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

Unified Diff: runtime/vm/os_openbsd.cc

Issue 1559053002: Refs #10260 OpenBSD support #25327 Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address code review issues Created 4 years, 11 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 | « runtime/vm/native_symbol_openbsd.cc ('k') | runtime/vm/os_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_openbsd.cc
diff --git a/runtime/vm/os_linux.cc b/runtime/vm/os_openbsd.cc
similarity index 98%
copy from runtime/vm/os_linux.cc
copy to runtime/vm/os_openbsd.cc
index 7924be1cfcd7460c55309f25096ddd8021c0ecc7..844ccba601a2b8ace0791f89b5551922ac775388 100644
--- a/runtime/vm/os_linux.cc
+++ b/runtime/vm/os_openbsd.cc
@@ -3,18 +3,17 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(TARGET_OS_LINUX)
+#if defined(TARGET_OS_OPENBSD)
#include "vm/os.h"
#include <errno.h> // NOLINT
#include <limits.h> // NOLINT
-#include <malloc.h> // NOLINT
+#include <stdlib.h> // NOLINT
#include <time.h> // NOLINT
#include <sys/resource.h> // NOLINT
#include <sys/time.h> // NOLINT
#include <sys/types.h> // NOLINT
-#include <sys/syscall.h> // NOLINT
#include <sys/stat.h> // NOLINT
#include <fcntl.h> // NOLINT
#include <unistd.h> // NOLINT
@@ -259,9 +258,8 @@ class JitdumpCodeObserver : public CodeObserver {
}
pid_t gettid() {
- // libc doesn't wrap the Linux-specific gettid system call.
// Note that this thread id is not the same as the posix thread id.
- return syscall(SYS_gettid);
+ return getthrid();
}
uint64_t GetKernelTimeNanos() {
@@ -337,7 +335,7 @@ class JitdumpCodeObserver : public CodeObserver {
const char* OS::Name() {
- return "linux";
+ return "openbsd";
}
@@ -414,8 +412,8 @@ void* OS::AlignedAllocate(intptr_t size, intptr_t alignment) {
const int kMinimumAlignment = 16;
ASSERT(Utils::IsPowerOfTwo(alignment));
ASSERT(alignment >= kMinimumAlignment);
- void* p = memalign(alignment, size);
- if (p == NULL) {
+ void* p = NULL;
+ if (posix_memalign(&p, alignment, size)) {
UNREACHABLE();
}
return p;
@@ -653,4 +651,4 @@ void OS::Exit(int code) {
} // namespace dart
-#endif // defined(TARGET_OS_LINUX)
+#endif // defined(TARGET_OS_OPENBSD)
« no previous file with comments | « runtime/vm/native_symbol_openbsd.cc ('k') | runtime/vm/os_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698