Passing file descriptors
Josiah Carlson
jcarlson at uci.edu
Fri Jun 11 12:11:41 EDT 2004
>>Seemingly this is because I_SENDFD/I_RECVFD is not properly implemented
>>on linux 2.4, but maybe I'm doing something wrong.
>
>
> I'd say it's a fair bet that I_SENDFD is not implemented on Linux,
> properly or otherwise. It looks to me like an AT&T STREAMS function,
> as opposed to Berkeley socket. Casual look around the include files
> doesn't suggest any support on Linux for any STREAMS stuff.
>
> As usual, there's a parallel Berkeley way to do this, using as
> already mentioned a UNIX domain socket, and sendmsg, and SCM_RIGHTS.
>
> If Python's socketmodule.c doesn't directly support sendmsg and
> the attendant data structures, you'll have to add that in C, either
> in socketmodule.c or your own module. That means mainly getting
> the msghdr struct together (I think the control object you want
> to pass, with SCM_RIGHTS and the fds can be packed up in Python.)
Since I'm going to have to write a wrapper anyways, I may as well spend
some time learning Pyrex and gain python garbage collection.
Thank you for the information,
- Josiah
More information about the Python-list
mailing list