blob: 04c90c01343a4b84beb5cf56b348e5d5041905ed [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#include <stdio.h>
Rich Felkerdd5f50d2014-05-29 21:01:32 -04002#include <fcntl.h>
Rich Felker0b44a032011-02-12 00:22:29 -05003#include "syscall.h"
4
5int rename(const char *old, const char *new)
6{
Rich Felkerdd5f50d2014-05-29 21:01:32 -04007#ifdef SYS_rename
Rich Felkeraa398f52011-03-20 00:16:43 -04008 return syscall(SYS_rename, old, new);
Rich Felkerdd5f50d2014-05-29 21:01:32 -04009#else
10 return syscall(SYS_renameat, AT_FDCWD, old, AT_FDCWD, new);
11#endif
Rich Felker0b44a032011-02-12 00:22:29 -050012}