Synopsis: | Don't use the functions readdir instead use the re-entrant counterpart readdir_r |
Language: | C |
Severity Level: | 5 |
Category: | Library |
Description: |
Justification Non-reentrant functions can cause problems when multiple threads are used or memory is shared between tasks (such as on VxWorks). Example #include <sys/types.h> #include <dirent.h> struct dirent *readdir(DIR *dirp); /* WRONG */ struct dirent *readdir_r(DIR *dirp, struct dirent *entry); /* RIGHT */ |