diff options
41 files changed, 349 insertions, 1 deletions
@@ -126,6 +126,9 @@ Major new features: checks, this can help to ensure that proper diagnostics are printed if the dynamic loader runs on an incompatible CPU. +* On Linux, the epoll_pwait2 function has been added. It is similar to + epoll_wait with the difference the timeout has nanoseconds resolution. + Deprecated and removed features, and other changes affecting compatibility: * On x86-64, the LD_PREFER_MAP_32BIT_EXEC environment variable support diff --git a/include/sys/epoll.h b/include/sys/epoll.h index 86e0a54e62..8049381a26 100644 --- a/include/sys/epoll.h +++ b/include/sys/epoll.h @@ -4,6 +4,14 @@ # ifndef _ISOMAC libc_hidden_proto (epoll_pwait) +#if __TIMESIZE == 64 +# define __epoll_pwait2_time64 epoll_pwait2 +#else +extern int __epoll_pwait2_time64 (int fd, struct epoll_event *ev, int maxev, + const struct __timespec64 *tmo, + const sigset_t *s); +libc_hidden_proto (__epoll_pwait2_time64) +#endif # endif /* !_ISOMAC */ #endif diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 61acc1987d..85fc8cbf75 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -55,7 +55,7 @@ endif ifeq ($(subdir),misc) sysdep_routines += adjtimex clone umount umount2 readahead sysctl \ - setfsuid setfsgid epoll_pwait signalfd \ + setfsuid setfsgid epoll_pwait epoll_pwait2 signalfd \ eventfd eventfd_read eventfd_write prlimit prlimit64 \ personality epoll_wait tee vmsplice splice \ open_by_handle_at mlock2 pkey_mprotect pkey_set pkey_get \ @@ -125,6 +125,7 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-ntp_gettimex tst-sigtimedwait tst-misalign-clone \ tst-prctl \ tst-scm_rights \ + tst-epoll \ # tests # Test for the symbol version of fcntl that was replaced in glibc 2.28. @@ -146,6 +147,7 @@ endif tests-time64 += \ tst-adjtimex-time64 \ tst-clock_adjtime-time64 \ + tst-epoll-time64 \ tst-ntp_adjtime-time64 \ tst-ntp_gettime-time64 \ tst-ntp_gettimex-time64 \ diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 3f8809a158..ded087f30e 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -293,6 +293,12 @@ libc { %endif close_range; } + GLIBC_2.35 { +%ifdef TIME64_NON_DEFAULT + __epoll_pwait2_time64; +%endif + epoll_pwait2; + } GLIBC_PRIVATE { # functions used in other libraries __syscall_rt_sigqueueinfo; diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index fed942ed4b..c1a5ee90e6 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2614,3 +2614,4 @@ GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 2867932704..1a30d0666b 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2711,6 +2711,7 @@ GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index 239db7bab0..e5dfdab357 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index bc79dcfe8a..4d3fd87278 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -491,8 +491,10 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __epoll_pwait2_time64 F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0 diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 614607fd6b..009dc9da14 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -488,8 +488,10 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __epoll_pwait2_time64 F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0 diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index 2b61543f0d..df8da506cd 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2647,5 +2647,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __epoll_pwait2_time64 F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F diff --git a/sysdeps/unix/sysv/linux/epoll_pwait2.c b/sysdeps/unix/sysv/linux/epoll_pwait2.c new file mode 100644 index 0000000000..e38a1b2349 --- /dev/null +++ b/sysdeps/unix/sysv/linux/epoll_pwait2.c @@ -0,0 +1,44 @@ +/* Implementation of epoll_pwait2 syscall wrapper. + Copyright (C) 2022 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#include <sys/epoll.h> +#include <sysdep.h> + +int +__epoll_pwait2_time64 (int fd, struct epoll_event *ev, int maxev, + const struct __timespec64 *tmo, const sigset_t *s) +{ + /* The syscall only supports 64-bit time_t. */ + return SYSCALL_CANCEL (epoll_pwait2, fd, ev, maxev, tmo, s, __NSIG_BYTES); +} +#if __TIMESIZE != 64 +libc_hidden_def (__epoll_pwait2_time64) + +int +epoll_pwait2 (int fd, struct epoll_event *ev, int maxev, + const struct timespec *tmo, const sigset_t *s) +{ + struct __timespec64 tmo64, *ptmo64 = NULL; + if (tmo != NULL) + { + tmo64 = valid_timespec_to_timespec64 (*tmo); + ptmo64 = &tmo64; + } + return __epoll_pwait2_time64 (fd, ev, maxev, ptmo64, s); +} +#endif diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 6b3cb1adb4..7ea1b017d0 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2596,8 +2596,10 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __epoll_pwait2_time64 F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 7f608c1b64..99ccf354b3 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2780,8 +2780,10 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __epoll_pwait2_time64 F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index 865deec43f..201542d1e7 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -2549,6 +2549,7 @@ GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index a172d74632..32fd72a78d 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -492,8 +492,10 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __epoll_pwait2_time64 F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0x98 GLIBC_2.4 _IO_2_1_stdin_ D 0x98 diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 174e9c7739..d26f0ae6c2 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2723,8 +2723,10 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __epoll_pwait2_time64 F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index d042be1369..520ca0882d 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2696,5 +2696,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __epoll_pwait2_time64 F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index 332da62de2..9162c31396 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2693,5 +2693,7 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __epoll_pwait2_time64 F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 2d6ec0d0e8..656fdbdcaa 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2688,8 +2688,10 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __epoll_pwait2_time64 F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 6c5befa72b..5f0b90d318 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2686,8 +2686,10 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_2.35 __epoll_pwait2_time64 F GLIBC_2.35 __memcmpeq F GLIBC_2.35 _dl_find_object F +GLIBC_2.35 epoll_pwait2 F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F |
