Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Avoid segfault or infinite loop when calling this function from somewhere else than...
[simgrid.git] / src / gras / Virtu / sg_process.c
index 838a74c..0c51c0e 100644 (file)
@@ -124,3 +124,13 @@ gras_procdata_t *gras_procdata_get(void) {
   return pd;
 }
 
+const char* xbt_procname(void) {
+  const char *res = NULL;
+  m_process_t process = MSG_process_self();
+  if ((process != NULL) && (process->simdata))
+    res = MSG_process_get_name(process);
+  if (res) 
+    return res;
+  else
+    return "";
+}