Skip to content

Conversation

@thomcc
Copy link
Contributor

@thomcc thomcc commented Aug 10, 2021

I was doing macOS ulock stuff, and was linked to Zig's DarwinFutex implementation by @kprotty. There were a few bugs I noticed:

  • __ulock_wait2 actually timeout as a u64, not u32 (this likely happens to work on at least x86_64 because of how the ABI works, but I can't say about others, and it's still UB either way).
  • Semantically, __ulock_wait2's timeout is in units of nanoseconds (this would just lead to waking up early which callers have to handle, but still).
  • EFAULT is not handled, but seems like it should be? At least almost all uses in system libraries / tests have it handled.

r? @kprotty

@daurnimator daurnimator added the standard library This issue involves writing Zig code for the standard library. label Aug 11, 2021
@kprotty
Copy link
Contributor

kprotty commented Aug 14, 2021

Nice, any other changes you wish to make?

@thomcc
Copy link
Contributor Author

thomcc commented Aug 14, 2021

Nope, unless anybody has issues I think its good to land

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

standard library This issue involves writing Zig code for the standard library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants