]> Cypherpunks repositories - gostls13.git/commitdiff
pkg: add missing godoc comments to windows versions
authorAlex Brainman <alex.brainman@gmail.com>
Tue, 17 Jan 2012 05:51:54 +0000 (16:51 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Tue, 17 Jan 2012 05:51:54 +0000 (16:51 +1100)
Mostly copied comments from unix files.

R=rsc
CC=golang-dev
https://golang.org/cl/5533057

34 files changed:
src/buildscript_darwin_386.sh
src/buildscript_darwin_amd64.sh
src/buildscript_freebsd_386.sh
src/buildscript_freebsd_amd64.sh
src/buildscript_linux_386.sh
src/buildscript_linux_amd64.sh
src/buildscript_linux_arm.sh
src/buildscript_netbsd_386.sh
src/buildscript_netbsd_amd64.sh
src/buildscript_openbsd_386.sh
src/buildscript_openbsd_amd64.sh
src/buildscript_plan9_386.sh
src/buildscript_windows_386.sh
src/buildscript_windows_amd64.sh
src/pkg/net/Makefile
src/pkg/net/doc.go [new file with mode: 0644]
src/pkg/net/lookup_plan9.go
src/pkg/net/lookup_unix.go
src/pkg/net/lookup_windows.go
src/pkg/os/Makefile
src/pkg/os/dir_plan9.go
src/pkg/os/dir_unix.go
src/pkg/os/dir_windows.go
src/pkg/os/doc.go [new file with mode: 0644]
src/pkg/os/exec/lp_windows.go
src/pkg/os/exec_plan9.go
src/pkg/os/exec_unix.go
src/pkg/os/exec_windows.go
src/pkg/os/file_unix.go
src/pkg/os/file_windows.go
src/pkg/os/sys_bsd.go
src/pkg/os/sys_linux.go
src/pkg/os/sys_plan9.go
src/pkg/os/sys_windows.go

index f5d00898d6aae255b6609f018e2668abec61738c..42dbf5e17a9a1190fd7834830f3c67bd2b360f9e 100755 (executable)
@@ -253,7 +253,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/darwin_386/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_darwin.go ./sys_bsd.go ./time.go ./types.go ./zsignal_darwin_386.go
+8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_darwin.go ./sys_bsd.go ./time.go ./types.go ./zsignal_darwin_386.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
 cp "$WORK"/os.a "$GOROOT"/pkg/darwin_386/os.a
 
index 36d18aee6febe6dd5a0765447e543659ad92da51..0766ff262c00a851e77e61c27c83ed5d946c6871 100755 (executable)
@@ -252,7 +252,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/darwin_amd64/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_darwin.go ./sys_bsd.go ./time.go ./types.go ./zsignal_darwin_amd64.go
+6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_darwin.go ./sys_bsd.go ./time.go ./types.go ./zsignal_darwin_amd64.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6
 cp "$WORK"/os.a "$GOROOT"/pkg/darwin_amd64/os.a
 
index d482e6f57fb9cc37cfc997e52bfb17d9694f6607..310f3dcf7b589a9ca1be885c1c08f991c0e76ef0 100755 (executable)
@@ -253,7 +253,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/freebsd_386/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_freebsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_freebsd_386.go
+8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_freebsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_freebsd_386.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
 cp "$WORK"/os.a "$GOROOT"/pkg/freebsd_386/os.a
 
index d24377b195afbc2ba4d2e4fac774ca5b6eaf78f5..9a91017ac5db6e23601213f362d663a908b62b0c 100755 (executable)
@@ -252,7 +252,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/freebsd_amd64/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_freebsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_freebsd_amd64.go
+6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_freebsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_freebsd_amd64.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6
 cp "$WORK"/os.a "$GOROOT"/pkg/freebsd_amd64/os.a
 
index ad8424253a18ea2f1f98eff2c34cf4871f3e2663..26009320ce19a2f58d648da839e8b5f8703796ee 100755 (executable)
@@ -253,7 +253,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/linux_386/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_386.go
+8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_386.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
 cp "$WORK"/os.a "$GOROOT"/pkg/linux_386/os.a
 
index e02b6f8a2f793fcc9e48db2955d2ee5e9de2230b..f2eae0a59b4a0900e2223ba193b9621fc55b4c1c 100755 (executable)
@@ -252,7 +252,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/linux_amd64/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_amd64.go
+6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_amd64.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6
 cp "$WORK"/os.a "$GOROOT"/pkg/linux_amd64/os.a
 
index 58027b8702a4e01460188bc4260c8abc82030e61..7589a5719e17dee54c8612640bbedc79f9549e6d 100755 (executable)
@@ -256,7 +256,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/linux_arm/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-5g -o "$WORK"/os/_obj/_go_.5 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_arm.go
+5g -o "$WORK"/os/_obj/_go_.5 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_arm.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.5
 cp "$WORK"/os.a "$GOROOT"/pkg/linux_arm/os.a
 
index 1a2c43f3b9a1054cdead6d6350e1f9f0f96bd62a..8f9491c80f04e4482048b0225b73369486443237 100755 (executable)
@@ -253,7 +253,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/netbsd_386/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_netbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_netbsd_386.go
+8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_netbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_netbsd_386.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
 cp "$WORK"/os.a "$GOROOT"/pkg/netbsd_386/os.a
 
index 7d6f647b6429058e807298568caa1efbfaec0490..be0053d066f8e8f39dc4071f093ed6f28d94601f 100755 (executable)
@@ -252,7 +252,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/netbsd_amd64/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_netbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_netbsd_amd64.go
+6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_netbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_netbsd_amd64.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6
 cp "$WORK"/os.a "$GOROOT"/pkg/netbsd_amd64/os.a
 
index 2b44b08af0de76411ad8bd92ac87437d248d5f91..30ddec6a5dd64f7112484be093309d235a98ca2d 100755 (executable)
@@ -253,7 +253,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/openbsd_386/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_openbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_openbsd_386.go
+8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_openbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_openbsd_386.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
 cp "$WORK"/os.a "$GOROOT"/pkg/openbsd_386/os.a
 
index ea3fca38539b66af02badcd61719c400705ed5df..c315d59e1639768c61538d752544776b1c588948 100755 (executable)
@@ -252,7 +252,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/openbsd_amd64/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_openbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_openbsd_amd64.go
+6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_openbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_openbsd_amd64.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6
 cp "$WORK"/os.a "$GOROOT"/pkg/openbsd_amd64/os.a
 
index f4e2050f527a8cf9435587878a427a256fa48554..10a24724f1b76ba07448352550cb4e5e51f8df7e 100755 (executable)
@@ -253,7 +253,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/plan9_386/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_plan9.go ./env.go ./error.go ./error_plan9.go ./exec.go ./exec_plan9.go ./file.go ./file_plan9.go ./getwd.go ./path.go ./path_plan9.go ./proc.go ./stat_plan9.go ./str.go ./sys_plan9.go ./time.go ./types.go
+8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_plan9.go ./doc.go ./env.go ./error.go ./error_plan9.go ./exec.go ./exec_plan9.go ./file.go ./file_plan9.go ./getwd.go ./path.go ./path_plan9.go ./proc.go ./stat_plan9.go ./str.go ./sys_plan9.go ./time.go ./types.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
 cp "$WORK"/os.a "$GOROOT"/pkg/plan9_386/os.a
 
index dc104dc364bbabbac0d413f71e758db1687da585..b5e79288bd95b884e2fdaac04a26f987f3ef045b 100755 (executable)
@@ -265,7 +265,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/windows_386/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_windows.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_windows.go ./file.go ./file_posix.go ./file_windows.go ./getwd.go ./path.go ./path_windows.go ./proc.go ./stat_windows.go ./sys_windows.go ./time.go ./types.go ./zsignal_windows_386.go
+8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_windows.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_windows.go ./file.go ./file_posix.go ./file_windows.go ./getwd.go ./path.go ./path_windows.go ./proc.go ./stat_windows.go ./sys_windows.go ./time.go ./types.go ./zsignal_windows_386.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
 cp "$WORK"/os.a "$GOROOT"/pkg/windows_386/os.a
 
index 0bfb4a517f9a1f430c88cc1589b504a9c98a06e9..bf87f6af9887aee0b7f4a1179d7a75a424b1a162 100755 (executable)
@@ -264,7 +264,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/windows_amd64/time.a
 
 mkdir -p "$WORK"/os/_obj/
 cd "$GOROOT"/src/pkg/os
-6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_windows.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_windows.go ./file.go ./file_posix.go ./file_windows.go ./getwd.go ./path.go ./path_windows.go ./proc.go ./stat_windows.go ./sys_windows.go ./time.go ./types.go ./zsignal_windows_amd64.go
+6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_windows.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_windows.go ./file.go ./file_posix.go ./file_windows.go ./getwd.go ./path.go ./path_windows.go ./proc.go ./stat_windows.go ./sys_windows.go ./time.go ./types.go ./zsignal_windows_amd64.go
 gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6
 cp "$WORK"/os.a "$GOROOT"/pkg/windows_amd64/os.a
 
index 81df2a266c355a0de0447ad91fa87cf12aac7a0d..a02798c73e9c1693b52e4e6ce6c6edd97a80195b 100644 (file)
@@ -9,6 +9,7 @@ GOFILES=\
        dial.go\
        dnsclient.go\
        dnsmsg.go\
+       doc.go\
        hosts.go\
        interface.go\
        ip.go\
diff --git a/src/pkg/net/doc.go b/src/pkg/net/doc.go
new file mode 100644 (file)
index 0000000..3a44e52
--- /dev/null
@@ -0,0 +1,59 @@
+// Copyright 2012 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 net
+
+// LookupHost looks up the given host using the local resolver.
+// It returns an array of that host's addresses.
+func LookupHost(host string) (addrs []string, err error) {
+       return lookupHost(host)
+}
+
+// LookupIP looks up host using the local resolver.
+// It returns an array of that host's IPv4 and IPv6 addresses.
+func LookupIP(host string) (addrs []IP, err error) {
+       return lookupIP(host)
+}
+
+// LookupPort looks up the port for the given network and service.
+func LookupPort(network, service string) (port int, err error) {
+       return lookupPort(network, service)
+}
+
+// LookupCNAME returns the canonical DNS host for the given name.
+// Callers that do not care about the canonical name can call
+// LookupHost or LookupIP directly; both take care of resolving
+// the canonical name as part of the lookup.
+func LookupCNAME(name string) (cname string, err error) {
+       return lookupCNAME(name)
+}
+
+// LookupSRV tries to resolve an SRV query of the given service,
+// protocol, and domain name.  The proto is "tcp" or "udp".
+// The returned records are sorted by priority and randomized
+// by weight within a priority.
+//
+// LookupSRV constructs the DNS name to look up following RFC 2782.
+// That is, it looks up _service._proto.name.  To accommodate services
+// publishing SRV records under non-standard names, if both service
+// and proto are empty strings, LookupSRV looks up name directly.
+func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) {
+       return lookupSRV(service, proto, name)
+}
+
+// LookupMX returns the DNS MX records for the given domain name sorted by preference.
+func LookupMX(name string) (mx []*MX, err error) {
+       return lookupMX(name)
+}
+
+// LookupTXT returns the DNS TXT records for the given domain name.
+func LookupTXT(name string) (txt []string, err error) {
+       return lookupTXT(name)
+}
+
+// LookupAddr performs a reverse lookup for the given address, returning a list
+// of names mapping to that address.
+func LookupAddr(addr string) (name []string, err error) {
+       return lookupAddr(addr)
+}
index 027794a5e4b50d7e4debd046a511aa1075e96328..645aa6d2493e1762748e500da64235f7be42f0be 100644 (file)
@@ -69,9 +69,7 @@ func queryDNS(addr string, typ string) (res []string, err error) {
        return query("/net/dns", addr+" "+typ, 1024)
 }
 
