*BSD News Article 69724


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!news.ysu.edu!news.cps.udayton.edu!news.engr.udayton.edu!blackbird.afit.af.mil!zombie.ncsc.mil!news.mathworks.com!uunet!in2.uu.net!news.voicenet.com!news2.noc.netcom.net!noc.netcom.net!netcom.net.uk!netcom.com!kientzle
From: kientzle@netcom.com
Subject: Re: HOW DO I FIGURE OUT HOW MANY PROCESSES ARE RUNNING?
Message-ID: <kientzleDs6F91.Jt3@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <4octq6$rkp@ucsbuxb.ucsb.edu>
Date: Wed, 29 May 1996 17:00:37 GMT
Lines: 24
Sender: kientzle@netcom22.netcom.com

Try:

man 2 getrlimit   -- to find out how many processes your User ID is permitted

If you know how to read a directory, you can skim through /proc
to count how many processes are owned by this UID already.
(do `ls -l /proc' to  see the info it gives, `man procfs' for
details on /proc).

Also look at `man csh' for info on the `limit' built-in command.

                                - Tim Kientzle

In article <4octq6$rkp@ucsbuxb.ucsb.edu>,
Loren Koss <loren@mcl.ucsb.edu> wrote:
>I am trying to write a program that forks a bunch of times, but it needs 
>to know how many processes are already running so it doesn't use em all 
>up.  Any suggestions?
>
>Loren
>
>