Make sure that a prototype is included for 'setIOManagerControlFd'
[ghc.git] / rts / Capability.c
index 29c5270..14c99d0 100644 (file)
@@ -26,6 +26,7 @@
 #include "sm/GC.h" // for gcWorkerThread()
 #include "STM.h"
 #include "RtsUtils.h"
+#include "rts/IOManager.h"
 
 #include <string.h>
 
@@ -255,6 +256,7 @@ initCapability( Capability *cap, nat i )
     cap->spark_stats.converted  = 0;
     cap->spark_stats.gcd        = 0;
     cap->spark_stats.fizzled    = 0;
+    cap->io_manager_control_wr_fd = -1;
 #endif
     cap->total_allocated        = 0;
 
@@ -1076,6 +1078,16 @@ rtsBool checkSparkCountInvariant (void)
 }
 #endif
 
+void setIOManagerControlFd(nat cap_no USED_IF_THREADS, int fd USED_IF_THREADS) {
+#if defined(THREADED_RTS)
+    if (cap_no < n_capabilities) {
+        capabilities[cap_no]->io_manager_control_wr_fd = fd;
+    } else {
+        errorBelch("warning: setIOManagerControlFd called with illegal capability number.");
+    }
+#endif
+}
+
 // Local Variables:
 // mode: C
 // fill-column: 80