From 6c32f9e5213e38339b4750c8fe4f493a39799561 Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Sat, 13 Feb 2021 11:45:28 -0300 Subject: [PATCH] base: Remove hostname from hostinfo This function is not used anywhere. In addition, gethostname uses a fixed host name, and sethostname is not implemented (sim/syscall_emul). If we were to handle sethostname too it would require a special conjoint implementation anyway. Change-Id: I20919a49b123a6a49582d9cfacf1fd167cb44776 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41394 Reviewed-by: Bobby R. Bruce Maintainer: Bobby R. Bruce Tested-by: kokoro --- src/base/hostinfo.cc | 18 ------------------ src/base/hostinfo.hh | 8 -------- 2 files changed, 26 deletions(-) diff --git a/src/base/hostinfo.cc b/src/base/hostinfo.cc index 577ab01838..0e11f3fdff 100644 --- a/src/base/hostinfo.cc +++ b/src/base/hostinfo.cc @@ -28,8 +28,6 @@ #include "base/hostinfo.hh" -#include - #ifdef __APPLE__ #include #include @@ -41,22 +39,6 @@ #include "base/logging.hh" #include "base/str.hh" -std::string -__get_hostname() -{ - char host[256]; - if (gethostname(host, sizeof host) == -1) - warn("could not get host name!"); - return host; -} - -std::string & -hostname() -{ - static std::string hostname = __get_hostname(); - return hostname; -} - #ifndef __APPLE__ uint64_t procInfo(const char *filename, const char *target) diff --git a/src/base/hostinfo.hh b/src/base/hostinfo.hh index 3efb6f4d02..d8a8910ed8 100644 --- a/src/base/hostinfo.hh +++ b/src/base/hostinfo.hh @@ -30,14 +30,6 @@ #define __HOSTINFO_HH__ #include -#include - -/** - * Get the host name for the current machine. - * - * @return The machine's host name. - */ -std::string &hostname(); /** * Determine the simulator process' total virtual memory usage.