elvish: github.com/elves/elvish/pkg/sys Index | Files

package sys

import "github.com/elves/elvish/pkg/sys"

Package sys provide convenient wrappers around syscalls.

Index

Package Files

dumpstack.go fdset_unix.go ioctl.go ioctl_notbsd.go isatty_unix.go select_unix.go sys.go tc.go termios.go termios_32bitflag.go waitforread_unix.go winsize_unix.go

Constants

const SIGWINCH = unix.SIGWINCH

SIGWINCH is the Window size change signal.

func DumpStack Uses

func DumpStack() string

func FlushInput Uses

func FlushInput(fd int) error

FlushInput discards data written to a file descriptor but not read.

func GetWinsize Uses

func GetWinsize(file *os.File) (row, col int)

GetWinsize queries the size of the terminal referenced by the given file.

func Ioctl Uses

func Ioctl(fd int, req uintptr, arg uintptr) error

Ioctl wraps the ioctl syscall.

func IsATTY Uses

func IsATTY(file *os.File) bool

IsATTY returns true if the given file is a terminal.

func Select Uses

func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout time.Duration) error

func Tcgetpgrp Uses

func Tcgetpgrp(fd int) (int, error)

func Tcsetpgrp Uses

func Tcsetpgrp(fd int, pid int) error

func WaitForRead Uses

func WaitForRead(timeout time.Duration, files ...*os.File) (ready []bool, err error)

WaitForRead blocks until any of the given files is ready to be read or timeout. A negative timeout means no timeout. It returns a boolean array indicating which files are ready to be read and any possible error.

type FdSet Uses

type FdSet unix.FdSet

func NewFdSet Uses

func NewFdSet(fds ...int) *FdSet

func (*FdSet) Clear Uses

func (fs *FdSet) Clear(fds ...int)

func (*FdSet) IsSet Uses

func (fs *FdSet) IsSet(fd int) bool

func (*FdSet) Set Uses

func (fs *FdSet) Set(fds ...int)

func (*FdSet) Zero Uses

func (fs *FdSet) Zero()

type Termios Uses

type Termios unix.Termios

Termios represents terminal attributes.

func NewTermiosFromFd Uses

func NewTermiosFromFd(fd int) (*Termios, error)

NewTermiosFromFd extracts the terminal attribute of the given file descriptor.

func (*Termios) ApplyToFd Uses

func (term *Termios) ApplyToFd(fd int) error

ApplyToFd applies term to the given file descriptor.

func (*Termios) Copy Uses

func (term *Termios) Copy() *Termios

Copy returns a copy of term.

func (*Termios) SetEcho Uses

func (term *Termios) SetEcho(v bool)

SetEcho sets the echo flag.

func (*Termios) SetICRNL Uses

func (term *Termios) SetICRNL(v bool)

SetICRNL sets the CRNL iflag bit

func (*Termios) SetICanon Uses

func (term *Termios) SetICanon(v bool)

SetICanon sets the canonical flag.

func (*Termios) SetVMin Uses

func (term *Termios) SetVMin(v uint8)

SetVMin sets the minimal number of characters for noncanonical read.

func (*Termios) SetVTime Uses

func (term *Termios) SetVTime(v uint8)

SetVTime sets the timeout in deciseconds for noncanonical read.

Package sys imports 6 packages (graph) and is imported by 5 packages. Updated 2020-01-28. Refresh now. Tools for package owners.