diff options
author | Roland McGrath <roland@redhat.com> | 2003-01-09 06:53:27 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2003-01-09 06:53:27 +0000 |
commit | 923f75011953091f1e0c5b734f7ff98f71f9791b (patch) | |
tree | f0fc1dd16918d90d83736f3e464dc2b5bcee1a40 /syscall.c | |
parent | 44f24c7b267082a7654ec8440f0e444346578ece (diff) | |
download | strace-923f75011953091f1e0c5b734f7ff98f71f9791b.tar.gz strace-923f75011953091f1e0c5b734f7ff98f71f9791b.tar.bz2 strace-923f75011953091f1e0c5b734f7ff98f71f9791b.tar.xz |
2003-01-08 Roland McGrath <roland@redhat.com>
Support for new Linux 2.5 thread features.
* defs.h [LINUX]: Define __NR_exit_group if not defined.
(struct tcb): New members nclone_threads, nclone_detached,
and nclone_waiting.
(TCB_CLONE_DETACHED, TCB_CLONE_THREAD, TCB_GROUP_EXITING): New macros.
(waiting_parent): Macro removed.
(pid2tcb): Declare it.
* process.c (internal_clone) [TCB_CLONE_THREAD]: Reparent the new
child to our parent if we are a CLONE_THREAD child ourselves.
Maintain TCB_CLONE_THREAD and TCB_CLONE_DETACHED flags and counts.
(internal_wait) [TCB_CLONE_THREAD]: Factor out detached children when
determining if we have any. If TCB_CLONE_THREAD is set, check
parent's children instead of our own, and bump nclone_waiting count.
(internal_exit) [__NR_exit_group]: Set the TCB_GROUP_EXITING flag if
the syscall was exit_group.
* syscall.c (internal_syscall): Use internal_exit for exit_group.
* strace.c (pid2tcb): No longer static.
(alloctcb) [TCB_CLONE_THREAD]: Initialize new fields.
(droptcb) [TCB_CLONE_THREAD]: Maintain new fields.
If we have thread children, set TCB_EXITING and don't clear the TCB.
(resume) [TCB_CLONE_THREAD]: Decrement parent's nclone_waiting.
(detach) [TCB_CLONE_THREAD]: When calling resume, check all thread
children of our parent that might be waiting for us too.
[TCB_GROUP_EXITING] (handle_group_exit): New function.
(trace) [TCB_GROUP_EXITING]: Use that in place of detach or droptcb.
Diffstat (limited to 'syscall.c')
-rw-r--r-- | syscall.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -670,6 +670,9 @@ struct tcb *tcp; #ifdef SYS32_exit case SYS32_exit: #endif +#ifdef __NR_exit_group + case __NR_exit_group: +#endif internal_exit(tcp); break; } |