@@ -68,6 +68,7 @@ static inline const char *skip_prefix(const char *str, const char *prefix)
return strncmp(str, prefix, len) ? NULL : str + len;
}
+void sig_prt_blocked(const char *str);
int sig_block(int n);
#endif /* KVM__UTIL_H */
@@ -101,6 +101,23 @@ size_t strlcat(char *dest, const char *src, size_t count)
return res;
}
+void sig_prt_blocked(const char *str)
+{
+ sigset_t sigset;
+ int i;
+
+ printf("-> %s : Blocked sig: ", str);
+
+ if (pthread_sigmask(0, NULL, &sigset) < 0)
+ return;
+ for (i = 1; i < _NSIG; i++) {
+ if (sigismember(&sigset, i))
+ printf("%d ", i);
+ }
+ printf("\n");
+
+}
+
int sig_block(int n)
{
sigset_t sigset;
This helper shows the blocked signals of the calling thread. Signed-off-by: Asias He <asias.hejun@gmail.com> --- tools/kvm/include/kvm/util.h | 1 + tools/kvm/util.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 0 deletions(-)