diff --git a/src/acconfig.h b/src/acconfig.h
index d8dcfdd4f76bdabf88c36548981c8ac5db7fdb82..7c45fb2226ef9165ca4fa865c933667c07933140 100644
--- a/src/acconfig.h
+++ b/src/acconfig.h
@@ -29,6 +29,9 @@
 /* Define to 'int' if <sys/time.h> doesn't */
 #undef time_t
 
+/* Define to 'int' if <signal.h> doesn't */
+#undef sig_atomic_t
+
 /* Define as the return type of signal handlers (int or void).  */
 #undef RETSIGTYPE
 
diff --git a/src/configure.in b/src/configure.in
index fd2d588ffceeccf64ef79f0d6154b0605942df7d..63edae9ade564f4dfaa03dcb5a68deb87e6585de 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1,4 +1,4 @@
-AC_REVISION("$Id: configure.in,v 1.161 1998/02/27 17:08:44 marcus Exp $")
+AC_REVISION("$Id: configure.in,v 1.162 1998/02/27 17:35:04 marcus Exp $")
 AC_INIT(interpret.c)
 AC_CONFIG_HEADER(machine.h)
 
@@ -650,7 +650,7 @@ memory.h values.h string.h strings.h fcntl.h sys/filio.h sys/sockio.h crypt.h \
 locale.h sys/resource.h sys/select.h sys/mman.h setjmp.h limits.h pthread.h \
 thread.h dlfcn.h dld.h sys/times.h sched.h sys/procfs.h sys/param.h winsock.h \
 sys/ioct.h sys/socket.h malloc.h netinet/in.h sys/wait.h winbase.h grp.h pwd.h \
-passwd.h group.h winsock2.h)
+passwd.h group.h winsock2.h signal.h)
 
 AC_CHECK_SIZEOF(char *,4)
 AC_CHECK_SIZEOF(long,4)
@@ -1482,12 +1482,38 @@ fi
 
 ########################################################################
 
+AC_MSG_CHECKING(for sig_atomic_t)
+AC_CACHE_VAL(ac_cv_type_sig_atomic_t,
+[
+  AC_EGREP_CPP(sig_atomic_t, [
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif], ac_cv_type_sig_atomic_t=yes, ac_cv_type_sig_atomic_t=no)])
+AC_MSG_RESULT($ac_cv_type_sig_atomic_t)
+if test x"$ac_cv_type_sig_atomic_t" = xno; then
+  AC_DEFINE(sig_atomic_t, int)
+else
+  :
+fi
+
 AC_MSG_CHECKING(if signal handlers reset automatically)
 AC_CACHE_VAL(pike_cv_sys_signal_oneshot,
 [
 AC_TRY_RUN([
+#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-char sigrun=0;
+#endif
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+volatile sig_atomic_t sigrun=0;
 RETSIGTYPE func(int sig) { sigrun=1; }
 
 int main()