Преглед на файлове

* the stat type is processor-dependent
* the dev_t tpye is processor dependent. Don't use it in the stat type
however, as that one is also used at a time where dev_t is already
defined as qword

Jonas Maebe преди 22 години
родител
ревизия
54015aaf6e
променени са 5 файла, в които са добавени 251 реда и са изтрити 48 реда
  1. 14 24
      rtl/linux/bunxtype.inc
  2. 71 0
      rtl/linux/i386/stat.inc
  3. 71 0
      rtl/linux/m68k/stat.inc
  4. 69 0
      rtl/linux/powerpc/stat.inc
  5. 26 24
      rtl/linux/systypes.inc

+ 14 - 24
rtl/linux/bunxtype.inc

@@ -57,29 +57,13 @@ TYPE
   TUtsName   = UtsName;
   PUtsName   = TUtsName;
 
-  Stat 	     = Packed Record  // No unix typing because of differences
-			      // kernel <->libc
-                st_dev     : word;
-                pad1       : word;
-                st_ino     : longint;
-                st_mode,
-                nlink,
-                uid,
-                gid        : word;
-                rdev       : word;
-                pad2       : word;
-                st_size,
-                blksze,
-                blocks,
-                atime,
-                unused1,
-                mtime,
-                unused2,
-                ctime,
-                unused3,
-                unused4,
-                unused5   : longint;
-  	       end;
+
+{ Definition of (kernel) stat type }
+{ see kernel/include/asm-<cpu>/stat.h, include/linux/types.h and }
+{ include /include/asm-<cpu>/posix-types.h                       }
+
+{$i stat.inc}
+
   TStat	     = Stat;
   PStat	     = ^Stat;
 
