home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / programm / 4408 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  2.0 KB

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