Skip to content

os: always use std.posix.system.clock_gettime to avoid direct syscall… - #427

Merged
lalinsky merged 1 commit into
mainfrom
clock-gettime
May 28, 2026
Merged

lalinsky merged 1 commit into
mainfrom
clock-gettime

Conversation

@lalinsky

Copy link
Copy Markdown
Owner

… without vDSO

#425

@coderabbitai

coderabbitai Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: df2c99eb-7299-4b13-82fd-8f71554f6652

📥 Commits

Reviewing files that changed from the base of the PR and between fe6ee95 and 388a976.

📒 Files selected for processing (1)
  • src/os/time.zig

📝 Walkthrough

Walkthrough

The PR consolidates POSIX time operations in src/os/time.zig by switching from the project's custom posix layer to Zig's standard library std.posix.system for clock and timespec handling on non-Windows platforms. The call logic and error handling are unchanged.

Changes

POSIX clock API consolidation

Layer / File(s) Summary
Clock source swap in now function
src/os/time.zig
now replaces posix.system.timespec, posix.system.clock_gettime, and posix.errno with std.posix.system equivalents; clock selection, clock_gettime invocation, and success/failure branches stay the same.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

A clock ticks on, no logic bent,
Just swapping where the time is sent,
From custom posix, tried and true,
To Zig's own standard library's view—
Same moment's still captured true.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: switching to std.posix.system.clock_gettime to avoid direct syscalls when vDSO is unavailable.
Description check ✅ Passed The description directly relates to the changeset, explaining the purpose of using std.posix.system.clock_gettime and referencing the related issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch clock-gettime

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

@lalinsky
lalinsky merged commit b241755 into main May 28, 2026
27 checks passed
@lalinsky
lalinsky deleted the clock-gettime branch May 28, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant