Re: problems in pread(2).

Itai Nahshon (nahshon@actcom.co.il)
Tue, 26 Jan 1999 13:27:24 +0200


Tigran Aivazian wrote:
>
> http://www.opengroup.org/onlinepubs/7908799/xsh/read.html
>
> The Single Unix v2 specs says:
> The pread() function will fail, and the file pointer remains unchanged,
> if:
>
> [EOVERFLOW]
> The file is a regular file and an attempt was made to read or
> write at or beyond the offset maximum associated with the file.

No... this is the full text from that page. If there is an update please
tell me where it was published.

[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.

>
> The "offset maximum associated with the file" is the fancy way of saying
> "current size of the file".

But they do talk about "starting position is before the end-of-file"
which
may be different from "the offset maximum established in the open file
description associated with fildes".

Thinking more about it, there must be (at least one ) typo there.

One possible interpretation is that "the endind pisition is greater than
.."
and the "maximum established" refers to file system or device
limitations.
(eg. if offset+nbyte > 2^31 on 2 file system that is limited to 2 GB).

Another possibility - they really mean non-regular files. There is no
explicit EOF (eg, on /dev/fd0) but you try to access beyond the physical
size of the device.

Itai

-- 
Itai Nahshon   nahshon@actcom.co.il
        Also   nahshon@vnet.ibm.com

- 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/