/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: seekFile.c,v 1.6 2001/03/01 12:25:33 rrt Exp $
+ * $Id: seekFile.c,v 1.7 2001/04/02 16:10:33 rrt Exp $
*
* hSeek and hIsSeekable Runtime Support
*/
seekFile(StgForeignPtr ptr, StgInt whence, StgInt size, StgByteArray d)
{
IOFileObject* fo = (IOFileObject*)ptr;
- struct Stat sb;
+ struct stat sb;
off_t offset;
int posn_delta =0;
int rc = 0;
if (rc < 0) return rc;
/* Try to find out the file type */
- while (Fstat(fo->fd, &sb) < 0) {
+ while (fstat(fo->fd, &sb) < 0) {
/* highly unlikely */
if (errno != EINTR) {
cvtErrno();
seekFile_int64(StgForeignPtr ptr, StgInt whence, StgInt64 d)
{
IOFileObject* fo = (IOFileObject*)ptr;
- struct Stat sb;
+ struct stat sb;
off_t offset = d;
int posn_delta =0;
int rc = 0;
if (rc < 0) return rc;
/* Try to find out the file type & size for a physical file */
- while (Fstat(fo->fd, &sb) < 0) {
+ while (fstat(fo->fd, &sb) < 0) {
/* highly unlikely */
if (errno != EINTR) {
cvtErrno();
seekFileP(StgForeignPtr ptr)
{
IOFileObject* fo = (IOFileObject*)ptr;
- struct Stat sb;
+ struct stat sb;
/* Try to find out the file type */
- while (Fstat(fo->fd, &sb) < 0) {
+ while (fstat(fo->fd, &sb) < 0) {
/* highly unlikely */
if (errno != EINTR) {
cvtErrno();