libexplain  1.4.D001
Functions
libexplain/buffer/errno/close.c File Reference
#include <libexplain/ac/errno.h>
#include <libexplain/ac/fcntl.h>
#include <libexplain/buffer/ebadf.h>
#include <libexplain/buffer/eintr.h>
#include <libexplain/buffer/eio.h>
#include <libexplain/buffer/errno/close.h>
#include <libexplain/buffer/errno/generic.h>
#include <libexplain/buffer/fildes_to_pathname.h>
#include <libexplain/buffer/gettext.h>
#include <libexplain/explanation.h>
#include <libexplain/string_buffer.h>

Go to the source code of this file.

Functions

static void explain_buffer_errno_close_system_call (explain_string_buffer_t *sb, int errnum, int fildes)
void explain_buffer_errno_close_explanation (explain_string_buffer_t *sb, int errnum, const char *syscall_name, int fildes)
void explain_buffer_errno_close (explain_string_buffer_t *sb, int errnum, int fildes)

Function Documentation

void explain_buffer_errno_close ( explain_string_buffer_t sb,
int  errnum,
int  fildes 
)

The explain_buffer_errno_close function is used to obtain an explanation of an error returned by the close(2) function. The least the message will contain is the value of strerror(errnum), 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 is 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.
fildesThe original file descriptor, exactly as passed to the close(2) system call.

Definition at line 104 of file close.c.

void explain_buffer_errno_close_explanation ( explain_string_buffer_t sb,
int  errnum,
const char *  syscall_name,
int  fildes 
)

The explain_buffer_errno_close_explanation function is used by the explain_buffer_errno_close 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.
fildesThe original file descriptor, exactly as passed to the close(2) system call.

Definition at line 46 of file close.c.

static void explain_buffer_errno_close_system_call ( explain_string_buffer_t sb,
int  errnum,
int  fildes 
) [static]

Definition at line 35 of file close.c.