From 68d2e2165a1b9166b5e16ffc117921cb2cd1f5fc Mon Sep 17 00:00:00 2001 From: mquinson Date: Mon, 2 Jul 2007 14:51:04 +0000 Subject: [PATCH] Revert the convertion of MSG pids from int to long int: linux ones are int only, I'll change GRAS ones to match reality instead git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3642 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/msg/msg.h | 16 ++++++++-------- src/msg/global.c | 2 +- src/msg/gos.c | 4 ++-- src/msg/m_process.c | 12 ++++++------ src/msg/private.h | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/msg/msg.h b/include/msg/msg.h index 2d7db1e0be..e593310bdd 100644 --- a/include/msg/msg.h +++ b/include/msg/msg.h @@ -53,19 +53,19 @@ XBT_PUBLIC(m_process_t) MSG_process_create_with_arguments(const char *name, m_process_code_t code, void *data, m_host_t host, int argc, char **argv); XBT_PUBLIC(void) MSG_process_kill(m_process_t process); -XBT_PUBLIC(int) MSG_process_killall(long int reset_PIDs); +XBT_PUBLIC(int) MSG_process_killall(int reset_PIDs); XBT_PUBLIC(MSG_error_t) MSG_process_change_host(m_process_t process, m_host_t host); XBT_PUBLIC(void*) MSG_process_get_data(m_process_t process); XBT_PUBLIC(MSG_error_t) MSG_process_set_data(m_process_t process, void *data); XBT_PUBLIC(m_host_t) MSG_process_get_host(m_process_t process); -XBT_PUBLIC(m_process_t) MSG_process_from_PID(long int PID); -XBT_PUBLIC(long int) MSG_process_get_PID(m_process_t process); -XBT_PUBLIC(long int) MSG_process_get_PPID(m_process_t process); +XBT_PUBLIC(m_process_t) MSG_process_from_PID(int PID); +XBT_PUBLIC(int) MSG_process_get_PID(m_process_t process); +XBT_PUBLIC(int) MSG_process_get_PPID(m_process_t process); XBT_PUBLIC(const char *)MSG_process_get_name(m_process_t process); -XBT_PUBLIC(long int) MSG_process_self_PID(void); -XBT_PUBLIC(long int) MSG_process_self_PPID(void); +XBT_PUBLIC(int) MSG_process_self_PID(void); +XBT_PUBLIC(int) MSG_process_self_PPID(void); XBT_PUBLIC(m_process_t) MSG_process_self(void); XBT_PUBLIC(MSG_error_t) MSG_process_suspend(m_process_t process); @@ -106,10 +106,10 @@ XBT_PUBLIC(MSG_error_t) MSG_parallel_task_execute(m_task_t task); XBT_PUBLIC(void) MSG_task_set_priority(m_task_t task, double priority); XBT_PUBLIC(int) MSG_task_Iprobe(m_channel_t channel); -XBT_PUBLIC(long int) MSG_task_probe_from(m_channel_t channel); +XBT_PUBLIC(int) MSG_task_probe_from(m_channel_t channel); XBT_PUBLIC(int) MSG_task_probe_from_host(int channel, m_host_t host); XBT_PUBLIC(MSG_error_t) MSG_channel_select_from(m_channel_t channel, double max_duration, - long int *PID); + int *PID); XBT_PUBLIC(MSG_error_t) MSG_process_sleep(double nb_sec); XBT_PUBLIC(MSG_error_t) MSG_get_errno(void); diff --git a/src/msg/global.c b/src/msg/global.c index 6371a1874f..a09b97c6a7 100644 --- a/src/msg/global.c +++ b/src/msg/global.c @@ -181,7 +181,7 @@ MSG_error_t MSG_main(void) * number means no reset and a positive number will be used to set the PID * of the next newly created process. */ -int MSG_process_killall(long int reset_PIDs) +int MSG_process_killall(int reset_PIDs) { m_process_t p = NULL; m_process_t self = MSG_process_self(); diff --git a/src/msg/gos.c b/src/msg/gos.c index 1102b884bd..fcd53b233c 100644 --- a/src/msg/gos.c +++ b/src/msg/gos.c @@ -247,7 +247,7 @@ int MSG_task_Iprobe(m_channel_t channel) number of channels fixed with MSG_set_channel_number(). * \return -1 if there is no pending communication and the PID of the process who sent it otherwise */ -long int MSG_task_probe_from(m_channel_t channel) +int MSG_task_probe_from(m_channel_t channel) { m_host_t h = NULL; xbt_fifo_item_t item; @@ -284,7 +284,7 @@ long int MSG_task_probe_from(m_channel_t channel) and #MSG_OK otherwise. */ MSG_error_t MSG_channel_select_from(m_channel_t channel, double max_duration, - long int *PID) + int *PID) { m_host_t h = NULL; simdata_host_t h_simdata = NULL; diff --git a/src/msg/m_process.c b/src/msg/m_process.c index 6e025d3c7c..f318b223f0 100644 --- a/src/msg/m_process.c +++ b/src/msg/m_process.c @@ -134,7 +134,7 @@ void MSG_process_kill(m_process_t process) { simdata_process_t p_simdata = process->simdata; - DEBUG3("Killing %s(%ld) on %s",process->name, p_simdata->PID, p_simdata->host->name); + DEBUG3("Killing %s(%d) on %s",process->name, p_simdata->PID, p_simdata->host->name); if(p_simdata->waiting_task) { DEBUG1("Canceling waiting task %s",p_simdata->waiting_task->name); @@ -215,7 +215,7 @@ m_host_t MSG_process_get_host(m_process_t process) whose PID is equal to \a PID. If no host is found, \c NULL is returned. Note that the PID are uniq in the whole simulation, not only on a given host. */ -m_process_t MSG_process_from_PID(long int PID) +m_process_t MSG_process_from_PID(int PID) { xbt_fifo_item_t i = NULL; m_process_t process = NULL; @@ -232,7 +232,7 @@ m_process_t MSG_process_from_PID(long int PID) * This functions checks whether \a process is a valid pointer or not and return its PID. */ -long int MSG_process_get_PID(m_process_t process) +int MSG_process_get_PID(m_process_t process) { xbt_assert0(((process != NULL) && (process->simdata)), "Invalid parameters"); @@ -246,7 +246,7 @@ long int MSG_process_get_PID(m_process_t process) and return its PID. Returns -1 if the agent has not been created by another agent. */ -long int MSG_process_get_PPID(m_process_t process) +int MSG_process_get_PPID(m_process_t process) { xbt_assert0(((process != NULL) && (process->simdata)), "Invalid parameters"); @@ -271,7 +271,7 @@ const char *MSG_process_get_name(m_process_t process) * * This functions returns the PID of the currently running #m_process_t. */ -long int MSG_process_self_PID(void) +int MSG_process_self_PID(void) { return (MSG_process_get_PID(MSG_process_self())); } @@ -282,7 +282,7 @@ long int MSG_process_self_PID(void) * This functions returns the PID of the parent of the currently * running #m_process_t. */ -long int MSG_process_self_PPID(void) +int MSG_process_self_PPID(void) { return (MSG_process_get_PPID(MSG_process_self())); } diff --git a/src/msg/private.h b/src/msg/private.h index 2184dbe667..e78420d889 100644 --- a/src/msg/private.h +++ b/src/msg/private.h @@ -57,8 +57,8 @@ typedef struct simdata_task { typedef struct simdata_process { m_host_t host; /* the host on which the process is running */ smx_process_t smx_process; - long int PID; /* used for debugging purposes */ - long int PPID; /* The parent PID */ + int PID; /* used for debugging purposes */ + int PPID; /* The parent PID */ m_host_t put_host; /* used for debugging purposes */ m_channel_t put_channel; /* used for debugging purposes */ m_task_t waiting_task; -- 2.20.1