Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
51677e03
Commit
51677e03
authored
Jan 28, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Solaris version of os.Hostname.
From-SVN: r169350
parent
00472076
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
2 deletions
+45
-2
libgo/Makefile.am
+15
-1
libgo/Makefile.in
+5
-1
libgo/go/os/sys_uname.go
+25
-0
No files found.
libgo/Makefile.am
View file @
51677e03
...
@@ -657,6 +657,20 @@ go_netchan_files = \
...
@@ -657,6 +657,20 @@ go_netchan_files = \
go/netchan/export.go
\
go/netchan/export.go
\
go/netchan/import.go
go/netchan/import.go
if
LIBGO_IS_LINUX
go_os_sys_file
=
go/os/sys_linux.go
else
if
LIBGO_IS_SOLARIS
go_os_sys_file
=
go/os/sys_uname.go
else
if
LIBGO_IS_RTEMS
go_os_sys_file
=
go/os/sys_uname.go
else
go_os_sys_file
=
go/os/sys_bsd.go
endif
endif
endif
go_os_files
=
\
go_os_files
=
\
go/os/dir.go
\
go/os/dir.go
\
go/os/env.go
\
go/os/env.go
\
...
@@ -669,7 +683,7 @@ go_os_files = \
...
@@ -669,7 +683,7 @@ go_os_files = \
go/os/path.go
\
go/os/path.go
\
go/os/proc.go
\
go/os/proc.go
\
go/os/stat.go
\
go/os/stat.go
\
go/os/sys_linux.go
\
$(go_os_sys_file)
\
go/os/time.go
\
go/os/time.go
\
go/os/types.go
go/os/types.go
...
...
libgo/Makefile.in
View file @
51677e03
...
@@ -1037,6 +1037,10 @@ go_netchan_files = \
...
@@ -1037,6 +1037,10 @@ go_netchan_files = \
go/netchan/export.go
\
go/netchan/export.go
\
go/netchan/import.go
go/netchan/import.go
@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_RTEMS_FALSE@@LIBGO_IS_SOLARIS_FALSE@
go_os_sys_file
=
go/os/sys_bsd.go
@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_RTEMS_TRUE@@LIBGO_IS_SOLARIS_FALSE@
go_os_sys_file
=
go/os/sys_uname.go
@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_SOLARIS_TRUE@
go_os_sys_file
=
go/os/sys_uname.go
@LIBGO_IS_LINUX_TRUE@
go_os_sys_file
=
go/os/sys_linux.go
go_os_files
=
\
go_os_files
=
\
go/os/dir.go
\
go/os/dir.go
\
go/os/env.go
\
go/os/env.go
\
...
@@ -1049,7 +1053,7 @@ go_os_files = \
...
@@ -1049,7 +1053,7 @@ go_os_files = \
go/os/path.go
\
go/os/path.go
\
go/os/proc.go
\
go/os/proc.go
\
go/os/stat.go
\
go/os/stat.go
\
go/os/sys_linux.go
\
$(go_os_sys_file)
\
go/os/time.go
\
go/os/time.go
\
go/os/types.go
go/os/types.go
...
...
libgo/go/os/sys_uname.go
0 → 100644
View file @
51677e03
// 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.
// For systems which only store the hostname in uname (Solaris).
package
os
import
"syscall"
func
Hostname
()
(
name
string
,
err
Error
)
{
var
u
syscall
.
Utsname
if
errno
:=
syscall
.
Uname
(
&
u
);
errno
!=
0
{
return
""
,
NewSyscallError
(
"uname"
,
errno
)
}
b
:=
make
([]
byte
,
len
(
u
.
Nodename
))
i
:=
0
for
;
i
<
len
(
u
.
Nodename
);
i
++
{
if
u
.
Nodename
[
i
]
==
0
{
break
}
b
[
i
]
=
byte
(
u
.
Nodename
[
i
])
}
return
string
(
b
[
:
i
]),
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment