mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-20 08:44:33 +00:00
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.
This commit is contained in:
parent
1ed8cb4870
commit
a9f9df5daf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103086
|
@ -172,7 +172,7 @@ pecoff_coredump(register struct thread * td, register struct vnode * vp,
|
|||
register struct ucred *cred = td->td_ucred;
|
||||
struct proc *p = td->td_proc;
|
||||
register struct vmspace *vm = p->p_vmspace;
|
||||
caddr_t tempuser;
|
||||
char *tempuser;
|
||||
int error;
|
||||
#ifdef PECOFF_DEBUG
|
||||
struct vm_map *map;
|
||||
|
@ -187,15 +187,14 @@ pecoff_coredump(register struct thread * td, register struct vnode * vp,
|
|||
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),
|
||||
sizeof(struct trapframe));
|
||||
PROC_LOCK(p);
|
||||
fill_kinfo_proc(p, &p->p_uarea->u_kproc);
|
||||
PROC_UNLOCK(p);
|
||||
|
||||
#if PECOFF_DEBUG
|
||||
fill_regs(td, ®s);
|
||||
printf("EIP%x\n", regs.r_eip);
|
||||
|
|
|
@ -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,14 +741,14 @@ 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),
|
||||
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,
|
||||
ctob(uarea_pages + kstack_pages),
|
||||
(off_t)0, UIO_SYSSPACE, IO_UNIT, cred, NOCRED,
|
||||
|
|
|
@ -272,7 +272,7 @@ aout_coredump(td, vp, limit)
|
|||
struct proc *p = td->td_proc;
|
||||
register struct ucred *cred = td->td_ucred;
|
||||
register struct vmspace *vm = p->p_vmspace;
|
||||
caddr_t tempuser;
|
||||
char *tempuser;
|
||||
int error;
|
||||
|
||||
if (ctob((uarea_pages + kstack_pages)
|
||||
|
@ -282,14 +282,14 @@ aout_coredump(td, vp, 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),
|
||||
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,
|
||||
ctob(uarea_pages + kstack_pages),
|
||||
(off_t)0, UIO_SYSSPACE, IO_UNIT, cred, NOCRED,
|
||||
|
|
Loading…
Reference in a new issue