|
|
|
@ -326,7 +326,9 @@ int sys_sleep(unsigned int seconds){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define NAME_MAX 255
|
|
|
|
|
#define NAME_MAX 14
|
|
|
|
|
|
|
|
|
|
/////////////////////////sys_getdents//////////////////////////
|
|
|
|
|
struct linux_dirent { //专为输出的目录项结构
|
|
|
|
|
long d_ino;
|
|
|
|
|
off_t d_off;
|
|
|
|
@ -366,7 +368,7 @@ int sys_getdents(unsigned int fd, struct dirent *dirp, unsigned int count)
|
|
|
|
|
for( ; d < inode->i_size ; d += dir_entry_size)
|
|
|
|
|
{
|
|
|
|
|
//printk("***\n");
|
|
|
|
|
if(l >= count - linux_dirent_size) break;//dirp已经满了,返回读取的字节数 //buggy
|
|
|
|
|
if (l >= count - linux_dirent_size) break;//dirp已经满了,返回读取的字节数 //buggy
|
|
|
|
|
|
|
|
|
|
//bufhd->b_data 是char*类型的指针(char为一字节),因此+d可以到这个目录项
|
|
|
|
|
d_entry = (struct dir_entry *)(bufhd->b_data + d);
|
|
|
|
@ -394,8 +396,8 @@ int sys_getdents(unsigned int fd, struct dirent *dirp, unsigned int count)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char * sys_getcwd(char * buf, size_t size){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|