diff options
author | Frans Kaashoek <[email protected]> | 2019-09-10 12:30:10 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2019-09-10 12:30:10 -0400 |
commit | 7e6c37e67e6da62e02089fc3292569103b7e94b3 (patch) | |
tree | 8b3f2e762f1f0a32a4641d240d30b155af6ab34a /kernel/trap.c | |
parent | 035cca95fe87c67ee1e33b9edfb2d87e24476fa8 (diff) | |
download | xv6-labs-7e6c37e67e6da62e02089fc3292569103b7e94b3.tar.gz xv6-labs-7e6c37e67e6da62e02089fc3292569103b7e94b3.tar.bz2 xv6-labs-7e6c37e67e6da62e02089fc3292569103b7e94b3.zip |
Support exit status for exit/wait
One test case for returning a exit status
Passes usertests, but haven't used it to simplify tests
Diffstat (limited to 'kernel/trap.c')
-rw-r--r-- | kernel/trap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/trap.c b/kernel/trap.c index ec57bed..e96a542 100644 --- a/kernel/trap.c +++ b/kernel/trap.c @@ -54,7 +54,7 @@ usertrap(void) // system call if(p->killed) - exit(); + exit(-1); // sepc points to the ecall instruction, // but we want to return to the next instruction. @@ -74,7 +74,7 @@ usertrap(void) } if(p->killed) - exit(); + exit(-1); // give up the CPU if this is a timer interrupt. if(which_dev == 2) |