git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1187
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
const char *
gras_os_myname(void);
+/** @brief get process identification
+ *
+ * Returns the process ID of the current process. (This is often used
+ by routines that generate unique temporary file names.)
+ */
+int gras_process_getpid(void);
+
/** @} */
END_DECL()
#include "gras_modinter.h" /* module initialization interface */
#include "gras/Virtu/virtu_rl.h"
+#include "portable.h"
XBT_LOG_EXTERNAL_CATEGORY(process);
XBT_LOG_DEFAULT_CATEGORY(process);
else return "(null)";
}
+int gras_process_getpid(void) {
+ return getpid();
+}
+
/* **************************************************************************
* Process data
* **************************************************************************/
else
return "";
}
+
+int gras_process_getpid(void) {
+ m_process_t process = MSG_process_self();
+ if ((process != NULL) && (process->simdata))
+ return MSG_process_get_PID(MSG_process_self());
+ else
+ return 0;
+}