LibCore: Add Core::System wrapper for disown()
This commit is contained in:
parent
0badfd7b32
commit
ccb8374434
Notes:
sideshowbarker
2024-07-17 20:32:55 +09:00
Author: https://github.com/sppmacd Commit: https://github.com/SerenityOS/serenity/commit/ccb83744342 Pull-request: https://github.com/SerenityOS/serenity/pull/11488 Reviewed-by: https://github.com/awesomekling
2 changed files with 11 additions and 0 deletions
|
@ -20,6 +20,10 @@
|
|||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __serenity__
|
||||
# include <serenity.h>
|
||||
#endif
|
||||
|
||||
#define HANDLE_SYSCALL_RETURN_VALUE(syscall_name, rc, success_value) \
|
||||
if ((rc) < 0) { \
|
||||
return Error::from_syscall(syscall_name, rc); \
|
||||
|
@ -125,6 +129,12 @@ ErrorOr<long> ptrace(int request, pid_t tid, void* address, void* data)
|
|||
return Error::from_syscall("ptrace"sv, -errno);
|
||||
return rc;
|
||||
}
|
||||
|
||||
ErrorOr<void> disown(pid_t pid)
|
||||
{
|
||||
int rc = ::disown(pid);
|
||||
HANDLE_SYSCALL_RETURN_VALUE("disown", rc, {});
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef AK_OS_BSD_GENERIC
|
||||
|
|
|
@ -41,6 +41,7 @@ ErrorOr<void> ptrace_peekbuf(pid_t tid, void const* tracee_addr, Bytes destinati
|
|||
ErrorOr<void> setgroups(Span<gid_t const>);
|
||||
ErrorOr<void> mount(int source_fd, StringView target, StringView fs_type, int flags);
|
||||
ErrorOr<long> ptrace(int request, pid_t tid, void* address, void* data);
|
||||
ErrorOr<void> disown(pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifndef AK_OS_BSD_GENERIC
|
||||
|
|
Loading…
Add table
Reference in a new issue