- 论坛徽章:
- 0
|
在ep_poll()函数中有下面的代码:- static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
- int maxevents, long timeout)
- {
- int res, eavail;
- unsigned long flags;
- long jtimeout;
- wait_queue_t wait;
- /*
- * Calculate the timeout by checking for the "infinite" value (-1)
- * and the overflow condition. The passed timeout is in milliseconds,
- * that why (t * HZ) / 1000.
- */
- /*
- * timeout是以毫秒为单位,这里是要转换为jiffies时间。
- * 不知道这里在计算的时候为什么要加上999?
- */
- jtimeout = (timeout < 0 || timeout >= EP_MAX_MSTIMEO) ?
- MAX_SCHEDULE_TIMEOUT : (timeout * HZ + 999) / 1000;
复制代码 不知道在计算jiffies时间的时候为什么要加上999,请各位知道的说说 |
|