| Issue |
234694
|
| Summary |
[libc] Implement setresuid and setresgid in unistd
|
| Labels |
libc
|
| Assignees |
|
| Reporter |
amanmaurya92
|
### Summary
Implement the standard Linux / glibc functions `setresuid` and `setresgid` in `<unistd.h>`.
Linux man pages:
- setresuid(2): https://man7.org/linux/man-pages/man2/setresuid.2.html
### Background & Context
`setresuid` and `setresgid` set the real, effective, and saved user and group IDs of the calling process:
```c
int setresuid(uid_t ruid, uid_t euid, uid_t suid);
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
```
The underlying system call wrappers already exist internally in `libc/src/__support/OSUtil/linux/syscall_wrappers/`:
- `setresuid.h`
- `setresgid.h`
This is a natural companion to the recently merged `seteuid` and `setegid` (#233088).
### Scope
- Add public headers `libc/src/unistd/setresuid.h` and `libc/src/unistd/setresgid.h`.
- Implement `setresuid.cpp` and `setresgid.cpp` in `libc/src/unistd/linux/`.
- Add entries in `libc/include/unistd.yaml`.
- Register entrypoints across supported architectures in `entrypoints.txt`.
- Add integration/unit tests.
I would like to work on this issue.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs