initial OpenBSD support

This commit is contained in:
Sébastien Marie
2022-02-25 08:49:25 +00:00
parent 3a469dc13e
commit 5676c9e7eb
30 changed files with 1151 additions and 27 deletions

View File

@@ -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();
}
}