Imported Upstream version 2.2.51
[platform/upstream/acl.git] / man / man3 / acl_get_fd.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_GET_FD 3
26 .Os "Linux ACL"
27 .Sh NAME
28 .Nm acl_get_fd
29 .Nd get an ACL by file descriptor
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_get_fd "int fd"
37 .Sh DESCRIPTION
38 The
39 .Fn acl_get_fd
40 function retrieves the access ACL associated with the file referred to by
41 .Va fd .
42 The ACL is placed into working storage and
43 .Fn acl_get_fd
44 returns a pointer to that storage.
45 .Pp
46 In order to read an ACL from an object, a process must have read access to
47 the object's attributes.
48 .Pp
49 This function may cause memory to be allocated.  The caller should free any
50 releasable memory, when the new ACL is no longer required, by calling
51 .Xr acl_free 3
52 with the
53 .Va (void*)acl_t
54 returned by
55 .Fn acl_get_fd
56 as an argument.
57 .Sh RETURN VALUE
58 On success, this function shall return a pointer to the
59 working storage.  On error, a value of
60 .Li (acl_t)NULL
61 shall be returned, and
62 .Va errno
63 is set appropriately.
64 .Sh ERRORS
65 If any of the following conditions occur, the
66 .Fn acl_get_fd
67 function returns a value of
68 .Li (acl_t)NULL
69 and sets
70 .Va errno
71 to the corresponding value:
72 .Bl -tag -width Er
73 .It Bq Er EBADF
74 The
75 .Va fd
76 argument is not a valid file descriptor.
77 .It Bq Er ENOMEM
78 The ACL working storage requires more memory than is allowed by the hardware or system-imposed memory management constraints.
79 .It Bq Er ENOTSUP
80 The file system on which the file identified by
81 .Va fd
82 is located does not support ACLs, or ACLs are disabled.
83 .El
84 .Sh STANDARDS
85 IEEE Std 1003.1e draft 17 (\(lqPOSIX.1e\(rq, abandoned)
86 .Sh SEE ALSO
87 .Xr acl_free 3 ,
88 .Xr acl_get_entry 3 ,
89 .Xr acl_get_file 3 ,
90 .Xr acl_set_fd 3 ,
91 .Xr acl 5
92 .Sh AUTHOR
93 Derived from the FreeBSD manual pages written by
94 .An "Robert N M Watson" Aq rwatson@FreeBSD.org ,
95 and adapted for Linux by
96 .An "Andreas Gruenbacher" Aq a.gruenbacher@bestbits.at .