Fei Jie | bff70d4 | 2016-04-19 15:38:34 +0800 | [diff] [blame] | 1 | #include "tests.h" |
Dmitry V. Levin | 6a2f43c | 2016-08-09 14:38:29 +0000 | [diff] [blame^] | 2 | #include <asm/unistd.h> |
Fei Jie | bff70d4 | 2016-04-19 15:38:34 +0800 | [diff] [blame] | 3 | |
| 4 | #ifdef __NR_symlinkat |
| 5 | |
Fei Jie | bff70d4 | 2016-04-19 15:38:34 +0800 | [diff] [blame] | 6 | # include <stdio.h> |
| 7 | # include <unistd.h> |
| 8 | |
| 9 | int |
| 10 | main(void) |
| 11 | { |
| 12 | const long int fd = (long int) 0xdeadbeefffffffff; |
| 13 | static const char oldpath[] = "symlink_old"; |
| 14 | static const char newpath[] = "symlink_new"; |
Dmitry V. Levin | 5bc585e | 2016-04-21 21:25:29 +0000 | [diff] [blame] | 15 | |
Fei Jie | bff70d4 | 2016-04-19 15:38:34 +0800 | [diff] [blame] | 16 | long rc = syscall(__NR_symlinkat, oldpath, fd, newpath); |
| 17 | printf("symlinkat(\"%s\", %d, \"%s\") = %ld %s (%m)\n", |
Dmitry V. Levin | 5bc585e | 2016-04-21 21:25:29 +0000 | [diff] [blame] | 18 | oldpath, (int) fd, newpath, rc, errno2name()); |
Fei Jie | bff70d4 | 2016-04-19 15:38:34 +0800 | [diff] [blame] | 19 | |
| 20 | puts("+++ exited with 0 +++"); |
| 21 | return 0; |
| 22 | } |
| 23 | |
| 24 | #else |
| 25 | |
| 26 | SKIP_MAIN_UNDEFINED("__NR_symlinkat") |
| 27 | |
| 28 | #endif |