Xref: utzoo comp.protocols.tcp-ip:15765 comp.unix.internals:2590 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!spool.mu.edu!munnari.oz.au!manuel!ccadfa!sserve!cjsv From: cjsv@sserve.cc.adfa.oz.au (Christopher JS Vance) Newsgroups: comp.protocols.tcp-ip,comp.unix.internals Subject: struct msghdr, passing fds between processes Keywords: access rights, UNIX domain sockets, open fds, BSD Message-ID: <1991Apr22.123248.8250@sserve.cc.adfa.oz.au> Date: 22 Apr 91 12:32:48 GMT Organization: Australian Defence Force Academy, Canberra, Australia Lines: 29 I note that a BSD struct msghdr (used with sendmsg and recvmsg) allows the passing of `access rights'. I seem to remember someone indicating that this meant open file descriptors, sort of like a call on dup, except to a different process. Could someone who knows please point me to some documentation of this feature, or at least let me know what kinds of stream these can be passed over. I assume that the numbers change on the wire and come out as open fds at the other end. I guess that the stream must probably be a UNIX domain socket or pipe. Or am I barking up the wrong tree? What I'd like to do is start up a process which has access to my login terminal, have it open a socket-based connection to a server process, and have it pass access to my login terminal to the server process. (Subsidiary question - if I can do this, and my server process had no controlling terminal, does it suddenly inherit one?) What colour dragons be here? (i.e., what do I need to be wary of?) A bit of working code would be a bonus. If your reference is the BSD book by Leffler et al., I can borrow a copy, but won't bother unless it helps. I had a copy of the Advanced IPC document, but I don't seem to remember seeing it there, and the person who has my copy hasn't returned it. I can get it back, though, if it's worth it. -- Christopher