Skip to content
Snippets Groups Projects
Commit 99c3962a authored by a2-stratford's avatar a2-stratford
Browse files

Implemented the exit system call

parent 89c3f3c8
No related branches found
No related tags found
3 merge requests!22Merge Feature/system calls,!8Implemented the exit system call,!7Implemented the close system call
......@@ -10,3 +10,4 @@ examples/libc.a
examples/my
# Visual Studio folder
/.vs
/CppProperties.json
#include "system_calls.h"
#include "threads/interrupt.h"
#include "threads/thread.h"
void syscall_exit(struct intr_frame *f) {
(void*)0;
void syscall_exit(struct intr_frame *status) {
struct thread *current_thread; // creates thread struct from thread.h
current_thread = thread_current(); // Sets current thread
current_thread->status = status; // Returning status to kernel
thread_exit(); // Exiting current thread
return -1; // Returning -1 for success
}
......@@ -12,7 +12,7 @@ void syscall_halt(struct intr_frame *f);
* returned. Conventionally, a status of 0 indicates success and nonzero
* values indicate errors.
*/
void syscall_exit(struct intr_frame *f);
void syscall_exit(struct intr_frame *status);
/*
* Runs the executable whose name is given in cmd_line, passing any given
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment