Reputation: 232
Does Kqueue handler need close ? I mean :
int hd = epoll_create(512);
....
close(hd); // we have to close
so for kqueue, does it need Close ?
int hd = kqueue();
...
close(hd) ? // is this a must ?
Upvotes: 1
Views: 258
Reputation: 19221
Yes.
Kqueue uses a file descriptor, exactly like epoll, meaning that it should be closed when you're done with it.
Mostly, the OS cleanup will close it if you didn't do so before the process terminated... however, this is considered a bad practice.
Upvotes: 3