[Libevent-users] Signals question regarding libevent

Subbu Subramaniam mcvsubbu at yahoo.com
Wed Dec 19 12:11:36 EST 2007


A follow-up question.

Can the same signal be registered multiple times, each with a different void *
context? Is the expectation that the callback will be called multiple times
correct?

In the attached program, the callback function seems to be called only once,
even though it is registered two times.

I tried it in FreeBSD-4.11/libevent-1.1b, and RHEL-2.6.9/libevent-1.3e. In
Freebsd, the last registered void * is given in the callback whereas in linux,
it is the first one. But the callback happens only once.

Is this a bug?

-Subbu

--- Niels Provos <provos at citi.umich.edu> wrote:

> Hi Subbu,
> 
> please, use signal_{set,add,del} for handling signals when you use libevent.
> 
> Niels.
> 
> On Dec 18, 2007 5:17 PM, Subbu Subramaniam <mcvsubbu at yahoo.com> wrote:
> > Hi,
> >
> > What is the right way to handle siganls while using libevent?
> >
> > Am I supposed to use signal_set()/signal_add() etc. calls, or am I supposed
> to
> > install my own signal handler and use event_sigcb and event_gotsig (or, am
> I
> > supposed to do both somehow?)
> >
> > Thanks
> >
> > -Subbu
> >
> > --
> > Subbu Subramaniam
> > _______________________________________________
> > Libevent-users mailing list
> > Libevent-users at monkey.org
> > http://monkeymail.org/mailman/listinfo/libevent-users
> >
> >
> 

--
Subbu Subramaniam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sigtest2.c
Type: application/octet-stream
Size: 2020 bytes
Desc: 2062010864-sigtest2.c
Url : http://monkeymail.org/archives/libevent-users/attachments/20071219/12459cd7/sigtest2.obj


More information about the Libevent-users mailing list