plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

unix.c (177B)


      1 #include <u.h>
      2 #include <sys/stat.h>
      3 #include <libc.h>
      4 #include <draw.h>
      5 
      6 vlong
      7 _drawflength(int fd)
      8 {
      9 	struct stat s;
     10 
     11 	if(fstat(fd, &s) < 0)
     12 		return -1;
     13 	return s.st_size;
     14 }