From patchwork Wed Nov 15 18:31:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 24264 Received: (qmail 113129 invoked by alias); 15 Nov 2017 18:31:13 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 113117 invoked by uid 89); 15 Nov 2017 18:31:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Wed, 15 Nov 2017 18:31:06 +0000 From: Joseph Myers To: Subject: Add MADV_WIPEONFORK, MADV_KEEPONFORK from Linux 4.14 Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) 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 * 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. */