mirror of git://sourceware.org/git/glibc.git
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>
|
||
|---|---|---|
| .. | ||
| 405 | ||
| 440 | ||
| 464 | ||
| 476 | ||
| 970 | ||
| a2 | ||
| cell | ||
| fpu | ||
| nofpu | ||
| Makefile | ||
| Versions | ||
| ____longjmp_chk.S | ||
| alphasort64.c | ||
| arch-syscall.h | ||
| c++-types.data | ||
| clone.S | ||
| configure | ||
| configure.ac | ||
| getcontext-common.S | ||
| getcontext.S | ||
| kernel_stat.h | ||
| ld.abilist | ||
| libBrokenLocale.abilist | ||
| libanl.abilist | ||
| libcrypt.abilist | ||
| libdl.abilist | ||
| libnsl.abilist | ||
| libpthread.abilist | ||
| libresolv.abilist | ||
| librt.abilist | ||
| libthread_db.abilist | ||
| libutil.abilist | ||
| makecontext.S | ||
| setcontext-common.S | ||
| setcontext.S | ||
| struct_kernel_msqid64_ds.h | ||
| struct_kernel_semid64_ds.h | ||
| swapcontext-common.S | ||
| swapcontext.S | ||
| syscalls.list | ||
| time64-compat.h | ||
| ucontext_i.sym | ||
| versionsort64.c | ||
| vfork.S | ||