You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

## getcwd
##### 1)思路分析
###### 获取当前目录的节点号
current_ino = get_ino_byname(".")
###### 获取当前节点的父目录的节点号
parent_ino = get_ino_byname("..") namei函数
###### 判断是否在根目录; **循环**直至根目录 这里有个循环回溯的过程
if(current_ino == parent_ino)break;
###### 切换到父目录根据current_ino,搜索到对应的文件名并记录
chdir("..")
buf[depth] = find_name_byino(current_ino) //buf这可能会出问题
depth += len(find_name_byino(current_ino))
等break出来
###### 根据buf输出路径
##### 2现有问题
没有实现如何搜索到对应文件名记录
路径名传入没实现
## sleep
###### 1思路
在系统调用里分别调用
mysignal(SIGALRM,SIG_IGN);
alram(1)
pasue()
的系统调用函数通过改变alarm中的参数实现想睡多久就睡多久。
2问题
系统调用函数实现后,发现测试报错
显示错误:
-----testing sleep:
malloc called with impossibly large argument(334988)
Kernel panic: malloc: bad arg
最后解决方法是将原来直接跳过的系统调用号给补上,
加了个89的系统调用函数pipe2()