From 497a91510f768c4bdecac6a6a571eafe505167dd Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Tue, 18 Feb 2003 05:47:47 -0800 Subject: [PATCH] [PATCH] fix text and data sizing in MMUless task_nommu.c This patch does a couple of things to the MMUless proc support: 1. change current->sig to current->sighand 2. initialize vsize var in task_vsize() function 3. correctly set *text and *data values in task_vsize() function --- fs/proc/task_nommu.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c index 16f05cfae496a..53dd89a45352a 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c @@ -1,5 +1,6 @@ #include +#include /* * Logic: we've got two memory sums for each process, "shared", and @@ -44,10 +45,10 @@ char *task_mem(struct mm_struct *mm, char *buffer) else bytes += kobjsize(current->files); - if (current->sig && atomic_read(¤t->sig->count) > 1) - sbytes += kobjsize(current->sig); + if (current->sighand && atomic_read(¤t->sighand->count) > 1) + sbytes += kobjsize(current->sighand); else - bytes += kobjsize(current->sig); + bytes += kobjsize(current->sighand); bytes += kobjsize(current); /* includes kernel stack */ @@ -64,7 +65,7 @@ char *task_mem(struct mm_struct *mm, char *buffer) unsigned long task_vsize(struct mm_struct *mm) { struct mm_tblock_struct *tbp; - unsigned long vsize; + unsigned long vsize = 0; for (tbp = &mm->context.tblock; tbp; tbp = tbp->next) { if (tbp->rblock) @@ -89,8 +90,8 @@ int task_statm(struct mm_struct *mm, int *shared, int *text, } } - size += (text = mm->end_code - mm->start_code); - size += (data = mm->start_stack - mm->start_data); + size += (*text = mm->end_code - mm->start_code); + size += (*data = mm->start_stack - mm->start_data); *resident = size; return size; -- 2.53.0