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

Fixed minor errors in syscall_filesize

syscall_filesize.c
line 14: Added passed in variable to file_search()
line 16: Fixed return for failure state
parent 9d6aeb92
No related branches found
No related tags found
2 merge requests!22Merge Feature/system calls,!6Implemented filesize system call
......@@ -11,9 +11,9 @@ int syscall_filesize(struct intr_frame *f) {
struct file_map *f_map; // Described in system_calls.h
// pop off first int argument from interrupt frame
f_map->file_descriptor = *((int*)f->esp + 1);
file_search();
file_search(*f_map);
if (f_map->file == NULL) { // Checking if file is empty or non-existent
return -1; // Returning failure state
f->eax -1; // Returning failure state
}
// Using the file_length function in file.h to get the length and store it
int size = file_length(f_map->file);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment