AUDIT_GET_REPLY(3)

πŸ“¦
version 4.2.1 Β· 2 versions
, in alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, fedora 43, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– AUDIT_GET_REPLY(3) πŸ’–

okay bestie, gather round, because we're talking about audit_get_reply β€” yes that's the whole name, she's the Linux Audit API's little messenger girl and she's serving πŸŽ€


✨ NAME ✨

audit_get_reply β€” get the audit system's reply 🫢


🌸 SYNOPSIS 🌸

#include <libaudit.h>

int audit_get_reply(int fd, struct audit_reply *rep, reply_t block, int peek);"

(and yes, that quote mark at the end is just sitting there being iconic, we don't question her πŸ’…)


πŸ¦‹ DESCRIPTION πŸ¦‹

so like. this function grabs the next data packet that comes flying in on the audit netlink socket. it's the move you pull right after you've sent a command off to the audit system β€” you send, she replies, you catch it. main character energy fr fr ✨

let's break down the girlies:

  • fd β€” gotta be an open file descriptor, the kind you got back from audit_open. no random fd's allowed, she's picky πŸ’…
  • rep β€” a data structure where the reply gets tucked in all cozy πŸŽ€
  • block β€” type reply_t, and it's lowkey a vibe check between two options: GET_REPLY_BLOCKING and GET_REPLY_NONBLOCKING. pick your fighter πŸ₯Š
  • peek β€” if this is non-zero, you get the data without dequeueing it from the netlink socket. like looking at your notifications without opening them. obsessed πŸ‘€
ngl bestie, peek is the sneaky one β€” same data, but it stays in the socket's queue, no cap.

⭐ RETURN VALUE ⭐

here's the tea, and it's three whole moods:

  • -errno β€” it went wrong 😭 that's a negative errno, so pay attention to the sign
  • 0 β€” an error response was received πŸ’€ (yes, zero is not "all good" here, don't get played)
  • positive value β€” slay, success, we ate πŸ”₯

🌈 SEE ALSO 🌈

audit_open(3) β€” the bestie that hands you the fd in the first place 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Steve Grubb πŸ’œ


and that's the whole page, bestie!! this one's from Red Hat, dated Oct 2006 β€” an absolute vintage icon, we stan a classic πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸŒˆβ­πŸ‘‘