title: Atomic RMW operations on a file
body: <p>Is there a way I can issue an atomic RMW write to the entire contents of a file or a subset of the contents of a file with the write() APIs? With support for both failure-atomicity (i.e. the visible side-effects of the file write remain true even through process restarts) and concurrency-atomicity (i.e. for writes write(A), and write(B) the only possible values for the file after the writes finish are A or B)?</p>
  <p>I was looking for something like a compare-exchange or a lower-level store-conditional sort of write.</p>
  <p>Thanks!</p>