8 #include <darwintest.h>
13 T_ASSERT_FAIL("child readv is blocked");
16 T_DECL(pipe_read_infloop_55437634
, "Infinite loop in pipe_read")
22 .iov_len
= 0x100000000UL
28 /* create a pipe with some data in it: */
29 T_ASSERT_POSIX_SUCCESS(pipe(p
), NULL
);
30 T_ASSERT_POSIX_SUCCESS(write(p
[1], "A", 1), NULL
);
33 T_ASSERT_POSIX_SUCCESS(child
= fork(), NULL
);
41 * if the waitpid takes too long, the child is probably stuck in the
42 * infinite loop, so fail via too_long.
44 T_ASSERT_NE(signal(SIGALRM
, too_long
), SIG_ERR
, NULL
);
45 T_ASSERT_POSIX_SUCCESS(alarm(10), NULL
);
47 /* this will hang if the bug is there: */
48 T_ASSERT_POSIX_SUCCESS(waitpid(child
, &status
, 0), NULL
);
50 /* expecting a clean, zero exit: */
51 T_ASSERT_TRUE(WIFEXITED(status
), NULL
);
52 T_ASSERT_EQ(WEXITSTATUS(status
), 0, NULL
);