Include signal.h unconditionally. (mono/mono#17430)
authorJay Krell <jaykrell@microsoft.com>
Thu, 24 Oct 2019 21:44:57 +0000 (14:44 -0700)
committerAleksey Kliger (λgeek) <alklig@microsoft.com>
Thu, 24 Oct 2019 21:44:57 +0000 (17:44 -0400)
Some of the includes already were unconditional, including both on Win32 and Unix.
It is part of ANSI C 89, albeit in a reduced form compared to typical Unix (no sigaction).

Remove configuration of MSG_NOSIGNAL which has no other uses.

Preserve configuration of signal.h temporarily due to other uses of ifdef HAVE_SIGNAL_H.
 i.e. LLVM?

Commit migrated from https://github.com/mono/mono/commit/fc390a5f2493ae908ccf2696c4ca675d82104db6

16 files changed:
src/mono/configure.ac
src/mono/mono/metadata/metadata-verify.c
src/mono/mono/metadata/threads.c
src/mono/mono/metadata/w32process-unix.c
src/mono/mono/metadata/w32socket-unix.c
src/mono/mono/mini/driver.c
src/mono/mono/mini/exceptions-amd64.c
src/mono/mono/mini/mini-amd64.h
src/mono/mono/mini/mini-exceptions.c
src/mono/mono/mini/mini-runtime.c
src/mono/mono/mini/mini-x86.h
src/mono/mono/mini/mini.h
src/mono/mono/utils/mono-context.h
src/mono/mono/utils/mono-mmap-wasm.c
src/mono/mono/utils/mono-mmap.c
src/mono/mono/utils/mono-sigcontext.h

index 5936374..b5384c2 100644 (file)
@@ -2361,21 +2361,6 @@ if test x$host_win32 = xno; then
                        AC_CHECK_LIB(inotify, inotify_init, LIBS="$LIBS -linotify")
        esac
 
-       dnl *******************************
-       dnl *** Checks for MSG_NOSIGNAL ***
-       dnl *******************************
-       AC_MSG_CHECKING(for MSG_NOSIGNAL)
-       AC_TRY_COMPILE([#include <sys/socket.h>], [
-               int f = MSG_NOSIGNAL;
-       ], [
-               # Yes, we have it...
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [Have MSG_NOSIGNAL])
-       ], [
-               # We'll have to use signals
-               AC_MSG_RESULT(no)
-       ])
-
        dnl *****************************
        dnl *** Checks for IPPROTO_IP ***
        dnl *****************************
index eaa22e1..321258e 100644 (file)
@@ -32,7 +32,6 @@
 #include <mono/utils/mono-error-internals.h>
 #include <mono/utils/bsearch.h>
 #include <string.h>
-//#include <signal.h>
 #include <ctype.h>
 
 #ifndef DISABLE_VERIFIER
index e8ebd02..1d1f11f 100644 (file)
@@ -64,9 +64,7 @@
 #include <sys/wait.h>
 #endif
 
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 #if defined(HOST_WIN32)
 #include <objbase.h>
@@ -6385,7 +6383,6 @@ summarizer_state_init (SummarizerGlobalState *state, MonoNativeThreadId current,
 static void
 summarizer_signal_other_threads (SummarizerGlobalState *state, MonoNativeThreadId current, int current_idx)
 {
-#ifdef HAVE_SIGNAL_H
        sigset_t sigset, old_sigset;
        sigemptyset(&sigset);
        sigaddset(&sigset, SIGTERM);
@@ -6404,7 +6401,6 @@ summarizer_signal_other_threads (SummarizerGlobalState *state, MonoNativeThreadI
                g_error ("pthread_kill () is not supported by this platform");
        #endif
        }
-#endif
 }
 
 // Returns true when there are shared global references to "this_thread"
index ddf251b..14559fd 100644 (file)
@@ -22,9 +22,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 #include <sys/time.h>
 #include <fcntl.h>
 #ifdef HAVE_SYS_PARAM_H
index bd5baf3..5822ee7 100644 (file)
@@ -42,9 +42,7 @@
 #ifdef HAVE_SYS_SOCKIO_H
 #include <sys/sockio.h>    /* defines SIOCATMARK */
 #endif
-#ifndef HAVE_MSG_NOSIGNAL
 #include <signal.h>
-#endif
 #ifdef HAVE_SYS_SENDFILE_H
 #include <sys/sendfile.h>
 #endif
index 06db626..cce7f34 100644 (file)
@@ -12,9 +12,7 @@
  */
 
 #include <config.h>
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 #if HAVE_SCHED_SETAFFINITY
 #include <sched.h>
 #endif
index d5ff063..88224bd 100644 (file)
 
 #include <glib.h>
 #include <string.h>
-
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 #ifdef HAVE_UCONTEXT_H
 #include <ucontext.h>
 #endif
index c5aa259..6f17a90 100644 (file)
 
 #ifdef HOST_WIN32
 #include <windows.h>
-/* use SIG* defines if possible */
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 #if !defined(_MSC_VER)
 /* sigcontext surrogate */
@@ -26,7 +23,7 @@ struct sigcontext {
        guint64 edx;
        guint64 ebp;
        guint64 esp;
-    guint64 esi;
+       guint64 esi;
        guint64 edi;
        guint64 eip;
 };
index 1f583c8..b00db6f 100644 (file)
 #include <config.h>
 #include <glib.h>
 #include <string.h>
-
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 #ifdef HAVE_EXECINFO_H
 #include <execinfo.h>
index f05af55..4887061 100644 (file)
@@ -23,9 +23,7 @@
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 #include <mono/utils/memcheck.h>
 
index d64c37f..6791b57 100644 (file)
 
 #ifdef HOST_WIN32
 #include <windows.h>
-/* use SIG* defines if possible */
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 typedef void MONO_SIG_HANDLER_SIGNATURE ((*MonoW32ExceptionHandler));
 
index 9d6dd04..db89b70 100644 (file)
@@ -10,9 +10,7 @@
 
 #include "config.h"
 #include <glib.h>
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
index dda6b86..696c0df 100644 (file)
 #include "mono-compiler.h"
 #include "mono-sigcontext.h"
 #include "mono-machine.h"
-
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 #define MONO_CONTEXT_OFFSET(field, index, field_type) \
     "i" (offsetof (MonoContext, field) + (index) * sizeof (field_type))
index 10485f7..c8ff1f8 100644 (file)
@@ -13,9 +13,7 @@
 #ifdef HAVE_SYS_SYSCTL_H
 #include <sys/sysctl.h>
 #endif
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 #include <fcntl.h>
 #include <string.h>
 #include <unistd.h>
index 3be70d9..174b154 100644 (file)
@@ -22,9 +22,7 @@
 #ifdef HAVE_SYS_SYSCTL_H
 #include <sys/sysctl.h>
 #endif
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 #include <fcntl.h>
 #include <string.h>
 #include <unistd.h>
index 254d7ab..b23b706 100644 (file)
@@ -18,9 +18,7 @@
 #include <unistd.h>
 #endif
 
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 #if defined(TARGET_X86)