vms-3dd: RMS XAB dates are real VMS binary time, not raw Unix time_t - #442
Merged
Merged
Conversation
rms_impl_display() stuffed raw Unix time_t (seconds since 1970) straight into xab$q_cdt/xab$q_rdt, which VMS defines as 100-nanosecond intervals since the base date 17-NOV-1858 (VSI OpenVMS Programming Concepts Manual, Vol. I, "System Time Format"). A raw time_t read as that quadword decodes to a few minutes past 1858 — ~112 years off and in the wrong units, so DIRECTORY/DATE, $ASCTIM and any XABDAT reader got garbage dates. Convert st_ctime/st_mtime through the existing RTL converter lib$cvt_vectim (src/libvms/rtl/lib_datetime.c), which owns the documented VMS_EPOCH_OFFSET constant — no new magic constant, no duplicated conversion, no new cross-image symbol. gmtime_r breaks the absolute Unix instant into its UTC calendar fields; lib$cvt_vectim's timegm() inverts gmtime() exactly, so the same wall-clock instant round-trips. Test: test_xab_dates in tests/vmsrms sets a known revision instant (15-JUN-2021 12:00:00 UTC) via utimensat, $DISPLAYs the XABDAT, asserts the quadword is a real post-1970 VMS time (catches the old raw-time_t bug), round-trips to the exact instant, and that $ASCTIM renders "15-JUN-2021 12:00:00.00". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
baron-3dl
added a commit
that referenced
this pull request
Aug 13, 2026
#445) Bump OVMX_PRODUCT_VERSION V0.4 → V0.4-1. 24 PRs / 32 commits since V0.4, packed across dimensions (point release toward the 0.5 milestone): self-host (R7) #409 lib$tparse · #411 CLI$ compiled-CLD · #413 sys$setddir #414 lib$get_foreign · #415 sys$filescan (RTL foundation) #418 parse_tables.mar→C (spine #2) · #429 LIBRARIAN.EXE+.OLB (spine #3) #435 shareable-vector freeze (GSMATCH stability) authenticity #421 veracity rubric (Q1 oracle-source/Q2 real-inject) · #424 30 oracle-pinned constants #433 rmsdef.h 74 fabricated RMS codes → oracle UX/DCL/RMS #422 SHOW CLUSTER real membership · #441 DCL per-@-level local scope #442 RMS XAB dates → VMS 1858-epoch quadword networking #419 virtio NIC (user-mode default + opt-in tap/bridge) docs #423 clustering release train + swept: other threads' merged work on main since V0.4 Clustering config-authoring UX (vms-098) + its public-manual grounding gate remain 0.5 (minor) deliverables — not triggered by this point cut. Co-authored-by: alice <alice@workspace.local> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
rms_impl_display()(src/vmsrms/rms_core.c) stuffed raw Unixtime_t(seconds since 1970) straight intoxab$q_cdt/xab$q_rdt. VMS defines those fields as 100-nanosecond intervals since the base date 17-NOV-1858 (VSI OpenVMS Programming Concepts Manual, Vol. I, "System Time Format"). A rawtime_t(~1.6e9) read as that quadword decodes to a few minutes past 1858 — roughly 112 years off and in the wrong units. DIRECTORY/DATE,$ASCTIM, and any XABDAT reader got garbage dates.Draper faithfulness register Tier 1 item.
Fix
Convert
st_ctime/st_mtimethrough the existing RTL converterlib$cvt_vectim(src/libvms/rtl/lib_datetime.c), which owns the documentedVMS_EPOCH_OFFSETconstant.lib$cvt_vectimis already auto-exported by LIBVMS$SHR's symbol vector; the added libc callsgmtime_r/timegmare already in the DECC$SHR vector (mk_decc_shr.sh).gmtime_rbreaks the absolute Unix instant into its UTC calendar fields;lib$cvt_vectim'stimegm()invertsgmtime()exactly, so the same wall-clock instant round-trips.Test
test_xab_datesin tests/vmsrms/test_vmsrms.c:utimensaton the FAB's resolved on-disk path,$DISPLAYs the XABDAT,> VMS_EPOCH_OFFSET) — this alone catches the old raw-time_tbug,$ASCTIMrenders15-JUN-2021 12:00:00.00.ctest -R vmsrms_unitexits 0, all assertions pass.$ASCTIMobserved output:15-JUN-2021 12:00:00.00.Refs vms-3dd.
🤖 Generated with Claude Code