package sys
import "src.elv.sh/pkg/sys"
Package sys provide convenient wrappers around syscalls.
Index ¶
- Constants
- func DumpStack() string
- func GetWinsize(file *os.File) (row, col int)
- func IsATTY(file *os.File) bool
- func NotifySignals() chan os.Signal
- func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout time.Duration) error
- func Tcsetpgrp(fd int, pid int) error
- func WaitForRead(timeout time.Duration, files ...*os.File) (ready []bool, err error)
- type FdSet
- func NewFdSet(fds ...int) *FdSet
- func (fs *FdSet) Clear(fds ...int)
- func (fs *FdSet) IsSet(fd int) bool
- func (fs *FdSet) Set(fds ...int)
- func (fs *FdSet) Zero()
- type Termios
- func TermiosForFd(fd int) (*Termios, error)
- func (term *Termios) ApplyToFd(fd int) error
- func (term *Termios) Copy() *Termios
- func (term *Termios) SetEcho(v bool)
- func (term *Termios) SetICRNL(v bool)
- func (term *Termios) SetICanon(v bool)
- func (term *Termios) SetIExten(v bool)
- func (term *Termios) SetVMin(v uint8)
- func (term *Termios) SetVTime(v uint8)
Package Files ¶
dumpstack.go fdset_unix.go ioctl_notbsd.go isatty_unix.go select_unix.go signals_unix.go sys.go tc.go termios.go termios_32bitflag.go waitforread_unix.go winsize_unix.go
Constants ¶
SIGWINCH is the Window size change signal.
func DumpStack ¶
func GetWinsize ¶
GetWinsize queries the size of the terminal referenced by the given file.
func IsATTY ¶
IsATTY returns true if the given file is a terminal.
func NotifySignals ¶
func Select ¶
func Tcsetpgrp ¶
func WaitForRead ¶
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 ¶
func NewFdSet ¶
func (*FdSet) Clear ¶
func (*FdSet) IsSet ¶
func (*FdSet) Set ¶
func (*FdSet) Zero ¶
type Termios ¶
Termios represents terminal attributes.
func TermiosForFd ¶
TermiosForFd returns a pointer to a Termios structure if the file descriptor is open on a terminal device.
func (*Termios) ApplyToFd ¶
ApplyToFd applies term to the given file descriptor.
func (*Termios) Copy ¶
Copy returns a copy of term.
func (*Termios) SetEcho ¶
SetEcho sets the echo flag.
func (*Termios) SetICRNL ¶
SetICRNL sets the CRNL iflag bit
func (*Termios) SetICanon ¶
SetICanon sets the canonical flag.
func (*Termios) SetIExten ¶
SetIExten sets the iexten flag.
func (*Termios) SetVMin ¶
SetVMin sets the minimal number of characters for noncanonical read.
func (*Termios) SetVTime ¶
SetVTime sets the timeout in deciseconds for noncanonical read.
Package sys imports 8 packages (graph) and is imported by 4 packages. Updated 1 month ago.
Tools for package owners.