Date: Wed, 31 May 2006 11:24:19 +0200 From: Ulf Lilleengen <lulf@stud.ntnu.no> To: "Rick C. Petty" <rick-freebsd@kiwi-computer.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Formatting time in kernel Message-ID: <20060531092419.GA23593@stud.ntnu.no> In-Reply-To: <20060531001745.GA43622@megan.kiwi-computer.com> References: <20060526205917.GA12965@stud.ntnu.no> <20060531001745.GA43622@megan.kiwi-computer.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060531092419.GA23593>