public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* semtimedop, powerpc, time64 and older kernels
@ 2020-09-30 18:01 Matheus Castanho
  2020-09-30 18:29 ` Matheus Castanho
  0 siblings, 1 reply; 5+ messages in thread
From: Matheus Castanho @ 2020-09-30 18:01 UTC (permalink / raw)
  To: Adhemerval Zanella, GNU C Library

Hi Adhemerval,

sysvipc/test-sysvsem started failing on ppc64le on kernels older than
5.1 after:

commit aaa12e9ff02b32d5fbb2f367d7d6b6985a2176d6
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Sep 25 15:04:34 2020 -0300

    sysvipc: Fix semtimeop for !__ASSUME_DIRECT_SYSVIPC_SYSCALLS

    The __NR_ipc syscall does not support 64-bit time operations.  It
    fixes 7c437d3778.

    Checked on i686-linux-gnu on a Linux 5.4.

It fails with:
FAIL: sysvipc/test-sysvsem
original exit status 1
error: test-sysvsem.c:101: semop failed (errno=38)
error: 1 test failures

Looks like semtimedop was added on Linux 5.1, so it makes sense that
older kernels will fail with ENOSYS when calling that. So in such cases
should we also apply time convertion and fallback to semtimedop/ipc in
__semtimedop64 as done when !__ASSUME_DIRECT_SYSVIPC_SYSCALLS?

The patch below seems to solve the issue, at least on ppc64le.

Suggestions?

Thanks,
Matheus Castanho

--- 8< ---

diff --git a/sysdeps/unix/sysv/linux/semtimedop.c
b/sysdeps/unix/sysv/linux/semtimedop.c
index a9ad922ee2..510fea1852 100644
--- a/sysdeps/unix/sysv/linux/semtimedop.c
+++ b/sysdeps/unix/sysv/linux/semtimedop.c
@@ -32,7 +32,7 @@ __semtimedop64 (int semid, struct sembuf *sops, size_t
nsops,
   int r = INLINE_SYSCALL_CALL (semtimedop_time64, semid, sops, nsops,
                               timeout);

-#ifndef __ASSUME_TIME64_SYSCALLS
+#if !(defined __ASSUME_TIME64_SYSCALLS) || __LINUX_KERNEL_VERSION <
0x050100
   if (r == 0 || errno != ENOSYS)
     return r;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-30 20:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-30 18:01 semtimedop, powerpc, time64 and older kernels Matheus Castanho
2020-09-30 18:29 ` Matheus Castanho
2020-09-30 18:45   ` Andreas Schwab
2020-09-30 19:12   ` Adhemerval Zanella
2020-09-30 20:45     ` Matheus Castanho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).