Imported Upstream version 2.2.51
[platform/upstream/acl.git] / man / man3 / acl_init.3
1 .\" Access Control Lists manual pages
2 .\"
3 .\" (C) 2002 Andreas Gruenbacher, <a.gruenbacher@bestbits.at>
4 .\"
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual.  If not, see
22 .\" <http://www.gnu.org/licenses/>.
23 .\"
24 .Dd March 23, 2002
25 .Dt ACL_INIT 3
26 .Os "Linux ACL"
27 .Sh NAME
28 .Nm acl_init
29 .Nd initialize ACL working storage
30 .Sh LIBRARY
31 Linux Access Control Lists library (libacl, \-lacl).
32 .Sh SYNOPSIS
33 .In sys/types.h
34 .In sys/acl.h
35 .Ft acl_t
36 .Fn acl_init "int count"
37 .Sh DESCRIPTION
38 The
39 .Fn acl_init
40 function allocates and initializes the working storage for an ACL of at least
41 .Va count
42 ACL entries.  The ACL created initially contains no ACL entries.
43 A pointer to the working storage is returned.
44 .Pp
45 This function may cause memory to be allocated.  The caller should free any
46 releasable memory, when the new ACL is no longer required, by calling
47 .Xr acl_free 3
48 with the
49 .Va (void*)acl_t
50 returned by
51 .Fn acl_init
52 as an argument.
53 .Sh RETURN VALUE
54 On success, this function returns a pointer to the
55 working storage.  On error, a value of
56 .Li (acl_t)NULL
57 is returned, and
58 .Va errno
59 is set appropriately.
60 .Sh ERRORS
61 If any of the following conditions occur, the
62 .Fn acl_init
63 function returns a value of
64 .Li (acl_t)NULL
65 and sets
66 .Va errno
67 to the corresponding value:
68 .Bl -tag -width Er
69 .It Bq Er EINVAL
70 The value of count is less than zero.
71 .It Bq Er ENOMEM
72 The
73 .Va acl_t
74 to be returned requires more memory than is allowed by the hardware or
75 system-imposed memory management constraints.
76 .El
77 .Sh STANDARDS
78 IEEE Std 1003.1e draft 17 (\(lqPOSIX.1e\(rq, abandoned)
79 .Sh SEE ALSO
80 .Xr acl_get_file 3 ,
81 .Xr acl_free 3 ,
82 .Xr acl 5
83 .Sh AUTHOR
84 Derived from the FreeBSD manual pages written by
85 .An "Robert N M Watson" Aq rwatson@FreeBSD.org ,
86 and adapted for Linux by
87 .An "Andreas Gruenbacher" Aq a.gruenbacher@bestbits.at .