Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: rolling over high-traffic logfiles?



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



Messages sorted by: Reverse Date, Date, Thread, Author