passing file descriptors through stream pipes?

passing file descriptors through stream pipes?

Post by Stryd » Sun, 22 Jan 1995 18:26:10

I'm working with W. Richard Sevens's book "Advanced Programming in the
Unix Environment".  Currently I'm working with a sample application he
calls an "open server".  In it, one process passes an opened file
descriptor to another process.

He shows three examples of how to do it on SVR4, 4.3BSD and 4.3+BSD
implementations of Unix, none of which will compile on my Linux system.

Can this be done?  I'll supply more detail if needed.


1. passing file descriptors through stream pipes?

I'm using W. Richard Stevens's book "Advanced Programming in the Unix
Environment" to explore Linux.  So far, everything that's been covered
has been compilable on my Linux system.

However, I'm working on his example of an open server - a server that
opens files, sockets, etc. for it's clients.  He gives three different
ways of passing file descriptors between processes using stream pipes.
Unfortunately, none of these have worked - the Berkeley implemintations
require a data structure called "struct msghdr" that's supposed to be
in socket.h, but ain't there.  The SVR4 implementation is done with an
I_SENDFD parameter to ioctl, but there's no such animal on my Linux

Any help in this matter would be greatly appreciated.


                        Imagine there's no heaven.
                        It's easy if you try.
                        No hell below us,
                        And above us only sky.

                                       John Lennon

2. Solaris2.X specific interview questions

3. How to pass control data to other process thru stream pipes

4. memcpy to videoram eats too much CPU on ATI cards (cach

5. Passing file descriptors thru rexec() socket

6. X win display problems :-(

7. file descriptor passing via streams ioctl (AIX 4.3)

8. Dual Boot Machine Secure?

9. Fast way to write a file to a file descriptor or stream?

10. Named Pipes and FILE vs file descriptors

11. Passing a var thru a file