aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/Makefile
diff options
context:
space:
mode:
authorAdhemerval Zanella Netto <adhemerval.zanella@linaro.org>2023-08-24 13:42:19 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-09-05 13:08:59 -0300
commite7190fc73dbc8a1f8f94f8ccacd9a190fa5e609c (patch)
tree0070895e116c7250463b90b643f8727466bfbb5b /sysdeps/unix/sysv/linux/Makefile
parent0d6f9f626521678f330f8bfee89e1cdb7e2b1062 (diff)
downloadglibc-e7190fc73dbc8a1f8f94f8ccacd9a190fa5e609c.zip
glibc-e7190fc73dbc8a1f8f94f8ccacd9a190fa5e609c.tar.gz
glibc-e7190fc73dbc8a1f8f94f8ccacd9a190fa5e609c.tar.bz2
linux: Add pidfd_getpid
This interface allows to obtain the associated process ID from the process file descriptor. It is done by parsing the procps fdinfo information. Its prototype is: pid_t pidfd_getpid (int fd) It returns the associated pid or -1 in case of an error and sets the errno accordingly. The possible errno values are those from open, read, and close (used on procps parsing), along with: - EBADF if the FD is negative, does not have a PID associated, or if the fdinfo fields contain a value larger than pid_t. - EREMOTE if the PID is in a separate namespace. - ESRCH if the process is already terminated. Checked on x86_64-linux-gnu on Linux 4.15 (no CLONE_PIDFD or waitid support), Linux 5.4 (full support), and Linux 6.2. Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/Makefile')
-rw-r--r--sysdeps/unix/sysv/linux/Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 3ecfa18..063719b 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -213,6 +213,7 @@ tests += \
tst-ofdlocks \
tst-personality \
tst-pidfd \
+ tst-pidfd_getpid \
tst-pkey \
tst-ppoll \
tst-prctl \
@@ -493,8 +494,10 @@ sysdep_headers += \
sysdep_routines += \
getcpu \
oldglob \
+ pidfd_getpid \
pidfd_spawn \
pidfd_spawnp \
+ procutils \
sched_getcpu \
spawnattr_getcgroup_np \
spawnattr_setcgroup_np \