[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN RFC for-4.14] Re: use of "stat -"



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<t
> >   $ 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<t
> $ 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.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.