fd passing for X

Thomas Klausner tk at giga.or.at
Wed Jan 23 11:04:06 PST 2013


On Sat, Oct 06, 2012 at 11:26:05AM -0700, Keith Packard wrote:
> Thomas Klausner <tk at giga.or.at> writes:
> 
> > On Fri, Oct 05, 2012 at 01:46:57PM -0700, Keith Packard wrote:
> >> I did a bunch of experiments with fd passing in Linux to see how it
> >> might work in X.
> >
> > Do you have a test program I could run on NetBSD to see if it works
> > there as well?
> 
> All of the tests I did are in a git repository that you can fetch from
> 
> git://keithp.com/git/fdpassing

Ok, that was quite some time ago, sorry for that.
Here are the results when I run these on NetBSD-6.99.16/amd64:
# ./fdpassing 
passing fd 1
wrote 1
# received fd 3
read 1
hello, world

# ./lostfd 
passing fd 1
wrote 1 without fd
passing fd 2
wrote 1 with fd
# read 1
recvmsg: Invalid argument

# ./multiwrite 
not passing fd
wrote 1 without fd
passing fd 1
wrote 1 with fd
not passing fd
wrote 1 without fd
# read 1
received fd 3
read 2
hello, world

# ./xreq 
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
passing fd 1
passing fd 4
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
passing fd 1
passing fd 4
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
passing fd 1
passing fd 4
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
passing fd 1
passing fd 4
# got 256
got 32
recvmsg: Invalid argument

# ./zerowrite 
not passing fd
wrote 1 without fd
passing fd 1
wrote 0 with fd
not passing fd
wrote 1 without fd
# read 1
received fd 3
read 1
hello, world

I guess the recvmsg errors shouldn't happen?
 Thomas 




More information about the xorg-devel mailing list