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

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: Created 7 years, 1 month 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
Index: src/platform-posix.cc
diff --git a/src/platform-posix.cc b/src/platform-posix.cc
index 923cd8700ed9a062c8ed8ad7a505da253ae084dd..b19c54201c7a1e8adee4f3e26b15a726539e9a23 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,11 @@ void* OS::GetRandomMmapAddr() {
size_t OS::AllocateAlignment() {
+#if defined(V8_OS_QNX)
Benedikt Meurer 2013/11/15 11:49:59 Use #if V8_OS_QNX.
c.truta 2013/11/18 13:36:32 D'oh! Oversight. Thank you. I also added #if V8_OS
Benedikt Meurer 2013/11/19 07:01:27 sysconf(_SC_PAGESIZE) just calls getpagesize() for
+ return static_cast<size_t>(sysconf(_SC_PAGESIZE));
+#else
return getpagesize();
+#endif
}

Powered by Google App Engine
This is Rietveld 408576698