summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_aout.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2004-11-27 06:46:59 +0000
committerdas <das@FreeBSD.org>2004-11-27 06:46:59 +0000
commit0b21c939c0a54cb34f0810d1353e74009ad7176a (patch)
tree6aa4584b2997dda4c8f1afb8de4c92af8d5cf732 /sys/kern/imgact_aout.c
parent3ccad749b08338ad8ae5538ef71034dffe656f1a (diff)
downloadFreeBSD-src-0b21c939c0a54cb34f0810d1353e74009ad7176a.zip
FreeBSD-src-0b21c939c0a54cb34f0810d1353e74009ad7176a.tar.gz
Axe a.out core dump support. Neither older gdb binaries nor current
bfd sources understand the present format.
Diffstat (limited to 'sys/kern/imgact_aout.c')
-rw-r--r--sys/kern/imgact_aout.c55
1 files changed, 1 insertions, 54 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index e2334a9..792ba96 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
#include <sys/sysent.h>
#include <sys/systm.h>
#include <sys/vnode.h>
-#include <sys/user.h>
#include <machine/frame.h>
#include <machine/md_var.h>
@@ -53,8 +52,6 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_object.h>
#include <vm/vm_param.h>
-#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,
@@ -263,56 +260,6 @@ exec_aout_imgact(imgp)
}
/*
- * 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.
*/
static struct execsw aout_execsw = { exec_aout_imgact, "a.out" };
OpenPOWER on IntegriCloud