From 88ff6a98323a78ee3334a55c2eac6de17cb10316 Mon Sep 17 00:00:00 2001 From: Alex Stratford <alexander3.stratford@live.uwe.ac.uk> Date: Wed, 4 Dec 2019 15:56:53 +0000 Subject: [PATCH] Fixed other issues --- userprog/syscall.c | 3 +++ userprog/system_calls.h | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/userprog/syscall.c b/userprog/syscall.c index a104087..e6abc56 100644 --- a/userprog/syscall.c +++ b/userprog/syscall.c @@ -79,6 +79,9 @@ syscall_handler (struct intr_frame *f UNUSED) case SYSCALL_OPEN: syscall_open(f); break; + case SYSCALL_FILESIZE: + syscall_filesize(f); + break; default: printf ("WARNING: Invalid Syscall (%d)\n", syscall_number); thread_exit (); diff --git a/userprog/system_calls.h b/userprog/system_calls.h index 8dc87c9..ce7ae18 100644 --- a/userprog/system_calls.h +++ b/userprog/system_calls.h @@ -49,6 +49,11 @@ void syscall_write(struct intr_frame *f); */ void syscall_open(struct intr_frame *f); +/* + * Returns the size, in bytes, of the file open as fd. + */ +void syscall_filesize(struct intr_frame *f); + /* * Deletes the file called file. Returns true if successful, false otherwise. * A file may be removed regardless of whether it is open or closed, and -- GitLab