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=-1.9 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,MISSING_HEADERS,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31986 invoked from network); 23 Jun 2023 20:36:35 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 23 Jun 2023 20:36:35 -0000 Received: (qmail 15871 invoked by uid 550); 23 Jun 2023 20:36:29 -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 15828 invoked from network); 23 Jun 2023 20:36:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202305; t=1687552573; bh=gvLMZ6OA//nZh7Hx/9NNTlN+LEZPslHiyqe+5vpEws8=; h=Date:From:Cc:Subject:From; b=e7/vfVcQXIQgv0gPER1KcBiaevZhoHGIT2Y/xpPQr7jvzxzBw1108BfqI0PQ413qh GHfYLy7iQUlj8y5E9CgN2VxyJ0JHk6O4YrtG8qUtoiaoVP6v7HUbV9dp/SoC/0IMG1 SfNuDuYKlP7ehm/ax+ACM3VuEZGKAisNU+1FUnku+kzGrO6Y06rXtCDVV8yWm5X6Jg y2FyvqljGQfLcjWwb3E9q+haWlYJFOY2nxUsx15h5P7mhpjV/1AxPECcfdfxv9VdkG aUYh5hrMKs/LGVVs1mrsh7KL8UkzYvuSmD0QZEz4wCvL10aRSVUuqMrI73tLSD+7C1 cfubgxtXxeMeA== Date: Fri, 23 Jun 2023 22:36:11 +0200 From: =?utf-8?B?0L3QsNCx?= Cc: musl@lists.openwall.com Message-ID: <2a5yr4pg5a2lt5enykfhqezpggsdhkn6j2cpslls5n26qaffss@jz5pftqutx6t> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="j7irk52qmanhy4me" Content-Disposition: inline User-Agent: NeoMutt/20230517 Subject: [musl] [PATCH] [f]statvfs: allocate spare for f_type --j7irk52qmanhy4me 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 --- 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 --j7irk52qmanhy4me Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmSWAjsACgkQvP0LAY0m WPFyAQ/8CVNjtnKRy0tUGMlyuEW2Iv7OmQbg90WuEFUX/c7z+EGE6ECvEZ82Hq3l n4ayk8cvJQePU/TVYBs7RUQLQVWnKFI5+5oSRXq/9K/qMTKGzTuYD+lQuprf7UWl tFdciQ6smuigQ/Js0wf8fTkFImsoW5kdnR+oepCfKrr+dCXAhx9lqF2yP6Qwybqj iz/YuW8d6ND41660gbQEUCDeB/uizixo/58xShoO9Kp/Ziw2JDiS7Nl3dsOHV/gI thB+RPEy87BVmLRti2sOwrFLzcYLKNnmuAjv3hZiAp9G+yQvMNIZwhGtBscjP014 mWShP7xOJr7dtC7P79HTRqSHaL3IMml4zFwvb/zAhl5Tx5+puvd+iK1SeYNe5DMP Fq2LeSuTOZJXAOJ35SB/hl6P9kCNzB8+jUlvgnGm96ifOlTsPWHU8xE33ial5pry ej59YXRTDprAKyb4/8Y2IERR1SxrvTKj5/G9sfKZA252gjFVKngZkV6k9vgbX8RZ 5485EJmKFr/j49tpGjYvUe+8Ta22fAz3kjSVndjlYkvKLO+3Wcsm0jmunJ9waclp Q+JUtQCX8Hi7HK+EnHdYzNMHPV2VhmyodUT8W2V3zsUd2G5CIoxEKCtwI+2y+QGR +0dWrqPVtPGGuiX1TMob70CLQjXFrrpqGZO5vqk9dE/ySjUQpCY= =xMD1 -----END PGP SIGNATURE----- --j7irk52qmanhy4me--