diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2007-09-18 19:32:43 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2007-09-18 19:32:43 +0000 |
commit | 3908c985922d653fa47775dfbf5d2d29ff7c4fa0 (patch) | |
tree | bf5fac0245666188665bcb55719e2000e288ab3f /newlib/libc/stdio/rename.c | |
parent | 4090f565a839d8e846cf9c6249a5ebbfd8ad9790 (diff) | |
download | newlib-3908c985922d653fa47775dfbf5d2d29ff7c4fa0.zip newlib-3908c985922d653fa47775dfbf5d2d29ff7c4fa0.tar.gz newlib-3908c985922d653fa47775dfbf5d2d29ff7c4fa0.tar.bz2 |
2007-09-18 Jeff Johnston <jjohnstn@redhat.com>
* libc/reent/renamer.c: New file.
* libc/reent/Makefile.am: Add new file.
* libc/reent/Makefile.in: Regenerated.
* libc/stdio/rename.c: Break out _rename_r code into reent/renamer.c
and add check for rename syscall.
Diffstat (limited to 'newlib/libc/stdio/rename.c')
-rw-r--r-- | newlib/libc/stdio/rename.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/newlib/libc/stdio/rename.c b/newlib/libc/stdio/rename.c index 4fa8e39..6eb1f7d 100644 --- a/newlib/libc/stdio/rename.c +++ b/newlib/libc/stdio/rename.c @@ -21,27 +21,17 @@ FUNCTION INDEX rename -INDEX - _rename_r ANSI_SYNOPSIS #include <stdio.h> int rename(const char *<[old]>, const char *<[new]>); - int _rename_r(struct _reent *<[reent]>, - const char *<[old]>, const char *<[new]>); - TRAD_SYNOPSIS #include <stdio.h> int rename(<[old]>, <[new]>) char *<[old]>; char *<[new]>; - int _rename_r(<[reent]>, <[old]>, <[new]>) - struct _reent *<[reent]>; - char *<[old]>; - char *<[new]>; - DESCRIPTION Use <<rename>> to establish a new name (the string at <[new]>) for a file now known by the string at <[old]>. After a successful @@ -50,9 +40,6 @@ file now known by the string at <[old]>. After a successful If <<rename>> fails, the file named <<*<[old]>>> is unaffected. The conditions for failure depend on the host operating system. -The alternate function <<_rename_r>> is a reentrant version. The -extra argument <[reent]> is a pointer to a reentrancy structure. - RETURNS The result is either <<0>> (when successful) or <<-1>> (when the file could not be renamed). @@ -70,27 +57,6 @@ Supporting OS subroutines required: <<link>>, <<unlink>>, or <<rename>>. #include <stdio.h> #include <sys/unistd.h> -int -_DEFUN(_rename_r, (ptr, old, new), - struct _reent *ptr _AND - _CONST char *old _AND - _CONST char *new) -{ -#ifdef HAVE_RENAME - return _rename (old,new); -#else - if (_link_r (ptr, old, new) == -1) - return -1; - - if (_unlink_r (ptr, old) == -1) - { - /* ??? Should we unlink new? (rhetorical question) */ - return -1; - } -#endif - return 0; -} - #ifndef _REENT_ONLY int |