Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@embecosm.com>2003-07-10 19:31:30 +0400
committerJoern Rennecke <joern.rennecke@embecosm.com>2003-07-10 19:31:30 +0400
commite0bec12f55faa823e3f98375ad4c3e7ed36b6898 (patch)
treeac33522b8af77569c371e8fc8a5a84cd6f067d6d /newlib/libc/sys
parentd53f60a1e41c69b3c33a094f4a1d52aa28de4948 (diff)
* 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.
Diffstat (limited to 'newlib/libc/sys')
-rw-r--r--newlib/libc/sys/sh/Makefile.am2
-rw-r--r--newlib/libc/sys/sh/Makefile.in8
-rw-r--r--newlib/libc/sys/sh/ftruncate.c9
-rw-r--r--newlib/libc/sys/sh/sys/syscall.h3
-rw-r--r--newlib/libc/sys/sh/truncate.c9
5 files changed, 26 insertions, 5 deletions
diff --git a/newlib/libc/sys/sh/Makefile.am b/newlib/libc/sys/sh/Makefile.am
index da89f1198..1fddc4cd2 100644
--- a/newlib/libc/sys/sh/Makefile.am
+++ b/newlib/libc/sys/sh/Makefile.am
@@ -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
diff --git a/newlib/libc/sys/sh/Makefile.in b/newlib/libc/sys/sh/Makefile.in
index 734438b4e..29a0b7a26 100644
--- a/newlib/libc/sys/sh/Makefile.in
+++ b/newlib/libc/sys/sh/Makefile.in
@@ -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)
diff --git a/newlib/libc/sys/sh/ftruncate.c b/newlib/libc/sys/sh/ftruncate.c
new file mode 100644
index 000000000..660377bf3
--- /dev/null
+++ b/newlib/libc/sys/sh/ftruncate.c
@@ -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);
+}
diff --git a/newlib/libc/sys/sh/sys/syscall.h b/newlib/libc/sys/sh/sys/syscall.h
index fd9ee7c51..9ab32e7b7 100644
--- a/newlib/libc/sys/sh/sys/syscall.h
+++ b/newlib/libc/sys/sh/sys/syscall.h
@@ -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
diff --git a/newlib/libc/sys/sh/truncate.c b/newlib/libc/sys/sh/truncate.c
new file mode 100644
index 000000000..5ca48d3c6
--- /dev/null
+++ b/newlib/libc/sys/sh/truncate.c
@@ -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);
+}