summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/os/os_mman.h
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2014-08-29 10:27:43 +0900
committerMichel Dänzer <[email protected]>2014-09-05 18:08:59 +0900
commit76b906c9f6ebe1626e9ace5ea8336167aa210876 (patch)
tree0e2470ba76a735a56559eb4cddf8fc3d282e7d14 /src/gallium/auxiliary/os/os_mman.h
parentb4539274b6478249d52e99fa34243daacf48be80 (diff)
configure.ac: Add AC_SYS_LARGEFILE
Making sure large file support is enabled across the tree even on 32-bit systems. Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/os/os_mman.h')
-rw-r--r--src/gallium/auxiliary/os/os_mman.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/os/os_mman.h b/src/gallium/auxiliary/os/os_mman.h
index b48eb053023..19478d24e44 100644
--- a/src/gallium/auxiliary/os/os_mman.h
+++ b/src/gallium/auxiliary/os/os_mman.h
@@ -40,9 +40,6 @@
#include "pipe/p_compiler.h"
#if defined(PIPE_OS_UNIX)
-# ifndef _FILE_OFFSET_BITS
-# error _FILE_OFFSET_BITS must be defined to 64
-# endif
# include <sys/mman.h>
#else
# error Unsupported OS
@@ -77,7 +74,15 @@ static INLINE void *os_mmap(void *addr, size_t length, int prot, int flags, int
# define os_mmap(addr, length, prot, flags, fd, offset) mmap(addr, length, prot, flags, fd, offset)
#endif
-#define os_munmap(addr, length) munmap(addr, length)
+static INLINE int os_munmap(void *addr, size_t length)
+{
+ /* Copied from configure code generated by AC_SYS_LARGEFILE */
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+ STATIC_ASSERT(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1);
+#undef LARGE_OFF_T
+
+ return munmap(addr, length);
+}
#ifdef __cplusplus