* mmap2 expects that offset is divided by 4096

git-svn-id: trunk@44198 -
This commit is contained in:
florian 2020-02-16 20:14:28 +00:00
parent 27e89e07a3
commit 17158c3587

View File

@ -583,11 +583,11 @@ end;
begin begin
{$if sizeof(TSysParam)>=sizeof(off_t)} {$if sizeof(TSysParam)>=sizeof(off_t)}
Fpmmap:= pointer(do_syscall(syscall_nr_mmap2,TSysParam(adr),TSysParam(len), Fpmmap:= pointer(do_syscall(syscall_nr_mmap2,TSysParam(adr),TSysParam(len),
TSysParam(prot),TSysParam(flags),TSysParam(fd),TSysParam(off))); TSysParam(prot),TSysParam(flags),TSysParam(fd),TSysParam(off div 4096)));
{$else off_t is larger than TsysParam } {$else off_t is larger than TsysParam }
{$message warning need mmap64 syscall, hi(off) not used} {$message warning need mmap64 syscall, hi(off) not used}
Fpmmap:= pointer(do_syscall(syscall_nr_mmap2,TSysParam(adr),TSysParam(len), Fpmmap:= pointer(do_syscall(syscall_nr_mmap2,TSysParam(adr),TSysParam(len),
TSysParam(prot),TSysParam(flags),TSysParam(fd),TSysParam(lo(off)))); TSysParam(prot),TSysParam(flags),TSysParam(fd),TSysParam(lo(off div 4096))));
{$endif} {$endif}
end; end;
{$else MMAP2} {$else MMAP2}