From owner-freebsd-questions@FreeBSD.ORG Wed Oct 27 22:09:47 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9DACD16A4CE for ; Wed, 27 Oct 2004 22:09:47 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4556343D1D for ; Wed, 27 Oct 2004 22:09:47 +0000 (GMT) (envelope-from david.jenkins@gmail.com) Received: by wproxy.gmail.com with SMTP id 65so428719wri for ; Wed, 27 Oct 2004 15:09:46 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=O8FqX+xZIxAeZ6ZHMTGxtA8qROayvh/6gF+nYBZsU7D8luz5qXNzpFMEH+6wm2cjNT8+wsMtgWAs2H6SkuXILA/4d8f2xNHQLYFKZONgWtcvSTAqFkUbaN3W+KTztLlvLxGL12F+AC05dP6NLvLQ1WIxdHeg48gAD9kXRtLo1RU= Received: by 10.38.76.80 with SMTP id y80mr1038796rna; Wed, 27 Oct 2004 15:09:46 -0700 (PDT) Received: by 10.38.208.41 with HTTP; Wed, 27 Oct 2004 15:09:46 -0700 (PDT) Message-ID: <9395922d04102715094411ac2d@mail.gmail.com> Date: Wed, 27 Oct 2004 23:09:46 +0100 From: David Jenkins To: FreeBSD Questions Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: getloadavg and source for /usr/bin/uptime X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: David Jenkins List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2004 22:09:47 -0000 Hi, I'm running 5.3-RC1 and am trying to develop a (VERY) simple C based tool to retrieve the system loads (as reported by uptime). NB - I don't want to pipe uptime into awk or use a perl script etc, I'd much prefer it to be C based. As I'm dreadful at C I thought I'd look at the source for the uptime program as that uses getloadavg from what I gather and modify it to suit my needs. The problem is, and I'm obviously being a bit stupid here, I can't find the sources for it ... ? I've grep'd and searched the entire source tree a good few times but can't seem to find it. I've googled for things like "freebsd uptime" or "freebsd uptime.c" as well as many others but have had no joy, and have read what I believe to be the relevant manpages. If any knows where it's hiding (or why it's not there) I'd be very grateful if you could share it with me. Many thanks, David