LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 03-29-2002, 01:21 PM   #1
ghe1
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!!!!!!!!!!!
*********************CODE*************************
**
#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));

return(0);
}

***********************CODE***********************
**
 
Old 04-01-2002, 08:38 AM   #2
ghe1
LQ Newbie
 
Registered: Mar 2002
Posts: 2

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


Reply


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 05:48 AM
No SWAP but all RAM!! hari_seldon99 Linux - General 3 01-13-2004 11:48 AM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 08:58 PM
RAM/swap memory - strange readings mesonite Linux - Hardware 0 01-02-2003 01:01 PM
Swap and RAM ? mikeshn Linux - General 1 09-18-2002 10:33 PM


All times are GMT -5. The time now is 10:32 PM.

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