From 33145f3a1e718d721f062d152cda9a98d1aab5b8 Mon Sep 17 00:00:00 2001 From: navarro Date: Tue, 31 Jan 2012 14:22:07 +0100 Subject: [PATCH] Make the commit on file read and write compile with all warning --- examples/msg/io/file.c | 4 ++-- src/simix/smx_smurf.c | 9 +++++++++ src/simix/smx_smurf_private.h | 12 ++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/examples/msg/io/file.c b/examples/msg/io/file.c index f5eca2a3e1..5c58289bbf 100644 --- a/examples/msg/io/file.c +++ b/examples/msg/io/file.c @@ -18,9 +18,9 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(file, int host(int argc, char *argv[]) { size_t read = simcall_file_read(NULL,0,0,NULL); - XBT_INFO("Host '%s' read",MSG_host_get_name(MSG_host_self()) ); + XBT_INFO("Host '%s' read %ld",MSG_host_get_name(MSG_host_self()),read); size_t write = simcall_file_write(NULL,0,0,NULL); - XBT_INFO("Host '%s' write",MSG_host_get_name(MSG_host_self()) ); + XBT_INFO("Host '%s' write %ld",MSG_host_get_name(MSG_host_self()), write); return 0; } diff --git a/src/simix/smx_smurf.c b/src/simix/smx_smurf.c index 86297496bf..06a084ed53 100644 --- a/src/simix/smx_smurf.c +++ b/src/simix/smx_smurf.c @@ -489,6 +489,15 @@ void SIMIX_simcall_pre(smx_simcall_t simcall, int value) SIMIX_pre_file_write(simcall); break; + case SIMCALL_FILE_OPEN: + break; + + case SIMCALL_FILE_CLOSE: + break; + + case SIMCALL_FILE_STAT: + break; + case SIMCALL_NONE: THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s", SIMIX_process_get_name(simcall->issuer), diff --git a/src/simix/smx_smurf_private.h b/src/simix/smx_smurf_private.h index da45db68e9..4135e30c7c 100644 --- a/src/simix/smx_smurf_private.h +++ b/src/simix/smx_smurf_private.h @@ -522,6 +522,18 @@ typedef struct s_smx_simcall { smx_file_t* stream; size_t result; } file_write; + + struct { + const char* path; + const char* mode; + smx_file_t* result; + } file_open; + + struct { + smx_file_t* fp; + int result; + } file_close; + }; } s_smx_simcall_t, *smx_simcall_t; -- 2.20.1