diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2017-12-14 11:59:33 +0100 |
---|---|---|
committer | Tobias Klauser <tobias.klauser@gmail.com> | 2018-02-13 15:41:19 +0000 |
commit | acd17e9b2b9740ea374ec18bcc7a4cd488eb534c (patch) | |
tree | fb0a12d83b6773f79541f626890dc03bd2c94c4d /src/syscall/syscall_solaris.go | |
parent | dc27d68936767277984ac731a06cb15c4f64c997 (diff) | |
download | go-git-acd17e9b2b9740ea374ec18bcc7a4cd488eb534c.tar.gz |
syscall: support Getwd on all BSDs
All supported BSDs provide the SYS___GETCWD syscall which can be used to
implement syscall.Getwd. With this change os.Getwd can use a single
syscall instead of falling back to the current kludge solution on the
BSDs.
This doesn't add any new exported functions to the frozen syscall
package, only ImplementsGetwd changes to true for dragonfly, freebsd,
netbsd and openbsd.
As suggested by Ian, this follows CL 83755 which did the same for
golang.org/x/sys/unix.
Also, an entry for netbsd/arm is added to mkall.sh which was used to
generate the syscall wrappers there.
Change-Id: I84da1ec61a6b8625443699a63cde556b6442ad41
Reviewed-on: https://go-review.googlesource.com/84484
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/syscall/syscall_solaris.go')
-rw-r--r-- | src/syscall/syscall_solaris.go | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/syscall/syscall_solaris.go b/src/syscall/syscall_solaris.go index 73ac12759c..425f5122de 100644 --- a/src/syscall/syscall_solaris.go +++ b/src/syscall/syscall_solaris.go @@ -29,15 +29,6 @@ type SockaddrDatalink struct { raw RawSockaddrDatalink } -func clen(n []byte) int { - for i := 0; i < len(n); i++ { - if n[i] == 0 { - return i - } - } - return len(n) -} - func direntIno(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) } |