audit Subroutine
Purpose
Enables and disables system auditing.
Library
Standard C Library (libc.a)
Syntax
Description
The audit subroutine enables or disables system auditing.
When auditing is enabled, audit records are created for security-relevant events. These records can be collected through the auditbin subroutine, or through the /dev/audit special file interface.
Parameters
Item | Description |
---|---|
Command | Defined in the sys/audit.h file, can be one of the following values:
|
Argument | Specifies the behavior when a bin write fails (for AUDIT_ON) or
specifies the size of the audit event buffer (for AUDIT_EVENT_THRESHOLD and
AUDIT_BYTE_THRESHOLD). For AUDIT_RESET and
AUDIT_QUERY, the value of the Argument is the WPAR ID. For
all other commands, the value of Argument is ignored. The
Argument parameter can take the following values:
|
Return Values
For a Command value of AUDIT_QUERY, the audit subroutine returns, upon successful completion, a mask that indicates the state of the auditing subsystem. The mask is a logical ORing of the AUDIT_ON, AUDIT_OFF, AUDIT_PANIC, AUDIT_NO_PANIC, and AUDIT_FULLPATH flags. For any other Command value, the audit subroutine returns 0 on successful completion.
If the audit subroutine fails, a value of -1 is returned and the errno global variable is set to indicate the error.
Error Codes
The audit subroutine fails if any of the following error codes are true:
Item | Description |
---|---|
EINVAL | The Command parameter is not one of AUDIT_ON, AUDIT_OFF, AUDIT_RESET, or AUDIT_QUERY. |
EINVAL | The Command parameter is AUDIT_ON and the Argument parameter specifies values other than AUDIT_PANIC or AUDIT_FULLPATH. |
EPERM | The calling process does not have root user authority. |
Files
Item | Description |
---|---|
dev/audit | Specifies the audit pseudo-device from which the audit records are read. |