MCPcopy Create free account
hub / github.com/F-Stack/f-stack / itimerfix

Function itimerfix

freebsd/kern/kern_time.c:930–940  ·  view source on GitHub ↗

* 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.) */

Source from the content-addressed store, hash-verified

928 * than the resolution of the clock, round it up.)
929 */
930int
931itimerfix(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

Callers 4

kern_setitimerFunction · 0.70
kern_aio_suspendFunction · 0.70
kern_aio_waitcompleteFunction · 0.70
bpfioctlFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected