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] add SPU create


Add a SPU creat(). Depends on previous patches for libc/machine/spu/Makefile.am
changes.

2007-06-07 Patrick Mansfield <patmans@us.ibm.com>

	* libc/machine/spu/creat.c: New file copied from libc/posix/creat.c,
	it just calls open with appropriate arguments. 
	* libc/machine/spu/Makefile.am: Add creat.c.
	* libc/machine/spu/Makefile.in: Regenerate.

Index: quilt/newlib/libc/machine/spu/creat.c
===================================================================
--- /dev/null
+++ quilt/newlib/libc/machine/spu/creat.c
@@ -0,0 +1,15 @@
+/* creat() "system call" */
+
+/* copied from libc/posix/creat.c */
+
+/* This is needed by f2c and therefore the SPEC benchmarks.  */
+
+#include <fcntl.h>
+
+int
+_DEFUN(creat, (path, mode),
+       const char *path _AND
+       mode_t mode)
+{
+  return open (path, O_WRONLY | O_CREAT | O_TRUNC, mode);
+}
Index: quilt/newlib/libc/machine/spu/Makefile.am
===================================================================
--- quilt.orig/newlib/libc/machine/spu/Makefile.am
+++ quilt/newlib/libc/machine/spu/Makefile.am
@@ -8,7 +8,7 @@ noinst_LIBRARIES = lib.a
 
 AM_CCASFLAGS = $(INCLUDES)
 
-lib_a_SOURCES = setjmp.S clearerr.c fclose.c feof.c ferror.c fflush.c \
+lib_a_SOURCES = setjmp.S clearerr.c creat.c fclose.c feof.c ferror.c fflush.c \
 	fgetc.c fgetpos.c fgets.c fileno.c fiprintf.c fiscanf.c fopen.c \
 	fprintf.c fputc.c fputs.c fread.c freopen.c fscanf.c fseek.c \
 	fsetpos.c ftell.c fwrite.c getc.c getchar.c gets.c iprintf.c \
Index: quilt/newlib/libc/machine/spu/Makefile.in
===================================================================
--- quilt.orig/newlib/libc/machine/spu/Makefile.in
+++ quilt/newlib/libc/machine/spu/Makefile.in
@@ -80,7 +80,7 @@ DIST_COMMON = $(srcdir)/../../../../conf
 	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
 	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
 	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
-	$(srcdir)/../../../../compile
+	$(srcdir)/../../../../compile $(srcdir)/../../../../compile
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
@@ -96,46 +96,47 @@ ARFLAGS = cru
 lib_a_AR = $(AR) $(ARFLAGS)
 lib_a_LIBADD =
 am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-clearerr.$(OBJEXT) \
