Which, given a specification of a filehandle (eg an IP address or path) uses lsof to determine the PID of the owning process and the numeric value of the filehandle, and then uses gdb to attach to that process and close it. It's a crude but simple way of exercising error-handling code.
fuser is useful too, and available on many Unixen. I've used "fuser -k" many times to find and kill rogue processes.
https://en.wikipedia.org/wiki/Lsof
https://en.wikipedia.org/wiki/Fuser_(Unix)
Edited for grammar.