Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'SIGUSR1' undeclared #93

Open
aganm opened this issue Aug 5, 2020 · 1 comment
Open

'SIGUSR1' undeclared #93

aganm opened this issue Aug 5, 2020 · 1 comment

Comments

@aganm
Copy link

aganm commented Aug 5, 2020

I get a couple of errors when trying to compile thpool.c

-- Configuring done
-- Generating done
-- Build files have been written to: D:/msys64/home/Projects/test/bin
D:/msys64/home/Projects/test/src/lib/thpool.c: In function 'thpool_pause':
D:/msys64/home/Projects/test/src/lib/thpool.c:249:47: error: 'SIGUSR1' undeclared (first use in this function)
  249 |   pthread_kill(thpool_p->threads[n]->pthread, SIGUSR1);
      |                                               ^~~~~~~
D:/msys64/home/Projects/test/src/lib/thpool.c:249:47: note: each undeclared identifier is reported only once for each function it appears in
D:/msys64/home/Projects/test/src/lib/thpool.c: In function 'thread_do':
D:/msys64/home/Projects/test/src/lib/thpool.c:336:19: error: storage size of 'act' isn't known
  336 |  struct sigaction act;
      |                   ^~~
D:/msys64/home/Projects/test/src/lib/thpool.c:337:2: warning: implicit declaration of function 'sigemptyset' [-Wimplicit-function-declaration]
  337 |  sigemptyset(&act.sa_mask);
      |  ^~~~~~~~~~~
D:/msys64/home/Projects/test/src/lib/thpool.c:340:6: warning: implicit declaration of function 'sigaction' [-Wimplicit-function-declaration]
  340 |  if (sigaction(SIGUSR1, &act, NULL) == -1) {
      |      ^~~~~~~~~
D:/msys64/home/Projects/test/src/lib/thpool.c:340:16: error: 'SIGUSR1' undeclared (first use in this function)
  340 |  if (sigaction(SIGUSR1, &act, NULL) == -1) {
      |                ^~~~~~~
D:/msys64/home/Projects/test/src/lib/thpool.c:336:19: warning: unused variable 'act' [-Wunused-variable]
  336 |  struct sigaction act;
      |                   ^~~
make[2]: *** [CMakeFiles/test.dir/build.make:5491: CMakeFiles/test.dir/src/lib/thpool.c.obj] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:125: CMakeFiles/test.dir/all] Error 2
make: *** [Makefile:104: all] Error 2
 [ 0%] Building C object CMakeFiles/test.dir/src/lib/thpool.c.obj

Any idea how to fix those?

@abiiranathan
Copy link

Add #include <signal.h>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants