1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:57:45 +00:00

Add a simplified waitpid() so that sh can wait on spawned commands.

This commit is contained in:
Andreas Kling 2018-10-24 00:20:34 +02:00
parent 018da1be11
commit 3253a23b91
8 changed files with 42 additions and 7 deletions

View file

@ -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&&);