diff --git a/rune/vendor/github.com/creack/pty/.gitignore b/rune/vendor/github.com/creack/pty/.gitignore deleted file mode 100644 index 1f0a99f2f2b01a6bb432b997074cf78dc8c60d2a..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -[568].out -_go* -_test* -_obj diff --git a/rune/vendor/github.com/creack/pty/Dockerfile.riscv b/rune/vendor/github.com/creack/pty/Dockerfile.riscv deleted file mode 100644 index 476d8f11a8878fce516ba1a5ea29869afd465d32..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/Dockerfile.riscv +++ /dev/null @@ -1,14 +0,0 @@ -FROM golang:1.12 - -# Clone and complie a riscv compatible version of the go compiler. -RUN git clone https://review.gerrithub.io/riscv/riscv-go /riscv-go -# riscvdev branch HEAD as of 2019-06-29. -RUN cd /riscv-go && git checkout 04885fddd096d09d4450726064d06dd107e374bf -ENV PATH=/riscv-go/misc/riscv:/riscv-go/bin:$PATH -RUN cd /riscv-go/src && GOROOT_BOOTSTRAP=$(go env GOROOT) ./make.bash -ENV GOROOT=/riscv-go - -# Make sure we compile. -WORKDIR pty -ADD . . -RUN GOOS=linux GOARCH=riscv go build diff --git a/rune/vendor/github.com/creack/pty/LICENSE b/rune/vendor/github.com/creack/pty/LICENSE deleted file mode 100644 index 6b7558b6b421c43b2279cb433613a87201ae239e..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2011 Keith Rarick - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall -be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS -OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/rune/vendor/github.com/creack/pty/README.md b/rune/vendor/github.com/creack/pty/README.md deleted file mode 100644 index 5275014a7a71edb284e88cdd318170f147effc28..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# pty - -Pty is a Go package for using unix pseudo-terminals. - -## Install - - go get github.com/creack/pty - -## Example - -### Command - -```go -package main - -import ( - "github.com/creack/pty" - "io" - "os" - "os/exec" -) - -func main() { - c := exec.Command("grep", "--color=auto", "bar") - f, err := pty.Start(c) - if err != nil { - panic(err) - } - - go func() { - f.Write([]byte("foo\n")) - f.Write([]byte("bar\n")) - f.Write([]byte("baz\n")) - f.Write([]byte{4}) // EOT - }() - io.Copy(os.Stdout, f) -} -``` - -### Shell - -```go -package main - -import ( - "io" - "log" - "os" - "os/exec" - "os/signal" - "syscall" - - "github.com/creack/pty" - "golang.org/x/crypto/ssh/terminal" -) - -func test() error { - // Create arbitrary command. - c := exec.Command("bash") - - // Start the command with a pty. - ptmx, err := pty.Start(c) - if err != nil { - return err - } - // Make sure to close the pty at the end. - defer func() { _ = ptmx.Close() }() // Best effort. - - // Handle pty size. - ch := make(chan os.Signal, 1) - signal.Notify(ch, syscall.SIGWINCH) - go func() { - for range ch { - if err := pty.InheritSize(os.Stdin, ptmx); err != nil { - log.Printf("error resizing pty: %s", err) - } - } - }() - ch <- syscall.SIGWINCH // Initial resize. - - // Set stdin in raw mode. - oldState, err := terminal.MakeRaw(int(os.Stdin.Fd())) - if err != nil { - panic(err) - } - defer func() { _ = terminal.Restore(int(os.Stdin.Fd()), oldState) }() // Best effort. - - // Copy stdin to the pty and the pty to stdout. - go func() { _, _ = io.Copy(ptmx, os.Stdin) }() - _, _ = io.Copy(os.Stdout, ptmx) - - return nil -} - -func main() { - if err := test(); err != nil { - log.Fatal(err) - } -} -``` diff --git a/rune/vendor/github.com/creack/pty/doc.go b/rune/vendor/github.com/creack/pty/doc.go deleted file mode 100644 index 190cfbea929d5bcd419c02133f22bc6a50efb15b..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Package pty provides functions for working with Unix terminals. -package pty - -import ( - "errors" - "os" -) - -// ErrUnsupported is returned if a function is not -// available on the current platform. -var ErrUnsupported = errors.New("unsupported") - -// Opens a pty and its corresponding tty. -func Open() (pty, tty *os.File, err error) { - return open() -} diff --git a/rune/vendor/github.com/creack/pty/ioctl.go b/rune/vendor/github.com/creack/pty/ioctl.go deleted file mode 100644 index c85cdcd14a01486005b308ed74f5149726a953e4..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ioctl.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build !windows,!solaris - -package pty - -import "syscall" - -func ioctl(fd, cmd, ptr uintptr) error { - _, _, e := syscall.Syscall(syscall.SYS_IOCTL, fd, cmd, ptr) - if e != 0 { - return e - } - return nil -} diff --git a/rune/vendor/github.com/creack/pty/ioctl_bsd.go b/rune/vendor/github.com/creack/pty/ioctl_bsd.go deleted file mode 100644 index 73b12c53cf4804c1a5cc8d345ce010f839c6e2e4..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ioctl_bsd.go +++ /dev/null @@ -1,39 +0,0 @@ -// +build darwin dragonfly freebsd netbsd openbsd - -package pty - -// from -const ( - _IOC_VOID uintptr = 0x20000000 - _IOC_OUT uintptr = 0x40000000 - _IOC_IN uintptr = 0x80000000 - _IOC_IN_OUT uintptr = _IOC_OUT | _IOC_IN - _IOC_DIRMASK = _IOC_VOID | _IOC_OUT | _IOC_IN - - _IOC_PARAM_SHIFT = 13 - _IOC_PARAM_MASK = (1 << _IOC_PARAM_SHIFT) - 1 -) - -func _IOC_PARM_LEN(ioctl uintptr) uintptr { - return (ioctl >> 16) & _IOC_PARAM_MASK -} - -func _IOC(inout uintptr, group byte, ioctl_num uintptr, param_len uintptr) uintptr { - return inout | (param_len&_IOC_PARAM_MASK)<<16 | uintptr(group)<<8 | ioctl_num -} - -func _IO(group byte, ioctl_num uintptr) uintptr { - return _IOC(_IOC_VOID, group, ioctl_num, 0) -} - -func _IOR(group byte, ioctl_num uintptr, param_len uintptr) uintptr { - return _IOC(_IOC_OUT, group, ioctl_num, param_len) -} - -func _IOW(group byte, ioctl_num uintptr, param_len uintptr) uintptr { - return _IOC(_IOC_IN, group, ioctl_num, param_len) -} - -func _IOWR(group byte, ioctl_num uintptr, param_len uintptr) uintptr { - return _IOC(_IOC_IN_OUT, group, ioctl_num, param_len) -} diff --git a/rune/vendor/github.com/creack/pty/ioctl_solaris.go b/rune/vendor/github.com/creack/pty/ioctl_solaris.go deleted file mode 100644 index f63985f34ce3695a410b349a1c0625d1ed570418..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ioctl_solaris.go +++ /dev/null @@ -1,30 +0,0 @@ -package pty - -import ( - "golang.org/x/sys/unix" - "unsafe" -) - -const ( - // see /usr/include/sys/stropts.h - I_PUSH = uintptr((int32('S')<<8 | 002)) - I_STR = uintptr((int32('S')<<8 | 010)) - I_FIND = uintptr((int32('S')<<8 | 013)) - // see /usr/include/sys/ptms.h - ISPTM = (int32('P') << 8) | 1 - UNLKPT = (int32('P') << 8) | 2 - PTSSTTY = (int32('P') << 8) | 3 - ZONEPT = (int32('P') << 8) | 4 - OWNERPT = (int32('P') << 8) | 5 -) - -type strioctl struct { - ic_cmd int32 - ic_timout int32 - ic_len int32 - ic_dp unsafe.Pointer -} - -func ioctl(fd, cmd, ptr uintptr) error { - return unix.IoctlSetInt(int(fd), uint(cmd), int(ptr)) -} diff --git a/rune/vendor/github.com/creack/pty/mktypes.bash b/rune/vendor/github.com/creack/pty/mktypes.bash deleted file mode 100644 index 82ee16721cba5c4b3d2793a648d1622cf06a8a5a..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/mktypes.bash +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -GOOSARCH="${GOOS}_${GOARCH}" -case "$GOOSARCH" in -_* | *_ | _) - echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2 - exit 1 - ;; -esac - -GODEFS="go tool cgo -godefs" - -$GODEFS types.go |gofmt > ztypes_$GOARCH.go - -case $GOOS in -freebsd|dragonfly|openbsd) - $GODEFS types_$GOOS.go |gofmt > ztypes_$GOOSARCH.go - ;; -esac diff --git a/rune/vendor/github.com/creack/pty/pty_darwin.go b/rune/vendor/github.com/creack/pty/pty_darwin.go deleted file mode 100644 index 6344b6b0efb64d8a5fdcc3bd7847046dd1fe926d..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/pty_darwin.go +++ /dev/null @@ -1,65 +0,0 @@ -package pty - -import ( - "errors" - "os" - "syscall" - "unsafe" -) - -func open() (pty, tty *os.File, err error) { - pFD, err := syscall.Open("/dev/ptmx", syscall.O_RDWR|syscall.O_CLOEXEC, 0) - if err != nil { - return nil, nil, err - } - p := os.NewFile(uintptr(pFD), "/dev/ptmx") - // In case of error after this point, make sure we close the ptmx fd. - defer func() { - if err != nil { - _ = p.Close() // Best effort. - } - }() - - sname, err := ptsname(p) - if err != nil { - return nil, nil, err - } - - if err := grantpt(p); err != nil { - return nil, nil, err - } - - if err := unlockpt(p); err != nil { - return nil, nil, err - } - - t, err := os.OpenFile(sname, os.O_RDWR, 0) - if err != nil { - return nil, nil, err - } - return p, t, nil -} - -func ptsname(f *os.File) (string, error) { - n := make([]byte, _IOC_PARM_LEN(syscall.TIOCPTYGNAME)) - - err := ioctl(f.Fd(), syscall.TIOCPTYGNAME, uintptr(unsafe.Pointer(&n[0]))) - if err != nil { - return "", err - } - - for i, c := range n { - if c == 0 { - return string(n[:i]), nil - } - } - return "", errors.New("TIOCPTYGNAME string not NUL-terminated") -} - -func grantpt(f *os.File) error { - return ioctl(f.Fd(), syscall.TIOCPTYGRANT, 0) -} - -func unlockpt(f *os.File) error { - return ioctl(f.Fd(), syscall.TIOCPTYUNLK, 0) -} diff --git a/rune/vendor/github.com/creack/pty/pty_dragonfly.go b/rune/vendor/github.com/creack/pty/pty_dragonfly.go deleted file mode 100644 index b7d1f20f29e5236d479ed9578759536f98cc1aa5..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/pty_dragonfly.go +++ /dev/null @@ -1,80 +0,0 @@ -package pty - -import ( - "errors" - "os" - "strings" - "syscall" - "unsafe" -) - -// same code as pty_darwin.go -func open() (pty, tty *os.File, err error) { - p, err := os.OpenFile("/dev/ptmx", os.O_RDWR, 0) - if err != nil { - return nil, nil, err - } - // In case of error after this point, make sure we close the ptmx fd. - defer func() { - if err != nil { - _ = p.Close() // Best effort. - } - }() - - sname, err := ptsname(p) - if err != nil { - return nil, nil, err - } - - if err := grantpt(p); err != nil { - return nil, nil, err - } - - if err := unlockpt(p); err != nil { - return nil, nil, err - } - - t, err := os.OpenFile(sname, os.O_RDWR, 0) - if err != nil { - return nil, nil, err - } - return p, t, nil -} - -func grantpt(f *os.File) error { - _, err := isptmaster(f.Fd()) - return err -} - -func unlockpt(f *os.File) error { - _, err := isptmaster(f.Fd()) - return err -} - -func isptmaster(fd uintptr) (bool, error) { - err := ioctl(fd, syscall.TIOCISPTMASTER, 0) - return err == nil, err -} - -var ( - emptyFiodgnameArg fiodgnameArg - ioctl_FIODNAME = _IOW('f', 120, unsafe.Sizeof(emptyFiodgnameArg)) -) - -func ptsname(f *os.File) (string, error) { - name := make([]byte, _C_SPECNAMELEN) - fa := fiodgnameArg{Name: (*byte)(unsafe.Pointer(&name[0])), Len: _C_SPECNAMELEN, Pad_cgo_0: [4]byte{0, 0, 0, 0}} - - err := ioctl(f.Fd(), ioctl_FIODNAME, uintptr(unsafe.Pointer(&fa))) - if err != nil { - return "", err - } - - for i, c := range name { - if c == 0 { - s := "/dev/" + string(name[:i]) - return strings.Replace(s, "ptm", "pts", -1), nil - } - } - return "", errors.New("TIOCPTYGNAME string not NUL-terminated") -} diff --git a/rune/vendor/github.com/creack/pty/pty_freebsd.go b/rune/vendor/github.com/creack/pty/pty_freebsd.go deleted file mode 100644 index 63b6d91337ae361b675035305b1f866f924d2e9e..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/pty_freebsd.go +++ /dev/null @@ -1,78 +0,0 @@ -package pty - -import ( - "errors" - "os" - "syscall" - "unsafe" -) - -func posixOpenpt(oflag int) (fd int, err error) { - r0, _, e1 := syscall.Syscall(syscall.SYS_POSIX_OPENPT, uintptr(oflag), 0, 0) - fd = int(r0) - if e1 != 0 { - err = e1 - } - return fd, err -} - -func open() (pty, tty *os.File, err error) { - fd, err := posixOpenpt(syscall.O_RDWR | syscall.O_CLOEXEC) - if err != nil { - return nil, nil, err - } - p := os.NewFile(uintptr(fd), "/dev/pts") - // In case of error after this point, make sure we close the pts fd. - defer func() { - if err != nil { - _ = p.Close() // Best effort. - } - }() - - sname, err := ptsname(p) - if err != nil { - return nil, nil, err - } - - t, err := os.OpenFile("/dev/"+sname, os.O_RDWR, 0) - if err != nil { - return nil, nil, err - } - return p, t, nil -} - -func isptmaster(fd uintptr) (bool, error) { - err := ioctl(fd, syscall.TIOCPTMASTER, 0) - return err == nil, err -} - -var ( - emptyFiodgnameArg fiodgnameArg - ioctlFIODGNAME = _IOW('f', 120, unsafe.Sizeof(emptyFiodgnameArg)) -) - -func ptsname(f *os.File) (string, error) { - master, err := isptmaster(f.Fd()) - if err != nil { - return "", err - } - if !master { - return "", syscall.EINVAL - } - - const n = _C_SPECNAMELEN + 1 - var ( - buf = make([]byte, n) - arg = fiodgnameArg{Len: n, Buf: (*byte)(unsafe.Pointer(&buf[0]))} - ) - if err := ioctl(f.Fd(), ioctlFIODGNAME, uintptr(unsafe.Pointer(&arg))); err != nil { - return "", err - } - - for i, c := range buf { - if c == 0 { - return string(buf[:i]), nil - } - } - return "", errors.New("FIODGNAME string not NUL-terminated") -} diff --git a/rune/vendor/github.com/creack/pty/pty_linux.go b/rune/vendor/github.com/creack/pty/pty_linux.go deleted file mode 100644 index 4a833de1849974648d924e107dee071ad10f5d81..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/pty_linux.go +++ /dev/null @@ -1,51 +0,0 @@ -package pty - -import ( - "os" - "strconv" - "syscall" - "unsafe" -) - -func open() (pty, tty *os.File, err error) { - p, err := os.OpenFile("/dev/ptmx", os.O_RDWR, 0) - if err != nil { - return nil, nil, err - } - // In case of error after this point, make sure we close the ptmx fd. - defer func() { - if err != nil { - _ = p.Close() // Best effort. - } - }() - - sname, err := ptsname(p) - if err != nil { - return nil, nil, err - } - - if err := unlockpt(p); err != nil { - return nil, nil, err - } - - t, err := os.OpenFile(sname, os.O_RDWR|syscall.O_NOCTTY, 0) - if err != nil { - return nil, nil, err - } - return p, t, nil -} - -func ptsname(f *os.File) (string, error) { - var n _C_uint - err := ioctl(f.Fd(), syscall.TIOCGPTN, uintptr(unsafe.Pointer(&n))) - if err != nil { - return "", err - } - return "/dev/pts/" + strconv.Itoa(int(n)), nil -} - -func unlockpt(f *os.File) error { - var u _C_int - // use TIOCSPTLCK with a pointer to zero to clear the lock - return ioctl(f.Fd(), syscall.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))) -} diff --git a/rune/vendor/github.com/creack/pty/pty_openbsd.go b/rune/vendor/github.com/creack/pty/pty_openbsd.go deleted file mode 100644 index a6a35d1e677e8ab696f6b83759e9a509087c9047..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/pty_openbsd.go +++ /dev/null @@ -1,33 +0,0 @@ -package pty - -import ( - "os" - "syscall" - "unsafe" -) - -func open() (pty, tty *os.File, err error) { - /* - * from ptm(4): - * The PTMGET command allocates a free pseudo terminal, changes its - * ownership to the caller, revokes the access privileges for all previous - * users, opens the file descriptors for the pty and tty devices and - * returns them to the caller in struct ptmget. - */ - - p, err := os.OpenFile("/dev/ptm", os.O_RDWR|syscall.O_CLOEXEC, 0) - if err != nil { - return nil, nil, err - } - defer p.Close() - - var ptm ptmget - if err := ioctl(p.Fd(), uintptr(ioctl_PTMGET), uintptr(unsafe.Pointer(&ptm))); err != nil { - return nil, nil, err - } - - pty = os.NewFile(uintptr(ptm.Cfd), "/dev/ptm") - tty = os.NewFile(uintptr(ptm.Sfd), "/dev/ptm") - - return pty, tty, nil -} diff --git a/rune/vendor/github.com/creack/pty/pty_solaris.go b/rune/vendor/github.com/creack/pty/pty_solaris.go deleted file mode 100644 index 09ec1b7978a600bee7716e9dc0cc1f79ce1ed13d..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/pty_solaris.go +++ /dev/null @@ -1,139 +0,0 @@ -package pty - -/* based on: -http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/pt.c -*/ - -import ( - "errors" - "golang.org/x/sys/unix" - "os" - "strconv" - "syscall" - "unsafe" -) - -const NODEV = ^uint64(0) - -func open() (pty, tty *os.File, err error) { - masterfd, err := syscall.Open("/dev/ptmx", syscall.O_RDWR|unix.O_NOCTTY, 0) - //masterfd, err := syscall.Open("/dev/ptmx", syscall.O_RDWR|syscall.O_CLOEXEC|unix.O_NOCTTY, 0) - if err != nil { - return nil, nil, err - } - p := os.NewFile(uintptr(masterfd), "/dev/ptmx") - - sname, err := ptsname(p) - if err != nil { - return nil, nil, err - } - - err = grantpt(p) - if err != nil { - return nil, nil, err - } - - err = unlockpt(p) - if err != nil { - return nil, nil, err - } - - slavefd, err := syscall.Open(sname, os.O_RDWR|unix.O_NOCTTY, 0) - if err != nil { - return nil, nil, err - } - t := os.NewFile(uintptr(slavefd), sname) - - // pushing terminal driver STREAMS modules as per pts(7) - for _, mod := range([]string{"ptem", "ldterm", "ttcompat"}) { - err = streams_push(t, mod) - if err != nil { - return nil, nil, err - } - } - - return p, t, nil -} - -func minor(x uint64) uint64 { - return x & 0377 -} - -func ptsdev(fd uintptr) uint64 { - istr := strioctl{ISPTM, 0, 0, nil} - err := ioctl(fd, I_STR, uintptr(unsafe.Pointer(&istr))) - if err != nil { - return NODEV - } - var status unix.Stat_t - err = unix.Fstat(int(fd), &status) - if err != nil { - return NODEV - } - return uint64(minor(status.Rdev)) -} - -func ptsname(f *os.File) (string, error) { - dev := ptsdev(f.Fd()) - if dev == NODEV { - return "", errors.New("not a master pty") - } - fn := "/dev/pts/" + strconv.FormatInt(int64(dev), 10) - // access(2) creates the slave device (if the pty exists) - // F_OK == 0 (unistd.h) - err := unix.Access(fn, 0) - if err != nil { - return "", err - } - return fn, nil -} - -type pt_own struct { - pto_ruid int32 - pto_rgid int32 -} - -func grantpt(f *os.File) error { - if ptsdev(f.Fd()) == NODEV { - return errors.New("not a master pty") - } - var pto pt_own - pto.pto_ruid = int32(os.Getuid()) - // XXX should first attempt to get gid of DEFAULT_TTY_GROUP="tty" - pto.pto_rgid = int32(os.Getgid()) - var istr strioctl - istr.ic_cmd = OWNERPT - istr.ic_timout = 0 - istr.ic_len = int32(unsafe.Sizeof(istr)) - istr.ic_dp = unsafe.Pointer(&pto) - err := ioctl(f.Fd(), I_STR, uintptr(unsafe.Pointer(&istr))) - if err != nil { - return errors.New("access denied") - } - return nil -} - -func unlockpt(f *os.File) error { - istr := strioctl{UNLKPT, 0, 0, nil} - return ioctl(f.Fd(), I_STR, uintptr(unsafe.Pointer(&istr))) -} - -// push STREAMS modules if not already done so -func streams_push(f *os.File, mod string) error { - var err error - buf := []byte(mod) - // XXX I_FIND is not returning an error when the module - // is already pushed even though truss reports a return - // value of 1. A bug in the Go Solaris syscall interface? - // XXX without this we are at risk of the issue - // https://www.illumos.org/issues/9042 - // but since we are not using libc or XPG4.2, we should not be - // double-pushing modules - - err = ioctl(f.Fd(), I_FIND, uintptr(unsafe.Pointer(&buf[0]))) - if err != nil { - return nil - } - err = ioctl(f.Fd(), I_PUSH, uintptr(unsafe.Pointer(&buf[0]))) - return err -} diff --git a/rune/vendor/github.com/creack/pty/pty_unsupported.go b/rune/vendor/github.com/creack/pty/pty_unsupported.go deleted file mode 100644 index ceb425b19c982cdce5aac24de8e9cde46bd773cf..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/pty_unsupported.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !linux,!darwin,!freebsd,!dragonfly,!openbsd,!solaris - -package pty - -import ( - "os" -) - -func open() (pty, tty *os.File, err error) { - return nil, nil, ErrUnsupported -} diff --git a/rune/vendor/github.com/creack/pty/run.go b/rune/vendor/github.com/creack/pty/run.go deleted file mode 100644 index 959be26b208bcf3261b660da8e878cba8b61c8a4..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/run.go +++ /dev/null @@ -1,57 +0,0 @@ -// +build !windows - -package pty - -import ( - "os" - "os/exec" - "syscall" -) - -// Start assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout, -// and c.Stderr, calls c.Start, and returns the File of the tty's -// corresponding pty. -func Start(c *exec.Cmd) (pty *os.File, err error) { - return StartWithSize(c, nil) -} - -// StartWithSize assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout, -// and c.Stderr, calls c.Start, and returns the File of the tty's -// corresponding pty. -// -// This will resize the pty to the specified size before starting the command -func StartWithSize(c *exec.Cmd, sz *Winsize) (pty *os.File, err error) { - pty, tty, err := Open() - if err != nil { - return nil, err - } - defer tty.Close() - if sz != nil { - err = Setsize(pty, sz) - if err != nil { - pty.Close() - return nil, err - } - } - if c.Stdout == nil { - c.Stdout = tty - } - if c.Stderr == nil { - c.Stderr = tty - } - if c.Stdin == nil { - c.Stdin = tty - } - if c.SysProcAttr == nil { - c.SysProcAttr = &syscall.SysProcAttr{} - } - c.SysProcAttr.Setctty = true - c.SysProcAttr.Setsid = true - c.SysProcAttr.Ctty = int(tty.Fd()) - err = c.Start() - if err != nil { - pty.Close() - return nil, err - } - return pty, err -} diff --git a/rune/vendor/github.com/creack/pty/test_crosscompile.sh b/rune/vendor/github.com/creack/pty/test_crosscompile.sh deleted file mode 100644 index f0b1dcac092bc3b87119140f10d671080232f3df..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/test_crosscompile.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env sh - -# Test script checking that all expected os/arch compile properly. -# Does not actually test the logic, just the compilation so we make sure we don't break code depending on the lib. - -echo2() { - echo $@ >&2 -} - -trap end 0 -end() { - [ "$?" = 0 ] && echo2 "Pass." || (echo2 "Fail."; exit 1) -} - -cross() { - os=$1 - shift - echo2 "Build for $os." - for arch in $@; do - echo2 " - $os/$arch" - GOOS=$os GOARCH=$arch go build - done - echo2 -} - -set -e - -cross linux amd64 386 arm arm64 ppc64 ppc64le s390x mips mipsle mips64 mips64le -cross darwin amd64 386 arm arm64 -cross freebsd amd64 386 arm -cross netbsd amd64 386 arm -cross openbsd amd64 386 -cross dragonfly amd64 -cross solaris amd64 - -# Not expected to work but should still compile. -cross windows amd64 386 arm - -# TODO: Fix compilation error on openbsd/arm. -# TODO: Merge the solaris PR. - -# Some os/arch require a different compiler. Run in docker. -if ! hash docker; then - # If docker is not present, stop here. - return -fi - -echo2 "Build for linux." -echo2 " - linux/riscv" -docker build -t test -f Dockerfile.riscv . diff --git a/rune/vendor/github.com/creack/pty/util.go b/rune/vendor/github.com/creack/pty/util.go deleted file mode 100644 index 8fdde0bab988c9a62c663be1a44961bdeee458ae..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/util.go +++ /dev/null @@ -1,64 +0,0 @@ -// +build !windows,!solaris - -package pty - -import ( - "os" - "syscall" - "unsafe" -) - -// InheritSize applies the terminal size of pty to tty. This should be run -// in a signal handler for syscall.SIGWINCH to automatically resize the tty when -// the pty receives a window size change notification. -func InheritSize(pty, tty *os.File) error { - size, err := GetsizeFull(pty) - if err != nil { - return err - } - err = Setsize(tty, size) - if err != nil { - return err - } - return nil -} - -// Setsize resizes t to s. -func Setsize(t *os.File, ws *Winsize) error { - return windowRectCall(ws, t.Fd(), syscall.TIOCSWINSZ) -} - -// GetsizeFull returns the full terminal size description. -func GetsizeFull(t *os.File) (size *Winsize, err error) { - var ws Winsize - err = windowRectCall(&ws, t.Fd(), syscall.TIOCGWINSZ) - return &ws, err -} - -// Getsize returns the number of rows (lines) and cols (positions -// in each line) in terminal t. -func Getsize(t *os.File) (rows, cols int, err error) { - ws, err := GetsizeFull(t) - return int(ws.Rows), int(ws.Cols), err -} - -// Winsize describes the terminal size. -type Winsize struct { - Rows uint16 // ws_row: Number of rows (in cells) - Cols uint16 // ws_col: Number of columns (in cells) - X uint16 // ws_xpixel: Width in pixels - Y uint16 // ws_ypixel: Height in pixels -} - -func windowRectCall(ws *Winsize, fd, a2 uintptr) error { - _, _, errno := syscall.Syscall( - syscall.SYS_IOCTL, - fd, - a2, - uintptr(unsafe.Pointer(ws)), - ) - if errno != 0 { - return syscall.Errno(errno) - } - return nil -} diff --git a/rune/vendor/github.com/creack/pty/util_solaris.go b/rune/vendor/github.com/creack/pty/util_solaris.go deleted file mode 100644 index e8896924824b315fd6a1799dd0416ea961a3ebb1..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/util_solaris.go +++ /dev/null @@ -1,51 +0,0 @@ -// - -package pty - -import ( - "os" - "golang.org/x/sys/unix" -) - -const ( - TIOCGWINSZ = 21608 // 'T' << 8 | 104 - TIOCSWINSZ = 21607 // 'T' << 8 | 103 -) - -// Winsize describes the terminal size. -type Winsize struct { - Rows uint16 // ws_row: Number of rows (in cells) - Cols uint16 // ws_col: Number of columns (in cells) - X uint16 // ws_xpixel: Width in pixels - Y uint16 // ws_ypixel: Height in pixels -} - -// GetsizeFull returns the full terminal size description. -func GetsizeFull(t *os.File) (size *Winsize, err error) { - var wsz *unix.Winsize - wsz, err = unix.IoctlGetWinsize(int(t.Fd()), TIOCGWINSZ) - - if err != nil { - return nil, err - } else { - return &Winsize{wsz.Row, wsz.Col, wsz.Xpixel, wsz.Ypixel}, nil - } -} - -// Get Windows Size -func Getsize(t *os.File) (rows, cols int, err error) { - var wsz *unix.Winsize - wsz, err = unix.IoctlGetWinsize(int(t.Fd()), TIOCGWINSZ) - - if err != nil { - return 80, 25, err - } else { - return int(wsz.Row), int(wsz.Col), nil - } -} - -// Setsize resizes t to s. -func Setsize(t *os.File, ws *Winsize) error { - wsz := unix.Winsize{ws.Rows, ws.Cols, ws.X, ws.Y} - return unix.IoctlSetWinsize(int(t.Fd()), TIOCSWINSZ, &wsz) -} diff --git a/rune/vendor/github.com/creack/pty/ztypes_386.go b/rune/vendor/github.com/creack/pty/ztypes_386.go deleted file mode 100644 index ff0b8fd838f0021aca6b8f086739bc80c581ab98..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_386.go +++ /dev/null @@ -1,9 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/rune/vendor/github.com/creack/pty/ztypes_amd64.go b/rune/vendor/github.com/creack/pty/ztypes_amd64.go deleted file mode 100644 index ff0b8fd838f0021aca6b8f086739bc80c581ab98..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_amd64.go +++ /dev/null @@ -1,9 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/rune/vendor/github.com/creack/pty/ztypes_arm.go b/rune/vendor/github.com/creack/pty/ztypes_arm.go deleted file mode 100644 index ff0b8fd838f0021aca6b8f086739bc80c581ab98..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_arm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/rune/vendor/github.com/creack/pty/ztypes_arm64.go b/rune/vendor/github.com/creack/pty/ztypes_arm64.go deleted file mode 100644 index 6c29a4b918882009ca8dc6567d21fd205a9394f9..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_arm64.go +++ /dev/null @@ -1,11 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -// +build arm64 - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/rune/vendor/github.com/creack/pty/ztypes_dragonfly_amd64.go b/rune/vendor/github.com/creack/pty/ztypes_dragonfly_amd64.go deleted file mode 100644 index 6b0ba037f897c3aeda77239194c030f4d5095d0f..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_dragonfly_amd64.go +++ /dev/null @@ -1,14 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_dragonfly.go - -package pty - -const ( - _C_SPECNAMELEN = 0x3f -) - -type fiodgnameArg struct { - Name *byte - Len uint32 - Pad_cgo_0 [4]byte -} diff --git a/rune/vendor/github.com/creack/pty/ztypes_freebsd_386.go b/rune/vendor/github.com/creack/pty/ztypes_freebsd_386.go deleted file mode 100644 index d9975374e3c5149915e9438ca7a66a1cf561f0b4..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_freebsd_386.go +++ /dev/null @@ -1,13 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_freebsd.go - -package pty - -const ( - _C_SPECNAMELEN = 0x3f -) - -type fiodgnameArg struct { - Len int32 - Buf *byte -} diff --git a/rune/vendor/github.com/creack/pty/ztypes_freebsd_amd64.go b/rune/vendor/github.com/creack/pty/ztypes_freebsd_amd64.go deleted file mode 100644 index 5fa102fcdf6eb41a68eb5ca7404f227600bba2c3..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_freebsd_amd64.go +++ /dev/null @@ -1,14 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_freebsd.go - -package pty - -const ( - _C_SPECNAMELEN = 0x3f -) - -type fiodgnameArg struct { - Len int32 - Pad_cgo_0 [4]byte - Buf *byte -} diff --git a/rune/vendor/github.com/creack/pty/ztypes_freebsd_arm.go b/rune/vendor/github.com/creack/pty/ztypes_freebsd_arm.go deleted file mode 100644 index d9975374e3c5149915e9438ca7a66a1cf561f0b4..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_freebsd_arm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_freebsd.go - -package pty - -const ( - _C_SPECNAMELEN = 0x3f -) - -type fiodgnameArg struct { - Len int32 - Buf *byte -} diff --git a/rune/vendor/github.com/creack/pty/ztypes_mipsx.go b/rune/vendor/github.com/creack/pty/ztypes_mipsx.go deleted file mode 100644 index f0ce74086aef731c6ee8151929fc57372e9ebc27..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_mipsx.go +++ /dev/null @@ -1,12 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -// +build linux -// +build mips mipsle mips64 mips64le - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/rune/vendor/github.com/creack/pty/ztypes_openbsd_386.go b/rune/vendor/github.com/creack/pty/ztypes_openbsd_386.go deleted file mode 100644 index ccb3aab9ae9c71cb56fc22bfcea7455bb41cbed4..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_openbsd_386.go +++ /dev/null @@ -1,13 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_openbsd.go - -package pty - -type ptmget struct { - Cfd int32 - Sfd int32 - Cn [16]int8 - Sn [16]int8 -} - -var ioctl_PTMGET = 0x40287401 diff --git a/rune/vendor/github.com/creack/pty/ztypes_openbsd_amd64.go b/rune/vendor/github.com/creack/pty/ztypes_openbsd_amd64.go deleted file mode 100644 index e67051688f0058c9354f439079ed69fa9b2b6091..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_openbsd_amd64.go +++ /dev/null @@ -1,13 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_openbsd.go - -package pty - -type ptmget struct { - Cfd int32 - Sfd int32 - Cn [16]int8 - Sn [16]int8 -} - -var ioctl_PTMGET = 0x40287401 diff --git a/rune/vendor/github.com/creack/pty/ztypes_ppc64.go b/rune/vendor/github.com/creack/pty/ztypes_ppc64.go deleted file mode 100644 index 4e1af84312bf46e570e9dfd44e2c809ad3ff9fe1..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_ppc64.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build ppc64 - -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/rune/vendor/github.com/creack/pty/ztypes_ppc64le.go b/rune/vendor/github.com/creack/pty/ztypes_ppc64le.go deleted file mode 100644 index e6780f4e237a35d0ceb047ee54aecc31806c83c1..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_ppc64le.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build ppc64le - -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/rune/vendor/github.com/creack/pty/ztypes_riscvx.go b/rune/vendor/github.com/creack/pty/ztypes_riscvx.go deleted file mode 100644 index 99eec8ecbe021f2b54a2519e26b5c905ad389756..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_riscvx.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs types.go - -// +build riscv riscv64 - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/rune/vendor/github.com/creack/pty/ztypes_s390x.go b/rune/vendor/github.com/creack/pty/ztypes_s390x.go deleted file mode 100644 index a7452b61cb35b0fcd5401a0b0d2742901314642d..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/creack/pty/ztypes_s390x.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build s390x - -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/rune/vendor/github.com/kr/pty/.gitignore b/rune/vendor/github.com/kr/pty/.gitignore deleted file mode 100644 index 1f0a99f2f2b01a6bb432b997074cf78dc8c60d2a..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/kr/pty/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -[568].out -_go* -_test* -_obj diff --git a/rune/vendor/github.com/kr/pty/LICENSE b/rune/vendor/github.com/kr/pty/LICENSE deleted file mode 100644 index db5a1eda3d8dbb65e410d67280f9177f82ee000f..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/kr/pty/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2019 Keith Rarick - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall -be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS -OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/rune/vendor/github.com/kr/pty/README.md b/rune/vendor/github.com/kr/pty/README.md deleted file mode 100644 index 64466c3282380afbcee959d6a323a97782c02cdd..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/kr/pty/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# pty - -This Go module has moved to . - -Existing clients will continue to work. - -New clients should use the new module import path -`github.com/creack/pty`. - diff --git a/rune/vendor/github.com/kr/pty/go.mod b/rune/vendor/github.com/kr/pty/go.mod deleted file mode 100644 index 382a202aed1d012f6e5f952a1b61a6dd0c29a827..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/kr/pty/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/kr/pty - -go 1.12 - -require github.com/creack/pty v1.1.7 diff --git a/rune/vendor/github.com/kr/pty/go.sum b/rune/vendor/github.com/kr/pty/go.sum deleted file mode 100644 index 710ab50547b913631ba86e8456b98959c7762b9d..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/kr/pty/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/creack/pty v1.1.7 h1:6pwm8kMQKCmgUg0ZHTm5+/YvRK0s3THD/28+T6/kk4A= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= diff --git a/rune/vendor/github.com/kr/pty/shim.go b/rune/vendor/github.com/kr/pty/shim.go deleted file mode 100644 index 32e04262e06fae386204990619ef8445dbd32bb8..0000000000000000000000000000000000000000 --- a/rune/vendor/github.com/kr/pty/shim.go +++ /dev/null @@ -1,76 +0,0 @@ -// Package pty is a wrapper for github.com/creack/pty, which provides -// functions for working with Unix terminals. -// -// This package is deprecated. Existing clients will continue to work, -// but no further updates will happen here. New clients should use -// github.com/creack/pty directly. -package pty - -import ( - "os" - "os/exec" - - "github.com/creack/pty" - newpty "github.com/creack/pty" -) - -// ErrUnsupported is returned if a function is not available on the -// current platform. -// -// Deprecated; please use github.com/creack/pty instead. -var ErrUnsupported = pty.ErrUnsupported - -// Winsize describes the terminal size. -// -// Deprecated; please use github.com/creack/pty instead. -type Winsize = pty.Winsize - -// Getsize returns the number of rows (lines) and cols (positions in -// each line) in terminal t. -// -// Deprecated; please use github.com/creack/pty instead. -func Getsize(t *os.File) (rows, cols int, err error) { return pty.Getsize(t) } - -// GetsizeFull returns the full terminal size description. -// -// Deprecated; please use github.com/creack/pty instead. -func GetsizeFull(t *os.File) (size *Winsize, err error) { - return pty.GetsizeFull(t) -} - -// InheritSize applies the terminal size of pty to tty. This should be -// run in a signal handler for syscall.SIGWINCH to automatically -// resize the tty when the pty receives a window size change -// notification. -// -// Deprecated; please use github.com/creack/pty instead. -func InheritSize(pty, tty *os.File) error { return newpty.InheritSize(pty, tty) } - -// Opens a pty and its corresponding tty. -// -// Deprecated; please use github.com/creack/pty instead. -func Open() (pty, tty *os.File, err error) { return newpty.Open() } - -// Setsize resizes t to s. -// -// Deprecated; please use github.com/creack/pty instead. -func Setsize(t *os.File, ws *Winsize) error { return pty.Setsize(t, ws) } - -// Start assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout, -// and c.Stderr, calls c.Start, and returns the File of the tty's -// corresponding pty. -// -// Deprecated; please use github.com/creack/pty instead. -func Start(c *exec.Cmd) (pty *os.File, err error) { return newpty.Start(c) } - -// StartWithSize assigns a pseudo-terminal tty os.File to c.Stdin, -// c.Stdout, and c.Stderr, calls c.Start, and returns the File of the -// tty's corresponding pty. -// -// This will resize the pty to the specified size before starting the -// command. -// -// Deprecated; please use github.com/creack/pty instead. -func StartWithSize(c *exec.Cmd, sz *Winsize) (pty *os.File, err error) { - return newpty.StartWithSize(c, sz) -}