libexplain  1.4.D001
Functions
libexplain/is_efault/pointer.c File Reference
#include <libexplain/ac/errno.h>
#include <libexplain/ac/stdlib.h>
#include <libexplain/ac/sys/mman.h>
#include <libexplain/ac/unistd.h>
#include <libexplain/is_efault.h>

Go to the source code of this file.

Functions

int explain_is_efault_pointer (const void *data, size_t data_size)

Function Documentation

int explain_is_efault_pointer ( const void *  data,
size_t  data_size 
)

The explain_is_efault_pointer function may be used to determine whether or not a pointer is valid. Typically this is used when handling ambiguous EFAULT situations.

Parameters:
dataPointer to the base address of the memory to be checked.
data_sizeThe size in bytes of the memory to be checked (i.e. you can use sizeof(*data) in most situations).
Returns:
int; 1 if the pointer is bad (points outside the process address space), or 0 if the pointer is OK.

Definition at line 29 of file pointer.c.