On Thu, Jun 29, 2006 at 08:46:20AM -0400, Adam Grossman wrote:
> hello.
> 
> i am currently writing on app for linux kernel 2.4 and 2.6.  on 2.4, it 
> works great.  on 2.4, when a call event_del on a certain event, i get an 
> error, where  errno=2 and the strerror(errno) returns "No such file or 
> directory".  what exactly does that error mean? i can not figure out why 
> this is happening, especially since it is working 2.4, but i am hoping 
> an explanation of this error will help me narrow it down.
> 

1) You should only check errno if event_del() returns non-zero.

2) That said, on kernel 2.6 (I assume the above has a typo), if you register
a descriptor w/ epoll, fork, then close the desciptor in one of the
processes, the descriptor is removed from the epoll() queue in the other
process. Thus, when you call event_del() epoll will return an error. I
submitted a patch some time ago--which was accepted--which kept everything
in a consistent state when this occured so that the error could be safely
ignored. Though, you would still need to drop and re-add the descriptor in
the process which did NOT close the descriptor.

Basically, this means that if you have some sort of multi-process system for
handling connections or w'ever, when you fork you need to reinitialize
everything, including calling event_init(), IIRC.

_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to