Assume the following code where "sock" is a handle to TCP socket that was previously registered with an epoll file descriptor designated by epfd.
epoll_ctl(epfd, EPOLL_CTL_DEL, sock, &ev);
close(sock);
Is it still necessary to call epoll_ctl if the socket is going to get subsequently closed anyway? Or does the socket get implicitly deregistered as a result of closing it?