From e9c4061531a26621b24e04eac0280384cd509182 Mon Sep 17 00:00:00 2001 From: sBubshait Date: Tue, 5 Nov 2024 22:38:45 +0000 Subject: [PATCH] Implement the exit system call, w/ E --- src/userprog/syscall.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c index fedd1a4..5113292 100644 --- a/src/userprog/syscall.c +++ b/src/userprog/syscall.c @@ -99,9 +99,12 @@ halt (void) } static void -exit (int status UNUSED) +exit (int status) { - //TODO + /* Sets exit_status of the thread to status. thread_exit () will call + process_exit () if user programs are allowed. */ + thread_current ()->exit_status = status; + thread_exit (); } static pid_t