Re: VFS locking: f_pos thread-safe ?

Andries Brouwer
2004-02-06T20:54:54Z

On Fri, Feb 06, 2004 at 04:12:24AM -0300, Werner Almesberger wrote:

> I'm trying to figure out how all the locking in VFS and friends
> works, and I can't quite explain to myself how f_pos is kept
> consistent with concurrent readers.
>
> Section 2.9.7 of the "Austin" draft of IEEE Std. 1003.1-200x,
> 28-JUL-2000, says:
>
> "[...] read( ) [...] shall be atomic with respect to each other
> in the effects specified in IEEE Std. 1003.1-200x when they
> operate on regular files. If two threads each call one of these
> functions, each call shall either see all of the specified
> effects of the other call, or none of them."

The 2003 version can be found at

http://www.opengroup.org/onlinepubs/007904975/toc.htm
http://www.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_09.html

Andries