This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
call a function even a program terminate abnormally
- From: Yubin Ruan <ablacktshirt at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Sat, 5 Aug 2017 16:13:35 +0800
- Subject: call a function even a program terminate abnormally
- Authentication-results: sourceware.org; auth=none
Hi,
I am wondering whether it is possible to invoke a function when a program
terminate abnormally (e.g., segfault). I know "atexit(3)" will do the job
if the process terminate normally. But I am wondering whether that is possible
for the abnormal case. Any system call for this (on Linux)?
I am doing some interprocess communication here. If a process just die with
a lock unlocked, there might be potential deadlock.
Thanks,
Yubin