I have no knowledge of this code, but if this naming and the one used
below should match, shouldn't the string be "RSDZTW" (W as last
character).?
astor
> psinfo.pr_zomb = psinfo.pr_sname == 'Z';
> psinfo.pr_nice = current->priority-15;
> psinfo.pr_flag = current->flags;
> --- linux-2.1.88/fs/proc/array.c.~1~ Wed Jan 28 19:11:04 1998
> +++ linux-2.1.88/fs/proc/array.c Tue Feb 17 16:20:14 1998
> @@ -611,7 +611,7 @@
> static inline char * task_state(struct task_struct *p, char *buffer)
> {
> #define NR_STATES (sizeof(states)/sizeof(const char *))
> - unsigned int n = p->state;
> + unsigned int n = p->state ? ffz(~p->state) + 1 : 0;
> static const char * states[] = {
> "R (running)",
> "S (sleeping)",
> @@ -763,14 +763,15 @@
> char blocked_str[sizeof(sigset_t)*2+1];
> char sigign_str[sizeof(sigset_t)*2+1];
> char sigcatch_str[sizeof(sigset_t)*2+1];
> - char state;
> + int state;
>
> if (!tsk)
> return 0;
> - if (tsk->state < 0 || tsk->state > 5)
> + state = tsk->state ? ffz(~tsk->state) + 1 : 0;
> + if (state < 0 || state > 5)
> state = '.';
> else
> - state = "RSDZTW"[tsk->state];
> + state = "RSDZTW"[state];
> vsize = eip = esp = 0;
> if (tsk->mm && tsk->mm != &init_mm) {
> struct vm_area_struct *vma = tsk->mm->mmap;
> --- linux-2.1.88/kernel/sched.c.~4~ Sat Feb 14 08:51:26 1998
> +++ linux-2.1.88/kernel/sched.c Tue Feb 17 14:19:03 1998
> @@ -1453,11 +1453,13 @@
> static void show_task(int nr,struct task_struct * p)
> {
> unsigned long free = 0;
> + int state;
> static const char * stat_nam[] = { "R", "S", "D", "Z", "T", "W" };
>
> printk("%-16s %3d ", p->comm, (p == current) ? -nr : nr);
> - if (((unsigned) p->state) < sizeof(stat_nam)/sizeof(char *))
> - printk(stat_nam[p->state]);
> + state = p->state ? ffz(~p->state) + 1 : 0;
> + if (((unsigned) state) < sizeof(stat_nam)/sizeof(char *))
> + printk(stat_nam[state]);
> else
> printk(" ");
> #if ((~0UL) == 0xffffffff)
>
astor
-- Alexander Kjeldaas, Guardian Networks AS, Trondheim, Norway http://www.guardian.no/- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu