libexplain  1.4.D001
Functions
libexplain/buffer/errno/fopen.h File Reference
#include <libexplain/string_buffer.h>

Go to the source code of this file.

Functions

void explain_buffer_errno_fopen (explain_string_buffer_t *sb, int errnum, const char *path, const char *mode)
void explain_buffer_errno_fopen_explanation (explain_string_buffer_t *sb, int errnum, const char *syscall_name, const char *path, const char *mode)

Function Documentation

void explain_buffer_errno_fopen ( explain_string_buffer_t sb,
int  errnum,
const char *  path,
const char *  mode 
)

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:
sbThe string buffer in which the message is being constructed. If a safe buffer s specified, this function is thread safe.
errnumThe 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.
pathThe original path, exactly has passed to the fopen(3) system call.
modeThe original mode, exactly has passed to the fopen(3) system call.

Definition at line 114 of file fopen.c.

void explain_buffer_errno_fopen_explanation ( explain_string_buffer_t sb,
int  errnum,
const char *  syscall_name,
const char *  path,
const char *  mode 
)

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:
sbThe string buffer in which the message is being constructed.
errnumThe error value to be decoded.
syscall_nameThe name of the offending system call.
pathThe original path, exactly has passed to the fopen(3) system call.
modeThe original mode, exactly has passed to the fopen(3) system call.

Definition at line 55 of file fopen.c.