glibc/sysdeps/unix/sysv/linux/bits
Adhemerval Zanella ffd178c651 sysv: linux: Add 64-bit time_t variant for shmctl
To provide a y2038 safe interface a new symbol __shmctl64 is added
and __shmctl is change to call it instead (it adds some extra buffer
copying for the 32 bit time_t implementation).

Two new structures are added:

  1. kernel_shmid64_ds: used internally only on 32-bit architectures
     to issue the syscall.  A handful of architectures (hppa, i386,
     mips, powerpc32, and sparc32) require specific implementations
     due to their kernel ABI.

  2. shmid_ds64: this is only for __TIMESIZE != 64 to use along with
     the 64-bit shmctl.  It is different than the kernel struct because
     the exported 64-bit time_t might require different alignment
     depending on the architecture ABI.

So the resulting implementation does:

  1. For 64-bit architectures it assumes shmid_ds already contains
     64-bit time_t fields and will result in just the __shmctl symbol
     using the __shmctl64 code.  The shmid_ds argument is passed as-is
     to the syscall.

  2. For 32-bit architectures with default 64-bit time_t (newer ABIs
     such riscv32 or arc), it will also result in only one exported
     symbol but with the required high/low time handling.

  3. Finally for 32-bit architecture with both 32-bit and 64-bit time_t
     support we follow the already set way to provide one symbol with
     64-bit time_t support and implement the 32-bit time_t support
     using of the 64-bit one.

     The default 32-bit symbol will allocate and copy the shmid_ds
     over multiple buffers, but this should be deprecated in favor
     of the __shmctl64 anyway.

Checked on i686-linux-gnu and x86_64-linux-gnu.  I also did some sniff
tests on powerpc, powerpc64, mips, mips64, armhf, sparcv9, and
sparc64.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2020-07-09 12:05:47 -03:00
..
types sysv: linux: Add 64-bit time_t variant for shmctl 2020-07-09 12:05:47 -03:00
a.out.h Update. 2003-07-25 09:06:04 +00:00
dirent_ext.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dirent.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
epoll.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
errno.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
eventfd.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
fcntl-linux.h Rename RWF_WRITE_LIFE_NOT_SET to RWH_WRITE_LIFE_NOT_SET following Linux 5.5. 2020-02-12 13:37:16 +00:00
fcntl.h
in.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
initspin.h
inotify.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ioctl-types.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ioctls.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ipc-perm.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ipc.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
local_lim.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
mman-linux.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
mman-map-flags-generic.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
mman-shared.h Add MREMAP_DONTUNMAP from Linux 5.7 2020-06-23 14:42:45 +00:00
mman.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
mqueue.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
msq.h sysvipc: Split out linux struct semid_ds 2020-07-09 12:05:40 -03:00
param.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
poll.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
posix_opt.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
procfs-extra.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
procfs-id.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
procfs-prregset.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
procfs.h Unify some sys/procfs.h headers. 2018-09-25 16:48:15 +00:00
ptrace-shared.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
resource.h Use gcc -finput-charset=ascii for check-installed-headers. 2020-02-13 17:32:00 +01:00
rseq.h Linux: Perform rseq registration at C startup and thread creation 2020-07-06 10:21:16 +02:00
sched.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
sem.h semctl: Remove the sem-pad.h file 2020-04-29 08:29:30 -07:00
semaphore.h semaphore: consolidate arch headers into a generic one 2020-05-06 13:07:12 -07:00
shm.h sysvipc: Remove the linux shm-pad.h file 2020-07-09 12:05:46 -03:00
shmlba.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
sigaction.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
sigcontext.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
sigevent-consts.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +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 copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
signal_ext.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
signalfd.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
signum-arch.h signal: Add signum-{generic,arch}.h 2020-07-07 14:10:58 -03:00
sigstack.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
socket_type.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
socket-constants.h provide y2038 safe socket constants for default/asm-generic ABI 2020-04-19 13:34:32 -07:00
socket.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ss_flags.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
stat.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
statfs.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
statvfs.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
statx.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
termios-baud.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
termios-c_cc.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
termios-c_cflag.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
termios-c_iflag.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
termios-c_lflag.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
termios-c_oflag.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
termios-misc.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
termios-struct.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
termios-tcflow.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
termios.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
time.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
timerfd.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
timex.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
uio_lim.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
uio-ext.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
unistd_ext.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
utsname.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
waitflags.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00