[PATCH 02/18] Provide POSIX defined id_t in <sys/types.h>
Sebastian Huber
sebastian.huber at embedded-brains.de
Thu Apr 14 11:54:31 UTC 2016
Signed-off-by: Sebastian Huber <sebastian.huber at embedded-brains.de>
---
newlib/libc/include/sys/_types.h | 4 ++++
newlib/libc/include/sys/types.h | 5 +++++
winsup/cygwin/include/cygwin/types.h | 6 ------
winsup/cygwin/include/machine/_types.h | 3 +++
4 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index 762dfed..ebd4943 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -43,6 +43,10 @@ typedef unsigned short __uid_t;
typedef unsigned short __gid_t;
#endif
+#ifndef __machine_id_t_defined
+typedef __pid_t __id_t;
+#endif
+
#ifndef __machine_off64_t_defined
__extension__ typedef long long _off64_t;
#endif
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index 316ee9a..d093578 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -134,6 +134,11 @@ typedef char * caddr_t;
#define __caddr_t_defined
#endif
+#ifndef _ID_T_DECLARED
+typedef __id_t id_t; /* can hold a uid_t or pid_t */
+#define _ID_T_DECLARED
+#endif
+
#ifndef __CYGWIN__
#if defined(__MS_types__) || defined(__rtems__) || \
defined(__sparc__) || defined(__SPU__)
diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h
index f9ed4b6..bfffc5d 100644
--- a/winsup/cygwin/include/cygwin/types.h
+++ b/winsup/cygwin/include/cygwin/types.h
@@ -65,12 +65,6 @@ typedef __uint32_t __ino32_t;
typedef __uint64_t ino_t;
#endif /*__ino_t_defined*/
-/* Generic ID type, must match at least pid_t, uid_t and gid_t in size. */
-#ifndef __id_t_defined
-#define __id_t_defined
-typedef __uint32_t id_t;
-#endif /* __id_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 50e704b..1dfe442 100644
--- a/winsup/cygwin/include/machine/_types.h
+++ b/winsup/cygwin/include/machine/_types.h
@@ -20,6 +20,9 @@ typedef __uint32_t __uid_t;
#define __machine_gid_t_defined
typedef __uint32_t __gid_t;
+#define __machine_id_t_defined
+typedef __uint32_t __id_t;
+
#define __machine_key_t_defined
typedef long long __key_t;
--
1.8.4.5
More information about the devel
mailing list