Procházet zdrojové kódy

* map.h: Flush.
* signal.c: Add Mono_Posix_SIGRTMIN(), Mono_Posix_SIGRTMAX(),
Mono_Posix_FromRealTimeSignum().
Patch thanks to [email protected].

svn path=/trunk/mono/; revision=121852

Jonathan Pryor před 17 roky
rodič
revize
848c445e8e
3 změnil soubory, kde provedl 42 přidání a 1 odebrání
  1. 7 0
      support/ChangeLog
  2. 3 0
      support/map.h
  3. 32 1
      support/signal.c

+ 7 - 0
support/ChangeLog

@@ -1,3 +1,10 @@
+2008-12-19  Jonathan Pryor  <[email protected]>
+
+	* map.h: Flush.
+	* signal.c: Add Mono_Posix_SIGRTMIN(), Mono_Posix_SIGRTMAX(),
+	  Mono_Posix_FromRealTimeSignum().
+	  Patch thanks to [email protected].
+
 2008-11-06  Alan McGovern  <[email protected]>
 
 	* Makefile.am: Missed out on a header file for minizip

+ 3 - 0
support/map.h

@@ -1583,7 +1583,10 @@ int map_Mono_Posix_AccessMode (int mode);
 int map_Mono_Posix_FileMode (int mode);
 int map_Mono_Posix_OpenFlags (int flags);
 int map_Mono_Posix_WaitOptions (int wait_options);
+int Mono_Posix_FromRealTimeSignum (int offset, int* rval);
 int Mono_Posix_FromStatvfs (struct Mono_Posix_Statvfs* source, void* destination);
+int Mono_Posix_SIGRTMAX (void);
+int Mono_Posix_SIGRTMIN (void);
 int Mono_Posix_Stdlib__IOFBF (void);
 int Mono_Posix_Stdlib__IOLBF (void);
 int Mono_Posix_Stdlib__IONBF (void);

+ 32 - 1
support/signal.c

@@ -54,6 +54,37 @@ Mono_Posix_Stdlib_InvokeSignalHandler (int signum, void *handler)
 	_h (signum);
 }
 
+int Mono_Posix_SIGRTMIN (void)
+{
+#ifdef SIGRTMIN
+	return SIGRTMIN;
+#else /* def SIGRTMIN */
+	return -1;
+#endif /* ndef SIGRTMIN */
+}
+
+int Mono_Posix_SIGRTMAX (void)
+{
+#ifdef SIGRTMAX
+	return SIGRTMAX;
+#else /* def SIGRTMAX */
+	return -1;
+#endif /* ndef SIGRTMAX */
+}
+
+int Mono_Posix_FromRealTimeSignum (int offset, int *r)
+{
+   *r = 0;
+#if defined (SIGRTMIN) && defined (SIGRTMAX)
+   if ((offset < 0) || (SIGRTMIN > SIGRTMAX - offset))
+	return -1;
+   *r = SIGRTMIN+offset;
+   return 0;
+#else
+   return -1;
+#endif
+}
+
 #ifndef PLATFORM_WIN32
 
 #ifdef WAPI_ATOMIC_ASM
@@ -109,7 +140,7 @@ Mono_Unix_UnixSignal_install (int sig)
 	int i, mr;
 	signal_info* h = NULL; 
 	int have_handler = 0;
-	void* handler;
+	void* handler = NULL;
 
 	mr = pthread_mutex_lock (&signals_mutex);
 	if (mr != 0) {