sysdeps/posix/{pread64,pwrite64}.c
Roland McGrath
roland@frob.com
Wed Jan 5 14:07:00 GMT 2000
I think these are bogus, for several reasons. They have been there for a
while, but I just noticed because they just started breaking things (I
guess something else is calling them).
Firstly, sysdeps/posix is for functions implemented in terms of POSIX entry
points. lseek64 is not a POSIX entry point, so a function using it has no
business residing in sysdeps/posix.
Secondly (and this is a problem with sysdeps/posix/{pread,pwrite}.c too),
the whole point of pread/pwrite is to be thread-safe as opposed to using
lseek. I think it is dangerously misleading to provide an incorrect
implementation instead of none at all. If a threaded program wants to use
file descriptors safely, it needs to know that pread/pwrite work as
specified or else that it must do its own synchronization. In the current
situation, one will believe there is a pread/pwrite but in fact the
specified functionality is not available.
More information about the Libc-hacker
mailing list