musl/src/network
Rich Felker e8a0b27a71 improve SOCK_NONBLOCK/SOCK_CLOEXEC fallback code
checking for EINVAL should be sufficient, but qemu user emulation
returns EPROTONOSUPPORT in some of the failure cases, and it seems
conceivable that other kernels doing linux-emulation could make the
same mistake. since DNS lookups and other important code might break
if the fallback does not get invoked, be extra careful and check for
either error.

note that it's important NOT to perform the fallback code on other
errors such as resource-exhaustion cases, since the fallback is not
atomic and will lead to file-descriptor leaks in multi-threaded
programs that use exec. the fallback code is only "safe" to run when
the initial failure is caused by the application's choice of
arguments, not the system state.
2012-11-05 14:30:15 -05:00
..
__dns.c fix some more O_CLOEXEC/SOCK_CLOEXEC issues 2012-09-29 17:59:50 -04:00
__dns.h initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
__ipparse.c ipv6 parsing code (formerly dummied-out) 2011-04-25 17:04:40 -04:00
accept.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
accept4.c move accept4, dup3, and pipe2 to non-linux-specific locations 2012-09-29 17:40:42 -04:00
bind.c cleanup socketcall syscall interface to ease porting to sane(r) archs 2011-02-15 04:40:40 -05:00
connect.c overhaul pthread cancellation 2011-04-17 11:43:03 -04:00
dn_expand.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
ent.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
freeaddrinfo.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
gai_strerror.c fix wrong messages in gai_strerror 2011-08-01 00:31:15 -04:00
getaddrinfo.c fix getaddrinfo to accept port 0 (zero) 2012-09-22 16:19:06 -04:00
gethostbyaddr.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
gethostbyaddr_r.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
gethostbyname.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
gethostbyname2.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
gethostbyname2_r.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
gethostbyname_r.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
getnameinfo.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
getpeername.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
getservbyname.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
getservbyname_r.c make getservby*_r return error code rather than -1 (and using errno) 2012-07-22 18:49:49 -04:00
getservbyport.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
getservbyport_r.c make getservby*_r return error code rather than -1 (and using errno) 2012-07-22 18:49:49 -04:00
getsockname.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
getsockopt.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
h_errno.c fix misplaced semicolon in preprocessor directive (#undef h_errno) 2012-05-16 20:14:30 -04:00
hstrerror.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
htonl.c optimize ntohl etc. in terms of bswap functions 2011-04-12 13:13:27 -04:00
htons.c optimize ntohl etc. in terms of bswap functions 2011-04-12 13:13:27 -04:00
if_freenameindex.c implement if_nameindex and if_freenameindex 2011-08-03 12:13:13 -04:00
if_indextoname.c implement if_indextoname and if_nametoindex functions 2011-04-05 13:20:08 -04:00
if_nameindex.c fix logic error for skipping failed interfaces in if_nameindex 2012-07-21 17:56:48 -04:00
if_nametoindex.c implement if_indextoname and if_nametoindex functions 2011-04-05 13:20:08 -04:00
in6addr_any.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
in6addr_loopback.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
inet_addr.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
inet_aton.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
inet_ntoa.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
inet_ntop.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
inet_pton.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
listen.c cleanup socketcall syscall interface to ease porting to sane(r) archs 2011-02-15 04:40:40 -05:00
netname.c "implement" getnetbyaddr and getnetbyname 2011-07-12 02:52:06 -04:00
ntohl.c optimize ntohl etc. in terms of bswap functions 2011-04-12 13:13:27 -04:00
ntohs.c optimize ntohl etc. in terms of bswap functions 2011-04-12 13:13:27 -04:00
proto.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
recv.c cleanup socketcall syscall interface to ease porting to sane(r) archs 2011-02-15 04:40:40 -05:00
recvfrom.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
recvmsg.c overhaul pthread cancellation 2011-04-17 11:43:03 -04:00
res_init.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
res_query.c use __h_errno_location for h_errno 2012-05-12 23:45:07 -04:00
res_state.c add _res (__res_state()) dummy 2011-04-06 15:47:26 -04:00
send.c cleanup socketcall syscall interface to ease porting to sane(r) archs 2011-02-15 04:40:40 -05:00
sendmsg.c workaround another sendmsg kernel bug on 64-bit machines 2012-07-12 21:37:54 -04:00
sendto.c overhaul pthread cancellation 2011-04-17 11:43:03 -04:00
serv.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
setsockopt.c cleanup socketcall syscall interface to ease porting to sane(r) archs 2011-02-15 04:40:40 -05:00
shutdown.c cleanup socketcall syscall interface to ease porting to sane(r) archs 2011-02-15 04:40:40 -05:00
sockatmark.c cleanup socketcall syscall interface to ease porting to sane(r) archs 2011-02-15 04:40:40 -05:00
socket.c improve SOCK_NONBLOCK/SOCK_CLOEXEC fallback code 2012-11-05 14:30:15 -05:00
socketpair.c cleanup socketcall syscall interface to ease porting to sane(r) archs 2011-02-15 04:40:40 -05:00