x On successful completion of readdir, a pointer to an object of type struct dirent. 0 Successful completion of readdir_r. x On error, an error value (readdir_r only). NULL An error occurred or end of the directory stream (readdir_r only). If an error occurred, errno is set to a value indicating the cause.