[PATCH v2 00/25] Linux 7.2/7.3 updates and new system call wrappers

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Nov 10 15:09:44 GMT 2026


This series add the usual header updates for the kernel releases since
the last sync (Linux 7.2 and 7.3), and wrappers for system calls that
are currently only available through syscall.

Patches from 1 to 11 are the Linux 7.2/7.3 sync:

  - Patch 1 updates the syscall lists.  Linux 7.3 adds fchroot, and
    Linux 7.2 adds no new system call.

  - Patch 2 adds the fallback definition of EFTYPE (Linux 7.2), which
    openat2 returns with OPENAT2_REGULAR.  errlist.h already has an
    EFTYPE entry for Hurd, so without the fallback strerror (EFTYPE)
    would depend on the kernel headers used to build glibc.

  - Patch 3 adds OPENAT2_REGULAR (Linux 7.2) to bits/openat2.h, and
    patch 4 adds O_EMPTYPATH (Linux 7.2) and FD_FAILFS_ROOT (Linux 7.3)
    to bits/fcntl-linux.h.  The manual documents both new flags.

  - Patches 5 and 6 add the new AArch64 HWCAP3 bits (Linux 7.2) and the
    powerpc PPC_FEATURE2_ARCH_3_2 and PPC_FEATURE2_DMF bits (Linux 7.3).

  - Patches 7 to 9 add definitions from earlier releases that the
    previous syncs missed: the TCP_AO_* (Linux 6.7) and TCP_IS_MPTCP
    (Linux 6.10) socket options to netinet/tcp.h, which already has the
    TCP-AO structures; PTRACE_SET_SYSCALL_INFO (Linux 6.16) to
    sys/ptrace.h, along with the new reserved and flags fields of struct
    __ptrace_syscall_info; and FD_INVALID (Linux 6.17) to
    bits/fcntl-linux.h.

  - Patches 10 and 11 update the header constant tests and
    build-many-glibcs.py to Linux 7.3.

Linux 7.3 also drops PER_HPUX from <linux/personality.h>, which glibc
keeps in <sys/personality.h> for compatibility.  The new
SO_RIGHTS_NOTRUNC socket option comes from <asm/socket.h>, so it needs
no change.

This patchset also improves the syscall wrappers support, following the
priority list from Carlos and Florian presentation at Linux Plumbers [1].
Patches 12-25 add wrappers for system calls that are neither provided
by a dedicated library nor tied to state owned by glibc.

  - membarrier (Linux 4.3), in the new <sys/membarrier.h> (patch 12).
    It uses the three-argument signature, which has been stable since
    Linux 5.10 added the cpu_id argument (the change Florian mentioned
    at LPC).  Florian, if you prefer to finish your version, I can drop
    this one.

  - fchroot (Linux 7.3), patch 13.

  - open_tree_attr (Linux 6.15), statmount and listmount (Linux 6.8),
    in <sys/mount.h> (patches 14 and 15).

  - setxattrat, getxattrat, listxattrat, and removexattrat (Linux 6.13),
    in <sys/xattr.h> (patch 16).

  - file_getattr and file_setattr (Linux 6.17), in the new
    <sys/file_attr.h> (patch 17).

  - quotactl_fd (Linux 5.14), in <sys/quota.h> (patch 18).

  - memfd_secret (Linux 5.14), in <sys/mman.h> (patch 19).

  - ioprio_get and ioprio_set (Linux 2.6.13), in the new <sys/ioprio.h>
    (patch 20).

  - listns (Linux 6.19), in the new <sys/nsfs.h> (patch 21).

  - cachestat (Linux 6.5), in <sys/mman.h> (patch 22).

  - futex_wait, futex_timedwait, futex_wake, and futex_requeue, which
    wrap the futex system call, and futex_waitv (Linux 5.16), in the new
    <sys/futex.h> (patches 23 to 25).  These were posted separately [2],
    and this series replaces that one.  Patch 23 renames the internal
    futex functions, so they do not clash with the new public ones.

