Added host info for freebsd, fixed 104

This commit is contained in:
TheDarkBug 2021-07-24 15:37:16 +02:00
parent 8a576e5e02
commit 9d6f99d2e9

View file

@ -405,6 +405,12 @@ void get_info()
#endif #endif
FILE *host_model_info = fopen("/sys/devices/virtual/dmi/id/board_name", "r"); FILE *host_model_info = fopen("/sys/devices/virtual/dmi/id/board_name", "r");
if (!host_model_info) host_model_info = fopen("/sys/devices/virtual/dmi/id/product_name", "r"); if (!host_model_info) host_model_info = fopen("/sys/devices/virtual/dmi/id/product_name", "r");
#ifdef __FREEBSD__
host_model_info = popen("sysctl -a hw.hv_vendor", "r");
while (fgets(line, sizeof(line), host_model_info))
if (sscanf(line, "hw.hv_vendor: %[^\n]", host_model))
break;
#endif
FILE *host_model_version = fopen("/sys/devices/virtual/dmi/id/product_version", "r"); FILE *host_model_version = fopen("/sys/devices/virtual/dmi/id/product_version", "r");
#ifdef __CYGWIN__ #ifdef __CYGWIN__
iscygwin = 1; iscygwin = 1;