1 /* Reentrant version of rename system call. */
9 /* Some targets provides their own versions of these functions. Those
10 targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
13 #ifndef REENTRANT_SYSCALLS_PROVIDED
14 #define REENTRANT_SYSCALLS_PROVIDED
18 #ifndef REENTRANT_SYSCALLS_PROVIDED
20 /* We use the errno variable used by the system dependent layer. */
26 <<_rename_r>>---Reentrant version of rename
33 int _rename_r(struct _reent *<[ptr]>,
34 const char *<[old]>, const char *<[new]>);
37 This is a reentrant version of <<rename>>. It
38 takes a pointer to the global data block, which holds
43 _rename_r (struct _reent
*ptr
,
51 if ((ret
= _rename (old
, new)) == -1 && errno
!= 0)
52 _REENT_ERRNO(ptr
) = errno
;
54 if (_link_r (ptr
, old
, new) == -1)
57 if (_unlink_r (ptr
, old
) == -1)
59 /* ??? Should we unlink new? (rhetorical question) */
66 #endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */