IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New The non-syscall method....

Frankly, ls /proc/[0-9]*/fd/* | wc -l would be my\r\nexpedient.

\r\n\r\n

Otherwise, I'd suggest lsof, either as an OS call, or\r\npulling apart the sources to see where it's grabbing its\r\ninformation.

\r\n\r\n

Remember that /proc is system state, and that file\r\noperations on /proc may be the preferred operational method.

\r\n
--\r\n
Karsten M. Self [link|mailto:kmself@ix.netcom.com|kmself@ix.netcom.com]\r\n
[link|http://kmself.home.netcom.com/|http://kmself.home.netcom.com/]\r\n
What part of "gestalt" don't you understand?\r\n
[link|http://twiki.iwethey.org/twiki/bin/view/Main/|TWikIWETHEY] -- an experiment in collective intelligence. Stupidity. Whatever.\r\n
\r\n
   Keep software free.     Oppose the CBDTPA.     Kill S.2048 dead.\r\n[link|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html]\r\n
New Remember that /proc is meant to be a human API
Its contents can and do change dramatically between releases of Linux, and that fact makes it very dangerous to rely on it in code.

Cheers,
Ben
"good ideas and bad code build communities, the other three combinations do not"
- [link|http://archives.real-time.com/pipermail/cocoon-devel/2000-October/003023.html|Stefano Mazzocchi]
New Yabut
The alternative is sysctl, which also changes drastically between releases. In fact, the manpage for sysctl specifically says to use /proc instead.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
     I'm just looking for a count of file descriptors. - (admin) - (11)
         I am thinking either... - (folkert) - (1)
             I need to do this in code, not at a shell prompt... -NT - (admin)
         The non-syscall method.... - (kmself) - (2)
             Remember that /proc is meant to be a human API - (ben_tilly) - (1)
                 Yabut - (admin)
         There is a fast /proc answer - (ben_tilly) - (2)
             That's for the whole system (I think); I need by process -NT - (admin) - (1)
                 It is, my misread. Sorry. -NT - (ben_tilly)
         Note: current solution - (admin)
         Well... I just looked through *lsof* source tree... - (folkert)
         Well, joo find anything else... or give up looking? -NT - (folkert)

Please print clearly.
38 ms