Use O_NOATIME

This commit is contained in:
hjp 2018-03-05 19:33:19 +00:00
parent 33d8e11a3e
commit 18c9936606
1 changed files with 7 additions and 1 deletions

View File

@ -12,6 +12,12 @@ use IO::Handle;
use Simba::Util qw(quote unquote typestr);
use POSIX qw(strftime);
use Config::YAML;
use Fcntl;
sub O_NOATIME() {
# XXX - possibly specific to Linux x86/amd64
return 01000000;
}
Readonly my $BUFSIZE => 128 * 1024;
#my $BUFSIZE = 128 * 1024;
@ -179,7 +185,7 @@ sub get {
}
if (typestr($st->mode) eq 'f') {
my $fh;
unless (open($fh, '<:raw', $fn)) {
unless (sysopen($fh, $fn, O_RDONLY | O_NOATIME)) {
$fh_out->printflush("fail $path ($!)\n");
return;
}