From 400cc41176d62430b88267da627d0069986b2f0c Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 7 Oct 2022 18:41:22 +0200 Subject: [PATCH] LibCore: Make Core::System::{send,recv}fd work on macOS All the required bits were already there. Also, this would probably work on FreeBSD without modification but I don't currently have a system to test this on. --- Userland/Libraries/LibCore/Stream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibCore/Stream.cpp b/Userland/Libraries/LibCore/Stream.cpp index 9cda8a8bd08..74e7c1b4ed2 100644 --- a/Userland/Libraries/LibCore/Stream.cpp +++ b/Userland/Libraries/LibCore/Stream.cpp @@ -563,7 +563,7 @@ ErrorOr LocalSocket::receive_fd(int flags) { #if defined(AK_OS_SERENITY) return Core::System::recvfd(m_helper.fd(), flags); -#elif defined(AK_OS_LINUX) +#elif defined(AK_OS_LINUX) || defined(AK_OS_MACOS) union { struct cmsghdr cmsghdr; char control[CMSG_SPACE(sizeof(int))]; @@ -608,7 +608,7 @@ ErrorOr LocalSocket::send_fd(int fd) { #if defined(AK_OS_SERENITY) return Core::System::sendfd(m_helper.fd(), fd); -#elif defined(AK_OS_LINUX) +#elif defined(AK_OS_LINUX) || defined(AK_OS_MACOS) char c = 'F'; struct iovec iov { .iov_base = &c,