work around stupid linux bug

This commit is contained in:
rsc 2005-02-13 18:35:19 +00:00
parent 74fc94d47e
commit 8f4871fd2e

View file

@ -582,6 +582,14 @@ main(int argc, char **argv)
_threadcreate(p, threadmainstart, nil, mainstacksize); _threadcreate(p, threadmainstart, nil, mainstacksize);
procscheduler(p); procscheduler(p);
_threaddaemonize(); _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(); _threadpexit();
return 0; return 0;
} }