From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26429 invoked by alias); 28 Apr 2005 20:09:58 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 26374 invoked from network); 28 Apr 2005 20:09:52 -0000 Received: from unknown (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org with SMTP; 28 Apr 2005 20:09:52 -0000 Received: from zaretski (IGLD-80-230-65-115.inter.net.il [80.230.65.115]) by romy.inter.net.il (MOS 3.5.6-GR) with ESMTP id BCC36975 (AUTH halo1); Thu, 28 Apr 2005 23:08:22 +0300 (IDT) Date: Thu, 28 Apr 2005 20:09:00 -0000 From: "Eli Zaretskii" To: Mark Mitchell Message-ID: <01c54c2d$Blat.v2.4$f3029840@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 CC: bug-readline@gnu.org, gdb-patches@sources.redhat.com In-reply-to: <4270886B.1020806@codesourcery.com> (message from Mark Mitchell on Wed, 27 Apr 2005 23:53:31 -0700) Subject: Re: PATCH: Readline on MinGW Reply-to: Eli Zaretskii References: <4270886B.1020806@codesourcery.com> X-SW-Source: 2005-04/txt/msg00395.txt.bz2 > Date: Wed, 27 Apr 2005 23:53:31 -0700 > From: Mark Mitchell > > This patch begins adding support for MinGW to readline. There is one > other patche required, which is *much* smaller, but somewhat more > complex; this patch is the large, mechanical patch. In general, this > patch checks for the availability of more things in autoconf, and then > disables uses of those things when they are not present. There are no > actual changes to the code itself, just additional conditionals, with > the exception that a call to "kill" is turned into a call to the POSIX > "raise", which, unlike "kill", is also available on Windows. I support all the patches suggested by Mark, except the one which calls `raise' instead of `kill'. Here's the relevant hunk: > *************** rl_signal_handler (sig) > *** 158,168 **** > > #if defined (__EMX__) > signal (sig, SIG_ACK); > #endif > > ! kill (getpid (), sig); > > /* Let the signal that we just sent through. */ > #if defined (HAVE_POSIX_SIGNALS) > sigprocmask (SIG_SETMASK, &set, (sigset_t *)NULL); > #else /* !HAVE_POSIX_SIGNALS */ > --- 166,176 ---- > > #if defined (__EMX__) > signal (sig, SIG_ACK); > #endif > > ! raise (sig); > > /* Let the signal that we just sent through. */ > #if defined (HAVE_POSIX_SIGNALS) > sigprocmask (SIG_SETMASK, &set, (sigset_t *)NULL); > #else /* !HAVE_POSIX_SIGNALS */ I am not sure `raise' is a 100% compatible replacement for `kill', since the latter really delivers a signal, and so is subject to rules regarding blocked signals, while `raise' simlpy calls the signal handler and AFAIK is not specified to observe blocked signals. So I suggest to use `raise' only on systems, such as MinGW, which lack `kill', not everywhere.