AUDIT_NAME_TO_SYSCALL(3)

πŸ’– AUDIT_NAME_TO_SYSCALL β€” the girlies' guide to turning syscall names into numbers πŸ’–

okay bestie, so this is audit_name_to_syscall(3), part of the Linux Audit API, and she's a section 3 library function. she does exactly one thing and she does it flawlessly: you hand her a syscall name, she hands you back the numeric syscall value. that's it. that's the whole personality. and honestly? iconic. ✨


🌸 NAME 🌸

audit_name_to_syscall β€” convert the syscall name to the numeric syscall value πŸ’…

like, you say "open", she says a number. matchmaker behavior fr fr.


πŸŽ€ SYNOPSIS πŸŽ€

#include <libaudit.h>

int audit_name_to_syscall(const char *sc, int machine);

yes queen, just two little arguments. no drama. πŸ¦‹


✨ DESCRIPTION ✨

so here's the tea, bestie. audit_name_to_syscall() converts the syscall name to the numeric syscall value. she takes your cute little string and turns it into a number for you. no cap.

  • sc β€” this is the syscall name. the string. the name itself. πŸ“
  • machine β€” this is the enum value of the machine type, and it's defined in machine_t.

and the way you get that machine value? you call audit_detect_machine(3). she'll figure out what machine you're on and hand you the enum so you can pass it straight in here. teamwork, periodt. 🫢


πŸ”₯ RETURN VALUE πŸ”₯

  • Returns -1 if an error occurs 😭
  • Otherwise, the return value is the numeric syscall value πŸ‘‘

so like, vibe check your return value. if it's -1, something went sideways. if it's a number, slay, you got your syscall. πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘


🌈 AUTHOR 🌈

Steve Grubb πŸ’–


and that's the whole page, bestie! this little baddie shipped from Red Hat, dated Nov 2021. go convert some syscall names, you've got this. mwah. πŸ’‹πŸŒΊπŸ¦‹πŸ’«

πŸ“¦ where this page comes from