1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // +build darwin dragonfly freebsd nacl netbsd openbsd
7 // os code shared between *BSD systems including OS X (Darwin)
14 func hostname() (name
string, err error
) {
15 name
, err
= syscall
.Sysctl("kern.hostname")
17 return "", NewSyscallError("sysctl kern.hostname", err
)