From c5d5030aea7585b86a4fe6e3dec068b0e720e8a2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 15 Apr 2016 13:44:21 +0200 Subject: [PATCH] Provide POSIX defined blksize_t in Signed-off-by: Sebastian Huber --- 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 13362ad09..0d48f04ad 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 a75c1c24f..94a90c0dd 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 ac8252ee6..24d90cd34 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 3dbcb3db5..ed0920692 100644 --- a/newlib/libc/sys/rtems/include/machine/_types.h +++ b/newlib/libc/sys/rtems/include/machine/_types.h @@ -3,11 +3,12 @@ #include -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 b7c3e23ca..9e13d0423 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 f014cdc36..f09f1ef17 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;