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
syscall: Windows Errno constants invalid #32309
Comments
There do exist fake windows syscall Errnos. They won't go away entirely. But the fakes should only be used for traditional Unix errors that don't exist in Windows world. For example ENOENT and ENOTDIR already map to real windows errors instead of being provided by fakes. In the same way, ENOTEMPTY should map to ERROR_DIR_NOT_EMPTY. Perhaps there are others too. But to be clear, some (many) of the fakes will remain. |
I'm unclear why each Errno that cannot appear on windows has a unique value. I would expect them to share a value, e.g. 0xbad5eed. |
I think we're at NeedsFix here... Should this be assigned to someone? |
Kindly pinging @jordanrh1 @alexbrainman |
Sure, I am happy to investigate. But I don't understand what the problem is. @networkimprov, please, try again. Thank you. Alex |
@rsc or @ianlancetaylor, could you suggest a course of action? |
In zerrors_windows.go |
Also the top comment re "mkerrors_windows.sh" should be removed, and maybe the file renamed, since it's no longer script-generated. Any takers? This is tagged for 1.13. |
I know some error constants or signal types are fake on Windows. IMO, the fake errors on Windows is required to implement using runtime.GOOS. if runtime.GOOS == "windows" {
// do windows specific
} else {
if err == syscall.ENOTEMPTY {
}
} As you know, we can separate this code to per OS's files with build constraints. However, we should provide simple way to write code. |
I don't follow you. Did you see Ian's request? #32309 (comment) This set: https://golang.org/src/syscall/zerrors_windows.go#L6 |
I just meant that it must not be removed. For about values of the UNIXish constaint, because it is OS specific valuse, that should be set same value defined in header file of mingw compiler. Additional I'm not sure, I don't think that all of UNIX constaint values can be mapped to Windows constaint. |
@ianlancetaylor any thoughts on others to ping for this? |
@networkimprov, please feel free to send a CL fixing this but otherwise Ian and others also have a lot on their plates, moreover right before Gophercon and with Go1.3 about to be released so the pings might be perceived as pressure. |
Sorry... Ian tagged it 1.13; I wouldn't have asked otherwise. |
Thanks. I don't think there is anything new here. If nobody sends in a CL shortly, we'll kick it to 1.14. |
@gopherbot add NeedsFix |
Change https://golang.org/cl/208537 mentions this issue: |
These constants: https://golang.org/src/syscall/types_windows.go#L7
Should appear in these constants: https://golang.org/src/syscall/zerrors_windows.go#L16
... because the latter are currently useless for comparison with Errno values, unlike other supported OSes. For example
err.(*os.PathError).Err == syscall.ENOTEMPTY
is never true on Windows.Filed at request of @rsc
@gopherbot add OS-Windows
The text was updated successfully, but these errors were encountered: