Commit Diff


commit - 14695b90acb1226ee1b137350e6dbbbc73c2f0e7
commit + 17558fbe2d50f3ca908edae3b1836c71b5d9fe00
blob - c371266f40d5852ee921f9dde5184e20404be84e
blob + 422a1b244b8895849f71086bb85a5a00cd648655
--- src/libthread/Linux-sparc64-asm.s
+++ src/libthread/Linux-sparc64-asm.s
@@ -1,3 +1,6 @@
+! Actually sparc32 assembly. 
+! Debian's sparc64 port is a 32-bit user space.
+
 	.section	".text", #alloc, #execinstr
 	.align		8
 	.skip		16
blob - a6d536ec1b085f72b7471cad526e6b549cd742f6
blob + 3c71e4b1b71d30e435c50a0bd6958459cdf74c5d
--- src/libthread/exec.c
+++ src/libthread/exec.c
@@ -76,10 +76,11 @@ _threadspawn(int fd[3], char *cmd, char *argv[])
 		return -1;
 	case 0:
 		/* can't RFNOTEG - will lose tty */
-		/* rfork(RFNOTEG); */
 		dup2(fd[0], 0);
 		dup2(fd[1], 1);
 		dup2(fd[2], 2);
+		if(!isatty(0) && !isatty(1) && !isatty(2))
+			rfork(RFNOTEG);
 		for(i=3; i<100; i++)
 			if(i != p[1])
 				close(i);
blob - 12b8a9988078af36ad1c9080784f51c1eda9be2a
blob + bc0667f734112ed93dd595b2b026c2b4c77d3b30
--- src/libthread/threadimpl.h
+++ src/libthread/threadimpl.h
@@ -46,6 +46,14 @@ extern	void		makecontext(ucontext_t*, void(*)(), int, 
 extern pid_t rfork_thread(int, void*, int(*)(void*), void*);
 #endif
 
+#if defined(__sun__)
+#	define mcontext libthread_mcontext
+#	define mcontext_t libthread_mcontext_t
+#	define ucontext libthread_ucontext
+#	define ucontext_t libthread_ucontext_t
+#	include "sparc-ucontext.h"
+#endif
+
 #if defined(__arm__)
 int getmcontext(mcontext_t*);
 void setmcontext(const mcontext_t*);
@@ -53,6 +61,7 @@ void setmcontext(const mcontext_t*);
 #define	getcontext(u)	getmcontext(&(u)->uc_mcontext)
 #endif
 
+
 typedef struct Context Context;
 typedef struct Execjob Execjob;
 typedef struct Proc Proc;