* Add MADV_WIPEONFORK, MADV_KEEPONFORK from Linux 4.14
@ 2017-11-15 18:31 Joseph Myers
2017-11-15 18:38 ` Florian Weimer
0 siblings, 1 reply; 2+ messages in thread
From: Joseph Myers @ 2017-11-15 18:31 UTC (permalink / raw)
To: libc-alpha
This patch adds the new MADV_WIPEONFORK and MADV_KEEPONFORK from Linux
4.14 to bits/mman-linux.h (and bits/mman.h in the hppa case). Note
there are further hppa MADV_* changes in 4.14; I plan a separate glibc
patch for those.
Tested for x86_64.
2017-11-15 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/bits/mman-linux.h
[__USE_MISC] (MADV_WIPEONFORK): New macro.
[__USE_MISC] (MADV_KEEPONFORK): Likewise.
* sysdeps/unix/sysv/linux/hppa/bits/mman.h
[__USE_MISC] (MADV_WIPEONFORK): Likewise.
[__USE_MISC] (MADV_KEEPONFORK): Likewise.
diff --git a/sysdeps/unix/sysv/linux/bits/mman-linux.h b/sysdeps/unix/sysv/linux/bits/mman-linux.h
index b091181..78c07c8 100644
--- a/sysdeps/unix/sysv/linux/bits/mman-linux.h
+++ b/sysdeps/unix/sysv/linux/bits/mman-linux.h
@@ -89,6 +89,8 @@
# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
overrides the coredump filter bits. */
# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
+# define MADV_WIPEONFORK 18 /* Zero memory on fork, child only. */
+# define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK. */
# define MADV_HWPOISON 100 /* Poison a page for testing. */
#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/mman.h b/sysdeps/unix/sysv/linux/hppa/bits/mman.h
index acf7002..4ad9153 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/mman.h
@@ -99,6 +99,8 @@
# define MADV_DONTDUMP 69 /* Explicity exclude from the core dump,
overrides the coredump filter bits */
# define MADV_DODUMP 70 /* Clear the MADV_NODUMP flag */
+# define MADV_WIPEONFORK 71 /* Zero memory on fork, child only. */
+# define MADV_KEEPONFORK 72 /* Undo MADV_WIPEONFORK. */
#endif
/* The POSIX people had to invent similar names for the same things. */
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Add MADV_WIPEONFORK, MADV_KEEPONFORK from Linux 4.14
2017-11-15 18:31 Add MADV_WIPEONFORK, MADV_KEEPONFORK from Linux 4.14 Joseph Myers
@ 2017-11-15 18:38 ` Florian Weimer
0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer @ 2017-11-15 18:38 UTC (permalink / raw)
To: Joseph Myers, libc-alpha
On 11/15/2017 07:31 PM, Joseph Myers wrote:
> 2017-11-15 Joseph Myers<joseph@codesourcery.com>
>
> * sysdeps/unix/sysv/linux/bits/mman-linux.h
> [__USE_MISC] (MADV_WIPEONFORK): New macro.
> [__USE_MISC] (MADV_KEEPONFORK): Likewise.
> * sysdeps/unix/sysv/linux/hppa/bits/mman.h
> [__USE_MISC] (MADV_WIPEONFORK): Likewise.
> [__USE_MISC] (MADV_KEEPONFORK): Likewise.
I double-checked the constants against the kernel sources. Looks good.
Thanks,
Florian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-11-15 18:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-15 18:31 Add MADV_WIPEONFORK, MADV_KEEPONFORK from Linux 4.14 Joseph Myers
2017-11-15 18:38 ` Florian Weimer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).