[Xcb] [PATCH] Use recv(2) instead of read(2).

Alan Coopersmith alan.coopersmith at oracle.com
Sat Apr 24 13:01:01 PDT 2010


Jamey Sharp wrote:
> On Thu, Apr 22, 2010 at 8:59 PM, Alan Coopersmith
> <alan.coopersmith at oracle.com> wrote:
>> Jamey Sharp wrote:
>>> The X protocol is only usable over sockets anyway,
>> System V machines have long supported streams & pipe based transports
>> as well as sockets.
>>
>> Solaris currently supports X11 connections over TCP sockets,
>> Unix domain sockets (/tmp/.X11-unix/*) and named pipes/fifos
>> (/tmp/.X11-pipe/*).  The only other recently active OS that
>> had transports such as these I can remember is SCO, but libxtrans
>> is littered with older bits for HP-UX and AIX and the like.
> 
> Oh. This is why I asked. :-)
> 
> Is that a NAK to the patch? Or does recv work for those transports on
> those systems? Or does nobody care about those transports any more?
>
> I guess the true version of my note is that nobody has implemented
> support in XCB for opening a connection over anything but a socket,
> and that means when libX11 is built --with-xcb it doesn't support
> non-sockets either. We also don't have code to call
> XauGetBestAuthByAddr without a struct sockaddr.
> 
> As Solaris starts shipping Xlib/XCB, are we going to get a patch for
> named pipe support?
> 
> Are Solaris named pipes bidirectional, or are we going to somehow need
> to gain support for using two fds as one connection?

It's not a NAK as much as a "needs thought/investigation".   The recv(3)
man page only mentions socket support not pipes, so I don't think it
works with them, but haven't tested.

I'm also not sure if we care anymore, or if our Xlib/XCB will support
them (another engineer is doing that integration work at the moment,
and I've not reviewed it yet).   The support well predates my time here,
and I believe pipes were added because the kernel socket support at the
time was the original SVR4-based streams implementation, and named pipes
were faster.   In Solaris 10 we switched our default local transport back
to Unix domain sockets since the kernel changes to make sockets a native
transport type instead of a layer over streams made the sockets the faster
option.   While I think our server still needs to support accepting pipe
connections for compatibility (though since we don't support statically
linking against libX11, even that's arguable), I'm not sure if we do need
to continue supporting the client libraries opening pipe connections.
I can't speak for other platforms, but I don't know if any of the other
platforms that had alternative local transport support in xtrans will be
updating to XCB.

The named pipes are certainly bidirectional - as you can see in the existing
libX11 code, the Xlib core didn't need to change for them, it was just another
xtrans backend.

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the Xcb mailing list