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

Unified Diff: src/base/platform/platform-posix.cc

Issue 521473003: More PNaCL fixes (without GYP/Makefile tweaks) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months 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/base/platform/platform-linux.cc ('k') | src/base/platform/semaphore.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/platform/platform-posix.cc
diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc
index ea06ff51635344f4ee32d2915e0371c47589cadf..0fc04fc11088b28e4a0ff5c451e7bf45fcab77fd 100644
--- a/src/base/platform/platform-posix.cc
+++ b/src/base/platform/platform-posix.cc
@@ -19,14 +19,8 @@
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/stat.h>
-#if !defined(__pnacl__)
-#include <sys/syscall.h>
-#endif
#include <sys/time.h>
#include <sys/types.h>
-#if defined(__linux__) && !defined(__pnacl__)
-#include <sys/prctl.h> // NOLINT, for prctl
-#endif
#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || \
defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/sysctl.h> // NOLINT, for sysctl
@@ -56,6 +50,14 @@
#include <dlfcn.h>
#endif
+#if V8_OS_LINUX
+#include <sys/prctl.h> // NOLINT, for prctl
+#endif
+
+#if !V8_OS_NACL
+#include <sys/syscall.h>
+#endif
+
namespace v8 {
namespace base {
@@ -223,11 +225,11 @@ void OS::DebugBreak() {
#elif V8_HOST_ARCH_MIPS64
asm("break");
#elif V8_HOST_ARCH_IA32
-#if defined(__native_client__)
+#if V8_OS_NACL
asm("hlt");
#else
asm("int $3");
-#endif // __native_client__
+#endif // V8_OS_NACL
#elif V8_HOST_ARCH_X64
asm("int $3");
#else
@@ -268,12 +270,17 @@ int OS::GetCurrentThreadId() {
//
int OS::GetUserTime(uint32_t* secs, uint32_t* usecs) {
+#if V8_OS_NACL
+ // Optionally used in Logger::ResourceEvent.
+ return -1;
+#else
struct rusage usage;
if (getrusage(RUSAGE_SELF, &usage) < 0) return -1;
*secs = usage.ru_utime.tv_sec;
*usecs = usage.ru_utime.tv_usec;
return 0;
+#endif
}
« no previous file with comments | « src/base/platform/platform-linux.cc ('k') | src/base/platform/semaphore.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698