From 87bc879019fc94e7ff1bc1ada77ecf85b0b588af Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20B=C3=A9daride?= Date: Wed, 30 Jan 2013 18:08:03 +0100 Subject: [PATCH] Fix missing proto for PID functions --- include/simgrid/simix.h | 2 ++ src/simix/smx_process_private.h | 2 ++ teshsuite/msg/pid.c | 13 ++++++++----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index c53fd4e43e..b22e1e8c3c 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -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); diff --git a/src/simix/smx_process_private.h b/src/simix/smx_process_private.h index de9b038c6a..53614eefd0 100644 --- a/src/simix/smx_process_private.h +++ b/src/simix/smx_process_private.h @@ -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); diff --git a/teshsuite/msg/pid.c b/teshsuite/msg/pid.c index 1f04fb2a54..ef21c7858b 100644 --- a/teshsuite/msg/pid.c +++ b/teshsuite/msg/pid.c @@ -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 */ -- 2.20.1