about summary refs log tree commit diff
path: root/bits/signum.h
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2019-03-16 12:35:25 -0400
committerZack Weinberg <zackw@panix.com>2020-01-08 13:45:44 -0500
commitff9bae2f92e83e9655abd8b32021b0d6407ef560 (patch)
treeddc4a385d617790bab3f1ff899d77beb9e5a5036 /bits/signum.h
parent7e2c24ffcbb36f4c568da4d7c6b31f89b21613ab (diff)
downloadglibc-ff9bae2f92e83e9655abd8b32021b0d6407ef560.tar.gz
glibc-ff9bae2f92e83e9655abd8b32021b0d6407ef560.tar.xz
glibc-ff9bae2f92e83e9655abd8b32021b0d6407ef560.zip
Don’t include sys/select.h from sys/types.h.
This is supposedly present for BSD compatibility, but the current
generation of BSDs is not consistent about it: FreeBSD does, OpenBSD
doesn’t, NetBSD exposes only fd_set and the FD_* macros.  Programs
that need to wait for any of multiple I/O events have several
alternatives to select nowadays, so I think it makes sense to expose
select only to programs that specifically want it.

Only a few places within our own code are affected.  A few test
programs need to include sys/select.h explicitly, as does rpc/svc.h.
sysdeps/nptl/thread_db.h needs to declare sigset_t, and
sysdeps/unix/sysv/linux/pselect.c was including sys/poll.h instead of
sys/select.h, which is probably a copy-and-paste error.  sys/socket.h
needs to forward-declare struct timespec under __USE_GNU, because
recvmmsg has a struct timespec * argument; I’m open to the possibility
of having it fully declare struct timespec.

I considered taking sys/select.h out of sys/time.h as well, but POSIX
not only explicitly allows this inclusion, it requires sys/time.h to
declare almost everything that sys/select.h declares.  It doesn’t seem
worth creating another bits header just to prevent sys/time.h from
declaring pselect, sigset_t, and struct timespec.

Not including sys/select.h from sys/types.h means that sys/types.h
also no longer defines anything from sys/time.h, and a couple of files
were relying on that.  (pthread_join_common.c should be using
clock_gettime instead of gettimeofday, but that's out of scope for
this patch series.)

	* posix/sys/types.h: Don’t include sys/select.h.
	* scripts/check-obsolete-constructs.py: Remove whitelist entry
	for sys/types.h -> sys/select.h.  Adjust commentary re
	sys/time.h -> sys/select.h.

	* socket/sys/socket.h: When __USE_GNU, forward-declare struct timespec.
	* misc/tst-fdset.c, nptl/tst-cancel4.c, scripts/check-c++-types.sh
	* sunrpc/rpc/svc.h: Include sys/select.h.
	* sysdeps/nptl/thread_db.h: Include bits/types/sigset_t.h.
	* sysdeps/unix/sysv/linux/pselect.c: Include sys/select.h,
	not sys/poll.h.
	* nptl/pthread_join_common.c, sysdeps/unix/sysv/linux/dl-vdso.h:
	Include sys/time.h.
Diffstat (limited to 'bits/signum.h')
0 files changed, 0 insertions, 0 deletions