From owner-freebsd-hackers@FreeBSD.ORG Wed May 31 09:24:01 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 20DC316A443 for ; Wed, 31 May 2006 09:23:59 +0000 (UTC) (envelope-from lulf@stud.ntnu.no) Received: from signal.itea.ntnu.no (signal.itea.ntnu.no [129.241.190.231]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CF1043D70 for ; Wed, 31 May 2006 09:23:53 +0000 (GMT) (envelope-from lulf@stud.ntnu.no) Received: from localhost (localhost [127.0.0.1]) by signal.itea.ntnu.no (Postfix) with ESMTP id C549933A04; Wed, 31 May 2006 11:23:52 +0200 (CEST) Received: from gaupe.stud.ntnu.no (gaupe.stud.ntnu.no [129.241.56.184]) by signal.itea.ntnu.no (Postfix) with ESMTP; Wed, 31 May 2006 11:23:52 +0200 (CEST) Received: by gaupe.stud.ntnu.no (Postfix, from userid 2312) id 3986FCFFFA; Wed, 31 May 2006 11:24:19 +0200 (CEST) Date: Wed, 31 May 2006 11:24:19 +0200 From: Ulf Lilleengen To: "Rick C. Petty" Message-ID: <20060531092419.GA23593@stud.ntnu.no> References: <20060526205917.GA12965@stud.ntnu.no> <20060531001745.GA43622@megan.kiwi-computer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060531001745.GA43622@megan.kiwi-computer.com> User-Agent: Mutt/1.5.9i X-Content-Scanned: with sophos and spamassassin at mailgw.ntnu.no. Cc: freebsd-hackers@freebsd.org Subject: Re: Formatting time in kernel 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: Wed, 31 May 2006 09:24:02 -0000 On Tue, May 30, 2006 at 07:17:45PM -0500, Rick C. Petty wrote: > On Fri, May 26, 2006 at 10:59:18PM +0200, Ulf Lilleengen wrote: > > > > I've been looking through the kernel code the past few days, but I have not found > > what I'm looking for, which is a way to format "struct timeval" for output > > in the same matter as the ctime(3) in the standard libc. I keep thinking how this part of the code > > should not be in kernel because of this, but things will be vastly more > > complicated if not because of the whole gvinum structure. (This is for use in > > the gvinum dumpconfig option I'm working on, and I'm not sure if it's really that important > > showing the creation time, but that's a different discussion). > > Why can't you just pass the struct timeval up to the userland tool and have > gvinum call ctime? Or at the very least pass up a time_t. Maybe go the > other route and pass up the whole gv_label (I'm assuming this is the > structure you're talking about).. /sbin/gvinum already has to include > vinum/geom_vinum_var.h so it's not like it's very kernel-specific (e.g. > #ifdef KERNEL). I personally feel that stuff like this belongs in userland > not kernel, parsing or converting times, etc. I agree, but currently the output list, printconfig and those are heavily formatted in the kernel, so I was just looking for the easy way out as a temporate solution. However, I intend to pass the whole configuration to userland, not just the label, and let the tools format it there, as I see to this point see no reason for it to be in the kernel. -- Mvh Ulf Lilleengen