2 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH AU_OPEN 3BSM "Mar 6, 2017"
8 au_open, au_close, au_write \- construct and write audit records
12 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lbsm\fR [ \fIlibrary\fR... ]
13 #include <bsm/libbsm.h>
15 \fBint\fR \fBau_close\fR(\fBint\fR \fId\fR, \fBint\fR \fIkeep\fR, \fBshort\fR \fIevent\fR);
20 \fBint\fR \fBau_open\fR(\fB\fR\fIvoid\fR);
25 \fBint\fR \fBau_write\fR(\fBint\fR \fId\fR, \fBtoken_t *\fR\fIm\fR);
30 The \fBau_open()\fR function returns an audit record descriptor to which audit
31 tokens can be written using \fBau_write()\fR. The audit record descriptor is an
32 integer value that identifies a storage area where audit records are
36 The \fBau_close()\fR function terminates the life of an audit record \fId\fR
37 of type \fIevent\fR started by \fBau_open()\fR. If the \fIkeep\fR parameter is
38 \fBAU_TO_NO_WRITE\fR, the data contained therein is discarded. If the
39 \fIkeep\fR parameter is \fBAU_TO_WRITE\fR, the additional parameters are used
40 to create a header token. Depending on the audit policy information obtained
41 by \fBauditon\fR(2), additional tokens such as \fIsequence\fR and
42 \fItrailer\fR tokens can be added to the record. The \fBau_close()\fR function
43 then writes the record to the audit trail by calling \fBaudit\fR(2). Any
44 memory used is freed by calling \fBfree\fR(3C).
47 The \fBau_write()\fR function adds the audit token pointed to by \fIm\fR to the
48 audit record identified by the descriptor \fId\fR. After this call is made the
49 audit token is no longer available to the caller.
52 Upon successful completion, \fBau_open()\fR returns an audit record descriptor.
53 If a descriptor could not be allocated, \fBau_open()\fR returns \fB\(mi1\fR and
54 sets \fBerrno\fR to indicate the error.
57 Upon successful completion, \fBau_close()\fR returns \fB0\fR. If \fId\fR is an
58 invalid or corrupted descriptor or if \fBaudit()\fR fails, \fBau_close()\fR
59 returns \(mi1 without setting \fBerrno\fR. If \fBaudit()\fR fails, \fBerrno\fR
60 is set to one of the error values described on the \fBaudit\fR(2) manual page.
63 Upon successful completion, \fBau_write()\fR returns \fB0\fR. If \fId\fR is an
64 invalid descriptor or \fIm\fR is an invalid token, or if \fBaudit()\fR fails,
65 \fBau_write()\fR returns \(mi1 without setting \fBerrno\fR. If \fBaudit()\fR
66 fails, \fBerrno\fR is set to one of the error values described on the
67 \fBaudit\fR(2) manual page.
70 The \fBau_open()\fR function will fail if:
77 The physical limits of the system have been exceeded such that sufficient
78 memory cannot be allocated.
87 There is currently insufficient memory available. The application can try again
93 See \fBattributes\fR(5) for descriptions of the following attributes:
101 ATTRIBUTE TYPE ATTRIBUTE VALUE
103 Interface Stability Stable
110 \fBaudit\fR(2), \fBauditon\fR(2), \fBau_preselect\fR(3BSM),
111 \fBau_to\fR(3BSM), \fBfree\fR(3C), \fBattributes\fR(5)