lkml.org 
[lkml]   [1999]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: problems in pread(2).
Look at <http://www.opengroup.org/onlinepubs/7908799/xsh/pread.html>.

Pread should give exactly the same result as read. AFAIK read
does (and has always) retrun 0 when trying to read at or beyond the EOF.


The opengroup man page for read has this unclear clause about EOVERFLOW:
[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.

What is "open file description" (should I read descriptor ???) ?
What is "the offset maximum established in the ..". Where does it
exist (and how do I set it) in regular files.

Notice that talks only about "regular file". This might have a meaning
with some device files where there is no explicit EOF [lseek(fd, off, SEEK_END)
cannot be used].

Itai


> Just to make my previous mail more concrete, the following program
> illustrates a problem with current implementation of pread(2). Namely,
> reading beyond the end of file should (by Single UNIX spec) set
> errno=EOVERFLOW. Currently it returns 0, and sets errno =0 (Success),
> whilst leaving the buffer intact.

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

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:1.838 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site