Index: src/platform-posix.cc |
diff --git a/src/platform-posix.cc b/src/platform-posix.cc |
index 0070bdf6a770bb27febdf7808493a6a4339b1182..58c803de1b0e64130990c84f60eb209afb1e8257 100644 |
--- a/src/platform-posix.cc |
+++ b/src/platform-posix.cc |
@@ -130,6 +130,13 @@ uint64_t OS::TotalPhysicalMemory() { |
return 0; |
} |
return static_cast<uint64_t>(memory_info.dwTotalPhys); |
+#elif V8_OS_QNX |
+ struct stat stat_buf; |
+ if (stat("/proc", &stat_buf) != 0) { |
+ UNREACHABLE(); |
+ return 0; |
+ } |
+ return static_cast<uint64_t>(stat_buf.st_size); |
#else |
intptr_t pages = sysconf(_SC_PHYS_PAGES); |
intptr_t page_size = sysconf(_SC_PAGESIZE); |
@@ -247,7 +254,7 @@ void* OS::GetRandomMmapAddr() { |
size_t OS::AllocateAlignment() { |
- return getpagesize(); |
+ return static_cast<size_t>(sysconf(_SC_PAGESIZE)); |
} |