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
9c272954
Commit
9c272954
authored
5 years ago
by
a2-stratford
Browse files
Options
Downloads
Patches
Plain Diff
Removed useless functions
parent
645de1b7
No related branches found
No related tags found
2 merge requests
!22
Merge Feature/system calls
,
!6
Implemented filesize system call
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
userprog/syscall.c
+0
-30
0 additions, 30 deletions
userprog/syscall.c
userprog/system_calls.h
+0
-7
0 additions, 7 deletions
userprog/system_calls.h
with
0 additions
and
37 deletions
userprog/syscall.c
+
0
−
30
View file @
9c272954
...
...
@@ -83,33 +83,3 @@ syscall_handler (struct intr_frame *f UNUSED)
thread_exit
();
}
}
\ No newline at end of file
static
struct
list
*
file_list
;
/* Goes through all the files in the file_list and looks for the given file
* Descriptor. Linear search
*/
void
file_search
(
struct
file_map
*
f
)
{
// Creates a struct to hold the currently checked file
struct
file_map
*
curr_file
;
// Creates the list element to test for end of list
struct
list_elem
*
list_element
;
*
list_element
=
*
list_begin
(
file_list
);
// Loop to check each file in the linked list in turn
while
((
curr_file
->
file_descriptor
!=
f
->
file_descriptor
)
&&
(
is_tail
(
list_element
)
==
false
)
)
{
// Swaps the list_element for the next one in place
list_element
=
list_next
(
list_element
);
}
// Copies list_element to current file
curr_file
->
list_element
=
*
list_element
;
// Checks if file has been found returning NULL if not or the file if it has
if
(
curr_file
->
file_descriptor
!=
f
->
file_descriptor
)
{
f
->
file
=
NULL
;
}
else
{
f
=
curr_file
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
userprog/system_calls.h
+
0
−
7
View file @
9c272954
...
...
@@ -4,13 +4,6 @@
#include
"filesys/file.c"
// Added due to dependency for file
// Maps file descriptions to the associated file structure
struct
file_map
{
struct
list_elem
list_element
;
// Defined in list.h
int
file_descriptor
;
struct
file
*
file
;
// Defined in file.c
};
/*
* Terminates Pintos by calling shutdown_power_off()
...
...
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