Skip to content
Commit 2deb7793 authored by Adhemerval Zanella's avatar Adhemerval Zanella
Browse files

sysvipc: Fix semtimedop for Linux < 5.1 for 64-bit ABI



Both powerpc64 and s390x provides semtimedop through __NR_ipc for
pre v5.1 kernel.  Neither the y2038 support (7c437d37) nor the
attempt to fix an issue for !__ASSUME_DIRECT_SYSVIPC_SYSCALLS
(aaa12e9f) took this in consideration.

This patch fixes it by issuing __NR_semtimedop_time64 iff it is
defined, otherwise __NR_semtimeop is issued if both
__ASSUME_DIRECT_SYSVIPC_SYSCALLS it set and __NR_semtimedop is
define, other __NR_ipc is used instead.  To summarize:

  1. For 32-bit architetures __NR_semtimedop_time64 is always
     issued.  The fallback is used only for !__ASSUME_TIME64_SYSCALLS
     and it issues either __NR_ipc or __NR_semtimedop.

  2. For 64-bit architecture with wire-up SysV syscall
     (__ASSUME_DIRECT_SYSVIPC_SYSCALLS and __NR_semtimeop defined)
     __NR_semtimeop is issued.

  3. Otherwise __NR_ipc is used instead.

Checked on x86_64-linux-gnu, i686-linux-gnu (kernel 4.15 and 5.4),
powerpc64le (kernel 4.18), and s390x (kernel 4.12).

Reviewed-by: default avatarMatheus Castanho <msc@linux.ibm.com>
parent e75fbaaa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment