From f43dea8084f7ce989c17d2a00b643aac5b404325 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 16 Nov 2010 17:29:39 +0000 Subject: [PATCH] * libc/include/sys/types.h: Add _mode_t for __rtems__. * libc/sys/rtems/machine/_types.h: Provide _mode_t, _fpos_t, _off_t. Add _ssize_t for 64bit sparc. Let arm, i386, m68k, mips, PPC, sparc use 64bit _off_t, _fpos_t. --- newlib/ChangeLog | 7 +++++++ newlib/libc/include/sys/types.h | 6 +++++- newlib/libc/sys/rtems/machine/_types.h | 23 +++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 29ace2ac9..54fbfa8cd 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,10 @@ +2010-11-16 Ralf Corsépius + + * libc/include/sys/types.h: Add _mode_t for __rtems__. + * libc/sys/rtems/machine/_types.h: Provide _mode_t, _fpos_t, _off_t. + Add _ssize_t for 64bit sparc. + Let arm, i386, m68k, mips, PPC, sparc use 64bit _off_t, _fpos_t. + 2010-11-16 Ralf Corsépius * configure.host: Add -D_COMPILING_NEWLIB to newlib_cflags. diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index 823a9c0f5..17f9306ac 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -171,12 +171,16 @@ typedef signed char pid_t; typedef int pid_t; #endif +#if defined(__rtems__) +typedef _mode_t mode_t; +#endif + #ifndef __CYGWIN__ typedef long key_t; #endif typedef _ssize_t ssize_t; -#ifndef __CYGWIN__ +#if !defined(__CYGWIN__) && !defined(__rtems__) #ifdef __MS_types__ typedef char * addr_t; typedef int mode_t; diff --git a/newlib/libc/sys/rtems/machine/_types.h b/newlib/libc/sys/rtems/machine/_types.h index e1c6ba671..2e0204335 100644 --- a/newlib/libc/sys/rtems/machine/_types.h +++ b/newlib/libc/sys/rtems/machine/_types.h @@ -20,6 +20,9 @@ typedef signed int _ssize_t; typedef long signed int _ssize_t; #endif #define __ssize_t_defined 1 +#elif defined(__sparc__) && defined(__LP64__) +typedef long signed int _ssize_t; +#define __ssize_t_defined 1 #elif defined(__AVR__) || defined(__lm32__) || defined(__m32c__) || defined(__mips__) || defined(__moxie__) || defined(__PPC__) || defined(__sparc__) || defined(__sh__) typedef signed int _ssize_t; #define __ssize_t_defined 1 @@ -31,4 +34,24 @@ typedef signed int _ssize_t; typedef __int32_t blksize_t; typedef __int32_t blkcnt_t; + +#if defined(__arm__) || defined(__i386__) || defined(__m68k__) || defined(__mips__) || defined(__PPC__) || defined(__sparc__) +/* Use 64bit types */ +typedef __int64_t _off_t; +#define __off_t_defined 1 + +typedef __int64_t _fpos_t; +#define __fpos_t_defined 1 +#else +/* Use 32bit types */ +typedef __int32_t _off_t; +#define __off_t_defined 1 + +typedef __int32_t _fpos_t; +#define __fpos_t_defined 1 +#endif + +typedef __uint32_t _mode_t; +#define __mode_t_defined 1 + #endif -- 2.43.5