Browse Source

Use SIGPROF only if it is available

The SIGPROF signal is an XSI option and obsolescent in XSI. POSIX systems
are not required to have it.

This change is released under the MIT/X11 license.
Jonas 'Sortie' Termansen 11 years ago
parent
commit
82364ccaaa
2 changed files with 4 additions and 0 deletions
  1. 2 0
      mono/mini/mini-posix.c
  2. 2 0
      support/old-map.c

+ 2 - 0
mono/mini/mini-posix.c

@@ -296,6 +296,7 @@ SIG_HANDLER_FUNC (static, sigusr1_signal_handler)
 #define FULL_STAT_PROFILER_BACKTRACE 0
 #endif
 
+#ifdef SIGPROF
 #if defined(__ia64__) || defined(__sparc__) || defined(sparc) || defined(__s390__) || defined(s390)
 
 SIG_HANDLER_FUNC (static, sigprof_signal_handler)
@@ -384,6 +385,7 @@ SIG_HANDLER_FUNC (static, sigprof_signal_handler)
 	mono_chain_signal (SIG_HANDLER_PARAMS);
 }
 
+#endif
 #endif
 
 SIG_HANDLER_FUNC (static, sigquit_signal_handler)

+ 2 - 0
support/old-map.c

@@ -155,8 +155,10 @@ int map_Mono_Posix_Signals (int x)
 		 return SIGXFSZ;
 	if (x == Mono_Posix_Signals_SIGVTALRM)
 		 return SIGVTALRM;
+#ifdef SIGPROF
 	if (x == Mono_Posix_Signals_SIGPROF)
 		 return SIGPROF;
+#endif
 	if (x == Mono_Posix_Signals_SIGWINCH)
 		 return SIGWINCH;
 #ifdef SIGIO