aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/os
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2014-01-08 01:08:29 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2014-01-08 01:08:29 +0000
commit747639c28ff29046b26ffafc9a04fc42a72f683b (patch)
tree64ded3dc2ea89ef1e27d4a84653a9306f1dcfe05 /libgo/go/os
parent2da4a7611b2b68bb446f6138bd474c426006444c (diff)
downloadgcc-747639c28ff29046b26ffafc9a04fc42a72f683b.zip
gcc-747639c28ff29046b26ffafc9a04fc42a72f683b.tar.gz
gcc-747639c28ff29046b26ffafc9a04fc42a72f683b.tar.bz2
re PR go/59430 (os/user FAILs on Solaris)
PR go/59430 os/user: Use POSIX functions on Solaris. From-SVN: r206412
Diffstat (limited to 'libgo/go/os')
-rw-r--r--libgo/go/os/user/decls_solaris.go18
-rw-r--r--libgo/go/os/user/decls_unix.go18
-rw-r--r--libgo/go/os/user/lookup_unix.go6
3 files changed, 36 insertions, 6 deletions
diff --git a/libgo/go/os/user/decls_solaris.go b/libgo/go/os/user/decls_solaris.go
new file mode 100644
index 0000000..788a00f
--- /dev/null
+++ b/libgo/go/os/user/decls_solaris.go
@@ -0,0 +1,18 @@
+// Copyright 2014 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.
+
+// +build solaris
+// +build cgo
+
+package user
+
+import "syscall"
+
+// Declarations for the libc functions on Solaris.
+
+//extern __posix_getpwnam_r
+func libc_getpwnam_r(name *byte, pwd *syscall.Passwd, buf *byte, buflen syscall.Size_t, result **syscall.Passwd) int
+
+//extern __posix_getpwuid_r
+func libc_getpwuid_r(uid syscall.Uid_t, pwd *syscall.Passwd, buf *byte, buflen syscall.Size_t, result **syscall.Passwd) int
diff --git a/libgo/go/os/user/decls_unix.go b/libgo/go/os/user/decls_unix.go
new file mode 100644
index 0000000..f76e4c9
--- /dev/null
+++ b/libgo/go/os/user/decls_unix.go
@@ -0,0 +1,18 @@
+// Copyright 2014 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.
+
+// +build darwin dragonfly freebsd linux netbsd openbsd
+// +build cgo
+
+package user
+
+import "syscall"
+
+// Declarations for the libc functions on most Unix systems.
+
+//extern getpwnam_r
+func libc_getpwnam_r(name *byte, pwd *syscall.Passwd, buf *byte, buflen syscall.Size_t, result **syscall.Passwd) int
+
+//extern getpwuid_r
+func libc_getpwuid_r(uid syscall.Uid_t, pwd *syscall.Passwd, buf *byte, buflen syscall.Size_t, result **syscall.Passwd) int
diff --git a/libgo/go/os/user/lookup_unix.go b/libgo/go/os/user/lookup_unix.go
index eca97a6..2d309ed 100644
--- a/libgo/go/os/user/lookup_unix.go
+++ b/libgo/go/os/user/lookup_unix.go
@@ -27,12 +27,6 @@ static int mygetpwuid_r(int uid, struct passwd *pwd,
}
*/
-//extern getpwnam_r
-func libc_getpwnam_r(name *byte, pwd *syscall.Passwd, buf *byte, buflen syscall.Size_t, result **syscall.Passwd) int
-
-//extern getpwuid_r
-func libc_getpwuid_r(uid syscall.Uid_t, pwd *syscall.Passwd, buf *byte, buflen syscall.Size_t, result **syscall.Passwd) int
-
// bytePtrToString takes a NUL-terminated array of bytes and convert
// it to a Go string.
func bytePtrToString(p *byte) string {