This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: sysdeps/posix/{pread64,pwrite64}.c


Roland McGrath <roland@frob.com> writes:

> That sounds like a contradiction of your first argument.

No, it's not.  If you would define the code in sysdpes/posix as that
which can be implemented using POSIX functions the directory would be
empty.

> > I don't see a danger here.
> 
> Ha!  You are not that naive.  The nature of the danger is introduction of
> subtle race condition bugs when noone suspects the issue may have arisen.

No, this is not what I mean.  There is no danger because everybody who
honestly ports glibc to a new system will check this.  It is nothing
you can overlook easily for the very same reasons you reject this
code.

> Is it not the case that there are Linux kernels where linuxthreads
> can work but there is no pread?  I'm pretty sure that was the case
> at one time, anyway.

These kernel versions are not supported.

> If you don't have pthreads then why would you expect to have pread at all?

Because these functions can be used in other code which does not use
them for the thread-safetiness of the interface.  It's simply a nice
interface which suits in many situations.

> Something else I haven't tracked down yet appears to have newly changed so
> the bogus pread is being linked in where it wasn't before, and I haven't
> looked into what it is yet.

As said above, it's a useful interface and therefore might be used in
places you won't expect it.  I don't know where it is in the moment.
Unless the same application is using threads there shouldn't be any
danger.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]