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

Broken file_search in syscall.c DO NOT MERGE until working

parent 21d14e88
Branches
No related tags found
2 merge requests!22Merge Feature/system calls,!6Implemented filesize system call
......@@ -4,6 +4,7 @@
#include "system_calls.h"
#include "threads/interrupt.h"
#include "threads/thread.h"
#include "lib/kernel/list.h" // Dependencies for
/* System call numbers. */
......@@ -79,8 +80,17 @@ syscall_handler (struct intr_frame *f UNUSED)
}
}
static struct list *file_list;
void file_search(struct file_map *f) {
// TODO: Write file search
struct file_map *curr_file;
*curr_file->list_element = list_begin(file_list);
while (
(curr_file->file_descriptor != f->file_descriptor) &&
(*curr_file->list_element != file_list->tail)
) {
list_next(*curr_file->list_element);
}
f->file = NULL;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment