~ubuntu-branches/ubuntu/intrepid/procps/intrepid-security

« back to all changes in this revision

Viewing changes to pmap.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2004-12-08 10:45:17 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041208104517-dddigjyt093j9ql6
Tags: 1:3.2.4-1ubuntu1
Resynchronise with Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
  return cp;
114
114
}
115
115
 
116
 
 
117
 
// Overkill, but who knows what is proper? The "w" prog
118
 
// uses the tty width to determine this.
119
 
#define maxcmd 0xfffff
120
 
 
121
116
static int one_proc(proc_t *p){
122
117
  char buf[32];
123
118
  char mapbuf[9600];
126
121
  unsigned long total_private_readonly = 0ul;
127
122
  unsigned long total_private_writeable = 0ul;
128
123
 
 
124
  // Overkill, but who knows what is proper? The "w" prog
 
125
  // uses the tty width to determine this.
 
126
  int maxcmd = 0xfffff;
 
127
 
129
128
  sprintf(buf,"/proc/%u/maps",p->tgid);
130
129
  if(!freopen(buf, "r", stdin)) return 1;
131
130
 
132
 
  escape_command(cmdbuf, p, sizeof cmdbuf, maxcmd, ESC_ARGS|ESC_BRACKETS);
 
131
  escape_command(cmdbuf, p, sizeof cmdbuf, &maxcmd, ESC_ARGS|ESC_BRACKETS);
133
132
  printf("%u:   %s\n", p->tgid, cmdbuf);
134
133
 
135
134
  if(!q_option && (x_option|d_option)){