-	lib_a-fclose.$(OBJEXT) lib_a-feof.$(OBJEXT) \
-	lib_a-ferror.$(OBJEXT) lib_a-fflush.$(OBJEXT) \
-	lib_a-fgetc.$(OBJEXT) lib_a-fgetpos.$(OBJEXT) \
-	lib_a-fgets.$(OBJEXT) lib_a-fileno.$(OBJEXT) \
-	lib_a-fiprintf.$(OBJEXT) lib_a-fiscanf.$(OBJEXT) \
-	lib_a-fopen.$(OBJEXT) lib_a-fprintf.$(OBJEXT) \
-	lib_a-fputc.$(OBJEXT) lib_a-fputs.$(OBJEXT) \
-	lib_a-fread.$(OBJEXT) lib_a-freopen.$(OBJEXT) \
-	lib_a-fscanf.$(OBJEXT) lib_a-fseek.$(OBJEXT) \
-	lib_a-fsetpos.$(OBJEXT) lib_a-ftell.$(OBJEXT) \
-	lib_a-fwrite.$(OBJEXT) lib_a-getc.$(OBJEXT) \
-	lib_a-getchar.$(OBJEXT) lib_a-gets.$(OBJEXT) \
-	lib_a-iprintf.$(OBJEXT) lib_a-iscanf.$(OBJEXT) \
-	lib_a-memcpy.$(OBJEXT) lib_a-memmove.$(OBJEXT) \
-	lib_a-memset.$(OBJEXT) lib_a-mktemp.$(OBJEXT) \
-	lib_a-perror.$(OBJEXT) lib_a-printf.$(OBJEXT) \
-	lib_a-putc.$(OBJEXT) lib_a-putchar.$(OBJEXT) \
-	lib_a-puts.$(OBJEXT) lib_a-remove.$(OBJEXT) \
-	lib_a-rename.$(OBJEXT) lib_a-rewind.$(OBJEXT) \
-	lib_a-scanf.$(OBJEXT) lib_a-setbuf.$(OBJEXT) \
-	lib_a-setvbuf.$(OBJEXT) lib_a-siprintf.$(OBJEXT) \
-	lib_a-siscanf.$(OBJEXT) lib_a-sleep.$(OBJEXT) \
-	lib_a-sniprintf.$(OBJEXT) lib_a-snprintf.$(OBJEXT) \
-	lib_a-sprintf.$(OBJEXT) lib_a-sscanf.$(OBJEXT) \
-	lib_a-stdio.$(OBJEXT) lib_a-strcat.$(OBJEXT) \
-	lib_a-strchr.$(OBJEXT) lib_a-strcmp.$(OBJEXT) \
-	lib_a-strcpy.$(OBJEXT) lib_a-strcspn.$(OBJEXT) \
-	lib_a-strlen.$(OBJEXT) lib_a-strncat.$(OBJEXT) \
-	lib_a-strncmp.$(OBJEXT) lib_a-strncpy.$(OBJEXT) \
-	lib_a-strpbrk.$(OBJEXT) lib_a-strrchr.$(OBJEXT) \
-	lib_a-strspn.$(OBJEXT) lib_a-strxfrm.$(OBJEXT) \
-	lib_a-tmpfile.$(OBJEXT) lib_a-tmpnam.$(OBJEXT) \
-	lib_a-ungetc.$(OBJEXT) lib_a-usleep.$(OBJEXT) \
-	lib_a-vfiprintf.$(OBJEXT) lib_a-vfiscanf.$(OBJEXT) \
-	lib_a-vfprintf.$(OBJEXT) lib_a-vfscanf.$(OBJEXT) \
-	lib_a-viprintf.$(OBJEXT) lib_a-viscanf.$(OBJEXT) \
-	lib_a-vprintf.$(OBJEXT) lib_a-vscanf.$(OBJEXT) \
-	lib_a-vsiprintf.$(OBJEXT) lib_a-vsiscanf.$(OBJEXT) \
-	lib_a-vsniprintf.$(OBJEXT) lib_a-vsnprintf.$(OBJEXT) \
-	lib_a-vsprintf.$(OBJEXT) lib_a-vsscanf.$(OBJEXT)
+	lib_a-creat.$(OBJEXT) lib_a-fclose.$(OBJEXT) \
+	lib_a-feof.$(OBJEXT) lib_a-ferror.$(OBJEXT) \
+	lib_a-fflush.$(OBJEXT) lib_a-fgetc.$(OBJEXT) \
+	lib_a-fgetpos.$(OBJEXT) lib_a-fgets.$(OBJEXT) \
+	lib_a-fileno.$(OBJEXT) lib_a-fiprintf.$(OBJEXT) \
+	lib_a-fiscanf.$(OBJEXT) lib_a-fopen.$(OBJEXT) \
+	lib_a-fprintf.$(OBJEXT) lib_a-fputc.$(OBJEXT) \
+	lib_a-fputs.$(OBJEXT) lib_a-fread.$(OBJEXT) \
+	lib_a-freopen.$(OBJEXT) lib_a-fscanf.$(OBJEXT) \
+	lib_a-fseek.$(OBJEXT) lib_a-fsetpos.$(OBJEXT) \
+	lib_a-ftell.$(OBJEXT) lib_a-fwrite.$(OBJEXT) \
+	lib_a-getc.$(OBJEXT) lib_a-getchar.$(OBJEXT) \
+	lib_a-gets.$(OBJEXT) lib_a-iprintf.$(OBJEXT) \
+	lib_a-iscanf.$(OBJEXT) lib_a-memcpy.$(OBJEXT) \
+	lib_a-memmove.$(OBJEXT) lib_a-memset.$(OBJEXT) \
+	lib_a-mktemp.$(OBJEXT) lib_a-perror.$(OBJEXT) \
+	lib_a-printf.$(OBJEXT) lib_a-putc.$(OBJEXT) \
+	lib_a-putchar.$(OBJEXT) lib_a-puts.$(OBJEXT) \
+	lib_a-remove.$(OBJEXT) lib_a-rename.$(OBJEXT) \
+	lib_a-rewind.$(OBJEXT) lib_a-scanf.$(OBJEXT) \
+	lib_a-setbuf.$(OBJEXT) lib_a-setvbuf.$(OBJEXT) \
+	lib_a-siprintf.$(OBJEXT) lib_a-siscanf.$(OBJEXT) \
+	lib_a-sleep.$(OBJEXT) lib_a-sniprintf.$(OBJEXT) \
+	lib_a-snprintf.$(OBJEXT) lib_a-sprintf.$(OBJEXT) \
+	lib_a-sscanf.$(OBJEXT) lib_a-stdio.$(OBJEXT) \
+	lib_a-strcat.$(OBJEXT) lib_a-strchr.$(OBJEXT) \
+	lib_a-strcmp.$(OBJEXT) lib_a-strcpy.$(OBJEXT) \
+	lib_a-strcspn.$(OBJEXT) lib_a-strlen.$(OBJEXT) \
+	lib_a-strncat.$(OBJEXT) lib_a-strncmp.$(OBJEXT) \
+	lib_a-strncpy.$(OBJEXT) lib_a-strpbrk.$(OBJEXT) \
+	lib_a-strrchr.$(OBJEXT) lib_a-strspn.$(OBJEXT) \
+	lib_a-strxfrm.$(OBJEXT) lib_a-tmpfile.$(OBJEXT) \
+	lib_a-tmpnam.$(OBJEXT) lib_a-ungetc.$(OBJEXT) \
+	lib_a-usleep.$(OBJEXT) lib_a-vfiprintf.$(OBJEXT) \
+	lib_a-vfiscanf.$(OBJEXT) lib_a-vfprintf.$(OBJEXT) \
+	lib_a-vfscanf.$(OBJEXT) lib_a-viprintf.$(OBJEXT) \
+	lib_a-viscanf.$(OBJEXT) lib_a-vprintf.$(OBJEXT) \
+	lib_a-vscanf.$(OBJEXT) lib_a-vsiprintf.$(OBJEXT) \
+	lib_a-vsiscanf.$(OBJEXT) lib_a-vsniprintf.$(OBJEXT) \
+	lib_a-vsnprintf.$(OBJEXT) lib_a-vsprintf.$(OBJEXT) \
+	lib_a-vsscanf.$(OBJEXT)
 lib_a_OBJECTS = $(am_lib_a_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir)
 depcomp =
