Comment 0 for bug 1993995

Revision history for this message
Daniel Tang (daniel-z-tg) wrote : glibc2.36 has a pidfd_open wrapper now

glibc2.36 shipping with Ubuntu 22.10 has pidfd_open and other pidfd_* support. manpages-dev still reports "Note: glibc provides no wrapper for pidfd_open(), necessitating the use of syscall(2)" and recommends the less ideal `int syscall(SYS_pidfd_open [...]`. This is false, outdated, and misleading.

This is a new behaviour this August 2022 according to https://lists.gnu.org/archive/html/info-gnu/2022-08/msg00000.html . This bug also exists in the upstream code at https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/man2/pidfd_open.2?h=man-pages-6.01#n20 .

$ lsb_release -rd
Description: Ubuntu 22.10
Release: 22.10

$ apt-cache policy manpages-dev
manpages-dev:
  Installed: 5.13-1
  Candidate: 5.13-1
  Version table:
 *** 5.13-1 500
        500 https://gpl.savoirfairelinux.net/pub/mirrors/ubuntu kinetic/main amd64 Packages
        500 https://gpl.savoirfairelinux.net/pub/mirrors/ubuntu kinetic/main i386 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy libc6
libc6:
  Installed: 2.36-0ubuntu4
  Candidate: 2.36-0ubuntu4
  Version table:
 *** 2.36-0ubuntu4 500
        500 https://gpl.savoirfairelinux.net/pub/mirrors/ubuntu kinetic/main amd64 Packages
        100 /var/lib/dpkg/status

# Expected behaviour

The function exists from `#include <sys/pidfd.h>`. It should recommend something like the line there with ```extern int pidfd_open (__pid_t __pid, unsigned int __flags) __THROW;```.

$ readelf -Ws /lib/x86_64-linux-gnu/libc.so.6 | grep pidfd_open
  1425: 000000000011fbe0 37 FUNC GLOBAL DEFAULT 16 pidfd_open@@GLIBC_2.36

# Actual behaviour

$ zcat /usr/share/man/man2/pidfd_open.2.gz | grep glibc
glibc provides no wrapper for