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

NAME

6       explain_acl_set_file - explain acl_set_file(3) errors
7

SYNOPSIS

9       #include <libexplain/acl_set_file.h>
10       const char *explain_acl_set_file(const char *pathname, acl_type_t type,
11       acl_t acl);
12       const char *explain_errno_acl_set_file(int errnum, const char *path‐
13       name, acl_type_t type, acl_t acl);
14       void explain_message_acl_set_file(char *message, int message_size,
15       const char *pathname, acl_type_t type, acl_t acl);
16       void explain_message_errno_acl_set_file(char *message, int mes‐
17       sage_size, int errnum, const char *pathname, acl_type_t type, acl_t
18       acl);
19

DESCRIPTION

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

SEE ALSO

213       acl_set_file(3)
214               set an ACL by filename
215
216       explain_acl_set_file_or_die(3)
217               set an ACL by filename and report errors
218
220       libexplain version 1.4
221       Copyright (C) 2013 Peter Miller
222
223
224
225                                                       explain_acl_set_file(3)
Impressum