summaryrefslogtreecommitdiff
path: root/fs/proc/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 7af62577287e..40d29f078984 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -162,13 +162,13 @@ static inline char * task_state(struct task_struct *p, char *buffer)
"Uid:\t%d\t%d\t%d\t%d\n"
"Gid:\t%d\t%d\t%d\t%d\n",
get_task_state(p),
- (p->sleep_avg/1024)*100/(1000000000/1024),
+ (p->sleep_avg/1024)*100/(1020000000/1024),
p->tgid,
p->pid, p->pid ? p->real_parent->pid : 0,
p->pid && p->ptrace ? p->parent->pid : 0,
p->uid, p->euid, p->suid, p->fsuid,
p->gid, p->egid, p->sgid, p->fsgid);
- read_unlock(&tasklist_lock);
+ read_unlock(&tasklist_lock);
task_lock(p);
buffer += sprintf(buffer,
"FDSize:\t%d\n"
@@ -301,7 +301,7 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
sigset_t sigign, sigcatch;
char state;
int res;
- pid_t ppid;
+ pid_t ppid, pgid = -1, sid = -1;
int num_threads = 0;
struct mm_struct *mm;
@@ -311,10 +311,6 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
mm = task->mm;
if(mm)
mm = mmgrab(mm);
- if (task->tty) {
- tty_pgrp = task->tty->pgrp;
- tty_nr = new_encode_dev(tty_devnum(task->tty));
- }
task_unlock(task);
if (mm) {
down_read(&mm->mmap_sem);
@@ -335,7 +331,15 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
collect_sigign_sigcatch(task, &sigign, &sigcatch);
spin_unlock_irq(&task->sighand->siglock);
}
- read_unlock(&tasklist_lock);
+ if (task->signal) {
+ if (task->signal->tty) {
+ tty_pgrp = task->signal->tty->pgrp;
+ tty_nr = new_encode_dev(tty_devnum(task->signal->tty));
+ }
+ pgid = process_group(task);
+ sid = task->signal->session;
+ }
+ read_unlock(&tasklist_lock);
/* scale priority and nice values from timeslices to -20..20 */
/* to make it look like a "normal" Unix priority/nice value */
@@ -352,8 +356,8 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
task->comm,
state,
ppid,
- process_group(task),
- task->session,
+ pgid,
+ sid,
tty_nr,
tty_pgrp,
task->flags,
@@ -388,8 +392,8 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
sigign .sig[0] & 0x7fffffffUL,
sigcatch .sig[0] & 0x7fffffffUL,
wchan,
- task->nswap,
- task->cnswap,
+ 0UL,
+ 0UL,
task->exit_signal,
task_cpu(task),
task->rt_priority,