build-many-glibcs.py: Add openrisc hard float glibc variant
[glibc.git] / posix / tst-execvp3.c
blob02a937c2da7030f8c03a92714545662363ace73b
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <unistd.h>
5 #include <sys/stat.h>
8 static void do_prepare (void);
9 #define PREPARE(argc, argv) do_prepare ()
10 static int do_test (void);
11 #define TEST_FUNCTION do_test ()
13 #include "../test-skeleton.c"
15 #ifndef EXECVP
16 # define EXECVP(file, argv) execvp (file, argv)
17 #endif
19 static char *fname;
21 static void
22 do_prepare (void)
24 int fd = create_temp_file ("testscript", &fname);
25 dprintf (fd, "echo foo\n");
26 fchmod (fd, 0700);
27 close (fd);
31 static int
32 do_test (void)
34 if (setenv ("PATH", test_dir, 1) != 0)
36 puts ("setenv failed");
37 return 1;
40 char *argv[] = { fname, NULL };
41 EXECVP (basename (fname), argv);
43 /* If we come here, the execvp call failed. */
44 return 1;