]> Cypherpunks repositories - gostls13.git/commitdiff
os: create sys_bsd.go
authorGiles Lean <giles.lean@pobox.com>
Tue, 27 Apr 2010 06:01:31 +0000 (23:01 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 27 Apr 2010 06:01:31 +0000 (23:01 -0700)
R=rsc
CC=golang-dev
https://golang.org/cl/897042

src/pkg/os/Makefile
src/pkg/os/sys_bsd.go [moved from src/pkg/os/sys_darwin.go with 83% similarity]
src/pkg/os/sys_freebsd.go [deleted file]

index b69ac24f2a4d9345ffef86b2eb2c2083618316c8..ebb1665d4251cda315eaed30cf2a270b5f1f3e71 100644 (file)
@@ -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))
 
similarity index 83%
rename from src/pkg/os/sys_darwin.go
rename to src/pkg/os/sys_bsd.go
index 2e3ab2127963ced6f990a6b56003e570ba4a0607..188993b696120387b937d9c5a01697eb9a5f4c20 100644 (file)
@@ -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 (file)
index c567f5c..0000000
+++ /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
-}