diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2023-02-10 16:32:30 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2023-02-10 17:08:33 +0100 |
commit | c49b7472eaa7a6501aa937b40f80702ecf0f43e6 (patch) | |
tree | 5c4b08f2d4ce973a35188139e8e05c42b231afab /src | |
parent | 3e6e34cdf589d67c767bffe19483a6c9e53233a7 (diff) |
Fix macOS build
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/util.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 94da37561..795b66dc3 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -1085,6 +1085,7 @@ pid_t startProcess(std::function<void()> fun, const ProcessOptions & options) pid_t pid = -1; if (options.cloneFlags) { + #ifdef __linux__ // Not supported, since then we don't know when to free the stack. assert(!(options.cloneFlags & CLONE_VM)); @@ -1096,6 +1097,9 @@ pid_t startProcess(std::function<void()> fun, const ProcessOptions & options) Finally freeStack([&]() { munmap(stack, stackSize); }); pid = clone(childEntry, stack + stackSize, options.cloneFlags | SIGCHLD, &wrapper); + #else + throw Error("clone flags are only supported on Linux"); + #endif } else pid = doFork(options.allowVfork, wrapper); |