Plan 9 from User Space's /usr/local/plan9/src/libdraw/unix.c

#include <u.h>
#include <sys/stat.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;
}


Space Glenda

Copyright © 2005 Lucent Technologies, Russ Cox, MIT.
See license for details.