Skip to content

Fix clock_gettime on systems without VDSO #2475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 11, 2019

Conversation

LemonBoy
Copy link
Contributor

Using atomics here feels a bit heavy-handed, missing coherence means we may end up initializing the symbol twice but that's not deadly (isn't it?)

@andrewrk
Copy link
Member

Under what circumstances does a Linux system not have VDSO?

Using atomics here feels a bit heavy-handed, missing coherence means we may end up initializing the symbol twice but that's not deadly (isn't it?)

Initializing the symbol twice would be ok, but as far as I understand the atomics are required to prevent data races.

@LemonBoy
Copy link
Contributor Author

Under what circumstances does a Linux system not have VDSO?

Architectures other than x86 may not have a vDSO at all, maybe it's been implemented in newer kernel versions. You may also have turned it off completely via the vdso kernel parameter. Or maybe you're running your binary under qemu's user-mode emulation.

@andrewrk andrewrk merged commit 2ef2f9d into ziglang:master May 11, 2019
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.

2 participants