1 /* Check that TRT happens for pipe corner cases (for our definition of TRT).
4 #output: Terminating simulation due to writing pipe * from one single thread\n
5 #output: program stopped with signal 4 (*).\n
15 void err (const char *s)
33 pipemax = fpathconf (pip[1], _PC_PIPE_BUF);
38 fprintf (stderr, "Bad pipemax %d\n", pipemax);
42 /* Writing an inordinate amount to the pipe. */
43 buf = calloc (100 * pipemax, 1);
47 /* The following doesn't trig on host; writing more than PIPE_MAX to a
48 pipe with no reader makes the program hang. Neither does it trig
49 on target: we don't want to emulate the "hanging" (which would
50 happen with *any* amount written to a pipe with no reader if we'd
51 support it - but we don't). Better to abort the simulation with a
53 if (write (pip[1], buf, 100 * pipemax) != -1