Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2008 16:31:32 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        "Heiko Wundram \(Beenic\)" <wundram@beenic.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: OT: getting the protocol family of a file descriptor
Message-ID:  <86zlumvwob.fsf@ds4.des.no>
In-Reply-To: <200801310923.16029.wundram@beenic.net> (Heiko Wundram's message of "Thu\, 31 Jan 2008 09\:23\:15 %2B0100")
References:  <200801310923.16029.wundram@beenic.net>

next in thread | previous in thread | raw e-mail | index | archive | help
"Heiko Wundram (Beenic)" <wundram@beenic.net> writes:
> 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 ;-)).

This is the correct way to do it, I don't understand why you think it
might not work in the future.

> Is there any other "better" way to get at the domain (protocol family)
> of a socket?

Why should there be a better way?

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



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