<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/124633>124633</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc] wrong function signature for setrlimit in generated sys/resource.h
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            libc
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          nickdesaulniers
      </td>
    </tr>
</table>

<pre>
    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:
```c
int setrlimit(const struct rlimit) __NOEXCEPT;
```
but `man 3 setrlimit` says it should be
```c
int setrlimit(int resource, const struct rlimit *rlp);
```

libc/include/sys/resource.yaml should be fixed, a la 6045146014151a8f63a60612445de9ff6af47626 (cc @alexprabhat99)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyclMlu5DYQhp-GuhTSoEpb66BD22MBA2QZjB0gN4MiSxITNtnh4uUyzx5QbtudcZAAIQiIkork97OKvwhBL5ZoYM0Vaz4VIsXV-cFq-YeiIJKxmnwoJqeeh6ukjdJ2AWmEXUDHQGYGsQhtQwRjHo4_GD1JmIU2AR51XFl1YHzrLT93fsiBDEejJ4bjbTqdnI8Mx1-tfmI4fvFu8eK401ay6lC2JasOFasOQN47nwfWwVFEuWaSOVkZtbMwOw9SGAPRAcMuUPRGH3Vk2DF-ACjbElh3DQAXv_Zff_z80-e7-6-3twyvgWHrGfasutqm5PYyhTU3384ta8ExBc9w1FaapIjhGJ4Dw9FTcMlL2mXdmKGbF95I-SmFVVqJSO_U1kV40GIyW4CnP5P2FKAE4Zd0JBsz1pQiIDySJzh596AVqRc-rDY-bePfREmX0xGiTzLC69ce7u9__uXmt-ubL3cfBW4S4dvH9l3q7lYdQAeYSIoUCOJKsJAlLyIpWEko8vC4caokCVYRtpg3wYqkEV5sYzefy-N1A8n44X-KuYTM58VafhQWqou1Wg5BPAfQEcLqklEw0X_tnt9fs5pT8Q80wPDgzemtbi5JcrHrSf5bqTyLo3nngVk_kco7CTACWl43Zd3ysi6bUuznthItb0us60ZRP8-tmOuuxRbyQUlgNReGnk5eTKuIfc-wL9RQqb7qRUFD2VV7XtYd1sU6EM3lpDpe91hP5dwRUi26Gfey2Tei5oUekGPDS-ywbJDXO9XwTnYl8r6bZppmVnM6Cm12-T7vnF8KHUKiocS6rarCiIlM2GwFcXFOwax9iLAFMUSG1wzx5XgwO48fNgeZ0hJYzY0OMbwvHXU0m0dtE5pP8Ojd5fXPJiZi8rQZwVsKQduL-vz-lhbJm2GN8RRyIeLIcFx0XNO0k25zqLNRZayTd7-TzD61CcgLnYU-DPhXAAAA___1U6yw">