X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/66e807f40a943c3e3f754ed836d6759cc4909ce2..77e63efea0d0c200b85f224c2faf9de94d98e83a:/src/simix/smx_user.c diff --git a/src/simix/smx_user.c b/src/simix/smx_user.c index 771268f0dd..c3074c01cb 100644 --- a/src/simix/smx_user.c +++ b/src/simix/smx_user.c @@ -534,7 +534,7 @@ void* simcall_process_get_data(smx_process_t process) * \ingroup simix_process_management * \brief Set the user data of a #smx_process_t. * - * This functions checks whether \a process is a valid pointer or not and set the user data associated to \a process if it is possible. + * This functions sets the user data associated to \a process. * \param process SIMIX process * \param data User data */ @@ -577,7 +577,8 @@ void simcall_process_set_kill_time(smx_process_t process, double kill_time) * \ingroup simix_process_management * \brief Return the location on which an agent is running. * - * This functions checks whether \a process is a valid pointer or not and return the m_host_t corresponding to the location on which \a process is running. + * This functions returns the smx_host_t corresponding to the location on which + * \a process is running. * \param process SIMIX process * \return SIMIX host */ @@ -652,7 +653,8 @@ xbt_dict_t simcall_process_get_properties(smx_process_t process) * \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) { +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; @@ -668,7 +670,8 @@ XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_t fu * Will restart the process when the host comes back up if auto_restart is set to 1. */ -XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_process_t process, int auto_restart) { +XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_process_t process, int auto_restart) +{ smx_simcall_t simcall = SIMIX_simcall_mine(); simcall->call = SIMCALL_PROCESS_AUTO_RESTART_SET; @@ -677,6 +680,21 @@ XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_process_t process, int aut SIMIX_simcall_push(simcall->issuer); } +/** + * \ingroup simix_process_management + * \brief Restarts the process, killing it and starting it again from scratch. + */ +XBT_PUBLIC(smx_process_t) simcall_process_restart(smx_process_t process) +{ + smx_simcall_t simcall = SIMIX_simcall_mine(); + + simcall->call = SIMCALL_PROCESS_RESTART; + simcall->process_restart.process = process; + + SIMIX_simcall_push(simcall->issuer); + + return simcall->process_restart.result; +} /** * \ingroup simix_process_management * \brief Creates a new sleep SIMIX action. @@ -1447,6 +1465,21 @@ int simcall_file_stat(smx_file_t fd, s_file_stat_t *buf) return simcall->file_stat.result; } +/** + * \ingroup simix_file_management + * + */ +int simcall_file_unlink(smx_file_t fd) +{ + smx_simcall_t simcall = SIMIX_simcall_mine(); + simcall->call = SIMCALL_FILE_UNLINK; + simcall->file_unlink.fd = fd; + + SIMIX_simcall_push(simcall->issuer); + + return simcall->file_unlink.result; +} + /* ************************************************************************** */ /** @brief returns a printable string representing a simcall */