title: Atomicity of file writes using O_APPEND in linux
body: <p>The man pages state that the write() system call is atomic. Does this mean that if I were to have 2 processes both write 4 GB of text to the same file, I can assume that the first write will write its 4 GB, followed by the second write writing its 4 GB in full (assuming that the file was opened with the O_APPEND flag)?</p>
  
  <p>Or will the OS buffer both writes, and then make repeated calls to write() such that the full 8 GB of changes gets written as a series of small chunks? If this is the case, is there any guarantee about the order of these chunks, or can chunks from the first process be interleaved with chunks from the other one?</p>