Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix missing proto for PID functions
authorPaul Bédaride <paul.bedaride@gmail.com>
Wed, 30 Jan 2013 17:08:03 +0000 (18:08 +0100)
committerPaul Bédaride <paul.bedaride@gmail.com>
Wed, 30 Jan 2013 17:08:03 +0000 (18:08 +0100)
include/simgrid/simix.h
src/simix/smx_process_private.h
teshsuite/msg/pid.c

index c53fd4e..b22e1e8 100644 (file)
@@ -357,6 +357,8 @@ XBT_PUBLIC(void *) simcall_process_get_data(smx_process_t process);
 XBT_PUBLIC(void) simcall_process_set_data(smx_process_t process, void *data);
 XBT_PUBLIC(smx_host_t) simcall_process_get_host(smx_process_t process);
 XBT_PUBLIC(const char *) simcall_process_get_name(smx_process_t process);
+int simcall_process_get_PID(smx_process_t process);
+int simcall_process_get_PPID(smx_process_t process);
 XBT_PUBLIC(int) simcall_process_is_suspended(smx_process_t process);
 XBT_PUBLIC(xbt_dict_t) simcall_process_get_properties(smx_process_t host);
 XBT_PUBLIC(void) simcall_process_set_kill_time(smx_process_t process, double kill_time);
index de9b038..53614ee 100644 (file)
@@ -90,6 +90,7 @@ void SIMIX_pre_process_suspend(smx_simcall_t simcall, smx_process_t process);
 smx_action_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer);
 void SIMIX_process_resume(smx_process_t process, smx_process_t issuer);
 int SIMIX_process_get_PID(smx_process_t self);
+int SIMIX_process_get_PPID(smx_process_t self);
 void* SIMIX_process_get_data(smx_process_t process);
 void SIMIX_process_set_data(smx_process_t process, void *data);
 smx_host_t SIMIX_process_get_host(smx_process_t process);
@@ -119,6 +120,7 @@ void SIMIX_pre_process_resume(smx_simcall_t simcall, smx_process_t process);
 int SIMIX_pre_process_count(smx_simcall_t simcall);
 void* SIMIX_pre_process_self_get_data(smx_simcall_t simcall, smx_process_t process);
 int SIMIX_pre_process_get_PID(smx_simcall_t simcall, smx_process_t self);
+int SIMIX_pre_process_get_PPID(smx_simcall_t simcall, smx_process_t self);
 void* SIMIX_pre_process_get_data(smx_simcall_t simcall, smx_process_t process);
 void SIMIX_pre_process_set_data(smx_simcall_t simcall, smx_process_t process,
                                 void *data);
index 1f04fb2..ef21c78 100644 (file)
@@ -9,15 +9,16 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
                              "Messages specific for this msg example");
-char* mailbox = "mailbox";
+const char* mailbox = "mailbox";
 #define task_comp_size 1000
 #define task_comm_size 100000
 
-int onexit(void* data){
-  XBT_INFO("Process \"%d\" killed.", *((int*)data));  
+static int onexit(void* data){
+  XBT_INFO("Process \"%d\" killed.", *((int*)data));
+  return 0;
 }
 
-int sendpid(int argc, char *argv[])
+static int sendpid(int argc, char *argv[])
 {
   int pid = MSG_process_self_PID();
   MSG_process_on_exit(onexit, &pid);  
@@ -26,9 +27,10 @@ int sendpid(int argc, char *argv[])
   MSG_task_send(task, mailbox);
   XBT_INFO("Send of pid \"%d\" done.", pid);
   MSG_process_suspend(MSG_process_self());
+  return 0;
 }
 
-int killall(int argc, char *argv[]){
+static int killall(int argc, char *argv[]){
   msg_task_t task = NULL;
   _XBT_GNUC_UNUSED int res;
   int i;
@@ -39,6 +41,7 @@ int killall(int argc, char *argv[]){
     MSG_process_kill(MSG_process_from_PID(pid));
     task = NULL;
   }
+  return 0;
 }
 
 /** Main function */