diff options
Diffstat (limited to 'src/libdraw/unix.c')
-rw-r--r-- | src/libdraw/unix.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libdraw/unix.c b/src/libdraw/unix.c new file mode 100644 index 00000000..2203b087 --- /dev/null +++ b/src/libdraw/unix.c @@ -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; +} + |