mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibCore: Add OpenBSD headers to System and LocalSocket
Add the correct header to System.h and add OpenBSD-specific handling of signals and socket process id
This commit is contained in:
parent
f650efc76f
commit
ea0a002468
Notes:
sideshowbarker
2024-07-17 21:59:49 +09:00
Author: https://github.com/tuftedocelot 🔰 Commit: https://github.com/SerenityOS/serenity/commit/ea0a0024681 Pull-request: https://github.com/SerenityOS/serenity/pull/11398 Reviewed-by: https://github.com/bgianfo ✅ Reviewed-by: https://github.com/linusg
3 changed files with 5 additions and 2 deletions
|
@ -65,6 +65,9 @@ pid_t LocalSocket::peer_pid() const
|
|||
#elif defined(__FreeBSD__)
|
||||
struct xucred creds = {};
|
||||
socklen_t creds_size = sizeof(creds);
|
||||
#elif defined(__OpenBSD__)
|
||||
struct sockpeercred creds = {};
|
||||
socklen_t creds_size = sizeof(creds);
|
||||
#else
|
||||
struct ucred creds = {};
|
||||
socklen_t creds_size = sizeof(creds);
|
||||
|
|
|
@ -131,7 +131,7 @@ ErrorOr<void> sigaction(int signal, struct sigaction const* action, struct sigac
|
|||
return {};
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
#if defined(__APPLE__) || defined(__OpenBSD__)
|
||||
ErrorOr<sig_t> signal(int signal, sig_t handler)
|
||||
#else
|
||||
ErrorOr<sighandler_t> signal(int signal, sighandler_t handler)
|
||||
|
|
|
@ -41,7 +41,7 @@ ErrorOr<int> accept4(int sockfd, struct sockaddr*, socklen_t*, int flags);
|
|||
#endif
|
||||
|
||||
ErrorOr<void> sigaction(int signal, struct sigaction const* action, struct sigaction* old_action);
|
||||
#ifdef __APPLE__
|
||||
#if defined(__APPLE__) || defined(__OpenBSD__)
|
||||
ErrorOr<sig_t> signal(int signal, sig_t handler);
|
||||
#else
|
||||
ErrorOr<sighandler_t> signal(int signal, sighandler_t handler);
|
||||
|
|
Loading…
Reference in a new issue