steamcompmgr: reap children like Linux on some BSDs
DragonFly and FreeBSD adopted a similar API to Linux. Other sytems maybe interested as well, so add a warning. src/steamcompmgr.cpp:51:10: fatal error: 'sys/prctl.h' file not found #include <sys/prctl.h> ^~~~~~~~~~~~~ src/steamcompmgr.cpp:3118:9: error: use of undeclared identifier 'PR_SET_CHILD_SUBREAPER' prctl( PR_SET_CHILD_SUBREAPER, 1, 0, 0, 0 ); ^
This commit is contained in:
parent
241df252fd
commit
50d5ea83b6
1 changed files with 10 additions and 0 deletions
|
@ -53,7 +53,11 @@
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#if defined(__linux__)
|
||||||
#include <sys/prctl.h>
|
#include <sys/prctl.h>
|
||||||
|
#elif defined(__DragonFly__) || defined(__FreeBSD__)
|
||||||
|
#include <sys/procctl.h>
|
||||||
|
#endif
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
@ -4832,8 +4836,14 @@ void check_new_wayland_res(xwayland_ctx_t *ctx)
|
||||||
static void
|
static void
|
||||||
spawn_client( char **argv )
|
spawn_client( char **argv )
|
||||||
{
|
{
|
||||||
|
#if defined(__linux__)
|
||||||
// (Don't Lose) The Children
|
// (Don't Lose) The Children
|
||||||
prctl( PR_SET_CHILD_SUBREAPER, 1, 0, 0, 0 );
|
prctl( PR_SET_CHILD_SUBREAPER, 1, 0, 0, 0 );
|
||||||
|
#elif defined(__DragonFly__) || defined(__FreeBSD__)
|
||||||
|
procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL);
|
||||||
|
#else
|
||||||
|
#warning "Changing reaper process for children is not supported on this platform"
|
||||||
|
#endif
|
||||||
|
|
||||||
std::string strNewPreload;
|
std::string strNewPreload;
|
||||||
char *pchPreloadCopy = nullptr;
|
char *pchPreloadCopy = nullptr;
|
||||||
|
|
Loading…
Reference in a new issue