Merge with git://charm.itp.tuwien.ac.at/mattems/klibc/.git#maks
diff --git a/usr/include/arch/mips/klibc/archconfig.h b/usr/include/arch/mips/klibc/archconfig.h
index d9528b8..15b3208 100644
--- a/usr/include/arch/mips/klibc/archconfig.h
+++ b/usr/include/arch/mips/klibc/archconfig.h
@@ -12,4 +12,7 @@
 /* MIPS has architecture-specific code for vfork() */
 #define _KLIBC_REAL_VFORK 1
 
+/* MIPS defines it's own statfs */
+#define _KLIBC_STATFS_F_TYPE_32B 1
+
 #endif				/* _KLIBC_ARCHCONFIG_H */
diff --git a/usr/include/klibc/sysconfig.h b/usr/include/klibc/sysconfig.h
index f3ae915..f4fb7a9 100644
--- a/usr/include/klibc/sysconfig.h
+++ b/usr/include/klibc/sysconfig.h
@@ -163,4 +163,14 @@
 # define _KLIBC_STATFS_F_TYPE_64 (_BITSIZE == 64)
 #endif
 
+/*
+ * _KLIBC_STATFS_F_TYPE_32B:
+ *
+ * 	mips has it's own definition of statfs, which is
+ * 	different from any other 32 bit arch.
+ */	
+#ifndef _KLIBC_STATFS_F_TYPE_32B
+# define _KLIBC_STATFS_F_TYPE_32B 0
+#endif
+
 #endif /* _KLIBC_SYSCONFIG_H */
diff --git a/usr/include/sys/vfs.h b/usr/include/sys/vfs.h
index 33b1026..6fb1eab 100644
--- a/usr/include/sys/vfs.h
+++ b/usr/include/sys/vfs.h
@@ -32,6 +32,23 @@
 	uint64_t f_spare[5];
 };
 
+#elif _KLIBC_STATFS_F_TYPE_32B
+
+struct statfs {
+	uint32_t f_type;
+	uint32_t f_bsize;
+	uint32_t f_frsize;
+	uint32_t __pad;
+	uint64_t f_blocks;
+	uint64_t f_bfree;
+	uint64_t f_files;
+	uint64_t f_ffree;
+	uint64_t f_bavail;
+	__kernel_fsid_t f_fsid;
+	uint32_t f_namelen;
+	uint32_t f_spare[6];
+};
+
 #else /* not _KLIBC_STATFS_F_TYPE_64 */
 
 struct statfs {