glibc/socket
Mike Frysinger a277af22ea split assume pipe2/dup3/sock_cloexec knobs
We can't assume sock_cloexec and pipe2 are bound together as the former
defines are found in glibc only while the latter are a combo of kernel
headers and glibc.  So if we do a runtime detection of SOCK_CLOEXEC, but
pipe2() is a stub inside of glibc, we hit a problem.  For example:

main()
{
	getgrnam("portage");
	if (!popen("ls", "r"))
		perror("popen()");
}

getgrnam() will detect that the kernel supports SOCK_CLOEXEC and then set
both __have_sock_cloexec and __have_pipe2 to true.  But if glibc was built
against older kernel headers where __NR_pipe2 does not exist, glibc will
have a ENOSYS stub for it.  So popen() will always fail as glibc assumes
pipe2() works.

While this isn't too much of an issue for some arches as they added the
functionality to the kernel at the same time, not all arches are that
lucky.

Since the code already has dedicated names for each feature, delete the
defines wiring these three features together and make each one a proper
dedicated knob.

We've been carrying this in Gentoo since glibc-2.9.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-18 00:35:47 -04:00
..
bits Fix attributes for fortify functions. 2012-04-29 15:34:20 +02:00
sys Fix attributes for fortify functions. 2012-04-29 15:34:20 +02:00
Makefile Remove distribute variable from Makefiles 2012-03-07 05:17:13 -05:00
Versions * socket/sys/socket.h: Declare accept4. 2008-12-03 04:23:18 +00:00
accept.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
accept4.c Clean up stub accept4 definition. 2012-07-31 09:43:14 -07:00
bind.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
connect.c Remove use of INTDEF/INTUSE in socket 2012-05-31 00:34:41 +02:00
getpeername.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getsockname.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getsockopt.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
have_sock_cloexec.c split assume pipe2/dup3/sock_cloexec knobs 2012-08-18 00:35:47 -04:00
isfdtype.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
listen.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
opensock.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
recv.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
recvfrom.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
recvmsg.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
send.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
sendmsg.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
sendto.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
setsockopt.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
shutdown.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
sockatmark.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
socket.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
socketpair.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00