mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 06:57:42 +00:00
Kernel: Process should send SIGCHLD to its parent when it dies.
This commit is contained in:
parent
7fe600f250
commit
ba6ffea03c
2 changed files with 13 additions and 0 deletions
|
@ -2172,6 +2172,11 @@ void Process::die()
|
||||||
m_fds.clear();
|
m_fds.clear();
|
||||||
m_tty = nullptr;
|
m_tty = nullptr;
|
||||||
destroy_all_windows();
|
destroy_all_windows();
|
||||||
|
|
||||||
|
InterruptDisabler disabler;
|
||||||
|
if (auto* parent_process = Process::from_pid(m_ppid)) {
|
||||||
|
parent_process->send_signal(SIGCHLD, this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Process::amount_virtual() const
|
size_t Process::amount_virtual() const
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <LibGUI/GEventLoop.h>
|
#include <LibGUI/GEventLoop.h>
|
||||||
#include <LibGUI/GTextBox.h>
|
#include <LibGUI/GTextBox.h>
|
||||||
#include <LibGUI/GCheckBox.h>
|
#include <LibGUI/GCheckBox.h>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
class ClockWidget final : public GWidget {
|
class ClockWidget final : public GWidget {
|
||||||
public:
|
public:
|
||||||
|
@ -69,8 +70,15 @@ static GWindow* make_font_test_window();
|
||||||
static GWindow* make_launcher_window();
|
static GWindow* make_launcher_window();
|
||||||
static GWindow* make_clock_window();
|
static GWindow* make_clock_window();
|
||||||
|
|
||||||
|
void handle_sigchld(int)
|
||||||
|
{
|
||||||
|
dbgprintf("Got SIGCHLD\n");
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
signal(SIGCHLD, handle_sigchld);
|
||||||
|
|
||||||
GEventLoop loop;
|
GEventLoop loop;
|
||||||
#if 0
|
#if 0
|
||||||
auto* font_test_window = make_font_test_window();
|
auto* font_test_window = make_font_test_window();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue