From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F9C1C433E0 for ; Wed, 24 Jun 2020 16:20:00 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7CC9A20768 for ; Wed, 24 Jun 2020 16:20:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CC9A20768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jo87j-0005xs-Bw; Wed, 24 Jun 2020 16:19:43 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jo87i-0005xn-1C for xen-devel@lists.xenproject.org; Wed, 24 Jun 2020 16:19:42 +0000 X-Inumbo-ID: 818c1964-b636-11ea-bb8b-bc764e2007e4 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 818c1964-b636-11ea-bb8b-bc764e2007e4; Wed, 24 Jun 2020 16:19:41 +0000 (UTC) Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: uas/xXVt+4AcmAKP1VNu1dvnjXMglspU4h6VpuY1tkC+ehM7mbzL4UeCZugdtid4QOath1VofJ w9SCIoKFek7dak6ftHRFg4Bu6QD9LsA2JY7O99MU2QGel9HHZ1AK5+ytq0CHosma1sQak2p+Oc aZb8gTwCHsAYIEpbT0bgX2Bgikf3hzpM85ofnLf34k6B1eboMOuKX2f69cIr9qLarGgqT6fxjl sletYTA23AHMQG4LEjurfsp/B9hQzoJYAoDanRnhf8cDvi3kvB/W2yX822lu2Q63xG6aJjSRie V7Q= X-SBRS: 2.7 X-MesageID: 20841141 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.75,275,1589256000"; d="scan'208";a="20841141" From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-ID: <24307.32018.502303.817846@mariner.uk.xensource.com> Date: Wed, 24 Jun 2020 17:19:30 +0100 To: Jan Beulich Subject: [XEN RFC for-4.14] Re: use of "stat -" In-Reply-To: <0b449d5a-9629-8e41-5354-b985a063eba4@suse.com> References: <3bfd6384-fcaf-c74a-e560-a35aafa06a43@suse.com> <20200512141947.yqx4gmbvqs4grx5g@liuwe-devbox-debian-v2.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net> <4b90b635-84bb-e827-d52e-dfe1ebdb4e4d@citrix.com> <814db557-4f6a-020d-9f71-4ee3724981e3@suse.com> <20200512195005.GA96154@mattapan.m5p.com> <049e0022-f9c1-6dc9-3360-d25d88eeb97f@citrix.com> <20200512225458.GA1530@mattapan.m5p.com> <24253.9543.974853.499775@mariner.uk.xensource.com> <0b449d5a-9629-8e41-5354-b985a063eba4@suse.com> X-Mailer: VM 8.2.0b under 24.5.1 (i686-pc-linux-gnu) X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Paul Durrant , Andrew Cooper , Jason Andryuk , Elliott Mitchell , "xen-devel@lists.xenproject.org" Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Jan Beulich writes ("Re: use of "stat -""): > [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments unless you have verified the sender and know the content is safe. > On 14.05.2020 13:02, Ian Jackson wrote: > > I've read this thread. Jan, I'm sorry that this causes you > > inconvenience. I'm hoping it won't come down to a choice between > > supporting people who want to ship a dom0 without perl, and people who > > want a dom0 using more-than-a-decade-old coreutils. > > > > Jan, can you tell me what the output is of this on your ancient > > system: > > > > $ rm -f t > > $ >t > > $ exec 3 > $ stat -L -c '%F %i' /dev/stdin <&3 > > regular empty file 393549 > > $ rm t > > $ stat -L -c '%F %i' /dev/stdin <&3 > > regular empty file 393549 > > $ strace -ou stat -L -c '%F %i' /dev/stdin <&3 > > $ > > $ rm -f t > $ >t > $ exec 3 $ stat -L -c '%F %i' /dev/stdin <&3 > regular empty file 3380369 > $ rm t > $ stat -L -c '%F %i' /dev/stdin <&3 > regular empty file 3380369 > $ strace -ou stat -L -c '%F %i' /dev/stdin <&3 > regular empty file 3380369 > > > Also, the contents of the file "u" afterwards, please. > > Attached. Thanks. I think this means that `stat -' can be replaced by `stat /dev/stdin'. This script is only run on Linux where /dev/stdin has existed basically forever. The strace output shows stat("/dev/stdin", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 and the transcript shows that your stat(1) behaves as I hope. Jan, will you send a patch ? It is best if someone else but me writes it and tests it because then I am a "clean" reviewer. Paul, supposing I review such a patch and say it is low risk, and we commit it by Friday, can it have a release-ack ? Thanks, Ian.