lkml.org 
[lkml]   [1998]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectOFFTOPIC: write atomicity
This topic came up recently while I was playing with porting Apache to
NSPR (netscape's portable runtime): "What guarantees are there on the
atomicity of writes?"

Single Unix has a satisfying answer for pipes, FIFOs, and STREAMS. But it
doesn't really give an answer for regular files, or for network sockets.

I know from experience, that for plain files there is an atomicity
guarantee on every unix out there... otherwise Apache's log files, for
example, would be completely broken because there are several processes
writing them all the time, and in the past four years nobody has
complained of jumbled log messages. But Single Unix doesn't mention this,
or give a lower bound for the atomicity.

I generally use the heuristic that if it's <= PIPE_BUF bytes in size I'm
probably safe everywhere... but I wouldn't mind having a standard to point
at.

Two questions:

Is there a standard which guarantees this for files and sockets?

What are linux's guarantees?

Dean


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.033 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site