aboutsummaryrefslogtreecommitdiff
path: root/release/picobsd/tinyware/sps
diff options
context:
space:
mode:
authorAndrzej Bialecki <abial@FreeBSD.org>2001-01-10 22:24:07 +0000
committerAndrzej Bialecki <abial@FreeBSD.org>2001-01-10 22:24:07 +0000
commit650da9d30a2f524ee0fba53cf3d707de3540f883 (patch)
tree66a967742e401c6502a53494fd3019a10f1b0cb8 /release/picobsd/tinyware/sps
parent891b3d045f6e56da00da693a153e3bb53fe98d0c (diff)
downloadsrc-650da9d30a2f524ee0fba53cf3d707de3540f883.tar.gz
src-650da9d30a2f524ee0fba53cf3d707de3540f883.zip
Fix breakage after moving from struct proc/eproc to kinfo_proc.
Notes
Notes: svn path=/head/; revision=70906
Diffstat (limited to 'release/picobsd/tinyware/sps')
-rw-r--r--release/picobsd/tinyware/sps/sps.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/release/picobsd/tinyware/sps/sps.c b/release/picobsd/tinyware/sps/sps.c
index 938cde30dbd3..c3eef178f5ba 100644
--- a/release/picobsd/tinyware/sps/sps.c
+++ b/release/picobsd/tinyware/sps/sps.c
@@ -36,7 +36,6 @@
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/stat.h>
-#include <sys/proc.h>
#include <sys/user.h>
char p_stat[]="?iRSTZWM";
@@ -45,10 +44,8 @@ int
main(int argc, char *argv[])
{
int mib[4],i=0, num, len, j, plen;
- int sz = sizeof(struct proc) + sizeof(struct eproc);
- struct proc *p;
- struct eproc *ep;
char buf[MAXPATHLEN],vty[5],pst[5], wmesg[10];
+ struct kinfo_proc *ki;
char *t;
int ma,mi;
@@ -65,32 +62,31 @@ main(int argc, char *argv[])
exit(1);
}
mib[2]=KERN_PROC_ARGS;
- num = len / sz;
+ num = len / KINFO_PROC_SIZE;
i=0;
printf("USERNAME PID PPID PRI NICE TTY STAT WCHAN COMMAND\n");
while(i < num) {
- p=(struct proc *)(t + (num - i - 1) * sz);
- ep=(struct eproc *)(t + (num - i - 1) * sz + sizeof(struct proc));
- mib[3]=p->p_pid;
+ ki = (struct kinfo_proc *)(t + (num - i - 1) * KINFO_PROC_SIZE);
+ mib[3] = ki->ki_pid;
plen = MAXPATHLEN;
if(sysctl(mib,4,buf,&plen,NULL,0)) {
perror("sysctl info");
exit(1);
}
if(plen == 0) {
- sprintf(buf, "(%s)", p->p_comm);
+ sprintf(buf, "(%s)", ki->ki_comm);
} else {
for(j=0; j < plen-1; j++) {
if(buf[j] == '\0') buf[j] = ' ';
}
}
- if(strcmp(ep->e_wmesg, "") == 0) {
+ if(strcmp(ki->ki_wmesg, "") == 0) {
sprintf(wmesg, "-");
} else {
- strcpy(wmesg, ep->e_wmesg);
+ strcpy(wmesg, ki->ki_wmesg);
}
- ma=major(ep->e_tdev);
- mi=minor(ep->e_tdev);
+ ma=major(ki->ki_tdev);
+ mi=minor(ki->ki_tdev);
switch(ma) {
case 255:
strcpy(vty,"??");
@@ -108,13 +104,13 @@ main(int argc, char *argv[])
sprintf(vty,"p%d",mi);
break;
}
- sprintf(pst,"%c",p_stat[p->p_stat]);
+ sprintf(pst,"%c",p_stat[ki->ki_stat]);
printf("%8s %5u %5u %3d %4d %3s %-4s %-7s %s\n",
- ep->e_login,
- p->p_pid,
- ep->e_ppid,
- p->p_priority - 22,
- p->p_nice,
+ ki->ki_login,
+ ki->ki_pid,
+ ki->ki_ppid,
+ ki->ki_priority - 22,
+ ki->ki_nice,
vty,
pst,
wmesg,