This is the mail archive of the mailing list for the newlib project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/2] Add BSD guards for off_t, dev_t, uid_t, and gid_t

Copy definitions of off_t, dev_t, uid_t, and gid_t verbatim from latest
FreeBSD <sys/types.h>.

Signed-off-by: Sebastian Huber <>
 newlib/libc/include/sys/types.h | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index c0b5796..496c2ae 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -168,11 +168,23 @@ typedef int32_t register_t;
 #ifndef __CYGWIN__	/* which defines these types in it's own types.h. */
-typedef _off_t	off_t;
-typedef __dev_t dev_t;
-typedef __uid_t uid_t;
-typedef __gid_t gid_t;
+#ifndef _OFF_T_DECLARED
+typedef	__off_t		off_t;		/* file offset */
+#define	_OFF_T_DECLARED
+#ifndef _DEV_T_DECLARED
+typedef	__dev_t		dev_t;		/* device number or struct cdev */
+#define	_DEV_T_DECLARED
+#ifndef _UID_T_DECLARED
+typedef	__uid_t		uid_t;		/* user id */
+#define	_UID_T_DECLARED
+#ifndef _GID_T_DECLARED
+typedef	__gid_t		gid_t;		/* group id */
+#define	_GID_T_DECLARED
+#endif /* !__CYGWIN__ */
 #ifndef _PID_T_DECLARED
 typedef	__pid_t		pid_t;		/* process id */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]