diff options
author | abial <abial@FreeBSD.org> | 2001-01-10 22:24:07 +0000 |
---|---|---|
committer | abial <abial@FreeBSD.org> | 2001-01-10 22:24:07 +0000 |
commit | 7c0baff27a9a7f1c2f24af8303c9f89caade4a5d (patch) | |
tree | 224859a1f43a97c9b2faec64a39beffc1f8f7b81 /release/picobsd | |
parent | d9512fd7b2bd158adad8ec83228eba16f4e6f1e8 (diff) | |
download | FreeBSD-src-7c0baff27a9a7f1c2f24af8303c9f89caade4a5d.zip FreeBSD-src-7c0baff27a9a7f1c2f24af8303c9f89caade4a5d.tar.gz |
Fix breakage after moving from struct proc/eproc to kinfo_proc.
Diffstat (limited to 'release/picobsd')
-rw-r--r-- | release/picobsd/tinyware/sps/sps.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/release/picobsd/tinyware/sps/sps.c b/release/picobsd/tinyware/sps/sps.c index 938cde3..c3eef17 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, |