From owner-freebsd-questions Thu Jul 2 02:01:40 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA11383 for freebsd-questions-outgoing; Thu, 2 Jul 1998 02:01:40 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from iconmail.bellatlantic.net (iconmail.bellatlantic.net [199.173.162.30]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA11369 for ; Thu, 2 Jul 1998 02:01:34 -0700 (PDT) (envelope-from dmm125@bellatlantic.net) Received: from bellatlantic.net (client201-122-36.bellatlantic.net [151.201.122.36]) by iconmail.bellatlantic.net (IConNet Sendmail) with ESMTP id FAA05638; Thu, 2 Jul 1998 05:00:04 -0400 (EDT) Message-ID: <359B13F0.82AF7F1B@bellatlantic.net> Date: Thu, 02 Jul 1998 05:00:32 +0000 From: Donn Miller X-Mailer: Mozilla 4.05 [en] (X11; I; FreeBSD 2.2.6-RELEASE i386) MIME-Version: 1.0 To: Adrian Filipi-Martin CC: questions@FreeBSD.ORG Subject: Re: FreeBSD equiv. of /proc/loadavg References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG ADRIAN Filipi-Martin wrote: > > On Thu, 2 Jul 1998, Donn Miller wrote: > > > > > Am looking for the FreeBSD equivalent of the Linux file /proc/loadavg. I > > want to use this instead of using getloadavg(). > > > > I'm also looking for the equivalent of these. This is what I think they > > are: > > > > Linux FreeBSD > > ===== ======= > > /proc/meminfo /proc/curproc/mem > > /proc/stat /proc/curproc/status > > /proc/loadavg ??? (probably /kernel) > > /proc/uptime ??? (probably /kernel) > > Hope I'm not missing the point, but what's wrong with uptime(1)? > There has been talk of a /kernelfs, but I doubt that will be happening > anytime soon. > Well, I'm was looking to port some Linux apps that make system calls like: FILE *fp_meminfo; FILE *fp_stat; FILE *fp_loadavg; /*.....*/ fp = fopen("/proc/uptime", "r"); fp_meminfo = fopen("/proc/meminfo", "r"); fp_loadavg = fopen("/proc/loadavg", "r"); fp_stat = fopen("/proc/stat", "r"); And I needed some FreeBSD equivalent files to open in /proc. An example would be fp_stat = fopen("/proc/stat", "r"); /*Linux*/ fp_stat = fopen("/proc/curproc/status", "r"); /*FreeBSD*/ And the /proc/uptime probably has no equivalent /proc entry in FreeBSD, so would likely have to use /kernel instead. Another example is the line: fp_meminfo = fopen("/proc/meminfo", "r"); /*Linux*/ fp_meminfo = fopen("/proc/curproc/mem", "r"); /*FreeBSD*/ etc. I just needed some FreeBSD equivalent files for porting from Linux to FreeBSD, like for wine, some load ave. utilities in WindowMaker, etc. --Donn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message