OSDN Git Service

* libc/reent/Makefile.am (lib_a_SOURCES): Added unlinkr.c.
authoraoliva <aoliva>
Wed, 8 Mar 2000 04:01:49 +0000 (04:01 +0000)
committeraoliva <aoliva>
Wed, 8 Mar 2000 04:01:49 +0000 (04:01 +0000)
(CHEWOUT_FILES): Added unlinkr.def.
* libc/reent/Makefile.in: Rebuilt.
* libc/sys.tex: Include unlinkr.def.
* libc/reent/linkr.c (_unlink_r): Moved to...
* libc/reent/unlinkr.c: ... new file.

newlib/ChangeLog
newlib/libc/reent/Makefile.am
newlib/libc/reent/Makefile.in
newlib/libc/reent/linkr.c
newlib/libc/reent/unlinkr.c [new file with mode: 0644]
newlib/libc/sys.tex

index cf16f1d..065694f 100644 (file)
@@ -1,3 +1,12 @@
+Wed Mar  8 00:46:41 2000  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
+
+       * libc/reent/Makefile.am (lib_a_SOURCES): Added unlinkr.c.
+       (CHEWOUT_FILES): Added unlinkr.def.
+       * libc/reent/Makefile.in: Rebuilt.
+       * libc/sys.tex: Include unlinkr.def.
+       * libc/reent/linkr.c (_unlink_r): Moved to...
+       * libc/reent/unlinkr.c: ... new file.
+
 Wed Mar  8 00:43:07 2000  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
 
        * libc/string/Makefile.am (lib_a_SOURCES): Added swab.c.
index 20baf3f..87a847e 100644 (file)
@@ -20,6 +20,7 @@ lib_a_SOURCES = \
        sbrkr.c \
        statr.c \
        timer.c \
+       unlinkr.c \
        writer.c
 
 CHEWOUT_FILES = \
@@ -35,6 +36,7 @@ CHEWOUT_FILES = \
        sbrkr.def \
        statr.def \
        timer.def \
+       unlinkr.def \
        writer.def
 
 SUFFIXES = .def .h
index ad174b1..7c1f931 100644 (file)
@@ -102,6 +102,7 @@ lib_a_SOURCES = \
        sbrkr.c \
        statr.c \
        timer.c \
+       unlinkr.c \
        writer.c
 
 
@@ -118,6 +119,7 @@ CHEWOUT_FILES = \
        sbrkr.def \
        statr.def \
        timer.def \
+       unlinkr.def \
        writer.def
 
 
@@ -139,7 +141,7 @@ LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
 lib_a_LIBADD = 
 lib_a_OBJECTS =  closer.o reent.o impure.o execr.o fstatr.o linkr.o \
-lseekr.o openr.o readr.o signalr.o sbrkr.o statr.o timer.o writer.o
+lseekr.o openr.o readr.o signalr.o sbrkr.o statr.o timer.o unlinkr.o writer.o
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
index a15d223..eda8d03 100644 (file)
@@ -63,40 +63,4 @@ _link_r (ptr, old, new)
   return ret;
 }
 
-/*
-FUNCTION
-       <<_unlink_r>>---Reentrant version of unlink
-       
-INDEX
-       _unlink_r
-
-ANSI_SYNOPSIS
-       #include <reent.h>
-       int _unlink_r(struct _reent *<[ptr]>, const char *<[file]>);
-
-TRAD_SYNOPSIS
-       #include <reent.h>
-       int _unlink_r(<[ptr]>, <[file]>)
-       struct _reent *<[ptr]>;
-       char *<[file]>;
-
-DESCRIPTION
-       This is a reentrant version of <<unlink>>.  It
-       takes a pointer to the global data block, which holds
-       <<errno>>.
-*/
-
-int
-_unlink_r (ptr, file)
-     struct _reent *ptr;
-     _CONST char *file;
-{
-  int ret;
-
-  errno = 0;
-  if ((ret = _unlink (file)) == -1 && errno != 0)
-    ptr->_errno = errno;
-  return ret;
-}
-
 #endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
diff --git a/newlib/libc/reent/unlinkr.c b/newlib/libc/reent/unlinkr.c
new file mode 100644 (file)
index 0000000..dbfc7e6
--- /dev/null
@@ -0,0 +1,59 @@
+/* Reentrant versions of file system calls.  These implementations
+   just call the usual system calls.  */
+
+#include <reent.h>
+#include <unistd.h>
+#include <_syslist.h>
+
+/* Some targets provides their own versions of these functions.  Those
+   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
+
+#ifdef _REENT_ONLY
+#ifndef REENTRANT_SYSCALLS_PROVIDED
+#define REENTRANT_SYSCALLS_PROVIDED
+#endif
+#endif
+
+#ifndef REENTRANT_SYSCALLS_PROVIDED
+
+/* We use the errno variable used by the system dependent layer.  */
+#undef errno
+extern int errno;
+
+/*
+FUNCTION
+       <<_unlink_r>>---Reentrant version of unlink
+       
+INDEX
+       _unlink_r
+
+ANSI_SYNOPSIS
+       #include <reent.h>
+       int _unlink_r(struct _reent *<[ptr]>, const char *<[file]>);
+
+TRAD_SYNOPSIS
+       #include <reent.h>
+       int _unlink_r(<[ptr]>, <[file]>)
+       struct _reent *<[ptr]>;
+       char *<[file]>;
+
+DESCRIPTION
+       This is a reentrant version of <<unlink>>.  It
+       takes a pointer to the global data block, which holds
+       <<errno>>.
+*/
+
+int
+_unlink_r (ptr, file)
+     struct _reent *ptr;
+     _CONST char *file;
+{
+  int ret;
+
+  errno = 0;
+  if ((ret = _unlink (file)) == -1 && errno != 0)
+    ptr->_errno = errno;
+  return ret;
+}
+
+#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
index 44b608b..3182b71 100644 (file)
@@ -326,6 +326,7 @@ library, and achieve reentrancy by using a reserved global data block
 @include reent/statr.def
 @include reent/fstatr.def
 @include reent/linkr.def
+@include reent/unlinkr.def
 @include reent/sbrkr.def
 @up
 @end ignore