ntohq/htonq?

Warner Losh imp at bsdimp.com
Wed Sep 14 14:39:02 UTC 2011


Linux has hton64, but last time I checked it was kernel only.  NetBSD has talked about different flavors of hton64 or htonq, but it appears none made it into the tree.

htonll is in both AIX and Solaris (well, OpenSolaris 2009.06).

It isn't standardized, so the standards wonks will say "be sure not to pollute namespace with these if you implement them."

If I was doing it, I'd be tempted to implement all three with two being simple aliases to the third canonical implementation, but I think that might get me shot when I posted the patch.  Nobody wants 1/3 of a baby.

Warner


On Sep 13, 2011, at 9:36 PM, Marcel Moolenaar wrote:
> All,
> 
> Is there a reason not to add ntohq and htonq to the short
> and long versions we (and everyone else) already has?
> 
> Juniper has 64-bit entities that go over the wire in
> network byte order and, while these macros are absolutely
> arcane, I see no reason not to complete them with 64-bit
> variants.
> 
> I did some googling and htonq and ntohq seem to be de
> facto names used, but oddly enough no OS has them defined.
> It's surreal. Are there better alternatives we should
> migrate to?
> 
> -- 
> Marcel Moolenaar
> marcel at xcllnt.net
> 
> 
> _______________________________________________
> freebsd-arch at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arch
> To unsubscribe, send any mail to "freebsd-arch-unsubscribe at freebsd.org"
> 
> 



More information about the freebsd-arch mailing list