This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] Provide POSIX defined fsblkcnt_t and fsfilcnt_t
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: cygwin-cvs at sourceware dot org, newlib-cvs at sourceware dot org
- Date: 15 Apr 2016 12:54:54 -0000
- Subject: [newlib-cygwin] Provide POSIX defined fsblkcnt_t and fsfilcnt_t
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f3e587d30a9f65d0c6551ad14095300f6e81672e
commit f3e587d30a9f65d0c6551ad14095300f6e81672e
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date: Fri Apr 15 13:44:22 2016 +0200
Provide POSIX defined fsblkcnt_t and fsfilcnt_t
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Diff:
---
newlib/libc/include/sys/_types.h | 8 ++++++++
newlib/libc/include/sys/types.h | 6 ++++++
winsup/cygwin/include/cygwin/types.h | 12 ------------
winsup/cygwin/include/machine/_types.h | 8 ++++++++
4 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index 0d48f04..88a18b3 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -30,6 +30,14 @@ typedef long __blkcnt_t;
typedef long __blksize_t;
#endif
+#ifndef __machine_fsblkcnt_t_defined
+typedef __uint64_t __fsblkcnt_t;
+#endif
+
+#ifndef __machine_fsfilcnt_t_defined
+typedef __uint32_t __fsfilcnt_t;
+#endif
+
#ifndef __machine_off_t_defined
typedef long _off_t;
#endif
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index 24d90cd..6d9865c 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -127,6 +127,12 @@ typedef char * caddr_t;
#define __caddr_t_defined
#endif
+#ifndef _FSBLKCNT_T_DECLARED /* for statvfs() */
+typedef __fsblkcnt_t fsblkcnt_t;
+typedef __fsfilcnt_t fsfilcnt_t;
+#define _FSBLKCNT_T_DECLARED
+#endif
+
#ifndef _ID_T_DECLARED
typedef __id_t id_t; /* can hold a uid_t or pid_t */
#define _ID_T_DECLARED
diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h
index 9e13d04..faf08bd 100644
--- a/winsup/cygwin/include/cygwin/types.h
+++ b/winsup/cygwin/include/cygwin/types.h
@@ -34,18 +34,6 @@ typedef struct timespec timestruc_t;
typedef __loff_t loff_t;
-#ifndef __fsblkcnt_t_defined
-#define __fsblkcnt_t_defined
-/* Keep as is. 32 bit on i386, 64 bit on x86_64. */
-typedef unsigned long fsblkcnt_t;
-#endif /* __fsblkcnt_t_defined */
-
-#ifndef __fsfilcnt_t_defined
-#define __fsfilcnt_t_defined
-/* Keep as is. 32 bit on i386, 64 bit on x86_64. */
-typedef unsigned long fsfilcnt_t;
-#endif /* __fsfilcnt_t_defined */
-
#if defined (__INSIDE_CYGWIN__) && !defined (__x86_64__)
struct __flock32 {
short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
diff --git a/winsup/cygwin/include/machine/_types.h b/winsup/cygwin/include/machine/_types.h
index f09f1ef..8a2c679 100644
--- a/winsup/cygwin/include/machine/_types.h
+++ b/winsup/cygwin/include/machine/_types.h
@@ -22,6 +22,14 @@ typedef __int32_t __blksize_t;
#define __machine_dev_t_defined
typedef __uint32_t __dev_t;
+#define __machine_fsblkcnt_t_defined
+/* Keep as is. 32 bit on i386, 64 bit on x86_64. */
+typedef unsigned long __fsblkcnt_t;
+
+#define __machine_fsfilcnt_t_defined
+/* Keep as is. 32 bit on i386, 64 bit on x86_64. */
+typedef unsigned long __fsfilcnt_t;
+
#define __machine_uid_t_defined
typedef __uint32_t __uid_t;