Skip to content
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

x/sys/unix: If mips64le termios Ispeed and Ospeed can work #37208

Open
Doorer opened this issue Feb 13, 2020 · 5 comments
Open

x/sys/unix: If mips64le termios Ispeed and Ospeed can work #37208

Doorer opened this issue Feb 13, 2020 · 5 comments
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@Doorer
Copy link

Doorer commented Feb 13, 2020

In mips64le , The Termios struct doesn't has member Ospeed or Ispeed
struct termios
{
tcflag_t c_iflag; /* input mode flags /
tcflag_t c_oflag; /
output mode flags /
tcflag_t c_cflag; /
control mode flags /
tcflag_t c_lflag; /
local mode flags /
cc_t c_line; /
line discipline /
cc_t c_cc[NCCS]; /
control characters */
};

In golang/sys/unix/ztypes_linux_mips64le.go, I found this define
Termios struct {
Iflag uint32
Oflag uint32
Cflag uint32
Lflag uint32
Line uint8
Cc [23]uint8
Ispeed uint32
Ospeed uint32
}
Will the member Ispped and Ospeed can work ?

What version of Go are you using (go version)?

$ go version
go version go1.13.3 linux/mips64le

Does this issue reproduce with the latest release?

I think so

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="mips64le"
GOBIN=""
GOCACHE="/home/jlzhang/.cache/go-build"
GOENV="/home/jlzhang/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="mips64le"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/jlzhang/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/lib/golang"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_mips64le"
GCCGO="gccgo"
GOMIPS64="hardfloat"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="0"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -mabi=64 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build438676280=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I use termios ,but can not work. I found the diffrent between syscall and unix

no

What did you expect to see?

no

What did you see instead?

no

@Doorer Doorer changed the title sys:unix If mips64le termios Ispeed and Ospeed can work x/sys/unix:If mips64le termios Ispeed and Ospeed can work Feb 13, 2020
@gopherbot gopherbot added this to the Unreleased milestone Feb 13, 2020
@tklauser
Copy link
Member

On systems which have TCSETS2set, type Termios actually gets generated from struct termios2, which seems to be the case for mips64{,le}:

https://github.com/golang/sys/blob/12a6c2dcc1e4cb348b57847c73987099e261714b/unix/linux/types.go#L189-L194

The version in syscall was probably generated from struct termios which is why you don't see the [IO]speed members.

@dmitshur dmitshur added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 15, 2020
@dmitshur
Copy link
Contributor

@Doorer Thanks for reporting, please let us know if @tklauser's comment helps you.

If not, this issue is hard to understand right now, which makes it hard to investigate. Can you please fill in the "What did you expect to see?" and "What did you see instead?" sections? Also, in the "What did you do?" section, can you show code that you've tried? Thanks!

@dmitshur dmitshur changed the title x/sys/unix:If mips64le termios Ispeed and Ospeed can work x/sys/unix: If mips64le termios Ispeed and Ospeed can work Feb 15, 2020
@Doorer
Copy link
Author

Doorer commented Feb 17, 2020

think you , I find the termios2 struct

@Doorer
Copy link
Author

Doorer commented Feb 17, 2020

On systems which have TCSETS2set, type Termios actually gets generated from struct termios2, which seems to be the case for mips64{,le}:

https://github.com/golang/sys/blob/12a6c2dcc1e4cb348b57847c73987099e261714b/unix/linux/types.go#L189-L194

The version in syscall was probably generated from struct termios which is why you don't see the [IO]speed members.

think you , I find the termios2 struct
will the golang/syscall use the termios which with Ispeed and Ospeed for mips

@tklauser
Copy link
Member

There‘s currently no test case involving The [IO]speed members of Termios in x/sys/unix. Patches welcome.

@ALTree ALTree added NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

5 participants