summaryrefslogtreecommitdiffstats
path: root/src/userprog/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/userprog/syscall.c')
-rw-r--r--src/userprog/syscall.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c
index 177cf02..52526aa 100644
--- a/src/userprog/syscall.c
+++ b/src/userprog/syscall.c
@@ -88,12 +88,16 @@ exit (int status)
thread->parent->exit_status = status;
lock_release (&thread->parent->l);
- printf("%s: exit(%d)\n", thread->name, status);
-
thread_exit ();
}
static int
+wait (tid_t child_tid)
+{
+ return process_wait (child_tid);
+}
+
+static int
read (int fd_i, void *buf, unsigned size)
{
struct thread *thread = thread_current ();
@@ -178,6 +182,10 @@ syscall_handler (struct intr_frame *f UNUSED)
// exec
f->eax = exec (INTR_ESP (1, char *));
break;
+ case 3:
+ // wait
+ f->eax = wait (INTR_ESP (1, tid_t));
+ break;
case 4:
// create
f->eax = create (INTR_ESP (1, char *), INTR_ESP (2, off_t));