@@ -262,7 +263,7 @@ AUTOMAKE_OPTIONS = cygnus
 INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 noinst_LIBRARIES = lib.a
 AM_CCASFLAGS = $(INCLUDES)
-lib_a_SOURCES = setjmp.S clearerr.c fclose.c feof.c ferror.c fflush.c \
+lib_a_SOURCES = setjmp.S clearerr.c creat.c fclose.c feof.c ferror.c fflush.c \
 	fgetc.c fgetpos.c fgets.c fileno.c fiprintf.c fiscanf.c fopen.c \
 	fprintf.c fputc.c fputs.c fread.c freopen.c fscanf.c fseek.c \
 	fsetpos.c ftell.c fwrite.c getc.c getchar.c gets.c iprintf.c \
@@ -355,6 +356,12 @@ lib_a-clearerr.o: clearerr.c
 lib_a-clearerr.obj: clearerr.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-clearerr.obj `if test -f 'clearerr.c'; then $(CYGPATH_W) 'clearerr.c'; else $(CYGPATH_W) '$(srcdir)/clearerr.c'; fi`
 
+lib_a-creat.o: creat.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-creat.o `test -f 'creat.c' || echo '$(srcdir)/'`creat.c
+
+lib_a-creat.obj: creat.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-creat.obj `if test -f 'creat.c'; then $(CYGPATH_W) 'creat.c'; else $(CYGPATH_W) '$(srcdir)/creat.c'; fi`
+
 lib_a-fclose.o: fclose.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fclose.o `test -f 'fclose.c' || echo '$(srcdir)/'`fclose.c
 


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