| 1418 | } |
| 1419 | |
| 1420 | int |
| 1421 | kern_ktimer_gettime(struct thread *td, int timer_id, struct itimerspec *val) |
| 1422 | { |
| 1423 | struct proc *p; |
| 1424 | struct itimer *it; |
| 1425 | int error; |
| 1426 | |
| 1427 | p = td->td_proc; |
| 1428 | PROC_LOCK(p); |
| 1429 | if (timer_id < 3 || (it = itimer_find(p, timer_id)) == NULL) { |
| 1430 | PROC_UNLOCK(p); |
| 1431 | error = EINVAL; |
| 1432 | } else { |
| 1433 | PROC_UNLOCK(p); |
| 1434 | itimer_enter(it); |
| 1435 | error = CLOCK_CALL(it->it_clockid, timer_gettime, (it, val)); |
| 1436 | itimer_leave(it); |
| 1437 | ITIMER_UNLOCK(it); |
| 1438 | } |
| 1439 | return (error); |
| 1440 | } |
| 1441 | |
| 1442 | #ifndef _SYS_SYSPROTO_H_ |
| 1443 | struct timer_getoverrun_args { |
no test coverage detected