Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161348AbWI2SNa (ORCPT ); Fri, 29 Sep 2006 14:13:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161323AbWI2SNa (ORCPT ); Fri, 29 Sep 2006 14:13:30 -0400 Received: from emailer.gwdg.de ([134.76.10.24]:34226 "EHLO emailer.gwdg.de") by vger.kernel.org with ESMTP id S1161348AbWI2SN3 (ORCPT ); Fri, 29 Sep 2006 14:13:29 -0400 Date: Fri, 29 Sep 2006 20:12:02 +0200 (MEST) From: Jan Engelhardt To: girish cc: linux-kernel@vger.kernel.org, William Pitcock Subject: Re: [PATCH] include children count, in Threads: field present in /proc//status (take-1) In-Reply-To: Message-ID: References: <0635847A-C149-412C-92B1-A974230381F8@dts.local> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Report: Content analysis: 0.0 points, 6.0 required _SUMMARY_ Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 788 Lines: 27 > > How about this? > > buffer += sprintf(buffer, "Threads:\t%d", num_threads); > if (num_children) > buffer += sprintf(buffer, " Children: %d Total: %d", > num_children, num_threads + num_children); > buffer += sprintf(buffer, "\n"); > No, this: > if (num_children) > buffer += sprintf(buffer, "\nChildren: %d\nTotal: %d", the newlines are essential because then you get _one_ field of information for _each_ call of fgets(). Jan Engelhardt -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/