"Robert G. Brown" wrote:
> 
> On Wed, 14 Apr 1999, Dick Balaska wrote:
> 
> > Dudes and/or Dudettes:
> >
> > I know i've seen (in normal user space) a call to determine the number
> > of CPUs in a system but i can't find it now that i need it.
> 
> I'm not sure what you are asking for here but maybe somebody does and
> will respond.  One can certainly find out by e.g. cat /proc/cpuinfo and
> looking or passing the output through a filter to count -- or did you
> mean from inside a program via a systems call?

Sorry yes, via a system call.  I had thought of 
fopen("/proc/cpuinfo") | !strcmp("processor", blah) | wc
but i was looking for something more Posix/gnu-centric 
like getnumprocessors()

> > This is more of a networking question:
> > There are times when i fail to call my (user space) terminate handler
> > and give back my listen socket.  Is there any way to recover that system
> > resource without rebooting?  (I usually lose it when i restart the program
> > in ddd without a `signal SIGINT` first)
> 
> They don't timeout eventually when ddd goes away?  Strange... what does
> netstat show?

It shows a listen socket on *:2270 , same as when the program is running.
I've never seen an orphan listen clean itself up in 10 years of *NIXing.
It did occur to me that i've also never seen Apache say something like:
"Failed to bind to port 80, EADDRINUSE".  So i did a kill -9 on 
apache and was surprised that there is no orphan listen on port 80.
Obviously, i'm doing something wrong.  I guess i need to study the
apache source some more.


> 
>    rgb
> 
> Robert G. Brown                        http://www.phy.duke.edu/~rgb/
> Duke University Dept. of Physics, Box 90305
> Durham, N.C. 27708-0305
> Phone: 1-919-660-2567  Fax: 919-660-2525     email:[EMAIL PROTECTED]
> 
> -
> Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
> To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]


-- 
           _,--"
dik        `-._        ________-_______        "----
       _----'--'--------------------------------'--'----_
      //_| | \        [EMAIL PROTECTED]          / | |_\\
     (_____|_|__= Waterbury CT +1.203.757.6994 =__|_|_____)
     _\_____=___   http://www.buckosoft.com     ___=_____/_
       \/-(o)-~~-(o)-~~-(o)-`------'-(o)-~~-(o)-~~-(o)-\/
Early Klingon Poetry:
Wustl, Wustl, ERR RIP MIT BOOT, BIND Wustl
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]

Reply via email to