AArch64: Add SVE memcpy
[glibc.git] / libio / tst-popen1.c
blob9f36b200908a09b4f34c915b9c8a7b212f53d9e7
1 #include <fcntl.h>
2 #include <stdio.h>
4 static int
5 do_test (void)
7 int res = 0;
9 FILE *fp = popen ("echo hello", "r");
10 if (fp == NULL)
12 puts ("first popen failed");
13 res = 1;
15 else
17 int fd = fileno (fp);
18 if (fcntl (fd, F_GETFD) == FD_CLOEXEC)
20 puts ("first popen(\"r\") set FD_CLOEXEC");
21 res = 1;
24 pclose (fp);
27 fp = popen ("echo hello", "re");
28 if (fp == NULL)
30 puts ("second popen failed");
31 res = 1;
33 else
35 int fd = fileno (fp);
36 if (fcntl (fd, F_GETFD) != FD_CLOEXEC)
38 puts ("second popen(\"r\") did not set FD_CLOEXEC");
39 res = 1;
42 pclose (fp);
45 return res;
48 #define TEST_FUNCTION do_test ()
49 #include "../test-skeleton.c"