netbsd/m68k: a fuggly fix for FpLseek, so the compiler works natively at least

git-svn-id: trunk@36803 -
This commit is contained in:
Károly Balogh 2017-07-27 19:02:40 +00:00
parent 12697deda7
commit 33abf859b4

View File

@ -61,7 +61,11 @@ end;
{$else}
// generic versions.
function Fplseek(fd : cint; offset : off_t; whence : cint): off_t; [public, alias : 'FPC_SYSC_LSEEK'];
{$ifdef cpum68k}
begin
Fplseek:=do_syscall64(syscall_nr_lseek,TSysParam(fd),0,hi(offset),lo(offset),whence);
end;
{$else}
{
this one is special for the return value being 64-bit..
hi/lo offset not yet tested.
@ -74,9 +78,13 @@ begin
{$ifdef CPU64}
Fplseek:=do_syscall(syscall_nr___syscall,syscall_nr_lseek,TSysParam(fd),0,Offset,whence);
{$else}
Fplseek:=do_syscall(syscall_nr___syscall,syscall_nr_lseek,0,TSysParam(fd),0,lo(Offset),{0} hi(offset),Whence);
Fplseek:=do_syscall(syscall_nr___syscall,syscall_nr_lseek,0,TSysParam(fd),0,
{$ifdef ENDIAN_BIG}hi(offset),lo(offset){$endif}
{$ifdef ENDIAN_LITTLE}lo(Offset),hi(offset){$endif},
Whence);
{$endif}
end;
{$endif}
function Fpftruncate(fd : cint; flength : off_t): cint; [public, alias : 'FPC_SYSC_FTRUNCATE'];