FreeBSD-specific porting work.
cgo/libmach remain unimplemented. However, compilers, runtime,
and packages are 100%. I still need to go through and implement
missing syscalls (at least make sure they're all listed), but
for all shipped functionality, this is done. Ship! ;)
R=rsc, VenkateshSrinivas
https://golang.org/cl/152142
diff --git a/src/pkg/os/sys_freebsd.go b/src/pkg/os/sys_freebsd.go
new file mode 100644
index 0000000..cc8daec
--- /dev/null
+++ b/src/pkg/os/sys_freebsd.go
@@ -0,0 +1,16 @@
+// 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;
+}