Forráskód Böngészése

* another part of Almindor's fix.

git-svn-id: trunk@12007 -
marco 16 éve
szülő
commit
699a0ba70f
1 módosított fájl, 22 hozzáadás és 3 törlés
  1. 22 3
      rtl/bsd/bunxsysc.inc

+ 22 - 3
rtl/bsd/bunxsysc.inc

@@ -351,10 +351,29 @@ begin
  FPutime:=do_syscall(syscall_nr_utimes,TSysParam(path),TSysParam(tvp));
 end;
 
-Function FPpipe(var fildes : tfildes):cint;
+function __pipe_call(sysnr:TSysParam):TSysResult; {$ifdef cpui386}oldfpccall{$endif} external name 'FPC_DOSYS0';
 
-begin
- FPpipe:=do_syscall(syscall_nr_pipe,TSysParam(@fildes));
+Function FPpipe(var fildes : tfildes):cint;
+var
+  a, b: cInt;
+begin
+  asm
+  {$ifdef CPUi386}
+    pushl syscall_nr_pipe
+    call __pipe_call
+    movl %eax, a
+    movl %edx, b
+  {$else}
+    movq syscall_nr_pipe, %rdi
+    call __pipe_call
+    movl %eax, a
+    movl %edx, b
+  {$endif}
+  end;
+
+  fpPipe := a; // eax is in a, no matter if it worked or not
+  fildes[0] := a;
+  fildes[1] := b;
 end;
 
 function FPfcntl(fildes:cint;Cmd:cint;Arg:cint):cint;