Add macOS support #34
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -55,7 +55,7 @@ auto change_to_process_directory() -> bool {
|
|||||||
std::string path;
|
std::string path;
|
||||||
path.resize(PATH_MAX + 1);
|
path.resize(PATH_MAX + 1);
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
proc_pidpath(getpid(), reinterpret_cast<void *>(path.data()),
|
auto res =proc_pidpath(getpid(), reinterpret_cast<void *>(path.data()),
|
||||||
static_cast<uint32_t>(path.size()));
|
static_cast<uint32_t>(path.size()));
|
||||||
#else // !defined(__APPLE__)
|
#else // !defined(__APPLE__)
|
||||||
auto res = readlink("/proc/self/exe", path.data(), path.size());
|
auto res = readlink("/proc/self/exe", path.data(), path.size());
|
||||||
@@ -69,7 +69,7 @@ auto change_to_process_directory() -> bool {
|
|||||||
}
|
}
|
||||||
#endif // defined(__APPLE__)
|
#endif // defined(__APPLE__)
|
||||||
path = utils::path::get_parent_path(path);
|
path = utils::path::get_parent_path(path);
|
||||||
auto res = chdir(path.c_str());
|
res = chdir(path.c_str());
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
throw utils::error::create_exception(
|
throw utils::error::create_exception(
|
||||||
function_name, {
|
function_name, {
|
||||||
|
@@ -31,6 +31,7 @@ auto convert_to_uint64(pthread_t thread) -> std::uint64_t {
|
|||||||
#else // defined(__APPLE__)
|
#else // defined(__APPLE__)
|
||||||
return static_cast<std::uint64_t>(thread);
|
return static_cast<std::uint64_t>(thread);
|
||||||
#endif // defined(__APPLE__)
|
#endif // defined(__APPLE__)
|
||||||
|
}
|
||||||
|
|
||||||
auto get_last_error_code() -> int { return errno; }
|
auto get_last_error_code() -> int { return errno; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user