LibCore: Add a wrapper for endgrent()

This commit is contained in:
Lucas CHOLLET 2022-06-08 14:39:59 +02:00 committed by Andreas Kling
parent 348750a9f4
commit d288c700c7
Notes: sideshowbarker 2024-07-17 10:21:54 +09:00
2 changed files with 12 additions and 0 deletions

View file

@ -687,6 +687,17 @@ ErrorOr<off_t> lseek(int fd, off_t offset, int whence)
return rc;
}
ErrorOr<void> endgrent()
{
int old_errno = 0;
swap(old_errno, errno);
::endgrent();
if (errno != 0)
return Error::from_syscall("endgrent", -errno);
errno = old_errno;
return {};
}
ErrorOr<WaitPidResult> waitpid(pid_t waitee, int options)
{
int wstatus;

View file

@ -100,6 +100,7 @@ ErrorOr<void> clock_settime(clockid_t clock_id, struct timespec* ts);
ErrorOr<pid_t> posix_spawn(StringView path, posix_spawn_file_actions_t const* file_actions, posix_spawnattr_t const* attr, char* const arguments[], char* const envp[]);
ErrorOr<pid_t> posix_spawnp(StringView path, posix_spawn_file_actions_t* const file_actions, posix_spawnattr_t* const attr, char* const arguments[], char* const envp[]);
ErrorOr<off_t> lseek(int fd, off_t, int whence);
ErrorOr<void> endgrent();
struct WaitPidResult {
pid_t pid;