ab917ae5af
* 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.
17 lines
258 B
C
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;
|
|
}
|