| 1 |
/* COVERAGE: set_tid_address */ |
| 2 |
|
| 3 |
#define _GNU_SOURCE |
| 4 |
#include <unistd.h> |
| 5 |
#include <sys/syscall.h> |
| 6 |
|
| 7 |
int main() |
| 8 |
{ |
| 9 |
int i; |
| 10 |
|
| 11 |
// set_tid_address() is being called as a part of the testcase |
| 12 |
// initialization. To ensure that our staptests are correctly |
| 13 |
// matching code under test, we'll do the limit testing first. |
| 14 |
// Using syscall() avoids link time issues. |
| 15 |
|
| 16 |
// Limit testing |
| 17 |
syscall(__NR_set_tid_address, (int *)-1); |
| 18 |
#ifdef __s390__ |
| 19 |
//staptest// set_tid_address (0x[7]?[f]+) = NNNN |
| 20 |
#else |
| 21 |
//staptest// set_tid_address (0x[f]+) = NNNN |
| 22 |
#endif |
| 23 |
|
| 24 |
// Test normal operation |
| 25 |
syscall(__NR_set_tid_address, &i); |
| 26 |
//staptest// set_tid_address (XXXX) = NNNN |
| 27 |
|
| 28 |
syscall(__NR_set_tid_address, NULL); |
| 29 |
//staptest// set_tid_address (0x0) = NNNN |
| 30 |
|
| 31 |
return 0; |
| 32 |
} |