Răsfoiți Sursa

* FSStat to StatFS
* StatFS structure to TStatFS

peter 24 ani în urmă
părinte
comite
13448762f6
6 a modificat fișierele cu 55 adăugiri și 31 ștergeri
  1. 9 6
      rtl/linux/systypes.inc
  2. 9 5
      rtl/linux/unixsysc.inc
  3. 11 7
      rtl/unix/dos.pp
  4. 7 3
      rtl/unix/linux.pp
  5. 11 7
      rtl/unix/sysutils.pp
  6. 8 3
      rtl/unix/unix.pp

+ 9 - 6
rtl/linux/systypes.inc

@@ -58,10 +58,10 @@ type
   end;
   PDir =^TDir;
 
-  dev_t	= word;
+  dev_t = word;
 
   Stat = packed record
-    dev     : dev_t;		
+    dev     : dev_t;
     pad1    : word;
     ino     : longint;
     mode,
@@ -85,7 +85,7 @@ type
   PStat=^Stat;
   TStat=Stat;
 
-  Statfs = packed record
+  TStatfs = packed record
     fstype,            { File system type }
     bsize,             { Optimal block trensfer size }
     blocks,            { Data blocks in system }
@@ -97,8 +97,7 @@ type
     namelen : longint; { Maximum name length in system }
     spare   : array [0..6] of longint; { For later use }
   end;
-  PStatFS=^StatFS;
-  TStatFS=StatFS;
+  PStatFS=^TStatFS;
 
   fdSet=array[0..7] of longint;{=256 bits}
   pfdset=^fdset;
@@ -133,7 +132,11 @@ type
 
 {
   $Log$
-  Revision 1.4  2001-06-02 00:31:30  peter
+  Revision 1.5  2001-06-03 20:19:09  peter
+    * FSStat to StatFS
+    * StatFS structure to TStatFS
+
+  Revision 1.4  2001/06/02 00:31:30  peter
     * merge unix updates from the 1.0 branch, mostly related to the
       solaris target
 

+ 9 - 5
rtl/linux/unixsysc.inc

@@ -498,7 +498,7 @@ end;
 
 
 
-Function FSStat(Path:Pathstr;Var Info:statfs):Boolean;
+Function StatFS(Path:Pathstr;Var Info:tstatfs):Boolean;
 {
   Get all information on a fileSystem, and return it in Info.
   Path is the name of a file/directory on the fileSystem you wish to
@@ -510,13 +510,13 @@ begin
   path:=path+#0;
   regs.reg2:=longint(@path[1]);
   regs.reg3:=longint(@Info);
-  FSStat:=(SysCall(SysCall_nr_statfs,regs)=0);
+  StatFS:=(SysCall(SysCall_nr_statfs,regs)=0);
   LinuxError:=errno;
 end;
 
 
 
-Function FSStat(Fd:Longint;Var Info:statfs):Boolean;
+Function StatFS(Fd:Longint;Var Info:tstatfs):Boolean;
 {
   Get all information on a fileSystem, and return it in Info.
   Fd is the file descriptor of a file/directory on the fileSystem
@@ -527,7 +527,7 @@ var
 begin
   regs.reg2:=Fd;
   regs.reg3:=longint(@Info);
-  FSStat:=(SysCall(SysCall_nr_fstatfs,regs)=0);
+  StatFS:=(SysCall(SysCall_nr_fstatfs,regs)=0);
   LinuxError:=errno;
 end;
 
@@ -927,7 +927,11 @@ end;
 
 {
   $Log$
-  Revision 1.2  2001-06-02 00:31:30  peter
+  Revision 1.3  2001-06-03 20:19:09  peter
+    * FSStat to StatFS
+    * StatFS structure to TStatFS
+
+  Revision 1.2  2001/06/02 00:31:30  peter
     * merge unix updates from the 1.0 branch, mostly related to the
       solaris target
 

+ 11 - 7
rtl/unix/dos.pp

@@ -395,10 +395,10 @@ end;
 
 Function DiskFree(Drive: Byte): int64;
 var
-  fs : statfs;
+  fs : tstatfs;
 Begin
-  if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and fsstat(StrPas(fixdrivestr[drive]),fs)) or
-     ((not (drivestr[Drive]=nil)) and fsstat(StrPas(drivestr[drive]),fs)) then
+  if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and StatFS(StrPas(fixdrivestr[drive]),fs)) or
+     ((not (drivestr[Drive]=nil)) and StatFS(StrPas(drivestr[drive]),fs)) then
    Diskfree:=int64(fs.bavail)*int64(fs.bsize)
   else
    Diskfree:=-1;
@@ -408,10 +408,10 @@ End;
 
 Function DiskSize(Drive: Byte): int64;
 var
-  fs : statfs;
+  fs : tstatfs;
 Begin
-  if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and fsstat(StrPas(fixdrivestr[drive]),fs)) or
-     ((not (drivestr[Drive]=nil)) and fsstat(StrPas(drivestr[drive]),fs)) then
+  if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and StatFS(StrPas(fixdrivestr[drive]),fs)) or
+     ((not (drivestr[Drive]=nil)) and StatFS(StrPas(drivestr[drive]),fs)) then
    DiskSize:=int64(fs.blocks)*int64(fs.bsize)
   else
    DiskSize:=-1;
@@ -877,7 +877,11 @@ End.
 
 {
   $Log$
-  Revision 1.5  2001-06-02 00:31:30  peter
+  Revision 1.6  2001-06-03 20:19:09  peter
+    * FSStat to StatFS
+    * StatFS structure to TStatFS
+
+  Revision 1.5  2001/06/02 00:31:30  peter
     * merge unix updates from the 1.0 branch, mostly related to the
       solaris target
 

+ 7 - 3
rtl/unix/linux.pp

@@ -290,8 +290,8 @@ Function  FStat(Fd:longint;Var Info:stat):Boolean;
 Function  FStat(var F:Text;Var Info:stat):Boolean;
 Function  FStat(var F:File;Var Info:stat):Boolean;
 Function  Lstat(Filename: PathStr;var Info:stat):Boolean;
-Function  FSStat(Path:Pathstr;Var Info:statfs):Boolean;
-Function  FSStat(Fd: Longint;Var Info:statfs):Boolean;
+Function  StatFS(Path:Pathstr;Var Info:tstatfs):Boolean;
+Function  StatFS(Fd: Longint;Var Info:tstatfs):Boolean;
 {$ifdef bsd}
 Function  Fcntl(Fd:longint;Cmd:longint):longint;
 Procedure Fcntl(Fd:longint;Cmd:longint;Arg:Longint);
@@ -2892,7 +2892,11 @@ End.
 
 {
   $Log$
-  Revision 1.9  2001-06-02 00:31:30  peter
+  Revision 1.10  2001-06-03 20:19:09  peter
+    * FSStat to StatFS
+    * StatFS structure to TStatFS
+
+  Revision 1.9  2001/06/02 00:31:30  peter
     * merge unix updates from the 1.0 branch, mostly related to the
       solaris target
 

+ 11 - 7
rtl/unix/sysutils.pp

@@ -330,10 +330,10 @@ end;
 
 Function DiskFree(Drive: Byte): int64;
 var
-  fs : statfs;
+  fs : tstatfs;
 Begin
-  if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and fsstat(StrPas(fixdrivestr[drive]),fs)) or
-     ((not (drivestr[Drive]=nil)) and fsstat(StrPas(drivestr[drive]),fs)) then
+  if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and statfs(StrPas(fixdrivestr[drive]),fs)) or
+     ((not (drivestr[Drive]=nil)) and statfs(StrPas(drivestr[drive]),fs)) then
    Diskfree:=int64(fs.bavail)*int64(fs.bsize)
   else
    Diskfree:=-1;
@@ -343,10 +343,10 @@ End;
 
 Function DiskSize(Drive: Byte): int64;
 var
-  fs : statfs;
+  fs : tstatfs;
 Begin
-  if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and fsstat(StrPas(fixdrivestr[drive]),fs)) or
-     ((not (drivestr[Drive]=nil)) and fsstat(StrPas(drivestr[drive]),fs)) then
+  if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and statfs(StrPas(fixdrivestr[drive]),fs)) or
+     ((not (drivestr[Drive]=nil)) and statfs(StrPas(drivestr[drive]),fs)) then
    DiskSize:=int64(fs.blocks)*int64(fs.bsize)
   else
    DiskSize:=-1;
@@ -465,7 +465,11 @@ end.
 {
 
   $Log$
-  Revision 1.9  2001-06-03 15:18:01  peter
+  Revision 1.10  2001-06-03 20:19:09  peter
+    * FSStat to StatFS
+    * StatFS structure to TStatFS
+
+  Revision 1.9  2001/06/03 15:18:01  peter
     * eoutofmemory and einvalidpointer fix
 
   Revision 1.8  2001/02/20 22:19:38  peter

+ 8 - 3
rtl/unix/unix.pp

@@ -290,8 +290,8 @@ Function  FStat(Fd:longint;Var Info:stat):Boolean;
 Function  FStat(var F:Text;Var Info:stat):Boolean;
 Function  FStat(var F:File;Var Info:stat):Boolean;
 Function  Lstat(Filename: PathStr;var Info:stat):Boolean;
-Function  FSStat(Path:Pathstr;Var Info:statfs):Boolean;
-Function  FSStat(Fd: Longint;Var Info:statfs):Boolean;
+Function  StatFS(Path:Pathstr;Var Info:tstatfs):Boolean;
+Function  StatFS(Fd: Longint;Var Info:tstatfs):Boolean;
 {$ifdef bsd}
 Function  Fcntl(Fd:longint;Cmd:longint):longint;
 Procedure Fcntl(Fd:longint;Cmd:longint;Arg:Longint);
@@ -949,6 +949,7 @@ begin
    LinuxError:=Errno;
 end;
 
+
 {$ifdef BSD}
 Function Fcntl(Fd:longint;Cmd:longint):longint;
 {
@@ -2892,7 +2893,11 @@ End.
 
 {
   $Log$
-  Revision 1.8  2001-06-02 00:31:31  peter
+  Revision 1.9  2001-06-03 20:19:09  peter
+    * FSStat to StatFS
+    * StatFS structure to TStatFS
+
+  Revision 1.8  2001/06/02 00:31:31  peter
     * merge unix updates from the 1.0 branch, mostly related to the
       solaris target