9os

Experimental kernel using plan9 ideas for embedded device
git clone git://git.simple-cc.org/9os
Log | Files | Refs | README | LICENSE

readdir.c (312B)


      1 #include <errno.h>
      2 #include <string.h>
      3 
      4 #include <os9/io.h>
      5 
      6 int
      7 readdir(DIR *dir, struct dirent *ent)
      8 {
      9 	int n;
     10 /*
     11 	Dir dentry;
     12 
     13 	if ((n = read(dir->fd, dir->buf, sizeof(dir->buf))) <= 0)
     14 		return n;
     15 
     16 	if (p9todir(&dentry, dir->buf, n) < 0) {
     17 		return -1;
     18 	}
     19 	strcpy(ent->d_name, dentry.name);
     20 */
     21 
     22 	return 1;
     23 }