Last active
September 3, 2017 06:51
-
-
Save zhsj/bf0e50258de3c8034a5a0f3a0a4a5b49 to your computer and use it in GitHub Desktop.
go syscall bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go version go1.9 linux/amd64 (from Debian unstable) | |
$ strace ./test 2>&1|grep ioctl | |
ioctl(0, TCGETS, {B9600 opost isig icanon echo ...}) = 0 | |
ioctl(0, TCGETS, {B9600 opost isig icanon echo ...}) = 0 | |
go version go1.8.1 gccgo (Debian 7.2.0-1) 7.2.0 linux/amd64 | |
$ strace ./test 2>&1|grep ioctl | |
ioctl(0, TCGETS, {B9600 opost isig icanon echo ...}) = 0 | |
ioctl(0, TCGETS, {B9600 opost isig icanon echo ...}) = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go version go1.9 linux/ppc64le (from Debian unstable) | |
$ strace ./test 2>&1|grep ioctl | |
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0 | |
ioctl(0, _IOC(_IOC_READ, 0x74, 0x13, 0x3c), 0xc208014080) = -1 ENOTTY (Inappropriate ioctl for device) | |
go version go1.8.1 gccgo (Debian 7.2.0-2) 7.2.0 linux/ppc64le | |
$ strace ./test 2>&1|grep ioctl | |
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0 | |
ioctl(0, _IOC(_IOC_READ, 0x74, 0x13, 0x3c), 0xc208014080) = -1 ENOTTY (Inappropriate ioctl for device) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
#include<unistd.h> | |
*/ | |
import "C" | |
import ( | |
"syscall" | |
"unsafe" | |
) | |
func main() { | |
C.isatty(C.int(0)) | |
var termios syscall.Termios | |
syscall.RawSyscall(syscall.SYS_IOCTL, 0, uintptr(syscall.TCGETS), uintptr(unsafe.Pointer(&termios))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment