| 1 |
/* COVERAGE: sched_rr_get_interval */ |
| 2 |
|
| 3 |
#define _GNU_SOURCE |
| 4 |
#include <stdio.h> |
| 5 |
#include <unistd.h> |
| 6 |
#include <sched.h> |
| 7 |
|
| 8 |
int main() |
| 9 |
{ |
| 10 |
struct timespec tp; |
| 11 |
|
| 12 |
sched_rr_get_interval(0, &tp); |
| 13 |
//staptest// sched_rr_get_interval (0, XXXX) = 0 |
| 14 |
|
| 15 |
sched_rr_get_interval(-1, &tp); |
| 16 |
//staptest// sched_rr_get_interval (-1, XXXX) = -NNNN (EINVAL) |
| 17 |
|
| 18 |
sched_rr_get_interval(999999, &tp); |
| 19 |
//staptest// sched_rr_get_interval (999999, XXXX) = -NNNN (ESRCH) |
| 20 |
|
| 21 |
// The following SEGVs if compiled as a 32-on-64 bit binary on x86_64 in valid_timespec64_to_timespec() |
| 22 |
#if __WORDSIZE == 64 |
| 23 |
sched_rr_get_interval(0, (struct timespec *)-1); |
| 24 |
#ifdef __s390__ |
| 25 |
//staptest// sched_rr_get_interval (0, 0x[7]?[f]+) = -NNNN (EFAULT) |
| 26 |
#else |
| 27 |
//staptest// sched_rr_get_interval (0, 0x[f]+) = -NNNN (EFAULT) |
| 28 |
#endif |
| 29 |
#endif |
| 30 |
|
| 31 |
return 0; |
| 32 |
} |