From 71ff763dd9c603fd597fe2f96ea832e71c9195fd Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 12 Jul 2023 13:45:36 +0200 Subject: [PATCH] kernel+libc: Add the SIGTTIN and SIGTTOU signals --- kernel/src/thread/Thread.cpp | 3 +++ libc/include/bits/signal.h | 2 ++ libc/src/string.cpp | 2 ++ 3 files changed, 7 insertions(+) diff --git a/kernel/src/thread/Thread.cpp b/kernel/src/thread/Thread.cpp index aa235d46..838fbbe6 100644 --- a/kernel/src/thread/Thread.cpp +++ b/kernel/src/thread/Thread.cpp @@ -110,6 +110,7 @@ enum class DefaultSignalAction Terminate, }; +// FIXME: Implement coredumps for some signals. static constexpr DefaultSignalAction default_actions[] = { DefaultSignalAction::Terminate, // SIGHUP DefaultSignalAction::Terminate, // SIGINT @@ -126,6 +127,8 @@ static constexpr DefaultSignalAction default_actions[] = { DefaultSignalAction::Terminate, // SIGPIPE DefaultSignalAction::Terminate, // SIGALRM DefaultSignalAction::Terminate, // SIGTERM + DefaultSignalAction::Terminate, // SIGTTIN + DefaultSignalAction::Terminate, // SIGTTOU }; void Thread::process_pending_signals(Registers* current_regs) diff --git a/libc/include/bits/signal.h b/libc/include/bits/signal.h index 792f9840..16a0441e 100644 --- a/libc/include/bits/signal.h +++ b/libc/include/bits/signal.h @@ -49,6 +49,8 @@ enum __signals SIGPIPE = 13, SIGALRM = 14, SIGTERM = 15, + SIGTTIN = 16, + SIGTTOU = 17, // FIXME: Add the remaining signals. __NSIG, }; diff --git a/libc/src/string.cpp b/libc/src/string.cpp index 510c465e..a9aeb754 100644 --- a/libc/src/string.cpp +++ b/libc/src/string.cpp @@ -33,6 +33,8 @@ extern "C" case SIGPIPE: return "Broken pipe"; case SIGALRM: return "Alarm signal"; case SIGTERM: return "Terminated"; + case SIGTTIN: return "Background process stopped (terminal input)"; + case SIGTTOU: return "Background process stopped (terminal output)"; default: return "Unknown signal"; } }