blob: 36888fbef6614d076d76d5460c0f52d4fd57701d (
plain)
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
|
$NetBSD: patch-af,v 1.3 2017/06/23 19:16:58 kamil Exp $
--- src/process_scan_bsd.cc.orig 2003-12-01 01:04:48.000000000 +0000
+++ src/process_scan_bsd.cc
@@ -56,7 +56,15 @@ extern "C" {
#include <sys/param.h>
#include <sys/sysctl.h> // KERN_PROC_ALL
#include <sys/types.h>
+#ifdef __DragonFly__
+#define template
+#endif
+#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/user.h>
+#endif
+#ifdef __DragonFly__
+#undef template
+#endif
#include <fcntl.h>
#include <kvm.h>
#include <unistd.h>
@@ -226,6 +234,13 @@ int process_scan_bsd::extract_uid() { re
int process_scan_bsd::extract_nice() { return int(cur_kp_->kp_proc.p_nice); }
int process_scan_bsd::extract_utime_msec() { return time_value_t_to_msec(kur_kp_->times.user_time) + time_value_t_to_msec(cur_kp_->tasks_info.user_time); }
int process_scan_bsd::extract_stime_msec() { return time_value_t_to_msec(kur_kp_->times.system _time) + time_value_t_to_msec(cur_kp_->tasks_info.system_time); }
+#elif defined(__DragonFly__)
+char *process_scan_bsd::extract_cmd() { return cur_kp_->kp_proc.p_comm; }
+int process_scan_bsd::extract_pid() { return int(cur_kp_->kp_proc.p_pid); }
+int process_scan_bsd::extract_uid() { return int(cur_kp_->kp_eproc.e_pcred.cr_ruid); }
+int process_scan_bsd::extract_nice() { return int(cur_kp_->kp_proc.p_nice); }
+int process_scan_bsd::extract_utime_msec() { return ticks_to_msec(cur_kp_->kp_eproc.e_uticks); }
+int process_scan_bsd::extract_stime_msec() { return ticks_to_msec(cur_kp_->kp_eproc.e_sticks); }
#else
#error unknown bsd variant
#endif
|