aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiles Lean <giles.lean@pobox.com>2010-04-26 23:01:31 -0700
committerRuss Cox <rsc@golang.org>2010-04-26 23:01:31 -0700
commit461314b6e743939ed7e2265d966d4281fe19650f (patch)
tree0d4033d097729e2f99c9d38b4c02e9f00a458c39
parentbf1c881afe33aef8aa52a74ab81e66e1cab2fd74 (diff)
downloadgo-461314b6e743939ed7e2265d966d4281fe19650f.tar.gz
go-461314b6e743939ed7e2265d966d4281fe19650f.zip
os: create sys_bsd.go
R=rsc CC=golang-dev https://golang.org/cl/897042
-rw-r--r--src/pkg/os/Makefile6
-rw-r--r--src/pkg/os/sys_bsd.go (renamed from src/pkg/os/sys_darwin.go)3
-rw-r--r--src/pkg/os/sys_freebsd.go16
3 files changed, 7 insertions, 18 deletions
diff --git a/src/pkg/os/Makefile b/src/pkg/os/Makefile
index b69ac24f2a..ebb1665d42 100644
--- a/src/pkg/os/Makefile
+++ b/src/pkg/os/Makefile
@@ -15,24 +15,28 @@ GOFILES=\
path.go\
proc.go\
stat_$(GOOS).go\
- sys_$(GOOS).go\
time.go\
types.go\
GOFILES_freebsd=\
file_unix.go\
+ sys_bsd.go\
GOFILES_darwin=\
file_unix.go\
+ sys_bsd.go\
GOFILES_linux=\
file_unix.go\
+ sys_linux.go\
GOFILES_nacl=\
file_unix.go\
+ sys_nacl.go\
GOFILES_mingw=\
file_mingw.go\
+ sys_mingw.go\
GOFILES+=$(GOFILES_$(GOOS))
diff --git a/src/pkg/os/sys_darwin.go b/src/pkg/os/sys_bsd.go
index 2e3ab21279..188993b696 100644
--- a/src/pkg/os/sys_darwin.go
+++ b/src/pkg/os/sys_bsd.go
@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style
// 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
diff --git a/src/pkg/os/sys_freebsd.go b/src/pkg/os/sys_freebsd.go
deleted file mode 100644
index c567f5c358..0000000000
--- a/src/pkg/os/sys_freebsd.go
+++ /dev/null
@@ -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
-}