/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: seekFile.c,v 1.4 1999/09/19 19:25:24 sof Exp $
+ * $Id: seekFile.c,v 1.7 2001/04/02 16:10:33 rrt Exp $
*
* hSeek and hIsSeekable Runtime Support
*/
/* Invoked by IO.hSeek only */
StgInt
-seekFile(ptr, whence, size, d)
-StgForeignPtr ptr;
-StgInt whence;
-StgInt size;
-StgByteArray d;
+seekFile(StgForeignPtr ptr, StgInt whence, StgInt size, StgByteArray d)
{
IOFileObject* fo = (IOFileObject*)ptr;
struct stat sb;
ghc_errstr = "can't seek on a pipe";
return -1;
}
- while ( lseek(fo->fd, offset, whence) == -1) {
+ while ( lseek(fo->fd, offset-posn_delta, whence) == -1) {
if (errno != EINTR) {
cvtErrno();
stdErrno();
/* Invoked by IO.hSeek only */
StgInt
-seekFile_int64(ptr, whence, d)
-StgForeignPtr ptr;
-StgInt whence;
-StgInt64 d;
+seekFile_int64(StgForeignPtr ptr, StgInt whence, StgInt64 d)
{
IOFileObject* fo = (IOFileObject*)ptr;
struct stat sb;
ghc_errstr = "can't seek on a pipe";
return -1;
}
- while ( lseek(fo->fd, offset, whence) == -1) {
+ while ( lseek(fo->fd, offset-posn_delta, whence) == -1) {
if (errno != EINTR) {
cvtErrno();
stdErrno();
}
StgInt
-seekFileP(ptr)
-StgForeignPtr ptr;
+seekFileP(StgForeignPtr ptr)
{
IOFileObject* fo = (IOFileObject*)ptr;
struct stat sb;