title: Is it necessary to deregister a socket from epoll before closing it?
body: <p>Assume the following code where "sock" is a handle to TCP socket that was previously registered with an epoll file descriptor designated by epfd.</p>
  
  <pre><code>epoll_ctl(epfd, EPOLL_CTL_DEL, sock, &amp;ev);
  close(sock);
  </code></pre>
  
  <p>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?</p>