It appears that sbin/restore already knows the full-resolution timestamps,
so the only thing to do is to stop converting the timespecs to timevals
and use futimens() and utimensat().
Details
- Reviewers
- None
- Commits
- rS279986: restore: Preserve timestamps to the nanosecond.
Dump and restore a small UFS image with a few file types in it.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Looks fine to me. I only have one tangential question: have you thought about making convenience wrappers in libc for utimens() and lutimens() that would call utimensat() with the respective flags?
Thanks.
I only have one tangential question: have you thought about making convenience wrappers in libc for utimens() and lutimens() that would call utimensat() with the respective flags?
I don't think the benefit (fewer parameters to functions) is worth the cost (more functions, non-standard functions) here. Also, utilities like touch actually benefit from the flag parameter, since it replaces multiple function pointers (stat/lstat and utimes/lutimes) with one flag variable (0/AT_SYMLINK_NOFOLLOW).