mirror of
https://github.com/golang/go
synced 2024-11-25 15:57:57 -07:00
parent
bf1c881afe
commit
461314b6e7
@ -15,24 +15,28 @@ GOFILES=\
|
|||||||
path.go\
|
path.go\
|
||||||
proc.go\
|
proc.go\
|
||||||
stat_$(GOOS).go\
|
stat_$(GOOS).go\
|
||||||
sys_$(GOOS).go\
|
|
||||||
time.go\
|
time.go\
|
||||||
types.go\
|
types.go\
|
||||||
|
|
||||||
GOFILES_freebsd=\
|
GOFILES_freebsd=\
|
||||||
file_unix.go\
|
file_unix.go\
|
||||||
|
sys_bsd.go\
|
||||||
|
|
||||||
GOFILES_darwin=\
|
GOFILES_darwin=\
|
||||||
file_unix.go\
|
file_unix.go\
|
||||||
|
sys_bsd.go\
|
||||||
|
|
||||||
GOFILES_linux=\
|
GOFILES_linux=\
|
||||||
file_unix.go\
|
file_unix.go\
|
||||||
|
sys_linux.go\
|
||||||
|
|
||||||
GOFILES_nacl=\
|
GOFILES_nacl=\
|
||||||
file_unix.go\
|
file_unix.go\
|
||||||
|
sys_nacl.go\
|
||||||
|
|
||||||
GOFILES_mingw=\
|
GOFILES_mingw=\
|
||||||
file_mingw.go\
|
file_mingw.go\
|
||||||
|
sys_mingw.go\
|
||||||
|
|
||||||
GOFILES+=$(GOFILES_$(GOOS))
|
GOFILES+=$(GOFILES_$(GOOS))
|
||||||
|
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// Darwin-specific
|
// os code shared between *BSD systems including OS X (Darwin)
|
||||||
|
// and FreeBSD.
|
||||||
|
|
||||||
package os
|
package os
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
// Copyright 2009 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package os
|
|
||||||
|
|
||||||
import "syscall"
|
|
||||||
|
|
||||||
func Hostname() (name string, err Error) {
|
|
||||||
var errno int
|
|
||||||
name, errno = syscall.Sysctl("kern.hostname")
|
|
||||||
if errno != 0 {
|
|
||||||
return "", NewSyscallError("sysctl kern.hostname", errno)
|
|
||||||
}
|
|
||||||
return name, nil
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user