diff options
Diffstat (limited to 'socket.c')
-rw-r--r-- | socket.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1094,6 +1094,12 @@ static val open_socket(val family, val type, val mode_str) { val self = lit("open-socket"); int fd = socket(c_num(family, self), c_num(type, self), 0); +#ifdef SOCK_NONBLOCK + type = logand(type, lognot(num_fast(SOCK_NONBLOCK), nil)); +#endif +#ifdef SOCK_CLOEXEC + type = logand(type, lognot(num_fast(SOCK_CLOEXEC), nil)); +#endif return open_sockfd(num(fd), family, type, mode_str, self); } @@ -1110,6 +1116,13 @@ static val socketpair_wrap(val family, val type, val mode_str) uw_throwf(socket_error_s, lit("~a failed: ~d/~s"), self, num(errno), errno_to_str(errno), nao); +#ifdef SOCK_NONBLOCK + type = logand(type, lognot(num_fast(SOCK_NONBLOCK), nil)); +#endif +#ifdef SOCK_CLOEXEC + type = logand(type, lognot(num_fast(SOCK_CLOEXEC), nil)); +#endif + { val s0 = open_sockfd(num(sv[0]), family, type, mode_str, self); val s1 = open_sockfd(num(sv[1]), family, type, mode_str, self); |