Date: Thu, 02 Jul 1998 05:00:32 +0000 From: Donn Miller <dmm125@bellatlantic.net> To: Adrian Filipi-Martin <adrian@ubergeeks.com> Cc: questions@FreeBSD.ORG Subject: Re: FreeBSD equiv. of /proc/loadavg Message-ID: <359B13F0.82AF7F1B@bellatlantic.net> References: <Pine.BSF.3.96.980702042919.7966A-100000@lorax.ubergeeks.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?359B13F0.82AF7F1B>
