file_close_fd_locked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to the file_close_fd_locked(9) page from the Kernel API Manual ✨ β€” it’s literally about grabbing the file tied to an fd, and it’s short and iconic πŸŽ€

🌸 NAME 🌸

file_close_fd_locked β€” return file associated with fd πŸ’…

✨ SYNOPSIS ✨

struct file * file_close_fd_locked (struct files_struct *files ,
unsigned fd );

🫢 ARGUMENTS 🫢

  • files β€” the file struct you’re retrieving the file from.
  • fd β€” the file descriptor you’re retrieving the file for.

πŸ’– DESCRIPTION πŸ’–

It does not take a separate reference count. That’s the whole note, bestie β€” no extra ref, periodt. πŸ’…

πŸ”’ CONTEXT πŸ”’

files_lock must be held. That’s the lock vibe check, no cap. πŸ”’

πŸŽ€ RETURN πŸŽ€

You get back the file associated with fd β€” and if fd is not open, the answer is NULL. πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’– source/version: ./fs β€’ date: October 2026 β€’ page: file_close_fd_locked(9) β€” slay, bye bestie 🫢✨

πŸ“¦ where this page comes from