[99] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

Re: sigsuspend?

daemon@ATHENA.MIT.EDU (Christopher Provenzano)
Sun Aug 27 05:38:08 1995

To: jhahn@candy.snu.ac.kr (Jung-Ho Ahn)
Cc: pthreads@MIT.EDU
In-Reply-To: Your message of "Sat, 05 Aug 1995 10:39:40 +0900."
             <9508050139.AA18468@candy.snu.ac.kr> 
Date: Sun, 27 Aug 1995 05:20:50 EDT
From: Christopher Provenzano  <proven@MIT.EDU>


> 'sigsuspend()' function doesn't seem to work well.
> the following program can't get a signal:
> #include <signal.h>
> 
> void wakeup() { }
> 
> 
> main()
> {
>     struct sigaction act;
>     act.sa_handler = wakeup;
>     sigemptyset(&act.sa_mask);
>     act.sa_flags = 0;
>     if ( sigaction(SIGUSR1, &act, 0) < 0 ) {
>         perror("sigaction");
>         exit(-1);
>     }
> 
>     sigset_t zeromask;
> 
>     sigemptyset(&zeromask);
> 
>     if ( sigsuspend(&zeromask) != -1 ) {
>         perror("sigsuspend");
>         exit(-1);
>     }
> 
>     printf("ok!\n");
> 
> }

The problem is with sigaction(), which isn't implemented in beta3. I've 
added a pthread_sigaction() for beta4, But to actually make is sigaction() 
will require a bit of asm hacking.

> 
> And also, sigprocmask() does not check whether the
> second arguemnt is NULL or not. so if it can't be
> used to examine the process's signal mask.
> 

This will be fixed in beta4.

CAP

home help back first fref pref prev next nref lref last post