AUDIT_NAME_TO_ERRNO(3)

πŸ’– AUDIT_NAME_TO_ERRNO β€” the audit_name_to_errno(3) glow-up ✨

okay bestie, welcome to section 3 of the Linux Audit API πŸŽ€ β€” this is where we learn that errno names and errno numbers are basically the same girlies in different outfits, and libaudit is the friend who does the outfit swap for you 🫢


🌸 NAME 🌸

audit_name_to_errno, audit_errno_to_name β€” converting between the errno name and the numeric errno value, both directions, no cap πŸ’…


✨ SYNOPSIS ✨

#include <libaudit.h>

int audit_name_to_errno(const char *error);

const char *audit_errno_to_name(int error);

like. two functions. two directions. one header. slay 🌈


πŸ¦‹ DESCRIPTION πŸ¦‹

audit_name_to_errno() takes an errno name β€” think "EPERM", "ENOENT", "ESRCH", etc. β€” and converts it into the numeric errno value (EPERM, ENOENT, ESRCH, etc.). the error argument is the errno name, periodt πŸ’œ

audit_errno_to_name() does the whole thing in reverse, main character energy: it takes the numeric errno value (EPERM, ENOENT, ESRCH, etc.) and converts it into the errno name ("EPERM", "ENOENT", "ESRCH", etc.). here the error argument is the numeric errno value 🌸

so one goes name β†’ number, the other goes number β†’ name. it's giving glow-up in both directions ✨


πŸ’€ RETURN VALUE πŸ’€

  • audit_name_to_errno() β€” if something goes wrong it returns 0. otherwise the return value is the numeric errno value πŸ“
  • audit_errno_to_name() β€” if something goes wrong it returns NULL. otherwise the return value is the errno name 🧚
bestie listen 😭 0 and NULL are the "it didn't work" signals here β€” check for them or you'll be out here debugging vibes instead of bugs πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

Steve Grubb πŸ’– (iconic behavior, honestly)


that's the whole page, bestie β€” go forth and translate your errnos πŸ¦‹

this lil manual page came to you from Red Hat, dated Mar 2022, and it lives in the Linux Audit API corner of the man-page universe β€” audit_name_to_errno(3), mwah πŸ’…πŸŽ€

πŸ“¦ where this page comes from