useracc(9F)
NAME
useracc − verify whether user has access to memory
SYNOPSIS
#include <sys/types.h>
#include <sys/buf.h>
#include <sys/vm.h>
int useracc(caddr_t base, uint count, int access
);
ARGUMENTS
base The start address of the user data area.
count The size of the data transfer in bytes.
access A flag to determine whether the access is a read or write. The defined constant B_READ specifies a read from the device and a write to memory. This requires that the user have write access permission for the specified data area. The defined constant B_WRITE specifies a read from memory and a write to the device. It requires read access permission for the data area ( B_READ and B_WRITE are defined in the system header sys/buf.h).
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
DESCRIPTION
useracc() verifies if a user has proper access to memory. It is not necessary to use useracc() for buffered I/O (including use of the copyin(9F) and copyout(9F) functions).
RETURN VALUES
Under normal conditions, 1 is returned. If the user does not have the proper access permission to the memory specified return EFAULT.
CONTEXT
useracc() can be called from user or interrupt context.
SEE ALSO
copyin(9F), copyout(9F), drv_priv(9F)
Sun Microsystems — Last change: 11 Apr 1991