void Socket::platform_init()
{
*priv->event = priv->handle;
+ set_inherit(false);
}
void Socket::platform_cleanup()
void Socket::Private::set_block(bool b)
{
int flags = fcntl(handle, F_GETFL);
- fcntl(handle, F_SETFL, (flags&O_NONBLOCK)|(b?0:O_NONBLOCK));
+ fcntl(handle, F_SETFL, (flags&~O_NONBLOCK)|(b?0:O_NONBLOCK));
+}
+
+void Socket::Private::set_inherit(bool i)
+{
+ int flags = fcntl(handle, F_GETFD);
+ fcntl(handle, F_SETFD, (flags&~O_CLOEXEC)|(i?O_CLOEXEC:0));
}
int Socket::Private::set_option(int level, int optname, const void *optval, socklen_t optlen)