]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/unix/handle.cpp
Use vectors for storage in Poller
[libs/core.git] / source / io / unix / handle.cpp
index ea8fa4eeb9797e12f5a598f4c63d0fe6e352d492..cbffa48e62a7354522a8d9efb8fcafe8f8c36c60 100644 (file)
@@ -8,16 +8,16 @@
 namespace Msp {
 namespace IO {
 
-Handle::operator const void *() const
+void sys_set_blocking(Handle &handle, bool b)
 {
-       return priv->handle!=-1 ? this : 0;
+       int flags = fcntl(*handle, F_GETFL);
+       fcntl(*handle, F_SETFL, (flags&~O_NONBLOCK)|(b?0:O_NONBLOCK));
 }
 
-
-void sys_set_blocking(Handle &handle, bool b)
+void sys_set_inherit(Handle &handle, bool i)
 {
        int flags = fcntl(*handle, F_GETFD);
-       fcntl(*handle, F_SETFL, (flags&~O_NONBLOCK)|(b?0:O_NONBLOCK));
+       fcntl(*handle, F_SETFD, (flags&~O_CLOEXEC)|(i?O_CLOEXEC:0));
 }
 
 unsigned sys_read(Handle &handle, char *buf, unsigned size)