ui: OS specific checks.

OpenBSD does not support listing kernel threads.
This commit is contained in:
Alastair Poole 2021-01-22 09:46:55 +00:00
parent 74dc726e98
commit 5dc1ebce0e
2 changed files with 23 additions and 10 deletions

View File

@ -471,6 +471,8 @@ evisum_ui_main_menu_create(Ui *ui, Evas_Object *parent, Evas_Object *obj)
evas_object_show(sep);
elm_box_pack_end(bx2, sep);
if (ui->proc.has_kthreads)
{
chk = elm_check_add(bx2);
evas_object_size_hint_weight_set(chk, EXPAND, EXPAND);
evas_object_size_hint_align_set(chk, FILL, FILL);
@ -480,6 +482,7 @@ evisum_ui_main_menu_create(Ui *ui, Evas_Object *parent, Evas_Object *obj)
evas_object_smart_callback_add(chk, "changed",
_main_menu_show_threads_changed_cb, ui);
elm_box_pack_end(bx2, chk);
}
chk = elm_check_add(bx2);
evas_object_size_hint_weight_set(chk, EXPAND, EXPAND);
@ -515,10 +518,18 @@ evisum_ui_main_menu_create(Ui *ui, Evas_Object *parent, Evas_Object *obj)
return o;
}
// Any OS specific feature checks.
static void
_ui_init_system_probe(Ui *ui)
{
#if defined(__OpenBSD__)
ui->proc.has_kthreads = 0;
#else
ui->proc.has_kthreads = 1;
#endif
#if defined(__FreeBSD__) || defined(__DragonFly__)
ui->mem.zfs_mounted = file_system_in_use("ZFS");
#endif
}
void

View File

@ -29,6 +29,8 @@ typedef struct Ui
int x, y;
Eina_Bool restart;
Eina_Bool has_kthreads;
int poll_delay;
int sort_type;
Eina_Bool sort_reverse;