mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-20 00:51:32 -08:00
14 lines
228 B
C++
14 lines
228 B
C++
#include "hostname.h"
|
|
#include <string>
|
|
#include <unistd.h>
|
|
#include <limits.h>
|
|
|
|
std::string hostname()
|
|
{
|
|
char buf[HOST_NAME_MAX];
|
|
int code = gethostname(buf, HOST_NAME_MAX);
|
|
if (code == 0)
|
|
return buf;
|
|
return "unknown";
|
|
}
|