rem: const char *cp = mapping_name(p, start, diff, mapbuf, 0, dev_major, dev_minor, inode);
add: const char *cp = mapping_name(p, start, diff, mapbuf, 1, dev_major, dev_minor, inode);
context: static int one_proc(proc_t *p){  char buf[32];  char mapbuf[9600];  char cmdbuf[512];  unsigned long total_shared = 0ul;  unsigned long total_private_readonly = 0ul;  unsigned long total_private_writeable = 0ul;  // Overkill, but who knows what is proper? The "w" prog  // uses the tty width to determine this.  int maxcmd = 0xfffff;  sprintf(buf,"/proc/%u/maps",p->tgid);  if(!freopen(buf, "r", stdin)) return 1;  escape_command(cmdbuf, p, sizeof cmdbuf, &maxcmd, ESC_ARGS|ESC_BRACKETS);  printf("%u:   %s\n", p->tgid, cmdbuf);  if(!q_option && (x_option|d_option)){    if(x_option){      if(sizeof(KLONG)==4) printf("Address   Kbytes     RSS    Anon  Locked Mode   Mapping\n");      else         printf("Address           Kbytes     RSS    Anon  Locked Mode   Mapping\n");    }    if(d_option){      if(sizeof(KLONG)==4) printf("Address   Kbytes Mode  Offset           Device    Mapping\n");      else         printf("Address           Kbytes Mode  Offset           Device    Mapping\n");    }  }  while(fgets(mapbuf,sizeof mapbuf,stdin)){    char flags[32];    char *tmp; // to clean up unprintables    unsigned KLONG start, end, diff;    unsigned long long file_offset, inode;    unsigned dev_major, dev_minor;    sscanf(mapbuf,"%"KLF"x-%"KLF"x %31s %Lx %x:%x %Lu", &start, &end, flags, &file_offset, &dev_major, &dev_minor, &inode);    tmp = strchr(mapbuf,'\n');    if(tmp) *tmp='\0';    tmp = mapbuf;    while(*tmp){      if(!isprint(*tmp)) *tmp='?';      tmp++;    }        diff = end-start;    if(flags[3]=='s') total_shared  += diff;    if(flags[3]=='p'){      flags[3] = '-';      if(flags[1]=='w') total_private_writeable += diff;      else              total_private_readonly  += diff;    }    // format used by Solaris 9 and procps-3.2.0+    // an 'R' if swap not reserved (MAP_NORESERVE, SysV ISM shared mem, etc.)    flags[4] = '-';    flags[5] = '\0';    if(x_option){      const char *cp = mapping_name(p, start, diff, mapbuf, 1, dev_major, dev_minor, inode);      printf(        (sizeof(KLONG)==8)          ? "%016"KLF"x %7lu       -       -       - %s  %s\n"          :      "%08lx %7lu       -       -       - %s  %s\n",        start,        (unsigned long)(diff>>10),        flags,        cp      );    }    if(d_option){      const char *cp = mapping_name(p, start, diff, mapbuf, 1, dev_major, dev_minor, inode);      printf(        (sizeof(KLONG)==8)          ? "%016"KLF"x %7lu %s %016Lx %03x:%05x %s\n"          :      "%08lx %7lu %s %016Lx %03x:%05x %s\n",        start,        (unsigned long)(diff>>10),        flags,        file_offset,        dev_major, dev_minor,        cp      );    }    if(!x_option && !d_option){      const char *cp = mapping_name(p, start, diff, mapbuf, 0, dev_major, dev_minor, inode);      printf(        (sizeof(KLONG)==8)          ? "%016"KLF"x %6luK %s  %s\n"          :      "%08lx %6luK %s  %s\n",        start,        (unsigned long)(diff>>10),        flags,        cp      );    }      }  if(!q_option){    if(x_option){      if(sizeof(KLONG)==8){        printf("----------------  ------  ------  ------  ------\n");        printf(          "total kB %15ld       -       -       -\n",          (total_shared + total_private_writeable + total_private_readonly) >> 10        );      }else{        printf("-------- ------- ------- ------- -------\n");        printf(          "total kB %7ld       -       -       -\n",          (total_shared + total_private_writeable + total_private_readonly) >> 10        );      }    }    if(d_option){        printf(          "mapped: %ldK    writeable/private: %ldK    shared: %ldK\n",          (total_shared + total_private_writeable + total_private_readonly) >> 10,          total_private_writeable >> 10,          total_shared >> 10        );    }    if(!x_option && !d_option){      if(sizeof(KLONG)==8) printf(" total %16ldK\n", (total_shared + total_private_writeable + total_private_readonly) >> 10);      else                 printf(" total %8ldK\n",  (total_shared + total_private_writeable + total_private_readonly) >> 10);    }  }  return 0;}