int sys_getdents(unsigned int fd,struct linux_dirent *dirp,unsigned int count) { struct buffer_head *bh; struct m_inode*inode=current->filp[fd]->f_inode; struct linux_dirent m; struct dir_entry *dir; char *buf; int k,n=0,i; if(count<=0)return -1; bh=bread(inode->i_dev,inode->i_zone[0]); for(k=0;ki_size;k+=sizeof(struct linux_dirent)) { if(n+sizeof(struct linux_dirent)>count)return 0; dir=(struct dir_entry*)(bh->b_data+k); if(dir->inode) { m.d_ino=dir->inode; for(i=0;iname[i]; m.d_off=0; m.d_reclen=sizeof(struct linux_dirent); buf=&m; for(i=0;i