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 26F123858C1F for ; Mon, 3 Jul 2023 14:59:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 26F123858C1F 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=1688396360; bh=bOX6K7S2bCx50Y0mWvLjU3N9+jcRM9PRu4kHdc6vLvE=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=LYPYjWwTF66DNsThjbk1xO0AOAwzFumXx4ycmaJCBvMwZskvV9sd+CbARtS2g8AV0 6Tq1NZv89jvZKjeg/aV1Zfx/mi9tlHQ5CDpVW94epKYZ12F3Jf0OqLimRTEcfBVqyq Lj4Z0uPu5MOY1Gz5RYiI1Rq6R/m7of8OHHrXWUEXQtD8MWQNpcw3FdcvZtVLniTFpi QuMzERZfzn50H4xEnkVO+E74OPltB/A4fAQc6rnb7unCGcA2jmBJL4w7y6IQK7ak9u V6hJDxOh3EoQ6lEvm1yCmq4Qj99/SH5NftynWlKSOYtmi+U+4D7RDop3FY7E8p4z36 388sM20UNvNZA== Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id ED6AA13F8; Mon, 3 Jul 2023 16:59:19 +0200 (CEST) Date: Mon, 3 Jul 2023 16:59:18 +0200 From: =?utf-8?B?0L3QsNCx?= Cc: Florian Weimer , libc-alpha@sourceware.org Subject: [PATCH v3 2/3] linux: statvfs: allocate spare for f_type Message-ID: <662dabdece8e902a1234b84cdc46ffefb107397d.1688396342.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qfhp6fcrnn323g22" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20230517 X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_INFOUSMEBIZ,MISSING_HEADERS,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: --qfhp6fcrnn323g22 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable This is the only missing part in struct statvfs. The LSB calls [f]statfs() deprecated, and its weird types are definitely off-putting. However, its use is required to get f_type. Instead, allocate one of the six spares to f_type, copied directly from struct statfs. This then becomes a small glibc extension to the standard interface on Linux and the Hurd, instead of two different interfaces, one of which is quite odd due to being an ABI type, and there no longer is any reason to use statfs(). The underlying kernel type is a mess, but all architectures agree on u32 (or more) for the ABI, and all filesystem magicks are 32-bit integers. Link: https://lore.kernel.org/linux-man/f54kudgblgk643u32tb6at4cd3kkzha6hsl= ahv24szs4raroaz@ogivjbfdaqtb/t/#u Signed-off-by: Ahelenia Ziemia=C5=84ska --- sysdeps/unix/sysv/linux/bits/statvfs.h | 6 ++++-- sysdeps/unix/sysv/linux/internal_statvfs.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/bits/statvfs.h b/sysdeps/unix/sysv/lin= ux/bits/statvfs.h index 8dfb5ce761..cf98460e00 100644 --- a/sysdeps/unix/sysv/linux/bits/statvfs.h +++ b/sysdeps/unix/sysv/linux/bits/statvfs.h @@ -51,7 +51,8 @@ struct statvfs #endif unsigned long int f_flag; unsigned long int f_namemax; - int __f_spare[6]; + unsigned int f_type; + int __f_spare[5]; }; =20 #ifdef __USE_LARGEFILE64 @@ -71,7 +72,8 @@ struct statvfs64 #endif unsigned long int f_flag; unsigned long int f_namemax; - int __f_spare[6]; + unsigned int f_type; + int __f_spare[5]; }; #endif =20 diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c b/sysdeps/unix/sysv= /linux/internal_statvfs.c index 6a1b7b755f..112d3c241a 100644 --- a/sysdeps/unix/sysv/linux/internal_statvfs.c +++ b/sysdeps/unix/sysv/linux/internal_statvfs.c @@ -57,6 +57,7 @@ __internal_statvfs (struct statvfs *buf, const struct sta= tfs *fsbuf) buf->__f_unused =3D 0; #endif buf->f_namemax =3D fsbuf->f_namelen; + buf->f_type =3D fsbuf->f_type; memset (buf->__f_spare, '\0', sizeof (buf->__f_spare)); =20 /* What remains to do is to fill the fields f_favail and f_flag. */ @@ -99,6 +100,7 @@ __internal_statvfs64 (struct statvfs64 *buf, const struc= t statfs64 *fsbuf) buf->__f_unused =3D 0; #endif buf->f_namemax =3D fsbuf->f_namelen; + buf->f_type =3D fsbuf->f_type; memset (buf->__f_spare, '\0', sizeof (buf->__f_spare)); =20 /* What remains to do is to fill the fields f_favail and f_flag. */ --=20 2.39.2 --qfhp6fcrnn323g22 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmSi4kYACgkQvP0LAY0m WPHGxw//cmIP8ib+L5VFxa2lGkm7fixtnpOLup7mKpGyJ5U1Rq3bdzxMA3DOl1l9 GjStRMz1/0usLlc2UV6UKa8GAK2tjQlz4oSXeYm6CnjQuhryFX8zRtXjluif3OiG KT9wp+9BnVpz4DEly4Tli30+QXH5d8efkx81zZBWABcI3UlcxqOBYpSq3t4nnVBK AZv/Da94zefqpDbScVLQk9Xrmp+mcU3cQoARGh9Wy6CYRURMTt2gR2fPJ+7hP2pJ HSORT6uQbzAXSkG0/0L2Lprk8wtMmrea+2RwMLC8FGO35jhAJJhdyKg3x1skXCNC vhTcNuf994oW+G01lIcw9mNB/MYtXssgW80Zv1WJcKqUk1BtncrxS/O8QdkyBAka n/XCBT/i0FzrI3bquSilypaQKlWYFfcm/UZBBSNyjEEexlQGL76KW1OtRzONwyml VSFBYmV6wsC3/LBydsfCLevKBzoIwDIlwzcYls07yPsWjvmKGYBvi+5LBoZpgojr +KUIneTR9SBMfMTpRL9hHZ74lGoyhy8AYxib9LMH8ugIoBOXgNBR3kMXC3fCmunW GgLEoZ7UWxfzsRlezudvp4Jo62k4Apz8p0N2l6ToZW9VnyIAJu2bl+RtYNLXuWqD Yf+LTXjH6I7YnGz1h20hs42239kLop3MYNhKtouwB3K6MDA6h5U= =lXTy -----END PGP SIGNATURE----- --qfhp6fcrnn323g22--