给线程命名
http://www.cppblog.com/beautykingdom/archive/2009/11/08/100419.aspx
设置coredump标记。
-
#if HAVE_PRCTL && defined(PR_SET_DUMPABLE)
-
/* Set Linux DUMPABLE flag */
-
if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) != 0)
-
debug(50, 2) ("prctl: %s\n", xstrerror());
-
#endif
man中对
PR_SET_DUMPABLE的解释,注意橙色部分,会导致core出不来,所以要显示的设置下。
-
PR_SET_DUMPABLE (since Linux 2.3.20)
-
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
-
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-
-
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
-
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-
-
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).)
阅读(1556) | 评论(0) | 转发(0) |