Daily bump.
[official-gcc.git] / libgo / go / os / sys_bsd.go
blob8ad5e21837100c395e3cc4cadb6cd70f00291d3e
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)
8 // and FreeBSD.
10 package os
12 import "syscall"
14 func hostname() (name string, err error) {
15 name, err = syscall.Sysctl("kern.hostname")
16 if err != nil {
17 return "", NewSyscallError("sysctl kern.hostname", err)
19 return name, nil