NetBSD-Users archive

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

Re: pselect and signal handling issue



On Tue, May 17, 2011 at 05:10:42PM +0200, anthony viallard wrote:
> Hi,
> 
> I have an issue with netBSD 5.1. My problem is related to
> 
>  * http://mail-index.netbsd.org/netbsd-users/2010/07/10/msg006559.html
>  * http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=43625
> 
> but seem the issue isn't fixed.
> 
> I'm the developper of yaddns (https://github.com/yaddns/yaddns), a
> small program to use dyndns services (no-ip, dyndns.org, ...). I'm
> trying to porting yaddns (developped on Linux) on NetBSD but i have
> found a problem with pselect and signals handling.
> 
> In my program, i install signal handler for SIGHUP, SIGTERM, SIGINT,
> SIGUSR1 and SIGUSR2 signals. In this signal handler, i modify global
> variables to inform what signal was received. As i want to process
> signals only in "waiting state", i use pselect() with a sigset empty.
> If pselect() return -1 and errno = EINTR, i known signal was caught.

Ewwww!

Have you considered using libevent?

Thor


Home | Main Index | Thread Index | Old Index