Browse Source

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.
Gunnar Beutner 2 năm trước cách đây
mục cha
commit
400cc41176
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      Userland/Libraries/LibCore/Stream.cpp

+ 2 - 2
Userland/Libraries/LibCore/Stream.cpp

@@ -563,7 +563,7 @@ ErrorOr<int> 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<void> 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,