aboutsummaryrefslogtreecommitdiffstats
path: root/src/fd_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fd_util.h')
-rw-r--r--src/fd_util.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/fd_util.h b/src/fd_util.h
index b49a51373..80fb98703 100644
--- a/src/fd_util.h
+++ b/src/fd_util.h
@@ -39,6 +39,14 @@
#include <stdbool.h>
#include <stddef.h>
+#ifndef WIN32
+#if !defined(_GNU_SOURCE) && (defined(HAVE_PIPE2) || defined(HAVE_ACCEPT4))
+#define _GNU_SOURCE
+#endif
+
+#include <sys/types.h>
+#endif
+
struct sockaddr;
/**
@@ -91,6 +99,20 @@ int
accept_cloexec_nonblock(int fd, struct sockaddr *address,
size_t *address_length_r);
+
+#ifndef WIN32
+
+struct msghdr;
+
+/**
+ * Wrapper for recvmsg(), which sets the CLOEXEC flag (atomically if
+ * supported by the OS).
+ */
+ssize_t
+recvmsg_cloexec(int sockfd, struct msghdr *msg, int flags);
+
+#endif
+
/**
* Wrapper for inotify_init(), which sets the CLOEXEC flag (atomically
* if supported by the OS).