mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
LibCore: Add waitpid() wrapper that return ErrorOr<pid_t>
This commit is contained in:
parent
123e49994d
commit
11578c623c
2 changed files with 10 additions and 0 deletions
|
@ -380,4 +380,12 @@ ErrorOr<pid_t> posix_spawnp(StringView const path, posix_spawn_file_actions_t* c
|
|||
return child_pid;
|
||||
}
|
||||
|
||||
ErrorOr<pid_t> waitpid(pid_t waitee, int* wstatus, int options)
|
||||
{
|
||||
pid_t pid = ::waitpid(waitee, wstatus, options);
|
||||
if (pid < 0)
|
||||
return Error::from_syscall("waitpid"sv, -errno);
|
||||
return pid;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue