The readdir_r function was marked as deprecated in glibc version 2.24. This change was made due to the complexity and potential issues related to its usage.
The readdir function is simpler and is thread-safe as long as different threads operate on different DIR objects. This change not only improves code readability but also aligns with the current best practices.
This situations happens in two situations:
linux/system_stats_utils.c: In function ‘read_process_status’:
linux/system_stats_utils.c:159:9: warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
159 | while (readdir_r(dirp, &dbuf, &ent) == 0)
| ^~~~~
In file included from linux/system_stats_utils.c:18:
/usr/include/dirent.h:185:12: note: declared here
185 | extern int readdir_r (DIR *__restrict __dirp,
| ^~~~~~~~~
and
linux/cpu_memory_by_process.c: In function ‘ReadCPUMemoryUsage’:
linux/cpu_memory_by_process.c:230:9: warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
230 | while (readdir_r(dirp, &dbuf, &ent) == 0)
| ^~~~~
In file included from linux/cpu_memory_by_process.c:16:
/usr/include/dirent.h:185:12: note: declared here
185 | extern int readdir_r (DIR *__restrict __dirp,
| ^~~~~~~~~
The readdir_r function was marked as deprecated in glibc version 2.24. This change was made due to the complexity and potential issues related to its usage.
The readdir function is simpler and is thread-safe as long as different threads operate on different DIR objects. This change not only improves code readability but also aligns with the current best practices.
This situations happens in two situations:
and
Bellow is full make messages output: