From 477996368827f818daf6a9dcf9de2d3e8d875fe4 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 28 Dec 2007 18:55:31 +0000 Subject: 2007-12-28 Joel Sherrill * libcsupport/Makefile.am: _rename_r is required by newlib 1.16.0. Hopefully this implementation is OK. * libcsupport/src/_rename_r.c: New file. --- cpukit/libcsupport/src/_rename_r.c | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 cpukit/libcsupport/src/_rename_r.c (limited to 'cpukit/libcsupport/src/_rename_r.c') diff --git a/cpukit/libcsupport/src/_rename_r.c b/cpukit/libcsupport/src/_rename_r.c new file mode 100644 index 0000000000..b0a636f468 --- /dev/null +++ b/cpukit/libcsupport/src/_rename_r.c @@ -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 +#include + +#include +#include +#include + +#include +#include + +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 ); +} -- cgit v1.2.3