LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sysinfo on 64bits machine with 32 bits kernels (https://www.linuxquestions.org/questions/linux-newbie-8/sysinfo-on-64bits-machine-with-32-bits-kernels-358151/)

sarunya 08-29-2005 12:06 PM

sysinfo on 64bits machine with 32 bits kernels
 
I tested the simple program
***************************************************************************************************
int main(int argc, char ** argv)
{
struct sysinfo si;

if(sysinfo(&si) != 0) {
perror("ERROR: SYS_INFO FAIL\n");
exit(1);
}

printf("freeram (%luB), freeswap (%luB), totalram (%luB), totalswap (%luB)\n",
si.freeram, si.freeswap, si.totalram, si.totalswap);

return 0;
}

****************************************************************************************************

and run this program on a intellistation 64bits machine
currently there are 12 installed distros (various versions of RedHats and NLDs where each version RedHat and NLD, i have both 32bits version and 64 bits version) on each partitions. (currently with this machine i have partitioned it into 22 (partitions for distro with 6g for each partition), + 1 swap, +2 (/home and /grubsys)


It seemed that when I tested the program on 64bits distro version, the program gives the right memory values from sysinfo. BUT when i tried it on 32 bits distro version, it doesn't.
for 32 bits distro versions, I got :
freeram (489KB), freeswap (635KB), totalram (506KB), totalswap (641KB)

throughout various distros I installed but using 32 bits version of that distro.


seemed that somehow when running the program on 32bits distro it might have only grabs the lower 32 bits of a 64bits machine...
perhaps someone have any idea why this happen???


All times are GMT -5. The time now is 08:10 AM.