From: sos AT prospect DOT com DOT ru (Sergey Okhapkin) Subject: Signal handling for cygwin.dll 1 Apr 1997 07:34:15 -0800 Sender: daemon AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <01BC3EB7.251A0210.cygnus.gnu-win32@gater.krystalbank.msk.ru> Original-To: "'Gnu-Win32'" Original-Cc: "'Geoffrey Noer'" Encoding: 60 TEXT, 221 UUENCODE X-MS-Attachment: signal.diff 0 00-00-1980 00:00 Original-Sender: owner-gnu-win32 AT cygnus DOT com Hi! This patch adds interprocess signals support with (almost :-) unix semantics for cygwin.dll while running on Windows NT. The only supported signal on Windows 95 is SIGKILL, because of Win32 API call CreateRemoteThread() is not supported on W95, and I don't see any way to implement signals without this call easy... This patch also includes my "Ctrl-C in bash" patch. Any bug reports/improvements are welcome. To test this patch I've used the following simple program: kill.c: #include #include #include static void usage (); int main (int ac, char **av) { int i=1, sig=SIGKILL; if (ac == 1) usage (); if (av[1][0] == '-') { sig = -atoi(av[1]); i++; } for (; i < ac; ++i) { int pid = atoi (av[i]); printf ("Killing %d with %d\n", pid, sig); kill(pid, sig); } return 0; } static void usage () { fprintf (stderr, "Usage: kill [-SigNum] pid1 [pid2 ...]\n"); exit (1); } ------------------------ BTW, prototype for kill() is missed in ... -- Sergey Okhapkin Moscow, Russia Looking for a job. begin 600 signal.diff M*BHJ('-Y6=N=7,O8V1K M+7-R8R]W:6YS=7 O97AC97!T:6]N6=W:6Y?97AC97!T:6]N7VAA M;F1L97(["B @"BT@PH@(" @=6YS:6=N960@:6YT(&-O9&4["BTM M+2 R,RPS-B M+2TM"B @"B @97AT97)N(")#(B!E>&-E<'1I;VY?:&%N9&QE M&-E<'1I;VY?:&%N9&QE6=W:6X@<')O8V5S'0@*'4M/G-E;&8M/FA4:')E860L M(" F;W)I9RD[("\J(%)E'0@*$]U6)O87)D(&EN=&5R M7!E*0H@('L*(" @(&EN="!S:6<["BTM+2 U-38L M-38R("TM+2T*(" *(" O*B!+97EB;V%R9"!I;G1EPH@(" @:6YT('-I9SL**BHJ*BHJ*BHJ*BHJ*BHJ"BHJ M*B U-CDL-3DS("HJ*BH*(" @(" @8V%S92!#5%),7TQ/1T]&1E]%5D5.5#H* M(" @(" @("!S:6<@/2!324=(55 ["B @(" @(" @8G)E86L["BT@(" @(&1E M9F%U;'0Z"B @(" @(&-A7!E+"!S:6&ET(&AA;F1L97)S+B @*B\*(2 @(" @("!E>&ET M("@H&ET(&AA;F1L97)S+B @*B\*(2 @(" @(" O M*F5X:70@*"AS:6<\/#@I('P@,'@Q,# P,"D[*B\*(2!K:6QL DOT AT D@9&5B=6=? M<')I;G1F("@B8W1R;%]C7VAA;F1L97(Z('1Y<&4@)60L('-I9R E9"P AT 86)O M=70@=&\@8V%L;"!?97AI=%QN(BP*(2 )"71Y<&4L('-I9RD["B$@"2!C86QL M7VAA;F1L97(@*%]E>&ET+" HPHA(" @(" @(&5X:70@*#0I.PH@(" @("!] M"B @"B @("!D96)U9U]PPHA(" @ M(" @("\J97AI=" H-"D[*B\*(2 @(" @("!D96)U9U]P7!E("5D+"!S:6<@)60L(&%B M;W5T('1O(&-A;&P@)7!<;B(L"BHJ*BHJ*BHJ*BHJ*BHJ*@HJ*BH AT -C V+#8Q M,B J*BHJ"B @"B @("!D96)U9U]P7-C86QL7W!R:6YT9B H(D-91U=)3B!296QE87-E M("5D+B5D+"!C;VUP:6QE9" E6=W:6Y?9&QL7W9E7-C86QL7W!R:6YT9B H(E]E>&ET("@E M9"E<;B(L(&XI.PH@(" @PHK(" @(" @PHA( D@(" @ M("!?7W-E=&5R'@G DOT 34 AT 9&]EPHA( D@(" @(" @(%]?%QN(BP@:%)T*3L*(2 ) M(" @(')EPH@( D@(" @("!?7W-E=&5RPH@(" @:6YT(&D["B @"B$@("!F;W(@*&D@/2 P.R!I(#P AT 9V5T9'1A8FQE M#@P,# P M,# I("8F("AV97)S:6]N("8@,'AF9BD@/B S*0H@( ER971U