[60] in Pthreads mailing list archive

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

sigsuspend?

daemon@ATHENA.MIT.EDU (Jung-Ho Ahn)
Fri Aug 4 23:52:41 1995

From: jhahn@candy.snu.ac.kr (Jung-Ho Ahn)
Date: Sat, 5 Aug 1995 10:39:40 +0900
To: pthreads@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");

}

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.


thanks in advance,

-- 
Z""""""":.               
 ":       ":.            An unbreakable toy is useful
   ":.      :     ....        for breaking other toys.
     :     :' .:""    """:        ^        .^
      ":    ""            ".     /:\-^-v^./: \
        ":..:      .       ":. . \/        \ / 
            :    ..:    .:   """ /  (.)(.)  \    
            : ..':  ;  .' ."     )   /~\    (      
          :" :   : :  :._')))    `- \ U / - '
          l_'))) l_'))             :`---'. 
 Jung-Ho Ahn                      "':    :.
 OOPSLA Lab. Dept. of Computer Eng.  "":  ;                 
 Seoul National Univ.                  (_)))

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