-
Notifications
You must be signed in to change notification settings - Fork 381
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
Add support for zos/s390x #582
Conversation
switch f & os.O_WRONLY { | ||
case os.O_WRONLY: | ||
out |= sshFxfWrite | ||
switch f & (os.O_RDONLY | os.O_WRONLY | os.O_RDWR) { |
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.
Consider that POSIX standard requires the assertion: O_RDONLY | O_WRONLY == O_RDWR
[1]
However, due to constant folding, I think we’re still fine here regardless.
1: https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html
Removed |
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.
On the lines where you’re adding io/fs
for something, there are available os
aliases. I’m not saying to use the os
version, but it is a possible way to skirt the name clash between io/fs
and github.com/kr/fs
.
Alternatively, I would recommend renaming kr/fs
rather than the standard library. (Even though this probably is a larger change surface.)
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.
Looks great. So much thanks.
stat.go
Outdated
s_ISVTX = uint32(sshfx.ModeSticky) | ||
) | ||
|
||
// Legacy export: |
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.
[golint] godoc should start with S_IFMT
(I know the comments on the pre-existing code wasn’t ideal, and you’re just moving it around.)
Thanks for your feedback! ✌️ |
// 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. | ||
// S_IFMT is a legacy export. `sshfx.ModeType` should be used instead |
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.
The problem is that the sshfx
package is internal
and so no one else can import it. So, the given alternative isn’t useful.
I would say that the local OS might use a different value from what we need to use internally, and there is no reason anyone should need this specific internal value.
We can also merge, and then I can adjust it after.
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.
Ah I see. That makes more sense. Better to have you leave the comment anyways. Thanks again
Would it also be possible to get a new tag that includes the recent changes? |
I want to get the |
Closes #581 #579 #578
Created
stat_zos.go
to alter the syscall constants that were not consistent with other platformstoPflags
also needed a minor change to support platforms that have different values foros.O_WRONLY
,os.O_RDONLY
&os.O_RDWR
(0x1, 0x2, 0x3 on zos respectively)Some other small modifications were made to tests so that they pass on zos/s390x