* fix stat for 64 bit CPUs

git-svn-id: trunk@5120 -
This commit is contained in:
micha 2006-10-31 13:01:20 +00:00
parent e11995aa99
commit 59e2c82080
2 changed files with 16 additions and 12 deletions

View File

@ -43,7 +43,7 @@ end;
function Fplseek(fd : cint; offset : off64_t; whence : cint): off64_t; [public, alias : 'FPC_SYSC_LSEEK'];
begin
{$ifdef CPU64}
{$if defined(cpu64) and not defined(cpupowerpc64)}
result:=do_syscall(syscall_nr_lseek,tsysparam(fd),tsysparam(offset),tsysparam(whence));
{$else}
if do_syscall(syscall_nr__llseek,tsysparam(fd),tsysparam(offset shr 32),tsysparam(offset),
@ -91,16 +91,13 @@ end;
function Fpstat(path: pchar; var buf: stat):cint; [public, alias : 'FPC_SYSC_STAT'];
begin
Fpstat:=do_syscall(syscall_nr_stat,TSysParam(path),TSysParam(@buf));
{$if defined(cpu64) and not defined(cpupowerpc64)}
Fpstat:=do_syscall(syscall_nr_stat,TSysParam(path),TSysParam(@buf));
{$else}
Fpstat:=do_syscall(syscall_nr_stat64,TSysParam(path),TSysParam(@buf));
{$endif}
end;
function Fpstat64(path: pchar; var buf: stat64):cint; [public, alias : 'FPC_SYSC_STAT64'];
begin
Fpstat64:=do_syscall(syscall_nr_stat64,TSysParam(path),TSysParam(@buf));
end;
{*****************************************************************************
--- Directory:Directory related calls ---
*****************************************************************************}

View File

@ -82,10 +82,12 @@ const
_STAT_VER = _STAT_VER_LINUX;
type
{$ifdef FPC_USE_LIBC}
{$i stat.inc}
TStat = Stat;
PStat = ^Stat;
{$else}
{$if defined(CPUPOWERPC) or defined(CPUPOWERPC64) or defined(CPUSPARC) or defined(CPUSPARC64)}
{$define CLEAN_STAT64}
@ -93,7 +95,7 @@ type
{ file characteristics services }
{ this record is incorrect for alpha, frv, h8300, mips, parisc, v850, xtensa }
stat64 = record
stat = record
st_dev : dev_t; // inode's device
{$ifdef CLEAN_STAT64}
st_ino : ino64_t;
@ -132,6 +134,11 @@ type
{$endif}
end;
{$endif}
TStat = Stat;
PStat = ^Stat;
{ directory services }
Dirent = packed record