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
0b3189e7
Commit
0b3189e7
authored
Mar 30, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libgo: Use waitpid on systems which do not have wait4.
From-SVN: r171758
parent
8955c80a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
80 additions
and
20 deletions
+80
-20
libgo/Makefile.am
+9
-1
libgo/Makefile.in
+6
-1
libgo/configure
+17
-3
libgo/configure.ac
+2
-1
libgo/mksysinfo.sh
+2
-0
libgo/syscalls/exec.go
+0
-14
libgo/syscalls/wait4.go
+22
-0
libgo/syscalls/waitpid.go
+22
-0
No files found.
libgo/Makefile.am
View file @
0b3189e7
...
@@ -1246,13 +1246,20 @@ endif # !LIBGO_IS_SOLARIS
...
@@ -1246,13 +1246,20 @@ endif # !LIBGO_IS_SOLARIS
endif
# !LIBGO_IS_LINUX
endif
# !LIBGO_IS_LINUX
# Define ForkExec, PtraceForkExec,
Exec, and Wait4
.
# Define ForkExec, PtraceForkExec,
and Exec
.
if
LIBGO_IS_RTEMS
if
LIBGO_IS_RTEMS
syscall_exec_os_file
=
syscalls/exec_stubs.go
syscall_exec_os_file
=
syscalls/exec_stubs.go
else
else
syscall_exec_os_file
=
syscalls/exec.go
syscall_exec_os_file
=
syscalls/exec.go
endif
endif
# Define Wait4.
if
HAVE_WAIT4
syscall_wait_file
=
syscalls/wait4.go
else
syscall_wait_file
=
syscalls/waitpid.go
endif
# Define Sleep.
# Define Sleep.
if
LIBGO_IS_RTEMS
if
LIBGO_IS_RTEMS
syscall_sleep_file
=
syscalls/sleep_rtems.go
syscall_sleep_file
=
syscalls/sleep_rtems.go
...
@@ -1329,6 +1336,7 @@ go_syscall_files = \
...
@@ -1329,6 +1336,7 @@ go_syscall_files = \
$(syscall_errstr_decl_file)
\
$(syscall_errstr_decl_file)
\
syscalls/exec_helpers.go
\
syscalls/exec_helpers.go
\
$(syscall_exec_os_file)
\
$(syscall_exec_os_file)
\
$(syscall_wait_file)
\
$(syscall_filesize_file)
\
$(syscall_filesize_file)
\
$(syscall_stat_file)
\
$(syscall_stat_file)
\
$(syscall_sleep_file)
\
$(syscall_sleep_file)
\
...
...
libgo/Makefile.in
View file @
0b3189e7
...
@@ -1632,8 +1632,12 @@ go_testing_script_files = \
...
@@ -1632,8 +1632,12 @@ go_testing_script_files = \
@LIBGO_IS_LINUX_TRUE@
syscall_stat_file
=
syscalls/sysfile_stat_largefile.go
@LIBGO_IS_LINUX_TRUE@
syscall_stat_file
=
syscalls/sysfile_stat_largefile.go
@LIBGO_IS_RTEMS_FALSE@
syscall_exec_os_file
=
syscalls/exec.go
@LIBGO_IS_RTEMS_FALSE@
syscall_exec_os_file
=
syscalls/exec.go
# Define ForkExec, PtraceForkExec,
Exec, and Wait4
.
# Define ForkExec, PtraceForkExec,
and Exec
.
@LIBGO_IS_RTEMS_TRUE@
syscall_exec_os_file
=
syscalls/exec_stubs.go
@LIBGO_IS_RTEMS_TRUE@
syscall_exec_os_file
=
syscalls/exec_stubs.go
@HAVE_WAIT4_FALSE@
syscall_wait_file
=
syscalls/waitpid.go
# Define Wait4.
@HAVE_WAIT4_TRUE@
syscall_wait_file
=
syscalls/wait4.go
@LIBGO_IS_RTEMS_FALSE@
syscall_sleep_file
=
syscalls/sleep_select.go
@LIBGO_IS_RTEMS_FALSE@
syscall_sleep_file
=
syscalls/sleep_select.go
# Define Sleep.
# Define Sleep.
...
@@ -1671,6 +1675,7 @@ go_syscall_files = \
...
@@ -1671,6 +1675,7 @@ go_syscall_files = \
$(syscall_errstr_decl_file)
\
$(syscall_errstr_decl_file)
\
syscalls/exec_helpers.go
\
syscalls/exec_helpers.go
\
$(syscall_exec_os_file)
\
$(syscall_exec_os_file)
\
$(syscall_wait_file)
\
$(syscall_filesize_file)
\
$(syscall_filesize_file)
\
$(syscall_stat_file)
\
$(syscall_stat_file)
\
$(syscall_sleep_file)
\
$(syscall_sleep_file)
\
...
...
libgo/configure
View file @
0b3189e7
...
@@ -603,6 +603,8 @@ am__EXEEXT_TRUE
...
@@ -603,6 +603,8 @@ am__EXEEXT_TRUE
LTLIBOBJS
LTLIBOBJS
LIBOBJS
LIBOBJS
STRINGOPS_FLAG
STRINGOPS_FLAG
HAVE_WAIT4_FALSE
HAVE_WAIT4_TRUE
HAVE_STRERROR_R_FALSE
HAVE_STRERROR_R_FALSE
HAVE_STRERROR_R_TRUE
HAVE_STRERROR_R_TRUE
HAVE_SYS_MMAN_H_FALSE
HAVE_SYS_MMAN_H_FALSE
...
@@ -10900,7 +10902,7 @@ else
...
@@ -10900,7 +10902,7 @@ else
lt_dlunknown
=
0
;
lt_dlno_uscore
=
1
;
lt_dlneed_uscore
=
2
lt_dlunknown
=
0
;
lt_dlno_uscore
=
1
;
lt_dlneed_uscore
=
2
lt_status
=
$lt_dlunknown
lt_status
=
$lt_dlunknown
cat
>
conftest.
$ac_ext
<<
_LT_EOF
cat
>
conftest.
$ac_ext
<<
_LT_EOF
#line 1090
3
"configure"
#line 1090
5
"configure"
#include "confdefs.h"
#include "confdefs.h"
#if HAVE_DLFCN_H
#if HAVE_DLFCN_H
...
@@ -11006,7 +11008,7 @@ else
...
@@ -11006,7 +11008,7 @@ else
lt_dlunknown
=
0
;
lt_dlno_uscore
=
1
;
lt_dlneed_uscore
=
2
lt_dlunknown
=
0
;
lt_dlno_uscore
=
1
;
lt_dlneed_uscore
=
2
lt_status
=
$lt_dlunknown
lt_status
=
$lt_dlunknown
cat
>
conftest.
$ac_ext
<<
_LT_EOF
cat
>
conftest.
$ac_ext
<<
_LT_EOF
#line 110
09
"configure"
#line 110
11
"configure"
#include "confdefs.h"
#include "confdefs.h"
#if HAVE_DLFCN_H
#if HAVE_DLFCN_H
...
@@ -14154,7 +14156,7 @@ else
...
@@ -14154,7 +14156,7 @@ else
fi
fi
for
ac_func
in
srandom random strerror_r strsignal
for
ac_func
in
srandom random strerror_r strsignal
wait4
do
:
do
:
as_ac_var
=
`
$as_echo
"ac_cv_func_
$ac_func
"
|
$as_tr_sh
`
as_ac_var
=
`
$as_echo
"ac_cv_func_
$ac_func
"
|
$as_tr_sh
`
ac_fn_c_check_func
"
$LINENO
"
"
$ac_func
"
"
$as_ac_var
"
ac_fn_c_check_func
"
$LINENO
"
"
$ac_func
"
"
$as_ac_var
"
...
@@ -14175,6 +14177,14 @@ else
...
@@ -14175,6 +14177,14 @@ else
HAVE_STRERROR_R_FALSE
=
HAVE_STRERROR_R_FALSE
=
fi
fi
if
test
"
$ac_cv_func_wait4
"
=
yes
;
then
HAVE_WAIT4_TRUE
=
HAVE_WAIT4_FALSE
=
'#'
else
HAVE_WAIT4_TRUE
=
'#'
HAVE_WAIT4_FALSE
=
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for __sync_bool_compare_and_swap_4"
>
&5
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for __sync_bool_compare_and_swap_4"
>
&5
$as_echo_n
"checking for __sync_bool_compare_and_swap_4... "
>
&6
;
}
$as_echo_n
"checking for __sync_bool_compare_and_swap_4... "
>
&6
;
}
...
@@ -14552,6 +14562,10 @@ if test -z "${HAVE_STRERROR_R_TRUE}" && test -z "${HAVE_STRERROR_R_FALSE}"; then
...
@@ -14552,6 +14562,10 @@ if test -z "${HAVE_STRERROR_R_TRUE}" && test -z "${HAVE_STRERROR_R_FALSE}"; then
as_fn_error
"conditional
\"
HAVE_STRERROR_R
\"
was never defined.
as_fn_error
"conditional
\"
HAVE_STRERROR_R
\"
was never defined.
Usually this means the macro was only invoked conditionally."
"
$LINENO
"
5
Usually this means the macro was only invoked conditionally."
"
$LINENO
"
5
fi
fi
if
test
-z
"
${
HAVE_WAIT4_TRUE
}
"
&&
test
-z
"
${
HAVE_WAIT4_FALSE
}
"
;
then
as_fn_error
"conditional
\"
HAVE_WAIT4
\"
was never defined.
Usually this means the macro was only invoked conditionally."
"
$LINENO
"
5
fi
:
${
CONFIG_STATUS
=./config.status
}
:
${
CONFIG_STATUS
=./config.status
}
ac_write_fail
=
0
ac_write_fail
=
0
...
...
libgo/configure.ac
View file @
0b3189e7
...
@@ -381,8 +381,9 @@ esac
...
@@ -381,8 +381,9 @@ esac
AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h)
AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h)
AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes)
AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes)
AC_CHECK_FUNCS(srandom random strerror_r strsignal)
AC_CHECK_FUNCS(srandom random strerror_r strsignal
wait4
)
AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = yes)
AC_CACHE_CHECK([for __sync_bool_compare_and_swap_4],
AC_CACHE_CHECK([for __sync_bool_compare_and_swap_4],
[libgo_cv_func___sync_bool_compare_and_swap_4],
[libgo_cv_func___sync_bool_compare_and_swap_4],
...
...
libgo/mksysinfo.sh
View file @
0b3189e7
...
@@ -377,6 +377,8 @@ if test "$rusage" != ""; then
...
@@ -377,6 +377,8 @@ if test "$rusage" != ""; then
nrusage
=
"
$nrusage
$field
;"
nrusage
=
"
$nrusage
$field
;"
done
done
echo
"type Rusage struct {
$nrusage
}"
>>
${
OUT
}
echo
"type Rusage struct {
$nrusage
}"
>>
${
OUT
}
else
echo
"type Rusage struct {}"
>>
${
OUT
}
fi
fi
# The utsname struct.
# The utsname struct.
...
...
libgo/syscalls/exec.go
View file @
0b3189e7
...
@@ -17,7 +17,6 @@ func libc_chdir(name *byte) int __asm__ ("chdir")
...
@@ -17,7 +17,6 @@ func libc_chdir(name *byte) int __asm__ ("chdir")
func
libc_dup2
(
int
,
int
)
int
__asm__
(
"dup2"
)
func
libc_dup2
(
int
,
int
)
int
__asm__
(
"dup2"
)
func
libc_execve
(
*
byte
,
**
byte
,
**
byte
)
int
__asm__
(
"execve"
)
func
libc_execve
(
*
byte
,
**
byte
,
**
byte
)
int
__asm__
(
"execve"
)
func
libc_sysexit
(
int
)
__asm__
(
"_exit"
)
func
libc_sysexit
(
int
)
__asm__
(
"_exit"
)
func
libc_wait4
(
Pid_t
,
*
int
,
int
,
*
Rusage
)
Pid_t
__asm__
(
"wait4"
)
// Fork, dup fd onto 0..len(fd), and exec(argv0, argvv, envv) in child.
// Fork, dup fd onto 0..len(fd), and exec(argv0, argvv, envv) in child.
// If a dup or exec fails, write the errno int to pipe.
// If a dup or exec fails, write the errno int to pipe.
...
@@ -263,16 +262,3 @@ func Exec(argv0 string, argv []string, envv []string) (err int) {
...
@@ -263,16 +262,3 @@ func Exec(argv0 string, argv []string, envv []string) (err int) {
libc_execve
(
StringBytePtr
(
argv0
),
&
argv_arg
[
0
],
&
envv_arg
[
0
])
libc_execve
(
StringBytePtr
(
argv0
),
&
argv_arg
[
0
],
&
envv_arg
[
0
])
return
GetErrno
()
return
GetErrno
()
}
}
func
Wait4
(
pid
int
,
wstatus
*
WaitStatus
,
options
int
,
rusage
*
Rusage
)
(
wpid
int
,
errno
int
)
{
var
status
int
r
:=
libc_wait4
(
Pid_t
(
pid
),
&
status
,
options
,
rusage
)
wpid
=
int
(
r
)
if
r
<
0
{
errno
=
GetErrno
()
}
if
wstatus
!=
nil
{
*
wstatus
=
WaitStatus
(
status
)
}
return
}
libgo/syscalls/wait4.go
0 → 100644
View file @
0b3189e7
// wait4.go -- Wait4 for systems with wait4.
// 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_wait4
(
Pid_t
,
*
int
,
int
,
*
Rusage
)
Pid_t
__asm__
(
"wait4"
)
func
Wait4
(
pid
int
,
wstatus
*
WaitStatus
,
options
int
,
rusage
*
Rusage
)
(
wpid
int
,
errno
int
)
{
var
status
int
r
:=
libc_wait4
(
Pid_t
(
pid
),
&
status
,
options
,
rusage
)
wpid
=
int
(
r
)
if
r
<
0
{
errno
=
GetErrno
()
}
if
wstatus
!=
nil
{
*
wstatus
=
WaitStatus
(
status
)
}
return
}
libgo/syscalls/waitpid.go
0 → 100644
View file @
0b3189e7
// waitpid.go -- Wait4 for systems without wait4, but with waitpid.
// 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_waitpid
(
Pid_t
,
*
int
,
int
)
Pid_t
__asm__
(
"waitpid"
)
func
Wait4
(
pid
int
,
wstatus
*
WaitStatus
,
options
int
,
rusage
*
Rusage
)
(
wpid
int
,
errno
int
)
{
var
status
int
r
:=
libc_waitpid
(
Pid_t
(
pid
),
&
status
,
options
)
wpid
=
int
(
r
)
if
r
<
0
{
errno
=
GetErrno
()
}
if
wstatus
!=
nil
{
*
wstatus
=
WaitStatus
(
status
)
}
return
}
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