From owner-freebsd-hackers Wed Oct 15 02:45:42 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id CAA07137 for hackers-outgoing; Wed, 15 Oct 1997 02:45:42 -0700 (PDT) (envelope-from owner-freebsd-hackers) Received: from korin.warman.org.pl (korin.nask.waw.pl [148.81.160.10]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id CAA07104 for ; Wed, 15 Oct 1997 02:45:37 -0700 (PDT) (envelope-from abial@korin.warman.org.pl) Received: from localhost (abial@localhost) by korin.warman.org.pl (8.8.7/8.8.5) with SMTP id LAA09279 for ; Wed, 15 Oct 1997 11:47:25 +0200 (CEST) Date: Wed, 15 Oct 1997 11:47:25 +0200 (CEST) From: Andrzej Bialecki To: freebsd-hackers@FreeBSD.ORG Subject: O_APPEND and flock() Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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. ---------------------+---------------------------------------------------------