* Check that a proposed value to load into the .it_value or * .it_interval part of an interval timer is acceptable, and * fix it to have at least minimal value (i.e. if it is less * than the resolution of the clock, round it up.) */
| 928 | * than the resolution of the clock, round it up.) |
| 929 | */ |
| 930 | int |
| 931 | itimerfix(struct timeval *tv) |
| 932 | { |
| 933 | |
| 934 | if (tv->tv_sec < 0 || tv->tv_usec < 0 || tv->tv_usec >= 1000000) |
| 935 | return (EINVAL); |
| 936 | if (tv->tv_sec == 0 && tv->tv_usec != 0 && |
| 937 | tv->tv_usec < (u_int)tick / 16) |
| 938 | tv->tv_usec = (u_int)tick / 16; |
| 939 | return (0); |
| 940 | } |
| 941 | |
| 942 | /* |
| 943 | * Decrement an interval timer by a specified number |
no outgoing calls
no test coverage detected