4 ms·
> From looking at the man page, it look like epoll does not return the file descriptor of the event; it returns a union containing user-defined data, although o
by ori_b 2y ago
> From looking at the man page, it look like epoll does not return the file descriptor of the event; it returns a union containing user-defined data, although one of the union's fields is called "fd" because it is presumably intended to be used as the file descriptor.
Yes -- so how do you unregister an event after you close the file, or dup the file descriptor? You have no way to do that, you just keep getting events for a resource you no longer have open, so long as the parent or child still has it open!
It's incredible that you can set things up in a way that you get events on a resource you can no longer refer to in any way.
- zzo38computer 2y ago> so how do you unregister an event after you close the file ... You have no way to do that, you just keep getting events for a resource you no longer have open ... It's incredible that you can set things up in a way that you get events on a resource you can no longer refer to in any way. Yes, I thought that too, it does not make much sense to me either. (I would suppose that you could close the epoll file descriptor, but then that would cancel all events, and not only that one.)