diff options
author | Fei Jie <feij.fnst@cn.fujitsu.com> | 2016-04-06 14:18:49 +0800 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2016-04-06 06:18:49 +0000 |
commit | 41cd6579301a4127b6c291ce0de206c6814304e3 (patch) | |
tree | 75a6398b54f0a72619df7c74c651cbd43048f4ef /tests/unlinkat.c | |
parent | 7a158a18f85d9b45561b7abb40b77002b8df1220 (diff) | |
download | strace-41cd6579301a4127b6c291ce0de206c6814304e3.tar.gz |
tests: add unlinkat.test
* tests/unlinkat.c: New file.
* tests/unlinkat.test: New test.
* tests/.gitignore: Add unlinkat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add unlinkat.test.
Diffstat (limited to 'tests/unlinkat.c')
-rw-r--r-- | tests/unlinkat.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/unlinkat.c b/tests/unlinkat.c new file mode 100644 index 000000000..744d8915c --- /dev/null +++ b/tests/unlinkat.c @@ -0,0 +1,29 @@ +#include "tests.h" +#include <sys/syscall.h> + +#ifdef __NR_unlinkat + +# include <errno.h> +# include <stdio.h> +# include <unistd.h> + +int +main(void) +{ + static const char sample[] = "unlinkat_sample"; + const long fd = (long) 0xdeadbeefffffffff; + + int rc = syscall(__NR_unlinkat, fd, sample, 0); + printf("unlinkat(%d, \"%s\", 0) = %d %s (%m)\n", + (int) fd, sample, rc, + errno == ENOSYS ? "ENOSYS" : "EBADF"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_unlinkat") + +#endif |