blob: 2203b0876e47137bc3ca1d18e7ce7e879f7e09db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}
|