Re: How do I find endian-conversion function on Redhar/Fedora

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

 



On Sunday February 5, gil@xxxxxxxxxxxxx wrote:
> Neil Brown wrote:
> > So my plea for help:  Could someone with a Redhat installation
> > please see if there is any way to get functions that convert
> > between little endian and host endian, or if there is some name I
> > can #define to disable the 'private kernel header' warning..
> 
> I have an FC4 machine that I tried this out on.  I have no idea if
> this is the right way to use these headers in /usr/include/linux,
> but it made the compile problem go away at least.

Ok,.... that's interesting. 
I would in one sense just be moving the problem and maybe Redhat would
try to declare linux/byteorder/* off limits, but I guess I could
simply include them in the mdadm distrib if they did that.

Thanks.  If nothing better surfaces I'll probably include this in
mdadm 2.4.

NeilBrown

> 
> --Gil
> diff -r -u mdadm-2.3/bitmap.c mdadm-2.3-patched/bitmap.c
> --- mdadm-2.3/bitmap.c	2005-12-15 17:41:31.000000000 -0800
> +++ mdadm-2.3-patched/bitmap.c	2006-02-05 15:09:32.000000000 -0800
> @@ -21,7 +21,16 @@
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include "mdadm.h"
> -#include <asm/byteorder.h>
> +#include <endian.h>
> +#if __BYTE_ORDER == __LITTLE_ENDIAN
> +#  include <linux/byteorder/little_endian.h>
> +#elif __BYTE_ORDER == __BIG_ENDIAN
> +#  include <linux/byteorder/big_endian.h>
> +#elif __BYTE_ORDER == __PDP_ENDIAN
> +#  include <linux/byteorder/pdp_endian.h>
> +#else
> +#  error "unknown endianness."
> +#endif
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux