libexplain  1.4.D001
Functions
libexplain/buffer/errno/execvp.c File Reference
#include <libexplain/ac/errno.h>
#include <libexplain/ac/stdlib.h>
#include <libexplain/ac/string.h>
#include <libexplain/ac/sys/stat.h>
#include <libexplain/ac/unistd.h>
#include <libexplain/buffer/caption_name_type.h>
#include <libexplain/buffer/efault.h>
#include <libexplain/buffer/errno/execve.h>
#include <libexplain/buffer/errno/execvp.h>
#include <libexplain/buffer/pathname.h>
#include <libexplain/buffer/pointer.h>
#include <libexplain/explanation.h>
#include <libexplain/have_permission.h>
#include <libexplain/name_max.h>
#include <libexplain/is_efault.h>
#include <libexplain/sizeof.h>

Go to the source code of this file.

Functions

static size_t count (char *const *p)
static void explain_buffer_errno_execvp_system_call (explain_string_buffer_t *sb, int errnum, const char *pathname, char *const *argv)
static int can_execute (const char *pathname)
void explain_buffer_errno_execvp_explanation (explain_string_buffer_t *sb, int errnum, const char *syscall_name, const char *pathname, char *const *argv)
void explain_buffer_errno_execvp (explain_string_buffer_t *sb, int errnum, const char *pathname, char *const *argv)

Function Documentation

static int can_execute ( const char *  pathname) [static]

Definition at line 110 of file execvp.c.

static size_t count ( char *const *  p) [static]

Definition at line 39 of file execvp.c.

void explain_buffer_errno_execvp ( explain_string_buffer_t sb,
int  errnum,
const char *  pathname,
char *const *  argv 
)

The explain_buffer_errno_execvp function is used to obtain an explanation of an error returned by the execvp(3) 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:
sbThe string buffer to print the message into. If a safe buffer is specified, this function is thread safe.
errnumThe error value to be decoded, usually obtained 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.
pathnameThe original pathname, exactly as passed to the execvp(3) system call.
argvThe original argv, exactly as passed to the execvp(3) system call.

Definition at line 357 of file execvp.c.

void explain_buffer_errno_execvp_explanation ( explain_string_buffer_t sb,
int  errnum,
const char *  syscall_name,
const char *  pathname,
char *const *  argv 
)

Definition at line 124 of file execvp.c.

static void explain_buffer_errno_execvp_system_call ( explain_string_buffer_t sb,
int  errnum,
const char *  pathname,
char *const *  argv 
) [static]

Definition at line 54 of file execvp.c.