AUDIT_NAME_TO_FSTYPE(3)

πŸ’– AUDIT_NAME_TO_FSTYPE πŸ’–

ok so this is a page from the Linux Audit API (that's the manual section 3 situation, bestie) and it's all about turning a filesystem type name into the actual number behind it. tiny function, huge glow-up energy. let's get into it πŸ¦‹


✨ NAME ✨

audit_name_to_fstype β€” convert the fstype name to the numeric fstype value

like. the whole job. the entire assignment. she does one thing and she does it flawlessly. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <libaudit.h>

int audit_name_to_fstype(const char *name);

yeah that's it. one include, one function, one const char *. minimalism ate. πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

audit_name_to_fstype() takes a fstype name and hands you back the numeric fstype value. and listen, there are exactly two names on the menu, no secret third thing:

  • "debugfs" β†’ 0x64626720
  • "tracefs" β†’ 0x74726163

name is the fstype name. that's the whole input. she's not complicated, she's just precise. ✨

ngl the mapping here is a little love letter: those hex values are literally the ASCII of the strings, and honestly? iconic. but fr fr, the only thing this page promises you is: name in, number out.

πŸ’€ RETURN VALUE πŸ’€

Returns -1 if an name occurs 😭 otherwise, the return value is the numeric fstype value.

so like β€” you get your number back when everything's chill, and you get -1 when an name happens. check your return value, bestie, don't just vibe past it. 🫢


🧚 SEE ALSO 🧚

the reverse-direction queen. go say hi. 🌈


πŸ’œ AUTHOR πŸ’œ

Steve Grubb


ok that's the page!! every flag-free, option-free, environment-variable-free inch of it. no cap. πŸ“

this lil' page comes to you from Red Hat, dated Mar 2022 β€” so when you're out here converting fstypes, just know a whole audit API is cheering you on. bye bestie, go log something πŸ’–
πŸ“¦ where this page comes from