Bläddra i källkod

* 1.9.x fixes

marco 21 år sedan
förälder
incheckning
3e7ae43113
3 ändrade filer med 15 tillägg och 11 borttagningar
  1. 10 6
      docs/linuxex/ex30.pp
  2. 2 2
      docs/linuxex/ex31.pp
  3. 3 3
      docs/linuxex/ex32.pp

+ 10 - 6
docs/linuxex/ex30.pp

@@ -2,31 +2,35 @@ program Example30;
 
 { Program to demonstrate the FSStat function. }
 
-uses linux;
+uses BaseUnix,Unix;
     
 var s : string; 
-    info : statfs;
+    info : tstatfs;
     
 begin
   writeln ('Info about current partition : ');
   s:='.';
   while s<>'q' do 
     begin
-    if not fsstat (s,info) then
+    if statfs (s,info)<>0 then
        begin
-       writeln('Fstat failed. Errno : ',linuxerror);
-       halt (1);
+         writeln('Fstat failed. Errno : ',fpgeterrno);
+         halt (1);
        end;
     writeln;
     writeln ('Result of fsstat on file ''',s,'''.');
-    writeln ('fstype  : ',info.fstype);
+    writeln ('fstype  : ',info.ftype);
     writeln ('bsize   : ',info.bsize);
     writeln ('bfree   : ',info.bfree);
     writeln ('bavail  : ',info.bavail);
     writeln ('files   : ',info.files);
     writeln ('ffree   : ',info.ffree);
+    {$ifdef FreeBSD}
+    writeln ('fsid    : ',info.fsid[0]);
+    {$else}
     writeln ('fsid    : ',info.fsid);
     writeln ('Namelen : ',info.namelen);
+    {$endif}
     write ('Type name of file to do fsstat. (q quits) :');
     readln (s)
     end;

+ 2 - 2
docs/linuxex/ex31.pp

@@ -2,12 +2,12 @@ program Example31;
 
 { Program to demonstrate the Dup function. }
 
-uses linux;
+uses baseunix;
 
 var f : text;
 
 begin
-  if not dup (output,f) then 
+  if  fpdup (output,f)<>0 then 
     Writeln ('Dup Failed !');
   writeln ('This is written to stdout.');
   writeln (f,'This is written to the dup file, and flushed');flush(f);

+ 3 - 3
docs/linuxex/ex32.pp

@@ -2,7 +2,7 @@ program Example31;
 
 { Program to demonstrate the Dup function. }
 
-uses linux;
+uses BaseUnix;
 
 var f : text;
     i : longint;
@@ -11,12 +11,12 @@ begin
   Assign (f,'text.txt');
   Rewrite (F);
   For i:=1 to 10 do writeln (F,'Line : ',i);
-  if not dup2 (output,f) then 
+  if fpdup2 (output,f)<>0 then 
     Writeln ('Dup2 Failed !');
   writeln ('This is written to stdout.');
   writeln (f,'This is written to the dup file, and flushed');
   flush(f);
   writeln;
   { Remove file. Comment this if you want to check flushing.}
-  Unlink ('text.txt');
+  fpUnlink ('text.txt');
 end.