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.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/fd_util.h b/src/fd_util.h
index dd4df7a13..e65c6a69b 100644
--- a/src/fd_util.h
+++ b/src/fd_util.h
@@ -51,6 +51,10 @@
struct sockaddr;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Wrapper for dup(), which sets the CLOEXEC flag on the new
* descriptor.
@@ -140,10 +144,25 @@ inotify_init_cloexec(void);
#endif
+#ifdef HAVE_EVENTFD
+
+/**
+ * Wrapper for eventfd() which sets the flags CLOEXEC and NONBLOCK
+ * flag (atomically if supported by the OS).
+ */
+int
+eventfd_cloexec_nonblock(unsigned initval, int flags);
+
+#endif
+
/**
* Portable wrapper for close(); use closesocket() on WIN32/WinSock.
*/
int
close_socket(int fd);
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif