Update release-README after completing the 2.43 release.
[binutils-gdb.git] / sim / testsuite / cris / c / pipe3.c
blob467b5ca122100d3676e8479080247591169cb678
1 /* Check that TRT happens when error on pipe call.
2 #progos: linux
3 */
5 #include <stddef.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <unistd.h>
9 #include <errno.h>
10 #include <limits.h>
12 int main (void)
14 int i;
15 int filemax;
17 #ifdef OPEN_MAX
18 filemax = OPEN_MAX;
19 #else
20 filemax = sysconf (_SC_OPEN_MAX);
21 #endif
23 /* Check that TRT happens when error on pipe call. */
24 for (i = 0; i < filemax + 1; i++)
26 int pip[2];
27 if (pipe (pip) != 0)
29 /* Shouldn't happen too early. */
30 if (i < filemax / 2 - 3 - 1)
32 fprintf (stderr, "i: %d\n", i);
33 abort ();
35 if (errno != EMFILE)
37 perror ("pipe");
38 abort ();
40 goto ok;
43 abort ();
45 ok:
46 printf ("pass\n");
47 exit (0);