Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pintos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Project Purple Stallion
Pintos
Commits
0cc65f90
Commit
0cc65f90
authored
5 years ago
by
a2-stratford
Browse files
Options
Downloads
Patches
Plain Diff
Broken file_search in syscall.c DO NOT MERGE until working
parent
21d14e88
Branches
Branches containing commit
No related tags found
2 merge requests
!22
Merge Feature/system calls
,
!6
Implemented filesize system call
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
userprog/syscall.c
+10
-0
10 additions, 0 deletions
userprog/syscall.c
with
10 additions
and
0 deletions
userprog/syscall.c
+
10
−
0
View file @
0cc65f90
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment