#include <sys/audit.h> #include <stdio.h>
int auditwrite (Event, Result, Buffer1, Length1, Buffer2, Length2, ...)
char * Event;
int Result;
char * Buffer1, *Buffer2 ...;
int Length1, Length2 ...;
The auditwrite subroutine builds the tail of an audit record and then writes it with the auditlog subroutine. The tail is built by gathering the specified buffers. The last buffer pointer must be a null.
If the auditwrite subroutine is to be called from a program invoked from the inittab file, the setpcred subroutine should be called first to establish the process' credentials.
If the auditwrite subroutine completes successfully, a value of 0 is returned. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
The auditwrite
subroutine fails if the following is true:
ENOSPC | The auditwrite subroutine is unable to allocate space for the tail buffer. |
Other error codes are returned by the auditlog subroutine.
This subroutine is part of Base Operating System (BOS) Runtime.
The auditlog (auditlog Subroutine) subroutine, setpcred subroutine.
The inittab file.
List of Security and Auditing Subroutines and Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.