3 #include <asm/unistd.h>
5 #if defined __NR_dup3 && defined O_CLOEXEC
13 const long int fd_old = (long int) 0xdeadbeefffffffffULL;
14 const long int fd_new = (long int) 0xdeadbeeffffffffeULL;
16 long rc = syscall(__NR_dup3, fd_old, fd_new, O_CLOEXEC);
17 printf("dup3(%d, %d, O_CLOEXEC) = %ld %s (%m)\n",
18 (int) fd_old, (int) fd_new, rc, errno2name());
20 puts("+++ exited with 0 +++");
26 SKIP_MAIN_UNDEFINED("__NR_dup3 && O_CLOEXEC")