summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_elf.c
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2000-02-28 04:10:35 +0000
committerps <ps@FreeBSD.org>2000-02-28 04:10:35 +0000
commitc3800346ab46195181630945b2f40e1fee7853d0 (patch)
treec1fe153aebcc58e892bd5d2eea0b026feb20e562 /sys/kern/imgact_elf.c
parent1e4770cd942238b5157e2b25cd92594590c69b9d (diff)
downloadFreeBSD-src-c3800346ab46195181630945b2f40e1fee7853d0.zip
FreeBSD-src-c3800346ab46195181630945b2f40e1fee7853d0.tar.gz
Add MAP_NOCORE to mmap(2), and MADV_NOCORE and MADV_CORE to madvise(2).
This This feature allows you to specify if mmap'd data is included in an application's corefile. Change the type of eflags in struct vm_map_entry from u_char to vm_eflags_t (an unsigned int). Reviewed by: dillon,jdp,alfred Approved by: jkh
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r--sys/kern/imgact_elf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 45d33df..8729888 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -816,6 +816,13 @@ each_writable_segment(p, func, closure)
(VM_PROT_READ|VM_PROT_WRITE))
continue;
+ /*
+ ** Dont include mmapped data in the coredump if MAP_NOCORE
+ ** is set in mmap(2).
+ */
+ if (entry->eflags & MAP_ENTRY_NOCOREDUMP)
+ continue;
+
if ((obj = entry->object.vm_object) == NULL)
continue;
OpenPOWER on IntegriCloud