]> CyberLeo.Net >> Repos - FreeBSD/releng/10.3.git/blob - contrib/openbsm/libbsm/au_errno.3
- Copy stable/10@296371 to releng/10.3 in preparation for 10.3-RC1
[FreeBSD/releng/10.3.git] / contrib / openbsm / libbsm / au_errno.3
1 .\"-
2 .\" Copyright (c) 2008 Apple Inc.
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1.  Redistributions of source code must retain the above copyright
9 .\"     notice, this list of conditions and the following disclaimer.
10 .\" 2.  Redistributions in binary form must reproduce the above copyright
11 .\"     notice, this list of conditions and the following disclaimer in the
12 .\"     documentation and/or other materials provided with the distribution.
13 .\" 3.  Neither the name of Apple Inc. ("Apple") nor the names of
14 .\"     its contributors may be used to endorse or promote products derived
15 .\"     from this software without specific prior written permission.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR
21 .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
26 .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 .\" POSSIBILITY OF SUCH DAMAGE. 
28 .\"
29 .Dd December 8, 2008
30 .Dt AU_BSM_TO_ERRNO 3
31 .Os
32 .Sh NAME
33 .Nm au_bsm_to_errno ,
34 .Nm au_errno_to_bsm ,
35 .Nm au_strerror
36 .Nd "convert between BSM and local error numbers"
37 .Sh LIBRARY
38 .Lb libbsm
39 .Sh SYNOPSIS
40 .In bsm/libbsm.h
41 .Ft int
42 .Fn au_bsm_to_errno "u_char bsm_error" "int *errorp"
43 .Ft u_char
44 .Fn au_errno_to_bsm "int error"
45 .Ft const char *
46 .Fn au_strerror "int bsm_error"
47 .Sh DESCRIPTION
48 These interfaces may be used to convert between the local (
49 .Xr errno 2 )
50 and BSM error number spaces found in BSM return tokens.
51 .Pp
52 The
53 .Fn au_bsm_to_errno
54 function accepts a BSM error value,
55 .Fa bsm_error ,
56 and converts it to an
57 .Xr errno 2
58 that will be stored in the integer pointed to by
59 .Fa errorp
60 if successful.
61 This call will fail if the BSM error cannot be mapped into a local error
62 number, which may occur if the return token was generated on another
63 operating system.
64 .Pp
65 The
66 .Fn au_errno_to_bsm
67 function accepts a local
68 .Xr errno 2
69 value, and returns the BSM error number for it.
70 This call cannot fail, and instead returns a BSM error number indicating to
71 a later decoder that the error could not be encoded.
72 .Pp
73 The
74 .Fn au_strerror
75 function converts a BSM error value to a string, generally by converting first to a
76 local error number and using the local
77 .Xr strerror 3
78 function, but will also work for errors that are not locally defined.
79 .Sh RETURN VALULES
80 On success,
81 .Fn au_bsm_to_errno
82 returns 0 and a converted error value; on failure, it returns -1 but does not
83 set
84 .Xr errno 2 .
85 .Pp
86 On success,
87 .Fn au_strerror
88 returns a pointer to an error string; on failure it will return
89 .Dv NULL .
90 .Sh SEE ALSO
91 .Xr au_to_return 3 ,
92 .Xr au_to_return32 3 ,
93 .Xr au_to_return64 3 ,
94 .Xr libbsm 3
95 .Sh HISTORY
96 .Fn au_bsm_to_errno
97 and
98 .Fn au_errno_to_bsm
99 were introduced in OpenBSM 1.1.
100 .Sh AUTHORS
101 These functions were implemented by
102 .An Robert Watson
103 under contract to Apple Inc.
104 .Pp
105 The Basic Security Module (BSM) interface to audit records and audit event
106 stream format were defined by Sun Microsystems.
107 .Sh BUGS
108 .Nm au_strerror
109 is unable to provide localized strings for errors not available in the local
110 operating system.