title: What is the max size of AF_UNIX datagram message in Linux?
body: <p>Currently I'm hitting a hard limit of 130688 bytes. If I try and send anything larger in one message I get a <code>ENOBUFS</code> error.</p>
  <p>I have checked the <code>net.core.rmem_default</code>, <code>net.core.wmem_default</code>, <code>net.core.rmem_max</code>, <code>net.core.wmem_max</code>, and <code>net.unix.max_dgram_qlen</code> sysctl options and increased them all but they have no effect because these deal with the total buffer size not the message size.</p>
  <p>I have also set the <code>SO_SNDBUF</code> and <code>SO_RCVBUF</code> socket options, but this has the same issue as above. The default socket buffer size are set based on the default socket options anyways.</p>
  <p>I've looked at the kernel source where <code>ENOBUFS</code> is returned in the socket stack, but it wasn't clear to me where it was coming from. The only places that seem to return this error have to do with not being able to allocate memory.</p>
  <p>Is the max size actually 130688? If not can this be changed without recompiling the kernel?</p>