Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
7a37578e
提交
7a37578e
8月 29, 2006
创建
作者:
rtm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clear killed flag in exit
idecref cwd in exit
上级
dfcc5b99
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
12 行增加
和
12 行删除
+12
-12
fs.c
fs.c
+1
-1
fstests.c
fstests.c
+6
-2
proc.c
proc.c
+4
-0
proc.h
proc.h
+0
-5
sh.c
sh.c
+1
-1
syscall.c
syscall.c
+0
-3
没有找到文件。
fs.c
浏览文件 @
7a37578e
...
@@ -632,7 +632,7 @@ unlink(char *cp)
...
@@ -632,7 +632,7 @@ unlink(char *cp)
memset
(
&
de
,
0
,
sizeof
(
de
));
memset
(
&
de
,
0
,
sizeof
(
de
));
if
(
writei
(
dp
,
(
char
*
)
&
de
,
off
,
sizeof
(
de
))
!=
sizeof
(
de
))
if
(
writei
(
dp
,
(
char
*
)
&
de
,
off
,
sizeof
(
de
))
!=
sizeof
(
de
))
panic
(
"unlink dir write"
);
panic
(
"unlink dir write"
);
iupdate
(
dp
);
iupdate
(
dp
);
iput
(
dp
);
iput
(
dp
);
...
...
fstests.c
浏览文件 @
7a37578e
...
@@ -150,8 +150,8 @@ createdelete()
...
@@ -150,8 +150,8 @@ createdelete()
}
}
if
(
pid
)
if
(
pid
)
wa
it
();
ex
it
();
else
else
exit
();
exit
();
for
(
i
=
0
;
i
<
n
;
i
++
){
for
(
i
=
0
;
i
<
n
;
i
++
){
...
@@ -160,8 +160,10 @@ createdelete()
...
@@ -160,8 +160,10 @@ createdelete()
fd
=
open
(
name
,
0
);
fd
=
open
(
name
,
0
);
if
((
i
==
0
||
i
>=
n
/
2
)
&&
fd
<
0
){
if
((
i
==
0
||
i
>=
n
/
2
)
&&
fd
<
0
){
printf
(
1
,
"oops createdelete %s didn't exist
\n
"
,
name
);
printf
(
1
,
"oops createdelete %s didn't exist
\n
"
,
name
);
exit
();
}
else
if
((
i
>=
1
&&
i
<
n
/
2
)
&&
fd
>=
0
){
}
else
if
((
i
>=
1
&&
i
<
n
/
2
)
&&
fd
>=
0
){
printf
(
1
,
"oops createdelete %s did exist
\n
"
,
name
);
printf
(
1
,
"oops createdelete %s did exist
\n
"
,
name
);
exit
();
}
}
if
(
fd
>=
0
)
if
(
fd
>=
0
)
close
(
fd
);
close
(
fd
);
...
@@ -171,8 +173,10 @@ createdelete()
...
@@ -171,8 +173,10 @@ createdelete()
fd
=
open
(
name
,
0
);
fd
=
open
(
name
,
0
);
if
((
i
==
0
||
i
>=
n
/
2
)
&&
fd
<
0
){
if
((
i
==
0
||
i
>=
n
/
2
)
&&
fd
<
0
){
printf
(
1
,
"oops createdelete %s didn't exist
\n
"
,
name
);
printf
(
1
,
"oops createdelete %s didn't exist
\n
"
,
name
);
exit
();
}
else
if
((
i
>=
1
&&
i
<
n
/
2
)
&&
fd
>=
0
){
}
else
if
((
i
>=
1
&&
i
<
n
/
2
)
&&
fd
>=
0
){
printf
(
1
,
"oops createdelete %s did exist
\n
"
,
name
);
printf
(
1
,
"oops createdelete %s did exist
\n
"
,
name
);
exit
();
}
}
if
(
fd
>=
0
)
if
(
fd
>=
0
)
close
(
fd
);
close
(
fd
);
...
...
proc.c
浏览文件 @
7a37578e
...
@@ -337,6 +337,9 @@ proc_exit(void)
...
@@ -337,6 +337,9 @@ proc_exit(void)
cp
->
fds
[
fd
]
=
0
;
cp
->
fds
[
fd
]
=
0
;
}
}
}
}
idecref
(
cp
->
cwd
);
cp
->
cwd
=
0
;
acquire
(
&
proc_table_lock
);
acquire
(
&
proc_table_lock
);
...
@@ -351,6 +354,7 @@ proc_exit(void)
...
@@ -351,6 +354,7 @@ proc_exit(void)
p
->
ppid
=
1
;
p
->
ppid
=
1
;
// Jump into the scheduler, never to return.
// Jump into the scheduler, never to return.
cp
->
killed
=
0
;
cp
->
state
=
ZOMBIE
;
cp
->
state
=
ZOMBIE
;
sched
();
sched
();
panic
(
"zombie exit"
);
panic
(
"zombie exit"
);
...
...
proc.h
浏览文件 @
7a37578e
...
@@ -46,12 +46,7 @@ struct proc{
...
@@ -46,12 +46,7 @@ struct proc{
int
killed
;
int
killed
;
struct
fd
*
fds
[
NOFILE
];
struct
fd
*
fds
[
NOFILE
];
struct
inode
*
cwd
;
struct
inode
*
cwd
;
uint
esp
;
// kernel stack pointer
uint
ebp
;
// kernel frame pointer
struct
jmpbuf
jmpbuf
;
struct
jmpbuf
jmpbuf
;
struct
trapframe
*
tf
;
// points into kstack, used to find user regs
struct
trapframe
*
tf
;
// points into kstack, used to find user regs
};
};
...
...
sh.c
浏览文件 @
7a37578e
...
@@ -22,7 +22,7 @@ char *argv[MAXARGS];
...
@@ -22,7 +22,7 @@ char *argv[MAXARGS];
char
argv0buf
[
BUFSIZ
];
char
argv0buf
[
BUFSIZ
];
int
argc
;
int
argc
;
int
debug
=
1
;
int
debug
=
0
;
int
parse
(
char
*
s
);
int
parse
(
char
*
s
);
void
runcmd
(
void
);
void
runcmd
(
void
);
...
...
syscall.c
浏览文件 @
7a37578e
...
@@ -113,7 +113,6 @@ sys_pipe(void)
...
@@ -113,7 +113,6 @@ sys_pipe(void)
return
0
;
return
0
;
oops:
oops:
cprintf
(
"sys_pipe failed
\n
"
);
if
(
rfd
)
if
(
rfd
)
fd_close
(
rfd
);
fd_close
(
rfd
);
if
(
wfd
)
if
(
wfd
)
...
@@ -602,14 +601,12 @@ sys_exec(void)
...
@@ -602,14 +601,12 @@ sys_exec(void)
return
0
;
return
0
;
bad:
bad:
cprintf
(
"exec failed early
\n
"
);
if
(
mem
)
if
(
mem
)
kfree
(
mem
,
sz
);
kfree
(
mem
,
sz
);
iput
(
ip
);
iput
(
ip
);
return
-
1
;
return
-
1
;
bad2:
bad2:
cprintf
(
"exec failed late
\n
"
);
iput
(
ip
);
iput
(
ip
);
proc_exit
();
proc_exit
();
return
0
;
return
0
;
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论