Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #include <stdio.h> |
Rich Felker | dd5f50d | 2014-05-29 21:01:32 -0400 | [diff] [blame] | 2 | #include <fcntl.h> |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 3 | #include "syscall.h" |
| 4 | |
| 5 | int rename(const char *old, const char *new) |
| 6 | { |
Rich Felker | dd5f50d | 2014-05-29 21:01:32 -0400 | [diff] [blame] | 7 | #ifdef SYS_rename |
Rich Felker | aa398f5 | 2011-03-20 00:16:43 -0400 | [diff] [blame] | 8 | return syscall(SYS_rename, old, new); |
Rich Felker | dd5f50d | 2014-05-29 21:01:32 -0400 | [diff] [blame] | 9 | #else |
| 10 | return syscall(SYS_renameat, AT_FDCWD, old, AT_FDCWD, new); |
| 11 | #endif |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 12 | } |