--- a/src/lib/mesa/src/gallium/auxiliary/os/os_mman.h
+++ b/src/lib/mesa/src/gallium/auxiliary/os/os_mman.h
@@ -59,10 +59,12 @@ extern "C" {
              munmap(addr, length)
 
 #else
+extern void *drm_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
 /* assume large file support exists */
 #  define os_mmap(addr, length, prot, flags, fd, offset) \
-             mmap(addr, length, prot, flags, fd, offset)
+             drm_mmap(addr, length, prot, flags, fd, offset)
 
+extern int drm_munmap(void *addr, size_t length);
 static inline int os_munmap(void *addr, size_t length)
 {
    /* Copied from configure code generated by AC_SYS_LARGEFILE */
@@ -72,7 +74,7 @@ static inline int os_munmap(void *addr, size_t length)
                  LARGE_OFF_T % 2147483647 == 1);
 #undef LARGE_OFF_T
 
-   return munmap(addr, length);
+   return drm_munmap(addr, length);
 }
 #endif
 
