From f19af37b5ee6cd5283683195d692fe3f713db2a5 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 12 Dec 2016 17:33:45 -0800 Subject: [PATCH] Deprecate readdir_r. I've been campaigning against readdir_r for years: http://elliotth.blogspot.com/2012/10/how-not-to-use-readdirr3.html and glibc deprecated it in 2.24, so we should join the club. Bug: http://b/32678321 Test: builds Change-Id: Ie3887ed75989aced9324266aa3b93e85c11bdbc9 --- libc/include/dirent.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/include/dirent.h b/libc/include/dirent.h index 7ac4ab736f..d6819f2e16 100644 --- a/libc/include/dirent.h +++ b/libc/include/dirent.h @@ -80,8 +80,8 @@ DIR* opendir(const char* __path); DIR* fdopendir(int __dir_fd); struct dirent* readdir(DIR* __dir); struct dirent64* readdir64(DIR* __dir) __INTRODUCED_IN(21); -int readdir_r(DIR* __dir, struct dirent* __entry, struct dirent** __buffer); -int readdir64_r(DIR* __dir, struct dirent64* __entry, struct dirent64** __buffer) __INTRODUCED_IN(21); +int readdir_r(DIR* __dir, struct dirent* __entry, struct dirent** __buffer) __attribute__((__deprecated__("readdir_r is deprecated; use readdir instead"))); +int readdir64_r(DIR* __dir, struct dirent64* __entry, struct dirent64** __buffer) __INTRODUCED_IN(21) __attribute__((__deprecated__("readdir64_r is deprecated; use readdir64 instead"))); int closedir(DIR* __dir); void rewinddir(DIR* __dir); void seekdir(DIR* __dir, long __location) __INTRODUCED_IN(23);