Re: VFS locking: f_pos thread-safe ?

From: Matthias Urlichs
Date: Fri Feb 06 2004 - 14:17:34 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/