Re: OFFTOPIC: write atomicity/jumbled logs

Adam D. Bradley (artdodge@cs.bu.edu)
Wed, 29 Apr 1998 23:10:23 -0400 (EDT)


> > 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,
>
> i don't know what's really involved, but jumbled logs happen constantly.
> turn on ipfw logging then flood your server with network traffic.

I think that's just printk's non-atomicity.

As best I recall, the value write() returns always represents a
contiguous stream of bytes written to the file descriptor (so that
chunk will be atomic, but it may be less than the whole buffer you
asked to be written), and for things like pipes/sockets and local
files opened with O_APPEND, write()'s are guaranteed to be
non-overlapping.

Corrections, anyone?

Adam

--
You crucify all honesty             \\Adam D. Bradley  artdodge@cs.bu.edu
No signs you see do you believe      \\Boston University Computer Science
And all your words just twist and turn\\    Grad Student and Linux Hacker
Reviving just to crash and burn        \\                             <><
--------->   Why can't you listen as love screams everywhere?   <--------

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