| www.delorie.com/archives/browse.cgi | search |
| X-Spam-Check-By: | sourceware.org |
| Message-ID: | <4420BF24.2010609@infodev.ca> |
| Date: | Tue, 21 Mar 2006 22:06:12 -0500 |
| From: | "D.Pageau" <dpageau AT infodev DOT ca> |
| User-Agent: | Thunderbird 1.5 (Windows/20051201) |
| MIME-Version: | 1.0 |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: signal is not delivered to the handler |
| References: | <BAY102-F1419989AED32B053AE39DABD0E0 AT phx DOT gbl> <20060206050928 DOT GA15260 AT trixie DOT casa DOT cgf DOT cx> <441E135B DOT 8020900 AT infodev DOT ca> <20060320135644 DOT GD24528 AT trixie DOT casa DOT cgf DOT cx> |
| In-Reply-To: | <20060320135644.GD24528@trixie.casa.cgf.cx> |
| X-IsSubscribed: | yes |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
> If you have a simple test case which illustrates the problem, we'll
> certainly investigate. Otherwise, I doubt that anyone is going to debug
> lzrz for you.
I was wrong, signal is delivred to handler but read() does not exit with
EINTR on SIGALRM like Linux and FreeBSD does. Did I miss something ?
#include <signal.h>
#include <stdio.h>
#define BUFZ 5
void alarm_handler(int signo)
{
fprintf(stderr, "SIGNAL: %d\n", signo);
}
int main()
{
char buff[BUFSIZ];
FILE *logfp = NULL;
siginterrupt(SIGALRM,1);
signal(SIGALRM, alarm_handler);
alarm(5);
fprintf (stderr, "Should timeout by itself in 5 secs\n");
read(0,buff,BUFSIZ);
fprintf (stderr, "Timeout\n");
alarm(0);
signal(SIGALRM,SIG_DFL);
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |