何回もソース読んだはずなのにすぐ忘れてしまう。

08048000-08049000 r-xp 00000000 16:44 66267    /home/foo/a.out
08049000-0804a000 rw-p 00000000 16:44 66267 /home/foo/a.out
40000000-40016000 r-xp 00000000 16:42 442401 /lib/ld-2.2.4.so
40016000-40017000 rw-p 00015000 16:42 442401 /lib/ld-2.2.4.so
40017000-40019000 rw-p 00000000 00:00 0
40033000-40166000 r-xp 00000000 16:42 327696 /lib/i686/libc-2.2.4.so
40166000-4016b000 rw-p 00132000 16:42 327696 /lib/i686/libc-2.2.4.so
4016b000-4016f000 rw-p 00000000 00:00 0
bfffe000-c0000000 rwxp fffff000 00:00 0
-------- -------- -- - -------- ----- ----- --------------
start end | | file device inode file name
addr addr | | offset major/ no
| | minor
rwxアクセス権 -+ |
mmapの引数ね |
|
s: 共有 ---+
p: プライベート




ソースの位置は linux/fs/proc/task_mmu.c より
80 static int show_map(struct seq_file *m, void *v)
81 {
82 struct vm_area_struct *map = v;
83 struct file *file = map->vm_file;
84 int flags = map->vm_flags;
85 unsigned long ino = 0;
86 dev_t dev = 0;
87 int len;
88
89 if (file) {
90 struct inode *inode = map->vm_file->f_dentry->d_inode;
91 dev = inode->i_sb->s_dev;
92 ino = inode->i_ino;
93 }
94
95 seq_printf(m, "%08lx-%08lx %c%c%c%c %08lx %02x:%02x %lu %n",
96 map->vm_start,
97 map->vm_end,
98 flags & VM_READ ? 'r' : '-',
99 flags & VM_WRITE ? 'w' : '-',
100 flags & VM_EXEC ? 'x' : '-',
101 flags & VM_MAYSHARE ? 's' : 'p',
102 map->vm_pgoff << PAGE_SHIFT,
103 MAJOR(dev), MINOR(dev), ino, &len);
104
105 if (map->vm_file) {
106 len = 25 + sizeof(void*) * 6 - len;
107 if (len < 1)
108 len = 1;
109 seq_printf(m, "%*c", len, ' ');
110 seq_path(m, file->f_vfsmnt, file->f_dentry, "");
111 }
112 seq_putc(m, '\n');
113 return 0;
114 }