[FEATURE] Set file timestamps through retained filesystem objects #43

Open
opened 2026-10-27 07:21:16 +01:00 by erikinkinen · 1 comment
Owner

Problem and motivation

The C file bridge needs timestamp-setting interfaces for build outputs and imported tools. Existing administrative metadata setters select paths and carry unsigned nanosecond counters. They cannot express the complete signed file-time domain or provide a conditional operation on a retained compatibility object.

Proposed behavior and scope

Add typed access/modification settings with Explicit, Now and Omit choices, then expose counted erix_c_utimensat and descriptor-based erix_c_futimens through the existing C runtime. Preserve signed seconds and canonical fractions until the actual filesystem checks its representation. A null C time array requests both Now; Now/Omit ignore the corresponding seconds field without reading uninitialized storage.

Implement the operation through LibPosixABI, LibIPC, Posixd, VFS and the existing RAM, ext and selected FAT/exFAT providers. Use one shared conditional metadata outcome type and preserve existing permission wire layouts. Standard aliases, cwd reporting and complete stat records remain separate. Local channels and sockets can validate an Omit/Omit request without a fictitious filesystem candidate; their timestamp mutation needs a separate supported metadata contract.

Authority, security and reliability

Keep the original admitted client, root, scope, object and provider handle throughout the operation. Preserve prefix search permissions. Both Now permits the effective owner or a fresh effective-write decision; explicit or mixed changes require ownership. Both Omit performs target validation without final-file mutation permission checks or clock acquisition. Numeric user zero adds no privilege.

VFS obtains current time through its existing authenticated clock route. Clients cannot supply ctime or claim clock provenance, and they receive no additional clock/provider grant. The provider applies both choices and ctime atomically against the original condition. Omit preserves the current provider field. Range refusal precedes effects; supported precision rounds down. Uncertain completion or rollback retains cleanup-only custody and cannot authorize replay, pathname reopening or ordinary errno success.

Acceptance criteria

  • Add the coordinated typed compatibility and native/provider contracts, canonical encodings, complete correlation and source migration.
  • Implement atomic signed time changes in RAM, ext and supported FAT/exFAT storage, with actual format limits and preserved transactions.
  • Implement original-target Posixd policy and continuations, the C/Rust interfaces, checked intake and the native C consumer without new grants.
  • Cover explicit pre-Epoch values, Now/Omit combinations, permissions, prefix denial, readonly/format boundaries, concurrency, failed retirement and rollback; update contracts and the technical manual.
  • Adopt the complete source graph and complete strict builds, owning tests and relevant guest acceptance. Verify the selected POSIX edition before claiming conformance.

Alternatives and tradeoffs

Extending the old unsigned path setter would retain its range limitation and miss original-object custody. Reading old times in the frontend to implement Omit would race with other writers. Using the provider's current fields under the same conditional mutation avoids that race.

The semantic target is POSIX.1-2024. The directly consulted permission and precision baseline is the IEEE/Open Group 2017 normative text; the current-edition comparison remains part of acceptance.

Tracking and rollout

Extends mediated C file operations, Posixd filesystem semantics and conditional permission changes, using retained VFS objects. Overall completion is tracked in Phase 6.

Agree on the shared contract first, then migrate providers and VFS alongside Posixd and Cstd. Publish the coordinated consumers and source catalogs before claiming the feature complete.

## Problem and motivation The C file bridge needs timestamp-setting interfaces for build outputs and imported tools. Existing administrative metadata setters select paths and carry unsigned nanosecond counters. They cannot express the complete signed file-time domain or provide a conditional operation on a retained compatibility object. ## Proposed behavior and scope Add typed access/modification settings with Explicit, Now and Omit choices, then expose counted `erix_c_utimensat` and descriptor-based `erix_c_futimens` through the existing C runtime. Preserve signed seconds and canonical fractions until the actual filesystem checks its representation. A null C time array requests both Now; Now/Omit ignore the corresponding seconds field without reading uninitialized storage. Implement the operation through LibPosixABI, LibIPC, Posixd, VFS and the existing RAM, ext and selected FAT/exFAT providers. Use one shared conditional metadata outcome type and preserve existing permission wire layouts. Standard aliases, cwd reporting and complete stat records remain separate. Local channels and sockets can validate an Omit/Omit request without a fictitious filesystem candidate; their timestamp mutation needs a separate supported metadata contract. ## Authority, security and reliability Keep the original admitted client, root, scope, object and provider handle throughout the operation. Preserve prefix search permissions. Both Now permits the effective owner or a fresh effective-write decision; explicit or mixed changes require ownership. Both Omit performs target validation without final-file mutation permission checks or clock acquisition. Numeric user zero adds no privilege. VFS obtains current time through its existing authenticated clock route. Clients cannot supply ctime or claim clock provenance, and they receive no additional clock/provider grant. The provider applies both choices and ctime atomically against the original condition. Omit preserves the current provider field. Range refusal precedes effects; supported precision rounds down. Uncertain completion or rollback retains cleanup-only custody and cannot authorize replay, pathname reopening or ordinary errno success. ## Acceptance criteria - [x] Add the coordinated typed compatibility and native/provider contracts, canonical encodings, complete correlation and source migration. - [x] Implement atomic signed time changes in RAM, ext and supported FAT/exFAT storage, with actual format limits and preserved transactions. - [x] Implement original-target Posixd policy and continuations, the C/Rust interfaces, checked intake and the native C consumer without new grants. - [x] Cover explicit pre-Epoch values, Now/Omit combinations, permissions, prefix denial, readonly/format boundaries, concurrency, failed retirement and rollback; update contracts and the technical manual. - [ ] Adopt the complete source graph and complete strict builds, owning tests and relevant guest acceptance. Verify the selected POSIX edition before claiming conformance. ## Alternatives and tradeoffs Extending the old unsigned path setter would retain its range limitation and miss original-object custody. Reading old times in the frontend to implement Omit would race with other writers. Using the provider's current fields under the same conditional mutation avoids that race. The semantic target is POSIX.1-2024. The directly consulted permission and precision baseline is the [IEEE/Open Group 2017 normative text](https://man7.org/linux/man-pages/man3/futimens.3p.html); the current-edition comparison remains part of acceptance. ## Tracking and rollout Extends [mediated C file operations](https://git.erikinkinen.fi/erix/lib-cstd/issues/14), [Posixd filesystem semantics](https://git.erikinkinen.fi/erix/posixd/issues/2) and [conditional permission changes](https://git.erikinkinen.fi/erix/posixd/issues/29), using [retained VFS objects](https://git.erikinkinen.fi/erix/vfsd/issues/16). Overall completion is tracked in [Phase 6](https://git.erikinkinen.fi/erix/integration/issues/65). Agree on the shared contract first, then migrate providers and VFS alongside Posixd and Cstd. Publish the coordinated consumers and source catalogs before claiming the feature complete.
Author
Owner

The coordinated timestamp source is published across the compatibility ABI, C runtime, mediator, VFS and filesystem providers. It preserves signed explicit values and independent Now/Omit settings on retained original objects. Both Omit skips final ownership metadata, and relative directory bases stay held through close or replacement.

The source catalogs and technical manual select the same implementation. The final execution and conformance criterion remains open.

The coordinated timestamp source is published across the compatibility ABI, C runtime, mediator, VFS and filesystem providers. It preserves signed explicit values and independent Now/Omit settings on retained original objects. Both Omit skips final ownership metadata, and relative directory bases stay held through close or replacement. The source catalogs and technical manual select the same implementation. The final execution and conformance criterion remains open.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:35:08 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/posixd#43
No description provided.