Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sigpending



On Tue, Apr 15, 2008 at 09:23:04PM +0200, BERTRAND Joël wrote:
>       Hello,
> 
>       I have written a subroutine that perfectly work on several Unices 
> (Solaris, Linux, Tru64, HP-UX). This subroutine can be compiled on 
> NetBSD 4.0 without any error, but doesn't work. I have done some test 
> and I have see that sigsuspend seems to return 0 even if a signal is 
> caught. I have seen that sigsuspend doesn't work in NetBSD 3.1, but I 
> haven't found any information about sigsuspend on NetBSD 4.0. Any news ?

sigsuspend seems to work fine for me, on both NetBSD 3.1 and 4.0, using
the test program below (that is, sigsuspend returns -1 when SIGUSR1
is sent to the process)

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

void handler(int sig)
{
        printf("signal %d\n", sig);
}

main()
{
        sigset_t sigset;
        struct sigaction act;
        int ret;

        act.sa_handler = handler;
        sigemptyset(&act.sa_mask);
        act.sa_flags = 0;

        if (sigaction(SIGUSR1, &act, NULL)) {
                perror("sigaction");
        }
        sigemptyset(&sigset);
        ret = sigsuspend(&sigset);
        printf("ret %d\n", ret);
        exit(0);
}

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index