1502 Remove conversion cruft from manpages
[unleashed.git] / usr / src / man / man2 / audit.2
blob883feb37684e9c8a5fb2dbfd3c53d845ec5e13ad
1 '\" te
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 "Apr 16, 2008"
7 .SH NAME
8 audit \- write a record to the audit log
9 .SH SYNOPSIS
10 .LP
11 .nf
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);
17 .fi
19 .SH DESCRIPTION
20 .sp
21 .LP
22 The \fBaudit()\fR function queues a record for writing to the system audit log.
23 The data pointed to by \fIrecord\fR is queued for the log after a minimal
24 consistency check, with the \fIlength\fR parameter specifying the size of the
25 record  in bytes. The data should be a well-formed audit  record as described
26 by \fBaudit.log\fR(4).
27 .sp
28 .LP
29 The kernel validates the record header token type and length,  and sets the
30 time stamp value before writing the record to the audit log. The kernel does
31 not do any preselection for user-level generated events. If the audit policy is
32 set to  include sequence or trailer tokens, the kernel will append  them to the
33 record.
34 .SH RETURN VALUES
35 .sp
36 .LP
37 Upon successful completion, \fB0\fR is returned.  Otherwise, \fB\(mi1\fR is
38 returned and \fBerrno\fR is set to indicate the error.
39 .SH ERRORS
40 .sp
41 .LP
42 The \fBaudit()\fR function will fail if:
43 .sp
44 .ne 2
45 .na
46 \fB\fBE2BIG\fR\fR
47 .ad
48 .RS 11n
49 The record length is greater than the maximum allowed record length.
50 .RE
52 .sp
53 .ne 2
54 .na
55 \fB\fBEFAULT\fR\fR
56 .ad
57 .RS 11n
58 The \fIrecord\fR argument points outside the process's allocated address space.
59 .RE
61 .sp
62 .ne 2
63 .na
64 \fB\fBEINVAL\fR\fR
65 .ad
66 .RS 11n
67 The header token in the record is invalid.
68 .RE
70 .sp
71 .ne 2
72 .na
73 \fB\fBENOTSUP\fR\fR
74 .ad
75 .RS 11n
76 Solaris Audit is not defined for this system.
77 .RE
79 .sp
80 .ne 2
81 .na
82 \fB\fBEPERM\fR\fR
83 .ad
84 .RS 11n
85 The {\fBPRIV_PROC_AUDIT\fR} privilege is not asserted in the effective set of
86 the calling process.
87 .RE
89 .SH USAGE
90 .sp
91 .LP
92 Only privileged processes can successfully execute this call.
93 .SH ATTRIBUTES
94 .sp
95 .LP
96 See \fBattributes\fR(5) for descriptions of the following attributes:
97 .sp
99 .sp
101 box;
102 c | c
103 l | l .
104 ATTRIBUTE TYPE  ATTRIBUTE VALUE
106 Interface Stability     Committed
108 MT-Level        MT-Safe
111 .SH SEE ALSO
114 \fBbsmconv\fR(1M), \fBaudit\fR(1M), \fBauditd\fR(1M), \fBsvcadm\fR(1M),
115 \fBauditon\fR(2), \fBgetaudit\fR(2), \fBaudit.log\fR(4), \fBattributes\fR(5),
116 \fBprivileges\fR(5)
117 .SH NOTES
120 The functionality described in this man page is available only if the Solaris
121 Auditing has been enabled and the audit daemon \fBauditd\fR(1M) has not been
122 disabled by \fBaudit\fR(1M) or \fBsvcadm\fR(1M). See \fBbsmconv\fR(1M) for more
123 information.