diff --git a/src/ioslaves/file/fdreceiver.cpp b/src/ioslaves/file/fdreceiver.cpp
--- a/src/ioslaves/file/fdreceiver.cpp
+++ b/src/ioslaves/file/fdreceiver.cpp
@@ -18,9 +18,6 @@
License along with this library. If not, see .
***/
-#include
-#include
-
#include
#include "sharefd_p.h"
diff --git a/src/ioslaves/file/kauth/fdsender.cpp b/src/ioslaves/file/kauth/fdsender.cpp
--- a/src/ioslaves/file/kauth/fdsender.cpp
+++ b/src/ioslaves/file/kauth/fdsender.cpp
@@ -18,9 +18,6 @@
License along with this library. If not, see .
***/
-#include
-#include
-
#include "../sharefd_p.h"
#include "fdsender.h"
diff --git a/src/ioslaves/file/sharefd_p.h b/src/ioslaves/file/sharefd_p.h
--- a/src/ioslaves/file/sharefd_p.h
+++ b/src/ioslaves/file/sharefd_p.h
@@ -20,6 +20,14 @@
#include
#include
+#include
+#include
+
+// fix SOCK_NONBLOCK for e.g. macOS
+#ifndef SOCK_NONBLOCK
+#include
+#define SOCK_NONBLOCK O_NONBLOCK
+#endif
class SocketAddress
{