bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stdlib self test: error: 'SIGTERM' undeclared


From: Bruno Haible
Subject: Re: stdlib self test: error: 'SIGTERM' undeclared
Date: Sun, 26 Sep 2010 14:57:20 +0200
User-agent: KMail/1.9.9

Simon Josefsson wrote:
> Thanks for installing that.  I should have tested more, there is another
> problem too:
> 
> /home/jas/src/gnulib/m/gltests/test-sys_wait.h:41: undefined reference to 
> `_WSTOPSIG'

Yes, I see this as well. My recipe to reproduce it is
  $ ./gnulib-tool --create-testdir --dir=/tmp/testdir --with-tests stdlib
  $ cd /tmp/testdir
  $ export PATH=.:/cross/i386-pc-mingw-tools/bin:$PATH
  $ ./configure --host=i386-pc-mingw32 --prefix=/cross/i386-pc-mingw/local \
    CPPFLAGS="-Wall -I/cross/i386-pc-mingw/local/include" \
    LDFLAGS="-L/cross/i386-pc-mingw/local/lib"
  $ make

> We _could_ do this:
> 
> -/* The signal that terminated a process is not known posthum.  */
> +/* The signal that terminated/stopped a process is not known posthum.  */
>  # define WTERMSIG(x) SIGTERM
> +# define WSTOPSIG(x) SIGSTOP
>  
> 
> However SIGSTOP doesn't exist in MinGW headers so it will fail.

There is no SIGSTOP in the mingw headers simply because there are no stopping
signals on Woe32. We don't need to define fake one, since WIFSTOPPED always
returns false. I'm applying this.

Most systems define WSTOPSIG(x) as either (((x) >> 8) & 0x7f) or
(((x) >> 8) & 0xff). Since the stopping signal values are all below < 32,
both formulas return the same value, assuming bit 15 has not been used for
another purpose.


2010-09-26  Bruno Haible  <address@hidden>

        sys_wait: Implement WSTOPSIG.
        * lib/sys_wait.in.h (WSTOPSIG): New macro.
        Reported by Simon Josefsson.

--- lib/sys_wait.in.h.orig      Sun Sep 26 14:52:59 2010
+++ lib/sys_wait.in.h   Sun Sep 26 14:45:04 2010
@@ -61,6 +61,11 @@
 #  define WEXITSTATUS(x) (((x) >> 8) & 0xff)
 # endif
 
+/* The stopping signal. Only to be accessed if WIFSTOPPED(x) is true.  */
+# ifndef WSTOPSIG
+#  define WSTOPSIG(x) (((x) >> 8) & 0x7f)
+# endif
+
 /* True if the process dumped core.  Not standardized by POSIX.  */
 # ifndef WCOREDUMP
 #  define WCOREDUMP(x) ((x) & 0x80)
@@ -98,6 +103,9 @@
 
 # define WEXITSTATUS(x) (x)
 
+/* There are no stopping signals.  */
+# define WSTOPSIG(x) 0
+
 /* There are no core dumps.  */
 # define WCOREDUMP(x) 0
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]