每个进程的终止都会调用exit系统调用吗?
从<<Linux内核源代码情景分析>>中看到,进程终止的最后一步都会调用系统调用sys_exit,但是我编写一个劫持系统调用exit的模块,就看不到有什么进程结束了,只能看到唯一的一个:/usr/sbin/automount周期性的调用sys_exit。这是为什么?
进程退出调用的是sys_exit_group, not sys_exit exit_group(2) - Linux man page
Name
exit_group - exit all threads in a process
Synopsis
#include <linux/unistd.h>
void exit_group(int status);
Description
This system call is equivalent to exit(2) except that it terminates not only the calling thread, but all threads in the calling process's thread group.
Return Value
This system call does not return.
Versions
This call is present since Linux 2.5.35.
Conforming to
This call is Linux-specific.
Notes
Since glibc 2.3, this is the system call invoked when the exit(2) wrapper function is called.
See Also
exit(2)
Referenced By
ptrace(2) 回复 2# gaojl0728
Got it, THX 回复 3# Tinnal
后来也发现了,学习了,哈哈
页:
[1]