-
Notifications
You must be signed in to change notification settings - Fork 385
fix S_IFMT value on windows, plan9 and js/wasm #329
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
Conversation
syscall_fixed.go
Outdated
@@ -0,0 +1,5 @@ | |||
// +build plan9 windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably also want this for js,wasm
:
https://github.com/golang/go/blob/master/src/syscall/syscall_js.go#L159
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
c38be39
to
d9b1aad
Compare
Go defines S_IFMT on windows, plan9 and js/wasm as 0x1f000 instead of 0xf000. None of the the other S_IFxyz values (even on those mentioned) include the "1" (in 0x1f000) which prevents them from matching the bitmask. This fixes that by overriding the S_IFMT value on the effected platforms to be 0xf000, as it it on all others.
d9b1aad
to
0277caa
Compare
I added js/wasm, updated the commit message and added a comment to the _fixed version noting the reasoning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to double check the build tag directive semantics, but it looks like everything is good. 👍
Thanks. I had to double check the build tags as well. First time I had a that logic combo. |
Go defines S_IFMT on windows, plan9 and js/wasm as 0x1f000 instead of 0xf000. None of the the other S_IFxyz values include the "1" (in 0x1f000) which prevents them from matching the bitmask.
This fixes that by overriding the S_IFMT value on the effected platforms to be 0xf000, as it it on all the others.
Fixes #291