Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Testing the value is useless here...
[simgrid.git] / src / simix / smx_user.c
index 0987155..803a6e6 100644 (file)
@@ -609,7 +609,20 @@ xbt_dict_t simcall_process_get_properties(smx_process_t process)
   SIMIX_simcall_push(simcall->issuer);
   return simcall->process_get_properties.result;
 }
+/** \ingroup m_process_management
+ * \brief Add an on_exit function
+ * Add an on_exit function which will be executed when the process exits/is killed.
+ */
+XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void *data) {
+  smx_simcall_t simcall = SIMIX_simcall_mine();
 
+  simcall->call = SIMCALL_PROCESS_ON_EXIT;
+  simcall->process_on_exit.process = process;
+  simcall->process_on_exit.fun = fun;
+  simcall->process_on_exit.data = data;
+
+  SIMIX_simcall_push(simcall->issuer);
+}
 /** \brief Creates a new sleep SIMIX action.
  *
  * This function creates a SURF action and allocates the data necessary
@@ -1006,7 +1019,7 @@ int simcall_comm_is_latency_bounded(smx_action_t comm)
 smx_mutex_t simcall_mutex_init(void)
 {
   if(!simix_global) {
-    fprintf(stderr,"You must run MSG_global_init or gras_init before using MSG or GRAS\n"); // I would have loved using xbt_die but I can't since it is not initialized yet... :)
+    fprintf(stderr,"You must run MSG_init or gras_init before using MSG or GRAS\n"); // I would have loved using xbt_die but I can't since it is not initialized yet... :)
     abort();
   }
   smx_simcall_t simcall = SIMIX_simcall_mine();
@@ -1203,7 +1216,7 @@ int simcall_sem_get_capacity(smx_sem_t sem)
   return simcall->sem_get_capacity.result;
 }
 
-size_t simcall_file_read(void* ptr, size_t size, size_t nmemb, smx_file_t stream)
+double simcall_file_read(void* ptr, size_t size, size_t nmemb, smx_file_t stream)
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();