This is the mail archive of the newlib@sourceware.org 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 1/3] Change _offset type from int to _off_t


2012-11-22  Sebastian Huber <sebastian.huber@embedded-brains.de>

	* libc/include/sys/reent.h (__sFILE): Change type of _offset
	from int to _off_t.

Currently we have

./newlib/libc/sys/rtems/machine/_types.h-
./newlib/libc/sys/rtems/machine/_types.h-#if defined(__arm__) || defined(__i386__) || defined(__m68k__) || defined(__mips__) || defined(__PPC__) || defined(__sparc__)
./newlib/libc/sys/rtems/machine/_types.h-/* Use 64bit types */
./newlib/libc/sys/rtems/machine/_types.h:typedef __int64_t _off_t;
./newlib/libc/sys/rtems/machine/_types.h-#define __off_t_defined 1
./newlib/libc/sys/rtems/machine/_types.h-
./newlib/libc/sys/rtems/machine/_types.h-typedef __int64_t _fpos_t;
./newlib/libc/sys/rtems/machine/_types.h-#define __fpos_t_defined 1
./newlib/libc/sys/rtems/machine/_types.h-#else
./newlib/libc/sys/rtems/machine/_types.h-/* Use 32bit types */
./newlib/libc/sys/rtems/machine/_types.h:typedef __int32_t _off_t;
./newlib/libc/sys/rtems/machine/_types.h-#define __off_t_defined 1
./newlib/libc/sys/rtems/machine/_types.h-
./newlib/libc/sys/rtems/machine/_types.h-typedef __int32_t _fpos_t;
./newlib/libc/sys/linux/sys/_types.h-#ifndef    _SYS__TYPES_H
./newlib/libc/sys/linux/sys/_types.h-#define _SYS__TYPES_H
./newlib/libc/sys/linux/sys/_types.h-
./newlib/libc/sys/linux/sys/_types.h:typedef long _off_t;
./newlib/libc/sys/linux/sys/_types.h-__extension__ typedef long long _off64_t;
./newlib/libc/sys/linux/sys/_types.h-
./newlib/libc/sys/linux/sys/_types.h-typedef long _fpos_t;
./newlib/libc/include/sys/_types.h-#include <sys/lock.h>
./newlib/libc/include/sys/_types.h-
./newlib/libc/include/sys/_types.h-#ifndef __off_t_defined
./newlib/libc/include/sys/_types.h:typedef long _off_t;
./newlib/libc/include/sys/_types.h-#endif
./newlib/libc/include/sys/_types.h-
./newlib/libc/include/sys/_types.h-#if defined(__rtems__)
./newlib/libc/include/machine/types.h-#define _TIMER_T_         unsigned long
./newlib/libc/include/machine/types.h-
./newlib/libc/include/machine/types.h-#ifndef _HAVE_SYSTYPES
./newlib/libc/include/machine/types.h:typedef long int __off_t;
./newlib/libc/include/machine/types.h-typedef int __pid_t;
./newlib/libc/include/machine/types.h-#ifdef __GNUC__
./newlib/libc/include/machine/types.h-__extension__ typedef long long int __loff_t

This change breaks binary compatibility if sizeof(int) != sizeof(long).
It breaks binary compatibility also on some RTEMS targets, but this is
not a problem.
---
 newlib/libc/include/sys/reent.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index 8518964..7e321e0 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -203,7 +203,7 @@ struct __sFILE {
 
   /* Unix stdio files get aligned to block boundaries on fseek() */
   int	_blksize;	/* stat.st_blksize (may be != _bf._size) */
-  int	_offset;	/* current lseek offset */
+  _off_t _offset;	/* current lseek offset */
 
 #ifndef _REENT_SMALL
   struct _reent *_data;	/* Here for binary compatibility? Remove? */
-- 
1.7.7


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