From: Samuel Thibault Date: Mon, 21 Dec 2020 01:02:47 +0000 (+0100) Subject: profil-counter: Add missing SIGINFO case X-Git-Tag: glibc-2.33~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53432762ac2ff24794089e2c767b976e54c2dc0a;p=thirdparty%2Fglibc.git 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. --- diff --git a/sysdeps/generic/profil-counter.h b/sysdeps/generic/profil-counter.h index 1fa7bc76535..da13e6aca95 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 + +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