330b961
commit 4ed990e5b97a61f29f929bdeb36c5b2abb547a64
330b961
Author: Joseph Myers <joseph@codesourcery.com>
330b961
Date:   Tue Sep 14 14:19:24 2021 +0000
330b961
330b961
    Add MADV_POPULATE_READ and MADV_POPULATE_WRITE from Linux 5.14 to bits/mman-linux.h
330b961
    
330b961
    Linux 5.14 adds constants MADV_POPULATE_READ and MADV_POPULATE_WRITE
330b961
    (with the same values on all architectures).  Add these to glibc's
330b961
    bits/mman-linux.h.
330b961
    
330b961
    Tested for x86_64.
330b961
    
330b961
    (cherry picked from commit 3561106278cddd2f007bd27fd4c3e90caaf14b43)
330b961
330b961
diff --git a/sysdeps/unix/sysv/linux/bits/mman-linux.h b/sysdeps/unix/sysv/linux/bits/mman-linux.h
330b961
index 3b1ae418e073c122..31451c28d93f9f72 100644
330b961
--- a/sysdeps/unix/sysv/linux/bits/mman-linux.h
330b961
+++ b/sysdeps/unix/sysv/linux/bits/mman-linux.h
330b961
@@ -89,6 +89,10 @@
330b961
 # define MADV_KEEPONFORK  19	/* Undo MADV_WIPEONFORK.  */
330b961
 # define MADV_COLD        20	/* Deactivate these pages.  */
330b961
 # define MADV_PAGEOUT     21	/* Reclaim these pages.  */
330b961
+# define MADV_POPULATE_READ 22	/* Populate (prefault) page tables
330b961
+				   readable.  */
330b961
+# define MADV_POPULATE_WRITE 23	/* Populate (prefault) page tables
330b961
+				   writable.  */
330b961
 # define MADV_HWPOISON	  100	/* Poison a page for testing.  */
330b961
 #endif
330b961