AUDITCTL(2)
π AUDITCTL β the auditctl(2) page, bestie edition π
okay so. you found the AUDITCTL(2) page in the System Calls Manual and you're like "what is this" β don't worry, I got you. this is a system call, it's in section 2, and it's way less scary than it looks. let's go π¦
β¨ NAME β¨
auditctl β configure system audit parameters
like, it sets up your audit stuff. that's the whole vibe check. π
β¨ SYNOPSIS β¨
#include <bsm/audit.h>
int
auditctl(const char *path);
ok so you include <bsm/audit.h>, you call auditctl() with a path, and it hands you back an int. iconic signature, no notes. π
β¨ DESCRIPTION β¨
so here's the tea: the auditctl() system call tells the kernel to open a brand new audit trail log file. that's its whole job and it does it well. π
it requires an appropriate privilege β like, you can't just roll up and do this, you need the permissions, no cap.
and here's the little plot twist bestie: auditctl() opens new files, but if you want to disable the audit log, that's a whole different call β you gotta use auditon(2) for that. different function, different job. don't mix them up. π
β¨ RETURN VALUES β¨
- if everything goes great β you get back the value
0. slay. β¨ - if it goes bad β you get back the value
-1, and the global variableerrnogets set to tell you what went wrong. π
that's the whole thing. 0 good, -1 not good, errno is your little detective. π
β¨ ERRORS β¨
the auditctl() system call will fail if:
[EINVAL]β the path is invalid. like, thepathyou handed over just doesn't work. π[EPERM]β the process does not have sufficient permission to complete the operation. you didn't have the privilege, bestie, it happens. π«
β¨ SEE ALSO β¨
go read these next, they're the friend group:
β¨ HISTORY β¨
storytime πΈ β the OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc. in 2004. literally 2004, ancient history in internet years.
and then it got adopted by the TrustedBSD Project as the foundation for the OpenBSM distribution. glow up. π
β¨ AUTHORS β¨
this software was created by McAfee Research, the security research division of McAfee, Inc., under contract to Apple Computer Inc. π«Ά
additional authors include Wayne Salamon, Robert Watson, and SPARTA Inc. β shoutout to the whole crew. π
the Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems. respect where it's due. β
and this manual page was written by Robert Watson <rwatson@FreeBSD.org>. thank you for your service, king. π
and that's the page!! π this came to you from Debian, dated April 19, 2005 β yeah, it's been around a minute, but it still ate. go forth and audit responsibly, bestie. periodt. π β¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2005-2006 Robert N. M. Watson
- Copyright (c) 2008 Apple Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms