xref: /freebsd/lib/libc/posix1e/acl_from_mode_np.3 (revision 19f7f91133af6b699a87ed7656987ba017a75b6a)
1*19f7f911SGleb Popov.\"-
2*19f7f911SGleb Popov.\" Copyright (c) 2021 Gleb Popov
3*19f7f911SGleb Popov.\" All rights reserved.
4*19f7f911SGleb Popov.\"
5*19f7f911SGleb Popov.\" Redistribution and use in source and binary forms, with or without
6*19f7f911SGleb Popov.\" modification, are permitted provided that the following conditions
7*19f7f911SGleb Popov.\" are met:
8*19f7f911SGleb Popov.\" 1. Redistributions of source code must retain the above copyright
9*19f7f911SGleb Popov.\"    notice, this list of conditions and the following disclaimer.
10*19f7f911SGleb Popov.\" 2. Redistributions in binary form must reproduce the above copyright
11*19f7f911SGleb Popov.\"    notice, this list of conditions and the following disclaimer in the
12*19f7f911SGleb Popov.\"    documentation and/or other materials provided with the distribution.
13*19f7f911SGleb Popov.\"
14*19f7f911SGleb Popov.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*19f7f911SGleb Popov.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*19f7f911SGleb Popov.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*19f7f911SGleb Popov.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*19f7f911SGleb Popov.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*19f7f911SGleb Popov.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*19f7f911SGleb Popov.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*19f7f911SGleb Popov.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*19f7f911SGleb Popov.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*19f7f911SGleb Popov.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*19f7f911SGleb Popov.\" SUCH DAMAGE.
25*19f7f911SGleb Popov.\"
26*19f7f911SGleb Popov.Dd January 20, 2021
27*19f7f911SGleb Popov.Dt ACL_FROM_MODE_NP 3
28*19f7f911SGleb Popov.Os
29*19f7f911SGleb Popov.Sh NAME
30*19f7f911SGleb Popov.Nm acl_from_mode_np
31*19f7f911SGleb Popov.Nd create an ACL from status information
32*19f7f911SGleb Popov.Sh LIBRARY
33*19f7f911SGleb Popov.Lb libc
34*19f7f911SGleb Popov.Sh SYNOPSIS
35*19f7f911SGleb Popov.In sys/types.h
36*19f7f911SGleb Popov.In sys/acl.h
37*19f7f911SGleb Popov.Ft acl_t
38*19f7f911SGleb Popov.Fn acl_from_mode_np "const mode_t mode"
39*19f7f911SGleb Popov.Sh DESCRIPTION
40*19f7f911SGleb PopovThe
41*19f7f911SGleb Popov.Fn acl_from_mode_np
42*19f7f911SGleb Popovfunction is a non-portable call that converts the permissions set referred to by
43*19f7f911SGleb Popov.Va mode
44*19f7f911SGleb Popovinto the corresponding minimal ACL structure, appropriate for applying to
45*19f7f911SGleb Popovfiles or manipulating.
46*19f7f911SGleb Popov.Pp
47*19f7f911SGleb PopovThis function causes memory to be allocated.
48*19f7f911SGleb PopovThe caller should free any
49*19f7f911SGleb Popovfree-able memory, when the new ACL is no longer required, by calling
50*19f7f911SGleb Popov.Xr acl_free 3
51*19f7f911SGleb Popovwith the
52*19f7f911SGleb Popov.Va (void *)acl_t
53*19f7f911SGleb Popovas an argument.
54*19f7f911SGleb Popov.Sh RETURN VALUES
55*19f7f911SGleb PopovUpon successful completion, the function returns a pointer to the
56*19f7f911SGleb Popovinternal representation of the ACL in working storage.
57*19f7f911SGleb PopovOtherwise, a value
58*19f7f911SGleb Popovof
59*19f7f911SGleb Popov.Va (acl_t)NULL
60*19f7f911SGleb Popovis returned, and
61*19f7f911SGleb Popov.Va errno
62*19f7f911SGleb Popovis set to indicate the error.
63*19f7f911SGleb Popov.Sh ERRORS
64*19f7f911SGleb PopovIf any of the following conditions occur, the
65*19f7f911SGleb Popov.Fn acl_from_mode_np
66*19f7f911SGleb Popovfunction returns a value of
67*19f7f911SGleb Popov.Va (acl_t)NULL
68*19f7f911SGleb Popovand set
69*19f7f911SGleb Popov.Va errno
70*19f7f911SGleb Popovto the corresponding value:
71*19f7f911SGleb Popov.Bl -tag -width Er
72*19f7f911SGleb Popov.It Bq Er ENOMEM
73*19f7f911SGleb PopovThe ACL working storage requires more memory than is allowed by the
74*19f7f911SGleb Popovhardware or system-imposed memory management constraints.
75*19f7f911SGleb Popov.El
76*19f7f911SGleb Popov.Sh SEE ALSO
77*19f7f911SGleb Popov.Xr acl 3 ,
78*19f7f911SGleb Popov.Xr acl_free 3 ,
79*19f7f911SGleb Popov.Xr acl_from_text 3 ,
80*19f7f911SGleb Popov.Xr posix1e 3
81*19f7f911SGleb Popov.Sh STANDARDS
82*19f7f911SGleb PopovPOSIX.1e is described in IEEE POSIX.1e draft 17.
83*19f7f911SGleb PopovDiscussion
84*19f7f911SGleb Popovof the draft continues on the cross-platform POSIX.1e implementation
85*19f7f911SGleb Popovmailing list.
86*19f7f911SGleb PopovTo join this list, see the
87*19f7f911SGleb Popov.Fx
88*19f7f911SGleb PopovPOSIX.1e implementation
89*19f7f911SGleb Popovpage for more information.
90*19f7f911SGleb Popov.Sh HISTORY
91*19f7f911SGleb PopovPOSIX.1e support was introduced in
92*19f7f911SGleb Popov.Fx 4.0 ,
93*19f7f911SGleb Popovand development continues.
94*19f7f911SGleb Popov.Sh AUTHORS
95*19f7f911SGleb Popov.An Gleb Popov
96