News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Codeblocks and signal process program

Started by axxegfx, September 26, 2009, 10:03:18 PM

Previous topic - Next topic

axxegfx

I'm making two programs that they can send special signals such as SIGTERM,SIGUSR1,etc.

I don't know what's wrong with it because main program detects the signal but doesn't jump to the special function, otherwise
it offers a backtrace.

"Program received signal SIGUSR1, User defined signal 1. Do you want to view the backtrace ?

References to it in Main program:

          signal(SIGUSR1, sigusr1);

Function:
          void sigusr1(int sig)
          {
                     signal(sig, SIG_IGN);
                     printf("%d\n", rand());
                     signal(sig, sigusr1);
           }

Therefore I need so help in order to clarify what my problem is.

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]