What is a good way to dump a Linux core file from inside a process?

前端 未结 8 1994
醉梦人生
醉梦人生 2020-12-08 23:14

We have a server (written in C and C++) that currently catches a SEGV and dumps some internal info to a file. I would like to generate a core file and write it to disk at th

8条回答
  •  误落风尘
    2020-12-08 23:26

    You can also change the ulimit() from within your program with setrlimit(2). Like the ulimit shell command, this can lower limits, or raise them as hard as the hard limit allows. At startup setrlimit() to allow core dumping, and you're fine.

提交回复
热议问题