8 Apr
2014
8 Apr
'14
6:57 a.m.
On 08/04/14 09:12, Arran Cudbard-Bell wrote:
There is that other multi variable version of write, but i'm not sure if it's guaranteed to be atomic.
Plain old write() is not guaranteed to be atomic, let alone writev(). Signals can interrupt writing and necessitate a retry. Any write() needs to be wrapped in a loop to ensure the entire buffer was handled. IIRC there are some weak guarantees in which a write() will tend to be atomic - something related to PIPE_BUF even though it's a plain file? - which is why rlm_linelog doesn't suffer interleaving problems (much?).