From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by sourceware.org (Postfix) with ESMTP id B69AF3858D20 for ; Mon, 26 Jun 2023 13:50:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B69AF3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=nabijaczleweli.xyz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nabijaczleweli.xyz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202305; t=1687787410; bh=UNIFQUqyX99cfuMaOaQpK3TtvH4inYvrHwu4Y/0KUaA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KWeq+x8u7UqM2ltHrgsWVb3GPhqi8gwKr7n5jIsxMevMg4uAJARwSAjW18C+boBf0 4TdTx4HYiuSHu0bL2Df4Gjwlt3PRm+MA85BY4wex8T3i5PqTf7/tt1TE054HJqFW55 YkpCys5mKDw5UjOn3kK2F7ojqa6vuiakdfEqJhNh9qx6cZFBf/oe24zalU7sLfZOO+ pKw+ZPqLLK1ahsER+Za3v8iUdmXUflzG2M16k+jV8bV+q7bFJE7Fvp97lKpk3tDDjB fg0jHM7blANoy6sScQ12NcgMJwJMvTgYCMnchXiYDZ9zJkhmHDu82uB4/eOkkO6VwR VIVEKQlebTQog== Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 48E28114C; Mon, 26 Jun 2023 15:50:10 +0200 (CEST) Date: Mon, 26 Jun 2023 15:50:09 +0200 From: =?utf-8?B?0L3QsNCx?= To: Florian Weimer Cc: libc-alpha@sourceware.org Subject: [PATCH 3/2] statvfs: f_type: NEWS & test Message-ID: References: <87cz1i74b2.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="o5lleybqhrc7wd5v" Content-Disposition: inline In-Reply-To: <87cz1i74b2.fsf@oldenburg.str.redhat.com> User-Agent: NeoMutt/20230517 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_INFOUSMEBIZ,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --o5lleybqhrc7wd5v Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Also fix tst-statvfs so that it actually fails; as it stood, all it did was return 0 always. Signed-off-by: Ahelenia Ziemia=C5=84ska --- NEWS | 5 +++++ io/tst-statvfs.c | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 709ee40e50..fc2392f168 100644 --- a/NEWS +++ b/NEWS @@ -48,6 +48,11 @@ Major new features: * The strlcpy and strlcat functions have been added. They are derived from OpenBSD, and are expected to be added to a future POSIX version. =20 +* struct statvfs now has an f_type member, equal to the f_type statfs memb= er; + on the Hurd this was always available under a reserved name, + and under Linux a spare has been allocated: it was always zero + in previous versions of glibc, and zero is not a valid result. + Deprecated and removed features, and other changes affecting compatibility: =20 * In the Linux kernel for the hppa/parisc architecture some of the diff --git a/io/tst-statvfs.c b/io/tst-statvfs.c index 227c62d7da..4f509faa31 100644 --- a/io/tst-statvfs.c +++ b/io/tst-statvfs.c @@ -1,5 +1,7 @@ #include +#include #include +#include =20 =20 /* This test cannot detect many errors. But it will fail if the @@ -11,17 +13,18 @@ do_test (int argc, char *argv[]) for (int i =3D 1; i < argc; ++i) { struct statvfs st; - if (statvfs (argv[i], &st) !=3D 0) - printf ("%s: failed (%m)\n", argv[i]); - else - printf ("%s: free: %llu, mandatory: %s\n", argv[i], - (unsigned long long int) st.f_bfree, + struct statfs stf; + TEST_VERIFY (statvfs (argv[i], &st) =3D=3D 0); + TEST_VERIFY (statfs (argv[i], &stf) =3D=3D 0); + TEST_VERIFY (st.f_type =3D=3D stf.f_type); + printf ("%s: free: %llu, mandatory: %s\n", argv[i], + (unsigned long long int) st.f_bfree, #ifdef ST_MANDLOCK - (st.f_flag & ST_MANDLOCK) ? "yes" : "no" + (st.f_flag & ST_MANDLOCK) ? "yes" : "no" #else - "no" + "no" #endif - ); + ); } return 0; } --=20 2.39.2 --o5lleybqhrc7wd5v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmSZl5AACgkQvP0LAY0m WPE1bg/+K81zDxp3H/+XVAhlgFWwvMFmKalp82SJeodzGNYjnsBRVJI/21fZRlBE A9tYcTxlQ+Hnr0iB8Nslnku96Q62fKiA7KgwD1l9U4nnyDehWLvONBtvjxHw7zxy kvLzs9l+i+14Zr8V+v0SsAyodYFNVxpQ3mAHgCrU2dnase7C0rIfhIuV3iK+SZAC pFvVmkXpl59W5Ht42uN3+/rhFYavNUaF0d4M5g8uFC600fLgjPz1z2lq+79tLF6V IvViJlysinp2d/xFbLMS6EQf+qh56U2I8Vcv8FS5HJnwWgz5/+D5Oo3xIAKR5F2d vX9INDQlkyDvfdS8tNWjAGpbqxKyo1fMxc9kg95lLgCEEuSK+TEXUjRfl3SHsMXy yOiasqoKuQjk+Gjq9J4q44UCOMo62flDrkj1VpHIUa4TGrbFSTHy0qpEfakQHjG4 hegQwG2VA4/Xb7dgfKoenusQtCNolqA31kOQWznsG0JfnuKvz/r5Ao2EIDvHnXZh bwWvxhxmVs8+deiGzqtAkMLbvtoy5AE3+X+jB5w9QIX1Oz5sbzAnhFmfWTOnrYMq p8quGOulpzsZyl+RXfcB2mgy6QE3bxB0d6p75fC9KdJBXGDN9OwzWmxtmODm7rAe isT+ftxp5qGpYk81rnt+BkyzbeWxcmCTDVplo3yBCpzKOD31wwc= =+Jfh -----END PGP SIGNATURE----- --o5lleybqhrc7wd5v--