8 Apr
2006
8 Apr
'06
19:52
On Sun, 9 Apr 2006 00:51:37 +0800
Verdi March
Hi,
On Saturday 08 April 2006 07:58, Jerry Feldman wrote:
I found a document from a reliable source that states that write(2) is NOT atomic. http://marc.theaimsgroup.com/?l=linux-kernel&m=107375454908544 "There are file descriptors that have atomicity guarantees (pipes(, but regular files do not". Linus Torvalds.
Thanks, this should clarify everything. I suggest that you use the lockf(3) or fcntl(2) functions to lock and unlock regions of a file before you write. Flock(2) will work fine on local drives but not on NFS file systems. -- Jerry Feldman
Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9