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

NAME

6       explain_fstatvfs - explain fstatvfs(2) errors
7

SYNOPSIS

9       #include <libexplain/fstatvfs.h>
10       const char *explain_fstatvfs(int fildes, struct statvfs *data);
11       const char *explain_errno_fstatvfs(int errnum, int fildes, struct
12       statvfs *data);
13       void explain_message_fstatvfs(char *message, int message_size, int
14       fildes, struct statvfs *data);
15       void explain_message_errno_fstatvfs(char *message, int message_size,
16       int errnum, int fildes, struct statvfs *data);
17

DESCRIPTION

19       These functions may be used to obtain explanations for errors  returned
20       by the fstatvfs(2) system call.
21
22   explain_fstatvfs
23       const char *explain_fstatvfs(int fildes, struct statvfs *data);
24
25       The  explain_fstatvfs  function  is used to obtain an explanation of an
26       error returned by the fstatvfs(2) 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 fstatvfs(2) sys‐
34               tem call.
35
36       data    The original data, exactly as passed to the fstatvfs(2)  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 (fstatvfs(fildes, data) < 0)
52              {
53                  fprintf(stderr, "%s\n", explain_fstatvfs(fildes, data));
54                  exit(EXIT_FAILURE);
55              }
56
57       The   above   code   example   is   available   pre‐packaged   as   the
58       explain_fstatvfs_or_die(3) function.
59
60   explain_errno_fstatvfs
61       const char *explain_errno_fstatvfs(int errnum, int fildes, struct
62       statvfs *data);
63
64       The explain_errno_fstatvfs function is used to obtain an explanation of
65       an error returned by the fstatvfs(2) system call.  The least  the  mes‐
66       sage  will contain is the value of strerror(errno), but usually it will
67       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 fstatvfs(2)  sys‐
76               tem call.
77
78       data    The  original data, exactly as passed to the fstatvfs(2) 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 (fstatvfs(fildes, data) < 0)
94              {
95                  int err = errno;
96                  fprintf(stderr, "%s\n", explain_errno_fstatvfs(err, fildes,
97                  data));
98                  exit(EXIT_FAILURE);
99              }
100
101       The   above   code   example   is   available   pre‐packaged   as   the
102       explain_fstatvfs_or_die(3) function.
103
104   explain_message_fstatvfs
105       void explain_message_fstatvfs(char *message, int message_size, int
106       fildes, struct statvfs *data);
107
108       The  explain_message_fstatvfs function is used to obtain an explanation
109       of an error returned by the fstatvfs(2) system  call.   The  least  the
110       message  will  contain  is the value of strerror(errno), but usually it
111       will do much better, and indicate the underlying cause in more detail.
112
113       The errno global variable will be used to obtain the error value to  be
114       decoded.
115
116       message The location in which to store the returned message. If a suit‐
117               able message return buffer is supplied, this function is thread
118               safe.
119
120       message_size
121               The  size  in  bytes  of  the  location  in  which to store the
122               returned message.
123
124       fildes  The original fildes, exactly as passed to the fstatvfs(2)  sys‐
125               tem call.
126
127       data    The  original data, exactly as passed to the fstatvfs(2) system
128               call.
129
130       Example: This function is intended to be used in a fashion  similar  to
131       the following example:
132              if (fstatvfs(fildes, data) < 0)
133              {
134                  char message[3000];
135                  explain_message_fstatvfs(message, sizeof(message), fildes,
136                  data);
137                  fprintf(stderr, "%s\n", message);
138                  exit(EXIT_FAILURE);
139              }
140
141       The   above   code   example   is   available   pre‐packaged   as   the
142       explain_fstatvfs_or_die(3) function.
143
144   explain_message_errno_fstatvfs
145       void explain_message_errno_fstatvfs(char *message, int message_size,
146       int errnum, int fildes, struct statvfs *data);
147
148       The explain_message_errno_fstatvfs function is used to obtain an expla‐
149       nation  of an error returned by the fstatvfs(2) system call.  The least
150       the message will contain is the value of strerror(errno),  but  usually
151       it  will  do  much  better,  and  indicate the underlying cause in more
152       detail.
153
154       message The location in which to store the returned message. If a suit‐
155               able message return buffer is supplied, this function is thread
156               safe.
157
158       message_size
159               The size in bytes  of  the  location  in  which  to  store  the
160               returned message.
161
162       errnum  The  error value to be decoded, usually obtained from the errno
163               global variable just before this function is  called.  This  is
164               necessary  if you need to call any code between the system call
165               to be explained and this function, because many libc  functions
166               will alter the value of errno.
167
168       fildes  The  original fildes, exactly as passed to the fstatvfs(2) sys‐
169               tem call.
170
171       data    The original data, exactly as passed to the fstatvfs(2)  system
172               call.
173
174       Example:  This  function is intended to be used in a fashion similar to
175       the following example:
176              if (fstatvfs(fildes, data) < 0)
177              {
178                  int err = errno;
179                  char message[3000];
180                  explain_message_errno_fstatvfs(message, sizeof(message),
181                  err, fildes, data);
182                  fprintf(stderr, "%s\n", message);
183                  exit(EXIT_FAILURE);
184              }
185
186       The   above   code   example   is   available   pre‐packaged   as   the
187       explain_fstatvfs_or_die(3) function.
188

SEE ALSO

190       fstatvfs(2)
191               get file system statistics
192
193       explain_fstatvfs_or_die(3)
194               get file system statistics and report errors
195
197       libexplain version 1.4
198       Copyright (C) 2010 Peter Miller
199
200
201
202                                                           explain_fstatvfs(3)
Impressum