Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
Krishna Vinnakota
CSEP551
Commits
3a2310f7
Commit
3a2310f7
authored
17 years ago
by
rsc
Browse files
Options
Downloads
Patches
Plain Diff
make code match comment
parent
64c47374
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
syscall.c
+6
-7
6 additions, 7 deletions
syscall.c
sysfile.c
+1
-1
1 addition, 1 deletion
sysfile.c
with
7 additions
and
8 deletions
syscall.c
+
6
−
7
View file @
3a2310f7
...
...
@@ -42,20 +42,20 @@ fetchstr(struct proc *p, uint addr, char **pp)
// Fetch the argno'th 32-bit system call argument.
int
argint
(
int
argno
,
int
*
ip
)
argint
(
int
n
,
int
*
ip
)
{
return
fetchint
(
cp
,
cp
->
tf
->
esp
+
4
+
4
*
argno
,
ip
);
return
fetchint
(
cp
,
cp
->
tf
->
esp
+
4
+
4
*
n
,
ip
);
}
// Fetch the nth word-sized system call argument as a pointer
// to a block of memory of size n bytes. Check that the pointer
// lies within the process address space.
int
argptr
(
int
argno
,
char
**
pp
,
int
size
)
argptr
(
int
n
,
char
**
pp
,
int
size
)
{
int
i
;
if
(
argint
(
argno
,
&
i
)
<
0
)
if
(
argint
(
n
,
&
i
)
<
0
)
return
-
1
;
if
((
uint
)
i
>=
cp
->
sz
||
(
uint
)
i
+
size
>=
cp
->
sz
)
return
-
1
;
...
...
@@ -68,10 +68,10 @@ argptr(int argno, char **pp, int size)
// (There is no shared writable memory, so the string can't change
// between this check and being used by the kernel.)
int
argstr
(
int
argno
,
char
**
pp
)
argstr
(
int
n
,
char
**
pp
)
{
int
addr
;
if
(
argint
(
argno
,
&
addr
)
<
0
)
if
(
argint
(
n
,
&
addr
)
<
0
)
return
-
1
;
return
fetchstr
(
cp
,
addr
,
pp
);
}
...
...
@@ -88,7 +88,6 @@ extern int sys_kill(void);
extern
int
sys_link
(
void
);
extern
int
sys_mkdir
(
void
);
extern
int
sys_mknod
(
void
);
//PAGEBREAK: 0
extern
int
sys_open
(
void
);
extern
int
sys_pipe
(
void
);
extern
int
sys_read
(
void
);
...
...
This diff is collapsed.
Click to expand it.
sysfile.c
+
1
−
1
View file @
3a2310f7
...
...
@@ -17,7 +17,7 @@ argfd(int n, int *pfd, struct file **pf)
int
fd
;
struct
file
*
f
;
if
(
argint
(
argno
,
&
fd
)
<
0
)
if
(
argint
(
n
,
&
fd
)
<
0
)
return
-
1
;
if
(
fd
<
0
||
fd
>=
NOFILE
||
(
f
=
cp
->
ofile
[
fd
])
==
0
)
return
-
1
;
...
...
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