Browse Source

* use statvfs/fstatvfs on solaris instead of statfs/fstatfs, because the
latter are deprecated
* replaced (wrong) statfs record definition with the definition of statvfs

git-svn-id: trunk@12815 -

Jonas Maebe 16 years ago
parent
commit
fba565d666
2 changed files with 25 additions and 12 deletions
  1. 19 6
      rtl/solaris/ptypes.inc
  2. 6 6
      rtl/unix/unxdeclh.inc

+ 19 - 6
rtl/solaris/ptypes.inc

@@ -158,17 +158,30 @@ Type
   ptimespec   = ^timespec;
   TTimeSpec   = timespec;
 
+{$ifdef cpu64}
+  fsblkcnt_t = culonglong;
+{$else}
+  fsblkcnt_t = culong;
+{$endif}
+
+  { actually stavfs, statfs is deprecated on Solaris }
   TStatfs = packed record
-    fstype,            { File system type }
-    bsize   : cint;    { Optimal block trensfer size }
+    bsize,             { fundamental file system block size  }
+    frsize  : culong;  { fragment size }
     blocks,            { Data blocks in system }
     bfree,             { free blocks in system }
     bavail,            { Available free blocks to non-root users }
     files,             { File nodes in system }
-    ffree   : clong;             { Free file nodes in system }
-    fsid    : array[0..1] of cint;          { File system ID }
-    namelen : clong; { Maximum name length in system }
-    spare   : array [0..5] of clong; { For later use }
+    ffree,             { Free file nodes in system }
+    favail  : fsblkcnt_t;   { free nodes avail to non-superuser}
+    fsid    : clong;   { File system ID }
+    basetype: array [0..15] of char; { null-terminated fs type name }
+    flag    : culong;  { bit-mask of flags }
+    namelen : culong; { Maximum name length in system }
+    fstr    : array[0..31] of char; { fs-specific string }
+{$ifndef cpu64}
+    spare   : array[0..15] of clong; { reserved for future use }
+{$endif}
   end;
   PStatFS=^TStatFS;
 

+ 6 - 6
rtl/unix/unxdeclh.inc

@@ -23,19 +23,19 @@ Function fpFlock (fd,mode : longint) : cint; cdecl; external clib name 'flock';
 {$endif beos}
 {$endif solaris}
 
-{$ifdef beos}
+{$if defined(beos) or defined(solaris) }
 Function fpfStatFS(Fd:Longint; Info:pstatfs):cint; cdecl; external clib name 'fstatvfs';
-{$else beos}
+{$else beos or solaris }
 Function fpfStatFS(Fd:Longint; Info:pstatfs):cint; cdecl; external clib name 'fstatfs';
-{$endif beos}
+{$endif beos or solaris }
 
 Function fpfsync (fd : cint) : cint; cdecl; external clib name 'fsync';
 
-{$ifdef beos}
+{$if defined(beos) or defined(solaris) }
 Function fpStatFS  (Path:pchar; Info:pstatfs):cint; cdecl; external clib name 'statvfs';
-{$else beos}
+{$else beos or solaris }
 Function fpStatFS  (Path:pchar; Info:pstatfs):cint; cdecl; external clib name 'statfs';
-{$endif beos}
+{$endif beos or solaris }
 
 function pipe (var fildes: filedesarray):cint;  cdecl; external clib name 'pipe';
 function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint;   cdecl; external clib name 'gettimeofday';