Skip to content
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

Use NULL as zeroTime in wait() #7

Merged
merged 1 commit into from
Apr 29, 2022
Merged

Conversation

dzaninovic
Copy link
Contributor

WaitFor() after ReadAt() was failing for me without this fix on Ubuntu 20.04.

io_getevents() man page says: "Specifying timeout as NULL means block indefinitely until at least min_nr events have been obtained."
https://man7.org/linux/man-pages/man2/io_getevents.2.html

According to the code comment that seems to be what is needed:

//wait for at least one active request to complete
x, _, ret := syscall.Syscall6(syscall.SYS_IO_GETEVENTS, uintptr(a.ctx), uintptr(1), uintptr(len(a.active)), uintptr(unsafe.Pointer(&a.evt[0])), uintptr(unsafe.Pointer(&to)), uintptr(0))

Copy link
Owner

@traetox traetox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet! thanks for the PR, LGTM

@traetox traetox merged commit 14623b8 into traetox:master Apr 29, 2022
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