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

NAME

6       explain_acl_get_fd - explain acl_get_fd(3) errors
7

SYNOPSIS

9       #include <libexplain/acl_get_fd.h>
10       const char *explain_acl_get_fd(int fildes);
11       const char *explain_errno_acl_get_fd(int errnum, int fildes);
12       void explain_message_acl_get_fd(char *message, int message_size, int
13       fildes);
14       void explain_message_errno_acl_get_fd(char *message, int message_size,
15       int errnum, int fildes);
16

DESCRIPTION

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

SEE ALSO

181       acl_get_fd(3)
182               Execute acl_get_fd(3)
183
184       explain_acl_get_fd_or_die(3)
185               Execute acl_get_fd(3) and report errors
186
188       libexplain version 1.4
189       Copyright (C) 2013 Peter Miller
190
191
192
193                                                         explain_acl_get_fd(3)
Impressum