blob: 2fb88d64bd16af90f8fb1716b4d1e49104e813ad [file] [log] [blame]
Fei Jiea4128a72016-03-01 16:55:36 +08001#include "tests.h"
2#include <errno.h>
3#include <sys/syscall.h>
4
5#ifdef __NR_rename
6
7# include <stdio.h>
8# include <unistd.h>
9
10# define OLD_FILE "rename_old"
11# define NEW_FILE "rename_new"
12
13int
14main(void)
15{
16 int rc = syscall(__NR_rename, OLD_FILE, NEW_FILE);
17 printf("rename(\"%s\", \"%s\") = %d %s (%m)\n",
18 OLD_FILE, NEW_FILE, rc,
19 errno == ENOSYS ? "ENOSYS" : "ENOENT");
20
21 puts("+++ exited with 0 +++");
22 return 0;
23}
24
25#else
26
27SKIP_MAIN_UNDEFINED("__NR_rename")
28
29#endif