summaryrefslogtreecommitdiff
path: root/Kernel/Process.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-05 10:34:08 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-05 10:34:08 +0100
commit251293f2e1178370d85c1dd4f3808ed9681fdb3c (patch)
tree6f5b3fcb24c210f5007832aa3445331b461ef830 /Kernel/Process.h
parentb67d0a363239c3ecf72f7514da74f0536595430b (diff)
downloadserenity-251293f2e1178370d85c1dd4f3808ed9681fdb3c.zip
Kernel: Block a signal from being dispatched again until handler returns.
We don't handle nesting yet, but this is a step in the right direction.
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r--Kernel/Process.h40
1 files changed, 4 insertions, 36 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h
index ab8439e4aa..db1080ad52 100644
--- a/Kernel/Process.h
+++ b/Kernel/Process.h
@@ -227,6 +227,7 @@ public:
int sys$listen(int sockfd, int backlog);
int sys$accept(int sockfd, sockaddr*, socklen_t*);
int sys$connect(int sockfd, const sockaddr*, socklen_t);
+ int sys$restore_signal_mask(dword mask);
int sys$create_shared_buffer(pid_t peer_pid, size_t, void** buffer);
void* sys$get_shared_buffer(int shared_buffer_id);
@@ -365,7 +366,7 @@ private:
size_t m_max_open_file_descriptors { 16 };
SignalActionData m_signal_action_data[32];
dword m_pending_signals { 0 };
- dword m_signal_mask { 0xffffffff };
+ dword m_signal_mask { 0 };
RetainPtr<Socket> m_blocked_connecting_socket;
byte m_termination_status { 0 };
@@ -439,41 +440,8 @@ private:
Process::State m_original_state { Process::Invalid };
};
-static inline const char* to_string(Process::State state)
-{
- switch (state) {
- case Process::Invalid: return "Invalid";
- case Process::Runnable: return "Runnable";
- case Process::Running: return "Running";
- case Process::Dying: return "Dying";
- case Process::Dead: return "Dead";
- case Process::Stopped: return "Stopped";
- case Process::Skip1SchedulerPass: return "Skip1";
- case Process::Skip0SchedulerPasses: return "Skip0";
- case Process::BlockedSleep: return "Sleep";
- case Process::BlockedWait: return "Wait";
- case Process::BlockedRead: return "Read";
- case Process::BlockedWrite: return "Write";
- case Process::BlockedSignal: return "Signal";
- case Process::BlockedSelect: return "Select";
- case Process::BlockedLurking: return "Lurking";
- case Process::BlockedConnect: return "Connect";
- case Process::BeingInspected: return "Inspect";
- }
- ASSERT_NOT_REACHED();
- return nullptr;
-}
-
-static inline const char* to_string(Process::Priority state)
-{
- switch (state) {
- case Process::LowPriority: return "Low";
- case Process::NormalPriority: return "Normal";
- case Process::HighPriority: return "High";
- }
- ASSERT_NOT_REACHED();
- return nullptr;
-}
+extern const char* to_string(Process::State);
+extern const char* to_string(Process::Priority);
extern void block(Process::State);
extern void sleep(dword ticks);