summaryrefslogtreecommitdiff
path: root/Kernel/Task.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-10-24 00:20:34 +0200
committerAndreas Kling <awesomekling@gmail.com>2018-10-24 00:20:34 +0200
commit3253a23b915df9c6e10d586a4a69181c1f1079bc (patch)
tree1e580dce611ff7d62f39c09fdcb46f0e49fe00d7 /Kernel/Task.h
parent018da1be11e90309d7929803ba47627efe15c202 (diff)
downloadserenity-3253a23b915df9c6e10d586a4a69181c1f1079bc.zip
Add a simplified waitpid() so that sh can wait on spawned commands.
Diffstat (limited to 'Kernel/Task.h')
-rw-r--r--Kernel/Task.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/Task.h b/Kernel/Task.h
index 06c8dc8212..7427daee80 100644
--- a/Kernel/Task.h
+++ b/Kernel/Task.h
@@ -37,6 +37,7 @@ public:
Terminated = 6,
Crashing = 7,
Exiting = 8,
+ BlockedWait = 9,
};
enum RingLevel {
@@ -97,6 +98,7 @@ public:
void sys$sleep(DWORD ticks);
void sys$exit(int status);
int sys$spawn(const char* path);
+ pid_t sys$waitpid(pid_t);
struct
{
@@ -116,6 +118,8 @@ public:
void didSchedule() { ++m_timesScheduled; }
dword timesScheduled() const { return m_timesScheduled; }
+ pid_t waitee() const { return m_waitee; }
+
private:
friend class MemoryManager;
@@ -145,6 +149,7 @@ private:
int m_error { 0 };
void* m_kernelStack { nullptr };
dword m_timesScheduled { 0 };
+ pid_t m_waitee { -1 };
struct Region {
Region(LinearAddress, size_t, RetainPtr<Zone>&&, String&&);