From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 31 09:04:57 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F039516A41B for ; Thu, 31 Jan 2008 09:04:57 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outC.internet-mail-service.net (outC.internet-mail-service.net [216.240.47.226]) by mx1.freebsd.org (Postfix) with ESMTP id CF80B13C455 for ; Thu, 31 Jan 2008 09:04:57 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Thu, 31 Jan 2008 01:04:57 -0800 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 7774E127080; Thu, 31 Jan 2008 01:04:56 -0800 (PST) Message-ID: <47A18F39.60801@elischer.org> Date: Thu, 31 Jan 2008 01:04:57 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: "Heiko Wundram (Beenic)" References: <200801310923.16029.wundram@beenic.net> In-Reply-To: <200801310923.16029.wundram@beenic.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: OT: getting the protocol family of a file descriptor X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2008 09:04:58 -0000 Heiko Wundram (Beenic) wrote: > Hey all! > > I'm currently in the need to get the protocol family that was used to create a > socket (and passed via a unix domain socket to another program), and I've not > really come up with a proper scheme other than to use getsockname and > retrieve sa_family from the resulting socket (which currently matches the > socket domain and historically has, but why take the chances ;-)). and pretty much always will. > > Is there any other "better" way to get at the domain (protocol family) of a > socket? >