1explain_acl_set_fd(3)      Library Functions Manual      explain_acl_set_fd(3)
2
3
4

NAME

6       explain_acl_set_fd - explain acl_set_fd(3) errors
7

SYNOPSIS

9       #include <libexplain/acl_set_fd.h>
10       const char *explain_acl_set_fd(int fildes, acl_t acl);
11       const char *explain_errno_acl_set_fd(int errnum, int fildes, acl_t
12       acl);
13       void explain_message_acl_set_fd(char *message, int message_size, int
14       fildes, acl_t acl);
15       void explain_message_errno_acl_set_fd(char *message, int message_size,
16       int errnum, int fildes, acl_t acl);
17

DESCRIPTION

19       These functions may be used to obtain explanations for errors  returned
20       by the acl_set_fd(3) system call.
21
22   explain_acl_set_fd
23       const char *explain_acl_set_fd(int fildes, acl_t acl);
24
25       The  explain_acl_set_fd function is used to obtain an explanation of an
26       error returned by the acl_set_fd(3) system call. The least the  message
27       will  contain  is  the value of strerror(errno), but usually it will do
28       much better, and indicate the underlying cause in more detail.
29
30       The errno global variable will be used to obtain the error value to  be
31       decoded.
32
33       fildes  The  original  fildes,  exactly  as passed to the acl_set_fd(3)
34               system call.
35
36       acl     The original acl, exactly as passed to the acl_set_fd(3) system
37               call.
38
39       Returns:
40               The message explaining the error. This message buffer is shared
41               by all libexplain functions which do not  supply  a  buffer  in
42               their argument list.  This will be overwritten by the next call
43               to any libexplain function which shares this buffer,  including
44               other threads.
45
46       Note: This function is not thread safe, because it shares a return buf‐
47       fer across all threads, and many other functions in this library.
48
49       Example: This function is intended to be used in a fashion  similar  to
50       the following example:
51              if (acl_set_fd(fildes, acl) < 0)
52              {
53                  fprintf(stderr, "%s\n", explain_acl_set_fd(fildes, acl));
54                  exit(EXIT_FAILURE);
55              }
56
57       The   above   code   example   is   available   pre-packaged   as   the
58       explain_acl_set_fd_or_die(3) function.
59
60   explain_errno_acl_set_fd
61       const char *explain_errno_acl_set_fd(int errnum, int fildes, acl_t
62       acl);
63
64       The  explain_errno_acl_set_fd function is used to obtain an explanation
65       of an error returned by the acl_set_fd(3) system call.  The  least  the
66       message  will  contain  is the value of strerror(errno), but usually it
67       will do much better, and indicate the underlying cause in more detail.
68
69       errnum  The error value to be decoded, usually obtained from the  errno
70               global  variable  just  before this function is called. This is
71               necessary if you need to call any code between the system  call
72               to  be explained and this function, because many libc functions
73               will alter the value of errno.
74
75       fildes  The original fildes, exactly as  passed  to  the  acl_set_fd(3)
76               system call.
77
78       acl     The original acl, exactly as passed to the acl_set_fd(3) system
79               call.
80
81       Returns:
82               The message explaining the error. This message buffer is shared
83               by  all  libexplain  functions  which do not supply a buffer in
84               their argument list.  This will be overwritten by the next call
85               to  any libexplain function which shares this buffer, including
86               other threads.
87
88       Note: This function is not thread safe, because it shares a return buf‐
89       fer across all threads, and many other functions in this library.
90
91       Example:  This  function is intended to be used in a fashion similar to
92       the following example:
93              if (acl_set_fd(fildes, acl) < 0)
94              {
95                  int err = errno;
96                  fprintf(stderr, "%s\n", explain_errno_acl_set_fd(err,
97                  fildes, acl));
98                  exit(EXIT_FAILURE);
99              }
100
101       The   above   code   example   is   available   pre-packaged   as   the
102       explain_acl_set_fd_or_die(3) function.
103
104   explain_message_acl_set_fd
105       void explain_message_acl_set_fd(char *message, int message_size, int
106       fildes, acl_t acl);
107
108       The  explain_message_acl_set_fd  function is used to obtain an explana‐
109       tion of an error returned by the acl_set_fd(3) system call.  The  least
110       the  message  will contain is the value of strerror(errno), but usually
111       it will do much better, and  indicate  the  underlying  cause  in  more
112       detail.
113
114       The  errno global variable will be used to obtain the error value to be
115       decoded.
116
117       message The location in which to store the returned message. If a suit‐
118               able message return buffer is supplied, this function is thread
119               safe.
120
121       message_size
122               The size in bytes  of  the  location  in  which  to  store  the
123               returned message.
124
125       fildes  The  original  fildes,  exactly  as passed to the acl_set_fd(3)
126               system call.
127
128       acl     The original acl, exactly as passed to the acl_set_fd(3) system
129               call.
130
131       Example:  This  function is intended to be used in a fashion similar to
132       the following example:
133              if (acl_set_fd(fildes, acl) < 0)
134              {
135                  char message[3000];
136                  explain_message_acl_set_fd(message, sizeof(message), fildes,
137                  acl);
138                  fprintf(stderr, "%s\n", message);
139                  exit(EXIT_FAILURE);
140              }
141
142       The   above   code   example   is   available   pre-packaged   as   the
143       explain_acl_set_fd_or_die(3) function.
144
145   explain_message_errno_acl_set_fd
146       void explain_message_errno_acl_set_fd(char *message, int message_size,
147       int errnum, int fildes, acl_t acl);
148
149       The  explain_message_errno_acl_set_fd  function  is  used  to obtain an
150       explanation of an error returned by the acl_set_fd(3) system call.  The
151       least  the  message  will  contain is the value of strerror(errno), but
152       usually it will do much better, and indicate the  underlying  cause  in
153       more detail.
154
155       message The location in which to store the returned message. If a suit‐
156               able message return buffer is supplied, this function is thread
157               safe.
158
159       message_size
160               The  size  in  bytes  of  the  location  in  which to store the
161               returned message.
162
163       errnum  The error value to be decoded, usually obtained from the  errno
164               global  variable  just  before this function is called. This is
165               necessary if you need to call any code between the system  call
166               to  be explained and this function, because many libc functions
167               will alter the value of errno.
168
169       fildes  The original fildes, exactly as  passed  to  the  acl_set_fd(3)
170               system call.
171
172       acl     The original acl, exactly as passed to the acl_set_fd(3) system
173               call.
174
175       Example: This function is intended to be used in a fashion  similar  to
176       the following example:
177              if (acl_set_fd(fildes, acl) < 0)
178              {
179                  int err = errno;
180                  char message[3000];
181                  explain_message_errno_acl_set_fd(message, sizeof(message),
182                  err, fildes, acl);
183                  fprintf(stderr, "%s\n", message);
184                  exit(EXIT_FAILURE);
185              }
186
187       The   above   code   example   is   available   pre-packaged   as   the
188       explain_acl_set_fd_or_die(3) function.
189

SEE ALSO

191       acl_set_fd(3)
192               set an ACL by file descriptor
193
194       explain_acl_set_fd_or_die(3)
195               set an ACL by file descriptor and report errors
196
198       libexplain version 1.4
199       Copyright (C) 2013 Peter Miller
200
201
202
203                                                         explain_acl_set_fd(3)
Impressum