source:
rtems/contrib/crossrpms/patches/newlib-1.17.0-rtems4.10-20090505.diff
@
ab16a063
Last change on this file since ab16a063 was e794ba6, checked in by Ralf Corsepius <ralf.corsepius@…>, on 05/05/09 at 11:17:09 | |
---|---|
|
|
File size: 31.1 KB |
-
newlib/ChangeLog.rtems
diff -Naur newlib-1.17.0.orig/newlib/ChangeLog.rtems newlib-1.17.0/newlib/ChangeLog.rtems
old new 1 2009-05-05 Ralf Corsépius <ralf.corsepius@rtems.org> 2 3 * configure.host: Remove -DMISSING_SYSCALL_NAMES. 4 5 2009-03-11 Ralf Corsépius <ralf.corsepius@rtems.org> 6 7 * libc/stdlib/assert.c: Don't build __assert_func. 8 * libc/sys/rtems/crt0.c: Add __assert_func. 9 10 2009-03-09 Ralf Corsépius <ralf.corsepius@rtems.org> 11 12 * libc/machine/powerpc/times.c: Remove. 13 * libc/machine/powerpc/Makefile.am: Remove times.c. 14 * libc/machine/powerpc/Makefile.in: Regenerate. 15 16 2009-02-24 Ralf Corsépius <ralf.corsepius@rtems.org> 17 18 * libc/unix/ttyname.c: Sync with newlib-cvs. 19 * configure.host: Add -DHAVE_BLKSIZE to newlib_cflags. 20 21 2009-02-22 Ralf Corsépius <ralf.corsepius@rtems.org> 22 23 * libc/sys/rtems/machine/stdint.h: Add __lm32__. 24 * libc/machine/lm32/configure.in: Set AC_CONFIG_SRC to setjmp.S. 25 * libc/machine/lm32/configure: Regenerate. 26 27 2009-02-20 Ralf Corsépius <ralf.corsepius@rtems.org> 28 29 * libc/unix/Makefile.in: Regenerate. 30 31 2009-02-20 Craig Howland <howland@LGSInnovations.com> on behalf of 32 Sebastian Huber <sebastian.huber@embedded-brains.de> 33 34 * libc/unix/ttyname.c: Remove ttyname_r() (to a new file to avoid 35 coupling ttyname_r() and ttyname() due to the latter's large buffer). 36 * libc/unix/ttyname_r.c: New file to hold ttyname_r(), previously in 37 ttyname.c. 38 * libc/unix/ttyname.h: New file (common size definition for the 2 39 ttyname*c files that are now split). 40 * libc/unix/Makefile.am (ELIX_2_SOURCES): Add ttyname_r.c. 41 42 2009-02-16 Ralf Corsépius <ralf.corsepius@rtems.org> 43 44 * libc/sys/rtems/sys/param.h: 45 Update copyright notice from FreeBSD. 46 Remove HZ. 47 Add #include <sys/priority.h> 48 Remove priority handling (moved to sys/priority.h). 49 Remove CLBYTES (Unused, abandoned in BSD). 50 51 2009-02-06 Ralf Corsépius <ralf.corsepius@rtems.org> 52 53 * libc/include/sched.h: 54 Remove (collides with RTEMS's schedul.h). 55 -
newlib/configure.host
diff -Naur newlib-1.17.0.orig/newlib/configure.host newlib-1.17.0/newlib/configure.host
old new 537 537 *-*-rtems*) 538 538 default_newlib_io_long_long="yes" 539 539 default_newlib_io_c99_formats="yes" 540 newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -D MISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP-DHAVE_FCNTL"540 newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL" 541 541 # turn off unsupported items in posix directory 542 542 newlib_cflags="${newlib_cflags} -D_NO_GETLOGIN -D_NO_GETPWENT -D_NO_GETUT -D_NO_GETPASS -D_NO_SIGSET" 543 543 ;; -
newlib/libc/include/inttypes.h
diff -Naur newlib-1.17.0.orig/newlib/libc/include/inttypes.h newlib-1.17.0/newlib/libc/include/inttypes.h
old new 163 163 164 164 165 165 /* 64-bit types */ 166 #if __have_longlong64 167 #define __PRI64(x) __STRINGIFY(ll##x) 168 #define __SCN64(x) __STRINGIFY(ll##x) 169 #elif __have_long64 166 #if __have_long64 170 167 #define __PRI64(x) __STRINGIFY(l##x) 171 168 #define __SCN64(x) __STRINGIFY(l##x) 169 #elif __have_longlong64 170 #define __PRI64(x) __STRINGIFY(ll##x) 171 #define __SCN64(x) __STRINGIFY(ll##x) 172 172 #else 173 173 #define __PRI64(x) __STRINGIFY(x) 174 174 #define __SCN64(x) __STRINGIFY(x) … … 217 217 #endif 218 218 219 219 /* max-bit types */ 220 #if __have_longlong64 221 #define __PRIMAX(x) __STRINGIFY(ll##x) 222 #define __SCNMAX(x) __STRINGIFY(ll##x) 223 #elif __have_long64 220 #if __have_long64 224 221 #define __PRIMAX(x) __STRINGIFY(l##x) 225 222 #define __SCNMAX(x) __STRINGIFY(l##x) 223 #elif __have_longlong64 224 #define __PRIMAX(x) __STRINGIFY(ll##x) 225 #define __SCNMAX(x) __STRINGIFY(ll##x) 226 226 #else 227 227 #define __PRIMAX(x) __STRINGIFY(x) 228 228 #define __SCNMAX(x) __STRINGIFY(x) … … 242 242 #define SCNxMAX __SCNMAX(x) 243 243 244 244 /* ptr types */ 245 #if __have_longlong64 246 #define __PRIPTR(x) __STRINGIFY(ll##x) 247 #define __SCNPTR(x) __STRINGIFY(ll##x) 248 #elif __have_long64 245 #if __have_long64 249 246 #define __PRIPTR(x) __STRINGIFY(l##x) 250 247 #define __SCNPTR(x) __STRINGIFY(l##x) 248 #elif __have_longlong64 249 #define __PRIPTR(x) __STRINGIFY(ll##x) 250 #define __SCNPTR(x) __STRINGIFY(ll##x) 251 251 #else 252 252 #define __PRIPTR(x) __STRINGIFY(x) 253 253 #define __SCNPTR(x) __STRINGIFY(x) -
newlib/libc/include/machine/ieeefp.h
diff -Naur newlib-1.17.0.orig/newlib/libc/include/machine/ieeefp.h newlib-1.17.0/newlib/libc/include/machine/ieeefp.h
old new 62 62 # define __IEEE_BIG_ENDIAN 63 63 # endif 64 64 #else 65 # define __IEEE_BIG_ENDIAN66 65 # ifdef __ARMEL__ 66 # define __IEEE_LITTLE_ENDIAN 67 # else 68 # define __IEEE_BIG_ENDIAN 69 # endif 70 # ifdef __ARMWEL__ 67 71 # define __IEEE_BYTES_LITTLE_ENDIAN 68 72 # endif 69 73 #endif -
newlib/libc/include/machine/setjmp.h
diff -Naur newlib-1.17.0.orig/newlib/libc/include/machine/setjmp.h newlib-1.17.0/newlib/libc/include/machine/setjmp.h
old new 27 27 28 28 /* necv70 was 9 as well. */ 29 29 30 #if def __mc68000__30 #if defined(__m68k__) || defined(__mc68000__) 31 31 /* 32 32 * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6, 33 33 * fp2-fp7 for 68881. -
newlib/libc/include/sched.h
diff -Naur newlib-1.17.0.orig/newlib/libc/include/sched.h newlib-1.17.0/newlib/libc/include/sched.h
old new 1 #ifndef _SCHED_H_2 #define _SCHED_H_3 4 #ifdef __cplusplus5 extern "C" {6 #endif7 8 #include <sys/sched.h>9 10 #ifdef __cplusplus11 }12 #endif13 14 #endif /* _SCHED_H_ */ -
newlib/libc/include/stdint.h
diff -Naur newlib-1.17.0.orig/newlib/libc/include/stdint.h newlib-1.17.0/newlib/libc/include/stdint.h
old new 475 475 #define UINTMAX_C(x) x##UL 476 476 #endif 477 477 478 #ifdef __rtems__ 479 #include <machine/stdint.h> 480 #endif 478 481 479 482 #ifdef __cplusplus 480 483 } -
newlib/libc/include/sys/_types.h
diff -Naur newlib-1.17.0.orig/newlib/libc/include/sys/_types.h newlib-1.17.0/newlib/libc/include/sys/_types.h
old new 84 84 typedef void *_iconv_t; 85 85 #endif 86 86 87 typedef long * __intptr_t; 88 typedef unsigned long* __uintptr_t; 89 87 90 #endif /* _SYS__TYPES_H */ -
newlib/libc/machine/arm/machine/endian.h
diff -Naur newlib-1.17.0.orig/newlib/libc/machine/arm/machine/endian.h newlib-1.17.0/newlib/libc/machine/arm/machine/endian.h
old new 1 /* ARM configuration file */2 3 #ifndef _MACHINE_ENDIAN_H4 # define _MACHINE_ENDIAN_H5 6 #ifdef __ARMEB__7 #define BYTE_ORDER BIG_ENDIAN8 #else9 #define BYTE_ORDER LITTLE_ENDIAN10 #endif11 12 #endif -
newlib/libc/machine/lm32/configure
diff -Naur newlib-1.17.0.orig/newlib/libc/machine/lm32/configure newlib-1.17.0/newlib/libc/machine/lm32/configure
old new 271 271 PACKAGE_STRING='newlib 1.17.0' 272 272 PACKAGE_BUGREPORT='' 273 273 274 ac_unique_file="setjmp. s"274 ac_unique_file="setjmp.S" 275 275 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAY_SUPPLY_SYSCALLS_TRUE MAY_SUPPLY_SYSCALLS_FALSE newlib_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB READELF ac_ct_READELF MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CCAS CCASFLAGS NEWLIB_CFLAGS LDFLAGS ELIX_LEVEL_0_TRUE ELIX_LEVEL_0_FALSE ELIX_LEVEL_1_TRUE ELIX_LEVEL_1_FALSE ELIX_LEVEL_2_TRUE ELIX_LEVEL_2_FALSE ELIX_LEVEL_3_TRUE ELIX_LEVEL_3_FALSE ELIX_LEVEL_4_TRUE ELIX_LEVEL_4_FALSE USE_LIBTOOL_TRUE USE_LIBTOOL_FALSE OBJEXT oext aext lpfx libm_machine_dir machine_dir sys_dir LIBOBJS LTLIBOBJS' 276 276 ac_subst_files='' 277 277 -
newlib/libc/machine/lm32/configure.in
diff -Naur newlib-1.17.0.orig/newlib/libc/machine/lm32/configure.in newlib-1.17.0/newlib/libc/machine/lm32/configure.in
old new 3 3 4 4 AC_PREREQ(2.59) 5 5 AC_INIT([newlib],[NEWLIB_VERSION]) 6 AC_CONFIG_SRCDIR([setjmp. s])6 AC_CONFIG_SRCDIR([setjmp.S]) 7 7 8 8 dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. 9 9 AC_CONFIG_AUX_DIR(../../../..) -
newlib/libc/machine/powerpc/Makefile.am
diff -Naur newlib-1.17.0.orig/newlib/libc/machine/powerpc/Makefile.am newlib-1.17.0/newlib/libc/machine/powerpc/Makefile.am
old new 10 10 11 11 AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib 12 12 13 lib_a_SOURCES = setjmp.S times.c13 lib_a_SOURCES = setjmp.S 14 14 lib_a_CCASFLAGS=$(AM_CCASFLAGS) 15 15 lib_a_CFLAGS=$(AM_CFLAGS) 16 16 lib_a_LIBADD = @extra_objs@ -
newlib/libc/machine/powerpc/Makefile.in
diff -Naur newlib-1.17.0.orig/newlib/libc/machine/powerpc/Makefile.in newlib-1.17.0/newlib/libc/machine/powerpc/Makefile.in
old new 39 39 DIST_COMMON = $(srcdir)/../../../../config.guess \ 40 40 $(srcdir)/../../../../config.sub $(srcdir)/Makefile.in \ 41 41 $(srcdir)/Makefile.am $(top_srcdir)/configure \ 42 $(am__configure_deps) $(srcdir)/../../../../mkinstalldirs \ 43 $(srcdir)/../../../../compile 42 $(am__configure_deps) $(srcdir)/../../../../mkinstalldirs 44 43 subdir = . 45 44 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 46 45 am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \ … … 54 53 LIBRARIES = $(noinst_LIBRARIES) 55 54 ARFLAGS = cru 56 55 lib_a_AR = $(AR) $(ARFLAGS) 57 am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-times.$(OBJEXT)56 am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) 58 57 lib_a_OBJECTS = $(am_lib_a_OBJECTS) 59 58 DEFAULT_INCLUDES = -I. -I$(srcdir) 60 59 depcomp = … … 128 127 USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@ 129 128 USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@ 130 129 VERSION = @VERSION@ 131 ac_ct_AR = @ac_ct_AR@132 ac_ct_AS = @ac_ct_AS@133 ac_ct_RANLIB = @ac_ct_RANLIB@134 ac_ct_READELF = @ac_ct_READELF@135 ac_ct_STRIP = @ac_ct_STRIP@136 130 aext = @aext@ 137 131 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ 138 132 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ … … 148 142 build_os = @build_os@ 149 143 build_vendor = @build_vendor@ 150 144 datadir = @datadir@ 145 datarootdir = @datarootdir@ 146 docdir = @docdir@ 147 dvidir = @dvidir@ 151 148 exec_prefix = @exec_prefix@ 152 149 extra_objs = @extra_objs@ 153 150 extra_sources = @extra_sources@ … … 156 153 host_cpu = @host_cpu@ 157 154 host_os = @host_os@ 158 155 host_vendor = @host_vendor@ 156 htmldir = @htmldir@ 159 157 includedir = @includedir@ 160 158 infodir = @infodir@ 161 159 install_sh = @install_sh@ 162 160 libdir = @libdir@ 163 161 libexecdir = @libexecdir@ 164 162 libm_machine_dir = @libm_machine_dir@ 163 localedir = @localedir@ 165 164 localstatedir = @localstatedir@ 166 165 lpfx = @lpfx@ 167 166 machine_dir = @machine_dir@ … … 170 169 newlib_basedir = @newlib_basedir@ 171 170 oext = @oext@ 172 171 oldincludedir = @oldincludedir@ 172 pdfdir = @pdfdir@ 173 173 prefix = @prefix@ 174 174 program_transform_name = @program_transform_name@ 175 psdir = @psdir@ 175 176 sbindir = @sbindir@ 176 177 sharedstatedir = @sharedstatedir@ 177 178 sys_dir = @sys_dir@ … … 182 183 AM_CCASFLAGS = $(INCLUDES) 183 184 noinst_LIBRARIES = lib.a 184 185 AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib 185 lib_a_SOURCES = setjmp.S times.c186 lib_a_SOURCES = setjmp.S 186 187 lib_a_CCASFLAGS = $(AM_CCASFLAGS) 187 188 lib_a_CFLAGS = $(AM_CFLAGS) 188 189 lib_a_LIBADD = @extra_objs@ … … 193 194 all: all-am 194 195 195 196 .SUFFIXES: 196 .SUFFIXES: .S . c .o .obj197 .SUFFIXES: .S .o .obj 197 198 am--refresh: 198 199 @: 199 200 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) … … 252 253 253 254 lib_a-setjmp.obj: setjmp.S 254 255 $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else $(CYGPATH_W) '$(srcdir)/setjmp.S'; fi` 255 256 .c.o:257 $(COMPILE) -c $<258 259 .c.obj:260 $(COMPILE) -c `$(CYGPATH_W) '$<'`261 262 lib_a-times.o: times.c263 $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-times.o `test -f 'times.c' || echo '$(srcdir)/'`times.c264 265 lib_a-times.obj: times.c266 $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi`267 256 uninstall-info-am: 268 257 269 258 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) -
newlib/libc/machine/powerpc/times.c
diff -Naur newlib-1.17.0.orig/newlib/libc/machine/powerpc/times.c newlib-1.17.0/newlib/libc/machine/powerpc/times.c
old new 1 /* Time support routines for PowerPC.2 *3 * Written by Aldy Hernandez.4 */5 6 #include <_ansi.h>7 #include <reent.h>8 #include <sys/time.h>9 #include <sys/times.h>10 #include <sys/resource.h>11 12 clock_t13 times (struct tms *tp)14 {15 struct rusage usage;16 union {17 struct rusage r;18 /* Newlib's rusage has only 2 fields. We need to make room for19 when we call the system's rusage. This should be enough. */20 int filler[32];21 } host_ru;22 23 getrusage (RUSAGE_SELF, (void *)&host_ru);24 25 if (tp)26 {27 tp->tms_utime = host_ru.r.ru_utime.tv_sec * 100028 + host_ru.r.ru_utime.tv_usec;29 tp->tms_stime = host_ru.r.ru_stime.tv_sec * 100030 + host_ru.r.ru_stime.tv_usec;31 tp->tms_cutime = 0; /* user time, children */32 tp->tms_cstime = 0; /* system time, children */33 }34 35 return tp->tms_utime;36 } -
newlib/libc/stdlib/assert.c
diff -Naur newlib-1.17.0.orig/newlib/libc/stdlib/assert.c newlib-1.17.0/newlib/libc/stdlib/assert.c
old new 47 47 #include <stdlib.h> 48 48 #include <stdio.h> 49 49 50 #if !defined(__rtems__) 51 /* RTEMS has a version of its own */ 52 50 53 /* func can be NULL, in which case no function information is given. */ 51 54 void 52 55 _DEFUN (__assert_func, (file, line, func, failedexpr), … … 62 65 abort(); 63 66 /* NOTREACHED */ 64 67 } 68 #endif 65 69 66 70 void 67 71 _DEFUN (__assert, (file, line, failedexpr), -
newlib/libc/sys/rtems/crt0.c
diff -Naur newlib-1.17.0.orig/newlib/libc/sys/rtems/crt0.c newlib-1.17.0/newlib/libc/sys/rtems/crt0.c
old new 84 84 int _execve(const char *path, char * const *argv, char * const *envp) { return -1; } 85 85 int _exit(int status) { return -1; } 86 86 87 /* stubs for functions required by libc/stdlib */ 88 void __assert_func(const char *file, int line, const char *failedexpr) {} 89 87 90 /* gcc can implicitly generate references to these */ 88 91 /* strcmp() {} */ 89 92 /* strcpy() {} */ -
newlib/libc/sys/rtems/machine/stdint.h
diff -Naur newlib-1.17.0.orig/newlib/libc/sys/rtems/machine/stdint.h newlib-1.17.0/newlib/libc/sys/rtems/machine/stdint.h
old new 1 /* 2 * 3 */ 4 #ifndef _MACHINE_STDINT_H 5 #define _MACHINE_STDINT_H 6 7 #ifndef _STDINT_H 8 #error machine/stdint.h is an internal file and must not be directly included 9 #endif 10 11 #ifndef __rtems__ 12 #error machine/stdint.h is an RTEMS specific internal file and must not be used otherwise 13 #endif 14 15 #if defined(__m32c__) || defined(__m32r__) || defined(__lm32__) 16 #if (__SIZEOF_PTRDIFF_T__ == __SIZEOF_LONG__) 17 #define __ptrint_t_long_defined 1 18 #endif 19 #if (__SIZEOF_PTRDIFF_T__ == __SIZEOF_INT__) 20 #define __ptrint_t_int_defined 1 21 #endif 22 #endif 23 24 #if defined(__sparc__) \ 25 || defined(__powerpc__) || defined(__PPC__) \ 26 || defined(__mips__) \ 27 || defined(__sh__) \ 28 || defined(__AVR__) \ 29 || defined(_C4x) || defined(_C3x) \ 30 || defined(__H8300__) 31 /* PTRDIFF_TYPE = int */ 32 #define __ptrint_t_int_defined 1 33 #endif 34 35 #if defined(__i386__) \ 36 || defined(__m68k__) \ 37 || defined(__bfin__) \ 38 || defined(__arm__) \ 39 || defined(__H8300S__) || defined(__H8300H__) || defined(__H8300SX__) \ 40 /* PTRDIFF_TYPE = long */ 41 #define __ptrint_t_long_defined 1 42 #endif 43 44 #if !defined(__ptrint_t_int_defined) && !defined(__ptrint_t_long_defined) 45 #error Failed to determine ptrint_t 46 #endif 47 48 #endif -
newlib/libc/sys/rtems/sys/param.h
diff -Naur newlib-1.17.0.orig/newlib/libc/sys/rtems/sys/param.h newlib-1.17.0/newlib/libc/sys/rtems/sys/param.h
old new 15 15 * 2. Redistributions in binary form must reproduce the above copyright 16 16 * notice, this list of conditions and the following disclaimer in the 17 17 * documentation and/or other materials provided with the distribution. 18 * 3. All advertising materials mentioning features or use of this software19 * must display the following acknowledgement:20 * This product includes software developed by the University of21 * California, Berkeley and its contributors.22 18 * 4. Neither the name of the University nor the names of its contributors 23 19 * may be used to endorse or promote products derived from this software 24 20 * without specific prior written permission. … … 47 43 #include <sys/config.h> 48 44 #include <machine/endian.h> 49 45 50 # define HZ (60)51 46 # define PATHSIZE (1024) 52 47 53 48 /* end of from newlib's <sys/param.h> */ … … 86 81 #define MAXHOSTNAMELEN 256 /* max hostname size */ 87 82 88 83 /* More types and definitions used throughout the kernel. */ 89 #if def KERNEL84 #if defined(KERNEL) || defined(_KERNEL) 90 85 #include <sys/cdefs.h> 91 86 #include <sys/errno.h> 92 87 #include <sys/time.h> 93 88 #include <sys/resource.h> 94 #include <sys/ucred.h>95 89 #include <sys/uio.h> 90 #include <sys/priority.h> 96 91 97 92 #ifndef FALSE 98 93 #define FALSE 0 … … 109 104 #include <machine/param.h> 110 105 #include <machine/limits.h> 111 106 112 /*113 * Priorities. Note that with 32 run queues, differences less than 4 are114 * insignificant.115 */116 #define PSWP 0117 #define PVM 4118 #define PINOD 8119 #define PRIBIO 16120 #define PVFS 20121 #define PZERO 22 /* No longer magic, shouldn't be here. XXX */122 #define PSOCK 24123 #define PWAIT 32124 #define PLOCK 36125 #define PPAUSE 40126 #define PUSER 50127 #define MAXPRI 127 /* Priorities range from 0 through MAXPRI. */128 129 107 #define PRIMASK 0x0ff 130 108 #define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */ 131 109 … … 136 114 #define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */ 137 115 #define NODEV (dev_t)(-1) /* non-existent device */ 138 116 139 /*140 * Clustering of hardware pages on machines with ridiculously small141 * page sizes is done here. The paging subsystem deals with units of142 * CLSIZE pte's describing PAGE_SIZE (from machine/machparam.h) pages each.143 */144 #if 0145 #define CLBYTES (CLSIZE*PAGE_SIZE)146 #endif147 148 117 #define CBLOCK 128 /* Clist block size, must be a power of 2. */ 149 118 #define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */ 150 119 /* Data chars/clist. */ … … 200 169 #define powerof2(x) ((((x)-1)&(x))==0) 201 170 202 171 /* Macros for min/max. */ 203 #if ndef KERNEL172 #if !(defined(KERNEL) || defined(_KERNEL)) 204 173 #define MIN(a,b) (((a)<(b))?(a):(b)) 205 174 #define MAX(a,b) (((a)>(b))?(a):(b)) 206 175 #endif -
newlib/libc/unix/Makefile.am
diff -Naur newlib-1.17.0.orig/newlib/libc/unix/Makefile.am newlib-1.17.0/newlib/libc/unix/Makefile.am
old new 12 12 13 13 ## Distinguish different EL/IX level interfaces 14 14 ELIX_2_SOURCES = \ 15 ttyname.c 15 ttyname.c \ 16 ttyname_r.c 16 17 17 18 ELIX_4_SOURCES = \ 18 19 basename.c \ -
newlib/libc/unix/Makefile.in
diff -Naur newlib-1.17.0.orig/newlib/libc/unix/Makefile.in newlib-1.17.0/newlib/libc/unix/Makefile.in
old new 59 59 lib_a_LIBADD = 60 60 am__objects_1 = lib_a-getcwd.$(OBJEXT) lib_a-pread.$(OBJEXT) \ 61 61 lib_a-pwrite.$(OBJEXT) lib_a-sigset.$(OBJEXT) 62 am__objects_2 = lib_a-ttyname.$(OBJEXT) 62 am__objects_2 = lib_a-ttyname.$(OBJEXT) lib_a-ttyname_r.$(OBJEXT) 63 63 am__objects_3 = lib_a-basename.$(OBJEXT) lib_a-dirname.$(OBJEXT) \ 64 64 lib_a-getlogin.$(OBJEXT) lib_a-getpass.$(OBJEXT) \ 65 65 lib_a-getpwent.$(OBJEXT) lib_a-getut.$(OBJEXT) … … 74 74 LTLIBRARIES = $(noinst_LTLIBRARIES) 75 75 libunix_la_LIBADD = 76 76 am__objects_5 = getcwd.lo pread.lo pwrite.lo sigset.lo 77 am__objects_6 = ttyname.lo 77 am__objects_6 = ttyname.lo ttyname_r.lo 78 78 am__objects_7 = basename.lo dirname.lo getlogin.lo getpass.lo \ 79 79 getpwent.lo getut.lo 80 80 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_8 = $(am__objects_6) \ … … 278 278 sigset.c 279 279 280 280 ELIX_2_SOURCES = \ 281 ttyname.c 281 ttyname.c \ 282 ttyname_r.c 282 283 283 284 ELIX_4_SOURCES = \ 284 285 basename.c \ … … 402 403 lib_a-ttyname.obj: ttyname.c 403 404 $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ttyname.obj `if test -f 'ttyname.c'; then $(CYGPATH_W) 'ttyname.c'; else $(CYGPATH_W) '$(srcdir)/ttyname.c'; fi` 404 405 406 lib_a-ttyname_r.o: ttyname_r.c 407 $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ttyname_r.o `test -f 'ttyname_r.c' || echo '$(srcdir)/'`ttyname_r.c 408 409 lib_a-ttyname_r.obj: ttyname_r.c 410 $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ttyname_r.obj `if test -f 'ttyname_r.c'; then $(CYGPATH_W) 'ttyname_r.c'; else $(CYGPATH_W) '$(srcdir)/ttyname_r.c'; fi` 411 405 412 lib_a-basename.o: basename.c 406 413 $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-basename.o `test -f 'basename.c' || echo '$(srcdir)/'`basename.c 407 414 -
newlib/libc/unix/ttyname.c
diff -Naur newlib-1.17.0.orig/newlib/libc/unix/ttyname.c newlib-1.17.0/newlib/libc/unix/ttyname.c
old new 28 28 * SUCH DAMAGE. 29 29 */ 30 30 31 #include <sys/types.h> 32 #include <sys/stat.h> 33 #include <fcntl.h> 31 #include "ttyname.h" 32 34 33 #include <dirent.h> 35 34 #include <unistd.h> 36 #include <string.h>37 35 #include <paths.h> 38 #include <_syslist.h>39 36 #include <errno.h> 40 37 41 static char ttyname_buf[sizeof (_PATH_DEV) + MAXNAMLEN] = _PATH_DEV; 42 43 /* 44 * ttyname_r() - POSIX 1003.1b 4.7.2 - Determine Terminal Device Name 45 */ 46 int 47 _DEFUN( ttyname_r,(fd, name, namesize), 48 int fd _AND 49 char *name _AND 50 size_t namesize) 51 { 52 struct stat sb; 53 struct dirent *dirp; 54 DIR *dp; 55 struct stat dsb; 56 char buf[sizeof(ttyname_buf)]; 57 58 /* Must be a terminal. */ 59 if (!isatty(fd)) 60 return ENOTTY; 61 62 /* Must be a character device. */ 63 if (fstat (fd, &sb) || !S_ISCHR (sb.st_mode)) 64 return ENOTTY; 65 66 if ((dp = opendir (_PATH_DEV)) == NULL) 67 return EBADF; 68 69 strcpy(buf, _PATH_DEV); 70 while ((dirp = readdir (dp)) != NULL) 71 { 72 if (dirp->d_ino != sb.st_ino) 73 continue; 74 strcpy (buf + sizeof (_PATH_DEV) - 1, dirp->d_name); 75 if (stat (buf, &dsb) || sb.st_dev != dsb.st_dev || 76 sb.st_ino != dsb.st_ino) 77 continue; 78 (void) closedir (dp); 79 if(strlen(buf) < namesize) /* < to account for terminating null */ 80 { 81 strcpy(name, buf); 82 return 0; 83 } 84 else 85 { 86 return ERANGE; 87 } 88 } 89 (void) closedir (dp); 90 return EBADF; 91 } 38 static char ttyname_buf[TTYNAME_BUFSIZE] = _PATH_DEV; 92 39 93 40 /* 94 41 * ttyname() - POSIX 1003.1b 4.7.2 - Determine Terminal Device Name -
newlib/libc/unix/ttyname.h
diff -Naur newlib-1.17.0.orig/newlib/libc/unix/ttyname.h newlib-1.17.0/newlib/libc/unix/ttyname.h
old new 1 /* Common defines for ttyname.c and ttyname_r.c */ 2 3 #include <dirent.h> /* For MAXNAMLEN */ 4 #include <paths.h> /* For _PATH_DEV */ 5 6 #define TTYNAME_BUFSIZE (sizeof (_PATH_DEV) + MAXNAMLEN) -
newlib/libc/unix/ttyname_r.c
diff -Naur newlib-1.17.0.orig/newlib/libc/unix/ttyname_r.c newlib-1.17.0/newlib/libc/unix/ttyname_r.c
old new 1 #ifndef _NO_TTYNAME 2 /* 3 * Copyright (c) 1988 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 4. Neither the name of the University nor the names of its contributors 15 * may be used to endorse or promote products derived from this software 16 * without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30 31 #include "ttyname.h" 32 33 #include <sys/types.h> 34 #include <sys/stat.h> 35 #include <fcntl.h> 36 #include <dirent.h> 37 #include <unistd.h> 38 #include <string.h> 39 #include <paths.h> 40 #include <_syslist.h> 41 #include <errno.h> 42 43 /* 44 * ttyname_r() - POSIX 1003.1b 4.7.2 - Determine Terminal Device Name 45 */ 46 int 47 _DEFUN( ttyname_r,(fd, name, namesize), 48 int fd _AND 49 char *name _AND 50 size_t namesize) 51 { 52 struct stat sb; 53 struct dirent *dirp; 54 DIR *dp; 55 struct stat dsb; 56 char buf[TTYNAME_BUFSIZE]; 57 58 /* Must be a terminal. */ 59 if (!isatty(fd)) 60 return ENOTTY; 61 62 /* Must be a character device. */ 63 if (fstat (fd, &sb) || !S_ISCHR (sb.st_mode)) 64 return ENOTTY; 65 66 if ((dp = opendir (_PATH_DEV)) == NULL) 67 return EBADF; 68 69 strcpy(buf, _PATH_DEV); 70 while ((dirp = readdir (dp)) != NULL) 71 { 72 if (dirp->d_ino != sb.st_ino) 73 continue; 74 strcpy (buf + sizeof (_PATH_DEV) - 1, dirp->d_name); 75 if (stat (buf, &dsb) || sb.st_dev != dsb.st_dev || 76 sb.st_ino != dsb.st_ino) 77 continue; 78 (void) closedir (dp); 79 if(strlen(buf) < namesize) /* < to account for terminating null */ 80 { 81 strcpy(name, buf); 82 return 0; 83 } 84 else 85 { 86 return ERANGE; 87 } 88 } 89 (void) closedir (dp); 90 return EBADF; 91 } 92 93 #endif /* !_NO_TTYNAME */ -
newlib/Makefile.am
diff -Naur newlib-1.17.0.orig/newlib/Makefile.am newlib-1.17.0/newlib/Makefile.am
old new 81 81 libc.a 82 82 endif 83 83 84 noinst_DATA= stmp-targ-include84 BUILT_SOURCES = stmp-targ-include 85 85 86 86 toollib_DATA = $(CRT0) $(CRT1) 87 87 … … 186 186 187 187 $(CRT1_DIR)$(CRT1): ; @true 188 188 189 190 all-recursive: stmp-targ-include191 192 189 # The targ-include directory just holds the includes files for the 193 190 # particular system and machine we have been configured for. It is 194 191 # used while building. -
newlib/Makefile.in
diff -Naur newlib-1.17.0.orig/newlib/Makefile.in newlib-1.17.0/newlib/Makefile.in
old new 106 106 pdf-recursive ps-recursive uninstall-info-recursive \ 107 107 uninstall-recursive 108 108 toollibDATA_INSTALL = $(INSTALL_DATA) 109 DATA = $( noinst_DATA) $(toollib_DATA)109 DATA = $(toollib_DATA) 110 110 ETAGS = etags 111 111 CTAGS = ctags 112 112 DEJATOOL = $(PACKAGE) … … 350 350 @USE_LIBTOOL_FALSE@toollib_LIBRARIES = libm.a \ 351 351 @USE_LIBTOOL_FALSE@ libc.a 352 352 353 noinst_DATA= stmp-targ-include353 BUILT_SOURCES = stmp-targ-include 354 354 toollib_DATA = $(CRT0) $(CRT1) 355 355 356 356 # The functions ldexp, frexp and modf are traditionally supplied in … … 409 409 410 410 # dejagnu support 411 411 RUNTESTFLAGS = 412 all: newlib.h412 all: $(BUILT_SOURCES) newlib.h 413 413 $(MAKE) $(AM_MAKEFLAGS) all-recursive 414 414 415 415 .SUFFIXES: … … 714 714 done 715 715 check-am: 716 716 $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU 717 check: check-recursive 717 check: $(BUILT_SOURCES) 718 $(MAKE) $(AM_MAKEFLAGS) check-recursive 718 719 all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) newlib.h 719 720 installdirs: installdirs-recursive 720 721 installdirs-am: 721 722 for dir in "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)"; do \ 722 723 test -z "$$dir" || $(mkdir_p) "$$dir"; \ 723 724 done 724 install: install-recursive 725 install: $(BUILT_SOURCES) 726 $(MAKE) $(AM_MAKEFLAGS) install-recursive 725 727 install-exec: install-exec-recursive 726 728 install-data: install-data-recursive 727 729 uninstall: uninstall-recursive … … 746 748 maintainer-clean-generic: 747 749 @echo "This command is intended for maintainers to use" 748 750 @echo "it deletes files that may require special tools to rebuild." 751 -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) 749 752 clean: clean-recursive 750 753 751 754 clean-am: clean-generic clean-libtool clean-toollibLIBRARIES \ … … 864 867 865 868 $(CRT1_DIR)$(CRT1): ; @true 866 869 867 all-recursive: stmp-targ-include868 869 870 # The targ-include directory just holds the includes files for the 870 871 # particular system and machine we have been configured for. It is 871 872 # used while building.
Note: See TracBrowser
for help on using the repository browser.