summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-03-12 14:37:41 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-03-12 14:37:41 +0000
commit2a1ce5c0e75dfe8d3dd39c3d9186f7cd7795b6b8 (patch)
treeb395e06790687c656ab449ba7ed3161ac0e56d3d /sys/kern
parent5b79aab6eebe0f7a472f6dca68a6d5c34c8e48e3 (diff)
Change the PT_IO interfaces like discussed on
the bsd-api-discuss list.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sys_process.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 7f695677ae8..562fe227661 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_process.c,v 1.20 2002/03/12 11:57:12 art Exp $ */
+/* $OpenBSD: sys_process.c,v 1.21 2002/03/12 14:37:40 art Exp $ */
/* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */
/*-
@@ -89,9 +89,9 @@ sys_ptrace(p, v, retval)
struct proc *t; /* target process */
struct uio uio;
struct iovec iov;
+ struct ptrace_io_desc piod;
int error, write;
int temp;
- struct ptrace_io_desc piod;
/* "A foolish consistency..." XXX */
if (SCARG(uap, req) == PT_TRACE_ME)
@@ -242,19 +242,20 @@ sys_ptrace(p, v, retval)
uio.uio_segflg = UIO_USERSPACE;
uio.uio_procp = p;
switch (piod.piod_op) {
- case PIOD_OP_READ_DATA:
- case PIOD_OP_READ_TEXT:
+ case PIOD_READ_D:
+ case PIOD_READ_I:
uio.uio_rw = UIO_READ;
break;
- case PIOD_OP_WRITE_DATA:
- case PIOD_OP_WRITE_TEXT:
+ case PIOD_WRITE_D:
+ case PIOD_WRITE_I:
uio.uio_rw = UIO_WRITE;
break;
default:
return (EINVAL);
}
error = procfs_domem(p, t, NULL, &uio);
- *retval = piod.piod_len - uio.uio_resid;
+ piod.piod_len -= uio.uio_resid;
+ (void) copyout(&piod, SCARG(uap, addr), sizeof(piod));
return (error);
#ifdef PT_STEP
case PT_STEP: