Hi. The attched patch adds the PR_DETACH prctl command. It is needed for those rare but unfortunate cases, where you can't daemonize your process before creating a thread. The effect of this command is similar to the fork() and then exit() on parent, except that: 1. PID does not change 2. Threads are not destroyed It would be nice to know what people think about such an approach. Signed-off-by: stsp@aknet.ru CC: Oleg Nesterov