-// LookupHost looks up the given host using the local resolver.
-// It returns an array of that host's addresses.
-func LookupHost(host string) (addrs []string, err error) {
+func lookupHost(host string) (addrs []string, err error) {
        // Use /net/cs insead of /net/dns because cs knows about
        // host names in local network (e.g. from /lib/ndb/local)
        lines, err := queryCS("tcp", host, "1")
@@ -95,9 +93,7 @@ func LookupHost(host string) (addrs []string, err error) {
        return
 }
 
-// LookupIP looks up host using the local resolver.
-// It returns an array of that host's IPv4 and IPv6 addresses.
-func LookupIP(host string) (ips []IP, err error) {
+func lookupIP(host string) (ips []IP, err error) {
        addrs, err := LookupHost(host)
        if err != nil {
                return
@@ -110,8 +106,7 @@ func LookupIP(host string) (ips []IP, err error) {
        return
 }
 
-// LookupPort looks up the port for the given network and service.
-func LookupPort(network, service string) (port int, err error) {
+func lookupPort(network, service string) (port int, err error) {
        switch network {
        case "tcp4", "tcp6":
                network = "tcp"
@@ -140,11 +135,7 @@ func LookupPort(network, service string) (port int, err error) {
        return 0, unknownPortError
 }
 
-// LookupCNAME returns the canonical DNS host for the given name.
-// Callers that do not care about the canonical name can call
-// LookupHost or LookupIP directly; both take care of resolving
-// the canonical name as part of the lookup.
-func LookupCNAME(name string) (cname string, err error) {
+func lookupCNAME(name string) (cname string, err error) {
        lines, err := queryDNS(name, "cname")
        if err != nil {
                return
@@ -157,16 +148,7 @@ func LookupCNAME(name string) (cname string, err error) {
        return "", errors.New("net: bad response from ndb/dns")
 }
 
-// LookupSRV tries to resolve an SRV query of the given service,
-// protocol, and domain name.  The proto is "tcp" or "udp".
-// The returned records are sorted by priority and randomized
-// by weight within a priority.
-//
-// LookupSRV constructs the DNS name to look up following RFC 2782.
-// That is, it looks up _service._proto.name.  To accommodate services
-// publishing SRV records under non-standard names, if both service
-// and proto are empty strings, LookupSRV looks up name directly.
-func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) {
+func lookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) {
        var target string
        if service == "" && proto == "" {
                target = name
@@ -195,8 +177,7 @@ func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err err
        return
 }
 
-// LookupMX returns the DNS MX records for the given domain name sorted by preference.
-func LookupMX(name string) (mx []*MX, err error) {
+func lookupMX(name string) (mx []*MX, err error) {
        lines, err := queryDNS(name, "mx")
        if err != nil {
                return
@@ -214,8 +195,7 @@ func LookupMX(name string) (mx []*MX, err error) {
        return
 }
 
-// LookupTXT returns the DNS TXT records for the given domain name.
-func LookupTXT(name string) (txt []string, err error) {
+func lookupTXT(name string) (txt []string, err error) {
        lines, err := queryDNS(name, "txt")
        if err != nil {
                return
@@ -228,9 +208,7 @@ func LookupTXT(name string) (txt []string, err error) {
        return
 }
 
-// LookupAddr performs a reverse lookup for the given address, returning a list
-// of names mapping to that address.
-func LookupAddr(addr string) (name []string, err error) {
+func lookupAddr(addr string) (name []string, err error) {
        arpa, err := reverseaddr(addr)
        if err != nil {
                return
index 5c475477b8380170c18981effe7a2bf0a71ffd9d..d500a1240d49de8993bba7fd0e29c65d2509e4e1 100644 (file)
@@ -52,9 +52,7 @@ func lookupProtocol(name string) (proto int, err error) {
        return
 }
 
-// LookupHost looks up the given host using the local resolver.
-// It returns an array of that host's addresses.
-func LookupHost(host string) (addrs []string, err error) {
+func lookupHost(host string) (addrs []string, err error) {
        addrs, err, ok := cgoLookupHost(host)
        if !ok {
                addrs, err = goLookupHost(host)
@@ -62,9 +60,7 @@ func LookupHost(host string) (addrs []string, err error) {
        return
 }
 
-// LookupIP looks up host using the local resolver.
-// It returns an array of that host's IPv4 and IPv6 addresses.
-func LookupIP(host string) (addrs []IP, err error) {
+func lookupIP(host string) (addrs []IP, err error) {
        addrs, err, ok := cgoLookupIP(host)
        if !ok {
                addrs, err = goLookupIP(host)
@@ -72,8 +68,7 @@ func LookupIP(host string) (addrs []IP, err error) {
        return
 }
 
-// LookupPort looks up the port for the given network and service.
-func LookupPort(network, service string) (port int, err error) {
+func lookupPort(network, service string) (port int, err error) {
        port, err, ok := cgoLookupPort(network, service)
        if !ok {
                port, err = goLookupPort(network, service)
@@ -81,11 +76,7 @@ func LookupPort(network, service string) (port int, err error) {
        return
 }
 
-// LookupCNAME returns the canonical DNS host for the given name.
-// Callers that do not care about the canonical name can call
-// LookupHost or LookupIP directly; both take care of resolving
-// the canonical name as part of the lookup.
-func LookupCNAME(name string) (cname string, err error) {
+func lookupCNAME(name string) (cname string, err error) {
        cname, err, ok := cgoLookupCNAME(name)
        if !ok {
                cname, err = goLookupCNAME(name)
@@ -93,16 +84,7 @@ func LookupCNAME(name string) (cname string, err error) {
        return
 }
 
-// LookupSRV tries to resolve an SRV query of the given service,
-// protocol, and domain name.  The proto is "tcp" or "udp".
-// The returned records are sorted by priority and randomized
-// by weight within a priority.
-//
-// LookupSRV constructs the DNS name to look up following RFC 2782.
-// That is, it looks up _service._proto.name.  To accommodate services
-// publishing SRV records under non-standard names, if both service
-// and proto are empty strings, LookupSRV looks up name directly.
-func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) {
+func lookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) {
        var target string
        if service == "" && proto == "" {
                target = name
@@ -123,8 +105,7 @@ func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err err
        return
 }
 
-// LookupMX returns the DNS MX records for the given domain name sorted by preference.
-func LookupMX(name string) (mx []*MX, err error) {
+func lookupMX(name string) (mx []*MX, err error) {
        _, records, err := lookup(name, dnsTypeMX)
        if err != nil {
                return
@@ -138,8 +119,7 @@ func LookupMX(name string) (mx []*MX, err error) {
        return
 }
 
-// LookupTXT returns the DNS TXT records for the given domain name.
-func LookupTXT(name string) (txt []string, err error) {
+func lookupTXT(name string) (txt []string, err error) {
        _, records, err := lookup(name, dnsTypeTXT)
        if err != nil {
                return
@@ -151,9 +131,7 @@ func LookupTXT(name string) (txt []string, err error) {
        return
 }
 
-// LookupAddr performs a reverse lookup for the given address, returning a list
-// of names mapping to that address.
-func LookupAddr(addr string) (name []string, err error) {
+func lookupAddr(addr string) (name []string, err error) {
        name = lookupStaticAddr(addr)
        if len(name) > 0 {
                return
index 51afbd4bb85a2dba27423f351c455f20d288b67f..dfe2ff6f1fa762447c9616fb51b634b31ec1f739 100644 (file)
@@ -28,7 +28,7 @@ func lookupProtocol(name string) (proto int, err error) {
        return int(p.Proto), nil
 }
 
-func LookupHost(name string) (addrs []string, err error) {
+func lookupHost(name string) (addrs []string, err error) {
        ips, err := LookupIP(name)
        if err != nil {
                return
@@ -40,7 +40,7 @@ func LookupHost(name string) (addrs []string, err error) {
        return
 }
 
-func LookupIP(name string) (addrs []IP, err error) {
+func lookupIP(name string) (addrs []IP, err error) {
        hostentLock.Lock()
        defer hostentLock.Unlock()
        h, e := syscall.GetHostByName(name)
@@ -61,7 +61,7 @@ func LookupIP(name string) (addrs []IP, err error) {
        return addrs, nil
 }
 
-func LookupPort(network, service string) (port int, err error) {
+func lookupPort(network, service string) (port int, err error) {
        switch network {
        case "tcp4", "tcp6":
                network = "tcp"
@@ -77,7 +77,7 @@ func LookupPort(network, service string) (port int, err error) {
        return int(syscall.Ntohs(s.Port)), nil
 }
 
-func LookupCNAME(name string) (cname string, err error) {
+func lookupCNAME(name string) (cname string, err error) {
        var r *syscall.DNSRecord
        e := syscall.DnsQuery(name, syscall.DNS_TYPE_CNAME, 0, nil, &r, nil)
        if e != nil {
@@ -91,16 +91,7 @@ func LookupCNAME(name string) (cname string, err error) {
        return
 }
 
-// LookupSRV tries to resolve an SRV query of the given service,
-// protocol, and domain name.  The proto is "tcp" or "udp".
-// The returned records are sorted by priority and randomized
-// by weight within a priority.
-//
-// LookupSRV constructs the DNS name to look up following RFC 2782.
-// That is, it looks up _service._proto.name.  To accommodate services
-// publishing SRV records under non-standard names, if both service
-// and proto are empty strings, LookupSRV looks up name directly.
-func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) {
+func lookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) {
        var target string
        if service == "" && proto == "" {
                target = name
@@ -122,7 +113,7 @@ func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err err
        return name, addrs, nil
 }
 
-func LookupMX(name string) (mx []*MX, err error) {
+func lookupMX(name string) (mx []*MX, err error) {
        var r *syscall.DNSRecord
        e := syscall.DnsQuery(name, syscall.DNS_TYPE_MX, 0, nil, &r, nil)
        if e != nil {
@@ -138,7 +129,7 @@ func LookupMX(name string) (mx []*MX, err error) {
        return mx, nil
 }
 
-func LookupTXT(name string) (txt []string, err error) {
+func lookupTXT(name string) (txt []string, err error) {
        var r *syscall.DNSRecord
        e := syscall.DnsQuery(name, syscall.DNS_TYPE_TEXT, 0, nil, &r, nil)
        if e != nil {
@@ -156,7 +147,7 @@ func LookupTXT(name string) (txt []string, err error) {
        return
 }
 
-func LookupAddr(addr string) (name []string, err error) {
+func lookupAddr(addr string) (name []string, err error) {
        arpa, err := reverseaddr(addr)
        if err != nil {
                return nil, err
index f875c09a1149faaf939ee96babfa6a914a768b26..9f8d527ba3be93f866568286abb45094bcb33a5c 100644 (file)
@@ -6,6 +6,7 @@ include ../../Make.inc
 
 TARG=os
 GOFILES=\
+       doc.go\
        error.go\
        env.go\
        exec.go\
index 78228205f47871c596ba7ec5e014441ba46421c4..f2dc15409dbe89edab922382eee8e8ca5157e8c1 100644 (file)
@@ -10,22 +10,7 @@ import (
        "syscall"
 )
 
-// Readdir reads the contents of the directory associated with file and
-// returns an array of up to n FileInfo structures, as would be returned
-// by Lstat, in directory order. Subsequent calls on the same file will yield
-// further FileInfos.
-//
-// If n > 0, Readdir returns at most n FileInfo structures. In this case, if
-// Readdirnames returns an empty slice, it will return a non-nil error
-// explaining why. At the end of a directory, the error is io.EOF.
-//
-// If n <= 0, Readdir returns all the FileInfo from the directory in
-// a single slice. In this case, if Readdir succeeds (reads all
-// the way to the end of the directory), it returns the slice and a
-// nil error. If it encounters an error before the end of the
-// directory, Readdir returns the FileInfo read until that point
-// and a non-nil error.
-func (file *File) Readdir(n int) (fi []FileInfo, err error) {
+func (file *File) readdir(n int) (fi []FileInfo, err error) {
        // If this file has no dirinfo, create one.
        if file.dirinfo == nil {
                file.dirinfo = new(dirInfo)
@@ -76,19 +61,7 @@ func (file *File) Readdir(n int) (fi []FileInfo, err error) {
        return result, nil
 }
 
-// Readdirnames reads and returns a slice of names from the directory f.
-//
-// If n > 0, Readdirnames returns at most n names. In this case, if
-// Readdirnames returns an empty slice, it will return a non-nil error
-// explaining why. At the end of a directory, the error is io.EOF.
-//
-// If n <= 0, Readdirnames returns all the names from the directory in
-// a single slice. In this case, if Readdirnames succeeds (reads all
-// the way to the end of the directory), it returns the slice and a
-// nil error. If it encounters an error before the end of the
-// directory, Readdirnames returns the names read until that point and
-// a non-nil error.
-func (file *File) Readdirnames(n int) (names []string, err error) {
+func (file *File) readdirnames(n int) (names []string, err error) {
        fi, err := file.Readdir(n)
        names = make([]string, len(fi))
        for i := range fi {
index e7a29554c15af5a2fd6597922ad80dc09791a1da..f41f939a97b549c178524c86acc3b0009892d4d1 100644 (file)
@@ -15,19 +15,7 @@ const (
        blockSize = 4096
 )
 
-// Readdirnames reads and returns a slice of names from the directory f.
-//
-// If n > 0, Readdirnames returns at most n names. In this case, if
-// Readdirnames returns an empty slice, it will return a non-nil error
-// explaining why. At the end of a directory, the error is io.EOF.
-//
-// If n <= 0, Readdirnames returns all the names from the directory in
-// a single slice. In this case, if Readdirnames succeeds (reads all
-// the way to the end of the directory), it returns the slice and a
-// nil error. If it encounters an error before the end of the
-// directory, Readdirnames returns the names read until that point and
-// a non-nil error.
-func (f *File) Readdirnames(n int) (names []string, err error) {
+func (f *File) readdirnames(n int) (names []string, err error) {
        // If this file has no dirinfo, create one.
        if f.dirinfo == nil {
                f.dirinfo = new(dirInfo)
index 6f999c0b0daee22d1e35376c7651db05858268f2..931316048bce2f976204fab9ae3bf50cd2b1f7a5 100644 (file)
@@ -4,7 +4,7 @@
 
 package os
 
-func (file *File) Readdirnames(n int) (names []string, err error) {
+func (file *File) readdirnames(n int) (names []string, err error) {
        fis, err := file.Readdir(n)
        names = make([]string, len(fis))
        for i, fi := range fis {
diff --git a/src/pkg/os/doc.go b/src/pkg/os/doc.go
new file mode 100644 (file)
index 0000000..ef857c0
--- /dev/null
@@ -0,0 +1,52 @@
+// Copyright 2012 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
+
+// FindProcess looks for a running process by its pid.
+// The Process it returns can be used to obtain information
+// about the underlying operating system process.
+func FindProcess(pid int) (p *Process, err error) {
+       return findProcess(pid)
+}
+
+// Hostname returns the host name reported by the kernel.
+func Hostname() (name string, err error) {
+       return hostname()
+}
+
+// Readdir reads the contents of the directory associated with file and
+// returns an array of up to n FileInfo values, as would be returned
+// by Lstat, in directory order. Subsequent calls on the same file will yield
+// further FileInfos.
+//
+// If n > 0, Readdir returns at most n FileInfo structures. In this case, if
+// Readdir returns an empty slice, it will return a non-nil error
+// explaining why. At the end of a directory, the error is io.EOF.
+//
+// If n <= 0, Readdir returns all the FileInfo from the directory in
+// a single slice. In this case, if Readdir succeeds (reads all
+// the way to the end of the directory), it returns the slice and a
+// nil error. If it encounters an error before the end of the
+// directory, Readdir returns the FileInfo read until that point
+// and a non-nil error.
+func (f *File) Readdir(n int) (fi []FileInfo, err error) {
+       return f.readdir(n)
+}
+
+// Readdirnames reads and returns a slice of names from the directory f.
+//
+// If n > 0, Readdirnames returns at most n names. In this case, if
+// Readdirnames returns an empty slice, it will return a non-nil error
+// explaining why. At the end of a directory, the error is io.EOF.
+//
+// If n <= 0, Readdirnames returns all the names from the directory in
+// a single slice. In this case, if Readdirnames succeeds (reads all
+// the way to the end of the directory), it returns the slice and a
+// nil error. If it encounters an error before the end of the
+// directory, Readdirnames returns the names read until that point and
+// a non-nil error.
+func (f *File) Readdirnames(n int) (names []string, err error) {
+       return f.readdirnames(n)
+}
index d09e839a397693502c2e492bf5fbcb6713a5eb9d..b7efcd68b8030be006262c681d00128487b72667 100644 (file)
@@ -42,6 +42,11 @@ func findExecutable(file string, exts []string) (string, error) {
        return ``, os.ENOENT
 }
 
+// LookPath searches for an executable binary named file
+// in the directories named by the PATH environment variable.
+// If file contains a slash, it is tried directly and the PATH is not consulted.
+// LookPath also uses PATHEXT environment variable to match
+// a suitable candidate.
 func LookPath(file string) (f string, err error) {
        x := os.Getenv(`PATHEXT`)
        if x == `` {
index 9a0db6dd3efbdcf0c71dccaf7ae499df2a915e9b..879d4d2a736d5bcdc5d6ec4ce68f56b6c5504acd 100644 (file)
@@ -138,10 +138,7 @@ func (p *Process) Release() error {
        return nil
 }
 
-// FindProcess looks for a running process by its pid.
-// The Process it returns can be used to obtain information
-// about the underlying operating system process.
-func FindProcess(pid int) (p *Process, err error) {
+func findProcess(pid int) (p *Process, err error) {
        // NOOP for Plan 9.
        return newProcess(pid, 0), nil
 }
index 375813895d97d472fad7871a91c0a6ffdb7c457e..6c11b63c34fd0cbc14cee10dc4479234048efee9 100644 (file)
@@ -72,10 +72,7 @@ func (p *Process) Release() error {
        return nil
 }
 
-// FindProcess looks for a running process by its pid.
-// The Process it returns can be used to obtain information
-// about the underlying operating system process.
-func FindProcess(pid int) (p *Process, err error) {
+func findProcess(pid int) (p *Process, err error) {
        // NOOP for unix.
        return newProcess(pid, 0), nil
 }
index c4c9dcfe8292d72418c816ec3810bb5b2b53fa33..7eb7d194d60edf0166a40447adb961c6ec2a7de7 100644 (file)
@@ -11,6 +11,8 @@ import (
        "unsafe"
 )
 
+// Wait waits for the Process to exit or stop, and then returns a
+// Waitmsg describing its status and an error, if any.
 func (p *Process) Wait(options int) (w *Waitmsg, err error) {
        s, e := syscall.WaitForSingleObject(syscall.Handle(p.handle), syscall.INFINITE)
        switch s {
@@ -43,6 +45,7 @@ func (p *Process) Signal(sig Signal) error {
        return syscall.Errno(syscall.EWINDOWS)
 }
 
+// Release releases any resources associated with the Process.
 func (p *Process) Release() error {
        if p.handle == -1 {
                return EINVAL
@@ -57,7 +60,7 @@ func (p *Process) Release() error {
        return nil
 }
 
-func FindProcess(pid int) (p *Process, err error) {
+func findProcess(pid int) (p *Process, err error) {
        const da = syscall.STANDARD_RIGHTS_READ |
                syscall.PROCESS_QUERY_INFORMATION | syscall.SYNCHRONIZE
        h, e := syscall.OpenProcess(da, false, uint32(pid))
index 9e5d0add837ac829f43dab2b080df603be0b6f31..01b72358f299b342e8544deaa9ccb49bc9368e8b 100644 (file)
@@ -139,22 +139,7 @@ func Lstat(name string) (fi FileInfo, err error) {
        return fileInfoFromStat(&stat, name), nil
 }
 
-// Readdir reads the contents of the directory associated with file and
-// returns an array of up to n FileInfo values, as would be returned
-// by Lstat, in directory order. Subsequent calls on the same file will yield
-// further FileInfos.
-//
-// If n > 0, Readdir returns at most n FileInfo structures. In this case, if
-// Readdir returns an empty slice, it will return a non-nil error
-// explaining why. At the end of a directory, the error is io.EOF.
-//
-// If n <= 0, Readdir returns all the FileInfo from the directory in
-// a single slice. In this case, if Readdir succeeds (reads all
-// the way to the end of the directory), it returns the slice and a
-// nil error. If it encounters an error before the end of the
-// directory, Readdir returns the FileInfo read until that point
-// and a non-nil error.
-func (f *File) Readdir(n int) (fi []FileInfo, err error) {
+func (f *File) readdir(n int) (fi []FileInfo, err error) {
        dirname := f.name
        if dirname == "" {
                dirname = "."
index 92f03c42419ef770696360b4606afee7698fec21..f5aaca06e51431313be238f8c1aa96fa482dae71 100644 (file)
@@ -135,22 +135,7 @@ func (file *file) close() error {
        return err
 }
 
-// Readdir reads the contents of the directory associated with file and
-// returns an array of up to n FileInfo structures, as would be returned
-// by Lstat, in directory order. Subsequent calls on the same file will yield
-// further FileInfos.
-//
-// If n > 0, Readdir returns at most n FileInfo structures. In this case, if
-// Readdir returns an empty slice, it will return a non-nil error
-// explaining why. At the end of a directory, the error is io.EOF.
-//
-// If n <= 0, Readdir returns all the FileInfo from the directory in
-// a single slice. In this case, if Readdir succeeds (reads all
-// the way to the end of the directory), it returns the slice and a
-// nil error. If it encounters an error before the end of the
-// directory, Readdir returns the FileInfo read until that point
-// and a non-nil error.
-func (file *File) Readdir(n int) (fi []FileInfo, err error) {
+func (file *File) readdir(n int) (fi []FileInfo, err error) {
        if file == nil || file.fd < 0 {
                return nil, EINVAL
        }
index d196469e7d48d00c1d0e4390028a8109a23997f4..0f263f1c121c9052471304675dbe068b696f7ddb 100644 (file)
@@ -11,7 +11,7 @@ package os
 
 import "syscall"
 
-func Hostname() (name string, err error) {
+func hostname() (name string, err error) {
        name, err = syscall.Sysctl("kern.hostname")
        if err != nil {
                return "", NewSyscallError("sysctl kern.hostname", err)
index d322a63c2d17ce81515b712303b891242c23613e..76cdf5043239963d6a01430929edaf04af6e777a 100644 (file)
@@ -6,8 +6,7 @@
 
 package os
 
-// Hostname returns the host name reported by the kernel.
-func Hostname() (name string, err error) {
+func hostname() (name string, err error) {
        f, err := Open("/proc/sys/kernel/hostname")
        if err != nil {
                return "", err
index 8ad89fbc73e9ed352e10660c1509e2b83819047b..07a7905f4721fd4133e77c9e837eddf38ed0634f 100644 (file)
@@ -6,7 +6,7 @@
 
 package os
 
-func Hostname() (name string, err error) {
+func hostname() (name string, err error) {
        f, err := Open("#c/sysname")
        if err != nil {
                return "", err
index 368086db20f35032a0ff16995058c5cb88a31e8c..92617de5e73d2b34014b5245d6d7e9cd6bc849ff 100644 (file)
@@ -6,7 +6,7 @@ package os
 
 import "syscall"
 
-func Hostname() (name string, err error) {
+func hostname() (name string, err error) {
        s, e := syscall.ComputerName()
        if e != nil {
                return "", NewSyscallError("ComputerName", e)