[MacPorts] #58729: legacy-support missing futimens() (and utimensat)

MacPorts noreply at macports.org
Tue Feb 2 01:36:44 UTC 2021


#58729: legacy-support missing futimens() (and utimensat)
-----------------------------+----------------------
  Reporter:  RJVB            |      Owner:  kencu
      Type:  enhancement     |     Status:  assigned
  Priority:  Normal          |  Milestone:
 Component:  ports           |    Version:
Resolution:                  |   Keywords:
      Port:  legacy-support  |
-----------------------------+----------------------

Comment (by Ionic):

 Replying to [comment:19 Ionic]:
 > I'll rewrite the test to do other sanity checking on non-APFS file
 systems, though. We *can* test if the a/mtimes set by our version of
 `utimensat` is within seconds and microseconds range. That should be good
 enough for things like HFS+ and, frankly, Apple's native implementation
 probably won't behave differently on HFS+ either. I'm going to make sure
 that that's the case.

 Or, actually, it turns out that HFS+ doesn't even support microseconds.

 That actually leads to an interesting observation: no file system I know
 of that is writable on OS X actually supports sub-second time precision
 (other, than, MAYBE... NFS and SMB?)

 If that's true, `utimensat` could essentially just be glorified wrapper
 for `utime` (1-second precision) or `utimes` (microsecond precision, in
 theory, if the file system supports that...)

 So, essentially we could have just provided a wrapper called `utimensat`,
 but really executing `utimes`, because that's all we'd never need there.
 It probably doesn't hurt to backport and hurt the "proper" code from XNU,
 but it also won't bring us any benefit.


 Anyway, regarding the test cases: for non-APFS file systems, I will check
 if our `utimensat` implementation behaves the same as `utimes`. That
 should be sane enough. Apple's implementation does, too, of course.

-- 
Ticket URL: <https://trac.macports.org/ticket/58729#comment:20>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list