$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 #include // KERN_PROC_ALL #include +#ifdef __DragonFly__ +#define template +#endif +#if defined(__FreeBSD__) || defined(__DragonFly__) #include +#endif +#ifdef __DragonFly__ +#undef template +#endif #include #include #include @@ -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