glibc/include
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
..
arpa Add first fixes for conformtest for POSIX2008 2012-02-26 21:32:56 -05:00
bits Add first fixes for conformtest for POSIX2008 2012-02-26 21:32:56 -05:00
gnu Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
net First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
netinet First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
protocols
rpc Remove pre-ISO C support 2012-01-07 23:57:22 -05:00
rpcsvc * nis/nis_domain_of.c (__nis_domain_of): New function. 2007-04-19 14:28:01 +00:00
sys Split sys/param.h out into common file and sysdeps bits/param.h file. 2012-08-17 09:55:17 -07:00
aio.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
aliases.h Remove pre-ISO C support 2012-01-07 23:57:22 -05:00
alloca.h Account for alloca size rounding in extend_alloca 2011-11-01 18:29:34 +01:00
argp.h
argz.h Remove use of INTDEF/INTUSE in intl 2012-05-24 23:08:18 +02:00
assert.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
atomic.h Add explicit acquire/release semantics to atomic_exchange_and_add. 2012-08-13 19:31:00 -07:00
byteswap.h
caller.h Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
complex.h
ctype.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
des.h
dirent.h Declare __getdirentries in internal dirent.h. 2012-08-15 10:09:18 -07:00
dlfcn.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
elf.h
endian.h
envz.h
err.h
errno.h Remove support for !USE___THREAD 2011-09-10 16:50:28 -04:00
error.h
execinfo.h Remove pre-ISO C support 2012-01-07 23:57:22 -05:00
fcntl.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
features.h Release 2.16 2012-06-30 12:12:34 -07:00
fenv.h Remove pre-ISO C support 2012-01-07 23:57:22 -05:00
fnmatch.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
fpu_control.h
ftw.h
gconv.h
getopt_int.h Update. 2004-03-09 10:36:53 +00:00
getopt.h Update. 2004-03-09 10:36:53 +00:00
glob.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
gmp.h * include/gmp.h: Include/gmp-mparam.h. * stdlib/strtod.c: Include gmp-mparam.h before gmp.h and gmp-impl.h. 2003-03-14 05:48:18 +00:00
gnu-versions.h Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
grp.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
gshadow.h [BZ #9955] 2009-04-23 18:29:30 +00:00
iconv.h
ifaddrs.h Cache network interface information 2011-10-31 01:51:16 -04:00
inline-hashtab.h Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
langinfo.h Add first fixes for conformtest for POSIX2008 2012-02-26 21:32:56 -05:00
libc-internal.h * include/libc-internal.h: Declare __libc_thread_freeres. 2003-02-22 22:46:40 +00:00
libc-symbols.h Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
libgen.h
libintl.h Remove use of INTDEF/INTUSE in intl 2012-05-24 23:08:18 +02:00
libio.h Remove use of INTDEF/INTUSE in libio 2012-05-24 23:06:20 +02:00
limits.h Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
link.h Fix invalid memory access in do_lookup_x. 2012-06-22 11:10:31 -07:00
locale.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
malloc.h * malloc/malloc.c (_int_free): Second argument is now mchunkptr. 2009-02-07 22:01:49 +00:00
math.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
mcheck.h
memory.h
mntent.h Remove use of INTUSE/INTDEF in misc. 2012-05-31 13:10:02 +02:00
monetary.h Add first fixes for conformtest for POSIX2008 2012-02-26 21:32:56 -05:00
mqueue.h Update. 2004-04-13 02:15:43 +00:00
netdb.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
netgroup.h
nl_types.h
nss.h
nsswitch.h
obstack.h
poll.h
printf.h
pthread.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
pty.h Update. 2004-10-24 21:29:41 +00:00
pwd.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
regex.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
resolv.h Remove support for !USE___THREAD 2011-09-10 16:50:28 -04:00
sched.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
search.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
set-hooks.h Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
setjmp.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
sgtty.h
shadow.h Remove pre-ISO C support 2012-01-07 23:57:22 -05:00
shlib-compat.h Fix sunrpc static library 2012-05-21 21:34:54 +02:00
signal.h Remove use of INTDEF/INTUSE in stdio-common 2012-06-01 01:25:41 +02:00
spawn.h
stab.h
stap-probe.h Add --enable-systemtap configuration to define static probe points. 2012-05-25 13:40:20 -07:00
stdc-predef.h Update __STDC_ISO_10646__. 2012-05-16 18:49:30 +00:00
stdio_ext.h Remove use of INTDEF/INTUSE in libio 2012-05-24 23:06:20 +02:00
stdio.h Remove use of INTDEF/INTUSE in libio 2012-05-24 23:06:20 +02:00
stdlib.h Rename __secure_getenv to secure_getenv 2012-07-25 19:46:22 +02:00
string.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
strings.h
stropts.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
stub-tag.h [BZ #715] 2005-02-11 10:17:19 +00:00
stubs-prologue.h
syscall.h
sysexits.h
syslog.h
tar.h
termios.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
tgmath.h
time.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
ttyent.h
uchar.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
ucontext.h
ulimit.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
unistd.h split assume pipe2/dup3/sock_cloexec knobs 2012-08-18 00:35:47 -04:00
utime.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
utmp.h Remove pre-ISO C support 2012-01-07 23:57:22 -05:00
values.h Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
wchar.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
wctype.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
wordexp.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
xlocale.h