fetch.c revision 8874
1229997Sken/*-
2229997Sken * Copyright (c) 1980, 1992, 1993
3229997Sken *	The Regents of the University of California.  All rights reserved.
4229997Sken *
5229997Sken * Redistribution and use in source and binary forms, with or without
6229997Sken * modification, are permitted provided that the following conditions
7229997Sken * are met:
8229997Sken * 1. Redistributions of source code must retain the above copyright
9229997Sken *    notice, this list of conditions and the following disclaimer.
10229997Sken * 2. Redistributions in binary form must reproduce the above copyright
11229997Sken *    notice, this list of conditions and the following disclaimer in the
12229997Sken *    documentation and/or other materials provided with the distribution.
13229997Sken * 3. All advertising materials mentioning features or use of this software
14229997Sken *    must display the following acknowledgement:
15229997Sken *	This product includes software developed by the University of
16229997Sken *	California, Berkeley and its contributors.
17229997Sken * 4. Neither the name of the University nor the names of its contributors
18229997Sken *    may be used to endorse or promote products derived from this software
19229997Sken *    without specific prior written permission.
20229997Sken *
21229997Sken * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22229997Sken * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23229997Sken * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24229997Sken * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25229997Sken * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26229997Sken * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27229997Sken * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28229997Sken * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29229997Sken * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30229997Sken * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31229997Sken * SUCH DAMAGE.
32229997Sken */
33229997Sken
34229997Sken#ifndef lint
35229997Skenstatic char sccsid[] = "@(#)fetch.c	8.1 (Berkeley) 6/6/93";
36229997Sken#endif /* not lint */
37229997Sken
38229997Sken#include <sys/types.h>
39229997Sken#include "systat.h"
40229997Sken#include "extern.h"
41229997Sken
42229997Skenint
43229997Skenkvm_ckread(a, b, l)
44229997Sken	void *a, *b;
45229997Sken	int l;
46229997Sken{
47229997Sken	if (kvm_read(kd, (u_long)a, b, l) != l) {
48229997Sken		if (verbose)
49229997Sken			error("error reading kmem at %x\n", a);
50229997Sken		return (0);
51229997Sken	}
52229997Sken	else
53229997Sken		return (1);
54229997Sken}
55229997Sken