]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
profil-counter: Add missing SIGINFO case
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 21 Dec 2020 01:02:47 +0000 (02:02 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 21 Dec 2020 01:08:33 +0000 (02:08 +0100)
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.

sysdeps/generic/profil-counter.h

index 1fa7bc76535f1b5d13e932dcb1ec0e597f88f0f2..da13e6aca9551bb175b56eedad3cd415943eb042 100644 (file)
 /* 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