@@ -262,7 +246,13 @@ CONST
 
 {
   $Log$
-  Revision 1.1  2002-12-18 16:43:26  marco
+  Revision 1.2  2003-05-15 22:50:50  jonas
+    * the stat type is processor-dependent
+    * the dev_t tpye is processor dependent. Don't use it in the stat type
+      however, as that one is also used at a time where dev_t is already
+      defined as qword
+
+  Revision 1.1  2002/12/18 16:43:26  marco
    * new unix rtl, linux part.....
 
   Revision 1.1  2002/11/12 14:37:59  marco

+ 71 - 0
rtl/linux/i386/stat.inc

@@ -0,0 +1,71 @@
+{
+    $Id$
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Jonas Maebe,
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+  Stat = Packed Record  // No unix typing because of differences
+                              // kernel <->libc
+    case byte of   
+      0: (st_dev     : word;
+          pad1       : word;
+          st_ino     : longint;
+          st_mode,
+          nlink,
+          uid,
+          gid        : word;
+          rdev       : word;
+          pad2       : word;
+          st_size,
+          st_blksze,
+          st_blocks,
+          st_atime,
+          unused1,
+          st_mtime,
+          unused2,
+          st_ctime,
+          unused3,
+          unused4,
+          unused5   : longint;);
+      1: (
+          dev     : word;
+          pad1_dummy    : word;
+          ino     : longint;
+          mode,
+          nlink_dummy,
+          uid_dummy,
+          gid_dummy     : word;
+          rdev_dummy    : word;
+          pad2_dummy    : word;
+          size,
+          blksze,
+          blocks,
+          atime,
+          unused1_dummy,
+          mtime,
+          unused2_dummy,
+          ctime,
+          unused3_dummy,
+          unused4_dummy,
+          unused5_dummy : longint;
+         );
+  end;
+
+{
+  $Log$
+  Revision 1.1  2003-05-15 22:50:50  jonas
+    * the stat type is processor-dependent
+    * the dev_t tpye is processor dependent. Don't use it in the stat type
+      however, as that one is also used at a time where dev_t is already
+      defined as qword
+
+}

+ 71 - 0
rtl/linux/m68k/stat.inc

@@ -0,0 +1,71 @@
+{
+    $Id$
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Jonas Maebe,
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+  Stat = Packed Record  // No unix typing because of differences
+                              // kernel <->libc
+    case byte of   
+      0: (st_dev     : word;
+          pad1       : word;
+          st_ino     : longint;
+          st_mode,
+          nlink,
+          uid,
+          gid        : word;
+          rdev       : word;
+          pad2       : word;
+          st_size,
+          st_blksze,
+          st_blocks,
+          st_atime,
+          unused1,
+          st_mtime,
+          unused2,
+          st_ctime,
+          unused3,
+          unused4,
+          unused5   : longint;);
+      1: (
+          dev     : word;
+          pad1_dummy    : word;
+          ino     : longint;
+          mode,
+          nlink_dummy,
+          uid_dummy,
+          gid_dummy     : word;
+          rdev_dummy    : word;
+          pad2_dummy    : word;
+          size,
+          blksze,
+          blocks,
+          atime,
+          unused1_dummy,
+          mtime,
+          unused2_dummy,
+          ctime,
+          unused3_dummy,
+          unused4_dummy,
+          unused5_dummy : longint;
+         );
+  end;
+
+{
+  $Log$
+  Revision 1.1  2003-05-15 22:50:50  jonas
+    * the stat type is processor-dependent
+    * the dev_t tpye is processor dependent. Don't use it in the stat type
+      however, as that one is also used at a time where dev_t is already
+      defined as qword
+
+}

+ 69 - 0
rtl/linux/powerpc/stat.inc

@@ -0,0 +1,69 @@
+{
+    $Id$
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Jonas Maebe,
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+  { note: NO packed record, C also inserts padding after the nlink field! }
+  Stat = Record  // No unix typing because of differences
+    case byte of   
+      0: (st_dev    : cardinal;
+          st_ino,
+          st_mode   : cardinal;
+          nlink     : word;
+          uid,
+          gid,
+          rdev      : cardinal;
+          st_size   : longint;
+          st_blksize,
+          st_blocks,
+          st_atime,
+          __unused1,
+          st_mtime,
+          __unused2,
+          st_ctime,
+          __unused3,
+          __unused4,
+          __unused5  : cardinal;);
+      1: (
+          dev     : cardinal;
+          pad1    : word;
+          ino     : longint;
+          mode,
+          nlink_dummy,
+          uid_dummy,
+          gid_dummy     : word;
+          rdev_dummy    : dev_t;
+          pad2_dummy    : word;
+          size,
+          blksze,
+          blocks,
+          atime,
+          unused1_dummy,
+          mtime,
+          unused2_dummy,
+          ctime,
+          unused3_dummy,
+          unused4_dummy,
+          unused5_dummy : longint;
+         );
+  end;
+
+{
+  $Log$
+  Revision 1.1  2003-05-15 22:50:51  jonas
+    * the stat type is processor-dependent
+    * the dev_t tpye is processor dependent. Don't use it in the stat type
+      however, as that one is also used at a time where dev_t is already
+      defined as qword
+
+}

+ 26 - 24
rtl/linux/systypes.inc

@@ -57,30 +57,25 @@ type
   end;
   PDir =^TDir;
 
+{ can't put definition in stat.inc because stat.inc is also included in }
+{ bunxtype.inc, which is used together with ptypes.inc, which defines   }
+{ def_t in another way :(                                               }
+{$ifdef i386}
   dev_t = word;
-
-  Stat = packed record
-    dev     : dev_t;
-    pad1    : word;
-    ino     : longint;
-    mode,
-    nlink,
-    uid,
-    gid     : word;
-    rdev    : dev_t;
-    pad2    : word;
-    size,
-    blksze,
-    blocks,
-    atime,
-    unused1,
-    mtime,
-    unused2,
-    ctime,
-    unused3,
-    unused4,
-    unused5 : longint;
-  end;
+{$else i386}
+{$ifdef m68k}
+  dev_t = word;
+{$else m68k}
+{$ifdef powerpc}
+  dev_t = cardinal;
+{$else powerpc}
+{$error dev_t unknown for this processor}
+{$endif powerpc}
+{$endif m68k}
+{$endif i386}
+
+{ definition of stat record type }
+{$i stat.inc}  
   PStat=^Stat;
   TStat=Stat;
 
@@ -131,10 +126,17 @@ type
 
 {
   $Log$
-  Revision 1.7  2002-09-07 16:01:20  peter
+  Revision 1.8  2003-05-15 22:50:50  jonas
+    * the stat type is processor-dependent
+    * the dev_t tpye is processor dependent. Don't use it in the stat type
+      however, as that one is also used at a time where dev_t is already
+      defined as qword
+
+  Revision 1.7  2002/09/07 16:01:20  peter
     * old logs removed and tabs fixed
 
   Revision 1.6  2002/07/29 17:50:02  florian
     + added register location description for ppc
 
 }
+