Add support for DragonFly OS

git-svn-id: trunk@31213 -
This commit is contained in:
pierre 2015-07-14 22:05:34 +00:00
parent 780c54c8b4
commit 56859175c9

View File

@ -27,7 +27,7 @@ end;
function shmget(key:key_t;size:size_t;flag:cint):cint;
begin
{$ifdef NetBSD}
{$if defined(dragonfly) or defined(NetBSD)}
shmget:=do_syscall(syscall_nr_shmget, key, size, flag);
{$else NetBSD}
shmget:=do_syscall(syscall_nr_shmsys,3, key, size, flag);
@ -36,7 +36,7 @@ end;
Function shmat (shmid:cint; shmaddr:pointer; shmflg:cint):pointer;
begin
{$ifdef NetBSD}
{$if defined(dragonfly) or defined(NetBSD)}
shmat:=pointer(do_syscall(syscall_nr_shmat, shmid, TSysParam(shmaddr), shmflg));
{$else NetBSD}
shmat:=pointer(do_syscall(syscall_nr_shmsys,0, shmid, TSysParam(shmaddr), shmflg));
@ -46,7 +46,7 @@ end;
Function shmdt (shmaddr:pointer):cint;
begin
{$ifdef NetBSD}
{$if defined(dragonfly) or defined(NetBSD)}
shmdt:=do_syscall(syscall_nr_shmdt, TSysParam(shmaddr));
{$else NetBSD}
shmdt:=do_syscall(syscall_nr_shmsys,2, TSysParam(shmaddr));
@ -56,7 +56,9 @@ end;
Function shmctl(shmid:cint; cmd:cint; buf: pshmid_ds): cint;
begin
{$ifdef NetBSD}
{$if defined(dragonfly)}
shmctl:= do_syscall(syscall_nr_shmctl, shmid, cmd, TSysParam(buf));
{$elseif defined(NetBSD)}
shmctl:= do_syscall(syscall_nr___shmctl13, shmid, cmd, TSysParam(buf));
{$else NetBSD}
shmctl:= do_syscall(syscall_nr_shmsys,4, shmid, cmd, TSysParam(buf));
@ -65,7 +67,7 @@ end;
Function semget(key:Tkey; nsems:cint; semflg:cint): cint;
begin
{$ifdef NetBSD}
{$if defined(dragonfly) or defined(NetBSD)}
semget:=do_syscall(syscall_nr_semget, key, nsems, semflg);
{$else NetBSD}
semget:=do_syscall(syscall_nr_semsys,1, key, nsems, semflg);
@ -74,7 +76,7 @@ end;
Function semop(semid:cint; sops: psembuf; nsops: cuint): cint;
begin
{$ifdef NetBSD}
{$if defined(dragonfly) or defined(NetBSD)}
semop:=do_syscall(syscall_nr_semop, semid, TSysParam(sops), nsops, 0);
{$else NetBSD}
semop:=do_syscall(syscall_nr_semsys,2, semid, TSysParam(sops), nsops, 0);
@ -83,7 +85,9 @@ end;
Function semctl(semid:cint; semnum:cint; cmd:cint; var arg: tsemun): cint;
begin
{$ifdef NetBSD}
{$if defined(dragonfly)}
semctl:=cint(do_syscall(syscall_nr___semctl, semid, semnum, cmd,TSysParam(@arg)));
{$elseif defined(NetBSD)}
semctl:=cint(do_syscall(syscall_nr_semconfig, semid, semnum, cmd,TSysParam(@arg)));
{$else NetBSD}
semctl:=cint(do_syscall(syscall_nr_semsys, 0, semid, semnum, cmd,TSysParam(@arg)));
@ -92,7 +96,7 @@ end;
Function msgget(key: TKey; msgflg:cint):cint;
begin
{$ifdef NetBSD}
{$if defined(dragonfly) or defined(NetBSD)}
msgget:=do_syscall(syscall_nr_msgget, key, msgflg);
{$else NetBSD}
msgget:=do_syscall(syscall_nr_msgsys,1, key, msgflg);
@ -101,7 +105,7 @@ end;
Function msgsnd(msqid:cint; msgp: PMSGBuf; msgsz: size_t; msgflg:cint): cint;
begin
{$ifdef NetBSD}
{$if defined(dragonfly) or defined(NetBSD)}
msgsnd:=do_syscall(syscall_nr_msgsnd, msqid, TSysParam(msgp), TSysParam(msgsz), msgflg);
{$else NetBSD}
msgsnd:=do_syscall(syscall_nr_msgsys,2, msqid, TSysParam(msgp), TSysParam(msgsz), msgflg);
@ -110,7 +114,7 @@ end;
Function msgrcv(msqid:cint; msgp: PMSGBuf; msgsz: size_t; msgtyp:clong; msgflg:cint):cint;
begin
{$ifdef NetBSD}
{$if defined(dragonfly) or defined(NetBSD)}
msgrcv:=(do_syscall(syscall_nr_msgrcv, msqid, TSysParam(msgp), msgsz, msgtyp, msgflg));
{$else NetBSD}
msgrcv:=(do_syscall(syscall_nr_msgsys,3, msqid, TSysParam(msgp), msgsz, msgtyp, msgflg));
@ -119,7 +123,9 @@ end;
Function msgctl(msqid:cint; cmd: cint; buf: PMSQid_ds): cint;
begin
{$ifdef NetBSD}
{$if defined(dragonfly)}
msgctl:= (do_syscall(syscall_nr_msgctl, msqid, cmd, tsysparam(buf)));
{$elseif defined(NetBSD)}
msgctl:= (do_syscall(syscall_nr___msgctl13, msqid, cmd, tsysparam(buf)));
{$else NetBSD}
msgctl:= (do_syscall(syscall_nr_msgsys,0, msqid, cmd, tsysparam(buf)));