一
[classic_tong @ https://www.cnblogs.com/hugetong/p/12198122.html]
查看一个命令或程序,都调用了什么系统API的方法,
可以是用strace
[root@T9 OUTPUT_nginx]# strace echo execve("/usr/bin/echo", ["echo"], [/* 22 vars */]) = 0 brk(NULL) = 0x1311000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f10f71d4000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=53652, ...}) = 0 mmap(NULL, 53652, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f10f71c6000 close(3) = 0 open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "177ELF2113 3 >