Go Back   Talk Root - PC Hardware, Software and Web Development forums > Operating Systems > Solaris Discussion > Solaris 1

Sponsored Links

Reply
 
Thread Tools Search this Thread
  #1  
Old 03-17-2004, 01:54 AM
Richard Yao
Guest
 
Posts: n/a
Default /proc/<pid>/fd issue

All,

As we know, on Solaris, /usr/proc/bin/pfiles can print out which files
process open and information of these files. I think it use /proc/<pid>/fd
to do that.

For socket, pfiles can print these information:
/************************************************** *************************
/
3: S_IFSOCK mode:0666 dev:284,0 ino:38699 uid:0 gid:0 size:0
O_RDWR
sockname: AF_INET 0.0.0.0 port: 5000
/************************************************** *************************
/

My question is:
I can use /proc/<pid>/fd to find out which sockets the process open, but how
can I get the information of these socket, just like the above(AF_INET
0.0.0.0 5000)?

Thanks,
Richard


Reply With Quote
  #2  
Old 03-18-2004, 03:24 AM
Casper H.S. Dik
Guest
 
Posts: n/a
Default Re: /proc/<pid>/fd issue

"Richard Yao" <yaozg@lucent.com> writes:

>For socket, pfiles can print these information:
>/************************************************** *************************
>/
> 3: S_IFSOCK mode:0666 dev:284,0 ino:38699 uid:0 gid:0 size:0
> O_RDWR
> sockname: AF_INET 0.0.0.0 port: 5000
>/************************************************** *************************
>/


>My question is:
>I can use /proc/<pid>/fd to find out which sockets the process open, but how
>can I get the information of these socket, just like the above(AF_INET
>0.0.0.0 5000)?


It injects a thread in the process which calls getsockname().

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Sponsored Links


All times are GMT -7. The time now is 04:50 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 (Unregistered)
© 2013 TalkRoot.com