0
在執行strace -ttT date
時,我錯過了很多可執行文件後的系統調用。在execve()之後,沒有更多的系統調用將date
ELF從HDD複製到內存,這是否會在內核中發生?我以爲我會看到很多IOCTL到硬盤控制器,每個字節都被逐塊加載到內存中?爲什麼strace不顯示HDD IOCTL系統調用?
16:00:00.505197 execve("/bin/date", ["date"], [/* 30 vars */]) = 0 <0.038088>
16:00:00.543671 brk(0) = 0x11b9000 <0.000074>
16:00:00.543915 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) <0.000077>
16:00:00.544187 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f4083a000 <0.000076>
16:00:00.544416 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) <0.000018>
16:00:00.544543 open("/etc/ld.so.cache", O_RDONLY) = 3 <0.000059>