Observations from an old timer playing with 64 bit numbers...

Randall Stewart rrs at lakerest.net
Tue Jun 22 22:17:01 UTC 2010


On Jun 22, 2010, at 6:01 PM, Max Laier wrote:

> On Tuesday 22 June 2010 23:46:02 Randall Stewart wrote:
>> Hi all:
>>
>> I have had some fun in my day job playing with exchanging 64bit
>> numbers. Unfortunately
>> there is no ntohll() OR htonll() which would be the logical thing  
>> (for
>> us old farts) to use.
>>
>> Yes, I have found htobe64() and friends.. and that would work.. but I
>> still cannot
>> help but feeling we should have the ntohll() and htonll().. for
>> consistency if nothing
>> else.
>>
>> Any objections to this showing up in a head near you soon (speak soon
>> or I will commit
>> the patches to add these ;-D)
>
> Is there any precedence in other *BSDs or elsewhere?  There is  
> already enough
> difference in endian.h between the BSDs (OpenBSD has betohXX instead  
> of
> beXXtoh) and it makes porting code difficult.  I'd prefer to not add
> gratuitous aliases for things that already have a well-known name.


Max:

Well well-known such things are not... otherwise I would not
have been futzing around looking for it.

Google showed nothing.. and finding the be64toh() took a while.
The only thing the man page in ntohl shows is the 16/32 bit quantities
and a nice disclaimer about conforming to POSIX - byteorder

fun..

R


>
> Thanks,
>  Max
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>

------------------------------
Randall Stewart
803-317-4952 (cell)



More information about the freebsd-net mailing list