Linux epoll(7) patch

Yuri yuri at rawbw.com
Mon Aug 5 19:24:11 UTC 2013


On 08/05/2013 08:39, Mateusz Guzik wrote:
> What happens to fd after the fork? Is it closed or simply remains
> non-functional?
>
> If the former, I suggest the patch is altered to leave fd with badfdops
> in place so that epoll users get less surprised.

I will try to alter it this way. However, there is no easy way of 
testing such case, apart from compiling specially crafted linux program.
Also forking after poll is a marginal case. Doubt it ever matters in 
practice.

I found two more problems with the patch: epoll_wait treats timeout as 
if it was in microseconds, when it is in milliseconds. Also epoll_wait 
doesn't check for the special case of timeout=-1. I corrected both 
issues. Will do additional testing, and will submit PR with an updated 
patch when done.

Yuri


More information about the freebsd-current mailing list