Open file (or socket) descriptor passing from one process to another




Hi, everybody,

Some time ago we had a discussion about the possibility
to pass the descriptor of an open file (or descriptor of
an open network socket) from one UNIX process to another.

I incidentally found the answer to that question.
UNIX SVR4 has the following method to do that: descriptor
can be passed over a streams pipe, using ioctl call with
I_SENDFD command. The other process receives it through
the I_RECVFD ioctl call.

Looks like, Informix engine is using this approach for
network connections: connection or query request is
received by the POLL thread running usually
on NETVP, whine CPUVP is sending the response to the client
directly, by executing sendto() on the same open network socket.

------------------------------------------
Alexey Sonkin


.