Index: sys/kern/sys_generic.c =================================================================== --- sys/kern/sys_generic.c (revision 239329) +++ sys/kern/sys_generic.c (working copy) @@ -1249,6 +1249,15 @@ struct poll_args { int timeout; }; #endif + +#define FREQ2BT(freq, bt) \ +{ \ + (bt)->sec = 0; \ + (bt)->frac = ((uint64_t)0x8000000000000000 / (freq)) << 1; \ +} + +static struct bintime bt_hz; + int sys_poll(td, uap) struct thread *td; @@ -1281,9 +1290,10 @@ sys_poll(td, uap) error = EINVAL; goto done; } - binuptime(&rbt); + getbinuptime(&rbt); timeval2bintime(&atv, &abt); bintime_add(&abt, &rbt); + bintime_addx(&abt, bt_hz.frac); } else { abt.sec = 0; abt.frac = 0; @@ -1295,7 +1305,7 @@ sys_poll(td, uap) if (error || td->td_retval[0] != 0) break; if (abt.sec || abt.frac) { - binuptime(&rbt); + getbinuptime(&rbt); if (bintime_cmp(&rbt, &abt, >=)) break; error = seltdwait(td, &abt, 0); @@ -1773,4 +1783,5 @@ selectinit(void *dummy __unused) selfd_zone = uma_zcreate("selfd", sizeof(struct selfd), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); mtxpool_select = mtx_pool_create("select mtxpool", 128, MTX_DEF); + FREQ2BT(hz, &bt_hz); }