View Issue Details

IDProjectCategoryView StatusLast Update
0031453FPCDocumentationpublic2017-02-28 13:33
ReporterDaniel RozieckiAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.0.1Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0031453: Example for SysInfo is from old version
Descriptionhttp://www.freepascal.org/docs-html/rtl/linux/sysinfo.html

<code pascal>
program Example64;

{ Example to demonstrate the SysInfo function.
  Sysinfo is Linux-only. }

{$ifdef Linux}
Uses Linux;

Function Mb(L : Longint) : longint;

begin
  Mb:=L div (1024*1024);
end;

Var Info : TSysInfo;
    D,M,Secs,H : longint;
{$endif}

begin
  {$ifdef Linux}
  If Not SysInfo(Info) then
    Halt(1);
  With Info do
    begin
    D:=Uptime div (3600*24);
    UpTime:=UpTime mod (3600*24);
    h:=uptime div 3600;
    uptime:=uptime mod 3600;
    m:=uptime div 60;
    secs:=uptime mod 60;
    Writeln('Uptime : ',d,'days, ',h,' hours, ',m,' min, ',secs,' s.');
    Writeln('Loads : ',Loads[1],'/',Loads[2],'/',Loads[3]);
    Writeln('Total Ram : ',Mb(totalram),'Mb.');
    Writeln('Free Ram : ',Mb(freeram),'Mb.');
    Writeln('Shared Ram : ',Mb(sharedram),'Mb.');
    Writeln('Buffer Ram : ',Mb(bufferram),'Mb.');
    Writeln('Total Swap : ',Mb(totalswap),'Mb.');
    Writeln('Free Swap : ',Mb(freeswap),'Mb.');
    end;
  {$endif}
end.
</code>

SysInfo doesn't return boolean now, and using PSysInfo, no TSysInfo. And donesn't work at all, but this will be next issue.
TagsNo tags attached.
Fixed in Revision1400
FPCOldBugId
FPCTarget
Attached Files

Activities

Michael Van Canneyt

2017-02-28 13:33

administrator   ~0098509

Fixed example, thanks for reporting.

Issue History

Date Modified Username Field Change
2017-02-28 11:59 Daniel Roziecki New Issue
2017-02-28 11:59 Daniel Roziecki Status new => assigned
2017-02-28 11:59 Daniel Roziecki Assigned To => Michael Van Canneyt
2017-02-28 13:33 Michael Van Canneyt Fixed in Revision => 1400
2017-02-28 13:33 Michael Van Canneyt Note Added: 0098509
2017-02-28 13:33 Michael Van Canneyt Status assigned => resolved
2017-02-28 13:33 Michael Van Canneyt Fixed in Version => 3.1.1
2017-02-28 13:33 Michael Van Canneyt Resolution open => fixed
2017-02-28 13:33 Michael Van Canneyt Target Version => 3.2.0