From owner-freebsd-questions Sat Aug 21 0:26:45 1999 Delivered-To: freebsd-questions@freebsd.org Received: from monkeys.com (i180.value.net [206.14.136.180]) by hub.freebsd.org (Postfix) with ESMTP id 4AFD115373 for ; Sat, 21 Aug 1999 00:26:38 -0700 (PDT) (envelope-from rfg@monkeys.com) Received: from monkeys.com (LOCALHOST [127.0.0.1]) by monkeys.com (8.9.3/8.9.3) with ESMTP id XAA07991 for ; Fri, 20 Aug 1999 23:43:40 -0700 To: freebsd-questions@freebsd.org Subject: Passing file descriptors via UNIX domain sockets From: "Ronald F. Guilmette" Date: Fri, 20 Aug 1999 23:43:40 -0700 Message-ID: <7989.935217820@monkeys.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message