diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-08 01:08:29 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-08 01:08:29 +0000 |
commit | b5656ca95fff3a517f00ee2297d78706e1810957 (patch) | |
tree | 64ded3dc2ea89ef1e27d4a84653a9306f1dcfe05 /libgo/go | |
parent | 85e1c970f2786aeff4220c4990d61a7576de80a1 (diff) | |
download | gcc-b5656ca95fff3a517f00ee2297d78706e1810957.tar.gz |
PR go/59430
os/user: Use POSIX functions on Solaris.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206412 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go')
-rw-r--r-- | libgo/go/os/user/decls_solaris.go | 18 | ||||
-rw-r--r-- | libgo/go/os/user/decls_unix.go | 18 | ||||
-rw-r--r-- | libgo/go/os/user/lookup_unix.go | 6 |
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 00000000000..788a00f0661 --- /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 00000000000..f76e4c9bdfc --- /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 eca97a63d6b..2d309ed3330 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 { |