open-nomad/plugins/drivers/utils/utils_unix.go

13 lines
254 B
Go
Raw Normal View History

// +build darwin dragonfly freebsd linux netbsd openbsd solaris
package utils
import (
"golang.org/x/sys/unix"
)
// IsUnixRoot returns true if system is unix and user running is effectively root
func IsUnixRoot() bool {
return unix.Geteuid() == 0
}