This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgo patch committed: Use POSIX functions for os/user on Solaris


This patch to libgo changes the os/user package to use the POSIX
functions on Solaris.  Bootstrapped and ran os/user testsuite on
x86_64-unknown-linux-gnu and Solaris.  Committed to mainline.  This
fixes PR 59430.

Ian

diff -r 5917b9bd0ed0 libgo/Makefile.am
--- a/libgo/Makefile.am	Tue Jan 07 16:42:00 2014 -0800
+++ b/libgo/Makefile.am	Tue Jan 07 17:05:42 2014 -0800
@@ -1465,10 +1465,17 @@
 	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/lookup.go \
+	go/os/user/lookup_unix.go \
 	go/os/user/user.go \
-	go/os/user/lookup.go \
-	go/os/user/lookup_unix.go
+	$(os_user_decls_file)
 
 go_path_filepath_files = \
 	go/path/filepath/match.go \
diff -r 5917b9bd0ed0 libgo/go/os/user/decls_solaris.go
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgo/go/os/user/decls_solaris.go	Tue Jan 07 17:05:42 2014 -0800
@@ -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 -r 5917b9bd0ed0 libgo/go/os/user/decls_unix.go
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgo/go/os/user/decls_unix.go	Tue Jan 07 17:05:42 2014 -0800
@@ -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 -r 5917b9bd0ed0 libgo/go/os/user/lookup_unix.go
--- a/libgo/go/os/user/lookup_unix.go	Tue Jan 07 16:42:00 2014 -0800
+++ b/libgo/go/os/user/lookup_unix.go	Tue Jan 07 17:05:42 2014 -0800
@@ -27,12 +27,6 @@
 }
 */
 
-//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 {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]