You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kevent implementation treats timeout as seconds but epoll_wait implantation treats timeout as milliseconds.
assuming milliseconds is desired timeout unit, code using kevent could be changed from
ts.tv_sec = timeout;
ts.tv_nsec = 0;
to
ts.tv_sec = timeout / 1000;
ts.tv_nsec = (timeout - (ts.tv_sec*1000)) * 1000000;
very good catch! this is totally undefined in my code and it will result in different behavior for kevent or epoll users. Luckily sshp itself uses -1 so it'll never hit this bug, but if people want to use fdwatcher in the future this should be fixed - i'll write up a fix today.
kevent implementation treats timeout as seconds but epoll_wait implantation treats timeout as milliseconds.
assuming milliseconds is desired timeout unit, code using kevent could be changed from
ts.tv_sec = timeout;
ts.tv_nsec = 0;
to
ts.tv_sec = timeout / 1000;
ts.tv_nsec = (timeout - (ts.tv_sec*1000)) * 1000000;
Note: epoll_wait timeout in milliseconds is according to https://man7.org/linux/man-pages/man2/epoll_wait.2.html
The text was updated successfully, but these errors were encountered: