add #ifdef test for Sun around DIRENT use