* map.h: Flush.
authorJonathan Pryor <jpryor@novell.com>
Fri, 19 Dec 2008 15:23:37 +0000 (15:23 -0000)
committerJonathan Pryor <jpryor@novell.com>
Fri, 19 Dec 2008 15:23:37 +0000 (15:23 -0000)
* signal.c: Add Mono_Posix_SIGRTMIN(), Mono_Posix_SIGRTMAX(),
  Mono_Posix_FromRealTimeSignum().
  Patch thanks to tim.jenks@realtimeworlds.com.

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

support/ChangeLog
support/map.h
support/signal.c

index 14e527531899f5d44e7703cf7ea1b8dc30818b67..e78587144f273352840644b4bdfa3f3b4dc409fa 100644 (file)
@@ -1,3 +1,10 @@
+2008-12-19  Jonathan Pryor  <jpryor@novell.com>
+
+       * map.h: Flush.
+       * signal.c: Add Mono_Posix_SIGRTMIN(), Mono_Posix_SIGRTMAX(),
+         Mono_Posix_FromRealTimeSignum().
+         Patch thanks to tim.jenks@realtimeworlds.com.
+
 2008-11-06  Alan McGovern  <amcgovern@novell.com>
 
        * Makefile.am: Missed out on a header file for minizip
index c913c60eb35d2d2e5d5138be2bb71e6b24acdead..fbc063d59bccac88eeb466ec4c8199dc1594447b 100644 (file)
@@ -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);
index 4ba92742af2d64dffdadf7e0449a92843dc81bb6..abf11038bb70a2a29d751e0669bc3f376a31c0bc 100644 (file)
@@ -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) {