/proc/self/maps
仮想メモリーの/proc/self/mapsの内容です。
メジャー番号/マイナ番号は、iノードの属するデバイスファイルの番号となります。
[root@localhost ~]# cat /proc/self/maps 08048000-08053000 r-xp 00000000 fd:01 30433 /bin/cat 08053000-08054000 r--p 0000a000 fd:01 30433 /bin/cat 08054000-08055000 rw-p 0000b000 fd:01 30433 /bin/cat 08320000-08341000 rw-p 00000000 00:00 0 [heap] 4ea28000-4ea49000 r-xp 00000000 fd:01 25590 /lib/ld-2.14.90.so 4ea49000-4ea4a000 r--p 00020000 fd:01 25590 /lib/ld-2.14.90.so 4ea4a000-4ea4b000 rw-p 00021000 fd:01 25590 /lib/ld-2.14.90.so 4ea51000-4ebf8000 r-xp 00000000 fd:01 56120 /lib/libc-2.14.90.so 4ebf8000-4ebf9000 ---p 001a7000 fd:01 56120 /lib/libc-2.14.90.so 4ebf9000-4ebfb000 r--p 001a7000 fd:01 56120 /lib/libc-2.14.90.so 4ebfb000-4ebfc000 rw-p 001a9000 fd:01 56120 /lib/libc-2.14.90.so 4ebfc000-4ebff000 rw-p 00000000 00:00 0 b748d000-b757c000 r--p 048ce000 fd:01 80026 /usr/lib/locale/locale-archive b757c000-b777c000 r--p 00000000 fd:01 80026 /usr/lib/locale/locale-archive b777c000-b777d000 rw-p 00000000 00:00 0 b7790000-b7791000 rw-p 00000000 00:00 0 b7791000-b7792000 r-xp 00000000 00:00 0 [vdso] bf875000-bf896000 rw-p 00000000 00:00 0 [stack]これはfs/proc/nommu.cのnommu_region_show()で、以下の様に表示されています。
static int nommu_region_show(struct seq_file *m, struct vm_region *region)
{
unsigned long ino = 0;
struct file *file;
dev_t dev = 0;
int flags, len;
flags = region->vm_flags;
file = region->vm_file;
if (file) {
struct inode *inode = region->vm_file->f_path.dentry->d_inode;
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
}
seq_printf(m,
"%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
region->vm_start,
region->vm_end,
flags & VM_READ ? 'r' : '-',
flags & VM_WRITE ? 'w' : '-',
flags & VM_EXEC ? 'x' : '-',
flags & VM_MAYSHARE ? flags & VM_SHARED ? 'S' : 's' : 'p',
((loff_t)region->vm_pgoff) << PAGE_SHIFT,
MAJOR(dev), MINOR(dev), ino, &len);
if (file) {
len = 25 + sizeof(void *) * 6 - len;
if (len < 1)
len = 1;
seq_printf(m, "%*c", len, ' ');
seq_path(m, &file->f_path, "");
}
seq_putc(m, '\n');
return 0;
}
順に、開始アドレス-終了アドレス,メモリフラグ,file内のオフセット,メジャー番号,マイナ番号,iノード番号,ファイル名メジャー番号/マイナ番号は、iノードの属するデバイスファイルの番号となります。





