Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Oct 1997 11:47:25 +0200 (CEST)
From:      Andrzej Bialecki <abial@korin.warman.org.pl>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   O_APPEND and flock()
Message-ID:  <Pine.NEB.3.95.971015113816.7513A-100000@korin.warman.org.pl>

next in thread | raw e-mail | index | archive | help
Hi!

I wonder if I have to flock() the file for concurrent access, when every
process opens it for writing with O_APPEND. The man page for open(2) says
that before each write() operation the position is set to the end of file.

The question is, is the write() call atomic? I.e., I want to avoid the
situation, when parts of each write() call would be interleaved with each
other.

Reading man pages and BSD docs didn't make it clear for me. 

Thanks for help.

Andrzej Bialecki

---------------------+---------------------------------------------------------
abial@warman.org.pl  | if(halt_per_mth > 0) { fetch("http://www.freebsd.org") }
Research & Academic  | "Be open-minded, but don't let your brains to fall out."
Network in Poland    | All of the above (and more) is just my personal opinion.
---------------------+---------------------------------------------------------




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.95.971015113816.7513A-100000>