- 论坛徽章:
- 0
|
有几个问题:
1. 我这边strace怎么看不到调用exit时的syscall?
2. _exit的解释是这样的“In glibc up to version 2.3, the _exit() wrapper function invoked the kernel system call of the same name. Since glibc 2.3, the wrapper function invokes exit_group(2), in order to terminate all of the threads in a process.”
3. 我调用pthread_exit怎么没看到syscall?如下代码及strace结果,我确实能看到pthread_create是clone系统调用,却没看见child的pthread_exit的系统调用。
child_fun(void*p)
{
printf("child\n");
pthread_exit(&i);
}
int main(void)
{
pthread_t tid;
pthread_create(&tid,NULL,child_fun,NULL);
while(1)
{
}
return 0;
}
strace结果:
clone(child_stack=0x7f786b0f9fb0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f786b0fa9d0, tls=0x7f786b0fa700, child_tidptr=0x7f786b0fa9d0) = 21499
child
strace回复 6# nswcfd
|
|