1

While working on the .c files I encountered the problem with siginfo_t. The header file I am using are:

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <pthread.h>
#include <signal.h>
#include <unistd.h>
#include <time.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/prctl.h>
#include <execinfo.h>
#include <sys/types.h>
#include <fcntl.h>
#include <gnu/libc-version.h>
#include <sys/utsname.h>
#include <ucontext.h> 
#include "libapiinc.h" 

The header files are configured properly. The snapshot of small part of code is as follows:

static void sighandler(int signum, siginfo_t *info, void *ptr)

Image showing problem in code

As I know the Siginfo comes under the signal header file, I have configured that includes properly.

What should be done to resolve the error of this siginfo_t? Which appears as Type siginfo_t couldn't be resolved

user16217248
  • 3,119
  • 19
  • 19
  • 37
  • 1
    Don't post pictures of code and errors, post them as actual text. – Shawn Mar 10 '23 at 05:54
  • Do note that your signal handler invokes undefined behavior. `fprintf()` is async-signal-unsafe. – Harith Mar 10 '23 at 06:22
  • 1
    Does this answer your question? [unknown type name 'siginfo\_t' with Clang using \_POSIX\_C\_SOURCE 2, why?](https://stackoverflow.com/questions/22912674/unknown-type-name-siginfo-t-with-clang-using-posix-c-source-2-why) – Harith Mar 10 '23 at 06:27

0 Answers0