Skip to content

[libc][sys/resource] wrong function signature for setrlimit in generated sys/resource.h #124633

Closed
@nickdesaulniers

Description

@nickdesaulniers

Building clang itself against llvm-libc fails with:

llvm/lib/Support/Unix/Program.inc:161:3: error: no matching function for call to 'setrlimit'
  161 |   setrlimit(RLIMIT_RSS, &r);
      |   ^~~~~~~~~
/usr/include/sys/resource.h:23:5: note: candidate function not viable: requires 1 argument, but 2 were provided
   23 | int setrlimit(const struct rlimit) __NOEXCEPT;
      |     ^         ~~~~~~~~~~~~~~~~~~~

This is because the generated header we produce has the function declaration of:

int setrlimit(const struct rlimit) __NOEXCEPT;

but man 3 setrlimit says it should be

int setrlimit(int resource, const struct rlimit *rlp);

libc/include/sys/resource.yaml should be fixed, a la 6045146 (cc @alexprabhat99)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions