forked from Imagelibrary/rtems
2007-12-28 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/Makefile.am: _rename_r is required by newlib 1.16.0. Hopefully this implementation is OK. * libcsupport/src/_rename_r.c: New file.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2007-12-28 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* libcsupport/Makefile.am: _rename_r is required by newlib 1.16.0.
|
||||||
|
Hopefully this implementation is OK.
|
||||||
|
* libcsupport/src/_rename_r.c: New file.
|
||||||
|
|
||||||
2007-12-22 Chris Johns <chrisj@rtems.org>
|
2007-12-22 Chris Johns <chrisj@rtems.org>
|
||||||
|
|
||||||
* configure.ac: fixed bug that always enabled strict order
|
* configure.ac: fixed bug that always enabled strict order
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ SYSTEM_CALL_C_FILES = src/open.c src/close.c src/read.c src/write.c \
|
|||||||
src/unlink.c src/umask.c src/ftruncate.c src/utime.c src/fstat.c \
|
src/unlink.c src/umask.c src/ftruncate.c src/utime.c src/fstat.c \
|
||||||
src/fcntl.c src/fpathconf.c src/getdents.c src/fsync.c src/fdatasync.c \
|
src/fcntl.c src/fpathconf.c src/getdents.c src/fsync.c src/fdatasync.c \
|
||||||
src/pipe.c src/dup.c src/dup2.c src/symlink.c src/readlink.c src/creat.c \
|
src/pipe.c src/dup.c src/dup2.c src/symlink.c src/readlink.c src/creat.c \
|
||||||
src/chroot.c src/sync.c
|
src/chroot.c src/sync.c src/_rename_r.c
|
||||||
|
|
||||||
## Until sys/uio.h is moved to libcsupport, we have to have networking
|
## Until sys/uio.h is moved to libcsupport, we have to have networking
|
||||||
## enabled to compile these. Hopefully this is a temporary situation.
|
## enabled to compile these. Hopefully this is a temporary situation.
|
||||||
|
|||||||
40
cpukit/libcsupport/src/_rename_r.c
Normal file
40
cpukit/libcsupport/src/_rename_r.c
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* _rename_r() - POSIX 1003.1b - 5.3.4 - Rename a file
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-2007.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.rtems.com/license/LICENSE.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <reent.h>
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
#include <rtems/libio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <rtems/libio_.h>
|
||||||
|
#include <rtems/seterr.h>
|
||||||
|
|
||||||
|
int _rename_r(
|
||||||
|
struct _reent *ptr,
|
||||||
|
const char *old,
|
||||||
|
const char *new
|
||||||
|
)
|
||||||
|
{
|
||||||
|
int s;
|
||||||
|
|
||||||
|
s = link( old, new );
|
||||||
|
if ( !s )
|
||||||
|
return s;
|
||||||
|
return unlink( old );
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user