xref: /netbsd-src/lib/libc/posix1e/acl_init.3 (revision 1b3734281f17fd86d3db0e29f84ea9985be6fe06)
1.\" $NetBSD: acl_init.3,v 1.2 2020/06/18 19:46:34 wiz Exp $
2.\"-
3.\" Copyright (c) 2000, 2002 Robert N. M. Watson
4.\" All rights reserved.
5.\"
6.\" This software was developed by Robert Watson for the TrustedBSD Project.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND 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 THE AUTHOR OR CONTRIBUTORS BE LIABLE
21.\" FOR 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, STRICT
25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.\" $FreeBSD: head/lib/libc/posix1e/acl_init.3 131504 2004-07-02 23:52:20Z ru $
30.\"
31.Dd January 28, 2000
32.Dt ACL_INIT 3
33.Os
34.Sh NAME
35.Nm acl_init
36.Nd initialize ACL working storage
37.Sh LIBRARY
38.Lb libc
39.Sh SYNOPSIS
40.In sys/types.h
41.In sys/acl.h
42.Ft acl_t
43.Fn acl_init "int count"
44.Sh DESCRIPTION
45The
46.Fn acl_init
47function allocates and initializes the working storage for an ACL of at
48least
49.Va count
50ACL entries.
51A pointer to the working storage is returned.
52The working
53storage allocated to contain the ACL is freed by a call to
54.Xr acl_free 3 .
55When the area is first allocated, it shall contain an ACL that contains
56no ACL entries.
57.Pp
58This function may cause memory to be allocated.
59The caller should free any
60releasable memory, when the new ACL is no longer required, by calling
61.Xr acl_free 3
62with the
63.Va (void*)acl_t
64as an argument.
65.Sh IMPLEMENTATION NOTES
66.Fx Ns 's
67support for POSIX.1e interfaces and features is still under
68development at this time.
69.Sh RETURN VALUES
70Upon successful completion, this function shall return a pointer to the
71working storage.
72Otherwise, a value of
73.Va (acl_t)NULL
74shall be returned, and
75.Va errno
76shall be set to indicate the error.
77.Sh ERRORS
78If any of the following conditions occur, the
79.Fn acl_init
80function shall return a value of
81.Va (acl_t)NULL
82and set
83.Va errno
84to the corresponding value:
85.Bl -tag -width Er
86.It Bq Er EINVAL
87The value of count is less than zero.
88.It Bq Er ENOMEM
89The
90.Va acl_t
91to be returned requires more memory than is allowed by the hardware or
92system-imposed memory management constraints.
93.El
94.Sh SEE ALSO
95.Xr acl 3 ,
96.Xr acl_free 3 ,
97.Xr posix1e 3
98.Sh STANDARDS
99POSIX.1e is described in IEEE POSIX.1e draft 17.
100Discussion
101of the draft continues on the cross-platform POSIX.1e implementation
102mailing list.
103To join this list, see the
104.Fx
105POSIX.1e implementation
106page for more information.
107.Sh HISTORY
108POSIX.1e support was introduced in
109.Fx 4.0 ,
110and development continues.
111.Sh AUTHORS
112.An Robert N M Watson
113