sock_from_file(9)
β¨ NAME β¨
okay bestie, welcome to sock_from_file(9) from the Kernel API Manual π β sheβs lowkey tiny but highkey iconic. The official name line is:
sock_from_fileβ Return the&socketbounded to@file.
No cap, thatβs the exact name description. Slay.
β¨ SYNOPSIS β¨
struct socket * sock_from_file (struct file *file );
Thatβs the whole signature, bestie. Copy it exactly, donβt get creative with the spacing π .
π ARGUMENTS π
fileβfileπ (yes, the entire argument description is literally justfile; I am not inventing extra lore, periodt).
π DESCRIPTION π
On failure returns NULL. Thatβs the whole description, queen β no extra behavior spelled out here, so Iβm not gonna make one up. If it fails, you get NULL; thatβs the vibe check π.
π¦ SEE ALSO π¦
Kernel file ./net/socket.c is linked up, plus this whole friend group of references β all of them, in order, no skipping:
move_addr_to_kernel(9), move_addr_to_user(9), sock_read_xattr(9), sock_alloc_file(9), sockfd_lookup(9), sock_alloc(9), sock_release(9), sock_sendmsg(9), kernel_sendmsg(9), sock_recvmsg(9), kernel_recvmsg(9), sock_create_lite(9), __sock_create(9), sock_create(9), sock_create_kern(9), sock_register(9), sock_unregister(9), kernel_bind(9), kernel_listen(9), kernel_accept(9), kernel_connect(9), kernel_getsockname(9), kernel_getpeername(9), kernel_sock_shutdown(9), kernel_sock_ip_overhead(9).
mwah π β source/version ./net, dated October 2026. Thatβs the cute sign-off, 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