Is there any Mac OS X equivalent header file for sysinfo.h in Linux. I am porting code from Linux to Mac but the structure struct sysinfo is not found.
Edit: ==More info==
In Linux platform I use a Header file <sys/sysinfo.h> which is not found in Mac.
By including the header in Linux I perform following operation:
struct sysinfo s;
sysinfo(&s);
Which in result give me some system related info.
Now as I porting my project from Linux to Mac I want to know is there any similar functionality serve by Mac.
Please help.
Thanks in advance.
The closest equivalent to
sysinfoin Mac OS X issysctl/ MIB. It doesn’t return asysinfostruct directly, but most of the values in that structure are available as sysctl keys. For instance:uptimeis approximated bykern.boottime(although that reflects the actual boot time, not the running time)loadsis available asvm.loadavgtotalram=hw.memsize(in bytes)freeram,sharedram, andbufferramare complicated, as the XNU memory manager works differently from Linux’s. I’m not sure if the closest equivalent values (“active” and “inactive” memory) are exposed.totalswapandfreeswapare reflected invm.swapusage. (But note that OS X allocates swap space dynamically.)procsdoesn’t appear to have any equivalent.totalhighandfreehighare specific to i386 Linux.