diff options
Diffstat (limited to 'log/term/terminal_solaris.go')
-rw-r--r-- | log/term/terminal_solaris.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/log/term/terminal_solaris.go b/log/term/terminal_solaris.go new file mode 100644 index 000000000..033c16324 --- /dev/null +++ b/log/term/terminal_solaris.go @@ -0,0 +1,9 @@ +package term + +import "golang.org/x/sys/unix" + +// IsTty returns true if the given file descriptor is a terminal. +func IsTty(fd uintptr) bool { + _, err := unix.IoctlGetTermios(int(fd), unix.TCGETA) + return err == nil +} |