In some cases the coder cannot rely on system calls being atomic, e.g. if the file is on a NFS filesystem. (c.f. NFS Overview, FAQ and HOWTO Documents). But atomic system calls are ultimately required for most database work. (c.f. Atomicity of database systems).
Is there a standard (and OS independent) way of confirming writes (and other syscalls) are atomic on a particular FILE in C (or python).
Any suggestions?
Subsequent notes: Atomicity on pipes is discussed in the following:
- unix pipe multiple writers
- What happens if a write system call is called on same file by 2 different processes simultaneously
Note in-particular the "man" page extract dealing specifically with O_APPEND:
If the O_APPEND flag of the file status flags is set, the file offset shall be set to the end of the file prior to each write and no intervening file modification operation shall occur between changing the file offset and the write operation.