From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by sourceware.org (Postfix) with ESMTPS id 209653858022 for ; Thu, 6 Jan 2022 21:48:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 209653858022 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=physik.fu-berlin.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=zedat.fu-berlin.de Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.94) with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (envelope-from ) id 1n5acL-001kXU-Gg; Thu, 06 Jan 2022 22:48:17 +0100 Received: from p57bd91bf.dip0.t-ipconnect.de ([87.189.145.191] helo=[192.168.178.81]) by inpost2.zedat.fu-berlin.de (Exim 4.94) with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (envelope-from ) id 1n5acL-000KUA-9t; Thu, 06 Jan 2022 22:48:17 +0100 Message-ID: <053a8c1b-90e4-4890-e843-34fe7d78c01f@physik.fu-berlin.de> Date: Thu, 6 Jan 2022 22:48:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH v3 7/7] dirent: Deprecate getdirentries Content-Language: en-US To: Adhemerval Zanella , libc-alpha@sourceware.org, Florian Weimer Cc: Dave Flogeras , James Clarke References: <20201021141542.2003377-1-adhemerval.zanella@linaro.org> <20201021141542.2003377-8-adhemerval.zanella@linaro.org> From: John Paul Adrian Glaubitz In-Reply-To: <20201021141542.2003377-8-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Original-Sender: glaubitz@physik.fu-berlin.de X-Originating-IP: 87.189.145.191 X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2022 21:48:21 -0000 Hi Adhemerval! On 10/21/20 16:15, Adhemerval Zanella wrote: > 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 | 3 +++ > dirent/dirent.h | 14 ++++++++++---- > sysdeps/unix/sysv/linux/Makefile | 3 +++ > 3 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/NEWS b/NEWS > index 3c1e509744..63623dcee2 100644 > --- a/NEWS > +++ b/NEWS > @@ -47,6 +47,9 @@ Deprecated and removed features, and other changes affecting compatibility: > as a compatibility symbol. Applications should use the getrlimit or > prlimit. > > +* The function getdirentries is now deprecated, applications should use > + either getdents64, readdir64 or readdir. > + > Changes to build and runtime requirements: > > * On Linux, the system administrator needs to configure /dev/pts with > diff --git a/dirent/dirent.h b/dirent/dirent.h > index 92d0925047..62bb77b4e1 100644 > --- a/dirent/dirent.h > +++ b/dirent/dirent.h > @@ -348,29 +348,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) > + __THROW __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 09604e128b..242b07734f 100644 > --- a/sysdeps/unix/sysv/linux/Makefile > +++ b/sysdeps/unix/sysv/linux/Makefile > @@ -262,6 +262,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) This particular patch seems to break the apt build: FAILED: apt-pkg/CMakeFiles/apt-pkg.dir/acquire.cc.o /usr/bin/c++ -DAPT_DOMAIN=\"libapt-pkg6.0\" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_WITH_GETLINE=1 -Dapt_pkg_EXPORTS -I/<>/obj-m68k-linux-gnu/include -I/<>/obj-m68k-linux-gnu/include/apt-pkg -g -O2 -ffile-prefix-map=/<>=. -specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wcast-align -Wlogical-op -Wredundant-decls -Wmissing-declarations -Wunsafe-loop-optimizations -Wctor-dtor-privacy -Wdisabled-optimization -Winit-self -Wmissing-include-dirs -Wnoexcept -Wsign-promo -Wundef -Wdouble-promotion -Wsuggest-override -Werror=suggest-override -Werror=return-type -std=gnu++17 -MD -MT apt-pkg/CMakeFiles/apt-pkg.dir/acquire.cc.o -MF apt-pkg/CMakeFiles/apt-pkg.dir/acquire.cc.o.d -o apt-pkg/CMakeFiles/apt-pkg.dir/acquire.cc.o -c /<>/apt-pkg/acquire.cc In file included from /usr/include/features.h:472, from /usr/include/m68k-linux-gnu/c++/11/bits/os_defines.h:39, from /usr/include/m68k-linux-gnu/c++/11/bits/c++config.h:586, from /usr/include/c++/11/cstring:41, from /<>/obj-m68k-linux-gnu/include/apt-pkg/hashes.h:17, from /<>/obj-m68k-linux-gnu/include/apt-pkg/acquire.h:68, from /<>/obj-m68k-linux-gnu/include/apt-pkg/acquire-item.h:22, from /<>/apt-pkg/acquire.cc:17: /usr/include/dirent.h:366:6: error: expected initializer before ‘noexcept’ 366 | __THROW __nonnull ((2, 4)) | ^~~~~~~ See the full build log here: > https://buildd.debian.org/status/fetch.php?pkg=apt&arch=m68k&ver=2.3.14&stamp=1641503494&raw=0 I have built and uploaded a custom version of the glibc package which includes your patch so that the m68k and sh4 buildds based on qemu-user will not be affected by BZ #23960. Do you have any suggestion how to fix this issue? Thanks, Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaubitz@debian.org `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913