From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7668 invoked from network); 17 Aug 2023 20:05:31 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 17 Aug 2023 20:05:31 -0000 Received: (qmail 12146 invoked by uid 550); 17 Aug 2023 20:05:27 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 12111 invoked from network); 17 Aug 2023 20:05:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202305; t=1692302715; bh=++iMGkjTxvuIqPkn/jPVh45BHgHswSQRymfD5k+tiwI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kMaMlVOmp7K5nHcK32x54N4AkiBj7/IQ2Fme9r0R6eKb+uvMLZvKHrruo8LWDEmXB pt1xO9bHUv7NAAwHXyPE6nyAgHC96nzXN8oFO3Dj4gf29FKtg5+VS8Aox0sPqFJ48Z uqpnGnl9uZWAJf8y4kKfs0a5tvJCDxZuk9+JGXNcbwwvy8ynxdCWTybXkXalLF1wu4 ZgFYMYhvxQnWDBViQsXF+T+5kZ4rPee4TKnJP36hWmxz20ekGbHSUZExdqnSirR9M6 xg/yoV96hfnFoiL+kuHIeuHrMlMqOb5dU2Kh1MuzatVS0VwoAdP0u7dH4OggAZ5hrI Z4Vsow9KouhoA== Date: Thu, 17 Aug 2023 22:05:14 +0200 From: =?utf-8?B?0L3QsNCx?= To: Szabolcs Nagy Cc: musl@lists.openwall.com Message-ID: References: <20230624043939.GC3630668@port70.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="736d4l77dnpwesqn" Content-Disposition: inline In-Reply-To: <20230624043939.GC3630668@port70.net> User-Agent: NeoMutt/20230517 Subject: [musl] [PATCH v2] [f]statvfs: allocate spare for f_type --736d4l77dnpwesqn Content-Type: text/plain; charset=us-ascii 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 extension to the standard interface on Linux, 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 Link: https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3D92861d93cdad= 13834f4d8f39504b550a80ad8200 --- Applied in glibc for 2.39, so resending rebased. include/sys/statvfs.h | 3 ++- src/stat/statvfs.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/sys/statvfs.h b/include/sys/statvfs.h index 57a6b806..71d9d1f9 100644 --- a/include/sys/statvfs.h +++ b/include/sys/statvfs.h @@ -23,7 +23,8 @@ struct statvfs { unsigned long f_fsid; #endif unsigned long f_flag, f_namemax; - int __reserved[6]; + unsigned int f_type; + int __reserved[5]; }; =20 int statvfs (const char *__restrict, struct statvfs *__restrict); diff --git a/src/stat/statvfs.c b/src/stat/statvfs.c index bfbb5fee..bc12da8b 100644 --- a/src/stat/statvfs.c +++ b/src/stat/statvfs.c @@ -39,6 +39,7 @@ static void fixup(struct statvfs *out, const struct statf= s *in) out->f_fsid =3D in->f_fsid.__val[0]; out->f_flag =3D in->f_flags; out->f_namemax =3D in->f_namelen; + out->f_type =3D in->f_type; } =20 int statvfs(const char *restrict path, struct statvfs *restrict buf) --=20 2.39.2 --736d4l77dnpwesqn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmTefXkACgkQvP0LAY0m WPHr/Q/+KFIBCBeqjnolwDCrPgaeRlIZEJ38wVPbG8JPshpf+RQoGyW/hC3gtW4X 6pUFOnFTM+jRHRZpm3YwGu59AeKLUDXn7mvD5f1fyjqhEHhg/YJyRZDFHGQ6KzBH 4B4w+gUbTXU5gcCpgpnST1W2prmGwyRqhS7RCKZpb7oUbD8QmCmh0UrobtJpJqVn ochPJgvFSna09GLVppg5X7WcQ7CYKTFtZRhOb+25zOoYK2sDtxZ5kpRkGtVuudv2 htz7FsdiCFIa8o1xswsWBE2Oe7t0M7vZ2SBgJ9VuHOaYpsxtg2GPBaTvrGtk2jKd CVPL7+jyJzI9QpXvv1FJE/6Lk2Rk3JyudfLDI1FRrqU0T8MAfVoKn/jO/S7pulJO QA7NbzG96iRB2Ouhy5vosvdlZQp7C3Eaw7RuOU+JW2qgYpdDX48Ms716Bc9h2cSB OUmukFEHG3VKeOYVK0TeuBE8+nZgp6PENKPhfabgWTeAVJcDXiP3pSCdmE+M5GeN aFVXwyt/x7dr660mB0F9kc7qGOLUI4w2d0PtPYVvcxRmp4NeD5InxCOOJ98bmhvW z8VGMd9mylwOcSiiBLLzqNaI5bqUihsMTvCaZZ73Q6Bj/DTT46qjOATkWurWWApN NRNc7X1bQm+eNI6AQ8DwHStK12/lHS3SbdEFO+hYW1YVttQR6YI= =O0ga -----END PGP SIGNATURE----- --736d4l77dnpwesqn--