Closed liupeng0518 closed 4 years ago
Wow. Those fields seem to be missing from the ztypes_linux_mips64le.go file. In fact, they don't seem to exist on modern Linux at all (in the underlying asm-generic/termios.h header). I'm astonished they are present in the old code -- man pages recommend using cfgetospeed and cfgetispeed to access these (presumably from the c_lflag bits.)
So apparently Linux differs from one architecture to another in this regard. It will be necessary to have different versions of this code for different architectures. I'm not even sure how we can use build tags to select by architecture.
Scanning a little, it affects all the MIPS variants of Linux, and nothing else (that is supported by the version of go that I have on the system).
Fixing will probably mean relying upon cgo and cfgetispeed etc. The other options involve a different flavor of the termios structure and a different ioctl to access them -- and those different items are not part of the sys package.
Well, it looks like the newer golang.org/x/sys package has them... interesting.
Well, it looks like the newer golang.org/x/sys package has them... interesting.
Thanks.
What I've done for my use case was use a different approach, using bitmasks against CBAUD. That won't cover everything, but it's good enough for my use case.
I ran into this this trying to build a tool to run on my router. Is there a workaround known or any expectation of providing mips support in the future?
$ go get github.com/pkg/term