xref: /netbsd-src/lib/libc/posix1e/acl_create_entry.3 (revision 1b3734281f17fd86d3db0e29f84ea9985be6fe06)
1.\" $NetBSD: acl_create_entry.3,v 1.2 2020/06/18 19:46:34 wiz Exp $
2.\"-
3.\" Copyright (c) 2001 Chris D. Faulhaber
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD: head/lib/libc/posix1e/acl_create_entry.3 318708 2017-05-23 07:11:15Z ngie $
28.\"
29.Dd June 25, 2009
30.Dt ACL_CREATE_ENTRY 3
31.Os
32.Sh NAME
33.Nm acl_create_entry ,
34.Nm acl_create_entry_np
35.Nd create a new ACL entry
36.Sh LIBRARY
37.Lb libc
38.Sh SYNOPSIS
39.In sys/types.h
40.In sys/acl.h
41.Ft int
42.Fn acl_create_entry "acl_t *acl_p" "acl_entry_t *entry_p"
43.Ft int
44.Fn acl_create_entry_np "acl_t *acl_p" "acl_entry_t *entry_p" "int index"
45.Sh DESCRIPTION
46The
47.Fn acl_create_entry
48function
49is a POSIX.1e call that creates a new ACL entry in the ACL
50pointed to by
51.Fa acl_p .
52The
53.Fn acl_create_entry_np
54function is a non-portable version that creates the ACL entry
55at position
56.Fa index .
57Positions are numbered starting from zero, i.e. calling
58.Fn acl_create_entry_np
59with
60.Fa index
61argument equal to zero will prepend the entry to the ACL.
62.Sh RETURN VALUES
63.Rv -std acl_create_entry
64.Sh ERRORS
65The
66.Fn acl_create_entry
67function fails if:
68.Bl -tag -width Er
69.It Bq Er EINVAL
70Argument
71.Fa acl_p
72does not point to a pointer to a valid ACL.
73Argument
74.Fa index
75is out of bounds.
76.It Bq Er ENOMEM
77The ACL working storage requires more memory than is
78allowed by the hardware or system-imposed memory
79management constraints.
80.El
81.Sh SEE ALSO
82.Xr acl 3 ,
83.Xr acl_delete_entry 3 ,
84.Xr acl_get_entry 3 ,
85.Xr posix1e 3
86.Sh STANDARDS
87POSIX.1e is described in IEEE POSIX.1e draft 17.
88.Sh HISTORY
89POSIX.1e support was introduced in
90.Fx 4.0 .
91The
92.Fn acl_create_entry
93function was added in
94.Fx 5.0 .
95.Sh AUTHORS
96The
97.Fn acl_create_entry
98function was written by
99.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .
100