ip addr命令实现源码分析
Posted linux进阶
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ip addr命令实现源码分析相关的知识,希望对你有一定的参考价值。
执行命令ip addr show dev eth2
执行strace 查看相应的系统调用如下
root@TopSecSystem:~/iproute2-5.6.0/tc>strace ip addr show dev eth2
execve("/sbin/ip", ["ip", "addr", "show", "dev", "eth2"], [/* 22 vars */]) = 0
brk(0) = 0x848000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3c85d3c000
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=32941, ...}) = 0
mmap(NULL, 32941, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f3c85d33000
close(3) = 0
open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "177ELF211 3 >