From 18d865e6985d7a5903eac874c8942b7001310625 Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 29 Mar 2005 22:24:16 +0000 Subject: [PATCH] Implement a gras_os_myname. KISS and don't try a DNS resolver tonight. ie, don't give a sensible result in RL git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1184 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/Makefile.am | 6 ++++-- src/gras/Virtu/rl_dns.c | 24 ++++++++++++++++++++++++ src/gras/Virtu/sg_dns.c | 15 +++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 src/gras/Virtu/rl_dns.c create mode 100644 src/gras/Virtu/sg_dns.c diff --git a/src/Makefile.am b/src/Makefile.am index 6662a0f235..894a83def5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -127,7 +127,8 @@ RL_SRC= \ gras/Transport/rl_transport.c gras/Transport/transport_plugin_tcp.c gras/Transport/transport_plugin_file.c \ \ gras/Virtu/rl_chrono.c \ - gras/Virtu/rl_process.c gras/Virtu/rl_time.c gras/Virtu/rl_conditional.c + gras/Virtu/rl_process.c gras/Virtu/rl_time.c gras/Virtu/rl_conditional.c \ + gras/Virtu/rl_dns.c SG_SRC= \ xbt/context.c \ @@ -147,7 +148,8 @@ SG_SRC= \ gras/Transport/sg_transport.c gras/Transport/transport_plugin_sg.c \ \ gras/Virtu/sg_chrono.c \ - gras/Virtu/sg_process.c gras/Virtu/sg_time.c gras/Virtu/sg_conditional.c + gras/Virtu/sg_process.c gras/Virtu/sg_time.c gras/Virtu/sg_conditional.c \ + gras/Virtu/sg_dns.c gras/DataDesc/ddt_parse.yy.c: gras/DataDesc/ddt_parse.yy.l @LEX@ -o$@ -Pgras_ddt_parse_ $^ diff --git a/src/gras/Virtu/rl_dns.c b/src/gras/Virtu/rl_dns.c new file mode 100644 index 0000000000..75dd9b671b --- /dev/null +++ b/src/gras/Virtu/rl_dns.c @@ -0,0 +1,24 @@ +/* $Id$ */ + +/* rl_dns - name resolution (real life) */ + +/* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + +#include "gras/Virtu/virtu_rl.h" + +/* A portable DNS resolver is a nightmare to do in a portable manner */ + +/* the ADNS library is a good candidate for inclusion in the source tree, but + * it would be a bit too much. We need a stripped down version of it, and it's + * a bit too late for this tonight. + * + * Next time maybe ;) + */ +const char *gras_os_myname(void) { + + return "(unknown host)"; +} + diff --git a/src/gras/Virtu/sg_dns.c b/src/gras/Virtu/sg_dns.c new file mode 100644 index 0000000000..1d67ee49ae --- /dev/null +++ b/src/gras/Virtu/sg_dns.c @@ -0,0 +1,15 @@ +/* $Id$ */ + +/* sg_dns - name resolution (simulator) */ + +/* Copyright (c) 2005 Martin Quinson. All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + + +#include "gras/Virtu/virtu_sg.h" + +const char *gras_os_myname(void) { + return MSG_host_get_name(MSG_host_self()); +} -- 2.20.1