| 1 |
/* COVERAGE: pivot_root */ |
| 2 |
|
| 3 |
#define _GNU_SOURCE |
| 4 |
#include <unistd.h> |
| 5 |
#include <sys/syscall.h> |
| 6 |
#include <sys/mman.h> |
| 7 |
|
| 8 |
int main() |
| 9 |
{ |
| 10 |
|
| 11 |
// We are not really going to let the syscall succeed. |
| 12 |
// Just sanity check it: |
| 13 |
|
| 14 |
mlockall(MCL_CURRENT); |
| 15 |
|
| 16 |
syscall(__NR_pivot_root, "/tmp", "/"); |
| 17 |
//staptest// pivot_root ("/tmp", "/") = NNNN |
| 18 |
|
| 19 |
syscall(__NR_pivot_root, (const char *)-1, "/tmp"); |
| 20 |
#ifdef __s390__ |
| 21 |
//staptest// pivot_root (0x[7]?[f]+, "/tmp") = NNNN |
| 22 |
#else |
| 23 |
//staptest// pivot_root (0x[f]+, "/tmp") = NNNN |
| 24 |
#endif |
| 25 |
|
| 26 |
syscall(__NR_pivot_root, "/tmp", (const char *)-1); |
| 27 |
#ifdef __s390__ |
| 28 |
//staptest// pivot_root ("/tmp", 0x[7]?[f]+) = NNNN |
| 29 |
#else |
| 30 |
//staptest// pivot_root ("/tmp", 0x[f]+) = NNNN |
| 31 |
#endif |
| 32 |
|
| 33 |
return 0; |
| 34 |
} |