Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/imgact_elf.c
Show First 20 Lines • Show All 1,232 Lines • ▼ Show 20 Lines | __elfN(coredump)(struct thread *td, struct vnode *vp, off_t limit, int flags) | ||||
/* | /* | ||||
* Collect info about the core file header area. | * Collect info about the core file header area. | ||||
*/ | */ | ||||
hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 + seginfo.count); | hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 + seginfo.count); | ||||
__elfN(prepare_notes)(td, ¬elst, ¬esz); | __elfN(prepare_notes)(td, ¬elst, ¬esz); | ||||
coresize = round_page(hdrsize + notesz) + seginfo.size; | coresize = round_page(hdrsize + notesz) + seginfo.size; | ||||
#ifdef RACCT | #ifdef RACCT | ||||
if (racct_enable) { | |||||
PROC_LOCK(td->td_proc); | PROC_LOCK(td->td_proc); | ||||
error = racct_add(td->td_proc, RACCT_CORE, coresize); | error = racct_add(td->td_proc, RACCT_CORE, coresize); | ||||
PROC_UNLOCK(td->td_proc); | PROC_UNLOCK(td->td_proc); | ||||
if (error != 0) { | if (error != 0) { | ||||
error = EFAULT; | error = EFAULT; | ||||
goto done; | goto done; | ||||
} | |||||
} | } | ||||
#endif | #endif | ||||
if (coresize >= limit) { | if (coresize >= limit) { | ||||
error = EFAULT; | error = EFAULT; | ||||
goto done; | goto done; | ||||
} | } | ||||
/* Set up core dump parameters. */ | /* Set up core dump parameters. */ | ||||
▲ Show 20 Lines • Show All 904 Lines • Show Last 20 Lines |