receive_fd(9)
π 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β thestruct filethat was received from another process. it's giving "incoming file, handle with care" πufdβ a__userpointer to write the new fd number to. yes bestie, userspace pointer π«Άo_flagsβ theO_*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):
__file_ref_put(9)fd_install(9)file_close_fd_locked(9)last_fd(9)sys_close_range(9)file_close_fd(9)get_file_rcu(9)get_file_active(9)
π and that's the tea: source/version ./fs, October 2026, receive_fd(9) β bye bestie, periodt! π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms