1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +00:00

Tests, LibTest: Implement disabling core dumps on GNU Hurd

This commit is contained in:
Sergey Bugaev 2023-09-03 22:30:39 +03:00 committed by Andrew Kaster
parent f31df017f9
commit bba193d6a0
2 changed files with 10 additions and 4 deletions

View file

@ -12,7 +12,7 @@
#include <sys/wait.h>
#include <unistd.h>
#if !defined(AK_OS_MACOS) && !defined(AK_OS_EMSCRIPTEN)
#if !defined(AK_OS_MACOS) && !defined(AK_OS_EMSCRIPTEN) && !defined(AK_OS_GNU_HURD)
# include <sys/prctl.h>
#endif
@ -38,7 +38,10 @@ bool Crash::run(RunType run_type)
perror("fork");
VERIFY_NOT_REACHED();
} else if (pid == 0) {
#if !defined(AK_OS_MACOS) && !defined(AK_OS_EMSCRIPTEN)
#if defined(AK_OS_GNU_HURD)
// When we crash, just kill the program, don't dump core.
setenv("CRASHSERVER", "/servers/crash-kill", true);
#elif !defined(AK_OS_MACOS) && !defined(AK_OS_EMSCRIPTEN)
if (prctl(PR_SET_DUMPABLE, 0, 0, 0) < 0)
perror("prctl(PR_SET_DUMPABLE)");
#endif