develooper Front page | perl.perl5.porters | Postings from May 2002

File::stat::stat test issue

From:
Chip Turner
Date:
May 28, 2002 23:55
Subject:
File::stat::stat test issue
Message ID:
vzkk7pnv3x8.fsf@minbar.devel.redhat.com

The test in the SKIP block of the File::stat test script has a logic
issue.  It assumes that perl's open method behaves like the native
OS's open method with respect to atime.  However, this isn't
necessarily the case, as perl's open may go any number of routes
(perlio, stdio, sfio, etc).  One such route involves a mmap of the
file for faster performance (ie, glibc changed its fopen behavior).
Since perl seems to be calling fopen instead of open in some cases
(-Uuseperlio in this example), I don't believe the specs state that
the atime of the file must be unmodified, as they do with fopen.  So
the test that ensires the atime before and after opening the file read
only are the same is incorrect.  That is, unless perl wants to ensure
this behavior to applications, in which case a lot of other changes
need making in the IO layers.

It's trivial to patch this test away, so I've not included it here.
This, and the previous issue with readonly mmap stdio from the
upcoming glibc 2.3.0, are going to be very common issues as various
linuxes move towards newer glibc's.  The mmap stdio issue is fixed
with -Uuseperlio, though this is probably not quite optimal.

Chip

-- 
Chip Turner                   cturner@redhat.com
                              Red Hat, Inc.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About