Reputation: 41
I use event.data.ptr to point to an object. When I epoll_ctl(del) the event I have to delete the object(pointed by event.data.ptr). How can I get the pointer? epll_ctl(del) just ignores the parameter 'event':
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
Do I have to maintain a vector of these objects? I think its a little dirty. thanks.
Upvotes: 1
Views: 1047
Reputation: 416
it is in fact. There is no way to query the data field in the epoll interface. The common workaround is to keep that data in your own list in user-space.
I think its time someone write an epoll syscall to query that field to avoid duplicated data associated to a file descriptor.
Upvotes: 1