provider-kairos/internal/cli/recovery_linux.go

13 lines
288 B
Go
Raw Normal View History

2022-08-12 07:40:40 +00:00
package cli
2022-08-11 11:30:51 +00:00
import (
"os"
"syscall"
"unsafe"
)
func setWinsize(f *os.File, w, h int) {
syscall.Syscall(syscall.SYS_IOCTL, f.Fd(), uintptr(syscall.TIOCSWINSZ), //nolint:errcheck
uintptr(unsafe.Pointer(&struct{ h, w, x, y uint16 }{uint16(h), uint16(w), 0, 0}))) //nolint:errcheck
}