diff --git a/config.h.meson b/config.h.meson index 77045319c..0bab71848 100644 --- a/config.h.meson +++ b/config.h.meson @@ -61,6 +61,9 @@ /* XKB base prefix */ #mesondefine XKB_BASE +/* Whether exists and it defines prctl() */ +#mesondefine HAVE_SYS_PRCTL + /* Either or */ #mesondefine HAVE_SYS_RANDOM #mesondefine HAVE_LINUX_RANDOM diff --git a/meson.build b/meson.build index ae0bbfcc2..55ab3eb14 100644 --- a/meson.build +++ b/meson.build @@ -366,6 +366,10 @@ cdata.set('HAVE_PROFILER', have_profiler) xkb_base = xkeyboard_config_dep.get_pkgconfig_variable('xkb_base') cdata.set_quoted('XKB_BASE', xkb_base) +if cc.has_header_symbol('sys/prctl.h', 'prctl') + cdata.set('HAVE_SYS_PRCTL', 1) +endif + if have_wayland xwayland_path = get_option('xwayland_path') if xwayland_path == '' diff --git a/src/core/main.c b/src/core/main.c index 2724cf076..7f4f666d2 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -70,6 +70,10 @@ #include #endif /* HAVE_WAYLAND && HAVE_NATIVE_BACKEND */ +#ifdef HAVE_SYS_PRCTL +#include +#endif + #include "backends/meta-backend-private.h" #include "backends/x11/cm/meta-backend-x11-cm.h" #include "backends/x11/meta-backend-x11.h" @@ -532,6 +536,10 @@ meta_init (void) MetaCompositorType compositor_type; GType backend_gtype; +#ifdef HAVE_SYS_PRCTL + prctl (PR_SET_DUMPABLE, 1); +#endif + sigemptyset (&empty_mask); act.sa_handler = SIG_IGN; act.sa_mask = empty_mask;