home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.programmer:4408 comp.unix.internals:1728
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!cs.utexas.edu!ut-emx!ibmchs!auschs!awdprime.austin.ibm.com!ravikm
- From: ravikm@austin.ibm.com (Ravi K Mandava)
- Newsgroups: comp.unix.programmer,comp.unix.internals
- Subject: Re: Sendmsg() on SunOS access rights
- Message-ID: <1992Aug21.134241.16782@awdprime.austin.ibm.com>
- Date: 21 Aug 92 13:42:41 GMT
- References: <1992Aug21.043106.11945@ennews.eas.asu.edu>
- Sender: news@awdprime.austin.ibm.com (USENET News)
- Reply-To: piobe!ravikm@ibmpa.awdpa.ibm.com
- Organization: IBM Austin
- Lines: 26
- Originator: ravikm@piobe.austin.ibm.com
-
-
- In article <1992Aug21.043106.11945@ennews.eas.asu.edu>, trotter@enuxhb.eas.asu.edu (Russell Trotter) writes:
- > Hello,
- > Have any of you guys experience a wierd side effect of sendmsg()
- > on SunOS 4.1.2 sending access rights (socket desciptors). I have
- > a program that starts a non-blocking connect on a socket, then at
- > a later time pass this connected socket to another process (with the
- > sendmsg() call). When I step through the sendmsg() call with dbx
- > the struct msghdr struct gets blown away (all fields get set to zero..
- > including the accrights fields) and doesn't return an error ??? Does the
- > state of the socket have anything to do with this side effect? Thanks
- > to anyone who can help.
-
- Recently I had to use sendmsg() to send an fd across two processes, and I had
- a similar problem on our system. Later we found out that we had a buggy
- implementation of 4.3BSD type calls. Then I changed to BSD4.4 type calls,
- where you'd have to initialize a struct cmsghdr and pass its address (stored
- next to cmsghdr is the fd) through msg_control field. This worked liked a
- charm. See which version (of BSD) your system supports, and if supported,
- use the new BSD4.4 format.
-
- Hope this helps,
- --
- *******************************************************************************
- Ravi K Mandava email: piobe!ravikm@ibmpa.awdpa.ibm.com
- *******************************************************************************
-