From 1b0d67b1e7c5546f1d0dc6345c664a14926a353a Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 22 Jun 2019 13:08:35 +0100 Subject: [PATCH] src: fix OpenBSD build PR-URL: https://github.com/nodejs/node/pull/28384 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis Reviewed-By: Rich Trott --- src/debug_utils.cc | 8 +++++--- src/env.cc | 2 +- src/node_report.cc | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/debug_utils.cc b/src/debug_utils.cc index a9bfa86b6d2aea..a55936f4e79c28 100644 --- a/src/debug_utils.cc +++ b/src/debug_utils.cc @@ -26,9 +26,11 @@ #endif // __POSIX__ -#if defined(__linux__) || defined(__sun) || defined(__FreeBSD__) +#if defined(__linux__) || defined(__sun) || \ + defined(__FreeBSD__) || defined(__OpenBSD__) #include -#endif // (__linux__) || defined(__sun) || defined(__FreeBSD__) +#endif // (__linux__) || defined(__sun) || + // (__FreeBSD__) || defined(__OpenBSD__) #ifdef __APPLE__ #include // _dyld_get_image_name() @@ -331,7 +333,7 @@ void PrintLibuvHandleInformation(uv_loop_t* loop, FILE* stream) { std::vector NativeSymbolDebuggingContext::GetLoadedLibraries() { std::vector list; -#if defined(__linux__) || defined(__FreeBSD__) +#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) dl_iterate_phdr( [](struct dl_phdr_info* info, size_t size, void* data) { auto list = static_cast*>(data); diff --git a/src/env.cc b/src/env.cc index 936b9a1854cf93..80079c4f6edc6b 100644 --- a/src/env.cc +++ b/src/env.cc @@ -277,7 +277,7 @@ std::string GetExecPath(const std::vector& argv) { uv_fs_t req; req.ptr = nullptr; if (0 == - uv_fs_realpath(env->event_loop(), &req, exec_path.c_str(), nullptr)) { + uv_fs_realpath(nullptr, &req, exec_path.c_str(), nullptr)) { CHECK_NOT_NULL(req.ptr); exec_path = std::string(static_cast(req.ptr)); } diff --git a/src/node_report.cc b/src/node_report.cc index ebeb386c27946d..4f2f1dd1abebfe 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -519,7 +519,9 @@ static void PrintSystemInformation(JSONWriter* writer) { #ifndef __sun {"max_user_processes", RLIMIT_NPROC}, #endif +#ifndef __OpenBSD__ {"virtual_memory_kbytes", RLIMIT_AS} +#endif }; #endif // _WIN32 writer->json_objectstart("environmentVariables");