61 |
|
#include <paths.h> |
62 |
|
#include <fcntl.h> |
63 |
|
#include <limits.h> |
64 |
+ |
#if (defined(FREEBSD) && !defined(FREEBSD5)) || defined(DFBSD) |
65 |
|
#include <kvm.h> |
66 |
|
#endif |
67 |
+ |
#include <unistd.h> |
68 |
+ |
#endif |
69 |
|
|
70 |
|
int get_proc_snapshot(proc_state_t **ps){ |
71 |
|
proc_state_t *proc_state = NULL; |
75 |
|
int mib[4]; |
76 |
|
size_t size; |
77 |
|
struct kinfo_proc *kp_stats; |
78 |
< |
int procs, i, alloc; |
78 |
> |
int procs, i; |
79 |
|
char *proctitle; |
80 |
< |
#if defined(FREEBSD5) || defined(NETBSD) || defined(OPENBSD) |
78 |
< |
long buflen; |
79 |
< |
char *p; |
80 |
< |
int argc; |
81 |
< |
int j = 0; |
82 |
< |
#else |
80 |
> |
#if (defined(FREEBSD) && !defined(FREEBSD5)) || defined(DFBSD) |
81 |
|
static kvm_t *kvmd; |
82 |
|
char **args; |
83 |
+ |
int alloc; |
84 |
+ |
#else |
85 |
+ |
long buflen; |
86 |
+ |
char *p; |
87 |
|
#endif |
88 |
|
#endif |
89 |
|
#if defined(SOLARIS) || defined(LINUX) |