X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fsched%2Fsched_rr_get_interval.c;h=33a3d1aeed43bf2860ffa89540b7848c0854fdd4;hb=246f1c811448f37a44b41cd8df8d0ef9736d95f4;hp=43bc49044ebb2e36d93ead9efecbdd809c786f58;hpb=61be1cfec1f5da66c68f92a6939e3a38e673c9d6;p=musl diff --git a/src/sched/sched_rr_get_interval.c b/src/sched/sched_rr_get_interval.c index 43bc4904..33a3d1ae 100644 --- a/src/sched/sched_rr_get_interval.c +++ b/src/sched/sched_rr_get_interval.c @@ -3,6 +3,19 @@ int sched_rr_get_interval(pid_t pid, struct timespec *ts) { +#ifdef SYS_sched_rr_get_interval_time64 + /* On a 32-bit arch, use the old syscall if it exists. */ + if (SYS_sched_rr_get_interval != SYS_sched_rr_get_interval_time64) { + long ts32[2]; + int r = __syscall(SYS_sched_rr_get_interval, pid, ts32); + if (!r) { + ts->tv_sec = ts32[0]; + ts->tv_nsec = ts32[1]; + } + return __syscall_ret(r); + } +#endif + /* If reaching this point, it's a 64-bit arch or time64-only + * 32-bit arch and we can get result directly into timespec. */ return syscall(SYS_sched_rr_get_interval, pid, ts); } -