mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 04:55:15 +00:00
LibCore: Add a wrapper for endgrent()
This commit is contained in:
parent
348750a9f4
commit
d288c700c7
Notes:
sideshowbarker
2024-07-17 10:21:54 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/d288c700c7 Pull-request: https://github.com/SerenityOS/serenity/pull/14222 Reviewed-by: https://github.com/petelliott ✅
2 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue