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