Is there any reason the drift file should be mode 600?

Hal Murray hmurray at megapathdsl.net
Thu Dec 14 01:46:36 UTC 2017


esr at thyrsus.com said:
> Yes.  A Unix write(2) under 512 bytes is atomic, and (when to a local
> filesystem) can't be signal-interrupted either.  There's a constant PIPE_BUF
> which is historically 512 but may be larger on modern Unixes - I haven't
> looked in a long time.  Technically it pertains to pipe reads, but writes
> that length or below are also atomic on disk filesystems.

Thanks.

Where is that documented?  I'd expect some alignment constraints.

I'm interested in the case where the chunk written crosses a disk page and 
the system crashes after writing the first page but before writing the next 
one.

There may be similar problems on the memory buffer.  The second page gets 
swapped out...

PIPE_BUF is 4096 on this system.

We are only writing a few bytes.



-- 
These are my opinions.  I hate spam.





More information about the devel mailing list