--- xfsprogs-3.0.0/include/linux.h~ 2009-02-04 23:29:25.000000000 +0100 +++ xfsprogs-3.0.0/include/linux.h 2009-03-19 16:19:35.000000000 +0100 @@ -25,6 +25,10 @@ #include #include #include +#ifdef __dietlibc__ +#include +#include +#endif static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) { diff -ur xfsprogs-3.0.0/include/project.h xfsprogs-3.0.0-diet/include/project.h --- xfsprogs-3.0.0/include/project.h 2009-02-04 23:29:25.000000000 +0100 +++ xfsprogs-3.0.0-diet/include/project.h 2009-03-19 12:55:05.000000000 +0100 @@ -19,6 +19,9 @@ #define __PROJECT_H__ #include +#ifdef __dietlibc__ +#include +#endif #if !defined(__sgi__) typedef __uint32_t prid_t; diff -ur xfsprogs-3.0.0/include/xfs_ialloc_btree.h xfsprogs-3.0.0-diet/include/xfs_ialloc_btree.h --- xfsprogs-3.0.0/include/xfs_ialloc_btree.h 2009-02-04 23:29:25.000000000 +0100 +++ xfsprogs-3.0.0-diet/include/xfs_ialloc_btree.h 2009-03-19 12:49:55.000000000 +0100 @@ -18,6 +18,9 @@ #ifndef __XFS_IALLOC_BTREE_H__ #define __XFS_IALLOC_BTREE_H__ +#ifdef __dietlibc__ +#define NBBY CHAR_BIT +#endif /* * Inode map on-disk structures */ diff -ur xfsprogs-3.0.0/include/xfs_types.h xfsprogs-3.0.0-diet/include/xfs_types.h --- xfsprogs-3.0.0/include/xfs_types.h 2009-02-04 23:29:25.000000000 +0100 +++ xfsprogs-3.0.0-diet/include/xfs_types.h 2009-03-19 12:40:08.000000000 +0100 @@ -28,18 +28,6 @@ typedef unsigned int uint_t; typedef unsigned long ulong_t; -/* - * Additional type declarations for XFS - */ -typedef signed char __int8_t; -typedef unsigned char __uint8_t; -typedef signed short int __int16_t; -typedef unsigned short int __uint16_t; -typedef signed int __int32_t; -typedef unsigned int __uint32_t; -typedef signed long long int __int64_t; -typedef unsigned long long int __uint64_t; - typedef enum { B_FALSE,B_TRUE } boolean_t; typedef __uint32_t prid_t; /* project ID */ typedef __uint32_t inst_t; /* an instruction */ @@ -64,6 +52,20 @@ #endif /* __KERNEL__ */ +#if defined(__dietlibc__) || defined(__KERNEL__) +/* + * Additional type declarations for XFS + */ +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; +typedef signed long long int __int64_t; +typedef unsigned long long int __uint64_t; +#endif + typedef __uint32_t xfs_agblock_t; /* blockno in alloc. group */ typedef __uint32_t xfs_extlen_t; /* extent length in blocks */ typedef __uint32_t xfs_agnumber_t; /* allocation group number */ --- xfsprogs-3.0.0/libdisk/evms.h~ 2009-02-04 23:29:25.000000000 +0100 +++ xfsprogs-3.0.0/libdisk/evms.h 2009-03-19 21:52:18.000000000 +0100 @@ -15,6 +15,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef __dietlibc__ +#include +#endif #define EVMS_MAJOR 117 #define EVMS_GET_VOL_STRIPE_INFO \ diff -ur xfsprogs-3.0.0/libdisk/xvm.h xfsprogs-3.0.0-diet/libdisk/xvm.h --- xfsprogs-3.0.0/libdisk/xvm.h 2009-02-04 23:29:25.000000000 +0100 +++ xfsprogs-3.0.0-diet/libdisk/xvm.h 2009-03-19 12:56:54.000000000 +0100 @@ -15,6 +15,10 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifdef __dietlibc__ +#include +#include +#endif #define _DIOC_(x) (('d'<<8) | x) #define DIOCGETVOLDEV _DIOC_(36) /* subvolume devices */ diff -ur xfsprogs-3.0.0/libhandle/handle.c xfsprogs-3.0.0-diet/libhandle/handle.c --- xfsprogs-3.0.0/libhandle/handle.c 2009-02-04 23:29:25.000000000 +0100 +++ xfsprogs-3.0.0-diet/libhandle/handle.c 2009-03-19 12:56:03.000000000 +0100 @@ -17,6 +17,10 @@ #include #include #include +#ifdef __dietlibc__ +#include +#include +#endif /* just pick a value we know is more than big enough */ #define MAXHANSIZ 64 diff -ur xfsprogs-3.0.0/libhandle/jdm.c xfsprogs-3.0.0-diet/libhandle/jdm.c --- xfsprogs-3.0.0/libhandle/jdm.c 2009-02-04 23:29:25.000000000 +0100 +++ xfsprogs-3.0.0-diet/libhandle/jdm.c 2009-03-19 12:56:28.000000000 +0100 @@ -17,6 +17,10 @@ #include #include #include +#ifdef __dietlibc__ +#include +#include +#endif /* internal fshandle - typecast to a void for external use */ #define FSHANDLE_SZ 8 diff -ur xfsprogs-3.0.0/libxfs/linux.c xfsprogs-3.0.0-diet/libxfs/linux.c --- xfsprogs-3.0.0/libxfs/linux.c 2009-02-04 23:29:25.000000000 +0100 +++ xfsprogs-3.0.0-diet/libxfs/linux.c 2009-03-19 13:30:12.000000000 +0100 @@ -21,7 +21,12 @@ #include #include #undef ustat +#ifdef __dietlibc__ +#include +#include +#else #include +#endif #include #include #include diff -ur xfsprogs-3.0.0/repair/prefetch.c xfsprogs-3.0.0-diet/repair/prefetch.c --- xfsprogs-3.0.0/repair/prefetch.c 2009-02-04 23:29:26.000000000 +0100 +++ xfsprogs-3.0.0-diet/repair/prefetch.c 2009-03-19 16:00:01.000000000 +0100 @@ -735,7 +735,11 @@ { mp = pmp; mp_fd = libxfs_device_to_fd(mp->m_dev); +#ifdef __dietlibc__ + pf_max_bytes = sysconf(_SC_PAGESIZE) << 7; +#else pf_max_bytes = sysconf(_SC_PAGE_SIZE) << 7; +#endif pf_max_bbs = pf_max_bytes >> BBSHIFT; pf_max_fsbs = pf_max_bytes >> mp->m_sb.sb_blocklog; pf_batch_bytes = DEF_BATCH_BYTES; --- xfsprogs-3.0.0/include/platform_defs.h.in~ 2009-02-04 23:29:25.000000000 +0100 +++ xfsprogs-3.0.0/include/platform_defs.h.in 2009-03-19 21:48:13.000000000 +0100 @@ -169,4 +169,14 @@ #define __arch_pack #endif +#if defined(__dietlibc__) && defined(__NO_STAT64) +#define lstat64 lstat +#define fstat64 fstat +#define stat64 stat +#define pread64 pread +#define pwrite64 pwrite +#define lseek64 lseek +#define ftruncate64 ftruncate +#endif + #endif /* __XFS_PLATFORM_DEFS_H__ */