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

Go to the source code of this file.

Functions

void explain_buffer_errno_read (explain_string_buffer_t *sb, int errnum, int fildes, const void *data, size_t data_size)
void explain_buffer_errno_read_explanation (explain_string_buffer_t *sb, int errnum, const char *syscall_name, int fildes, const void *data, size_t data_size)

Function Documentation

void explain_buffer_errno_read ( explain_string_buffer_t sb,
int  errnum,
int  fildes,
const void *  data,
size_t  data_size 
)

The explain_buffer_errno_lseek_explanation function is called by the explain_buffer_errno_lseek function (and others) to print the explanation, the part after "because..."

Parameters:
sbThe string buffer into which the message is to be written.
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 file descriptor to be read from, exactly as passed to the read(2) system call.
dataThe address of the base address in memory to write the data (the original read call modified the data, this function will not), exactly as passed to the read(2) system call.
data_sizeThe maximum number of bytes of data to be read, exactly as passed to the read(2) system call.
Note:
Given a suitably thread safe buffer, this function is thread safe.

Definition at line 307 of file read.c.

void explain_buffer_errno_read_explanation ( explain_string_buffer_t sb,
int  errnum,
const char *  syscall_name,
int  fildes,
const void *  data,
size_t  data_size 
)

The explain_buffer_errno_read_explanation function is called by the explain_buffer_errno_read function (and others) to print the explanation, the part after "because..."

Parameters:
sbThe string buffer into which the message is to be written.
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.
syscall_nameThe name of the offending system call.
fildesThe file descriptor to be read from, exactly as passed to the read(2) system call.
dataThe address of the base address in memory to write the data (the original read call modified the data, this function will not), exactly as passed to the read(2) system call.
data_sizeThe maximum number of bytes of data to be read, exactly as passed to the read(2) system call.
Note:
Given a suitably thread safe buffer, this function is thread safe.

Definition at line 70 of file read.c.