aboutsummaryrefslogtreecommitdiffstats
path: root/src/wayland-os.c
diff options
context:
space:
mode:
authorSébastien Marie <semarie@online.fr>2024-01-19 16:09:27 +0000
committerDaniel Stone <daniels@collabora.com>2024-02-21 15:46:41 +0000
commitd80bce5f1a0917c013aac54e3f951ffe740d0cbe (patch)
tree23e5acea8fc607c4e6dab825b529a352941d9aec /src/wayland-os.c
parentcompat: prefer waitpid() over waitid() (diff)
downloadwayland-d80bce5f1a0917c013aac54e3f951ffe740d0cbe.tar
wayland-d80bce5f1a0917c013aac54e3f951ffe740d0cbe.tar.gz
wayland-d80bce5f1a0917c013aac54e3f951ffe740d0cbe.tar.bz2
wayland-d80bce5f1a0917c013aac54e3f951ffe740d0cbe.tar.lz
wayland-d80bce5f1a0917c013aac54e3f951ffe740d0cbe.tar.xz
wayland-d80bce5f1a0917c013aac54e3f951ffe740d0cbe.tar.zst
wayland-d80bce5f1a0917c013aac54e3f951ffe740d0cbe.zip
build: fix build and provide compat for OpenBSD
- wayland-egl-abi-check: try to use llvm-nm first instead of BSD nm (incompatible options) - avoid forcing _POSIX_C_SOURCE=200809L (SOCK_CLOEXEC become available) - epoll(7) is provided by a userspace wrapper around kqueue(2) as FreeBSD - when using SO_PEERCRED, the struct to use is `struct sockpeercred` instead of `struct ucred` on OpenBSD - provide a compatibility layer for count_open_fds() using sysctl(2) as FreeBSD Signed-off-by: Sebastien Marie <semarie@online.fr>
Diffstat (limited to 'src/wayland-os.c')
-rw-r--r--src/wayland-os.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wayland-os.c b/src/wayland-os.c
index a0db2e8..f00ead4 100644
--- a/src/wayland-os.c
+++ b/src/wayland-os.c
@@ -111,7 +111,11 @@ int
wl_os_socket_peercred(int sockfd, uid_t *uid, gid_t *gid, pid_t *pid)
{
socklen_t len;
+#if defined(__OpenBSD__)
+ struct sockpeercred ucred;
+#else
struct ucred ucred;
+#endif
len = sizeof(ucred);
if (getsockopt(sockfd, SOL_SOCKET, SO_PEERCRED, &ucred, &len) < 0)