From 54015aaf6e70599367f91757abae9963bf1d7e92 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Thu, 15 May 2003 22:50:50 +0000 Subject: [PATCH] * 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 --- rtl/linux/bunxtype.inc | 38 ++++++++------------ rtl/linux/i386/stat.inc | 71 ++++++++++++++++++++++++++++++++++++++ rtl/linux/m68k/stat.inc | 71 ++++++++++++++++++++++++++++++++++++++ rtl/linux/powerpc/stat.inc | 69 ++++++++++++++++++++++++++++++++++++ rtl/linux/systypes.inc | 48 ++++++++++++++------------ 5 files changed, 250 insertions(+), 47 deletions(-) create mode 100644 rtl/linux/i386/stat.inc create mode 100644 rtl/linux/m68k/stat.inc create mode 100644 rtl/linux/powerpc/stat.inc diff --git a/rtl/linux/bunxtype.inc b/rtl/linux/bunxtype.inc index 556a5c53c6..fd7fc62c38 100644 --- a/rtl/linux/bunxtype.inc +++ b/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-/stat.h, include/linux/types.h and } +{ include /include/asm-/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 diff --git a/rtl/linux/i386/stat.inc b/rtl/linux/i386/stat.inc new file mode 100644 index 0000000000..23cc97beea --- /dev/null +++ b/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 + +} diff --git a/rtl/linux/m68k/stat.inc b/rtl/linux/m68k/stat.inc new file mode 100644 index 0000000000..23cc97beea --- /dev/null +++ b/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 + +} diff --git a/rtl/linux/powerpc/stat.inc b/rtl/linux/powerpc/stat.inc new file mode 100644 index 0000000000..25ef796d40 --- /dev/null +++ b/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 + +} diff --git a/rtl/linux/systypes.inc b/rtl/linux/systypes.inc index ef66e273e2..5563176460 100644 --- a/rtl/linux/systypes.inc +++ b/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; +{$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} - 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; +{ 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 } +