sock_from_file(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 &socket bounded 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 just file; 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