Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Aug 1999 21:22:11 +0100
From:      Brian Somers <brian@Awfulhak.org>
To:        "Ronald F. Guilmette" <rfg@monkeys.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Passing file descriptors via UNIX domain sockets 
Message-ID:  <199908212022.VAA04816@keep.lan.Awfulhak.org>
In-Reply-To: Your message of "Fri, 20 Aug 1999 23:43:40 PDT." <7989.935217820@monkeys.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Take a look at the ppp(8) code - specifically at 
bundle_ReceiveDatalink() and bundle_SendDatalink() in bundle.c.

> Greetings,
> 
> I'm trying to figure out exactly how to pass file descriptors between
> programs.
> 
> It appears that the examples given in Stevens' ``UNIX Network Programming''
> (original edition) on pages 308-312 no longer accurately describes what one
> must do to actually pass file descriptors.
> 
> The man page for recvmsg(2) definitely provides some clues regarding the
> new programatic idiom that must be used to pass files descriptors around,
> but it is a little too terse, saying only:
> 
>        Open file descriptors are now passed as ancillary data for
>        AF_UNIX domain sockets, with cmsg_level set to  SOL_SOCKET
>        and cmsg_type set to SCM_RIGHTS.
> 
> It would be REALLY helpful for me to be able to actually _see_ an example
> of some real working code that used the new style for file descriptor passing
> between processes.  Then I could just mimic that code in a monkey-see /
> monkey-do fashion.
> 
> So can anyone point me at a _current_ hunk of example code that shows open
> file descriptors being passed between programs?  If so, I would be much
> obliged.
> 
> 
> -- rfg

-- 
Brian <brian@Awfulhak.org>                        <brian@FreeBSD.org>
      <http://www.Awfulhak.org>;                   <brian@OpenBSD.org>
Don't _EVER_ lose your sense of humour !          <brian@FreeBSD.org.uk>




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908212022.VAA04816>