Update release-README after completing the 2.43 release.
[binutils-gdb.git] / sim / testsuite / cris / c / pipe1.c
blob21b17764c26ba97d9213af1b55d107d86f8ffe05
1 /* Check for proper pipe semantics at corner cases.
2 #progos: linux
3 */
5 #include <stddef.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <unistd.h>
9 #include <sched.h>
10 #include <signal.h>
11 #include <sys/types.h>
12 #include <sys/wait.h>
13 #include <limits.h>
14 #include <unistd.h>
16 int main (void)
18 int i;
19 int filemax;
21 #ifdef OPEN_MAX
22 filemax = OPEN_MAX;
23 #else
24 filemax = sysconf (_SC_OPEN_MAX);
25 #endif
27 if (filemax < 10)
28 abort ();
30 /* Check that pipes don't leak file descriptors. */
31 for (i = 0; i < filemax * 10; i++)
33 int pip[2];
34 if (pipe (pip) != 0)
36 perror ("pipe");
37 abort ();
40 if (close (pip[0]) != 0 || close (pip[1]) != 0)
42 perror ("close");
43 abort ();
46 printf ("pass\n");
47 exit (0);