Title pretty much says it all. If I run ifconfig, I get this:
ifconfig
eth0: flags=4163 mtu 1500 inet -snip-
Have you considered using the strace command to see how ifconfig works? you can even see what parameters are passed to functions and other interesting details of how ifconfig works ..
strace