#include	"sysdep.h"
#include	<IOCtl.h>
#include	<Files.h>

fstat(fd, buf)
	int	fd;
	struct stat	*buf;
{
	int		refnum;
	long	length, *arg;
	
	arg = 0;
	refnum = ioctl(fd, FIOREFNUM, arg);
	GetEOF(refnum, &length);
	return(length);
}