Commit 747639c2 by Ian Lance Taylor

re PR go/59430 (os/user FAILs on Solaris)

	PR go/59430
os/user: Use POSIX functions on Solaris.

From-SVN: r206412
parent 2da4a761
......@@ -1465,10 +1465,17 @@ go_os_signal_files = \
go/os/signal/signal.go \
go/os/signal/signal_unix.go
if LIBGO_IS_SOLARIS
os_user_decls_file = go/os/user/decls_solaris.go
else
os_user_decls_file = go/os/user/decls_unix.go
endif
go_os_user_files = \
go/os/user/user.go \
go/os/user/lookup.go \
go/os/user/lookup_unix.go
go/os/user/lookup_unix.go \
go/os/user/user.go \
$(os_user_decls_file)
go_path_filepath_files = \
go/path/filepath/match.go \
......
......@@ -1670,10 +1670,13 @@ go_os_signal_files = \
go/os/signal/signal.go \
go/os/signal/signal_unix.go
@LIBGO_IS_SOLARIS_FALSE@os_user_decls_file = go/os/user/decls_unix.go
@LIBGO_IS_SOLARIS_TRUE@os_user_decls_file = go/os/user/decls_solaris.go
go_os_user_files = \
go/os/user/user.go \
go/os/user/lookup.go \
go/os/user/lookup_unix.go
go/os/user/lookup_unix.go \
go/os/user/user.go \
$(os_user_decls_file)
go_path_filepath_files = \
go/path/filepath/match.go \
......
// 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
// 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
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment