1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:17:35 +00:00

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
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;