summaryrefslogtreecommitdiff
path: root/lib/util/util.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-06-10 21:22:33 +0200
committerGünther Deschner <gd@samba.org>2009-06-10 21:25:57 +0200
commit27bb7ac5d1ae1b22954024d74c02d9ffdb283def (patch)
treeca56116dce299f41970203fb11e40c85d1260a0e /lib/util/util.c
parentdc5c7b7f98345621f4cf1b9992ebbe9144e14ebb (diff)
downloadsamba-27bb7ac5d1ae1b22954024d74c02d9ffdb283def.tar.gz
samba-27bb7ac5d1ae1b22954024d74c02d9ffdb283def.tar.bz2
samba-27bb7ac5d1ae1b22954024d74c02d9ffdb283def.zip
lib-util: move set_blocking() call into own file.
Guenther
Diffstat (limited to 'lib/util/util.c')
-rw-r--r--lib/util/util.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/util/util.c b/lib/util/util.c
index 0148bdb00d..29b47f5858 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -146,37 +146,6 @@ _PUBLIC_ bool directory_create_or_exist(const char *dname, uid_t uid,
/**
- Set a fd into blocking/nonblocking mode. Uses POSIX O_NONBLOCK if available,
- else
- if SYSV use O_NDELAY
- if BSD use FNDELAY
-**/
-
-_PUBLIC_ int set_blocking(int fd, bool set)
-{
- int val;
-#ifdef O_NONBLOCK
-#define FLAG_TO_SET O_NONBLOCK
-#else
-#ifdef SYSV
-#define FLAG_TO_SET O_NDELAY
-#else /* BSD */
-#define FLAG_TO_SET FNDELAY
-#endif
-#endif
-
- if((val = fcntl(fd, F_GETFL, 0)) == -1)
- return -1;
- if(set) /* Turn blocking on - ie. clear nonblock flag */
- val &= ~FLAG_TO_SET;
- else
- val |= FLAG_TO_SET;
- return fcntl( fd, F_SETFL, val);
-#undef FLAG_TO_SET
-}
-
-
-/**
Sleep for a specified number of milliseconds.
**/