From patchwork Mon Jun 26 13:50:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?0L3QsNCx?= X-Patchwork-Id: 1799959 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=RtK+YiEf; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QqTkb5zSjz20ZP for ; Mon, 26 Jun 2023 23:50:31 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8C4C13858C30 for ; Mon, 26 Jun 2023 13:50:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C4C13858C30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1687787429; bh=SqGu+T2sB1Spp6jx/GtgekBbFtZ4QCBtu9QYUxYkyDY=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=RtK+YiEfc0BAy1+MdLj1nLiPUL+NOUvG5dLwN12P61f6OxD/XaBD540Ypj3e+krPO 6+DiZtyEu9MgXFJoYBOtZ7mKawHXBGXbDAyrYpvC7jQ/xKVn72TzvD9jqp5GiHaWnh M6ZjtgbQhEKrSJhNgu5/CCWrvO0kzq2V8y7l6BgA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 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 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-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 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-Patchwork-Original-From: =?utf-8?b?0L3QsNCxIHZpYSBMaWJjLWFscGhh?= From: =?utf-8?b?0L3QsNCx?= Reply-To: =?utf-8?b?0L3QsNCx?= Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" Also fix tst-statvfs so that it actually fails; as it stood, all it did was return 0 always. Signed-off-by: Ahelenia ZiemiaƄska --- 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. +* struct statvfs now has an f_type member, equal to the f_type statfs member; + 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: * 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 /* 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 = 1; i < argc; ++i) { struct statvfs st; - if (statvfs (argv[i], &st) != 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) == 0); + TEST_VERIFY (statfs (argv[i], &stf) == 0); + TEST_VERIFY (st.f_type == 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; }