Documentation
¶
Overview ¶
Package tty answers two questions about a file that may be a terminal: whether this process may touch it, and how big it is. It lives at the module root's internal/ so that both cmd/ and host/ may import it; Go's internal rule confines host/internal to the tree under host/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForegroundProcessGroup ¶
ForegroundProcessGroup returns the foreground process group of the terminal on fd.
The 32-bit read, not IoctlGetInt: the kernel writes a 4-byte pid_t, and IoctlGetInt reads into a Go int. s390x is big-endian and a release architecture, and there the value would land in the high half of that int — so the comparison in Owned could never succeed and upterm would decide it never owns its terminal.
func Owned ¶
Owned reports whether f is a terminal this process is in the foreground of.
Reading or reconfiguring a terminal we are not in the foreground of is what SIGTTIN and SIGTTOU exist to prevent, and since a host ignores both, nothing else would stop it: `upterm host … &` would put the foreground shell's terminal into raw mode and then race it for input.
Types ¶
This section is empty.