Re: [Patch] chunkd: use port xxx82 to build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jeff,

There is support for all sorts of byte swaping.  And swapping bytes works in both directions, big to little or little to big is the same operation.   ntohll is a 64 bit byte swap, but might not naturally work based on architecture.  Check out be64_to_cpu and friends.  They are in the tree and should work reliably, regardless of architecture.

I've been dealing with issues that seem to be related to Fedora8.  Fixing them one at a time seems counter productive, as some of the libraries are not exactly backward compatible.  What OS/release and libraries do you use to build Hail? 

Cheers,

 - Rick

>From: Jeff Garzik <jeff@xxxxxxxxxx>
>Sent: Aug 12, 2009 8:11 PM
>To: Rick Peralta <fbp@xxxxxxxx>
>Cc: Pete Zaitcev <zaitcev@xxxxxxxxxx>, Project Hail List <hail-devel@xxxxxxxxxxxxxxx>
>Subject: Re: [Patch] chunkd: use port xxx82 to build
>
>Rick Peralta wrote:
>> There is code to byte swap in the network stack.  ntoh() and friends should do the job.
>
>Unfortunately that isn't the best solution for us, for a few reasons:
>
>* There is no 64-bit variant, which we need.
>
>* The system platform definitions of ntohl() etc. can vary between 
>macros and function calls depending on compiler's -O settings, which 
>complicates debugging (at least for me).
>
>* ntohl() forces big endian.  Given the current landscape of commodity 
>hardware, I intentionally chose little endian over big endian.  That 
>will completely eliminate byte-swapping for the primary platforms' byte 
>order.
>
>We use the GLib byte order facilities, which provide little endian 
>variants and are portable (along with the rest of GLib) across modern 
>platforms.  But GUINT*_{FROM,TO}_LE macros come with the minor 
>disadvantages of all macros, namely a lack of type safety, problems with 
>multiple evaluation, etc.
>
>Regards,
>
>	Jeff
>
>
>

--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Fedora Clound]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux