]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.h
Don't try to create a new device when using --manage or --grow
[thirdparty/mdadm.git] / mdadm.h
diff --git a/mdadm.h b/mdadm.h
index ba00a9b403f09b9e8a543c295491c9466f00add8..b7ae9671e0a9b89c25195e9c9f5c32dd45bca05f 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -44,10 +44,11 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
 #include       <errno.h>
 #include       <string.h>
 #include       <syslog.h>
-#ifdef __dietlibc__NONO
-int strncmp(const char *s1, const char *s2, size_t n) __THROW __pure__;
-char *strncpy(char *dest, const char *src, size_t n) __THROW;
-#include    <strings.h>
+#ifdef __dietlibc__
+#include       <strings.h>
+/* dietlibc has deprecated random and srandom!! */
+#define random rand
+#define srandom srand
 #endif
 
 
@@ -72,13 +73,24 @@ char *strncpy(char *dest, const char *src, size_t n) __THROW;
 #include       "bitmap.h"
 
 #include <endian.h>
-/* #include "asm/byteorder.h" Redhat don't like this so... */
-#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>
+#include <byteswap.h>
+/* Redhat don't like to #include <asm/byteorder.h>, and
+ * some time include <linux/byteorder/xxx_endian.h> isn't enough,
+ * and there is no standard conversion function so... */
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define        __cpu_to_le16(_x) (_x)
+#define __cpu_to_le32(_x) (_x)
+#define __cpu_to_le64(_x) (_x)
+#define        __le16_to_cpu(_x) (_x)
+#define __le32_to_cpu(_x) (_x)
+#define __le64_to_cpu(_x) (_x)
+#elif BYTE_ORDER == BIG_ENDIAN
+#define        __cpu_to_le16(_x) bswap_16(_x)
+#define __cpu_to_le32(_x) bswap_32(_x)
+#define __cpu_to_le64(_x) bswap_64(_x)
+#define        __le16_to_cpu(_x) bswap_16(_x)
+#define __le32_to_cpu(_x) bswap_32(_x)
+#define __le64_to_cpu(_x) bswap_64(_x)
 #else
 #  error "unknown endianness."
 #endif
@@ -380,7 +392,7 @@ extern int CreateBitmap(char *filename, int force, char uuid[16],
                        unsigned long long array_size,
                        int major);
 extern int ExamineBitmap(char *filename, int brief, struct supertype *st);
-extern void bitmap_update_uuid(int fd, int *uuid);
+extern int bitmap_update_uuid(int fd, int *uuid);
 
 extern int md_get_version(int fd);
 extern int get_linux_version(void);