This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Readline on MinGW


> Date: Wed, 27 Apr 2005 23:53:31 -0700
> From: Mark Mitchell <mark@codesourcery.com>
> 
> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]