diff options
author | Max Kellermann <max@duempel.org> | 2009-11-08 22:11:35 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-11-08 22:11:35 +0100 |
commit | f66edccffdc4a9276ae9dced69fa6fb74ee1f97e (patch) | |
tree | 3350b0852762cb393c12054e28c999532b4fd027 /src/fd_util.h | |
parent | b043ade456818a414c726c8525bb8ec63658edc8 (diff) | |
download | mpd-f66edccffdc4a9276ae9dced69fa6fb74ee1f97e.tar.gz mpd-f66edccffdc4a9276ae9dced69fa6fb74ee1f97e.tar.xz mpd-f66edccffdc4a9276ae9dced69fa6fb74ee1f97e.zip |
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.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/fd_util.h b/src/fd_util.h index 2dfc151f2..d9e811d51 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 |