summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2013-04-25 15:32:37 -0700
committerRoland McGrath <roland@hack.frob.com>2013-04-25 15:32:37 -0700
commit60cd5c30c80e405b45cb66e97bb522c5bfd936dd (patch)
tree951092a6e95f2e3a338f207c9ad409dc51a144ca
parent9c40ef09cc239a621750f22687099bd37ba9497c (diff)
downloadglibc-60cd5c30c80e405b45cb66e97bb522c5bfd936dd.tar.gz
glibc-60cd5c30c80e405b45cb66e97bb522c5bfd936dd.tar.xz
glibc-60cd5c30c80e405b45cb66e97bb522c5bfd936dd.zip
Right mman.h bits for NaCl.
-rw-r--r--sysdeps/nacl/Makefile11
-rw-r--r--sysdeps/nacl/bits/mman.h24
2 files changed, 35 insertions, 0 deletions
diff --git a/sysdeps/nacl/Makefile b/sysdeps/nacl/Makefile
index 43419821d0..01a5fe0e3c 100644
--- a/sysdeps/nacl/Makefile
+++ b/sysdeps/nacl/Makefile
@@ -54,6 +54,17 @@ $(nacl-optional-interfaces:%=$(nacl-interface-pattern)): \
 sysdep_routines += nacl_interface_query \
 		   nacl-interfaces $(nacl-interface-routines)
 
+# The Linux bits are close enough for NaCl and we want to use the existing
+# file rather than copying it into sysdeps/nacl and letting it bit rot.
+# But we certainly don't want sysdeps/unix/sysv/linux in our sysdirs list!
+# So copy the file to the build directory.
+sysdep_headers += bits/mman-linux.h
+before-compile += $(common-objpfx)bits/mman-linux.h
+$(common-objpfx)bits/mman-linux.h: \
+  $(..)sysdeps/unix/sysv/linux/bits/mman-linux.h
+	$(make-target-directory)
+	ln -f $< $@ || cp -f $< $@
+
 # XXX temp test
 others += hello
 
diff --git a/sysdeps/nacl/bits/mman.h b/sysdeps/nacl/bits/mman.h
new file mode 100644
index 0000000000..07f8929ef2
--- /dev/null
+++ b/sysdeps/nacl/bits/mman.h
@@ -0,0 +1,24 @@
+/* Definitions for POSIX memory map interface.  NaCl version.
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* NaCl uses the Linux bits for this.  */
+#include <bits/mman-linux.h>