From owner-freebsd-isp Sun Dec 2 11:38:19 2001 Delivered-To: freebsd-isp@freebsd.org Received: from squall.waterspout.com (squall.waterspout.com [208.13.56.12]) by hub.freebsd.org (Postfix) with ESMTP id A8E4537B417 for ; Sun, 2 Dec 2001 11:38:15 -0800 (PST) Received: by squall.waterspout.com (Postfix, from userid 1050) id 290109B73; Sun, 2 Dec 2001 14:36:27 -0500 (EST) Date: Sun, 2 Dec 2001 14:36:27 -0500 From: Will Andrews To: "Thomas Krause, CI" Cc: freebsd-isp@freebsd.org Subject: Re: How to get uptime? Message-ID: <20011202143626.N56385@squall.waterspout.com> Reply-To: Will Andrews Mail-Followup-To: "Thomas Krause, CI" , freebsd-isp@freebsd.org References: <5.1.0.14.2.20011202200919.00b1a450@mta.webmatic.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.0.14.2.20011202200919.00b1a450@mta.webmatic.de> User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, Dec 02, 2001 at 08:12:14PM +0100, Thomas Krause, CI wrote: > ist there an other way to get the system uptime then the "uptime" command? > I need the uptime for a for a script which is called by mrtg. The output > of "uptime" is difficult to parse, eg: Yes. sysctl kern.boottime. In C, you can get that via syctlbyname(), then get the current time w/ time(), then use difftime() to get the number of seconds difference. -- wca To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message