[hurd,commited] profil-counter: Add missing SIGINFO case

Message ID 20201221010901.3866028-1-samuel.thibault@ens-lyon.org
State Committed, archived
Headers
Series [hurd,commited] profil-counter: Add missing SIGINFO case |

Commit Message

Samuel Thibault Dec. 21, 2020, 1:09 a.m. UTC
  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 | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Patch

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