Sending a file descriptor over a socket pair...

Sending a file descriptor over a socket pair...

Post by Rolland S » Tue, 11 Jul 1995 04:00:00



Hi,

I am trying to send a file descriptor over a Linux socket pair, to a child
process from the parent process.  I open a file descriptor AFTER I fork the
child, so I must be able to send the file descriptor over the socket pair,
rather than the child process using the same variable name.  I would do
this using sendmsg(), and recvmsg() system call in BSD style UN*X system,
but I could not find recvmsg() or sendmsg() definition in my .../include/linux/
socket.h.

I am wondering is recvmsg() and sendmsg() system calls supported in Linux at
all?  If not, how can I send over a file descriptor over a socket pair?
Any suggestions?

Thanks,

Rolland

 
 
 

Sending a file descriptor over a socket pair...

Post by Bill Davids » Sat, 15 Jul 1995 04:00:00


| I am wondering is recvmsg() and sendmsg() system calls supported in Linux at
| all?  If not, how can I send over a file descriptor over a socket pair?
| Any suggestions?

I'm on the wrong system here, but there are some unsupported features on
descriptor passing which prevent NCSA httpd from preforking servers.
However, I thought this was in the mmap() call rather than sockets.

Something might be done using /proc/${PPID}/fd entries?

This is starting to be a serious lack of functionality, so I'm sure it
will get fixed, but when. mmap() is still broken, so it's not on
anyone's list.
--
Stupidity, like virtue, is its own reward.

TMR does UNIX and other systems stuff, some real time, network and
system admin, security, C and other good stuff.

 
 
 

1. expect-send pairs and sub expect-send pairs in chat

My ISP has two possible logins when dialing, depending on waht server you
get, they are:
host:
login:
password:

were hos you enter ppp, slip, shell whatever,
or the server defaults to ppp prompting you for just:

login:
password:

What I belive the solution is:
expect "login:"
[if login is not found expect "host:" send "ppp"]
then send "voltaire"

The problem is that I can not get the sub-expect "host:" and sub-send
"ppp" to work.  I tried (trying to understand the chat manpage):

ogin:--ost: ppp--voltaire

obviously that isn't working, if it sees "ogin:" or "ost:" it sends
"ppp-voltaire"

If anyone can understand this bableing at all please help.

--
Voltaire

http://www.flinet.com/~voltaire

2. 99% packet loss to localhost ?

3. Sending file descriptors through sockets

4. C++ development tools in UNIX

5. Winsock to unix sockets -> bad file descriptor error on send

6. Linux with Ramdisk

7. Winsock to unix sockets....error sending (bad file descriptor)

8. Linux Gateway setup

9. send to socket: Bad file descriptor

10. sending socket descriptor to another pid

11. Problem sending file descriptor using sendmsg/recvmsg

12. do_ypcall: clnt_call: RPC: unable to send; errno =not valid file descriptor

13. sending data from one file descriptor to many