diff options
Diffstat (limited to 'src/librc')
-rw-r--r-- | src/librc/librc-daemon.c | 20 | ||||
-rw-r--r-- | src/librc/librc.h | 3 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c index 938448d1..ca23ed27 100644 --- a/src/librc/librc-daemon.c +++ b/src/librc/librc-daemon.c @@ -184,7 +184,16 @@ librc_hidden_def(rc_find_pids) #elif BSD -# if defined(__DragonFly__) || defined(__FreeBSD__) +# if defined(__NetBSD__) || defined(__OpenBSD__) +# define _KVM_GETPROC2 +# define _KINFO_PROC kinfo_proc2 +# define _KVM_GETARGV kvm_getargv2 +# define _GET_KINFO_UID(kp) (kp.p_ruid) +# define _GET_KINFO_COMM(kp) (kp.p_comm) +# define _GET_KINFO_PID(kp) (kp.p_pid) +# define _KVM_PATH NULL +# define _KVM_FLAGS KVM_NO_FILES +# else # ifndef KERN_PROC_PROC # define KERN_PROC_PROC KERN_PROC_ALL # endif @@ -195,15 +204,6 @@ librc_hidden_def(rc_find_pids) # define _GET_KINFO_PID(kp) (kp.ki_pid) # define _KVM_PATH _PATH_DEVNULL # define _KVM_FLAGS O_RDONLY -# else -# define _KVM_GETPROC2 -# define _KINFO_PROC kinfo_proc2 -# define _KVM_GETARGV kvm_getargv2 -# define _GET_KINFO_UID(kp) (kp.p_ruid) -# define _GET_KINFO_COMM(kp) (kp.p_comm) -# define _GET_KINFO_PID(kp) (kp.p_pid) -# define _KVM_PATH NULL -# define _KVM_FLAGS KVM_NO_FILES # endif pid_t *rc_find_pids (const char *const *argv, const char *cmd, diff --git a/src/librc/librc.h b/src/librc/librc.h index edde94fe..edbebafb 100644 --- a/src/librc/librc.h +++ b/src/librc/librc.h @@ -57,8 +57,7 @@ #include <time.h> #include <unistd.h> -#if defined(__DragonFly__) || defined(__FreeBSD__) || \ - defined(__NetBSD__) || defined (__OpenBSD__) +#ifdef BSD #include <sys/param.h> #include <sys/user.h> #include <sys/sysctl.h> |