Two points deserve attention in the review:

  - The header names:  <sys/ioprio.h> matches the shim systemd ships
    for these functions, and <sys/nsfs.h> is named after <linux/nsfs.h>.
    The <sys/membarrier.h> and <sys/file_attr.h> are my choice.

  - With _GNU_SOURCE, <sys/mman.h> now includes <linux/mman.h> if it is
    available (patch 22).  The kernel header defines the cachestat
    structures without any macro to check for them, and it is included
    along with <sys/mman.h> in either order, so it is the only way to
    avoid redefinitions.

Checked on x86_64-linux-gnu and i686-linux-gnu.  The series was also
checked (check-abi, the installed header checks, and the new tests) on
aarch64, alpha, arm, hppa, loongarch64, mips (o32, n32, and n64),
powerpc, powerpc64, powerpc64le, riscv64, and s390x.  Some of those
kernels are too old for the newest system calls, so the related tests
are UNSUPPORTED there; fchroot only ran on x86, with Linux 7.4-rc1.  On
x86_64 it was also checked with the Fedora container of the Sourceware
builders, using the default Docker seccomp profile.

Changes from v1:

  - Added the <sys/futex.h> wrappers (patches 23 to 25), which replace
    the separate futex series [2], with the review fixes applied.

  - Dropped kcmp.

  - Patches 2 to 4: manual fixes from the review (EFTYPE,
    OPENAT2_REGULAR, and O_EMPTYPATH).

  - Patches 15 and 21: include <sys/types.h> instead of defining
    ssize_t.

  - Patch 16: use the struct xattr_args from <linux/xattr.h> if
    <linux/libc-compat.h> was included first.

  - Patch 19: documented memfd_secret in the manual.

  - Tests:
      - work with older kernels, btrfs, qemu-user, and containers
        (overlayfs TMPDIR; seccomp EPERM is reported as UNSUPPORTED);
      - tst-membarrier now checks MEMBARRIER_CMD_SHARED;
      - tst-cachestat no longer casts between structure types.

[1] https://lwn.net/Articles/1101647/
[2] https://patchwork.sourceware.org/project/glibc/list/?series=65564

