diff mbox

RTEMS Go Patch

Message ID mcrsjkot99o.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Dec. 13, 2011, 10:08 p.m. UTC
Joel Sherrill <joel.sherrill@oarcorp.com> writes:

>         * libgo/go/syscall/wait.c:  Conditionalize on WIFxxx macros
>         and SIGxxx being defined.

I think I have fixed the wait issues as follows.  Bootstrapped on
x86_64-unknown-linux-gnu, which means little as the files are not
compiled there.  Committed to mainline.

Ian
diff mbox

Patch

diff -r e62855c629d3 libgo/Makefile.am
--- a/libgo/Makefile.am	Tue Dec 13 13:58:40 2011 -0800
+++ b/libgo/Makefile.am	Tue Dec 13 14:06:40 2011 -0800
@@ -1450,11 +1450,22 @@ 
 endif
 
 # Define Wait4.
+if LIBGO_IS_RTEMS
+syscall_wait_file =
+else
 if HAVE_WAIT4
 syscall_wait_file = go/syscall/libcall_wait4.go
 else
 syscall_wait_file = go/syscall/libcall_waitpid.go
 endif
+endif
+
+# Support for pulling apart wait status.
+if LIBGO_IS_RTEMS
+syscall_wait_c_file =
+else
+syscall_wait_c_file = go/syscall/wait.c
+endif
 
 # Define Sleep.
 if LIBGO_IS_RTEMS
@@ -1564,7 +1575,7 @@ 
 	syscall_arch.go
 go_syscall_c_files = \
 	go/syscall/errno.c \
-	go/syscall/wait.c
+	$(syscall_wait_c_file)
 
 libcalls.go: s-libcalls; @true
 s-libcalls: Makefile go/syscall/mksyscall.awk $(go_base_syscall_files)
diff -r e62855c629d3 libgo/go/syscall/exec_stubs.go
--- a/libgo/go/syscall/exec_stubs.go	Tue Dec 13 13:58:40 2011 -0800
+++ b/libgo/go/syscall/exec_stubs.go	Tue Dec 13 14:06:40 2011 -0800
@@ -7,17 +7,27 @@ 
 package syscall
 
 func ForkExec(argv0 string, argv []string, envv []string, dir string, fd []int) (pid int, err int) {
-	return -1, ENOSYS;
+	return -1, ENOSYS
 }
 
 func Exec(argv0 string, argv []string, envv []string) (err int) {
-	return ENOSYS;
+	return ENOSYS
 }
 
 func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {
-	return -1, ENOSYS;
+	return -1, ENOSYS
 }
 
+func (w WaitStatus) Exited() bool    { return false }
+func (w WaitStatus) Signaled() bool  { return false }
+func (w WaitStatus) Stopped() bool   { return false }
+func (w WaitStatus) Continued() bool { return false }
+func (w WaitStatus) CoreDump() bool  { return false }
+func (w WaitStatus) ExitStatus() int { return 0 }
+func (w WaitStatus) Signal() int     { return 0 }
+func (w WaitStatus) StopSignal() int { return 0 }
+func (w WaitStatus) TrapCause() int  { return 0 }
+
 func raw_ptrace(request int, pid int, addr *byte, data *byte) Errno {
 	return ENOSYS
 }