SWDEV-387026: using gethostid instead of depending on libsystemd

Change-Id: If576eec4abee1a52dfe7cc5bce507420bc8a4d07


[ROCm/rocprofiler commit: 05f2ef97f9]
Esse commit está contido em:
Ammar ELWazir
2023-03-06 22:15:09 +00:00
commit 7c5f07977c
10 arquivos alterados com 34 adições e 61 exclusões
+1 -9
Ver Arquivo
@@ -9,7 +9,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <systemd/sd-id128.h>
#include <cstdint>
#include <cstdio>
@@ -61,14 +60,7 @@ __global__ void kernelF() { printf("\nKernel F\n"); }
}
[[maybe_unused]] uint64_t GetMachineID() {
char hostname[1023] = "\0";
gethostname(hostname, 1023);
sd_id128_t ret;
char machine_id[SD_ID128_STRING_MAX];
[[maybe_unused]] int status = sd_id128_get_machine(&ret);
assert(status == 0 && "Error: Couldn't get machine id!");
if (sd_id128_to_string(ret, machine_id)) return std::hash<std::string>{}(machine_id);
return std::rand();
return gethostid();
}
std::ofstream output_file;