From 2420edb02ee04fc1b7dc39e7d5e17f98e3e3a24b Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Mon, 26 Jun 2017 08:32:38 -0500 Subject: Port console to Darwin (#253) * Port console to Darwin * Get syz-executor to build correctly * Do not export unix and syscall constants * Add presubmit test * Add myself to contributors --- vm/vmimpl/console.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vm/vmimpl/console.go') diff --git a/vm/vmimpl/console.go b/vm/vmimpl/console.go index f4a0b71d1..3fa501162 100644 --- a/vm/vmimpl/console.go +++ b/vm/vmimpl/console.go @@ -29,11 +29,11 @@ func OpenConsole(con string) (rc io.ReadCloser, err error) { } }() var term unix.Termios - if _, _, errno := syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), unix.TCGETS2, uintptr(unsafe.Pointer(&term))); errno != 0 { + if _, _, errno := syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), syscall_TCGETS, uintptr(unsafe.Pointer(&term))); errno != 0 { return nil, fmt.Errorf("failed to get console termios: %v", errno) } // no parity bit, only need 1 stop bit, no hardware flowcontrol - term.Cflag &^= unix.CBAUD | unix.CSIZE | unix.PARENB | unix.CSTOPB | unix.CRTSCTS + term.Cflag &^= unix_CBAUD | unix.CSIZE | unix.PARENB | unix.CSTOPB | unix_CRTSCTS // ignore modem controls term.Cflag |= unix.B115200 | unix.CS8 | unix.CLOCAL | unix.CREAD // setup for non-canonical mode @@ -42,7 +42,7 @@ func OpenConsole(con string) (rc io.ReadCloser, err error) { term.Oflag &^= unix.OPOST term.Cc[unix.VMIN] = 0 term.Cc[unix.VTIME] = 10 // 1 second timeout - if _, _, errno := syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), unix.TCSETS2, uintptr(unsafe.Pointer(&term))); errno != 0 { + if _, _, errno := syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), syscall_TCSETS, uintptr(unsafe.Pointer(&term))); errno != 0 { return nil, fmt.Errorf("failed to get console termios: %v", errno) } tmp := fd -- cgit mrf-deployment