sigset_t
Dan Nelson
dnelson at allantgroup.com
Mon May 24 07:53:00 PDT 2004
In the last episode (May 24), Arne Dirks said:
> I have just coded something on my Mac with signal funcionalities. On
> my machine (OS X 10.3) it compiles without problems, but on a FreeBSD
> 5.2.1 machine I get an error. The compiler says:
>
> main.c:10: error: invalid initializer
> *** Error code 1
>
>
> My Code was:
>
> 10: sigset_t sig = SIGALRM;
sigset_t is a signal set, which I believe is a bitmap internally.
SIGALRM is just a number. You must use the functions listed in the
sigsetops manpage to manipulate signal sets. The correct code for your
case would be something like:
sigset_t sig;
sigemptyset(&sig);
sigaddset(&sig, SIGALRM);
--
Dan Nelson
dnelson at allantgroup.com
More information about the freebsd-questions
mailing list