summary refs log tree commit diff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-12-21 02:02:47 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-12-21 02:08:33 +0100
commit53432762ac2ff24794089e2c767b976e54c2dc0a (patch)
treec8a05321d4ae422db86c0ba5fbdd5e9d92a5cde9
parentd865ff74ba096d016c9b1542a4e3d305169c9e55 (diff)
downloadglibc-53432762ac2ff24794089e2c767b976e54c2dc0a.tar.gz
glibc-53432762ac2ff24794089e2c767b976e54c2dc0a.tar.xz
glibc-53432762ac2ff24794089e2c767b976e54c2dc0a.zip
profil-counter: Add missing SIGINFO case
When SA_SIGINFO is available, sysdeps/posix/s?profil.c use it, so we have to
fix the __profil_counter function accordingly, using sigcontextinfo.h's
sigcontext_get_pc.
-rw-r--r--sysdeps/generic/profil-counter.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdeps/generic/profil-counter.h b/sysdeps/generic/profil-counter.h
index 1fa7bc7653..da13e6aca9 100644
--- a/sysdeps/generic/profil-counter.h
+++ b/sysdeps/generic/profil-counter.h
@@ -19,8 +19,18 @@
 /* In many Unix systems signal handlers are called like this
    and the interrupted PC is easily findable in the `struct sigcontext'.  */
 
+#ifdef SA_SIGINFO
+#include <sigcontextinfo.h>
+
+static void
+__profil_counter (int signr, siginfo_t *info, void *ctx)
+{
+  profil_count (sigcontext_get_pc (ctx));
+}
+#else
 static void
 __profil_counter (int signr, int code, struct sigcontext *scp)
 {
   profil_count ((uintptr_t) scp->sc_pc);
 }
+#endif