Couple of issues with the original code: 1) There was assumption that "lsof" is always installed on FreeBSD and Darwin/MacOSX, which isn't true. This resulted in false results when "lsof" was not found (because of parsing "lsof: not found" response from the os:cmd/1 call). 2) There was off-by-one error with response parsing (column headers were counted as open file descriptor). 3) Other UNIX-lie operating systems were ignored, even though "lsof" works on virtually all of them. New code tests for existence of "lsof" on all UNIX-like operating systems and either returns correct number of open file descriptors or "unknown" in case when "lsof" wasn't found.