logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

kernacc, useracc — check memory regions for accessibility

Bugs

       The process pointer should be passed in as an argument to useracc().

Debian                                            June 16, 1996                                       KERNACC(9)

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  any  bitwise
       combination of VM_PROT_READ, VM_PROT_WRITE and VM_PROT_EXECUTE.  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.

Name

       kernacc, useracc — check memory regions for accessibility

Return Values

       Both functions return boolean true if the type of access specified by rw is permitted.  Otherwise boolean
       false is returned.

Synopsis

#include<sys/param.h>#include<sys/proc.h>#include<vm/vm.h>#include<vm/vm_extern.h>intkernacc(void*addr, intlen, intrw);

       intuseracc(void*addr, intlen, intrw);

See Also