readdir example using POSIX API and linux syscall