[PATCH libxtrans] Increase UNIX socket buffer size

Mark Kettenis mark.kettenis at xs4all.nl
Sun Mar 30 06:34:12 PDT 2014


> Date: Sat, 29 Mar 2014 17:26:00 -0700
> From: Alan Coopersmith <alan.coopersmith at oracle.com>
> 
> Do we need to do the same for the SO_RCVBUF as well?

Not really.  These connections are local by defenition so in principle
it doesn't really matter whether we queue on the sending side or on
the receiving side.  On Linux SO_RCVBUF on a UNIX socket is explicitly
documented as a no-op.  The BSD sockets implementation seems to use
the receive buffer limits only for control (ancillary) data, like file
descriptors.  Not 100% sure though; the code is a bit complex...

> Though looking at the pfiles output from Xorg on Solaris, it appears we
> default to mismatched sizes for some reason:
> 
>    37: S_IFSOCK mode:0666 dev:621,0 ino:56871 uid:0 gid:0 size:0
>        O_RDWR|O_NONBLOCK
> 	SOCK_STREAM
> 	SO_SNDBUF(16384),SO_RCVBUF(5120)
> 	sockname: AF_UNIX /tmp/.X11-unix/X0
> 	peername: AF_UNIX
> 	peer: metacity[14049] zone: global[0]

Based on this assymmetry, it wouldn't surprise me if Solaris behaved
similar to BSD.


More information about the xorg-devel mailing list