| commit | 8cdd4b39f502d10358d92586e020d3535f257ec9 | [log] [tgz] |
|---|---|---|
| author | 0xe0f <po4ta.duka@gmail.com> | Tue Nov 03 12:21:35 2015 +0300 |
| committer | 0xe0f <po4ta.duka@gmail.com> | Tue Nov 03 12:21:35 2015 +0300 |
| tree | 6364d5027b3977f9b84fd88305dce73e6f177e35 | |
| parent | fe6f2b03125e4fcafb21406381010e363a072c80 [diff] |
Added implementation of function "IsTerminal" for Solaris
diff --git a/terminal_solaris.go b/terminal_solaris.go new file mode 100644 index 0000000..3e70bf7 --- /dev/null +++ b/terminal_solaris.go
@@ -0,0 +1,15 @@ +// +build solaris + +package logrus + +import ( + "os" + + "golang.org/x/sys/unix" +) + +// IsTerminal returns true if the given file descriptor is a terminal. +func IsTerminal() bool { + _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) + return err == nil +}