Adhemerval Zanella (25):
  Update syscall lists for Linux 7.3
  Add EFTYPE from Linux 7.2 to bits/errno.h
  Add OPENAT2_REGULAR from Linux 7.2 to bits/openat2.h
  Add new constants from Linux 7.2 and 7.3 to bits/fcntl-linux.h
  Add new AArch64 HWCAP3 definitions from Linux 7.2 to bits/hwcap.h
  powerpc: Add new HWCAP2 definitions from Linux 7.3
  Add TCP_AO_* and TCP_IS_MPTCP from Linux 6.7 and 6.10 to netinet/tcp.h
  Add PTRACE_SET_SYSCALL_INFO from Linux 6.16 to sys/ptrace.h
  Add FD_INVALID from Linux 6.17 to bits/fcntl-linux.h
  Update kernel version to 7.3 in header constant tests
  Use Linux 7.3 in build-many-glibcs.py
  linux: Add membarrier
  linux: Add fchroot
  linux: Add open_tree_attr
  linux: Add statmount and listmount
  linux: Add setxattrat, getxattrat, listxattrat, and removexattrat
  linux: Add file_getattr and file_setattr
  linux: Add quotactl_fd
  linux: Add memfd_secret
  linux: Add ioprio_get and ioprio_set
  linux: Add listns
  linux: Add cachestat
  nptl: Add __ prefix to the futex-internal.h functions
  linux: Add futex_wait, futex_timedwait, futex_wake, and futex_requeue
  linux: Add futex_waitv

 NEWS                                          |  59 ++++
 bits/xattr_ext.h                              |  21 ++
 include/sys/futex.h                           |  32 ++
 manual/errno.texi                             |   3 -
 manual/filesys.texi                           |   3 +-
 manual/llio.texi                              |  74 ++++
 manual/threads.texi                           | 325 ++++++++++++++++++
 misc/Makefile                                 |   1 +
 misc/sys/xattr.h                              |   3 +
 nptl/futex-internal.c                         |  36 +-
 nptl/lowlevellock.c                           |   4 +-
 nptl/nptl_setxid.c                            |  12 +-
 nptl/pthread_barrier_destroy.c                |   2 +-
 nptl/pthread_barrier_wait.c                   |   8 +-
 nptl/pthread_clockjoin.c                      |   2 +-
 nptl/pthread_cond_broadcast.c                 |   4 +-
 nptl/pthread_cond_common.c                    |   4 +-
 nptl/pthread_cond_destroy.c                   |   2 +-
 nptl/pthread_cond_signal.c                    |   2 +-
 nptl/pthread_cond_wait.c                      |   6 +-
 nptl/pthread_create.c                         |   8 +-
 nptl/pthread_join_common.c                    |   2 +-
 nptl/pthread_mutex_init.c                     |   2 +-
 nptl/pthread_mutex_lock.c                     |   9 +-
 nptl/pthread_mutex_setprioceiling.c           |   7 +-
 nptl/pthread_mutex_timedlock.c                |   7 +-
 nptl/pthread_mutex_trylock.c                  |   7 +-
 nptl/pthread_mutex_unlock.c                   |   6 +-
 nptl/pthread_once.c                           |   8 +-
 nptl/pthread_rwlock_common.c                  |  27 +-
 nptl/pthread_rwlock_tryrdlock.c               |   2 +-
 nptl/sem_clockwait.c                          |   2 +-
 nptl/sem_post.c                               |   7 +-
 nptl/sem_waitcommon.c                         |   2 +-
 scripts/build-many-glibcs.py                  |   2 +-
 sysdeps/gnu/errlist.h                         |   5 +-
 sysdeps/gnu/netinet/tcp.h                     |   6 +
 sysdeps/nptl/aio_misc.h                       |   3 +-
 sysdeps/nptl/dl-thread_gscope_wait.c          |   4 +-
 sysdeps/nptl/futex-internal.h                 |  80 +++--
 sysdeps/nptl/gai_misc.h                       |   3 +-
 sysdeps/nptl/libc_start_call_main.h           |   2 +-
 sysdeps/nptl/lowlevellock-futex.h             |  12 +
 sysdeps/powerpc/bits/hwcap.h                  |   2 +
 sysdeps/pthread/tst-rwlock-tryrdlock-stall.c  |   2 +-
 sysdeps/unix/sysv/linux/Makefile              |  35 ++
 sysdeps/unix/sysv/linux/Versions              |  27 ++
 .../unix/sysv/linux/aarch64/arch-syscall.h    |   1 +
 sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h  |   8 +
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  22 ++
 sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h  |   7 +-
 sysdeps/unix/sysv/linux/alpha/arch-syscall.h  |   1 +
 sysdeps/unix/sysv/linux/alpha/bits/errno.h    |   4 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |  22 ++
 sysdeps/unix/sysv/linux/arc/arch-syscall.h    |   1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist      |  22 ++
 sysdeps/unix/sysv/linux/arm/arch-syscall.h    |   1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  23 ++
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  23 ++
 sysdeps/unix/sysv/linux/arm/sys/ptrace.h      |   6 +-
 sysdeps/unix/sysv/linux/bits/errno.h          |   4 +
 sysdeps/unix/sysv/linux/bits/fcntl-linux.h    |   6 +
 sysdeps/unix/sysv/linux/bits/mman-shared.h    |   5 +
 sysdeps/unix/sysv/linux/bits/mman_ext.h       |  37 ++
 sysdeps/unix/sysv/linux/bits/openat2.h        |   6 +
 sysdeps/unix/sysv/linux/bits/ptrace-shared.h  |   7 +-
 sysdeps/unix/sysv/linux/bits/unistd_ext.h     |   6 +
 sysdeps/unix/sysv/linux/bits/xattr_ext.h      |  70 ++++
 sysdeps/unix/sysv/linux/csky/arch-syscall.h   |   1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  23 ++
 sysdeps/unix/sysv/linux/futex_requeue.c       |  35 ++
 sysdeps/unix/sysv/linux/futex_timedwait.c     |  55 +++
 sysdeps/unix/sysv/linux/futex_wait.c          |  36 ++
 sysdeps/unix/sysv/linux/futex_waitv.c         |  35 ++
 sysdeps/unix/sysv/linux/futex_wake.c          |  38 ++
 sysdeps/unix/sysv/linux/hppa/arch-syscall.h   |   1 +
 sysdeps/unix/sysv/linux/hppa/bits/errno.h     |   4 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  23 ++
 sysdeps/unix/sysv/linux/i386/arch-syscall.h   |   1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  23 ++
 .../sysv/linux/loongarch/ilp32/arch-syscall.h |   1 +
 .../sysv/linux/loongarch/ilp32/libc.abilist   |  22 ++
 .../sysv/linux/loongarch/lp64/arch-syscall.h  |   1 +
 .../sysv/linux/loongarch/lp64/libc.abilist    |  22 ++
 sysdeps/unix/sysv/linux/m68k/arch-syscall.h   |   1 +
 .../sysv/linux/m68k/coldfire/libc.abilist     |  23 ++
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  23 ++
 sysdeps/unix/sysv/linux/memfd_secret.c        |  34 ++
 .../unix/sysv/linux/microblaze/arch-syscall.h |   1 +
 .../sysv/linux/microblaze/be/libc.abilist     |  23 ++
 .../sysv/linux/microblaze/le/libc.abilist     |  23 ++
 sysdeps/unix/sysv/linux/mips/bits/errno.h     |   4 +
 .../sysv/linux/mips/mips32/arch-syscall.h     |   1 +
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  23 ++
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  23 ++
 .../sysv/linux/mips/mips64/n32/arch-syscall.h |   1 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  23 ++
 .../sysv/linux/mips/mips64/n64/arch-syscall.h |   1 +
 .../sysv/linux/mips/mips64/n64/libc.abilist   |  22 ++
 sysdeps/unix/sysv/linux/or1k/arch-syscall.h   |   1 +
 sysdeps/unix/sysv/linux/or1k/libc.abilist     |  22 ++
 .../unix/sysv/linux/powerpc/dl-hwcap-info.c   |   4 +
 .../linux/powerpc/powerpc32/arch-syscall.h    |   1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  23 ++
 .../powerpc/powerpc32/nofpu/libc.abilist      |  23 ++
 .../linux/powerpc/powerpc64/arch-syscall.h    |   1 +
 .../linux/powerpc/powerpc64/be/libc.abilist   |  22 ++
 .../linux/powerpc/powerpc64/le/libc.abilist   |  22 ++
 sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h  |   7 +-
 .../unix/sysv/linux/riscv/rv32/arch-syscall.h |   1 +
 .../unix/sysv/linux/riscv/rv32/libc.abilist   |  22 ++
 .../unix/sysv/linux/riscv/rv64/arch-syscall.h |   1 +
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |  22 ++
 sysdeps/unix/sysv/linux/s390/arch-syscall.h   |   1 +
 sysdeps/unix/sysv/linux/s390/libc.abilist     |  22 ++
 sysdeps/unix/sysv/linux/s390/sys/ptrace.h     |   5 +
 sysdeps/unix/sysv/linux/sh/arch-syscall.h     |   1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  23 ++
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  23 ++
 sysdeps/unix/sysv/linux/sparc/bits/errno.h    |   4 +
 .../sysv/linux/sparc/sparc32/arch-syscall.h   |   1 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |  23 ++
 .../sysv/linux/sparc/sparc64/arch-syscall.h   |   1 +
 .../sysv/linux/sparc/sparc64/libc.abilist     |  22 ++
 sysdeps/unix/sysv/linux/sparc/sys/ptrace.h    |   6 +-
 sysdeps/unix/sysv/linux/sys/file_attr.h       |  92 +++++
 sysdeps/unix/sysv/linux/sys/futex.h           | 135 ++++++++
 sysdeps/unix/sysv/linux/sys/ioprio.h          |  85 +++++
 sysdeps/unix/sysv/linux/sys/membarrier.h      |  69 ++++
 sysdeps/unix/sysv/linux/sys/mount.h           | 115 +++++++
 sysdeps/unix/sysv/linux/sys/nsfs.h            |  69 ++++
 sysdeps/unix/sysv/linux/sys/ptrace.h          |   6 +-
 sysdeps/unix/sysv/linux/sys/quota.h           |   4 +
 sysdeps/unix/sysv/linux/syscall-names.list    |   5 +-
 sysdeps/unix/sysv/linux/syscalls.list         |  16 +
 sysdeps/unix/sysv/linux/tst-cachestat.c       | 182 ++++++++++
 sysdeps/unix/sysv/linux/tst-fchroot.c         | 115 +++++++
 sysdeps/unix/sysv/linux/tst-file_attr.c       |  91 +++++
 sysdeps/unix/sysv/linux/tst-futex-consts.py   |  71 ++++
 sysdeps/unix/sysv/linux/tst-futex-time64.c    |   1 +
 .../unix/sysv/linux/tst-futex-waitv-time64.c  |   1 +
 sysdeps/unix/sysv/linux/tst-futex-waitv.c     | 200 +++++++++++
 sysdeps/unix/sysv/linux/tst-futex.c           | 186 ++++++++++
 sysdeps/unix/sysv/linux/tst-ioprio.c          |  57 +++
 sysdeps/unix/sysv/linux/tst-listns.c          | 243 +++++++++++++
 sysdeps/unix/sysv/linux/tst-membarrier.c      | 150 ++++++++
 sysdeps/unix/sysv/linux/tst-memfd_secret.c    |  67 ++++
 sysdeps/unix/sysv/linux/tst-mman-consts.py    |   2 +-
 sysdeps/unix/sysv/linux/tst-mount-consts.py   |  10 +-
 sysdeps/unix/sysv/linux/tst-mount.c           |  30 ++
 sysdeps/unix/sysv/linux/tst-openat2-consts.py |   6 +-
 sysdeps/unix/sysv/linux/tst-openat2.c         |  86 +++++
 sysdeps/unix/sysv/linux/tst-pidfd-consts.py   |   2 +-
 sysdeps/unix/sysv/linux/tst-quotactl_fd.c     |  53 +++
 sysdeps/unix/sysv/linux/tst-sched-consts.py   |   2 +-
 sysdeps/unix/sysv/linux/tst-statmount.c       | 162 +++++++++
 sysdeps/unix/sysv/linux/tst-xattrat.c         | 154 +++++++++
 sysdeps/unix/sysv/linux/x86/sys/ptrace.h      |   6 +-
 .../unix/sysv/linux/x86_64/64/arch-syscall.h  |   1 +
 .../unix/sysv/linux/x86_64/64/libc.abilist    |  22 ++
 .../unix/sysv/linux/x86_64/x32/arch-syscall.h |   1 +
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |  22 ++
 162 files changed, 4399 insertions(+), 135 deletions(-)
 create mode 100644 bits/xattr_ext.h
 create mode 100644 include/sys/futex.h
 create mode 100644 sysdeps/unix/sysv/linux/bits/xattr_ext.h
 create mode 100644 sysdeps/unix/sysv/linux/futex_requeue.c
 create mode 100644 sysdeps/unix/sysv/linux/futex_timedwait.c
 create mode 100644 sysdeps/unix/sysv/linux/futex_wait.c
 create mode 100644 sysdeps/unix/sysv/linux/futex_waitv.c
 create mode 100644 sysdeps/unix/sysv/linux/futex_wake.c
 create mode 100644 sysdeps/unix/sysv/linux/memfd_secret.c
 create mode 100644 sysdeps/unix/sysv/linux/sys/file_attr.h
 create mode 100644 sysdeps/unix/sysv/linux/sys/futex.h
 create mode 100644 sysdeps/unix/sysv/linux/sys/ioprio.h
 create mode 100644 sysdeps/unix/sysv/linux/sys/membarrier.h
 create mode 100644 sysdeps/unix/sysv/linux/sys/nsfs.h
 create mode 100644 sysdeps/unix/sysv/linux/tst-cachestat.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-fchroot.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-file_attr.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-futex-consts.py
 create mode 100644 sysdeps/unix/sysv/linux/tst-futex-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-futex-waitv-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-futex-waitv.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-futex.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-ioprio.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-listns.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-membarrier.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-memfd_secret.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-quotactl_fd.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-statmount.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-xattrat.c

-- 
2.53.0



More information about the Libc-alpha mailing list