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);
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);
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);
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);
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;
MSG_process_kill(MSG_process_from_PID(pid));
task = NULL;
}
+ return 0;
}
/** Main function */