============================================================
Wei Qu
Graduate Student, Research Assistant
Faculty of Computer Science, Dalhousie University
E_Mail: [EMAIL PROTECTED]
Home  : http://www.cs.dal.ca/~wei/
************************************************************
May you have warm words on the cold evening, a full moon on
the dark night, and a smooth road all the way to your door.
============================================================

On Mon, 21 May 2001, Guy Harris wrote:

> > I have a question about the block of pcap_dispatch(). When pcap_dispatch is 
> > blocked in the time specified by pcap_open_live(), a signal is delivery to it 
> > and the signal handler is invoked and then return,
> > 1) Will the blocked pcap_dispatch() be interrupted? 
> > 2) If the blocked pcap_dispatch() is interrupted, will the errno be set to 
> > EINTR?

> 
>       4) "pcap-linux.c" also continues on EINTR.
> 

But the problem is I can not make pcap_dispatch() interrupted by SIGALRM.
I set the signal handler with the following code:

act.sa_handler = sig_alrm;
sigemptyset( &act.sa_mask);
act.sa_flags = 0;
act.sa_flags |= SA_INTERRUPT;
sigaction( SIGALRM, &act, &oact );


but the pcap_dispatch() does not return when the signal is delivered.

Does this mean I have to first use select() to wait for the return value
of pcap_fileno() to be readable and then call pacp_dispatch()?

Thanks in advance!  

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to