1/* 2 * Copyright (c) 1993, David Greenman 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/kern/imgact_aout.c 94307 2002-04-09 20:10:46Z jhb $ |
27 */ 28 29#include "opt_kstack_pages.h" 30 31#include <sys/param.h> 32#include <sys/exec.h> 33#include <sys/fcntl.h> 34#include <sys/imgact.h> --- 223 unchanged lines hidden (view full) --- 258 struct proc *p = td->td_proc; 259 register struct ucred *cred = td->td_ucred; 260 register struct vmspace *vm = p->p_vmspace; 261 int error; 262 263 if (ctob((UAREA_PAGES + KSTACK_PAGES) 264 + vm->vm_dsize + vm->vm_ssize) >= limit) 265 return (EFAULT); |
266 PROC_LOCK(p); |
267 fill_kinfo_proc(p, &p->p_uarea->u_kproc); |
268 PROC_UNLOCK(p); |
269 error = cpu_coredump(td, vp, cred); 270 if (error == 0) 271 error = vn_rdwr(UIO_WRITE, vp, vm->vm_daddr, 272 (int)ctob(vm->vm_dsize), 273 (off_t)ctob(UAREA_PAGES + KSTACK_PAGES), UIO_USERSPACE, 274 IO_UNIT | IO_DIRECT, cred, (int *) NULL, td); 275 if (error == 0) 276 error = vn_rdwr_inchunks(UIO_WRITE, vp, --- 13 unchanged lines hidden --- |