From owner-freebsd-current Tue Jan 12 13:57:53 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA16648 for freebsd-current-outgoing; Tue, 12 Jan 1999 13:57:53 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA16643 for ; Tue, 12 Jan 1999 13:57:50 -0800 (PST) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id IAA32727; Wed, 13 Jan 1999 08:57:13 +1100 Date: Wed, 13 Jan 1999 08:57:13 +1100 From: Bruce Evans Message-Id: <199901122157.IAA32727@godzilla.zeta.org.au> To: fenner@parc.xerox.com, jgreco@solaria.sol.net Subject: Re: Lots of arpresolve: can't allocate llinfo for rt Cc: current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >getting a bit irritating... I'm using a serial console and during very >heavy message-spews, the machine seems to "freeze" for seconds at a time >and I'm pretty sure its because the system is waiting for the 9600 baud >console to print. I've got a whole different set of complaints about the >serial console handling, oh well. Try this patch. ttymsg() can fill up the process table for heavy message-spews. Serial console handling is relatively perfect :-). Bruce diff -c2 ttymsg.c~ ttymsg.c *** ttymsg.c~ Sat Jul 25 04:51:47 1998 --- ttymsg.c Sat Jul 25 04:52:56 1998 *************** *** 42,45 **** --- 42,46 ---- #include #include + #include #include #include *************** *** 70,74 **** register int cnt, fd, left, wret; struct iovec localiov[7]; ! int forked = 0; if (iovcnt > sizeof(localiov) / sizeof(localiov[0])) --- 71,92 ---- register int cnt, fd, left, wret; struct iovec localiov[7]; ! int forked = 0, status; ! static pid_t cpid = 0; ! pid_t pid; ! ! /* ! * Don't do anything if a child is still alive. Interleaved ! * output would not be good, and filling the process table with ! * as many children as we can fork before the timeout kills them ! * would be worse. Waiting here also reduces the need to handle ! * SIGCHLD in callers. ! */ ! if (cpid) { ! pid = waitpid(cpid, &status, WNOHANG); ! if (pid == cpid || (pid == -1 || errno == ECHILD)) ! cpid = 0; ! else ! return (NULL); ! } if (iovcnt > sizeof(localiov) / sizeof(localiov[0])) *************** *** 121,125 **** } if (errno == EWOULDBLOCK) { ! int cpid, off = 0; if (forked) { --- 139,143 ---- } if (errno == EWOULDBLOCK) { ! int off = 0; if (forked) { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message