| 1 |
/* COVERAGE: execve */ |
| 2 |
#include <unistd.h> |
| 3 |
#include <sys/mman.h> |
| 4 |
|
| 5 |
int main() |
| 6 |
{ |
| 7 |
mlockall(MCL_CURRENT); |
| 8 |
|
| 9 |
char *newargv[] = { "/bin/true", "a", "b", "cde", NULL }; |
| 10 |
char *newenv[] = { "FOO=10", "BAR=20", NULL }; |
| 11 |
|
| 12 |
/* Limit testing */ |
| 13 |
execve((char *)-1, NULL, NULL); |
| 14 |
#ifdef __s390__ |
| 15 |
//staptest// execve (0x[7]?[f]+, \[\], \[\]) = -NNNN (EFAULT) |
| 16 |
#else |
| 17 |
//staptest// execve (0x[f]+, \[\], \[\]) = -NNNN (EFAULT) |
| 18 |
#endif |
| 19 |
|
| 20 |
execve(NULL, (char **)-1, NULL); |
| 21 |
#ifdef __s390__ |
| 22 |
//staptest// execve (0x0, \[0x[7]?[f]+\], \[\]) = -NNNN (EFAULT) |
| 23 |
#else |
| 24 |
//staptest// execve (0x0, \[0x[f]+\], \[\]) = -NNNN (EFAULT) |
| 25 |
#endif |
| 26 |
|
| 27 |
execve(NULL, NULL, (char **)-1); |
| 28 |
#ifdef __s390__ |
| 29 |
//staptest// execve (0x0, \[\], \[0x[7]?[f]+\]) = -NNNN |
| 30 |
#else |
| 31 |
//staptest// execve (0x0, \[\], \[0x[f]+\]) = -NNNN |
| 32 |
#endif |
| 33 |
|
| 34 |
/* Regular testing. */ |
| 35 |
execve(newargv[0], newargv, newenv); |
| 36 |
//staptest// execve ("/bin/true", \["/bin/true", "a", "b", "cde"\], \["FOO=10", "BAR=20"\]) = NNNN |
| 37 |
|
| 38 |
return 0; |
| 39 |
} |
| 40 |
|