useracc (9)
Leading comments
$NetBSD: access.9,v 1.1 1996/06/16 10:38:35 pk Exp $
Copyright (c) 1996 The NetBSD Foundation, Inc.
All rights reserved.
This code is derived from software contributed to The NetBSD Foundation
by Paul Kranenburg.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaime...
(The comments found at the beginning of the groff file "man9/useracc.9freebsd".)
NAME
kernacc
useracc
- check memory regions for accessibility
SYNOPSIS
In sys/param.h
In sys/proc.h
In vm/vm.h
In vm/vm_extern.h
Ft int
Fn kernacc void *addr int len int rw
Ft int
Fn useracc void *addr int len int rw
DESCRIPTION
The
Fn kernacc
and
Fn useracc
functions check whether operations of the type specified in
Fa rw
are permitted in the range of virtual addresses given by
Fa addr
and
Fa len .
The possible values of
Fa rw
are any bitwise combination of
VM_PROT_READ
VM_PROT_WRITE
and
VM_PROT_EXECUTE
Fn kernacc
checks addresses in the kernel address space, while
Fn useracc
considers
Fa 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 boolean true if the type of access specified
by
Fa rw
is permitted.
Otherwise boolean false is returned.
BUGS
The process pointer should be passed in as an argument to
Fn useracc .