+
+void MC_simcall_handle(smx_simcall_t req, int value)
+{
+ if (MC_process_is_self(&mc_model_checker->process)) {
+ SIMIX_simcall_handle(req, value);
+ return;
+ }
+
+ MC_process_smx_refresh(&mc_model_checker->process);
+
+ unsigned i;
+ mc_smx_process_info_t pi = NULL;
+
+ xbt_dynar_foreach_ptr(mc_model_checker->process.smx_process_infos, i, pi) {
+ smx_process_t p = (smx_process_t) pi->address;
+ if (req == &pi->copy.simcall) {
+ smx_simcall_t real_req = &p->simcall;
+ // TODO, use a remote call
+ SIMIX_simcall_handle(real_req, value);
+ return;
+ }
+ }
+
+ // Check (remove afterwards):
+ xbt_dynar_foreach_ptr(mc_model_checker->process.smx_process_infos, i, pi) {
+ smx_process_t p = (smx_process_t) pi->address;
+ if (req == &p->simcall)
+ xbt_die("The real simcall was passed. We expected the local copy.");
+ }
+
+ xbt_die("Could not find the request");
+}