aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux/memory_mapped_file.cc
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org>2015-04-15 19:28:11 +0000
committermark@chromium.org <mark@chromium.org>2015-04-15 19:28:11 +0000
commitd88401cca9ff7640387a0d88d75de1e7d8fff294 (patch)
treeb47c776a127bb465572e382e752d5d63ca9b544c /src/common/linux/memory_mapped_file.cc
parentUse __NR_rt_sigaction instead of __NR_sigaction (diff)
downloadbreakpad-d88401cca9ff7640387a0d88d75de1e7d8fff294.tar.xz
MIPS64: Initial MIPS64 related change.
With this change Breakpad can be compiled for MIPS64, but it is not yet functional. Patch by Gordana Cmiljanovic <Gordana.Cmiljanovic@imgtec.com> Review URL: https://breakpad.appspot.com/6824002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1446 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/linux/memory_mapped_file.cc')
-rw-r--r--src/common/linux/memory_mapped_file.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/linux/memory_mapped_file.cc b/src/common/linux/memory_mapped_file.cc
index 064326bb..592b66c8 100644
--- a/src/common/linux/memory_mapped_file.cc
+++ b/src/common/linux/memory_mapped_file.cc
@@ -54,6 +54,8 @@ MemoryMappedFile::~MemoryMappedFile() {
Unmap();
}
+#include <unistd.h>
+
bool MemoryMappedFile::Map(const char* path, size_t offset) {
Unmap();
@@ -62,7 +64,9 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
return false;
}
-#if defined(__x86_64__) || defined(__aarch64__)
+#if defined(__x86_64__) || defined(__aarch64__) || \
+ (defined(__mips__) && _MIPS_SIM == _ABI64)
+
struct kernel_stat st;
if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
#else
@@ -83,7 +87,8 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
return true;
}
-#if defined(__x86_64__) || defined(__aarch64__)
+#if defined(__x86_64__) || defined(__aarch64__) || \
+ (defined(__mips__) && _MIPS_SIM == _ABI64)
void* data = sys_mmap(NULL, file_len, PROT_READ, MAP_PRIVATE, fd, offset);
#else
if ((offset & 4095) != 0) {