OT: getting the protocol family of a file descriptor
Peter Jeremy
peterjeremy at optushome.com.au
Fri Feb 1 02:22:49 PST 2008
On Thu, Jan 31, 2008 at 07:47:41PM +0100, Heiko Wundram (Beenic) wrote:
>I personally don't find this especially beautiful, and generally, as there is
>a getsockopt(SO_TYPE), I'd have thought the above should look (somewhat)
>similar to the following:
>
>int opt;
>socklen_t optlen = sizeof(opt);
>
>getsockopt(fd,SOL_SOCKET,SO_DOMAIN,&opt,&optlen);
Unfortunately and unlike the socket type returned by SO_TYPE, the
protocol family does not seem to be readily available within the
struct socket. Having had a rummage around in the socket structure,
it's not obvious how to implement this in a protocol-independent way.
--
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20080201/c896d401/attachment.pgp
More information about the freebsd-hackers
mailing list