public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/bz23960] dirent: Deprecate getdirentries
@ 2020-10-02 13:53 Adhemerval Zanella
  0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella @ 2020-10-02 13:53 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=10b45ae4ca822a7964e893d029d1a558ae533d87

commit 10b45ae4ca822a7964e893d029d1a558ae533d87
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Apr 17 09:59:51 2020 -0300

    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.

Diff:
---
 NEWS                             | 3 +++
 dirent/dirent.h                  | 7 ++++---
 sysdeps/unix/sysv/linux/Makefile | 3 +++
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index ce05d05b16..3022cc9fab 100644
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,9 @@ Deprecated and removed features, and other changes affecting compatibility:
 * The mallinfo function is marked deprecated.  Callers should call
   mallinfo2 instead.
 
+* The function getdirentries is now deprecated, applications should use
+  either getdents or POSIX readdir instead.
+
 Changes to build and runtime requirements:
 
   [Add changes to build and runtime requirements here]
diff --git a/dirent/dirent.h b/dirent/dirent.h
index 92d0925047..4ee60471f7 100644
--- a/dirent/dirent.h
+++ b/dirent/dirent.h
@@ -353,14 +353,15 @@ extern int alphasort64 (const struct dirent64 **__e1,
 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__;
 # 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)
+     __THROW __nonnull ((2, 4)) __attribute_deprecated__;
 #  else
 #   define getdirentries getdirentries64
 #  endif
@@ -370,7 +371,7 @@ extern __ssize_t __REDIRECT_NTH (getdirentries,
 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__;
 # endif
 #endif /* Use misc.  */
 
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 3bd3106ef9..55b8df59c5 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -260,6 +260,9 @@ ifeq ($(subdir),dirent)
 sysdep_routines += getdirentries getdirentries64
 tests += tst-getdents64
 tests-internal += tst-readdir64-compat
+
+# Avoid the warning for the weak_alias for _DIRENT_MATCHES_DIRENT64
+CFLAGS-getdirentries64.c = -Wno-deprecated-declarations
 endif
 
 ifeq ($(subdir),nis)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [glibc/azanella/bz23960] dirent: Deprecate getdirentries
@ 2020-04-17 13:23 Adhemerval Zanella
  0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella @ 2020-04-17 13:23 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=aeb11324a56e6d6950904a41aced147c153ae8e3

commit aeb11324a56e6d6950904a41aced147c153ae8e3
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Apr 17 09:59:51 2020 -0300

    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.

Diff:
---
 NEWS            | 3 +++
 dirent/dirent.h | 7 ++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 2424fecdc0..58d9db6d00 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,9 @@ Deprecated and removed features, and other changes affecting compatibility:
   but always fails with ENOSYS.  This reflects the removal of the system
   call from all architectures, starting with Linux 5.5.
 
+* The function getdirentries is now deprecated, applications should use
+  either getdents or POSIX readdir instead.
+
 Changes to build and runtime requirements:
 
   [Add changes to build and runtime requirements here]
diff --git a/dirent/dirent.h b/dirent/dirent.h
index 92d0925047..4ee60471f7 100644
--- a/dirent/dirent.h
+++ b/dirent/dirent.h
@@ -353,14 +353,15 @@ extern int alphasort64 (const struct dirent64 **__e1,
 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__;
 # 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)
+     __THROW __nonnull ((2, 4)) __attribute_deprecated__;
 #  else
 #   define getdirentries getdirentries64
 #  endif
@@ -370,7 +371,7 @@ extern __ssize_t __REDIRECT_NTH (getdirentries,
 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__;
 # endif
 #endif /* Use misc.  */


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-02 13:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-02 13:53 [glibc/azanella/bz23960] dirent: Deprecate getdirentries Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2020-04-17 13:23 Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).