-   Programming (
-   -   RAM/Swap Memory Code Errors (

ghe1 03-29-2002 12:21 PM

RAM/Swap Memory Code Errors
I use the following code to determine memory values on a 32bit machine and succeed with no errors and correct data. However, when I try to use this code for a 64bit machine it chokes. The error output is: In function 'sysinfo' undefined reference to '__ia64_syscall'. ANY SUGGESTIONS!!!!!!!!!!!
#include <stdio.h>
#include <linux/unistd.h> /* for _syscallX macros/related stuff */
#include <linux/kernel.h> /* for struct sysinfo */
#include <linux/sys.h>

_syscall1(int, sysinfo, struct sysinfo *, info);

int main(void)
struct sysinfo s_info;
int error;

error = sysinfo(&s_info);
printf("code error = %d\n", error);
printf("RAM: total %d KB/ free %d KB\n"
"Swap: total %d KB/ free %d KB\n",
(s_info.totalram/1024), (s_info.freeram/1024),
(s_info.totalswap/1024), (s_info.freeswap/1024));



ghe1 04-01-2002 07:38 AM

Problem has been solved. A line of code needed it works fine.

All times are GMT -5. The time now is 11:03 PM.