| 694 | } |
| 695 | |
| 696 | int |
| 697 | kern_settimeofday(struct thread *td, struct timeval *tv, struct timezone *tzp) |
| 698 | { |
| 699 | int error; |
| 700 | |
| 701 | error = priv_check(td, PRIV_SETTIMEOFDAY); |
| 702 | if (error) |
| 703 | return (error); |
| 704 | /* Verify all parameters before changing time. */ |
| 705 | if (tv) { |
| 706 | if (tv->tv_usec < 0 || tv->tv_usec >= 1000000 || |
| 707 | tv->tv_sec < 0) |
| 708 | return (EINVAL); |
| 709 | error = settime(td, tv); |
| 710 | } |
| 711 | return (error); |
| 712 | } |
| 713 | |
| 714 | /* |
| 715 | * Get value of an interval timer. The process virtual and profiling virtual |
no test coverage detected