diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index e2334a9379ed..792ba9638fe3 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -53,8 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define uarea_pages 1 - static int exec_aout_imgact(struct image_params *imgp); static int aout_fixup(register_t **stack_base, struct image_params *imgp); @@ -73,7 +70,7 @@ struct sysentvec aout_sysvec = { &szsigcode, NULL, "FreeBSD a.out", - aout_coredump, + NULL, NULL, MINSIGSTKSZ, PAGE_SIZE, @@ -262,56 +259,6 @@ exec_aout_imgact(imgp) return (0); } -/* - * Dump core, into a file named as described in the comments for - * expand_name(), unless the process was setuid/setgid. - */ -int -aout_coredump(td, vp, limit) - register struct thread *td; - register struct vnode *vp; - off_t limit; -{ - struct proc *p = td->td_proc; - register struct ucred *cred = td->td_ucred; - register struct vmspace *vm = p->p_vmspace; - char *tempuser; - int error; - - if (ctob((uarea_pages + kstack_pages) - + vm->vm_dsize + vm->vm_ssize) >= limit) - return (EFAULT); - tempuser = malloc(ctob(uarea_pages + kstack_pages), M_TEMP, - M_WAITOK | M_ZERO); - if (tempuser == NULL) - return (ENOMEM); - PROC_LOCK(p); - fill_user(p, (struct user *)tempuser); - PROC_UNLOCK(p); - bcopy(td->td_frame, - tempuser + ctob(uarea_pages) + - ((caddr_t)td->td_frame - (caddr_t)td->td_kstack), - sizeof(struct trapframe)); - 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); - free(tempuser, M_TEMP); - if (error == 0) - error = vn_rdwr(UIO_WRITE, vp, vm->vm_daddr, - (int)ctob(vm->vm_dsize), - (off_t)ctob(uarea_pages + kstack_pages), UIO_USERSPACE, - IO_UNIT | IO_DIRECT, cred, NOCRED, (int *) NULL, td); - if (error == 0) - error = vn_rdwr_inchunks(UIO_WRITE, vp, - (caddr_t)trunc_page(p->p_sysent->sv_usrstack - - ctob(vm->vm_ssize)), round_page(ctob(vm->vm_ssize)), - (off_t)ctob(uarea_pages + kstack_pages) + - ctob(vm->vm_dsize), UIO_USERSPACE, - IO_UNIT | IO_DIRECT, cred, NOCRED, NULL, td); - return (error); -} - /* * Tell kern_execve.c about it, with a little help from the linker. */ diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 75f19ad21911..03b0ab2b09bb 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -800,19 +800,6 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp) kp->ki_ppid = p->p_pptr->p_pid; } -/* - * Fill a 'struct user' for backwards compatibility with a.out core dumps. - * This is used by the aout, linux, and pecoff modules. - */ -void -fill_user(struct proc *p, struct user *u) -{ - - PROC_LOCK_ASSERT(p, MA_OWNED); - bcopy(&p->p_stats, &u->u_stats, sizeof(struct pstats)); - fill_kinfo_proc(p, &u->u_kproc); -} - struct pstats * pstats_alloc(void) { diff --git a/sys/sys/user.h b/sys/sys/user.h index 145b578ee17b..d8a36570989f 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -206,6 +206,4 @@ struct user { struct kinfo_proc u_kproc; /* eproc */ }; -void fill_user(struct proc *, struct user *); - #endif