phoenix-rtos-project
phoenix-rtos-project copied to clipboard
fs: readdir should be async safe
The type DIR, which is defined in the <dirent.h> header, represents a directory stream, which is an ordered sequence of ALL the directory entries in a particular directory. Directory entries represent files; files may be removed from a directory or added to a directory asynchronously to the operation of readdir().
If a file is removed from or added to the directory after the most recent call to opendir() or rewinddir(), whether a subsequent call to readdir() returns an entry for that file is unspecified.