Re: VFS locking: f_pos thread-safe ?

Matthias Urlichs
2004-02-06T19:11:41Z

Hi, viro wrote:

> "Somebody made a guess about undefined behaviour"

Guess what? The manpage says that read(2) return N bytes and advances the
file pointer by N bytes. It doesn't talk, much less caution, about threads.

YOU may immediately know, based on your kernel knowledge or whatever, that
things get somewhat undefined when two threads do that at the same time,
but it's NOT AT ALL obvious to a "normal" application programmer. There's
plenty of system calls that CAN be done concurrently, after all.

So we tried the simple idea, it didn't work, we grumbled a bit ;-) and
then did something else instead. Not a big deal.

Please save your "translations" for stupid ideas that are obviously so
without in-depth kernel knowledge or equivalent.

Thank you.

--
Matthias Urlichs