Created
March 10, 2015 11:21
-
-
Save alban/8aac83d4acb2cc9e022a to your computer and use it in GitHub Desktop.
rename.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE /* See feature_test_macros(7) */ | |
#include <unistd.h> | |
#include <sys/syscall.h> /* For SYS_xxx definitions */ | |
#include <stdio.h> | |
#include <fcntl.h> /* Definition of AT_* constants */ | |
#include <stdio.h> | |
int main() | |
{ | |
//renameat2(AT_FDCWD, "/tmp/aaa", AT_FDCWD, "/tmp/bbb", 1); | |
#define RENAME_NOREPLACE (1 << 0) | |
#define __NR_renameat2 316 | |
return syscall(__NR_renameat2, AT_FDCWD, "/home/alban/debian-tree/var/lib/machines/a", AT_FDCWD, "/home/alban/debian-tree/var/lib/machines/b", RENAME_NOREPLACE); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment