Something I noticed... In the x/sys/unix package, for z/OS there is an explicit definition of the Termios struct type. This is even though the z/OS syscall std library already has one called Termios, and additionally one called Termios.LE. The one in the unix package is defined differently than either of those, however. Specifically:
type Termios struct {
Cflag uint32
Iflag uint32
Lflag uint32
Oflag uint32
Cc [11]uint8
}
The ones in the z/OS syscall package are as follows:
type Termios struct {
Iflag uint32
Oflag uint32
Cflag uint32
Lflag uint32
Line uint8
Cc [32]uint8
_ [3]byte
Ispeed uint32
Ospeed uint32
}
type Termios_LE struct {
Iflag uint32
Oflag uint32
Cflag uint32
Lflag uint32
Cc [11]uint8
}
As you can see, the flags in the unix version are in this order: C,I,L,O, while the flags in syscall are I,O,C,L. The latter is how they are defined in Linux (and I imagine other platforms). However, it appears that CILO is the way they are defined on z/OS. See the following definition from /usr/include/termios.h:
struct termios {
tcflag_t c_cflag; /* control modes */
tcflag_t c_iflag; /* input modes */
tcflag_t c_lflag; /* local modes */
tcflag_t c_oflag; /* output modes */
cc_t c_cc[NCCS]; /* control chars */
};
So, my guess is that, at the very least, syscall.Termios_LE should be defined in the same order as unix.Termios. Then, in the unix package, for z/OS we probably should have "private" versions that use syscall.Termios_LE, i.e.:
//sys tcgetattr(fildes int, termptr *syscall.Termios_LE) (err error) = SYS_TCGETATTR
//sys tcsetattr(fildes int, when int, termptr *syscall.Termios_LE) (err error) = SYS_TCSETATTR
While the public versions would be explicitly defined (as below), calling the *syscall.Termios LE() method and *syscall.Termios_LE Linux() method, as appropriate.
func Tcgetattr(fildes int, termptr *syscall.Termios) (err error)
func Tcsetattr(fildes int, when int, termptr *syscall.Termios) (err error)
Or something like that. Just something to consider.
------------------------------
Frank Swarbrick
------------------------------