mirror of
https://github.com/aristocratos/btop.git
synced 2024-06-16 01:15:09 +12:00
Add NetBSD Support.
This commit is contained in:
parent
dd4ada7023
commit
57c4115282
6
Makefile
6
Makefile
|
@ -146,6 +146,12 @@ else ifeq ($(PLATFORM_LC),openbsd)
|
||||||
override ADDFLAGS += -lkvm -static-libstdc++
|
override ADDFLAGS += -lkvm -static-libstdc++
|
||||||
export MAKE = gmake
|
export MAKE = gmake
|
||||||
SU_GROUP := wheel
|
SU_GROUP := wheel
|
||||||
|
else ifeq ($(PLATFORM_LC),netbsd)
|
||||||
|
PLATFORM_DIR := netbsd
|
||||||
|
THREADS := $(shell sysctl -n hw.ncpu || echo 1)
|
||||||
|
override ADDFLAGS += -lkvm
|
||||||
|
export MAKE = gmake
|
||||||
|
SU_GROUP := wheel
|
||||||
else
|
else
|
||||||
$(error $(shell printf "\033[1;91mERROR: \033[97mUnsupported platform ($(PLATFORM))\033[0m"))
|
$(error $(shell printf "\033[1;91mERROR: \033[97mUnsupported platform ($(PLATFORM))\033[0m"))
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -293,7 +293,7 @@ void clean_quit(int sig) {
|
||||||
Global::quitting = true;
|
Global::quitting = true;
|
||||||
Runner::stop();
|
Runner::stop();
|
||||||
if (Global::_runner_started) {
|
if (Global::_runner_started) {
|
||||||
#if defined __APPLE__ || defined __OpenBSD__
|
#if defined __APPLE__ || defined __OpenBSD__ || defined __NetBSD__
|
||||||
if (pthread_join(Runner::runner_id, nullptr) != 0) {
|
if (pthread_join(Runner::runner_id, nullptr) != 0) {
|
||||||
Logger::warning("Failed to join _runner thread on exit!");
|
Logger::warning("Failed to join _runner thread on exit!");
|
||||||
pthread_cancel(Runner::runner_id);
|
pthread_cancel(Runner::runner_id);
|
||||||
|
@ -329,7 +329,7 @@ void clean_quit(int sig) {
|
||||||
|
|
||||||
const auto excode = (sig != -1 ? sig : 0);
|
const auto excode = (sig != -1 ? sig : 0);
|
||||||
|
|
||||||
#if defined __APPLE__ || defined __OpenBSD__
|
#if defined __APPLE__ || defined __OpenBSD__ || defined __NetBSD__
|
||||||
_Exit(excode);
|
_Exit(excode);
|
||||||
#else
|
#else
|
||||||
quick_exit(excode);
|
quick_exit(excode);
|
||||||
|
@ -1024,7 +1024,7 @@ int main(int argc, char **argv) {
|
||||||
Config::set("tty_mode", true);
|
Config::set("tty_mode", true);
|
||||||
Logger::info("Forcing tty mode: setting 16 color mode and using tty friendly graph symbols");
|
Logger::info("Forcing tty mode: setting 16 color mode and using tty friendly graph symbols");
|
||||||
}
|
}
|
||||||
#if not defined __APPLE__ && not defined __OpenBSD__
|
#if not defined __APPLE__ && not defined __OpenBSD__ && not defined __NetBSD__
|
||||||
else if (not Global::arg_tty and Term::current_tty.starts_with("/dev/tty")) {
|
else if (not Global::arg_tty and Term::current_tty.starts_with("/dev/tty")) {
|
||||||
Config::set("tty_mode", true);
|
Config::set("tty_mode", true);
|
||||||
Logger::info("Real tty detected: setting 16 color mode and using tty friendly graph symbols");
|
Logger::info("Real tty detected: setting 16 color mode and using tty friendly graph symbols");
|
||||||
|
|
1284
src/netbsd/btop_collect.cpp
Normal file
1284
src/netbsd/btop_collect.cpp
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue