2 .\" Copyright (c) 2008, 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 AUDIT 2 "Mar 6, 2017"
8 audit \- write a record to the audit log
12 cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lbsm\fR \fB -lsocket \fR \fB -lnsl \fR [ \fIlibrary\fR... ]
13 #include <sys/param.h>
14 #include <bsm/libbsm.h>
16 \fBint\fR \fBaudit\fR(\fBcaddr_t\fR \fIrecord\fR, \fBint\fR \fIlength\fR);
21 The \fBaudit()\fR function queues a record for writing to the system audit log.
22 The data pointed to by \fIrecord\fR is queued for the log after a minimal
23 consistency check, with the \fIlength\fR parameter specifying the size of the
24 record in bytes. The data should be a well-formed audit record as described
25 by \fBaudit.log\fR(4).
28 The kernel validates the record header token type and length, and sets the
29 time stamp value before writing the record to the audit log. The kernel does
30 not do any preselection for user-level generated events. If the audit policy is
31 set to include sequence or trailer tokens, the kernel will append them to the
35 Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
36 returned and \fBerrno\fR is set to indicate the error.
39 The \fBaudit()\fR function will fail if:
46 The record length is greater than the maximum allowed record length.
55 The \fIrecord\fR argument points outside the process's allocated address space.
64 The header token in the record is invalid.
73 Audit is not defined for this system.
82 The {\fBPRIV_PROC_AUDIT\fR} privilege is not asserted in the effective set of
88 Only privileged processes can successfully execute this call.
91 See \fBattributes\fR(5) for descriptions of the following attributes:
99 ATTRIBUTE TYPE ATTRIBUTE VALUE
101 Interface Stability Committed
108 \fBaudit\fR(1M), \fBauditd\fR(1M), \fBsvcadm\fR(1M),
109 \fBauditon\fR(2), \fBgetaudit\fR(2), \fBaudit.log\fR(4), \fBattributes\fR(5),
113 The functionality described in this man page is available only if
114 the audit daemon \fBauditd\fR(1M) has not been
115 disabled by \fBaudit\fR(1M) or \fBsvcadm\fR(1M).