Explorar o código

Merged revisions 7481,8018-8021 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r7481 | marco | 2007-05-26 15:56:21 +0200 (Sat, 26 May 2007) | 2 lines

* deprecated here and there even though compiler doesn't seem to show

........
r8018 | Almindor | 2007-07-11 22:55:09 +0200 (Wed, 11 Jul 2007) | 2 lines

* fix FPC_USES_LIBC cycling, by fixing libc stat records (both 32 and 64 bit)

........
r8019 | Almindor | 2007-07-11 23:00:03 +0200 (Wed, 11 Jul 2007) | 2 lines

* preliminary x86_64 stat for FPC_USE_LIBC

........
r8020 | Almindor | 2007-07-11 23:02:34 +0200 (Wed, 11 Jul 2007) | 2 lines

* fix the stupid pascal names in x86_64 linux stat

........
r8021 | tom_at_work | 2007-07-11 23:05:23 +0200 (Wed, 11 Jul 2007) | 1 line

* fix stat record when compiling for ppc/linux using -dFPC_USE_LIBC
........

git-svn-id: branches/fixes_2_2@8083 -

joost %!s(int64=18) %!d(string=hai) anos
pai
achega
824c1be6c8
Modificáronse 3 ficheiros con 192 adicións e 102 borrados
  1. 129 87
      rtl/linux/i386/stat.inc
  2. 15 14
      rtl/linux/powerpc/stat.inc
  3. 48 1
      rtl/linux/x86_64/stat.inc

+ 129 - 87
rtl/linux/i386/stat.inc

@@ -14,29 +14,29 @@
 
 {$ifndef FPC_USE_LIBC} // kernel record
 
-  Stat = packed record  // No unix typing because of differences
+  Stat = packed record  
     case byte of
       0:
