sys_process.c (0b08f5f73743f75cfe4603d65bf68a36aca310af) | sys_process.c (afc6ea238fca8459050ec15d5d897354e1d0435a) |
---|---|
1/* 2 * Copyright (c) 1994, Sean Eric Fagan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * | 1/* 2 * Copyright (c) 1994, Sean Eric Fagan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * |
31 * $Id: sys_process.c,v 1.35 1998/02/04 22:32:36 eivind Exp $ | 31 * $Id: sys_process.c,v 1.36 1998/02/06 12:13:27 eivind Exp $ |
32 */ 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/sysproto.h> 37#include <sys/proc.h> 38#include <sys/vnode.h> 39#include <sys/ptrace.h> --- 364 unchanged lines hidden (view full) --- 404 error = EINVAL; /* EOF */ 405 } 406 return (error); 407 408 case PT_READ_U: 409 if ((u_int)uap->addr > (UPAGES * PAGE_SIZE - sizeof(int))) { 410 return EFAULT; 411 } | 32 */ 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/sysproto.h> 37#include <sys/proc.h> 38#include <sys/vnode.h> 39#include <sys/ptrace.h> --- 364 unchanged lines hidden (view full) --- 404 error = EINVAL; /* EOF */ 405 } 406 return (error); 407 408 case PT_READ_U: 409 if ((u_int)uap->addr > (UPAGES * PAGE_SIZE - sizeof(int))) { 410 return EFAULT; 411 } |
412 if (ptrace_read_u_check(p,(vm_offset_t) uap->addr, 413 sizeof(int)) && 414 !procfs_kmemaccess(curp)) { 415 return EFAULT; 416 } |
|
412 error = 0; 413 PHOLD(p); /* user had damn well better be incore! */ 414 if (p->p_flag & P_INMEM) { 415 p->p_addr->u_kproc.kp_proc = *p; 416 fill_eproc (p, &p->p_addr->u_kproc.kp_eproc); 417 curp->p_retval[0] = *(int*)((u_int)p->p_addr + (u_int)uap->addr); 418 } else { 419 curp->p_retval[0] = 0; --- 105 unchanged lines hidden --- | 417 error = 0; 418 PHOLD(p); /* user had damn well better be incore! */ 419 if (p->p_flag & P_INMEM) { 420 p->p_addr->u_kproc.kp_proc = *p; 421 fill_eproc (p, &p->p_addr->u_kproc.kp_eproc); 422 curp->p_retval[0] = *(int*)((u_int)p->p_addr + (u_int)uap->addr); 423 } else { 424 curp->p_retval[0] = 0; --- 105 unchanged lines hidden --- |