From owner-freebsd-hackers Wed Oct 1 03:19:44 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id DAA04455 for hackers-outgoing; Wed, 1 Oct 1997 03:19:44 -0700 (PDT) Received: from thorin.hway.ru (root@thorin.hway.ru [194.87.58.130]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id DAA04432 for ; Wed, 1 Oct 1997 03:19:01 -0700 (PDT) Received: from flash.intech.hway.ru (flash.intech.hway.ru [192.168.1.16]) by thorin.hway.ru (8.8.6/8.8.6) with ESMTP id OAA25674 for ; Wed, 1 Oct 1997 14:16:41 +0400 (MSD) Message-Id: <199710011016.OAA25674@thorin.hway.ru> From: "Alexander V. Tischenko" To: Subject: Re: Recursive fork() and different fbsd's Date: Wed, 1 Oct 1997 14:16:10 +0400 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1161 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_01BCCE74.9100ACC0" Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk This is a multi-part message in MIME format. ------=_NextPart_000_01BCCE74.9100ACC0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit I tried a bit modified sample and got right into resource limit. Don't know how you can count proc's with your source. Alexander V. Tischenko ---------- > From: Eugeny Kuzakov > To: hackers@FreeBSD.ORG > Subject: Recursive fork() and different fbsd's > Date: 29 сентября 1997 г. 10:39 > > Hi, All ! > > > I run this program on: > > 1. 3.0-970807-SNAP - no hangs, fork always rerurns 0. But process count > does not grow.. > 2. 2.1.7.1-RELEASE - more swap, more processes, not hangs really, but > ....Works only > router...Any applications stoped... > > On linux, when will process count more than same constant, fork returns > -1. > > Any comments ? > > -- > Best wishes, Eugeny Kuzakov > Laboratory 321 ( Omsk, Russia ) > http://www.lab321.ru/~kev > kev@lab321.ru ------=_NextPart_000_01BCCE74.9100ACC0 Content-Type: application/octet-stream; name="ncrash.c" Content-Transfer-Encoding: 7bit Content-Description: ncrash.c (C ) Content-Disposition: attachment; filename="ncrash.c" #include #include #include #include #include #include int main () { pid_t pid; register int count = 0; while (1) { if ((pid = fork()) == (pid_t)-1) { printf("\nCollected: %d boys, return is %d\n", count, errno); fflush(stdout); signal(SIGINT, SIG_IGN); killpg(0, SIGINT); exit(0); } if (pid == 0) { /* Do nothing loop! */ while (1) pause(); } else { printf("."); count++; } } } ------=_NextPart_000_01BCCE74.9100ACC0--