--- pidof.c.orig 2005-05-01 16:26:19 UTC +++ pidof.c @@ -53,10 +53,19 @@ get_pid_of_process(char *process_name) if ((kd = kvm_open("/dev/null", "/dev/null", "/dev/null", O_RDONLY, "kvm_open")) == NULL) (void)errx(1, "%s", kvm_geterr(kd)); else { +#if __FreeBSD__ < 5 + p = kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes); +#else p = kvm_getprocs(kd, KERN_PROC_PROC, 0, &n_processes); +#endif /* __FreeBSD__ < 5 */ for (i = 0; i