[PATCH libxtrans] Increase UNIX socket buffer size

Alan Coopersmith alan.coopersmith at oracle.com
Sun Mar 30 08:45:07 PDT 2014


On 03/30/14 06:34 AM, Mark Kettenis wrote:
>> 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.
>

Okay - makes sense, I'd not looked that deeply into Unix domain socket
buffering before.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list