summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2023-01-10 09:24:11 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2023-01-10 09:25:09 -0800
commitf9e2a524e54bee792377a8799404e48f80afae23 (patch)
treeb10ff63d2c4b5fbb026b7d8b8ca7ee82938d96df
parent78099461ac99ee8e7e515046c802d569a4642bd2 (diff)
Rollback of PR #1349: direct_mmap: Use off_t on linux...
PiperOrigin-RevId: 501014555 Change-Id: Ie204d307a4e537935a04c0f23bb13532e3c84bc8
-rw-r--r--absl/base/internal/direct_mmap.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
index 14efc637..815b8d23 100644
--- a/absl/base/internal/direct_mmap.h
+++ b/absl/base/internal/direct_mmap.h
@@ -72,7 +72,7 @@ namespace base_internal {
// Platform specific logic extracted from
// 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,
- off_t offset) noexcept {
+ off64_t offset) noexcept {
#if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
defined(__m68k__) || defined(__sh__) || \
(defined(__hppa__) && !defined(__LP64__)) || \
@@ -101,7 +101,8 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
static_cast<size_t>(offset / pagesize));
#else
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
#elif defined(__s390x__)
// On s390x, mmap() arguments are passed in memory.