Initial revision
This commit is contained in:
parent
ed7c8e8d02
commit
76193d7cb0
223 changed files with 32479 additions and 0 deletions
16
src/libdraw/unix.c
Normal file
16
src/libdraw/unix.c
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include <sys/stat.h>
|
||||
|
||||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <draw.h>
|
||||
|
||||
vlong
|
||||
flength(int fd)
|
||||
{
|
||||
struct stat s;
|
||||
|
||||
if(fstat(fd, &s) < 0)
|
||||
return -1;
|
||||
return s.st_size;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue