bpf_path_d_path(9)
π bpf_path_d_path(9) β like, the Kernel API Manual page, bestie π
okay so this is bpf_path_d_path(9) from the Kernel API Manual, and honestly? she's that girl. let's get into it β¨
πΈ NAME πΈ
bpf_path_d_path β resolves the pathname for the path you hand her π«Ά
β SYNOPSIS β
__bpf_kfunc int bpf_path_d_path (const struct path *path , char *buf ,
size_t buf__sz );
no cap, that's the whole signature. copy it exactly, don't get creative π
π¦ ARGUMENTS π¦
pathβ the path you want the pathname resolved for. she's the main character here π₯bufβ the buffer where the resolved pathname gets returned. put it in, she goes there πbuf__szβ the length of the buffer you supplied. yes, the size matters, keep it correct π
π DESCRIPTION π
So what she does: she resolves the pathname for the supplied path and stores it in buf. simple, iconic, no drama π
This BPF kfunc is literally the safer variant of the legacy bpf_d_path helper, and you should use it in place of bpf_d_path whenever possible. like, if you can use her, use her. she ate π
β οΈ big one: this BPF kfunc may only be called from BPF LSM programs. that's the vibe check and she will fail you if you ignore it π
π RETURN π
- On success: a positive integer corresponding to the length of the resolved pathname in buf, including the NUL termination character (yes, the NUL counts, don't forget her β)
- On error: a negative integer is returned π
π§ SEE ALSO π§
Kernel file ./fs/bpf_fs_kfuncs.c, plus her whole friend group:
bpf_get_task_exe_file(9)bpf_put_file(9)bpf_get_dentry_xattr(9)bpf_get_file_xattr(9)bpf_set_dentry_xattr_locked(9)bpf_remove_dentry_xattr_locked(9)bpf_set_dentry_xattr(9)bpf_remove_dentry_xattr(9)bpf_cgroup_read_xattr(9)bpf_sock_read_xattr(9)bpf_real_data_inode(9)
like, the whole group chat is in here fr fr π«Ά
okay that's the whole page, mwah π this dropped from ./fs back in October 2026, and yep, the page itself is bpf_path_d_path(9) β you're so welcome bestie, go resolve those pathnames responsibly β¨ππ
π¦ 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