ACCESS(9)

NAME
access, kernacc, useracc - check memory regions for accessability

SYNOPSIS
int
kernacc(caddr_t addr, size_t len, int rw);
int
useracc(caddr_t addr, size_t len, int rw);

DESCRIPTION
The kernacc() and useracc() functions check whether operations of the type specified in rw are permitted in the range of virtual addresses given by addr and len. The possible values of rw are B_READ and B_WRITE. kernacc() checks addresses in the kernel address space, while useracc() considers addr to represent an user space address. The process context to use for this operation is taken from the global variable curproc.

RETURN VALUES
Both functions return 1 if the type of access specified by rw is permitted. Otherwise 0 is returned.

BUGS
The process pointer should be passed in as an argument.