diff --git a/ioctl.go b/ioctl.go index 45ec757..3cabedd 100644 --- a/ioctl.go +++ b/ioctl.go @@ -1,5 +1,5 @@ -//go:build !windows && !solaris -// +build !windows,!solaris +//go:build !windows && !solaris && !aix +// +build !windows,!solaris,!aix package pty diff --git a/ioctl_unsupported.go b/ioctl_unsupported.go new file mode 100644 index 0000000..2449a27 --- /dev/null +++ b/ioctl_unsupported.go @@ -0,0 +1,13 @@ +//go:build aix +// +build aix + +package pty + +const ( + TIOCGWINSZ = 0 + TIOCSWINSZ = 0 +) + +func ioctl(fd, cmd, ptr uintptr) error { + return ErrUnsupported +} diff --git a/start_windows.go b/start_windows.go index b3efdca..7e9530b 100644 --- a/start_windows.go +++ b/start_windows.go @@ -4,7 +4,6 @@ package pty import ( - "errors" "os" "os/exec" ) @@ -16,5 +15,5 @@ import ( // This will resize the pty to the specified size before starting the command. // Starts the process in a new session and sets the controlling terminal. func StartWithSize(cmd *exec.Cmd, ws *Winsize) (*os.File, error) { - return nil, errors.New("unsupported platform") + return nil, ErrUnsupported }