I want to avoid dumping certain information from my program into a core file in case of any crash.
For that, I can use coredump_filter (http://man7.org/linux/man-pages/man5/core.5.html)
The man page provides following description
The value in the file is a bit mask of memory mapping types (see mmap(2)). If a bit is set in the mask, then memory mappings of the corresponding type are dumped; otherwise they are not dumped. The bits in this file have the following meanings:
bit 0 Dump anonymous private mappings.
bit 1 Dump anonymous shared mappings.
bit 2 Dump file-backed private mappings.
bit 3 Dump file-backed shared mappings.
bit 4 (since Linux 2.6.24)
Dump ELF headers.
bit 5 (since Linux 2.6.28)
Dump private huge pages.
bit 6 (since Linux 2.6.28)
Dump shared huge pages.
I am looking to know which bit to set and reset in my case. I am not clear with these fields specially private and shared.
I have a buffer (unsigned char*) into memory. I do not want to dumped this into a core file in case of any crash. Is there any specific flag I have to use for mmap? Please help. Thanks in advance.