This uses ioctl syscalls or appropriate alternative, to detect if stdin/out/err are character devices or not. This caches the result, to ensure performance is ok at runtime as executing stat can approach microsecond overhead. Signed-off-by: Adrian Cole <adrian@tetrate.io>
8 lines
108 B
Go
8 lines
108 B
Go
//go:build darwin || freebsd
|
|
|
|
package platform
|
|
|
|
import "syscall"
|
|
|
|
const ioctlReadTermios = syscall.TIOCGETA
|