pidfd_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

pidfd_create β€” Create a new pid file descriptor. πŸ’…

Okay so this is the pidfd_create(9) page from the Kernel API Manual, and we’re gonna get you comfy with it, bestie. 🫢


πŸ“œ SYNOPSIS πŸ“œ

int pidfd_create (struct pid *pid , unsigned int flags );

🧾 ARGUMENTS 🧾

  • pid β€” the struct pid that the pidfd will reference πŸ’–
  • flags β€” flags to pass ✨

πŸ’« DESCRIPTION πŸ’«

This creates a new pid file descriptor with the O_CLOEXEC flag set. Slay. ✨

Note, that this function can only be called after the fd table has been unshared to avoid leaking the pidfd to the new process. πŸ‘€ Like, read that twice. It matters.

🚨 This symbol should not be explicitly exported to loadable modules. Periodt. πŸ’…

🎁 RETURN 🎁

On success, a cloexec pidfd is returned. πŸŽ€ On error, a negative errno number will be returned. 😭


πŸ‘€ SEE ALSO πŸ‘€


That’s the whole page, bestie: source/version ./kernel, dated October 2026 β€” mwah πŸ’‹

πŸ“¦ where this page comes from