Lines 585-591
Link Here
|
585 |
string[ sizeof(string)-1 ] = 0; |
585 |
string[ sizeof(string)-1 ] = 0; |
586 |
#endif |
586 |
#endif |
587 |
#elif HAVE_KVM_GETPROCS |
587 |
#elif HAVE_KVM_GETPROCS |
588 |
#if defined(freebsd5) |
588 |
#if defined(freebsd5) && __FreeBSD_version >= 500014 |
589 |
strcpy(string, proc_table[LowProcIndex].ki_comm); |
589 |
strcpy(string, proc_table[LowProcIndex].ki_comm); |
590 |
#else |
590 |
#else |
591 |
strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm); |
591 |
strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm); |
Lines 694-700
Link Here
|
694 |
*cp1 = 0; |
694 |
*cp1 = 0; |
695 |
#endif |
695 |
#endif |
696 |
#elif HAVE_KVM_GETPROCS |
696 |
#elif HAVE_KVM_GETPROCS |
697 |
#if defined(freebsd5) |
697 |
#if defined(freebsd5) && __FreeBSD_version >= 500014 |
698 |
strcpy(string, proc_table[LowProcIndex].ki_comm); |
698 |
strcpy(string, proc_table[LowProcIndex].ki_comm); |
699 |
#else |
699 |
#else |
700 |
strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm); |
700 |
strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm); |
Lines 857-864
Link Here
|
857 |
if (pid < PID_MAXSYS) |
857 |
if (pid < PID_MAXSYS) |
858 |
long_return = 2; /* operatingSystem */ |
858 |
long_return = 2; /* operatingSystem */ |
859 |
else |
859 |
else |
860 |
#endif |
|
|
861 |
long_return = 4; /* application */ |
860 |
long_return = 4; /* application */ |
|
|
861 |
#elif HAVE_KVM_GETPROCS |
862 |
#if defined(freebsd5) && __FreeBSD_version >= 500014 |
863 |
if (proc_table[LowProcIndex].ki_flag & P_SYSTEM) { |
864 |
if (proc_table[LowProcIndex].ki_pri.pri_class == PRI_ITHD) |
865 |
long_return = 3;/* deviceDriver */ |
866 |
else |
867 |
long_return = 2;/* operatingSystem */ |
868 |
} else |
869 |
long_return = 4; /* application */ |
870 |
#else |
871 |
if (proc_table[LowProcIndex].kp_proc.p_flag & P_SYSTEM) |
872 |
long_return = 2; /* operatingSystem */ |
873 |
else |
874 |
long_return = 4; /* application */ |
875 |
#endif |
876 |
#else |
877 |
long_return = 4; /* application */ |
878 |
#endif |
862 |
return (u_char *) & long_return; |
879 |
return (u_char *) & long_return; |
863 |
case HRSWRUN_STATUS: |
880 |
case HRSWRUN_STATUS: |
864 |
#if defined(cygwin) |
881 |
#if defined(cygwin) |
Lines 889-895
Link Here
|
889 |
} |
906 |
} |
890 |
#else |
907 |
#else |
891 |
#if HAVE_KVM_GETPROCS |
908 |
#if HAVE_KVM_GETPROCS |
892 |
#if defined(freebsd5) |
909 |
#if defined(freebsd5) && __FreeBSD_version >= 500014 |
893 |
switch (proc_table[LowProcIndex].ki_stat) { |
910 |
switch (proc_table[LowProcIndex].ki_stat) { |
894 |
#else |
911 |
#else |
895 |
switch (proc_table[LowProcIndex].kp_proc.p_stat) { |
912 |
switch (proc_table[LowProcIndex].kp_proc.p_stat) { |
Lines 988-994
Link Here
|
988 |
long_return = proc_buf->p_utime * 100 + proc_buf->p_stime * 100; |
1005 |
long_return = proc_buf->p_utime * 100 + proc_buf->p_stime * 100; |
989 |
#endif |
1006 |
#endif |
990 |
#elif HAVE_KVM_GETPROCS |
1007 |
#elif HAVE_KVM_GETPROCS |
991 |
#if defined(freebsd5) |
1008 |
#if defined(freebsd5) && __FreeBSD_version >= 500014 |
|
|
1009 |
/* XXX: Accessing ki_paddr causes sig10 ... |
1010 |
long_return = proc_table[LowProcIndex].ki_paddr->p_uticks + |
1011 |
proc_table[LowProcIndex].ki_paddr->p_sticks + |
1012 |
proc_table[LowProcIndex].ki_paddr->p_iticks; */ |
1013 |
long_return = 0; |
1014 |
#elif defined(freebsd5) |
992 |
long_return = proc_table[LowProcIndex].ki_runtime / 100000; |
1015 |
long_return = proc_table[LowProcIndex].ki_runtime / 100000; |
993 |
#else |
1016 |
#else |
994 |
long_return = proc_table[LowProcIndex].kp_proc.p_uticks + |
1017 |
long_return = proc_table[LowProcIndex].kp_proc.p_uticks + |
Lines 1063-1069
Link Here
|
1063 |
long_return = proc_buf->p_swrss; |
1086 |
long_return = proc_buf->p_swrss; |
1064 |
#endif |
1087 |
#endif |
1065 |
#elif HAVE_KVM_GETPROCS |
1088 |
#elif HAVE_KVM_GETPROCS |
1066 |
#if defined(freebsd3) && !defined(darwin) |
1089 |
#if defined(freebsd5) && __FreeBSD_version >= 500014 |
|
|
1090 |
/* XXX |
1091 |
long_return = proc_table[LowProcIndex].ki_vmspace->vm_tsize + |
1092 |
proc_table[LowProcIndex].ki_vmspace->vm_ssize + |
1093 |
proc_table[LowProcIndex].ki_vmspace->vm_dsize; |
1094 |
long_return = long_return * (getpagesize() / 1024); */ |
1095 |
long_return = 0; |
1096 |
#elif defined(freebsd3) && !defined(darwin) |
1067 |
long_return = |
1097 |
long_return = |
1068 |
#if defined(freebsd5) |
1098 |
#if defined(freebsd5) |
1069 |
proc_table[LowProcIndex].ki_size / 1024; |
1099 |
proc_table[LowProcIndex].ki_size / 1024; |
Lines 1349-1355
Link Here
|
1349 |
#elif defined(solaris2) |
1379 |
#elif defined(solaris2) |
1350 |
return proc_table[current_proc_entry++]; |
1380 |
return proc_table[current_proc_entry++]; |
1351 |
#elif HAVE_KVM_GETPROCS |
1381 |
#elif HAVE_KVM_GETPROCS |
1352 |
#if defined(freebsd5) |
1382 |
#if defined(freebsd5) && __FreeBSD_version >= 500014 |
1353 |
if (proc_table[current_proc_entry].ki_stat != 0) |
1383 |
if (proc_table[current_proc_entry].ki_stat != 0) |
1354 |
return proc_table[current_proc_entry++].ki_pid; |
1384 |
return proc_table[current_proc_entry++].ki_pid; |
1355 |
#else |
1385 |
#else |