source: rtems/cpukit/libcsupport/src/_rename_r.c @ 4779963

4.104.114.95
Last change on this file since 4779963 was 4779963, checked in by Joel Sherrill <joel.sherrill@…>, on 12/28/07 at 18:55:31

2007-12-28 Joel Sherrill <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.
  • Property mode set to 100644
File size: 695 bytes
Line 
1/*
2 *  _rename_r() - POSIX 1003.1b - 5.3.4 - Rename a file
3 *
4 *  COPYRIGHT (c) 1989-2007.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <stdio.h>
19#include <reent.h>
20
21#include <rtems.h>
22#include <rtems/libio.h>
23#include <errno.h>
24
25#include <rtems/libio_.h>
26#include <rtems/seterr.h>
27
28int _rename_r(
29  struct _reent *ptr,
30  const char    *old,
31  const char    *new
32)
33{
34  int s;
35
36  s = link( old, new );
37  if ( !s )
38    return s;
39  return unlink( old );
40}
Note: See TracBrowser for help on using the repository browser.