Problems getting signal to work

Chris Welch cwelch at
Tue Sep 3 21:55:44 UTC 2002

I'm having problems to get signals working properly with RTEMS 4.5.1.

With the program example at the end of this email, SIGALRM is does get set
(sigismember begins to return 1) after a three second delay, but the
handler, catchsig, is never called.

This program works correctly under Linux and Cygwin.

Any suggestions would be appreciated.

Perhaps there is a configuration definition I'm missing?

Thanks in advance,


#include <stdio.h>
#include <signal.h>

void catchsig();

int main()
        char     c = '.';
        sigset_t NewSet;
        struct sigaction NewSigAction;
        struct sigaction OldSigAction;

        // Set up the new signal action
        NewSigAction.sa_handler = catchsig;
        NewSigAction.sa_mask    = NewSet;
        NewSigAction.sa_flags   = 0;

        sigaction(SIGALRM, &NewSigAction, &OldSigAction);

        write(1, &c, 1);
                printf("%lx\n", sigismember(&NewSet, SIGALRM));
        exit (0);

void catchsig()
        char c = '.';

        write(1, &c, 1);

Chris Welch, Neumes Consulting, PC and UNIX Solutions
mailto:cwelch at
613)797-7831 FAX:(613)838-5602
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Chris Welch.vcf
Type: text/x-vcard
Size: 369 bytes
Desc: not available
URL: <>

More information about the users mailing list