int nzombies; /* # of formerly traced children now dead */
#ifdef LINUX
int nclone_threads; /* # of nchildren with CLONE_THREAD */
- int nclone_detached; /* # of nchildren with CLONE_DETACHED */
int nclone_waiting; /* clone threads in wait4 (TCB_SUSPENDED) */
#endif
/* (1st arg of wait4()) */
|| defined(ARM) || defined(MIPS) || defined(BFIN) || defined(TILE)
# define TCB_WAITEXECVE 02000 /* ignore SIGTRAP after exceve */
# endif
-# define TCB_CLONE_DETACHED 04000 /* CLONE_DETACHED set in creating syscall */
# define TCB_CLONE_THREAD 010000 /* CLONE_THREAD set in creating syscall */
# define TCB_GROUP_EXITING 020000 /* TCB_EXITING was exit_group, not _exit */
# include <sys/syscall.h>
#define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
#define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */
#define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */
-#define CLONE_DETACHED 0x00400000 /* parent wants no child-exit signal */
#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
{ CLONE_SETTLS, "CLONE_SETTLS" },
{ CLONE_PARENT_SETTID,"CLONE_PARENT_SETTID" },
{ CLONE_CHILD_CLEARTID,"CLONE_CHILD_CLEARTID" },
- { CLONE_DETACHED, "CLONE_DETACHED" },
{ CLONE_UNTRACED, "CLONE_UNTRACED" },
{ CLONE_CHILD_SETTID,"CLONE_CHILD_SETTID" },
{ 0, NULL },
tcpchild->flags |= TCB_CLONE_THREAD;
++tcp->nclone_threads;
}
- if (call_flags & CLONE_DETACHED) {
- tcpchild->flags |= TCB_CLONE_DETACHED;
- ++tcp->nclone_detached;
- }
if ((call_flags & CLONE_PARENT) &&
!(call_flags & CLONE_THREAD)) {
--tcp->nchildren;
if (tcp->flags & TCB_CLONE_THREAD)
/* The children we wait for are our parent's children. */
got_kids = (tcp->parent->nchildren
- > (tcp->parent->nclone_detached + tcp->parent->nclone_threads));
+ > tcp->parent->nclone_threads);
else
- got_kids = (tcp->nchildren > (tcp->nclone_detached + tcp->nclone_threads));
+ got_kids = (tcp->nchildren > tcp->nclone_threads);
#else
got_kids = tcp->nchildren > 0;
#endif
++nerr;
else if (tid != tcbtab[tcbi]->pid) {
tcp = alloctcb(tid);
- tcp->flags |= TCB_ATTACHED|TCB_CLONE_THREAD|TCB_CLONE_DETACHED|TCB_FOLLOWFORK;
+ tcp->flags |= TCB_ATTACHED|TCB_CLONE_THREAD|TCB_FOLLOWFORK;
tcbtab[tcbi]->nchildren++;
tcbtab[tcbi]->nclone_threads++;
- tcbtab[tcbi]->nclone_detached++;
tcp->parent = tcbtab[tcbi];
}
if (interactive) {
tcp->nchildren = 0;
tcp->nzombies = 0;
#ifdef TCB_CLONE_THREAD
- tcp->nclone_threads = tcp->nclone_detached = 0;
+ tcp->nclone_threads = 0;
tcp->nclone_waiting = 0;
#endif
tcp->flags = TCB_INUSE | TCB_STARTUP;
if (tcp->parent != NULL) {
tcp->parent->nchildren--;
#ifdef TCB_CLONE_THREAD
- if (tcp->flags & TCB_CLONE_DETACHED)
- tcp->parent->nclone_detached--;
if (tcp->flags & TCB_CLONE_THREAD)
tcp->parent->nclone_threads--;
#endif
-#ifdef TCB_CLONE_DETACHED
- if (!(tcp->flags & TCB_CLONE_DETACHED))
-#endif
- tcp->parent->nzombies++;
+ tcp->parent->nzombies++;
#ifdef LINUX
/* Update `tcp->parent->parent->nchildren' and the other fields
like NCLONE_DETACHED, only for zombie group leader that has
if (tcp->flags & TCB_CLONE_THREAD)
leader = tcp->parent;
- else if (tcp->nclone_detached > 0)
- leader = tcp;
if (sig < 0) {
if (leader != NULL && leader != tcp