* libc/include/sys/unistd.h (ftruncate, truncate): Also declare
for __sh__. * libc/sys/sh/Makefile.am (lib_a_SOURCES): Add ftruncate.c and truncate.c. * libc/sys/sh/Makefile.in: Regenerate. * libc/sys/sh/sys/syscall.h: (SYS_truncate, SYS_ftruncate): Define. * libc/sys/sh/ftruncate.c: New file. * libc/sys/sh/truncate.c: Likewise.
This commit is contained in:
		| @@ -1,3 +1,14 @@ | ||||
| 2003-07-10  J"orn Rennecke <joern.rennecke@superh.com> | ||||
|  | ||||
| 	* libc/include/sys/unistd.h (ftruncate, truncate): Also declare | ||||
| 	for __sh__. | ||||
| 	* libc/sys/sh/Makefile.am (lib_a_SOURCES): Add ftruncate.c and | ||||
| 	truncate.c. | ||||
| 	* libc/sys/sh/Makefile.in: Regenerate. | ||||
| 	* libc/sys/sh/sys/syscall.h: (SYS_truncate, SYS_ftruncate): Define. | ||||
| 	* libc/sys/sh/ftruncate.c: New file. | ||||
| 	* libc/sys/sh/truncate.c: Likewise. | ||||
|  | ||||
| 2003-07-09  Alexandre Oliva  <aoliva@redhat.com> | ||||
|  | ||||
| 	* libc/include/math.h (nan, nanf): Update prototype to C99. | ||||
|   | ||||
| @@ -175,15 +175,17 @@ int     _EXFUN(_unlink, (const char *__path )); | ||||
| _READ_WRITE_RETURN_TYPE _EXFUN(_write, (int __fd, const void *__buf, size_t __nbyte )); | ||||
| int     _EXFUN(_execve, (const char *__path, char * const __argv[], char * const __envp[] )); | ||||
|  | ||||
| #if defined(__CYGWIN__) || defined(__rtems__) || defined(__sh__) | ||||
| #if !defined(__INSIDE_CYGWIN__) | ||||
| int     _EXFUN(ftruncate, (int __fd, off_t __length)); | ||||
| int     _EXFUN(truncate, (const char *, off_t __length)); | ||||
| #endif | ||||
| #endif | ||||
| #if defined(__CYGWIN__) || defined(__rtems__) | ||||
| int	_EXFUN(getdtablesize, (void)); | ||||
| int	_EXFUN(setdtablesize, (int)); | ||||
| useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval)); | ||||
| unsigned _EXFUN(usleep, (unsigned int __useconds)); | ||||
| #if !defined(__INSIDE_CYGWIN__) | ||||
| int     _EXFUN(ftruncate, (int __fd, off_t __length)); | ||||
| int     _EXFUN(truncate, (const char *, off_t __length)); | ||||
| #endif | ||||
| #if !(defined  (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) | ||||
| /* winsock[2].h defines as __stdcall, and with int as 2nd arg */ | ||||
|  int	_EXFUN(gethostname, (char *__name, size_t __len)); | ||||
|   | ||||
| @@ -6,7 +6,7 @@ INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) | ||||
|  | ||||
| noinst_LIBRARIES = lib.a | ||||
|  | ||||
| lib_a_SOURCES = syscalls.c trap.S creat.c | ||||
| lib_a_SOURCES = syscalls.c trap.S creat.c ftruncate.c truncate.c | ||||
|  | ||||
| all: crt0.o | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| # Makefile.in generated automatically by automake 1.4 from Makefile.am | ||||
| # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am | ||||
|  | ||||
| # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. | ||||
| # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. | ||||
| # This Makefile.in is free software; the Free Software Foundation | ||||
| # gives unlimited permission to copy and/or distribute it, | ||||
| # with or without modifications, as long as this notice is preserved. | ||||
| @@ -89,7 +89,7 @@ INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) | ||||
|  | ||||
| noinst_LIBRARIES = lib.a | ||||
|  | ||||
| lib_a_SOURCES = syscalls.c trap.S creat.c | ||||
| lib_a_SOURCES = syscalls.c trap.S creat.c ftruncate.c truncate.c | ||||
|  | ||||
| ACLOCAL_AMFLAGS = -I ../../.. | ||||
| CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host | ||||
| @@ -103,7 +103,7 @@ DEFS = @DEFS@ -I. -I$(srcdir) | ||||
| CPPFLAGS = @CPPFLAGS@ | ||||
| LIBS = @LIBS@ | ||||
| lib_a_LIBADD =  | ||||
| lib_a_OBJECTS =  syscalls.o trap.o creat.o | ||||
| lib_a_OBJECTS =  syscalls.o trap.o creat.o ftruncate.o truncate.o | ||||
| CFLAGS = @CFLAGS@ | ||||
| COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||||
| CCLD = $(CC) | ||||
|   | ||||
							
								
								
									
										9
									
								
								newlib/libc/sys/sh/ftruncate.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								newlib/libc/sys/sh/ftruncate.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| #include <_ansi.h> | ||||
| #include <sys/types.h> | ||||
| #include "sys/syscall.h" | ||||
|  | ||||
| int | ||||
| ftruncate (int file, off_t length) | ||||
| { | ||||
|   return __trap34 (SYS_ftruncate, file, length, 0); | ||||
| } | ||||
| @@ -27,6 +27,9 @@ | ||||
| #define	SYS_pipe	42 | ||||
| #define	SYS_execve	59 | ||||
|  | ||||
| #define SYS_truncate	129 | ||||
| #define SYS_ftruncate	130 | ||||
|  | ||||
| #define SYS_argc	172 /* == 0xAC, for Argument Count :-) */ | ||||
| #define SYS_argnlen	173 | ||||
| #define SYS_argn	174 | ||||
|   | ||||
							
								
								
									
										9
									
								
								newlib/libc/sys/sh/truncate.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								newlib/libc/sys/sh/truncate.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| #include <_ansi.h> | ||||
| #include <sys/types.h> | ||||
| #include "sys/syscall.h" | ||||
|  | ||||
| int | ||||
| truncate (const char *path, off_t length) | ||||
| { | ||||
|   return __trap34 (SYS_truncate, path, length, 0); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user