diff options
Diffstat (limited to '9999/0011-dirent-Deprecate-getdirentries.patch')
-rw-r--r-- | 9999/0011-dirent-Deprecate-getdirentries.patch | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/9999/0011-dirent-Deprecate-getdirentries.patch b/9999/0011-dirent-Deprecate-getdirentries.patch new file mode 100644 index 0000000..c7abd61 --- /dev/null +++ b/9999/0011-dirent-Deprecate-getdirentries.patch @@ -0,0 +1,103 @@ +From fe14184069e952f57e74f1e599816d0403205ac0 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella <adhemerval.zanella@linaro.org> +Date: Fri, 17 Apr 2020 09:59:51 -0300 +Subject: [PATCH 11/12] dirent: Deprecate getdirentries + +The interface has some issues: + + 1. It is build on top getdents on Linux and requires handling + non-LFS call using LFS getdents. + + 2. It is not wildly used and the non-LFS support is as problematic + as non-LFS readdir. glibc only exports the LFS getdents. + + 3. It is not a direct replacement over BSD since on some plataform + its signature has changed (FreeBSD 11, for instance, used to + set the offset as a 'long' and changed to 'off_t' on version 12). + +The idea is to eventually move the symbols to compat ones. +--- + NEWS | 6 ++++++ + dirent/dirent.h | 14 ++++++++++---- + sysdeps/unix/sysv/linux/Makefile | 4 ++++ + 3 files changed, 20 insertions(+), 4 deletions(-) + +diff --git a/NEWS b/NEWS +index bc1aac1270..56c4d3ed7e 100644 +--- a/NEWS ++++ b/NEWS +@@ -93,6 +93,12 @@ Security related changes: + + [Add security related changes here] + ++Deprecated and removed features, and other changes affecting compatibility: ++ ++* The function getdirentries is now deprecated, applications should use ++ either getdents64, readdir64 or readdir. ++ ++ + The following bugs are resolved with this release: + + [The release manager will add the list generated by +diff --git a/dirent/dirent.h b/dirent/dirent.h +index c47d3273b2..1c299e5be8 100644 +--- a/dirent/dirent.h ++++ b/dirent/dirent.h +@@ -350,29 +350,35 @@ extern int alphasort64 (const struct dirent64 **__e1, + /* Read directory entries from FD into BUF, reading at most NBYTES. + Reading starts at offset *BASEP, and *BASEP is updated with the new + position after reading. Returns the number of bytes read; zero when at +- end of directory; or -1 for errors. */ ++ end of directory; or -1 for errors. ++ This is deprecated and getdents64 or readdir should be used instead. */ + # ifndef __USE_FILE_OFFSET64 + extern __ssize_t getdirentries (int __fd, char *__restrict __buf, + size_t __nbytes, + __off_t *__restrict __basep) +- __THROW __nonnull ((2, 4)); ++ __THROW __nonnull ((2, 4)) ++ __attribute_deprecated_msg__ ("Use getdents64 instead"); + # else + # ifdef __REDIRECT + extern __ssize_t __REDIRECT_NTH (getdirentries, + (int __fd, char *__restrict __buf, + size_t __nbytes, + __off64_t *__restrict __basep), +- getdirentries64) __nonnull ((2, 4)); ++ getdirentries64) ++ __nonnull ((2, 4)) ++ __attribute_deprecated_msg__ ("Use getdents64 instead"); + # else + # define getdirentries getdirentries64 + # endif + # endif + + # ifdef __USE_LARGEFILE64 ++/* This is deprecated and getdents64 or readdir64 should be used instead. */ + extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf, + size_t __nbytes, + __off64_t *__restrict __basep) +- __THROW __nonnull ((2, 4)); ++ __THROW __nonnull ((2, 4)) ++ __attribute_deprecated_msg__ ("Use getdents64 instead"); + # endif + #endif /* Use misc. */ + +diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile +index a139a16532..237b8ca80a 100644 +--- a/sysdeps/unix/sysv/linux/Makefile ++++ b/sysdeps/unix/sysv/linux/Makefile +@@ -365,6 +365,10 @@ tests += \ + tst-getdents64 \ + tst-readdir64-compat \ + # tests ++ ++# Avoid the warning for the weak_alias for _DIRENT_MATCHES_DIRENT64 ++CFLAGS-getdirentries64.o = -Wno-deprecated-declarations ++CFLAGS-getdirentries64.os = -Wno-deprecated-declarations + endif # $(subdir) == dirent + + ifeq ($(subdir),nis) +-- +2.35.1 + |