summaryrefslogtreecommitdiffstats
path: root/sys/i386/linux/linux_sysvec.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-09-07 22:31:44 +0000
committerpeter <peter@FreeBSD.org>2002-09-07 22:31:44 +0000
commit21b23e4fe817edef196743750867fa0f6120c902 (patch)
treefdac2ae32654c934bc9874ffbac7b508aeca7737 /sys/i386/linux/linux_sysvec.c
parent640af1c480488f92d6952a7db1bdd20d34d23cca (diff)
downloadFreeBSD-src-21b23e4fe817edef196743750867fa0f6120c902.zip
FreeBSD-src-21b23e4fe817edef196743750867fa0f6120c902.tar.gz
Tidy up some loose ends that bde pointed out. caddr_t bad, ok?
Move fill_kinfo_proc to before we copy the results instead of after the copy and too late. There is still more to do here.
Diffstat (limited to 'sys/i386/linux/linux_sysvec.c')
-rw-r--r--sys/i386/linux/linux_sysvec.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index 4e1f3e5..e6c2364 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -30,7 +30,6 @@
/* XXX we use functions that might not exist. */
#include "opt_compat.h"
-#include "opt_kstack_pages.h"
#ifndef COMPAT_43
#error "Unable to compile Linux-emulator due to missing COMPAT_43 option!"
@@ -732,7 +731,7 @@ linux_aout_coredump(struct thread *td, struct vnode *vp, off_t limit)
struct proc *p = td->td_proc;
struct ucred *cred = td->td_ucred;
struct vmspace *vm = p->p_vmspace;
- caddr_t tempuser;
+ char *tempuser;
int error;
if (ctob((uarea_pages + kstack_pages) +
@@ -742,15 +741,15 @@ linux_aout_coredump(struct thread *td, struct vnode *vp, off_t limit)
M_WAITOK | M_ZERO);
if (tempuser == NULL)
return (ENOMEM);
+ PROC_LOCK(p);
+ fill_kinfo_proc(p, &p->p_uarea->u_kproc);
+ PROC_UNLOCK(p);
bcopy(p->p_uarea, tempuser, sizeof(struct user));
bcopy(td->td_frame,
tempuser + ctob(uarea_pages) +
- ((caddr_t) td->td_frame - (caddr_t) td->td_kstack),
+ ((caddr_t)td->td_frame - (caddr_t)td->td_kstack),
sizeof(struct trapframe));
- PROC_LOCK(p);
- fill_kinfo_proc(p, &p->p_uarea->u_kproc);
- PROC_UNLOCK(p);
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t) tempuser,
+ error = vn_rdwr(UIO_WRITE, vp, (caddr_t)tempuser,
ctob(uarea_pages + kstack_pages),
(off_t)0, UIO_SYSSPACE, IO_UNIT, cred, NOCRED,
(int *)NULL, td);
@@ -762,7 +761,7 @@ linux_aout_coredump(struct thread *td, struct vnode *vp, off_t limit)
IO_UNIT | IO_DIRECT, cred, NOCRED, (int *) NULL, td);
if (error == 0)
error = vn_rdwr_inchunks(UIO_WRITE, vp,
- (caddr_t) trunc_page(USRSTACK - ctob(vm->vm_ssize)),
+ (caddr_t)trunc_page(USRSTACK - ctob(vm->vm_ssize)),
round_page(ctob(vm->vm_ssize)),
(off_t)ctob(uarea_pages + kstack_pages) +
ctob(vm->vm_dsize), UIO_USERSPACE,
OpenPOWER on IntegriCloud