Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-29-2002, 12:21 PM   #1
LQ Newbie
Registered: Mar 2002
Posts: 2

Rep: Reputation: 0
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));


Old 04-01-2002, 07:38 AM   #2
LQ Newbie
Registered: Mar 2002
Posts: 2

Original Poster
Rep: Reputation: 0
Problem has been solved. A line of code needed it works fine.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Use RAM as swap??? oneandoneis2 Linux - General 3 08-19-2004 04:48 AM
No SWAP but all RAM!! hari_seldon99 Linux - General 3 01-13-2004 10:48 AM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 07:58 PM
RAM/swap memory - strange readings mesonite Linux - Hardware 0 01-02-2003 12:01 PM
Swap and RAM ? mikeshn Linux - General 1 09-18-2002 09:33 PM > Forums > Non-*NIX Forums > Programming

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration