76b6d9
commit 71bdf29ac1de04efcce96bc5ce50af3263851ac7
76b6d9
Author: Joseph Myers <joseph@codesourcery.com>
76b6d9
Date:   Mon Sep 30 15:49:25 2019 +0000
76b6d9
76b6d9
    Update bits/mman.h constants and tst-mman-consts.py for Linux 5.3.
76b6d9
    
76b6d9
    The Linux 5.3 uapi headers have some rearrangement relating to MAP_*
76b6d9
    constants, which includes the effect of adding definitions of MAP_SYNC
76b6d9
    on powerpc and sparc.  This patch updates the corresponding glibc
76b6d9
    bits/mman.h headers accordingly, and updates the Linux kernel version
76b6d9
    number in tst-mman-consts.py to reflect that these constants are now
76b6d9
    current with that kernel version.
76b6d9
    
76b6d9
    Tested with build-many-glibcs.py.
76b6d9
    
76b6d9
            * sysdeps/unix/sysv/linux/powerpc/bits/mman.h [__USE_MISC]
76b6d9
            (MAP_SYNC): New macro.
76b6d9
            * sysdeps/unix/sysv/linux/sparc/bits/mman.h [__USE_MISC]
76b6d9
            (MAP_SYNC): Likewise.
76b6d9
            * sysdeps/unix/sysv/linux/tst-mman-consts.py (main): Update Linux
76b6d9
            kernel version number to 5.3.
76b6d9
76b6d9
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
76b6d9
index e652467c8c091381..0e7fa647793ed585 100644
76b6d9
--- a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
76b6d9
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
76b6d9
@@ -36,6 +36,8 @@
76b6d9
 # define MAP_NONBLOCK	0x10000		/* Do not block on IO.  */
76b6d9
 # define MAP_STACK	0x20000		/* Allocation is for a stack.  */
76b6d9
 # define MAP_HUGETLB	0x40000		/* Create huge page mapping.  */
76b6d9
+# define MAP_SYNC	0x80000		/* Perform synchronous page
76b6d9
+					   faults for the mapping.  */
76b6d9
 # define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED but do not unmap
76b6d9
 					   underlying mapping.  */
76b6d9
 #endif
76b6d9
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/mman.h b/sysdeps/unix/sysv/linux/sparc/bits/mman.h
76b6d9
index 3a3ffb994631e2b6..03f6f732bb5efbe2 100644
76b6d9
--- a/sysdeps/unix/sysv/linux/sparc/bits/mman.h
76b6d9
+++ b/sysdeps/unix/sysv/linux/sparc/bits/mman.h
76b6d9
@@ -36,6 +36,8 @@
76b6d9
 # define MAP_NONBLOCK	0x10000		/* Do not block on IO.  */
76b6d9
 # define MAP_STACK	0x20000		/* Allocation is for a stack.  */
76b6d9
 # define MAP_HUGETLB	0x40000		/* Create huge page mapping.  */
76b6d9
+# define MAP_SYNC	0x80000		/* Perform synchronous page
76b6d9
+					   faults for the mapping.  */
76b6d9
 # define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED but do not unmap
76b6d9
 					   underlying mapping.  */
76b6d9
 #endif
76b6d9
diff --git a/sysdeps/unix/sysv/linux/tst-mman-consts.py b/sysdeps/unix/sysv/linux/tst-mman-consts.py
76b6d9
index 9e326b1f31799a72..42914e4e0ba84712 100644
76b6d9
--- a/sysdeps/unix/sysv/linux/tst-mman-consts.py
76b6d9
+++ b/sysdeps/unix/sysv/linux/tst-mman-consts.py
76b6d9
@@ -41,7 +41,7 @@ def main():
76b6d9
                         help='C compiler (including options) to use')
76b6d9
     args = parser.parse_args()
76b6d9
     linux_version_headers = linux_kernel_version(args.cc)
76b6d9
-    linux_version_glibc = (5, 2)
76b6d9
+    linux_version_glibc = (5, 3)
76b6d9
     sys.exit(glibcextract.compare_macro_consts(
76b6d9
         '#define _GNU_SOURCE 1\n'
76b6d9
         '#include <sys/mman.h>\n',