bpf_ksock_acquire(9)
π bpf_ksock_acquire(9) π
okay so bestie, welcome to the Kernel API Manual β this page is about bpf_ksock_acquire, and yes it's giving "tiny function, big responsibilities" energy. let's get into it π«Ά
β¨ NAME β¨
bpf_ksock_acquire β grab yourself a reference to a BPF kernel socket. literally just a refcount glow-up π
πΈ SYNOPSIS πΈ
__bpf_kfunc struct bpf_ksock * bpf_ksock_acquire (struct bpf_ksock *ks );
no cap, that's the whole signature. short and iconic π
π ARGUMENTS π
ksβ the BPF kernel socket context you're acquiring. bestie listen: this must be a trusted pointer β think an RCU-protected kptr from a map. not just any random pointer you found lying around, okay? π
π¦ DESCRIPTION π¦
so you called it, you got your reference... now what? the acquired context has exactly two acceptable fates, and you gotta pick one:
- store it in a map as a kptr, or
- free it with
bpf_ksock_release
that's it. that's the whole vibe check. don't just let it float around unsupervised, because that's not the move π
β SEE ALSO β
- Kernel file
./net/core/bpf_ksock.c struct bpf_ksock(9)bpf_ksock_create(9)bpf_ksock_connect(9)bpf_ksock_release(9)bpf_ksock_send(9)
alright that's the page!! this one came from ./net/core, dated October 2026, and the manpage itself is bpf_ksock_acquire(9) β go acquire some references responsibly, love u, bye π§π
π¦ 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