9os

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

dirstat.c (251B)


      1 #include <os9/os9.h>
      2 
      3 #include <errno.h>
      4 
      5 #include <libk.h>
      6 
      7 int
      8 dirstat(char *name, Dir *dir)
      9 {
     10 	unsigned char buf[DIRLEN];
     11 	int n;
     12 
     13 	if ((n = stat(name, buf, sizeof(buf))) < 0)
     14 		return -1;
     15 
     16 	if (p9todir(dir, buf, n) < 0)
     17 		return -1;
     18 
     19 	return 0;
     20 }