patch not updating atime

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Mon Jul 11 15:13:17 PDT 2005


hey,

I just ran into an atime update issue:

printf "1\n\2\n\3\n" > data
printf "1\n\4\n\3\n" > data2
diff -u data data2 > data.diff
sleep 60      # wait some time
patch -o data.out -i data.diff data
ls -lu data data2 data.diff data.out

-rw-r--r--  1 corecode  corecode    6 Jul 12 00:08 data
-rw-r--r--  1 corecode  corecode  119 Jul 12 00:09 data.diff
-rw-r--r--  1 corecode  corecode    6 Jul 12 00:09 data.out
-rw-r--r--  1 corecode  corecode    6 Jul 12 00:08 data2

note that data, which actually was used as input source, doesn't
have a changed atime.

I guess this is because patch(1) does an open(2)+mmap(2), but
never an actual read. Shouldn't we at least set the atime on
open(2) [don't know if it's feasible for mmap/faulting in the
pages]?

cheers
  simon

-- 
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low $$$ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
Attachment:
pgp00004.pgp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00004.pgp
Type: application/octet-stream
Size: 189 bytes
Desc: "Description: PGP signature"
URL: <http://lists.dragonflybsd.org/pipermail/bugs/attachments/20050711/e3507eb7/attachment-0021.obj>


More information about the Bugs mailing list