* Wat cleanup, ouwe syscalls nu via baseunix e.d.

This commit is contained in:
marco 2003-09-16 13:17:03 +00:00
parent ca823630a1
commit 0528aa6fd7

View File

@ -56,7 +56,6 @@ Uses BaseUnix;
{ Include generic overloaded routines } { Include generic overloaded routines }
{$i thread.inc} {$i thread.inc}
{$ifndef BSD} {$ifndef BSD}
{$i pthread.inc} {$i pthread.inc}
{$else} {$else}
@ -102,69 +101,23 @@ function pthread_mutex_unlock (p:ppthread_mutex_attr_t):cint; cdecl;external;
{$ifndef BSD} {$ifndef BSD}
const Const
syscall_nr_mmap = 90;
syscall_nr_munmap = 91;
{ Constansts for MMAP } { Constants for MMAP }
MAP_PRIVATE =2; MAP_PRIVATE =2;
MAP_ANONYMOUS =$20; MAP_ANONYMOUS =$20;
{
type
SysCallRegs=record
reg1,reg2,reg3,reg4,reg5,reg6 : longint;
end;
var
Errno : longint;
{ Include syscall itself }
{$i syscallo.inc}
Function Fpmmap(adr,len,prot,flags,fdes,off:longint):longint;
type
tmmapargs=packed record
address : longint;
size : longint;
prot : longint;
flags : longint;
fd : longint;
offset : longint;
end;
var
t : syscallregs;
mmapargs : tmmapargs;
begin
mmapargs.address:=adr;
mmapargs.size:=len;
mmapargs.prot:=prot;
mmapargs.flags:=flags;
mmapargs.fd:=fdes;
mmapargs.offset:=off;
t.reg2:=longint(@mmapargs);
Fpmmap:=syscall(syscall_nr_mmap,t);
end;
Function Fpmunmap(adr,len:longint):longint;
var
t : syscallregs;
begin
t.reg2:=adr;
t.reg3:=len;
Fpmunmap:=syscall(syscall_nr_munmap,t);
end;
}
{$else} {$else}
{$ifdef FreeBSD}
CONST CONST
{ Constansts for MMAP. These are still private for *BSD } { Constants for MMAP. These are still private for *BSD }
MAP_PRIVATE =2; MAP_PRIVATE =2;
MAP_ANONYMOUS =$1000; MAP_ANONYMOUS =$1000;
{$ELSE}
// include some non posix internal types. {$ENTER ME}
// *BSD POSIX. Include headers to syscalls. {$ENDIF}
{$ENDIF}
{$endif}
{***************************************************************************** {*****************************************************************************
Threadvar support Threadvar support
@ -432,7 +385,10 @@ initialization
end. end.
{ {
$Log$ $Log$
Revision 1.11 2003-09-16 13:00:02 marco Revision 1.12 2003-09-16 13:17:03 marco
* Wat cleanup, ouwe syscalls nu via baseunix e.d.
Revision 1.11 2003/09/16 13:00:02 marco
* small BSD gotcha removed (typing mmap params) * small BSD gotcha removed (typing mmap params)
Revision 1.10 2003/09/15 20:08:49 marco Revision 1.10 2003/09/15 20:08:49 marco