Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com Message-ID: <03cf01c28c4f$aa191230$0201a8c0@sos> From: "Sergey Okhapkin" To: Subject: siginterrupt() call implementation Date: Thu, 14 Nov 2002 21:35:27 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) The patch implements siginterrupt(3) library function. 2002-11-14 Sergey Okhapkin * cygwin.din (siginterrupt): New export. * signal.cc (siginterrupt): New. Index: cygwin.din =================================================================== RCS file: /cvs/src/src/winsup/cygwin/cygwin.din,v retrieving revision 1.67 diff -u -p -r1.67 cygwin.din --- cygwin.din 7 Nov 2002 09:08:39 -0000 1.67 +++ cygwin.din 15 Nov 2002 02:31:50 -0000 @@ -740,6 +740,8 @@ sigemptyset _sigemptyset = sigemptyset sigfillset _sigfillset = sigfillset +siginterrupt +_siginterrupt = siginterrupt signal _signal = signal significand Index: signal.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/signal.cc,v retrieving revision 1.36 diff -u -p -r1.36 signal.cc --- signal.cc 20 Oct 2002 04:15:50 -0000 1.36 +++ signal.cc 15 Nov 2002 02:31:51 -0000 @@ -407,3 +407,16 @@ pause (void) { return handle_sigsuspend (myself->getsigmask ()); } + +extern "C" int +siginterrupt (int sig, int flag) +{ + struct sigaction act; + (void)sigaction(sig, NULL, &act); + if (flag) + act.sa_flags &= ~SA_RESTART; + else + act.sa_flags |= SA_RESTART; + return sigaction(sig, &act, NULL); +} + Sergey Okhapkin Somerset, NJ