-#elif defined F_GETFL
- /* On Unix, the initial state of unassigned standard file descriptors is
- that they are closed. */
- {
- int ret;
- errno = 0;
- ret = fcntl (STDERR_FILENO, F_GETFL);
- switch (atoi (argv[2]))
- {
- case 0:
- /* Expect fd 2 is open. */
- ASSERT (ret >= 0);
- break;
- case 1:
- /* Expect fd 2 is closed. */
- ASSERT (ret < 0);
- ASSERT (errno == EBADF);
- break;
- default:
- ASSERT (false);
- }
- }
-#endif