Re: problems in pread(2).

Matti Aarnio (matti.aarnio@sonera.fi)
Tue, 26 Jan 1999 16:00:36 +0200 (EET)


Tigran Aivazian <tigran@sco.COM> writes:
> Matti,
>
> I agree with you, however I think Itai did highlight an interesting point
> there. I confess that I missed that first EOVERFLOW case (whilst Itai
> clearly missed the last one - so we are even :) ).
>
> More to the point, the first case of EOVERFLOW:
>
> The file is a regular file, nbyte is greater than 0, the starting
> position is before the end-of-file and the starting position is
> greater than or equal to the offset maximum established in the open
> file description associated with fildes.
>
> I am starting to think that this "offset maximum" is really RLIMIT_FSIZE
> (see getrlimit(2)) because there is a provision for the starting position
> to be before the end of file and at the same time greater than or equal to
> the "offset maximum".

That is about the 'Large-File-Summit' thing.
The file must be opened with O_LARGEFILE, if the desired pread
offset isn't presentable in kernel off_t type variable. (32-bit
signed integer at i386, 64-bit signed integer at Alpha..).
(Maximum begin offset is INT_MAX-1 anyway, as the last readable
character is at INT_MAX -- without O_LARGEFILE flag, that is.)

> But, yes, what I said originally about pread() not setting errno=EOVERFLOW
> when it should, remains correct.

Quite so.

> Regards,
> ------
> Tigran A. Aivazian | http://www.sco.com
> Santa Cruz Operation Ltd | http://www.aivazian.demon.co.uk

/Matti Aarnio <matti.aarnio@sonera.fi>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/