[haiku-bugs] Re: [Haiku] #15102: stat() modifies the access time of an existing file.

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Mon, 10 Jun 2019 17:36:26 -0000

#15102: stat() modifies the access time of an existing file.
----------------------------+----------------------------
   Reporter:  return_0e     |      Owner:  nobody
       Type:  bug           |     Status:  new
   Priority:  low           |  Milestone:  Unscheduled
  Component:  System/POSIX  |    Version:  R1/Development
 Resolution:                |   Keywords:
 Blocked By:                |   Blocking:
Has a Patch:  0             |   Platform:  All
----------------------------+----------------------------

Comment (by bga):

 This is a BFS issue. It does not store access time anywhere and , instead,
 simple use the local time whenever stat is called on a file.

 Form the Linux stat man page:

 {{{
 The field st_atime is changed by file accesses, for example, by execve(2),
 mknod(2), pipe(2), utime(2) and read(2) (of more than zero bytes). Other
 routines, like mmap(2), may or may not update st_atime.
 }}}

 it does not explicitly say that but it is implied that stat should not
 change atime. Maybe BFS should be changed to match this behavior?
 Returning simply the time stat happened is a neat trick but also a bit
 useless.

-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15102#comment:1>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: