Update release-README after completing the 2.43 release.
[binutils-gdb.git] / sim / testsuite / cris / c / ftruncate2.c
blob712c185c754f37535f65c3ea7ae0a3f53062c70c
1 /*
2 #progos: linux
3 */
5 /* Check that we get a proper error indication if trying ftruncate on a
6 fd that is a pipe descriptor. */
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <errno.h>
11 #include <unistd.h>
12 int main (void)
14 int pip[2];
16 if (pipe (pip) != 0)
18 perror ("pipe");
19 abort ();
22 if (ftruncate (pip[0], 20) == 0 || errno != EINVAL)
24 perror ("ftruncate 1");
25 abort ();
28 errno = 0;
30 if (ftruncate (pip[1], 20) == 0 || errno != EINVAL)
32 perror ("ftruncate 2");
33 abort ();
36 printf ("pass\n");
38 exit (0);