receive_fd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– receive_fd(9) πŸ’–

🌸 NAME 🌸

okay so bestie, welcome to the Kernel API Manual β€” this is the page for receive_fd(9), and the name line is literally "receive_fd β€” install received file into file descriptor table." main character energy fr fr. ✨


✨ SYNOPSIS ✨

int receive_fd (struct file *file , int __user *ufd , unsigned int
       o_flags );

πŸŽ€ ARGUMENTS πŸŽ€

  • file β€” the struct file that was received from another process. it's giving "incoming file, handle with care" πŸ’…
  • ufd β€” a __user pointer to write the new fd number to. yes bestie, userspace pointer 🫢
  • o_flags β€” the O_* flags to apply to the new fd entry. slay, flags ✨

πŸ’… DESCRIPTION πŸ’…

Okay so here's the vibe check: receive_fd() installs a received file into the file descriptor table, with the appropriate checks and count updates. no cap. It optionally writes the fd number to userspace, but only if ufd is non-NULL. 🌸

This helper handles its own reference counting of the incoming struct file. not me obsessing over this, but it's iconic. πŸ’–

Returns the newly install fd or -ve on error. 😭 yes, that's the wording, bestie β€” keep it moving.

πŸ¦‹ SEE ALSO πŸ¦‹

Over in the Kernel file ./fs/file.c, the icons are (iykyk):

πŸ’– and that's the tea: source/version ./fs, October 2026, receive_fd(9) β€” bye bestie, periodt! πŸ’–

πŸ“¦ where this page comes from