* [PATCH] [mdadm] Add klibc support to mdadm.h
@ 2007-09-21 17:32 maximilian attems
2007-09-21 17:32 ` [PATCH] [mdadm] config.c include dirent.h instead sys/dir.h maximilian attems
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: maximilian attems @ 2007-09-21 17:32 UTC (permalink / raw)
To: linux-raid; +Cc: Neil Brown, maximilian attems
klibc still misses a lot functionality to let mdadm link against,
this small step helps to get to the real trouble.. :)
Signed-off-by: maximilian attems <max@stro.at>
---
mdadm.h | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/mdadm.h b/mdadm.h
index ac7d4b4..dba09f0 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -29,7 +29,7 @@
#define _GNU_SOURCE
#include <unistd.h>
-#ifndef __dietlibc__
+#if !defined(__dietlibc__) && !defined(__KLIBC__)
extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
#else
# if defined(__NO_STAT64) || __WORDSIZE != 32
@@ -97,6 +97,7 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
((x) & 0x00000000ff000000ULL) << 8 | \
((x) & 0x000000ff00000000ULL) >> 8)
+#if !defined(__KLIBC__)
#if BYTE_ORDER == LITTLE_ENDIAN
#define __cpu_to_le16(_x) (_x)
#define __cpu_to_le32(_x) (_x)
@@ -114,6 +115,7 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
#else
# error "unknown endianness."
#endif
+#endif /* __KLIBC__ */
@@ -398,6 +400,11 @@ struct stat64;
# undef HAVE_NFTW
#endif
+#if defined(__KLIBC__)
+# undef HAVE_NFTW
+# undef HAVE_FTW
+#endif
+
#ifndef HAVE_NFTW
# define FTW_PHYS 1
# ifndef HAVE_FTW
--
1.5.2.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH] [mdadm] config.c include dirent.h instead sys/dir.h 2007-09-21 17:32 [PATCH] [mdadm] Add klibc support to mdadm.h maximilian attems @ 2007-09-21 17:32 ` maximilian attems 2007-09-21 17:32 ` [PATCH] [mdadm] Create.c s/major/major_num/ maximilian attems 2007-09-24 3:22 ` [PATCH] [mdadm] Add klibc support to mdadm.h Neil Brown 2007-10-03 1:50 ` H. Peter Anvin 2 siblings, 1 reply; 5+ messages in thread From: maximilian attems @ 2007-09-21 17:32 UTC (permalink / raw) To: linux-raid; +Cc: Neil Brown, maximilian attems sys/dir.h is an old BSD'ism, include dirent directly. small step for better klibc support. compile tested against glibc. Signed-off-by: maximilian attems <max@stro.at> --- config.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/config.c b/config.c index 73031b7..68c1507 100644 --- a/config.c +++ b/config.c @@ -29,7 +29,7 @@ #include "mdadm.h" #include "dlink.h" -#include <sys/dir.h> +#include <dirent.h> #include <glob.h> #include <fnmatch.h> #include <ctype.h> -- 1.5.2.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] [mdadm] Create.c s/major/major_num/ 2007-09-21 17:32 ` [PATCH] [mdadm] config.c include dirent.h instead sys/dir.h maximilian attems @ 2007-09-21 17:32 ` maximilian attems 0 siblings, 0 replies; 5+ messages in thread From: maximilian attems @ 2007-09-21 17:32 UTC (permalink / raw) To: linux-raid; +Cc: Neil Brown, maximilian attems don't shadow the major() function by int major. Signed-off-by: maximilian attems <max@stro.at> --- Create.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Create.c b/Create.c index 3e6f1af..31b63b4 100644 --- a/Create.c +++ b/Create.c @@ -73,7 +73,7 @@ int Create(struct supertype *st, char *mddev, int mdfd, unsigned long long bitmapsize; mdu_array_info_t array; - int major = BITMAP_MAJOR_HI; + int major_num = BITMAP_MAJOR_HI; memset(&array, 0, sizeof(array)); @@ -422,7 +422,7 @@ int Create(struct supertype *st, char *mddev, int mdfd, return 1; if (bitmap_file && vers < 9003) { - major = BITMAP_MAJOR_HOSTENDIAN; + major_num = BITMAP_MAJOR_HOSTENDIAN; #ifdef __BIG_ENDIAN fprintf(stderr, Name ": Warning - bitmaps created on this kernel are not portable\n" " between different architectured. Consider upgrading the Linux kernel.\n"); @@ -436,7 +436,7 @@ int Create(struct supertype *st, char *mddev, int mdfd, } if (!st->ss->add_internal_bitmap(st, super, &bitmap_chunk, delay, write_behind, - bitmapsize, 1, major)) { + bitmapsize, 1, major_num)) { fprintf(stderr, Name ": Given bitmap chunk size not supported.\n"); return 1; } @@ -466,7 +466,7 @@ int Create(struct supertype *st, char *mddev, int mdfd, if (CreateBitmap(bitmap_file, force, (char*)uuid, bitmap_chunk, delay, write_behind, bitmapsize, - major)) { + major_num)) { return 1; } bitmap_fd = open(bitmap_file, O_RDWR); -- 1.5.2.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] [mdadm] Add klibc support to mdadm.h 2007-09-21 17:32 [PATCH] [mdadm] Add klibc support to mdadm.h maximilian attems 2007-09-21 17:32 ` [PATCH] [mdadm] config.c include dirent.h instead sys/dir.h maximilian attems @ 2007-09-24 3:22 ` Neil Brown 2007-10-03 1:50 ` H. Peter Anvin 2 siblings, 0 replies; 5+ messages in thread From: Neil Brown @ 2007-09-24 3:22 UTC (permalink / raw) To: maximilian attems; +Cc: linux-raid Thanks for this and the other 2 patches. They are all in the mdadm .git. Thanks, NeilBrown ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [mdadm] Add klibc support to mdadm.h 2007-09-21 17:32 [PATCH] [mdadm] Add klibc support to mdadm.h maximilian attems 2007-09-21 17:32 ` [PATCH] [mdadm] config.c include dirent.h instead sys/dir.h maximilian attems 2007-09-24 3:22 ` [PATCH] [mdadm] Add klibc support to mdadm.h Neil Brown @ 2007-10-03 1:50 ` H. Peter Anvin 2 siblings, 0 replies; 5+ messages in thread From: H. Peter Anvin @ 2007-10-03 1:50 UTC (permalink / raw) To: maximilian attems; +Cc: linux-raid, Neil Brown maximilian attems wrote: > klibc still misses a lot functionality to let mdadm link against, > this small step helps to get to the real trouble.. :) > > Signed-off-by: maximilian attems <max@stro.at> > --- > mdadm.h | 9 ++++++++- > 1 files changed, 8 insertions(+), 1 deletions(-) > > diff --git a/mdadm.h b/mdadm.h > index ac7d4b4..dba09f0 100644 > --- a/mdadm.h > +++ b/mdadm.h > @@ -29,7 +29,7 @@ > > #define _GNU_SOURCE > #include <unistd.h> > -#ifndef __dietlibc__ > +#if !defined(__dietlibc__) && !defined(__KLIBC__) > extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence)); > #else Wouldn't it be better to just compile with -D_FILE_OFFSET_BITS=64 on all libraries instead of using the LFS cruft? -hpa ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-10-03 1:50 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-09-21 17:32 [PATCH] [mdadm] Add klibc support to mdadm.h maximilian attems 2007-09-21 17:32 ` [PATCH] [mdadm] config.c include dirent.h instead sys/dir.h maximilian attems 2007-09-21 17:32 ` [PATCH] [mdadm] Create.c s/major/major_num/ maximilian attems 2007-09-24 3:22 ` [PATCH] [mdadm] Add klibc support to mdadm.h Neil Brown 2007-10-03 1:50 ` H. Peter Anvin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).