Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
89abc9bd
提交
89abc9bd
2月 10, 2012
创建
作者:
Nickolai Zeldovich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more c++
上级
09d6dd69
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
8 行增加
和
6 行删除
+8
-6
sysfile.c
sysfile.c
+6
-6
sysproc.cc
sysproc.cc
+2
-0
没有找到文件。
sysfile.c
浏览文件 @
89abc9bd
...
...
@@ -103,7 +103,7 @@ sys_fstat(void)
struct
file
*
f
;
struct
stat
*
st
;
if
(
argfd
(
0
,
0
,
&
f
)
<
0
||
argptr
(
1
,
(
void
*
)
&
st
,
sizeof
(
*
st
))
<
0
)
if
(
argfd
(
0
,
0
,
&
f
)
<
0
||
argptr
(
1
,
(
char
*
*
)
&
st
,
sizeof
(
*
st
))
<
0
)
return
-
1
;
return
filestat
(
f
,
st
);
}
...
...
@@ -112,10 +112,10 @@ sys_fstat(void)
long
sys_link
(
void
)
{
char
name
[
DIRSIZ
],
*
new
,
*
old
;
char
name
[
DIRSIZ
],
*
new
n
,
*
old
;
struct
inode
*
dp
,
*
ip
;
if
(
argstr
(
0
,
&
old
)
<
0
||
argstr
(
1
,
&
new
)
<
0
)
if
(
argstr
(
0
,
&
old
)
<
0
||
argstr
(
1
,
&
new
n
)
<
0
)
return
-
1
;
if
((
ip
=
namei
(
old
))
==
0
)
return
-
1
;
...
...
@@ -128,7 +128,7 @@ sys_link(void)
iupdate
(
ip
);
iunlock
(
ip
);
if
((
dp
=
nameiparent
(
new
,
name
))
==
0
)
if
((
dp
=
nameiparent
(
new
n
,
name
))
==
0
)
goto
bad
;
if
(
dp
->
dev
!=
ip
->
dev
||
dirlink
(
dp
,
name
,
ip
->
inum
)
<
0
)
goto
bad
;
...
...
@@ -149,7 +149,7 @@ bad:
static
void
*
check_empty
(
void
*
k
,
void
*
v
,
void
*
arg
)
{
char
*
name
=
k
;
char
*
name
=
(
char
*
)
k
;
if
(
strcmp
(
name
,
"."
)
&&
strcmp
(
name
,
".."
))
return
(
void
*
)
1
;
return
0
;
...
...
@@ -400,7 +400,7 @@ sys_pipe(void)
struct
file
*
rf
,
*
wf
;
int
fd0
,
fd1
;
if
(
argptr
(
0
,
(
void
*
)
&
fd
,
2
*
sizeof
(
fd
[
0
]))
<
0
)
if
(
argptr
(
0
,
(
char
*
*
)
&
fd
,
2
*
sizeof
(
fd
[
0
]))
<
0
)
return
-
1
;
if
(
pipealloc
(
&
rf
,
&
wf
)
<
0
)
return
-
1
;
...
...
sysproc.c
→
sysproc.c
c
浏览文件 @
89abc9bd
extern
"C"
{
#include "types.h"
#include "amd64.h"
#include "kernel.h"
...
...
@@ -8,6 +9,7 @@
#include "proc.h"
#include "cpu.h"
#include "vm.h"
}
long
sys_fork
(
void
)
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论