1au_open(3BSM)       Security and Auditing Library Functions      au_open(3BSM)
2
3
4

NAME

6       au_open, au_close, au_write - construct and write audit records
7

SYNOPSIS

9       cc [ flag... ] file... -lbsm  -lsocket   -lnsl   [ library... ]
10       #include <bsm/libbsm.h>
11
12       int au_close(int d, int keep, short event);
13
14
15       int au_open(void);
16
17
18       int au_write(int d, token_t *m);
19
20

DESCRIPTION

22       The  au_open()  function  returns  an  audit record descriptor to which
23       audit tokens can be written using au_write(). The audit record descrip‐
24       tor  is  an  integer  value  that identifies a storage area where audit
25       records are accumulated.
26
27
28       The au_close() function terminates the life of an audit  record   d  of
29       type   event   started   by   au_open().   If  the  keep  parameter  is
30       AU_TO_NO_WRITE, the data contained therein is discarded.  If  the  keep
31       parameter  is AU_TO_WRITE, the additional parameters are used to create
32       a header token.  Depending on the audit policy information  obtained by
33       auditon(2),  additional tokens such as  sequence and trailer tokens can
34       be added to the record. The au_close() function then writes the  record
35       to  the  audit  trail by calling audit(2).  Any memory used is freed by
36       calling free(3C).
37
38
39       The au_write() function adds the audit token pointed to  by  m  to  the
40       audit  record  identified  by the descriptor d. After this call is made
41       the audit token is no longer available to the caller.
42

RETURN VALUES

44       Upon successful completion, au_open() returns an audit record  descrip‐
45       tor.  If  a descriptor could not be allocated, au_open() returns −1 and
46       sets errno to indicate the error.
47
48
49       Upon successful completion, au_close()  returns 0. If d is  an  invalid
50       or  corrupted  descriptor  or  if  audit() fails, au_close() returns −1
51       without setting errno. If audit() fails, errno is set  to  one  of  the
52       error values described on the audit(2) manual page.
53
54
55       Upon  successful  completion, au_write()  returns 0. If d is an invalid
56       descriptor or m is an invalid token, or if  audit()  fails,  au_write()
57       returns −1 without setting errno. If audit() fails, errno is set to one
58       of the error values described on the audit(2) manual page.
59

ERRORS

61       The au_open() function will fail if:
62
63       ENOMEM    The physical limits of the system  have  been  exceeded  such
64                 that sufficient memory cannot be allocated.
65
66
67       EAGAIN    There  is currently insufficient memory available. The appli‐
68                 cation can try again later.
69
70

ATTRIBUTES

72       See attributes(5) for descriptions of the following attributes:
73
74
75
76
77       ┌─────────────────────────────┬─────────────────────────────┐
78       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
79       ├─────────────────────────────┼─────────────────────────────┤
80       │Interface Stability          │Stable                       │
81       ├─────────────────────────────┼─────────────────────────────┤
82       │MT-Level                     │MT-Safe                      │
83       └─────────────────────────────┴─────────────────────────────┘
84

SEE ALSO

86       bsmconv(1M),  audit(2),  auditon(2),  au_preselect(3BSM),  au_to(3BSM),
87       free(3C), attributes(5)
88

NOTES

90       The  functionality  described  on this manual page is available only if
91       the Solaris Auditing has been enabled.  See bsmconv(1M) for more infor‐
92       mation.
93
94
95
96SunOS 5.11                        31 Mar 2005                    au_open(3BSM)
Impressum