strace/tests/dup.c
Fei Jie ab917ae5af tests: add dup.test, dup2.test, and dup3.test
* tests/dup.c: New file.
* tests/dup.test: New test.
* tests/dup2.c: New file.
* tests/dup2.test: New test.
* tests/dup3.c: New file.
* tests/dup3.test: New test.
* tests/.gitignore: Add dup, dup2, and dup3.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Add dup.test, dup2.test, and dup3.test.
2016-03-10 02:41:31 +00:00

17 lines
258 B
C

#include <errno.h>
#include <stdio.h>
#include <unistd.h>
int
main(void)
{
const int fd = -1;
int rc = dup(fd);
printf("dup(%d) = %d %s (%m)\n",
fd, rc,
errno == ENOSYS ? "ENOSYS" : "EBADF");
puts("+++ exited with 0 +++");
return 0;
}