aboutsummaryrefslogtreecommitdiff
path: root/src/bug_report.cpp
diff options
context:
space:
mode:
authorSébastien Marie <semarie@online.fr>2022-02-25 08:49:25 +0000
committerSébastien Marie <semarie@online.fr>2022-02-25 08:49:25 +0000
commit5676c9e7ebcec9af526c59ece1faf2e8b15e457c (patch)
treee55736f4c0d291caac7c90d6184baf7cdadf1fcd /src/bug_report.cpp
parent3a469dc13ec27fc77a408d823d501c7ad1da1811 (diff)
initial OpenBSD support
Diffstat (limited to 'src/bug_report.cpp')
-rw-r--r--src/bug_report.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bug_report.cpp b/src/bug_report.cpp
index 4dd251f24..7f6b668e8 100644
--- a/src/bug_report.cpp
+++ b/src/bug_report.cpp
@@ -17,6 +17,10 @@
#include <sys/sysctl.h>
#endif
+#if defined(GB_SYSTEM_OPENBSD)
+ #include <sys/utsname.h>
+#endif
+
/*
NOTE(Jeroen): This prints the Windows product edition only, to be called from `print_platform_details`.
*/
@@ -643,6 +647,14 @@ void print_bug_report_help() {
} else {
gb_printf("macOS: Unknown\n");
}
+ #elif defined(GB_SYSTEM_OPENBSD)
+ struct utsname un;
+
+ if (uname(&un) != -1) {
+ gb_printf("%s %s %s %s\n", un.sysname, un.release, un.version, un.machine);
+ } else {
+ gb_printf("OpenBSD: Unknown\n");
+ }
#else
gb_printf("Unknown\n");
@@ -657,4 +669,4 @@ void print_bug_report_help() {
And RAM info.
*/
report_ram_info();
-} \ No newline at end of file
+}