file_close_fd_locked(9)
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 π
- Kernel file
./fs/file.c __file_ref_put(9)fd_install(9)last_fd(9)sys_close_range(9)file_close_fd(9)get_file_rcu(9)get_file_active(9)receive_fd(9)
π source/version: ./fs β’ date: October 2026 β’ page: file_close_fd_locked(9) β slay, bye bestie π«Άβ¨
π¦ 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