From: "Jose Luu" <jluu@mainsoft.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] call to sysinfo in ia32 mode trashes the stack
Date: Fri, 11 May 2001 20:57:17 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590693005569@msgid-missing> (raw)
I noticed the above problem using kernel 2.4.1. Is it solved in 2.4.4 ?
Thanks
Jose
------------------------------ test
program ------------------------------------
#include <stdio.h>
#include <sys/sysinfo.h>
typedef struct {
unsigned int dwTotalPhys ;
unsigned int dwAvailPhys ;
unsigned int dwTotalPageFile ;
unsigned int dwAvailPageFile ;
} MEMORYSTATUS;
int Memory(MEMORYSTATUS *lpmstMemStat)
{
#if defined(AIR_BAG)
char szBuffer[1000];
#endif
struct sysinfo info;
if(sysinfo(&info))
return 1;
lpmstMemStat->dwTotalPhys = info.totalram;
lpmstMemStat->dwAvailPhys = info.freeram;
lpmstMemStat->dwTotalPageFile = info.totalswap;
lpmstMemStat->dwAvailPageFile = info.freeswap;
return 0;
}
main ()
{
MEMORYSTATUS mem;
if (Memory(&mem) != 0) {
fprintf(stderr,"error\n");
}
fprintf(stderr,"Total Phys %u\n",mem.dwTotalPhys);
fprintf(stderr,"Avail Phys %u\n",mem.dwAvailPhys);
fprintf(stderr,"Total PageFile %u\n",mem.dwTotalPageFile);
fprintf(stderr,"Avail PageFile %u\n",mem.dwAvailPageFile);
}
next reply other threads:[~2001-05-11 20:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-11 20:57 Jose Luu [this message]
2001-05-11 21:12 ` [Linux-ia64] call to sysinfo in ia32 mode trashes the stack Don Dugger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-ia64-105590693005569@msgid-missing \
--to=jluu@mainsoft.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.