Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
new function gras_os_hostport, returning a constant form of gras_os_myname():gras_os_...
[simgrid.git] / src / gras / Virtu / process.c
index 8f2ab4d..8daf4b7 100644 (file)
@@ -167,3 +167,12 @@ gras_procdata_exit() {
   }
   xbt_dynar_free( & _gras_procdata_fabrics );
 }
+
+
+const char *gras_os_hostport() {
+   static char *res=NULL;
+   if (res)
+     free(res); /* my port may have changed */
+   res = bprintf("%s:%d",gras_os_myname(),gras_os_myport());
+   return (const char*)res;
+}