blob: 059b33942a7ddbd1860a7358c4273c81534cea93 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
--- src/sysinfo.cpp.orig Mon Jan 22 12:01:12 2007
+++ src/sysinfo.cpp Sun Jan 28 21:10:13 2007
@@ -13,6 +13,9 @@
#include <sys/socket.h>
#include <sys/wait.h>
#include <math.h>
+#ifdef __FreeBSD__
+#include <sys/utsname.h>
+#endif
#include <string>
#include <vector>
@@ -195,6 +198,29 @@ namespace {
}
};
+#ifdef __FreeBSD__
+ class UnameSysInfo
+ : public SysInfo
+ {
+ public:
+ UnameSysInfo()
+ {
+ this->load_uname_info();
+ }
+
+ private:
+
+ void load_uname_info()
+ {
+ struct utsname name;
+
+ uname(&name);
+
+ this->distro_name = name.sysname;
+ this->distro_release = name.release;
+ }
+ };
+#endif
SysInfo* get_sysinfo()
{
@@ -202,8 +228,11 @@ namespace {
g_free(p);
return new LSBSysInfo;
}
-
+#ifdef __FreeBSD__
+ return new UnameSysInfo;
+#else
return new SysInfo(_("Unknown distribution"));
+#endif
}
}
|