Re: Wrong define for dev_t
Pascal Terjan <[email protected]>
| Newsgroups | gmane.linux.lib.dietlibc |
|---|---|
| Organization | Mandriva |
| Message-ID | <1274349681.23709.7.camel@plop> |
Le mercredi 19 mai 2010 à 15:32 +0200, Pascal Terjan a écrit :
> I had a bug here where sda16 was created as 3:0 instead of 259:0
>
> I found that this is because on x86 dev_t is wrong, it is uint16_t
> instead of uint32_t
Patch for this is easy but I think struct stat and stat64 should be
fixed to, glibc has __dev_t st_dev and dietlibc has it uint16_t
_arm_ seems wrong too
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Le mercredi 19 mai 2010 15:32 +0200, Pascal Terjan a crit :
> I had a bug here where sda16 was created as 3:0 instead of 259:0
>
> I found that this is because on x86 dev_t is wrong, it is uint16_t
> instead of uint32_t
Patch for this is easy but I think struct stat and stat64 should be
fixed to, glibc has __dev_t st_dev and dietlibc has it uint16_t
_arm_ seems wrong too
Index: include/sys/types.h
===================================================================
RCS file: /cvs/dietlibc/include/sys/types.h,v
retrieving revision 1.30
diff -U2 -r1.30 types.h
--- include/sys/types.h 18 Oct 2007 21:08:02 -0000 1.30
+++ include/sys/types.h 20 May 2010 09:51:48 -0000
@@ -39,5 +39,5 @@
*/
-#if defined(__alpha__) || defined(__ia64__) || defined(__sparc64__) ||
defined(__s390x__)
+#if defined(__alpha__) || defined(__i386__) || defined(__ia64__) ||
defined(__sparc64__) || defined(__s390x__)
typedef uint32_t dev_t; /* Used for device IDs. */
typedef uint32_t gid_t; /* Used for group IDs. */
@@ -45,5 +45,5 @@
typedef uint32_t nlink_t; /* Used for link counts. */
typedef uint32_t uid_t; /* Used for user IDs. */
-#elif defined(__arm__) || defined(__i386__) || defined(__sparc__) ||
defined(__s390__) /* make sure __s390x__ hits before __s390__ */
+#elif defined(__arm__) || defined(__sparc__) || defined(__s390__) /*
make sure __s390x__ hits before __s390__ */
typedef uint16_t dev_t;
typedef uint16_t gid_t;