qmsk/net/libc.pxd
changeset 19 e6b670dbfe3b
parent 14 c44754cc1ffe
child 22 f6e8d5e37998
--- a/qmsk/net/libc.pxd	Mon Aug 17 01:03:40 2009 +0300
+++ b/qmsk/net/libc.pxd	Mon Aug 17 01:24:28 2009 +0300
@@ -41,6 +41,19 @@
 
     int close (int fd)
 
+cdef extern from "fcntl.h" :
+    int fcntl (int fd, int cmd, ...)
+
+    enum :
+        F_GETFL
+        F_SETFL
+
+    enum :
+        O_NONBLOCK
+
+# set a specific flag(s) to the given value
+cdef fcntl_set_flag (int fd, int flag, bint value)
+
 cdef extern from "alloca.h" :
     # XXX: this is unsafe because there is it may fail nastily for allocations that won't fit on the stack - SIGSEGV
     void* alloca (size_t size)