Please check the manual page scandir(3).