Go to the source code of this file.
Functions |
static void | explain_buffer_errno_fopen_system_call (explain_string_buffer_t *sb, int errnum, const char *pathname, const char *flags_string) |
void | explain_buffer_errno_fopen_explanation (explain_string_buffer_t *sb, int errnum, const char *syscall_name, const char *pathname, const char *flags) |
void | explain_buffer_errno_fopen (explain_string_buffer_t *sb, int errnum, const char *pathname, const char *flags_string) |
void | explain_string_flags_einval (const explain_string_flags_t *sf, explain_string_buffer_t *sb, const char *caption) |
Function Documentation
The explain_buffer_errno_fopen function is used to obtain an explanation of an error returned by the fopen(3) function. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail.
- Parameters:
-
sb | The string buffer in which the message is being constructed. If a safe buffer s specified, this function is thread safe. |
errnum | The error value to be decoded, usually obtain from the errno global variable just before this function is called. This is necessary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. |
path | The original path, exactly has passed to the fopen(3) system call. |
mode | The original mode, exactly has passed to the fopen(3) system call. |
Definition at line 114 of file fopen.c.
The explain_buffer_errno_fopen_explanation function is used by the explain_buffer_errno_fopen function (and others) to print the extended "because..." part of the explanation.
- Parameters:
-
sb | The string buffer in which the message is being constructed. |
errnum | The error value to be decoded. |
syscall_name | The name of the offending system call. |
path | The original path, exactly has passed to the fopen(3) system call. |
mode | The original mode, exactly has passed to the fopen(3) system call. |
Definition at line 55 of file fopen.c.
The explain_string_flags_einval function may be used to print an expanation for an EINVAL error relating to the given string flags.
- Parameters:
-
sf | The string flags of interest. |
sb | The string buffer to print into. |
caption | The name of th offending system call argument. |
Definition at line 140 of file fopen.c.