To: [EMAIL PROTECTED]
Hello there,
On my UltraSparc running Solaris 2.7, the manual page for fgetpos(3) says
RETURN VALUES
Upon successful completion, fgetpos() returns 0. Otherwise,
it returns a non-zero value and sets errno to indicate the
error.
Yet in the file src/iomonad.c, we find
primFun(primHGetPosn) { /* Get file position */
Int h;
HandleArg(h,3);
if (handles[h].hmode!=HCLOSED) {
#if HAVE_FGETPOS
fpos_t pos;
if (fgetpos(handles[h].hfp,&pos)) { /* <--- WRONG! */
IOReturn(mkInt((Int)pos));
}
#elif HAVE_FTELL
This is obviously wrong -- it should say
if (fgetpos(handles[h].hfp,&pos) == 0) {
It looks like the use of fsetpos is similarly incorrect.
I hope this is useful,
David
PS. A while ago, I implemented hSeek, and sent the code off to MPJ.
Still no sign of it in the "official" distribution though :-(.
-------------------------------------------------------------------------------
Dr. David Wakeling, School of Engineering and Computer Science
University of Exeter, Exeter, Devon, EX4 4PT.
unofficial web page: http://www.dcs.ex.ac.uk/~david
-------------------------------------------------------------------------------