cc [ flag ... ] file ... -lbsm -lsocket -lnsl -lintl [ library ... ]
#include <sys/param.h>
#include <bsm/audit.h>
int getaudit( struct auditinfo *info);
int setaudit( struct auditinfo *info);
The functionality described in this man page is available only if the Basic Security Module (BSM) has been enabled. See bsmconv(1M) for more information.
getaudit() gets the audit ID, the preselection mask, the terminal ID and the audit session ID of the current process.
setaudit() sets the audit ID, the preselection mask, the terminal ID and the audit session ID for the current process.
The info structure used to pass the process audit information contains the following members:
au_id_t ai_auid; /* audit user ID */ au_mask_t ai_mask; /* preselection mask */ au_tid_t ai_termid; /* terminal ID */ au_asid_t ai_asid; /* audit session ID */
Only processes with the effective user ID of the super-user may successfully execute these calls.