12 fd
= mkstemp("T:lseekXXXXXX");
15 /* Check if F_GETFD and F_SETFD is working */
16 TEST((fcntl(fd
, F_GETFD
) == 0));
17 TEST((fcntl(fd
, F_SETFD
, FD_CLOEXEC
) == 0));
18 TEST((fcntl(fd
, F_GETFD
) == FD_CLOEXEC
));
19 TEST((fcntl(fd
, F_SETFD
, 0) == 0));
20 TEST((fcntl(fd
, F_GETFD
) == 0));
25 /* Check if descriptor flags are independent for duped descriptors */
26 TEST((fcntl(fd2
, F_GETFD
) == 0));
27 TEST((fcntl(fd2
, F_SETFD
, FD_CLOEXEC
) == 0));
28 TEST((fcntl(fd2
, F_GETFD
) == FD_CLOEXEC
));
29 TEST((fcntl(fd
, F_GETFD
) == 0));
30 TEST((fcntl(fd
, F_SETFD
, FD_CLOEXEC
) == 0));
31 TEST((fcntl(fd2
, F_SETFD
, 0) == 0));
32 TEST((fcntl(fd
, F_GETFD
) == FD_CLOEXEC
));