]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Right mman.h bits for NaCl.
authorRoland McGrath <roland@hack.frob.com>
Thu, 25 Apr 2013 22:32:37 +0000 (15:32 -0700)
committerRoland McGrath <roland@hack.frob.com>
Thu, 25 Apr 2013 22:32:37 +0000 (15:32 -0700)
sysdeps/nacl/Makefile
sysdeps/nacl/bits/mman.h [new file with mode: 0644]

index 43419821d0d05d53c48c1878744275916a04cceb..01a5fe0e3c3f65995a7d098f5019c88844c32f4c 100644 (file)
@@ -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 (file)
index 0000000..07f8929
--- /dev/null
@@ -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>