feat: implement utimensat and futimens syscalls #617
+404
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add support for the
utimensat(2)andfutimens(3)syscalls which allow setting file access and modification times with nanosecond precision.Changes
litebox_common_linux
UTIME_NOW(0x3fffffff) andUTIME_OMIT(0x3ffffffe) constantsTimespechelper methods:is_utime_now(),is_utime_omit(),is_valid_for_utimensat()Sysno::utimensat,Sysno::utimensat_time64, andSysno::futimenslitebox (core)
SetTimesErrorenum for filesystem time-setting errorsset_times()andfd_set_times()methods toFileSystemtraitlitebox_shim_linux
sys_utimensat()with full path resolution and flag handlingsys_futimens()for fd-based timestamp modificationAT_SYMLINK_NOFOLLOWandAT_EMPTY_PATHflagsTimeProviderfor current time whenUTIME_NOWis specifiedTesting
cargo buildpassescargo clippy --all-targets --all-featurespasses with no new warningscargo test -p liteboxpasses (85 tests)cargo test -p litebox_common_linuxpassesKnown Limitations (documented as TODOs in code)
AT_SYMLINK_NOFOLLOWflag is accepted but not fully functional until symlinks are implementedFdRelativepath resolution returnsENOSYSRelated
This addresses one of the syscalls commonly needed by applications. See
docs/link_syscall_design.mdfor context on recent syscall implementations.