Re: network register on /proc fs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



doing a "strace ifconfig -a" and you can see the following in your stderr:

open("/proc/net/dev", O_RDONLY)         = 6
open("/proc/net/if_inet6", O_RDONLY)    = 6
open("/proc/net/if_inet6", O_RDONLY)    = 6
open("/proc/net/if_inet6", O_RDONLY)    = 6

and see fd id is 6, you can also see the fd in your /proc/<pid>/fd:

ls -al /proc/<pid>fd for a particular process give:

>ls -al /proc/2187/fd
total 0

lr-x------ 1 xxx xxx 64 Dec 16 07:26 0 -> /dev/null
l-wx------ 1 xxx xxx 64 Dec 16 07:26 1 -> /dev/null
lrwx------ 1 xxx xxx 64 Dec 16 07:26 10 -> anon_inode:[eventfd]
lrwx------ 1 xxx xxx 64 Dec 16 07:26 11 -> /dev/dri/card0

registration of /proc happened when /proc is being initialized and created:

fs/proc/root.c:proc_root_init()

and the function for network is proc_net_init() inside fs/proc/proc_net.c.

On Sat, Dec 7, 2013 at 12:58 PM, Hatt Tom <net.study.sea@xxxxxxxxx> wrote:
hi:

  Does the network relevent register on  /proc fs ? when does it register ?

  which entry of /proc will be used by ifconfig" command ?


Thanks!
--
Best Regards!

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



--
Regards,
Peter Teoh
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux