| 1497 | } |
| 1498 | |
| 1499 | static int |
| 1500 | realtimer_gettime(struct itimer *it, struct itimerspec *ovalue) |
| 1501 | { |
| 1502 | struct timespec cts; |
| 1503 | |
| 1504 | mtx_assert(&it->it_mtx, MA_OWNED); |
| 1505 | |
| 1506 | realtimer_clocktime(it->it_clockid, &cts); |
| 1507 | *ovalue = it->it_time; |
| 1508 | if (ovalue->it_value.tv_sec != 0 || ovalue->it_value.tv_nsec != 0) { |
| 1509 | timespecsub(&ovalue->it_value, &cts, &ovalue->it_value); |
| 1510 | if (ovalue->it_value.tv_sec < 0 || |
| 1511 | (ovalue->it_value.tv_sec == 0 && |
| 1512 | ovalue->it_value.tv_nsec == 0)) { |
| 1513 | ovalue->it_value.tv_sec = 0; |
| 1514 | ovalue->it_value.tv_nsec = 1; |
| 1515 | } |
| 1516 | } |
| 1517 | return (0); |
| 1518 | } |
| 1519 | |
| 1520 | static int |
| 1521 | realtimer_settime(struct itimer *it, int flags, |
no test coverage detected