title: Atomic write on an unix socket?
body: <p>I'm trying to choose between <em>pipes</em> and <em>unix sockets</em> for an IPC mechanism.<br>
  Both support the <code>select()</code> and <code>epoll()</code> functions which is great.</p>
  
  <p>Now, pipes have a 4kB (as of today) "atomic" write, which is guaranteed by the Linux Kernel.<br>
  Does such a feature exists in the case of unix sockets? I couldn't find any document stating this explicitely.</p>
  
  <p>Say I use a UNIX socket and I write x bytes of data from my client. Am I sure that these x bytes will be written on the server end of the socket when my server's <code>select()</code> cracks?</p>
  
  <p>On the same subject, would using SOCK_DGRAM ensure that writes are atomic (if such a guarantee is possible), since datagrams are supposed to <strong>be</strong> single well-defined messages?<br>
  What would then be the difference using SOCK_STREAM as a transfer mode?</p>
  
  <p>Thanks in advance.</p>