aboutsummaryrefslogtreecommitdiff
path: root/src/libdraw/unix.c
blob: 491bc66c866c2ab163d1d8995f0f68820c48872a (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
_drawflength(int fd)
{
	struct stat s;

	if(fstat(fd, &s) < 0)
		return -1;
	return s.st_size;
}