Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Unified Diff: src/platform-posix.cc

Issue 61153009: Add support for the QNX operating system. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Address latest review comments Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform.h ('k') | src/platform-qnx.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « src/platform.h ('k') | src/platform-qnx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698