Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1133875
  • 博文数量: 188
  • 博客积分: 1156
  • 博客等级: 少尉
  • 技术积分: 2173
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-16 15:01
个人简介

go!go!go!

文章分类

全部博文(188)

文章存档

2024年(2)

2023年(11)

2022年(13)

2021年(15)

2020年(38)

2019年(3)

2018年(6)

2016年(1)

2015年(16)

2014年(13)

2013年(24)

2012年(46)

分类: C/C++

2013-12-06 11:26:11

给线程命名
http://www.cppblog.com/beautykingdom/archive/2009/11/08/100419.aspx

设置coredump标记。


  1. #if HAVE_PRCTL && defined(PR_SET_DUMPABLE)
  2.     /* Set Linux DUMPABLE flag */
  3.     if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) != 0)
  4.         debug(50, 2) ("prctl: %s\n", xstrerror());
  5. #endif

man中对PR_SET_DUMPABLE的解释,注意橙色部分,会导致core出不来,所以要显示的设置下。

  1. PR_SET_DUMPABLE (since Linux 2.3.20)
  2. Set the state of the flag determining whether core dumps are produced for this process upon delivery of a signal whose default behavior is to produce a core
  3. dump. (Normally this flag is set for a process by default, but it is cleared when a set-user-ID or set-group-ID program is executed and also by various sys-
  4. tem calls that manipulate process UIDs and GIDs). In kernels up to and including 2.6.12, arg2 must be either 0 (process is not dumpable) or 1 (process is
  5. dumpable). Between kernels 2.6.13 and 2.6.17, the value 2 was also permitted, which caused any binary which normally would not be dumped to be dumped read-
  6. able by root only; for security reasons, this feature has been removed. (See also the description of /proc/sys/fs/suid_dumpable in proc(5).)

阅读(9074) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~