免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1995 | 回复: 4
打印 上一主题 下一主题

[进程管理] 每个进程的终止都会调用exit系统调用吗? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-01-17 11:00 |只看该作者 |倒序浏览
从<<Linux内核源代码情景分析>>中看到,进程终止的最后一步都会调用系统调用sys_exit,但是我编写一个劫持系统调用exit的模块,就看不到有什么进程结束了,只能看到唯一的一个:/usr/sbin/automount周期性的调用sys_exit。
这是为什么?

论坛徽章:
3
射手座
日期:2014-08-18 12:15:53戌狗
日期:2014-08-22 09:53:36寅虎
日期:2014-08-22 14:15:29
2 [报告]
发表于 2015-01-19 16:30 |只看该作者
进程退出调用的是sys_exit_group, not sys_exit

论坛徽章:
9
辰龙
日期:2014-08-18 20:38:42未羊
日期:2014-09-04 08:50:45丑牛
日期:2014-09-06 00:12:55寅虎
日期:2014-12-22 20:50:56摩羯座
日期:2015-01-14 22:28:15巳蛇
日期:2015-01-23 20:39:272015年辞旧岁徽章
日期:2015-03-03 16:54:1515-16赛季CBA联赛之青岛
日期:2016-03-13 23:37:1915-16赛季CBA联赛之深圳
日期:2016-03-29 18:52:38
3 [报告]
发表于 2015-01-19 20:11 |只看该作者
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)

论坛徽章:
0
4 [报告]
发表于 2015-01-26 18:53 |只看该作者
回复 2# gaojl0728


    Got it, THX

论坛徽章:
0
5 [报告]
发表于 2015-01-26 18:53 |只看该作者
回复 3# Tinnal


    后来也发现了,学习了,哈哈
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP