From owner-freebsd-emulation Thu Nov 2 13:54:57 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from imb.uq.edu.au (mail.imb.uq.edu.au [130.102.118.20]) by hub.freebsd.org (Postfix) with ESMTP id A15C737B4C5 for ; Thu, 2 Nov 2000 13:54:50 -0800 (PST) Received: from [130.102.4.80] ([130.102.4.80] verified) by imb.uq.edu.au (CommuniGate Pro SMTP 3.3) with SMTP id 320085 for freebsd-emulation@freebsd.org; Fri, 03 Nov 2000 07:56:50 +1000 X-Sender: Vthomas@pop3.vthrc.uq.edu.au Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Fri, 3 Nov 2000 07:54:46 +1000 To: freebsd-emulation@freebsd.org From: D.Thomas@imb.uq.edu.au (Danny Thomas) Subject: Re: linux sysinfo() Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >I've just found a man page on it, its a pretty simple function: > > sysinfo returns information in the following structure: > > struct sysinfo { > long uptime; /* Seconds since boot */ > unsigned long loads[3]; /* 1, 5, and 15 minute load >average >s */ > unsigned long totalram; /* Total usable main memory size >*/ > unsigned long freeram; /* Available memory size */ > unsigned long sharedram; /* Amount of shared memory */ > unsigned long bufferram; /* Memory used by buffers */ > unsigned long totalswap; /* Total swap space size */ > unsigned long freeswap; /* swap space still available */ > unsigned short procs; /* Number of current processes */ > char _f[22]; /* Pads structure to 64 bytes */ > }; > > >Which FreeBSD has no equivilances for. All I can see if the poking about in >kernel memory. Does anyone have any pointers on how to do such a thing from >kernel space? Thanks! (This function looks like it would be a useful FreeBSD >function as well!) rather than add system calls and ;ater find you didn't quite export enough values, you're better off making this info available through sysctl, which is an extensible interface specifically for grokking kernel info. The same info can be exported through a filesystem for those who prefer that. cheers, Danny Thomas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message