From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16440 invoked from network); 16 Jul 1998 16:27:27 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Jul 1998 16:27:27 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id MAA21119; Thu, 16 Jul 1998 12:15:01 -0400 (EDT) Resent-Date: Thu, 16 Jul 1998 12:12:43 -0400 (EDT) From: Zefram Message-Id: <199807161614.RAA32121@taos.demon.co.uk> Subject: Re: rolling over high-traffic logfiles? To: schaefer@brasslantern.com (Bart Schaefer) Date: Thu, 16 Jul 1998 17:14:28 +0100 (BST) Cc: zsh-users@math.gatech.edu, sweth@astaroth.nit.gwu.edu In-Reply-To: <980716082633.ZM15563@candle.brasslantern.com> from "Bart Schaefer" at Jul 16, 98 08:26:32 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"k5j_43.0.385.xPYhr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1680 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Bart Schaefer wrote: >} mv should use rename() to atomically replace the log file, in which case >} there is no race condition. > >Fair enough. There are two or more filesystem operations necessary even >if only only system call, but I suppose that's only a possible problem >on a multiprocessor system. POSIX.1 defines rename() to be atomic, as is historical practice. On multiprocessor systems the kernel just has to take a little extra care. POSIX.2 defines mv to behave as if it were calling rename(). -zefram