[fpc-devel] Linux.SysInfo Problem

Marco van de Voort marcov at stack.nl
Fri Mar 19 15:55:46 CET 2010


In our previous episode, Henry Vermaak said:
> On 19 March 2010 14:31, Andrew Brunner <andrew.t.brunner at gmail.com> wrote:
> >
> > Anyone with more SysInfo details on what it may have been replaced
> > with? ?Updated calling conventions?
> 
> Can you please write a small c app that returns all the sysinfo
> values?  Then we can figure out if the problem is with fpc.

Manpage:

       Since Linux 2.3.23 (i386), 2.3.48 (all architectures) the structure is:

           struct sysinfo {
               long uptime;             /* Seconds since boot */
               unsigned long loads[3];  /* 1, 5, and 15 minute load averages
*/
               unsigned long totalram;  /* Total usable main memory size */
               unsigned long freeram;   /* Available memory size */
               unsigned long sharedram; /* Amount of shared memory */
               unsigned long bufferram; /* Memory used by buffers */
               unsigned long totalswap; /* Total swap space size */
               unsigned long freeswap;  /* swap space still available */
               unsigned short procs;    /* Number of current processes */
               unsigned long totalhigh; /* Total high memory size */
               unsigned long freehigh;  /* Available high memory size */
               unsigned int mem_unit;   /* Memory unit size in bytes */
               char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding for libc5
               */
           };

       and the sizes are given as multiples of mem_unit bytes.

FPC was updated for this in 8330 (somewhere in 2007, probably part of 2.2.4
and 2.4.0)





More information about the fpc-devel mailing list