Commit f9e2a524 by Abseil Team Committed by Copybara-Service

Rollback of PR #1349: direct_mmap: Use off_t on linux...

PiperOrigin-RevId: 501014555
Change-Id: Ie204d307a4e537935a04c0f23bb13532e3c84bc8
parent 78099461
...@@ -72,7 +72,7 @@ namespace base_internal { ...@@ -72,7 +72,7 @@ namespace base_internal {
// Platform specific logic extracted from // Platform specific logic extracted from
// https://chromium.googlesource.com/linux-syscall-support/+/master/linux_syscall_support.h // https://chromium.googlesource.com/linux-syscall-support/+/master/linux_syscall_support.h
inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
off_t offset) noexcept { off64_t offset) noexcept {
#if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \ #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
defined(__m68k__) || defined(__sh__) || \ defined(__m68k__) || defined(__sh__) || \
(defined(__hppa__) && !defined(__LP64__)) || \ (defined(__hppa__) && !defined(__LP64__)) || \
...@@ -101,7 +101,8 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, ...@@ -101,7 +101,8 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
static_cast<size_t>(offset / pagesize)); static_cast<size_t>(offset / pagesize));
#else #else
return reinterpret_cast<void*>( return reinterpret_cast<void*>(
syscall(SYS_mmap2, start, length, prot, flags, fd, offset / pagesize)); syscall(SYS_mmap2, start, length, prot, flags, fd,
static_cast<off_t>(offset / pagesize)));
#endif #endif
#elif defined(__s390x__) #elif defined(__s390x__)
// On s390x, mmap() arguments are passed in memory. // On s390x, mmap() arguments are passed in memory.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment