From owner-freebsd-questions Mon Nov 3 18:28:10 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id SAA26841 for questions-outgoing; Mon, 3 Nov 1997 18:28:10 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from srv.net (snake.srv.net [199.104.81.3]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id SAA26799; Mon, 3 Nov 1997 18:28:00 -0800 (PST) (envelope-from cmott@srv.net) Received: from darkstar.home ([208.141.171.158]) by srv.net (8.8.5/8.8.5) with SMTP id TAA05526; Mon, 3 Nov 1997 19:27:50 -0700 (MST) Date: Mon, 3 Nov 1997 19:27:17 -0700 (MST) From: Charles Mott X-Sender: cmott@darkstar.home To: Greg Lehey cc: freebsd-questions@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: Maximum number of forked processes In-Reply-To: <19971104113110.52901@lemis.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Tue, 4 Nov 1997, Greg Lehey wrote: > On Mon, Nov 03, 1997 at 04:16:36PM -0700, Charles Mott wrote: > > How does one control the maximum number of forked processes from within > > the parent process? > > I suppose the answer is "manually". setrlimit(2) allows you to limit > the number of processes (=forks) per user, but I don't know of > anything that would limit the number of children of a process. > > > Since this is an elementary question but regards programming, I was > > uncertain whether to send it to -questions or -hackers. > > In fact, I'd think that this is worthy of -hackers, so I'm following > up there. > > Greg Tentatively, I am thinking of incrementing a counter when a process is forked and decrementing it when a SIGCLD is received. However, I don't know what standard procedure is in this matter. Charles Mott