Go to the source code of this file.
Functions |
static void | explain_buffer_errno_lseek_system_call (explain_string_buffer_t *sb, int errnum, int fildes, off_t offset, int whence) |
void | explain_buffer_errno_lseek_explanation (explain_string_buffer_t *sb, int errnum, const char *syscall_name, int fildes, off_t offset, int whence) |
void | explain_buffer_errno_lseek (explain_string_buffer_t *sb, int errnum, int fildes, off_t offset, int whence) |
Function Documentation
The explain_buffer_errno_lseek function may be used to obtain a human readable explanation of what went wrong in an lseek(2) system call. 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:
-
sb | The string buffer into which the message is to be written. |
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. |
fildes | The file descriptor to seek on, exactly as passed to the lseek(2) system call. |
offset | exactly as passed to the lseek(2) system call. |
whence | exactly as passed to the lseek(2) system call. |
- Note:
- Given a suitably thread safe buffer, this function is thread safe.
Definition at line 319 of file lseek.c.
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:
-
sb | The string buffer into which the message is to be written. |
errnum | The error value to be decoded. |
syscall_name | The name of the offending system call. |
fildes | The file descriptor to seek on, exactly as passed to the lseek(2) system call. |
offset | exactly as passed to the lseek(2) system call. |
whence | exactly as passed to the lseek(2) system call. |
- Note:
- Given a suitably thread safe buffer, this function is thread safe.
Definition at line 95 of file lseek.c.