| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Platform-specific code for POSIX goes here. This is not a platform on its | 5 // Platform-specific code for POSIX goes here. This is not a platform on its |
| 6 // own, but contains the parts which are the same across the POSIX platforms | 6 // own, but contains the parts which are the same across the POSIX platforms |
| 7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX. | 7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX. |
| 8 | 8 |
| 9 #include <errno.h> | 9 #include <errno.h> |
| 10 #include <limits.h> | 10 #include <limits.h> |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 355 |
| 356 int OS::GetCurrentThreadId() { | 356 int OS::GetCurrentThreadId() { |
| 357 #if V8_OS_MACOSX || (V8_OS_ANDROID && defined(__APPLE__)) | 357 #if V8_OS_MACOSX || (V8_OS_ANDROID && defined(__APPLE__)) |
| 358 return static_cast<int>(pthread_mach_thread_np(pthread_self())); | 358 return static_cast<int>(pthread_mach_thread_np(pthread_self())); |
| 359 #elif V8_OS_LINUX | 359 #elif V8_OS_LINUX |
| 360 return static_cast<int>(syscall(__NR_gettid)); | 360 return static_cast<int>(syscall(__NR_gettid)); |
| 361 #elif V8_OS_ANDROID | 361 #elif V8_OS_ANDROID |
| 362 return static_cast<int>(gettid()); | 362 return static_cast<int>(gettid()); |
| 363 #elif V8_OS_AIX | 363 #elif V8_OS_AIX |
| 364 return static_cast<int>(thread_self()); | 364 return static_cast<int>(thread_self()); |
| 365 #elif V8_OS_FUCHSIA |
| 366 return static_cast<int>(pthread_self()); |
| 365 #elif V8_OS_SOLARIS | 367 #elif V8_OS_SOLARIS |
| 366 return static_cast<int>(pthread_self()); | 368 return static_cast<int>(pthread_self()); |
| 367 #else | 369 #else |
| 368 return static_cast<int>(reinterpret_cast<intptr_t>(pthread_self())); | 370 return static_cast<int>(reinterpret_cast<intptr_t>(pthread_self())); |
| 369 #endif | 371 #endif |
| 370 } | 372 } |
| 371 | 373 |
| 372 | 374 |
| 373 // ---------------------------------------------------------------------------- | 375 // ---------------------------------------------------------------------------- |
| 374 // POSIX date/time support. | 376 // POSIX date/time support. |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 case OS::MemoryPermission::kReadWrite: | 791 case OS::MemoryPermission::kReadWrite: |
| 790 return PROT_READ | PROT_WRITE; | 792 return PROT_READ | PROT_WRITE; |
| 791 case OS::MemoryPermission::kReadWriteExecute: | 793 case OS::MemoryPermission::kReadWriteExecute: |
| 792 return PROT_READ | PROT_WRITE | PROT_EXEC; | 794 return PROT_READ | PROT_WRITE | PROT_EXEC; |
| 793 } | 795 } |
| 794 UNREACHABLE(); | 796 UNREACHABLE(); |
| 795 } | 797 } |
| 796 | 798 |
| 797 } // namespace base | 799 } // namespace base |
| 798 } // namespace v8 | 800 } // namespace v8 |
| OLD | NEW |