help-bash
[Top][All Lists]
Advanced

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

Re: How to check a file's modify time is at epoch 0?


From: Eli Schwartz
Subject: Re: How to check a file's modify time is at epoch 0?
Date: Wed, 30 Oct 2019 23:49:20 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0

On 10/30/19 5:47 PM, Chet Ramey wrote:
> On 10/27/19 10:00 PM, Eli Schwartz wrote:
>> On 10/27/19 7:29 PM, Peng Yu wrote:
>>> Thanks. But I am looking for something native to bash. Involvement
>>> with external programs will slow down the run time.
>>
>> No, there is no bash builtin that lets you stat the filesize directly.
>>
>> I was going to say, assuming your distribution of bash included the
>> built contents of examples/loadables/, you could use the example
>> loadable 'finfo'. However,
>>
>> $ enable -f /usr/lib/bash/finfo finfo
>> -bash: enable: cannot open shared object /usr/lib/bash/finfo:
>> /usr/lib/bash/finfo: undefined symbol: minor
>>
>> Other loadables provided in my Arch Linux package work fine, just this
>> one does not.
>>
>> Chet -- when I try to compile finfo.c, I get this warning:
>>
>> finfo.c: In function ‘printst’:
>> finfo.c:277:7: warning: implicit declaration of function ‘major’
>> [-Wimplicit-function-declaration]
>>   277 |  ma = major (st->st_rdev);
>>       |       ^~~~~
>> finf.o.c:278:7: warning: implicit declaration of function ‘minor’
>> [-Wimplicit-function-declaration]
>>   278 |  mi = minor (st->st_rdev);
>>       |       ^~~~~
>>
>> If I add an #include <sys/sysmacros.h> then it compiles okay and I can
>> load it and it works as expected.
> 
> Interesting. On Linux, <sys/sysmacros.h> is usually included from
> <sys/types.h> if __USE_BSD is defined (as it is, apparently, on RHEL,
> through one of the twisty maze of defines in <features.h>).

Looking through glibc history, this seems to have been deprecated in
glibc 2.25 and fully dropped in 2.28 -- note that Arch Linux is on 2.30
already.

RHEL 7.7 is on glibc 2.17 according to the almighty google and
distrowatch, RHEL 8 goes straight to glibc 2.28 -- so I guess you have
not updated to RHEL 8 yet, but once you did, you would see this too.

See:

https://sourceware.org/bugzilla/show_bug.cgi?id=19239

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dbab6577c6684c62bd2521c1c29dc25c3cac966f

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e16deca62e16f645213dffd4ecd1153c37765f17





-- 
Eli Schwartz
Bug Wrangler and Trusted User

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]