[PATCH v2 10/18] Provide POSIX defined blksize_t in <sys/types.h>
Sebastian Huber
sebastian.huber at embedded-brains.de
Fri Apr 15 11:44:21 UTC 2016
Signed-off-by: Sebastian Huber <sebastian.huber at embedded-brains.de>
---
newlib/libc/include/sys/_types.h | 4 ++++
newlib/libc/include/sys/stat.h | 2 +-
newlib/libc/include/sys/types.h | 5 +++++
newlib/libc/sys/rtems/include/machine/_types.h | 5 +++--
winsup/cygwin/include/cygwin/types.h | 5 -----
winsup/cygwin/include/machine/_types.h | 3 +++
6 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index 13362ad..0d48f04 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -26,6 +26,10 @@
typedef long __blkcnt_t;
#endif
+#ifndef __machine_blksize_t_defined
+typedef long __blksize_t;
+#endif
+
#ifndef __machine_off_t_defined
typedef long _off_t;
#endif
diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h
index a75c1c2..94a90c0 100644
--- a/newlib/libc/include/sys/stat.h
+++ b/newlib/libc/include/sys/stat.h
@@ -53,7 +53,7 @@ struct stat
long st_spare2;
time_t st_ctime;
long st_spare3;
- long st_blksize;
+ blksize_t st_blksize;
blkcnt_t st_blocks;
long st_spare4[2];
#endif
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index ac8252e..24d90cd 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -101,6 +101,11 @@ typedef __blkcnt_t blkcnt_t;
#define _BLKCNT_T_DECLARED
#endif
+#ifndef _BLKSIZE_T_DECLARED
+typedef __blksize_t blksize_t;
+#define _BLKSIZE_T_DECLARED
+#endif
+
#if !defined(__clock_t_defined) && !defined(_CLOCK_T_DECLARED)
typedef _CLOCK_T_ clock_t;
#define __clock_t_defined
diff --git a/newlib/libc/sys/rtems/include/machine/_types.h b/newlib/libc/sys/rtems/include/machine/_types.h
index 3dbcb3d..ed09206 100644
--- a/newlib/libc/sys/rtems/include/machine/_types.h
+++ b/newlib/libc/sys/rtems/include/machine/_types.h
@@ -3,11 +3,12 @@
#include <machine/_default_types.h>
-typedef __int32_t blksize_t;
-
typedef __int32_t __blkcnt_t;
#define __machine_blkcnt_t_defined
+typedef __int32_t __blksize_t;
+#define __machine_blksize_t_defined
+
typedef __uint64_t __dev_t;
#define __machine_dev_t_defined
diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h
index b7c3e23..9e13d04 100644
--- a/winsup/cygwin/include/cygwin/types.h
+++ b/winsup/cygwin/include/cygwin/types.h
@@ -34,11 +34,6 @@ typedef struct timespec timestruc_t;
typedef __loff_t loff_t;
-#ifndef __blksize_t_defined
-#define __blksize_t_defined
-typedef __int32_t blksize_t;
-#endif /*__blksize_t_defined*/
-
#ifndef __fsblkcnt_t_defined
#define __fsblkcnt_t_defined
/* Keep as is. 32 bit on i386, 64 bit on x86_64. */
diff --git a/winsup/cygwin/include/machine/_types.h b/winsup/cygwin/include/machine/_types.h
index f014cdc..f09f1ef 100644
--- a/winsup/cygwin/include/machine/_types.h
+++ b/winsup/cygwin/include/machine/_types.h
@@ -16,6 +16,9 @@ typedef __uint32_t __ino32_t;
#define __machine_blkcnt_t_defined
typedef __uint64_t __blkcnt_t;
+#define __machine_blksize_t_defined
+typedef __int32_t __blksize_t;
+
#define __machine_dev_t_defined
typedef __uint32_t __dev_t;
--
1.8.4.5
More information about the devel
mailing list