sendmsg and file descr.

sendmsg and file descr.

Post by Ulrich Drepp » Thu, 16 Nov 1995 04:00:00




   I have to pass open file descriptors between two processes. Normally I would
   do that by using the sendmsg and recvmsg functions. But as most of you
   may know they are not implemented in Linux yet.

   Is there another to pass open file descriptors btw processes ?

If the two processes share the same uid you can use the
/proc/<pid>/<fd> pseudo files.

--
-- Uli
________---------------------------------------------------------------
\      / Ulrich Drepper / Univ. at Karlsruhe, Germany / CS Dept. / IPD


   \/1.3.41 ------------------------------------------ Germany --------

 
 
 

sendmsg and file descr.

Post by Jan Stoevesa » Thu, 16 Nov 1995 04:00:00


HELP

I have to pass open file descriptors between two processes. Normally I would
do that by using the sendmsg and recvmsg functions. But as most of you
may know they are not implemented in Linux yet.

Is there another to pass open file descriptors btw processes ?

Thanks in advance,

Jan




 
 
 

sendmsg and file descr.

Post by Joep Vesse » Thu, 16 Nov 1995 04:00:00



>Is there another to pass open file descriptors btw processes ?

On SVR4 you can pass filedescriptors using the I_SENDFD ioctl call,
but this is stream based, and not (yet?) implemented on Linux.

Joep

 
 
 

sendmsg and file descr.

Post by Chip Salzenbe » Sat, 25 Nov 1995 04:00:00



Quote:>The problem is that passing file descriptors requires a garbage collector.

How's that?
--

        "Hey, it's the Miss Alternate Universe Pageant!"
          -- Crow T. Robot, MST3K: "Stranded In Space"
 
 
 

sendmsg and file descr.

Post by Alain Kna » Sat, 25 Nov 1995 04:00:00



: >The problem is that passing file descriptors requires a garbage collector.

: How's that?

 That's if you send file descriptors for other sockets over a socket.
Those other sockets may contain themselves filedescriptors which have been
sent but not yet read. There could be cycles, and hence the need of a
garbage collector.

: --

:         "Hey, it's the Miss Alternate Universe Pageant!"
:           -- Crow T. Robot, MST3K: "Stranded In Space"

--
 Linux - Where do you want to fly today ?
 Windows 95 - Makes a grown man cry

 Alain

 
 
 

sendmsg and file descr.

Post by Mark Swans » Sat, 09 Dec 1995 04:00:00


: : How's that?

:  That's if you send file descriptors for other sockets over a socket.
: Those other sockets may contain themselves filedescriptors which have been
: sent but not yet read. There could be cycles, and hence the need of a
: garbage collector.

Possible solution: (From Stevens' Advanced Programming in the Unix
Environment)

write your own send_fd and recv_fd functions that:

use SYSV IPC sendmsg and rescvmsg to send and receive the fd and make
the fd pointer point to the same fd file table structure.

Since I know the situations the code will be used in, I  wouldn't need
the garbage collector would I?