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.
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 |
puellanivis
left a comment
There was a problem hiding this comment.
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.)
puellanivis
left a comment
There was a problem hiding this comment.
Looks great. So much thanks.
| s_ISVTX = uint32(sshfx.ModeSticky) | ||
| ) | ||
|
|
||
| // Legacy export: |
There was a problem hiding this comment.
[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.
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.
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.goto alter the syscall constants that were not consistent with other platformstoPflagsalso 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