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