From patchwork Mon Oct 1 19:22:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 29602 Received: (qmail 36163 invoked by alias); 1 Oct 2018 19:22:59 -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 36144 invoked by uid 89); 1 Oct 2018 19:22:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Mon, 1 Oct 2018 19:22:51 +0000 From: Joseph Myers To: Subject: Move MREMAP_* to bits/mman-shared.h Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 The MREMAP_* flags are identical between bits/mman-linux.h and the hppa bits/mman.h; thus, they should be in bits/mman-shared.h instead to avoid unnecessary duplication. This patch moves them there. Tested for x86_64, and with build-many-glibcs.py. 2018-10-01 Joseph Myers * sysdeps/unix/sysv/linux/bits/mman-linux.h [__USE_GNU] (MREMAP_MAYMOVE): Do not define here. [__USE_GNU] (MREMAP_FIXED): Likewise. * sysdeps/unix/sysv/linux/bits/mman-shared.h [__USE_GNU] (MREMAP_MAYMOVE): Define here instead. [__USE_GNU] (MREMAP_FIXED): Likewise. * sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_GNU] (MREMAP_MAYMOVE): Remove. [__USE_GNU] (MREMAP_FIXED): Likewise. diff --git a/sysdeps/unix/sysv/linux/bits/mman-linux.h b/sysdeps/unix/sysv/linux/bits/mman-linux.h index 70edeb6d60..09b118bb70 100644 --- a/sysdeps/unix/sysv/linux/bits/mman-linux.h +++ b/sysdeps/unix/sysv/linux/bits/mman-linux.h @@ -67,12 +67,6 @@ #define MS_SYNC 4 /* Synchronous memory sync. */ #define MS_INVALIDATE 2 /* Invalidate the caches. */ -/* Flags for `mremap'. */ -#ifdef __USE_GNU -# define MREMAP_MAYMOVE 1 -# define MREMAP_FIXED 2 -#endif - /* Advice to `madvise'. */ #ifdef __USE_MISC # define MADV_NORMAL 0 /* No further special treatment. */ diff --git a/sysdeps/unix/sysv/linux/bits/mman-shared.h b/sysdeps/unix/sysv/linux/bits/mman-shared.h index d15ba95c9d..54823e3724 100644 --- a/sysdeps/unix/sysv/linux/bits/mman-shared.h +++ b/sysdeps/unix/sysv/linux/bits/mman-shared.h @@ -21,6 +21,10 @@ #endif #ifdef __USE_GNU +/* Flags for mremap. */ +# define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 + /* Flags for memfd_create. */ # ifndef MFD_CLOEXEC # define MFD_CLOEXEC 1U diff --git a/sysdeps/unix/sysv/linux/hppa/bits/mman.h b/sysdeps/unix/sysv/linux/hppa/bits/mman.h index 1c7d3708e6..fd07a65868 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/mman.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/mman.h @@ -76,12 +76,6 @@ #define MCL_FUTURE 2 /* Lock all future mappings */ #define MCL_ONFAULT 4 /* Lock all pages that are faulted in */ -/* Flags for `mremap'. */ -#ifdef __USE_GNU -# define MREMAP_MAYMOVE 1 -# define MREMAP_FIXED 2 -#endif - /* Advice to "madvise" */ #ifdef __USE_MISC # define MADV_NORMAL 0 /* No further special treatment */