Use _nuname on 32-bit Solaris 2/x86.
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 7 Mar 2011 22:39:45 +0000 (22:39 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 7 Mar 2011 22:39:45 +0000 (22:39 +0000)
From-SVN: r170761

libgo/Makefile.am
libgo/Makefile.in
libgo/syscalls/syscall_solaris_386.go
libgo/syscalls/syscall_uname.go [new file with mode: 0644]
libgo/syscalls/syscall_unix.go

index 814d7ed6132e4e611eadc37a7f0b8ead1a2290b6..ca3de1d1633a1fbd97aadccf467edc4c5252728e 100644 (file)
@@ -1201,6 +1201,18 @@ else
 syscall_socket_epoll_file =
 endif
 
+# Support for uname.
+if LIBGO_IS_SOLARIS
+if LIBGO_IS_386
+# 32-bit Solaris 2/x86 needs _nuname, handled in syscall_solaris_386.go.
+syscall_uname_file =
+else # !LIBGO_IS_386 && LIBGO_IS_SOLARIS
+syscall_uname_file = syscalls/syscall_uname.go
+endif
+else # !LIBGO_IS_SOLARIS
+syscall_uname_file = syscalls/syscall_uname.go
+endif
+
 syscall_arch.go: s-syscall_arch; @true
 s-syscall_arch: Makefile
        rm -f syscall_arch.go.tmp
@@ -1222,6 +1234,7 @@ go_syscall_files = \
        $(syscall_socket_os_file) \
        $(syscall_socket_epoll_file) \
        $(syscall_syscall_file) \
+       $(syscall_uname_file) \
        syscalls/syscall_unix.go \
        syscalls/stringbyte.go \
        syscalls/syscall_$(GOOS).go \
index 11352cf93d91eea410190df742e59e62206c7738..edc40b4be2a694b63b287538fc0b030bf300f7e9 100644 (file)
@@ -1563,6 +1563,12 @@ go_testing_script_files = \
 
 # Support for epoll.
 @LIBGO_IS_LINUX_TRUE@syscall_socket_epoll_file = syscalls/socket_epoll.go
+@LIBGO_IS_386_FALSE@@LIBGO_IS_SOLARIS_TRUE@syscall_uname_file = syscalls/syscall_uname.go
+
+# Support for uname.
+# 32-bit Solaris 2/x86 needs _nuname, handled in syscall_solaris_386.go.
+@LIBGO_IS_386_TRUE@@LIBGO_IS_SOLARIS_TRUE@syscall_uname_file = 
+@LIBGO_IS_SOLARIS_FALSE@syscall_uname_file = syscalls/syscall_uname.go
 go_syscall_files = \
        $(syscall_errstr_file) \
        $(syscall_errstr_decl_file) \
@@ -1575,6 +1581,7 @@ go_syscall_files = \
        $(syscall_socket_os_file) \
        $(syscall_socket_epoll_file) \
        $(syscall_syscall_file) \
+       $(syscall_uname_file) \
        syscalls/syscall_unix.go \
        syscalls/stringbyte.go \
        syscalls/syscall_$(GOOS).go \
index 687722ddc1dacb7bbaa3201dc935f463078dd9da..7ff8f5b07402a799ba764e9ce9969a702eac3557 100644 (file)
@@ -15,3 +15,6 @@ func libc_ptrace(request int, pid Pid_t, addr uintptr, data *byte) int __asm__ (
 
 var dummy *byte
 const sizeofPtr uintptr = uintptr(unsafe.Sizeof(dummy))
+
+// 32-bit Solaris 2/x86 needs to use _nuname internally, cf. <sys/utsname.h>.
+func libc_uname(buf *Utsname) (errno int) __asm__("_nuname")
diff --git a/libgo/syscalls/syscall_uname.go b/libgo/syscalls/syscall_uname.go
new file mode 100644 (file)
index 0000000..955866c
--- /dev/null
@@ -0,0 +1,7 @@
+// Copyright 2011 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.
+
+package syscall
+
+func libc_uname(buf *Utsname) (errno int) __asm__("uname")
index 408d0b8b7aa8aabfca4b1b9cf71b72d44d76999e..a29b6b54bfbbc53b08b5b1a781a859757fc6c54b 100644 (file)
@@ -15,8 +15,6 @@ const ENONE = 0
 func GetErrno() int
 func SetErrno(int)
 
-func libc_uname(buf *Utsname) (errno int) __asm__("uname")
-
 func Uname(buf *Utsname) (errno int) {
        r := libc_uname(buf)
        if r < 0 {