The function you are looking for is sigaction . It takes three arguments, the first is a signal, the second is a pointer to the new sigaction structure, and the third is a pointer to the old sigaction structure (which will be filled with the function). To get the current signal handler, call sigaction with the second argument set to NULL. For instance,
struct sigaction oldact;
sigaction(SIGINT, NULL, &oldact);
printf("SIGINT handler address: 0x%lx\n", oldact.sa_sigaction);
This approach will require a change in source.
You can also do this through gdb, which does not require changing the source. For example, this will work if you join the process after registering registered signal handlers.
(gdb) call malloc(sizeof(struct sigaction))
(gdb) sigaction(SIGINT, NULL, $1)
(gdb) print ((struct sigaction *)$1)->sa_sigaction
(gdb) info sym <address from previous step>
source
share