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 // os code shared between *BSD systems including OS X (Darwin)
12 func Hostname() (name
string, err Error
) {
14 name
, errno
= syscall
.Sysctl("kern.hostname")
16 return "", NewSyscallError("sysctl kern.hostname", errno
)