glibc/sysdeps/unix/sysv/linux/bits
Joseph Myers 729f34028a Use single bits/shm.h for all architectures.
After my patch to move SHMLBA to its own header, the bits/shm.h
headers for architectures using the Linux kernel still vary in a few
ways: the use of __syscall_ulong_t; whether padding for 32-bit systems
is present before or after time fields, or missing altogether (mips,
x32); whether shm_segsz is before or after the time fields; whether,
if after time fields, there is extra padding before shm_segsz.

This patch arranges for a single header to be used.  __syscall_ulong_t
is safe to use everywhere, while bits/shm-pad.h is added with new
macros __SHM_PAD_AFTER_TIME, __SHM_PAD_BEFORE_TIME,
__SHM_SEGSZ_AFTER_TIME and __SHM_PAD_BETWEEN_TIME_AND_SEGSZ to
describe the differences.

Tested for x86_64 and x86, and with build-many-glibcs.py.

	* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
	bits/shm-pad.h.
	* sysdeps/unix/sysv/linux/bits/shm.h: Include <bits/shm-pad.h>.
	(shmatt_t): Define as __syscall_ulong_t.
	(__SHM_PAD_TIME): New macro, depending on [__SHM_PAD_BEFORE_TIME]
	and [__SHM_PAD_AFTER_TIME].
	(struct shmid_ds): Define time fields using __SHM_PAD_TIME.
	Define shm_segsz and associated padding based on
	[__SHM_SEGSZ_AFTER_TIME] and [__SHM_PAD_BETWEEN_TIME_AND_SEGSZ].
	Use __syscall_ulong_t instead of unsigned long int.
	[__USE_MISC] (struct shminfo): Use __syscall_ulong_t instead of
	unsigned long int.
	[__USE_MISC] (struct shm_info): Likewise.
	* sysdeps/unix/sysv/linux/bits/shm-pad.h: New file.
	* sysdeps/unix/sysv/linux/hppa/bits/shm-pad.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/shm-pad.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/shm-pad.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/shm-pad.h: Likewise.
	* sysdeps/unix/sysv/linux/x86/bits/shm-pad.h: Likewise.
	* sysdeps/unix/sysv/linux/hppa/bits/shm.h: Remove.
	* sysdeps/unix/sysv/linux/mips/bits/shm.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/shm.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/shm.h: Likewise.
	* sysdeps/unix/sysv/linux/x86/bits/shm.h: Likewise.
2018-10-17 11:56:28 +00:00
..
types Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
a.out.h Update. 2003-07-25 09:06:04 +00:00
dirent.h Define _DIRENT_MATCHES_DIRENT64 regardless 2018-03-05 18:10:04 -03:00
epoll.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
errno.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
eventfd.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fcntl-linux.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fcntl.h Update. 2000-09-01 07:14:30 +00:00
in.h Add IPV6_FREEBIND from Linux 4.15. 2018-02-06 00:41:34 +00:00
initspin.h Update. 2000-10-15 06:50:42 +00:00
inotify.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
ioctl-types.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
ioctls.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
ipc.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
local_lim.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mman-linux.h Move MREMAP_* to bits/mman-shared.h. 2018-10-01 20:30:57 +00:00
mman-map-flags-generic.h Share MAP_* flags between more architectures. 2018-09-26 12:33:14 +00:00
mman-shared.h Move MREMAP_* to bits/mman-shared.h. 2018-10-01 20:30:57 +00:00
mman.h Share MAP_* flags between more architectures. 2018-09-26 12:33:14 +00:00
mqueue.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
msq-pad.h Use single bits/msq.h for all architectures. 2018-10-11 12:07:27 +00:00
msq.h Use single bits/msq.h for all architectures. 2018-10-11 12:07:27 +00:00
param.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
poll.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
posix_opt.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
procfs-extra.h Unify more sys/procfs.h headers. 2018-09-25 16:49:25 +00:00
procfs-id.h Unify more sys/procfs.h headers. 2018-09-25 16:49:25 +00:00
procfs-prregset.h Complete sys/procfs.h unification. 2018-09-25 16:50:30 +00:00
procfs.h Unify some sys/procfs.h headers. 2018-09-25 16:48:15 +00:00
ptrace-shared.h Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h. 2018-04-24 12:11:35 +00:00
resource.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sched.h hurd: Avoid exposing all <sched.h> symbols from sys/types.h 2018-04-19 20:24:36 +02:00
sem-pad.h Use single bits/sem.h for all architectures. 2018-10-15 19:28:04 +00:00
sem.h Use single bits/sem.h for all architectures. 2018-10-15 19:28:04 +00:00
shm-pad.h Use single bits/shm.h for all architectures. 2018-10-17 11:56:28 +00:00
shm.h Use single bits/shm.h for all architectures. 2018-10-17 11:56:28 +00:00
shmlba.h Move SHMLBA to its own header. 2018-10-17 11:55:10 +00:00
sigaction.h hurd: Fix includability of <hurd/signal.h> in all standards 2018-03-05 22:50:29 +01:00
sigcontext.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sigevent-consts.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
siginfo-arch.h Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
siginfo-consts-arch.h Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
siginfo-consts.h Update siginfo constants from Linux kernel (bug 21286). 2018-09-17 12:41:14 +00:00
signalfd.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
signum.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sigstack.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
socket_type.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
socket.h Add PF_XDP, AF_XDP and SOL_XDP from Linux 4.18 to bits/socket.h. 2018-08-21 17:22:53 +00:00
ss_flags.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
stat.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
statfs.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
statvfs.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sys_errlist.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sysctl.h Add sysctl.mk and bits/sysctl.h 2012-05-22 13:46:29 -07:00
termios.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
time.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
timerfd.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
timex.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
uio_lim.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
uio-ext.h Update RWF_SUPPORTED for Linux kernel 4.16 [BZ #22947] 2018-04-03 12:19:29 -07:00
utsname.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
waitflags.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00