mirror of
https://github.com/pavel-odintsov/fastnetmon
synced 2024-11-23 21:43:14 +01:00
We need different approach for detect windows version
This commit is contained in:
parent
4bb582f2e9
commit
c559487718
@ -7,8 +7,10 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
// For uname function
|
// For uname function
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "all_logcpp_libraries.hpp"
|
#include "all_logcpp_libraries.hpp"
|
||||||
|
|
||||||
@ -2221,6 +2223,12 @@ std::string get_virtualisation_method() {
|
|||||||
return boost::algorithm::to_lower_copy(output[0]);
|
return boost::algorithm::to_lower_copy(output[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
bool get_kernel_version(std::string& kernel_version) {
|
||||||
|
kernel_version = "windows";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#else
|
||||||
// Get linux kernel version in form: 3.19.0-25-generic
|
// Get linux kernel version in form: 3.19.0-25-generic
|
||||||
bool get_kernel_version(std::string& kernel_version) {
|
bool get_kernel_version(std::string& kernel_version) {
|
||||||
struct utsname current_utsname;
|
struct utsname current_utsname;
|
||||||
@ -2236,6 +2244,7 @@ bool get_kernel_version(std::string& kernel_version) {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Returns all CPU flags in vector
|
// Returns all CPU flags in vector
|
||||||
bool get_cpu_flags(std::vector<std::string>& flags) {
|
bool get_cpu_flags(std::vector<std::string>& flags) {
|
||||||
|
Loading…
Reference in New Issue
Block a user