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.

Attachment: pgpNwxTl8tz08.pgp
Description: PGP signature

Reply via email to