mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
vendor: github.com/creack/pty v1.1.21
full diff: https://github.com/creack/pty/compare/v1.1.18...v1.1.21 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
31
vendor/github.com/creack/pty/ioctl.go
generated
vendored
31
vendor/github.com/creack/pty/ioctl.go
generated
vendored
@ -1,19 +1,28 @@
|
||||
//go:build !windows && !solaris && !aix
|
||||
// +build !windows,!solaris,!aix
|
||||
//go:build !windows && go1.12
|
||||
// +build !windows,go1.12
|
||||
|
||||
package pty
|
||||
|
||||
import "syscall"
|
||||
import "os"
|
||||
|
||||
const (
|
||||
TIOCGWINSZ = syscall.TIOCGWINSZ
|
||||
TIOCSWINSZ = syscall.TIOCSWINSZ
|
||||
)
|
||||
func ioctl(f *os.File, cmd, ptr uintptr) error {
|
||||
return ioctlInner(f.Fd(), cmd, ptr) // Fall back to blocking io.
|
||||
}
|
||||
|
||||
func ioctl(fd, cmd, ptr uintptr) error {
|
||||
_, _, e := syscall.Syscall(syscall.SYS_IOCTL, fd, cmd, ptr)
|
||||
if e != 0 {
|
||||
// NOTE: Unused. Keeping for reference.
|
||||
func ioctlNonblock(f *os.File, cmd, ptr uintptr) error {
|
||||
sc, e := f.SyscallConn()
|
||||
if e != nil {
|
||||
return ioctlInner(f.Fd(), cmd, ptr) // Fall back to blocking io (old behavior).
|
||||
}
|
||||
|
||||
ch := make(chan error, 1)
|
||||
defer close(ch)
|
||||
|
||||
e = sc.Control(func(fd uintptr) { ch <- ioctlInner(fd, cmd, ptr) })
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
return nil
|
||||
e = <-ch
|
||||
return e
|
||||
}
|
||||
|
Reference in New Issue
Block a user