1
0
forked from x/icebergs
icebergs/misc/ssh/service_linux.go
2022-08-16 17:39:12 +08:00

17 lines
378 B
Go

package ssh
import (
"encoding/binary"
"syscall"
"unsafe"
)
type Winsize struct{ Height, Width, x, y uint16 }
func _ssh_size(fd uintptr, b []byte) {
w := binary.BigEndian.Uint32(b)
h := binary.BigEndian.Uint32(b[4:])
ws := &Winsize{Width: uint16(w), Height: uint16(h)}
syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCSWINSZ), uintptr(unsafe.Pointer(ws)))
}