aboutsummaryrefslogtreecommitdiff
path: root/src/fd_util.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-08 22:11:35 +0100
committerMax Kellermann <max@duempel.org>2009-11-08 22:11:35 +0100
commitf66edccffdc4a9276ae9dced69fa6fb74ee1f97e (patch)
tree3350b0852762cb393c12054e28c999532b4fd027 /src/fd_util.h
parentb043ade456818a414c726c8525bb8ec63658edc8 (diff)
fd_util: added O_NONBLOCK functions
Changed the wrappers for pipe(), socket(), accept(). On WIN32, this does not work for pipe().
Diffstat (limited to 'src/fd_util.h')
-rw-r--r--src/fd_util.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/fd_util.h b/src/fd_util.h
index 2dfc151f..d9e811d5 100644
--- a/src/fd_util.h
+++ b/src/fd_util.h
@@ -49,23 +49,27 @@ creat_cloexec(const char *path_fs, int mode);
/**
* Wrapper for pipe(), which sets the CLOEXEC flag (atomically if
* supported by the OS).
+ *
+ * On systems that supports it (everybody except for Windows), it also
+ * sets the NONBLOCK flag.
*/
int
-pipe_cloexec(int fd[2]);
+pipe_cloexec_nonblock(int fd[2]);
/**
- * Wrapper for socket(), which sets the CLOEXEC flag (atomically if
- * supported by the OS).
+ * Wrapper for socket(), which sets the CLOEXEC and the NONBLOCK flag
+ * (atomically if supported by the OS).
*/
int
-socket_cloexec(int domain, int type, int protocol);
+socket_cloexec_nonblock(int domain, int type, int protocol);
/**
- * Wrapper for accept(), which sets the CLOEXEC flag (atomically if
- * supported by the OS).
+ * Wrapper for accept(), which sets the CLOEXEC and the NONBLOCK flags
+ * (atomically if supported by the OS).
*/
int
-accept_cloexec(int fd, struct sockaddr *address, size_t *address_length_r);
+accept_cloexec_nonblock(int fd, struct sockaddr *address,
+ size_t *address_length_r);
/**
* Wrapper for inotify_init(), which sets the CLOEXEC flag (atomically