xref: /freebsd/share/man/man9/kernacc.9 (revision 1e133bd4803f0eb6813663583e40a9a651153669)
1dad0f566SMike Pritchard.\"	$NetBSD: access.9,v 1.1 1996/06/16 10:38:35 pk Exp $
2dad0f566SMike Pritchard.\"
3dad0f566SMike Pritchard.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
4dad0f566SMike Pritchard.\" All rights reserved.
5dad0f566SMike Pritchard.\"
6dad0f566SMike Pritchard.\" This code is derived from software contributed to The NetBSD Foundation
7dad0f566SMike Pritchard.\" by Paul Kranenburg.
8dad0f566SMike Pritchard.\"
9dad0f566SMike Pritchard.\" Redistribution and use in source and binary forms, with or without
10dad0f566SMike Pritchard.\" modification, are permitted provided that the following conditions
11dad0f566SMike Pritchard.\" are met:
12dad0f566SMike Pritchard.\" 1. Redistributions of source code must retain the above copyright
13dad0f566SMike Pritchard.\"    notice, this list of conditions and the following disclaimer.
14dad0f566SMike Pritchard.\" 2. Redistributions in binary form must reproduce the above copyright
15dad0f566SMike Pritchard.\"    notice, this list of conditions and the following disclaimer in the
16dad0f566SMike Pritchard.\"    documentation and/or other materials provided with the distribution.
17dad0f566SMike Pritchard.\" 3. All advertising materials mentioning features or use of this software
18dad0f566SMike Pritchard.\"    must display the following acknowledgement:
19dad0f566SMike Pritchard.\"        This product includes software developed by the NetBSD
20dad0f566SMike Pritchard.\"        Foundation, Inc. and its contributors.
21dad0f566SMike Pritchard.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22dad0f566SMike Pritchard.\"    contributors may be used to endorse or promote products derived
23dad0f566SMike Pritchard.\"    from this software without specific prior written permission.
24dad0f566SMike Pritchard.\"
25dad0f566SMike Pritchard.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26dad0f566SMike Pritchard.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27dad0f566SMike Pritchard.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28dad0f566SMike Pritchard.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
29dad0f566SMike Pritchard.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30dad0f566SMike Pritchard.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31dad0f566SMike Pritchard.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32dad0f566SMike Pritchard.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33dad0f566SMike Pritchard.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34dad0f566SMike Pritchard.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35dad0f566SMike Pritchard.\" POSSIBILITY OF SUCH DAMAGE.
36dad0f566SMike Pritchard.\"
37dad0f566SMike Pritchard.Dd June 16, 1996
381e133bd4SMike Pritchard.Dt KERNACC 9
39dad0f566SMike Pritchard.Os FreeBSD
40dad0f566SMike Pritchard.Sh NAME
41dad0f566SMike Pritchard.Nm kernacc ,
42dad0f566SMike Pritchard.Nm useracc
43dad0f566SMike Pritchard.Nd check memory regions for accessibility
44dad0f566SMike Pritchard.Sh SYNOPSIS
45dad0f566SMike Pritchard.Ft int
46dad0f566SMike Pritchard.Fn kernacc "caddr_t addr" "int len" "int rw"
47dad0f566SMike Pritchard.Ft int
48dad0f566SMike Pritchard.Fn useracc "caddr_t addr" "int len" "int rw"
49dad0f566SMike Pritchard.Sh DESCRIPTION
50dad0f566SMike PritchardThe
51dad0f566SMike Pritchard.Fn kernacc
52dad0f566SMike Pritchardand
53dad0f566SMike Pritchard.Fn useracc
54dad0f566SMike Pritchardfunctions check whether operations of the type specified in
55dad0f566SMike Pritchard.Fa rw
56dad0f566SMike Pritchardare permitted in the range of virtual addresses given by
57dad0f566SMike Pritchard.Fa addr
58dad0f566SMike Pritchardand
59dad0f566SMike Pritchard.Fa len .
60dad0f566SMike PritchardThe possible values of
61dad0f566SMike Pritchard.Fa rw
62dad0f566SMike Pritchardare
63dad0f566SMike Pritchard.Dv B_READ
64dad0f566SMike Pritchardand
65dad0f566SMike Pritchard.Dv B_WRITE .
66dad0f566SMike Pritchard.Fn kernacc
67dad0f566SMike Pritchardchecks addresses in the kernel address space, while
68dad0f566SMike Pritchard.Fn useracc
69dad0f566SMike Pritchardconsiders
70dad0f566SMike Pritchard.Fa addr
71dad0f566SMike Pritchardto represent an user space address. The process context to use for this
72dad0f566SMike Pritchardoperation is taken from the global variable
73dad0f566SMike Pritchard.Va curproc .
74dad0f566SMike Pritchard.Pp
75dad0f566SMike Pritchard.Sh RETURN VALUES
76dad0f566SMike PritchardBoth functions return 1 if the type of access specified by
77dad0f566SMike Pritchard.Fa rw
78dad0f566SMike Pritchardis permitted. Otherwise 0 is returned.
79dad0f566SMike Pritchard.Pp
80dad0f566SMike Pritchard.Sh BUGS
81dad0f566SMike PritchardThe process pointer should be passed in as an argument.
82