X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b8ba0bc2f48c6b9b96dfedd8fd383b941d5fdd0b..5fead7e79bf187e79ccae8055ae8fbf6c439bdad:/src/simix/smx_user.c diff --git a/src/simix/smx_user.c b/src/simix/smx_user.c index e26d97fe81..2663088b9d 100644 --- a/src/simix/smx_user.c +++ b/src/simix/smx_user.c @@ -17,6 +17,7 @@ #include "smx_private.h" #include "mc/mc.h" +#include "xbt/ex.h" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix); @@ -342,6 +343,7 @@ e_smx_state_t simcall_host_execution_wait(smx_action_t execution) * \param data a pointer to any data one may want to attach to the new object. It is for user-level information and can be NULL. * It can be retrieved with the function \ref simcall_process_get_data. * \param hostname name of the host where the new agent is executed. + * \param kill_time time when the process is killed * \param argc first argument passed to \a code * \param argv second argument passed to \a code * \param properties the properties of the process @@ -350,6 +352,7 @@ void simcall_process_create(smx_process_t *process, const char *name, xbt_main_func_t code, void *data, const char *hostname, + double kill_time, int argc, char **argv, xbt_dict_t properties) { @@ -361,6 +364,7 @@ void simcall_process_create(smx_process_t *process, const char *name, simcall->process_create.code = code; simcall->process_create.data = data; simcall->process_create.hostname = hostname; + simcall->process_create.kill_time = kill_time; simcall->process_create.argc = argc; simcall->process_create.argv = argv; simcall->process_create.properties = properties; @@ -1177,11 +1181,12 @@ 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) +size_t simcall_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, smx_file_t stream) { smx_simcall_t simcall = SIMIX_simcall_mine(); simcall->call = SIMCALL_FILE_READ; + simcall->file_read.storage = storage; simcall->file_read.ptr = ptr; simcall->file_read.size = size; simcall->file_read.nmemb = nmemb; @@ -1191,11 +1196,12 @@ size_t simcall_file_read(void* ptr, size_t size, size_t nmemb, smx_file_t* strea return simcall->file_read.result; } -size_t simcall_file_write(const void* ptr, size_t size, size_t nmemb, smx_file_t* stream) +size_t simcall_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, smx_file_t stream) { smx_simcall_t simcall = SIMIX_simcall_mine(); simcall->call = SIMCALL_FILE_WRITE; + simcall->file_write.storage = storage; simcall->file_write.ptr = ptr; simcall->file_write.size = size; simcall->file_write.nmemb = nmemb; @@ -1205,11 +1211,12 @@ size_t simcall_file_write(const void* ptr, size_t size, size_t nmemb, smx_file_t return simcall->file_write.result; } -smx_file_t* simcall_file_open(const char* path, const char* mode) +smx_file_t simcall_file_open(const char* storage, const char* path, const char* mode) { smx_simcall_t simcall = SIMIX_simcall_mine(); simcall->call = SIMCALL_FILE_OPEN; + simcall->file_open.storage = storage; simcall->file_open.path = path; simcall->file_open.mode = mode; SIMIX_simcall_push(simcall->issuer); @@ -1217,26 +1224,29 @@ smx_file_t* simcall_file_open(const char* path, const char* mode) return simcall->file_open.result; } -int simcall_file_close(smx_file_t* fp) +int simcall_file_close(const char* storage, smx_file_t fp) { smx_simcall_t simcall = SIMIX_simcall_mine(); simcall->call = SIMCALL_FILE_CLOSE; + simcall->file_close.storage = storage; simcall->file_close.fp = fp; SIMIX_simcall_push(simcall->issuer); return simcall->file_close.result; } -int simcall_file_stat(int fd, void* buf) +int simcall_file_stat(const char* storage, smx_file_t fd, s_file_stat_t *buf) { smx_simcall_t simcall = SIMIX_simcall_mine(); - simcall->call = SIMCALL_FILE_STAT; + simcall->file_stat.storage = storage; simcall->file_stat.fd = fd; - simcall->file_stat.buf = buf; + SIMIX_simcall_push(simcall->issuer); + *buf = simcall->file_stat.buf; + return simcall->file_stat.result; }