3 /* sg_dns - name resolution (simulator) */
5 /* Copyright (c) 2005 Martin Quinson. All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
11 #include "gras/Virtu/virtu_sg.h"
13 const char *gras_os_myname(void)
16 smx_process_t process = SIMIX_process_self();
18 /*HACK: maestro used not have a simix process, now it does so
19 SIMIX_process_self will return something different to NULL. This breaks
20 the old xbt_log logic that assumed that NULL was equivalent to maestro,
21 thus when printing it searches for maestro host name (which doesn't exists)
22 and breaks the logging.
23 As a hack we check for maestro by looking to the assigned host, if it is
24 NULL then we are sure is maestro
26 if (process != NULL && (host = SIMIX_host_self()) != NULL)
27 return SIMIX_host_get_name(host);