1 #include "tests.h" 2 #include <asm/unistd.h> 3 4 #ifdef __NR_renameat 5 6 # include <stdio.h> 7 # include <unistd.h> 8 9 # define OLD_FILE "renameat_old" 10 # define NEW_FILE "renameat_new" 11 12 int 13 main(void) 14 { 15 const long int fd_old = (long int) 0xdeadbeefffffffffULL; 16 const long int fd_new = (long int) 0xdeadbeeffffffffeULL; 17 18 long rc = syscall(__NR_renameat, fd_old, OLD_FILE, fd_new, NEW_FILE); 19 printf("renameat(%d, \"%s\", %d, \"%s\") = %ld %s (%m)\n", 20 (int) fd_old, OLD_FILE, (int) fd_new, NEW_FILE, 21 rc, errno2name()); 22 23 puts("+++ exited with 0 +++"); 24 return 0; 25 } 26 27 #else 28 29 SKIP_MAIN_UNDEFINED("__NR_renameat") 30 31 #endif 32