From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 20 05:39:10 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BE79106564A for ; Sat, 20 Dec 2008 05:39:10 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outZ.internet-mail-service.net (outz.internet-mail-service.net [216.240.47.249]) by mx1.freebsd.org (Postfix) with ESMTP id 5E77A8FC13 for ; Sat, 20 Dec 2008 05:39:10 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 0010F24C7; Fri, 19 Dec 2008 21:39:09 -0800 (PST) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id B53E42D6017; Fri, 19 Dec 2008 21:39:09 -0800 (PST) Message-ID: <494C8508.2020000@elischer.org> Date: Fri, 19 Dec 2008 21:39:20 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: Ferner Cilloniz References: <1229726360.5614.15.camel@mobiliare.Belkin> <494C8246.3020703@elischer.org> <1229729326.5614.16.camel@mobiliare.Belkin> In-Reply-To: <1229729326.5614.16.camel@mobiliare.Belkin> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: adding proc to allproc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 05:39:10 -0000 Ferner Cilloniz wrote: > When i run the code from a KLD it hangs the system. No reboot occurs > however, it just hangs there. well, firstly you have no locking though that would probably let you get away with it most times. Where does the process come from in the first place? It sounds like you are making a circular list somewhere or somehow... have you tried going into ddb? > > > On Fri, 2008-12-19 at 21:27 -0800, Julian Elischer wrote: >> Ferner Cilloniz wrote: >>> Hello everyone. >>> >>> I am playing with freebsd and just learning some things about the >>> FreeBSD kernel. >>> >>> So for my first quest i am placing random processes from the allproc >>> list into a list of my own and trying to add them back into allproc >>> >>> I have pasted the code below. >>> >>> ----------------------------------------------------------------------- >>> struct proc *p = a process from my own list; >>> if( p != NULL && (p->p_state == PRS_NEW || p->p_state == PRS_NORMAL) ){ >>> LIST_INSERT_HEAD(&allproc, p, p_list); >>> } >>> ----------------------------------------------------------------------- >> >>> _______________________________________________ >>> freebsd-hackers@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >>> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"