Fix NetBSD 6.1.5 compilation warnings and failures
Handle receiving events after directory itself has been renamed
and no POSIX.1-2008 relative pathname functions had been detected at configure
stage. It uses unsafe fchdir if MacOSX-specific F_GETPATH fcntl is absent
More accurate at* functions ifdefs
Insert forgotten include
One more forgotten change
Open new file descriptor on watched directory if we are to rewind
directory w/o close on each listing and do not want interfere with parent fd