]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blob - vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_notwindows.go
b343b3a3755c8628306e4a5a8cd1ab4dc863bcd8
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / fsouza / go-dockerclient / external / github.com / Sirupsen / logrus / terminal_notwindows.go
1 // Based on ssh/terminal:
2 // Copyright 2011 The Go Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file.
5
6 // +build linux darwin freebsd openbsd netbsd dragonfly
7
8 package logrus
9
10 import (
11 "syscall"
12 "unsafe"
13 )
14
15 // IsTerminal returns true if stderr's file descriptor is a terminal.
16 func IsTerminal() bool {
17 fd := syscall.Stderr
18 var termios Termios
19 _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
20 return err == 0
21 }