d_path(9)
π NAME π
d_path β return the path of a dentry π£οΈβ¨
(hi bestie, this is d_path(9) from the Kernel API Manual β we're gonna get you fluent, fr fr π
)
β¨ SYNOPSIS β¨
char * d_path (const struct path *path , char *buf , int buflen );
π ARGUMENTS π
pathβ path to report π£οΈbufβ buffer to return value in π₯buflenβ buffer length π
π¦ DESCRIPTION π¦
okay so d_path converts a dentry into an ASCII path name β¨. if the entry has been deleted, the string " (deleted)" gets appended β and the manpage literally says note that this is ambiguous π. that's not us being vague, that's the actual warning, bestie.
it returns a pointer into the buffer, or an error code if the path was too long π. important: callers should use the returned pointer, not the passed-in buffer, to use the name! fr fr. the implementation often starts at an offset into the buffer, and may leave 0 bytes at the start π.
also buflen should be positive β periodt π.
π SEE ALSO π
Kernel file ./fs/d_path.c β also peep prepend_name(9), prepend_path(9), and __d_path(9) π«Ά
stay iconic, bestie π β source ./fs, dated October 2026, page d_path(9) π
π¦ 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