-        (dev    : qword;
-        __pad0  : array[0..3] of byte;
-        __ino,
-        mode,
-        nlink,
-        uid,
-        gid     : cardinal;
-        rdev    : qword;
-        __pad3  : array[0..3] of byte;
-        size    : qword;
-        blksize : cardinal;
-        blocks  : qword;
-        atime,
-        atime_nsec,
-        mtime,
-        mtime_nsec,
-        ctime,
-        ctime_nsec : cardinal;
-        ino    : qword);
-      1:
+        (dev        : qword    deprecated;
+        __pad0      : array[0..3] of byte deprecated;
+        __ino       : cardinal deprecated;
+        mode        : cardinal deprecated;
+        nlink       : cardinal deprecated;
+        uid	    : cardinal deprecated;
+        gid         : cardinal deprecated;
+        rdev        : qword deprecated;
+        __pad3      : array[0..3] of byte deprecated;
+        size        : qword    deprecated;
+        blksize     : cardinal deprecated;
+        blocks      : qword    deprecated;
+        atime	    : cardinal deprecated;
+        atime_nsec  : cardinal deprecated;
+        mtime	    : cardinal deprecated; 
+        mtime_nsec  : cardinal deprecated;
+        ctime	    : cardinal deprecated;
+        ctime_nsec  : cardinal deprecated;
+        ino         : qword    deprecated);
+      1:		// Unix typing will be reintroduced.
         (st_dev   : qword;
         __pad0_   : array[0..3] of byte;
         __st_ino_,
@@ -60,77 +60,119 @@
 
 {$else}
 
+// info taken from /usr/include/asm-i386/stat.h you must have some -dev installed for this I think.. or linux-headers
+
 {$packrecords C}
+
+{$ifdef fs32bit}
   Stat =  Record
     case byte of
-      0:
-                              // kernel <->libc
-        (dev     : dev_t;
-        pad1       : word;
-{$ifdef fs32bit}
-        ino     : ino_t;
-{$else}
-        __ino   : ino_t;
-{$endif}    
-        mode    : mode_t;
-        nlink   : nlink_t;
-        uid     : uid_t;
-        gid     : gid_t;
-        rdev    : dev_t;
-        pad2       : word;
-        size    : off_t;
-        blksize : blksize_t;
-{$ifdef fs32bit}
-        blocks  : blkcnt_t;
-{$else}    
-        blocks  : blkcnt64_t;
-{$endif}    
-        atime,
-        atime_nsec,
-        mtime,
-        mtime_nsec,
-        ctime,
-        ctime_nsec : cardinal;
-{$ifdef fs32bit}
-        unused4, unused5: cardinal;
-{$else}    
-        ino     : ino64_t;
-{$endif});
-      1:
-                              // kernel <->libc
-        (st_dev    : dev_t;
-        pad1_      : word;
-{$ifdef fs32bit}
-        st_ino     : ino_t;
-{$else}
-        __st_ino   : ino_t;
-{$endif}    
-        st_mode    : mode_t;
-        st_nlink   : nlink_t;
-        st_uid     : uid_t;
-        st_gid     : gid_t;
-        st_rdev    : dev_t;
-        pad2_       : word;
-        st_size    : off_t;
-        st_blksize : blksize_t;
-{$ifdef fs32bit}
-        st_blocks  : blkcnt_t;
-{$else}    
-        st_blocks  : blkcnt64_t;
-{$endif}    
-        st_atime,
-        st_atime_nsec,
-        st_mtime,
-        st_mtime_nsec,
-        st_ctime,
-        st_ctime_nsec : culong;
-{$ifdef fs32bit}
-        unused4_, unused5_: culong;
-{$else}    
-        st_ino     : ino64_t;
-{$endif});
+      0:(dev: cuLong deprecated;
+         ino: cuLong deprecated;
+         mode: cuShort deprecated;
+         nlink: cuShort deprecated; 
+         uid: cuShort deprecated;
+         gid: cuShort deprecated;
+         rdev: cuLong deprecated;
+         size: cuLong deprecated;
+         blksize: cuLong deprecated;
+         blocks: cuLong deprecated;
+         atime: cuLong deprecated; 
+         atime_nsec: cuLong deprecated;
+         mtime: cuLong deprecated;
+         mtime_nsec: cuLong deprecated;
+         ctime: cuLong deprecated;
+         ctime_nsec: cuLong deprecated;
+         __unused4: cuLong deprecated;
+         __unused5: cuLong deprecated);
+
+      1:(st_dev: cuLong;
+         st_ino: cuLong;
+         st_mode: cuShort;
+         st_nlink: cuShort; 
+         st_uid: cuShort;
+         st_gid: cuShort;
+         st_rdev: cuLong;
+         st_size: cuLong;
+         st_blksize: cuLong;
+         st_blocks: cuLong;
+         st_atime: cuLong;
+         st_atime_nsec: cuLong;
+         st_mtime: cuLong;
+         st_mtime_nsec: cuLong;
+         st_ctime: cuLong;
+         st_ctime_nsec: cuLong;
+         __unused4_: cuLong;
+         __unused5_: cuLong);
+  end;
+
+{$else} // 64 bit stat
+
+  Stat = record
+    case Byte of
+    0 :(dev: cuLongLong deprecated;
+    __pad0: array[0..3] of cuChar deprecated;
+
+    __ino: cuLong deprecated;
+
+    mode: cuInt deprecated;
+    nlink: cuInt deprecated;
+
+    uid: cuLong deprecated;
+    gid: cuLong deprecated;
+
+    rdev: cuLongLong deprecated;
+    __pad3: array[0..3] of cuChar deprecated;
+
+    size: cLongLong deprecated;
+    blksize: cuLong deprecated;
+
+    blocks: cuLongLong deprecated;	//* Number 512-byte blocks allocated. */
+
+    atime: cuLong deprecated;
+    atime_nsec: cuLong deprecated;
+
+    mtime: cuLong deprecated;
+    mtime_nsec: cuInt deprecated;
+
+    ctime: cuLong deprecated;
+    ctime_nsec: cuLong deprecated;
+
+    ino: cuLongLong deprecated);
+
+    1 :(st_dev: cuLongLong;
+    __pad0_: array[0..3] of cuChar;
+
+    __st_ino: cuLong;
+
+    st_mode: cuInt;
+    st_nlink: cuInt;
+
+    st_uid: cuLong;
+    st_gid: cuLong;
+
+    st_rdev: cuLongLong;
+    __pad3_: array[0..3] of cuChar;
+
+    st_size: cLongLong;
+    st_blksize: cuLong;
+
+    st_blocks: cuLongLong;	//* Number 512-byte blocks allocated. */
+
+    st_atime: cuLong;
+    st_atime_nsec: cuLong;
+
+    st_mtime: cuLong;
+    st_mtime_nsec: cuInt;
+
+    st_ctime: cuLong;
+    st_ctime_nsec: cuLong;
+
+    st_ino: cuLongLong);
   end;
 
+{$endif}
+
 
 {$endif}
 

+ 15 - 14
rtl/linux/powerpc/stat.inc

@@ -73,22 +73,23 @@
 
 {$ELSE FPC_USE_LIBC}
 
-{ when linking to libc, we need to use some other, 64 bit enhanced stat type.
- Found out by having too much time on hand and some sophisticated guessing. }
+{ when linking to libc, we need to use some other, 64 bit enhanced stat type }
+
+{ i.e. powerpc kernel sources (2.6.20-15) /include/asm-powerpc/stat.h, stat64 struct }
 
   stat = record
     case byte of
       0: (
         st_dev     : cULongLong;
         st_ino     : cULongLong;
-        st_mode    : mode_t;
-        st_nlink   : nlink_t;
-        st_uid     : uid_t;
-        st_gid     : gid_t;
+        st_mode    : cUInt;
+        st_nlink   : cUInt;
+        st_uid     : cUInt;
+        st_gid     : cUInt;
         st_rdev    : cULongLong;
-        __pad2     : cushort;
+        __pad2     : cUShort;
         st_size    : cLongLong;
-        st_blksize : cULong;
+        st_blksize : cInt;
         st_blocks  : cULongLong;
         st_atime,
         st_atime_nsec,
@@ -101,14 +102,14 @@
       1: (
         dev    : cULongLong deprecated;
         ino    : cULongLong deprecated;
-        mode   : mode_t deprecated;
-        nlink  : nlink_t deprecated;
-        uid    : uid_t deprecated;
-        gid    : gid_t deprecated;
+        mode   : cUInt deprecated;
+        nlink  : cUInt deprecated;
+        uid    : cUInt deprecated;
+        gid    : cUInt deprecated;
         rdev   : cULongLong deprecated;
-        __pad2_: cushort deprecated;
+        __pad2_: cUShort deprecated;
         size   : cLongLong deprecated;
-        blksize: cULong deprecated;
+        blksize: cInt deprecated;
         blocks : cULongLong deprecated;
         atime,
         __unused1_dummy,

+ 48 - 1
rtl/linux/x86_64/stat.inc

@@ -62,7 +62,54 @@
 
 {$else}
 
-(* get it from glibc/sysdeps/unix/sysv/linux/x86_64/bits/stat.h and check defines with gcc *)
+{$packrecords C}
+// (* get it from glibc/sysdeps/unix/sysv/linux/x86_64/bits/stat.h and check defines with gcc *)
+// kill the one who made the st_less idea!
+
+  Stat = record
+  case Byte of
+    0:(dev: cuLong deprecated;
+    ino: cuLong deprecated;
+    nlink: cuLong deprecated;
+
+    mode: cuInt deprecated;
+    uid: cuInt deprecated;
+    gid: cuInt deprecated;
+    __pad0: cuInt deprecated;
+    rdev: cuLong deprecated;
+    size: cLong deprecated;
+    blksize: cLong deprecated;
+    blocks: cLong	deprecated; //* Number 512-byte blocks allocated. */
+
+    atime: cuLong deprecated;
+    atime_nsec: cuLong deprecated;
+    mtime: cuLong deprecated;
+    mtime_nsec: cuLong deprecated;
+    ctime: cuLong deprecated;
+    ctime_nsec: cuLong deprecated;
+    __unused: array[0..2] of cLong deprecated;);
+
+    1:(st_dev: cuLong;
+    st_ino: cuLong;
+    st_nlink: cuLong;
+
+    st_mode: cuInt;
+    st_uid: cuInt;
+    st_gid: cuInt;
+    __pad1: cuInt;
+    st_rdev: cuLong;
+    st_size: cLong;
+    st_blksize: cLong;
+    st_blocks: cLong;	//* Number 512-byte blocks allocated. */
+
+    st_atime: cuLong;
+    st_atime_nsec: cuLong; 
+    st_mtime: cuLong;
+    st_mtime_nsec: cuLong;
+    st_ctime: cuLong;
+    st_ctime_nsec: cuLong;
+    __unused2: array[0..2] of cLong);
+  end;
 
 {$endif}