aboutsummaryrefslogtreecommitdiff
path: root/src/zencore
diff options
context:
space:
mode:
Diffstat (limited to 'src/zencore')
-rw-r--r--src/zencore/include/zencore/memory/fmalloc.h2
-rw-r--r--src/zencore/include/zencore/process.h4
-rw-r--r--src/zencore/memory/mallocmimalloc.cpp2
-rw-r--r--src/zencore/process.cpp8
4 files changed, 12 insertions, 4 deletions
diff --git a/src/zencore/include/zencore/memory/fmalloc.h b/src/zencore/include/zencore/memory/fmalloc.h
index aeb05b651..5b476429e 100644
--- a/src/zencore/include/zencore/memory/fmalloc.h
+++ b/src/zencore/include/zencore/memory/fmalloc.h
@@ -2,6 +2,8 @@
#pragma once
+#include <cstddef>
+
#include <zenbase/zenbase.h>
namespace zen {
diff --git a/src/zencore/include/zencore/process.h b/src/zencore/include/zencore/process.h
index 42b997c39..36c2a2481 100644
--- a/src/zencore/include/zencore/process.h
+++ b/src/zencore/include/zencore/process.h
@@ -101,6 +101,10 @@ int GetProcessId(CreateProcResult ProcId);
std::filesystem::path GetProcessExecutablePath(int Pid, std::error_code& OutEc);
std::error_code FindProcess(const std::filesystem::path& ExecutableImage, ProcessHandle& OutHandle);
+#if ZEN_PLATFORM_LINUX
+void IgnoreChildSignals();
+#endif
+
void process_forcelink(); // internal
} // namespace zen
diff --git a/src/zencore/memory/mallocmimalloc.cpp b/src/zencore/memory/mallocmimalloc.cpp
index 1919af3bf..1f9aff404 100644
--- a/src/zencore/memory/mallocmimalloc.cpp
+++ b/src/zencore/memory/mallocmimalloc.cpp
@@ -1,5 +1,7 @@
// Copyright Epic Games, Inc. All Rights Reserved.
+#include <cstring>
+
#include <zencore/intmath.h>
#include <zencore/memory/align.h>
#include <zencore/memory/mallocmimalloc.h>
diff --git a/src/zencore/process.cpp b/src/zencore/process.cpp
index 004b36dca..079e2db3f 100644
--- a/src/zencore/process.cpp
+++ b/src/zencore/process.cpp
@@ -24,7 +24,6 @@
# include <sys/sem.h>
# include <sys/stat.h>
# include <sys/syscall.h>
-# include <sys/sysctl.h>
# include <sys/wait.h>
# include <time.h>
# include <unistd.h>
@@ -41,7 +40,9 @@ ZEN_THIRD_PARTY_INCLUDES_END
namespace zen {
#if ZEN_PLATFORM_LINUX
-const bool bNoZombieChildren = []() {
+void
+IgnoreChildSignals()
+{
// When a child process exits it is put into a zombie state until the parent
// collects its result. This doesn't fit the Windows-like model that Zen uses
// where there is a less strict familial model and no zombification. Ignoring
@@ -52,8 +53,7 @@ const bool bNoZombieChildren = []() {
sigemptyset(&Action.sa_mask);
Action.sa_handler = SIG_IGN;
sigaction(SIGCHLD, &Action, nullptr);
- return true;
-}();
+}
static char
GetPidStatus(int Pid, std::error_code& OutEc)