From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) From: arisawa In-Reply-To: Date: Thu, 29 Jan 2015 12:57:24 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] protection against resource exhaustion Topicbox-Message-UUID: 3d5faeb4-ead9-11e9-9d60-3106f5b1d025 Thanks for all. I have looked old source code /sys/src/9/port/proc.c, and found the next = code exists from very old day. lock(&procalloc); for(;;) { if((p =3D procalloc.free) !=3D nil) break; snprint(msg, sizeof msg, "no procs; %s forking", up !=3D nil ? up->text: "kernel"); unlock(&procalloc); resrcwait(msg); lock(&procalloc); } procalloc.free =3D p->qnext; unlock(&procalloc); and rfork(2) says: Rfork will sleep, if necessary, until required process resources = are available. which is also exists from old day. Nevertheless all programs, I believe, in /sys/src are written assuming = rfork() may return -l: switch(rfork(=E2=80=A6.)){ case -1: =E2=80=A6 } Any merit?