Update containerd dependencies
sys/unix cgroups go-runc console Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
2
vendor/github.com/containerd/console/console.go
generated
vendored
2
vendor/github.com/containerd/console/console.go
generated
vendored
@@ -26,6 +26,8 @@ type Console interface {
|
||||
Reset() error
|
||||
// Size returns the window size of the console
|
||||
Size() (WinSize, error)
|
||||
// Fd returns the console's file descriptor
|
||||
Fd() uintptr
|
||||
}
|
||||
|
||||
// WinSize specifies the window size of the console
|
||||
|
||||
4
vendor/github.com/containerd/console/console_unix.go
generated
vendored
4
vendor/github.com/containerd/console/console_unix.go
generated
vendored
@@ -114,6 +114,10 @@ func (m *master) Size() (WinSize, error) {
|
||||
return ws, nil
|
||||
}
|
||||
|
||||
func (m *master) Fd() uintptr {
|
||||
return m.f.Fd()
|
||||
}
|
||||
|
||||
// checkConsole checks if the provided file is a console
|
||||
func checkConsole(f *os.File) error {
|
||||
var termios unix.Termios
|
||||
|
||||
4
vendor/github.com/containerd/console/console_windows.go
generated
vendored
4
vendor/github.com/containerd/console/console_windows.go
generated
vendored
@@ -150,6 +150,10 @@ func (m *master) Write(b []byte) (int, error) {
|
||||
panic("not implemented on windows")
|
||||
}
|
||||
|
||||
func (m *master) Fd() uintptr {
|
||||
return m.in
|
||||
}
|
||||
|
||||
// makeInputRaw puts the terminal (Windows Console) connected to the given
|
||||
// file descriptor into raw mode
|
||||
func makeInputRaw(fd uintptr, mode uint32) error {
|
||||
|
||||
14
vendor/github.com/containerd/console/tc_linux.go
generated
vendored
14
vendor/github.com/containerd/console/tc_linux.go
generated
vendored
@@ -9,11 +9,16 @@ import (
|
||||
)
|
||||
|
||||
func tcget(fd uintptr, p *unix.Termios) error {
|
||||
return ioctl(fd, unix.TCGETS, uintptr(unsafe.Pointer(p)))
|
||||
termios, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*p = *termios
|
||||
return nil
|
||||
}
|
||||
|
||||
func tcset(fd uintptr, p *unix.Termios) error {
|
||||
return ioctl(fd, unix.TCSETS, uintptr(unsafe.Pointer(p)))
|
||||
return unix.IoctlSetTermios(int(fd), unix.TCSETS, p)
|
||||
}
|
||||
|
||||
func ioctl(fd, flag, data uintptr) error {
|
||||
@@ -32,15 +37,14 @@ func unlockpt(f *os.File) error {
|
||||
|
||||
// ptsname retrieves the name of the first available pts for the given master.
|
||||
func ptsname(f *os.File) (string, error) {
|
||||
var n int32
|
||||
if err := ioctl(f.Fd(), unix.TIOCGPTN, uintptr(unsafe.Pointer(&n))); err != nil {
|
||||
n, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCGPTN)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return fmt.Sprintf("/dev/pts/%d", n), nil
|
||||
}
|
||||
|
||||
func saneTerminal(f *os.File) error {
|
||||
// Go doesn't have a wrapper for any of the termios ioctls.
|
||||
var termios unix.Termios
|
||||
if err := tcget(f.Fd(), &termios); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user