patch-test_bug-mmap_c 569 B

12345678910111213141516171819202122
  1. $OpenBSD: patch-test_bug-mmap_c,v 1.1 2015/11/19 00:55:23 mmcc Exp $
  2. --- test/bug-mmap.c.orig Sat May 30 10:30:00 2015
  3. +++ test/bug-mmap.c Wed Nov 18 16:39:20 2015
  4. @@ -13,8 +13,6 @@
  5. #include "config.h"
  6. -#define _BSD_SOURCE 1 /* for MAP_POPULATE */
  7. -
  8. #if HAVE_SYS_MMAN_H
  9. # include <sys/mman.h>
  10. #endif
  11. @@ -32,7 +30,7 @@
  12. int main(void)
  13. {
  14. -#if defined _SC_PAGE_SIZE
  15. +#if defined _SC_PAGE_SIZE && defined MAP_POPULATE
  16. int fd = open("/etc/hosts", O_RDONLY);
  17. mmap(0, sysconf(_SC_PAGE_SIZE) * 2, PROT_READ,
  18. MAP_PRIVATE | MAP_POPULATE, fd, 0);