aboutsummaryrefslogtreecommitdiff
path: root/src/libthread
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-02-13 18:35:19 +0000
committerrsc <devnull@localhost>2005-02-13 18:35:19 +0000
commit8f4871fd2e9806293b0d6756402b8a019c732985 (patch)
tree136a63810c8d851c7ba618b4b76b22e4b019b8e1 /src/libthread
parent74fc94d47e68684567f16d3d09b822cdad721e4a (diff)
downloadplan9port-8f4871fd2e9806293b0d6756402b8a019c732985.tar.gz
plan9port-8f4871fd2e9806293b0d6756402b8a019c732985.tar.bz2
plan9port-8f4871fd2e9806293b0d6756402b8a019c732985.zip
work around stupid linux bug
Diffstat (limited to 'src/libthread')
-rw-r--r--src/libthread/thread.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libthread/thread.c b/src/libthread/thread.c
index cac2d497..c07a84f3 100644
--- a/src/libthread/thread.c
+++ b/src/libthread/thread.c
@@ -582,6 +582,14 @@ main(int argc, char **argv)
_threadcreate(p, threadmainstart, nil, mainstacksize);
procscheduler(p);
_threaddaemonize();
+ /*
+ * On Linux 2.6, if the main thread exits then the others
+ * keep running but the process shows up as a zombie in ps
+ * and is not attachable with ptrace. We'll just sit around
+ * instead of exiting.
+ */
+ for(;;)
+ sleep(1000);
_threadpexit();
return 0;
}