blob: 2203b0876e47137bc3ca1d18e7ce7e879f7e09db [file] [log] [blame]
#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;
}