Slide 15
Slide 15 text
procfs系のコマンドは、procから拾って組み立てる
(ps, top, uptime, vmstat... 等)
15
[root@cent7 ~]# strace ps
execve("/bin/ps", ["ps"], 0x7ffc3e00eb10 /* 18 vars */) = 0
....(省略)...
stat("/proc/1", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
open("/proc/1/stat", O_RDONLY) = 6
read(6, "1 (systemd) S 0 1 1 0 -1 4202752"..., 1024) = 375
close(6) = 0
open("/proc/1/status", O_RDONLY) = 6
read(6, "Name:\tsystemd\nUmask:\t0000\nState:"..., 1024) = 1024
read(6, "0,00000000,00000000,00000000,000"..., 1024) = 178
close(6) = 0
stat("/proc/2", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
open("/proc/2/stat", O_RDONLY) = 6
read(6, "2 (kthreadd) S 0 0 0 0 -1 213817"..., 2048) = 169
close(6) = 0
....(省略)...