* fixed ambiguity between pipe(2) with two params and pipe(3) with one that broke -dFPC_USE_LIBC

(cherry picked from commit f341baeaa7)
This commit is contained in:
marcoonthegit 2022-08-22 13:22:57 +02:00
parent 9b2ba834a6
commit 3a399845e4
3 changed files with 3 additions and 2 deletions

View File

@ -51,7 +51,7 @@ var
pip : tfildes;
flags : cint;
begin
assignPipe:=fppipe(pip, 0);
assignPipe:=fppipe(pip); // default parameter adds 0, if necessary. This abstracts between pipe(2) and pipe(3)
pipe_in:=pip[0];
pipe_out:=pip[1];
end;

View File

@ -13,6 +13,7 @@
**********************************************************************}
Unit BaseUnix;
{$modeswitch defaultparameters} // on freebsd to make one (libc) and two parameter pipe transparent.
Interface
{$modeswitch out}

View File

@ -35,7 +35,7 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds}
Function FpChown (path : pChar; owner : TUid; group : TGid): cInt;
Function FpUtime (path : pChar; times : putimbuf): cInt;
{$if defined(freebsd)}
Function FpPipe (var fildes : tfildes; flags : cInt):cInt;
Function FpPipe (var fildes : tfildes; flags : cInt=0):cInt;
{$else}
Function FpPipe (var fildes : tfildes):cInt;
{$endif}