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: 838292 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-87167-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="AKtAeWhM"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ycXyJ5jpPz9sNw for ; Thu, 16 Nov 2017 05:31:20 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=SN5pNOE0vjkPUFTbaSJlZmXJyfJWz +ppCHx3LTRQo8sDGxtUXJesKs1VCj9V44k4/6l1w8o0MpwD4hALL3Cq2fXdln9XT xX9Z0v3aTvrVs2Qou+YhWfcgpJeeJVFdH7QhDr9qOsuR1hy6H+KawdFt10rKYWuY 4p18vmLBEbrDT4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=MJwpRvDlU4IefzfCHDdTM6AVw5k=; b=AKt AeWhMmVqzvWsc+4SjNZkDn6OBbV7t83qqVkOJk8agLZSyAK1YnpFIG6a6aHCxHeM XzM38lN1hGc2vp3V3xGJyM/AdGOuVbzt2DjfJuBnBz7iFfV5gLwP6uiMWHjfIcys UzH8i1nEXTC0LjbfGJoVWSaTQL64BjkboaDsONQE= 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. */