aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/rc/rc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/rc/rc.h')
-rw-r--r--sys/cmd/rc/rc.h36
1 files changed, 25 insertions, 11 deletions
diff --git a/sys/cmd/rc/rc.h b/sys/cmd/rc/rc.h
index 9c6307f..ef7c18e 100644
--- a/sys/cmd/rc/rc.h
+++ b/sys/cmd/rc/rc.h
@@ -93,6 +93,22 @@ struct Redir
struct Redir *link; /* what else to do (reverse order) */
};
+enum
+{
+ PNil,
+ PRun,
+ PStop,
+ PSig,
+ PAgain,
+ PDone,
+};
+
+struct WaitItem
+{
+ int pid;
+ ushort status;
+};
+
struct Thread
{
struct {
@@ -109,21 +125,19 @@ struct Thread
Redir *redir; // list of redirections
struct {
- ushort i : 1;
- ushort eof : 1;
- ushort stop : 1;
- ushort done : 1;
- ushort again : 1;
- } flag; // flags for process
+ ushort i : 1;
+ ushort eof : 1;
+ } flag;
struct {
- int len, cap, *pid;
+ ushort status;
+ int len, cap;
+ struct WaitItem *on;
} wait;
int pid, pgid, status;
long line;
- Tree *nodes; // memory allocation
Thread *link; // process we return to
Thread *next; // next job
};
@@ -131,6 +145,7 @@ struct Thread
struct Shell
{
int pid;
+ Io *err;
int status;
int interactive;
Thread *jobs;
@@ -140,9 +155,7 @@ struct Shell
// globals
extern Shell shell;
-
-extern Thread *proc;
-extern Io *errio;
+extern Thread *runner;
extern Code *compiled;
// -----------------------------------------------------------------------
@@ -203,6 +216,7 @@ void killzombies(void);
Thread *getjob(int, int*);
void addjob(Thread *);
void deljob(Thread *);
+void wakeup(Thread *);
void report(Thread *, int);
void foreground(Thread *, int);