xref: /netbsd-src/sys/miscfs/procfs/procfs_mem.c (revision 168cd830d22e1f4a4c2bde1105f9f94d40fb870d)
1*168cd830Schristos /*	$NetBSD: procfs_mem.c,v 1.37 2006/11/16 01:33:38 christos Exp $	*/
2aad01611Sagc 
3aad01611Sagc /*
4aad01611Sagc  * Copyright (c) 1993
5aad01611Sagc  *	The Regents of the University of California.  All rights reserved.
6aad01611Sagc  *
7aad01611Sagc  * This code is derived from software contributed to Berkeley by
8aad01611Sagc  * Jan-Simon Pendry and Sean Eric Fagan.
9aad01611Sagc  *
10aad01611Sagc  * Redistribution and use in source and binary forms, with or without
11aad01611Sagc  * modification, are permitted provided that the following conditions
12aad01611Sagc  * are met:
13aad01611Sagc  * 1. Redistributions of source code must retain the above copyright
14aad01611Sagc  *    notice, this list of conditions and the following disclaimer.
15aad01611Sagc  * 2. Redistributions in binary form must reproduce the above copyright
16aad01611Sagc  *    notice, this list of conditions and the following disclaimer in the
17aad01611Sagc  *    documentation and/or other materials provided with the distribution.
18aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
19aad01611Sagc  *    may be used to endorse or promote products derived from this software
20aad01611Sagc  *    without specific prior written permission.
21aad01611Sagc  *
22aad01611Sagc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23aad01611Sagc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24aad01611Sagc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25aad01611Sagc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26aad01611Sagc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27aad01611Sagc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28aad01611Sagc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29aad01611Sagc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30aad01611Sagc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31aad01611Sagc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32aad01611Sagc  * SUCH DAMAGE.
33aad01611Sagc  *
34aad01611Sagc  *	@(#)procfs_mem.c	8.5 (Berkeley) 6/15/94
35aad01611Sagc  */
36cf92afd6Scgd 
37699e3be9Scgd /*
38699e3be9Scgd  * Copyright (c) 1993 Jan-Simon Pendry
39cde1d475Smycroft  * Copyright (c) 1993 Sean Eric Fagan
40699e3be9Scgd  *
41699e3be9Scgd  * This code is derived from software contributed to Berkeley by
42cde1d475Smycroft  * Jan-Simon Pendry and Sean Eric Fagan.
43699e3be9Scgd  *
44699e3be9Scgd  * Redistribution and use in source and binary forms, with or without
45699e3be9Scgd  * modification, are permitted provided that the following conditions
46699e3be9Scgd  * are met:
47699e3be9Scgd  * 1. Redistributions of source code must retain the above copyright
48699e3be9Scgd  *    notice, this list of conditions and the following disclaimer.
49699e3be9Scgd  * 2. Redistributions in binary form must reproduce the above copyright
50699e3be9Scgd  *    notice, this list of conditions and the following disclaimer in the
51699e3be9Scgd  *    documentation and/or other materials provided with the distribution.
52699e3be9Scgd  * 3. All advertising materials mentioning features or use of this software
53699e3be9Scgd  *    must display the following acknowledgement:
54699e3be9Scgd  *	This product includes software developed by the University of
55699e3be9Scgd  *	California, Berkeley and its contributors.
56699e3be9Scgd  * 4. Neither the name of the University nor the names of its contributors
57699e3be9Scgd  *    may be used to endorse or promote products derived from this software
58699e3be9Scgd  *    without specific prior written permission.
59699e3be9Scgd  *
60699e3be9Scgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
61699e3be9Scgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
62699e3be9Scgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
63699e3be9Scgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
64699e3be9Scgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
65699e3be9Scgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
66699e3be9Scgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
67699e3be9Scgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
68699e3be9Scgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
69699e3be9Scgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
70699e3be9Scgd  * SUCH DAMAGE.
71699e3be9Scgd  *
72cf92afd6Scgd  *	@(#)procfs_mem.c	8.5 (Berkeley) 6/15/94
73699e3be9Scgd  */
74699e3be9Scgd 
75699e3be9Scgd /*
76699e3be9Scgd  * This is a lightly hacked and merged version
77699e3be9Scgd  * of sef's pread/pwrite functions
78699e3be9Scgd  */
79699e3be9Scgd 
80e4b00f43Slukem #include <sys/cdefs.h>
81*168cd830Schristos __KERNEL_RCSID(0, "$NetBSD: procfs_mem.c,v 1.37 2006/11/16 01:33:38 christos Exp $");
82e4b00f43Slukem 
83699e3be9Scgd #include <sys/param.h>
84699e3be9Scgd #include <sys/proc.h>
85699e3be9Scgd #include <sys/vnode.h>
86f1f51aa2Sthorpej #include <sys/ptrace.h>
87d2397ac5Smrg 
88699e3be9Scgd #include <miscfs/procfs/procfs.h>
89d2397ac5Smrg 
90cde1d475Smycroft int
procfs_domem(struct lwp * curl,struct lwp * l,struct pfsnode * pfs,struct uio * uio)914d595fd7Schristos procfs_domem(
924d595fd7Schristos     struct lwp *curl,		/* tracer */
934d595fd7Schristos     struct lwp *l,		/* traced */
94*168cd830Schristos     struct pfsnode *pfs,
954d595fd7Schristos     struct uio *uio
964d595fd7Schristos )
97699e3be9Scgd {
98699e3be9Scgd 
9995e1ffb1Schristos 	return (process_domem(curl, l, uio));
100945beb8dSexplorer }
101