Mail Archives: cygwin-developers/1998/04/22/11:21:12
I modified egsc's pexecute.c to use common code for both cygwin and mingw
versions. Also I made a change to avoid read end of pipe inheritance
problem we discussed some time ago.
pexecute.c Cygwin-specific code removed;
(pexecute): create a pipe with non-inheritable handles, call spawn
functions
without underscores for cygwin32;
(pwait): just return wait(status) for cygwin32.
To support this changes I had to modify winsup sources :-) New
MSVC-compatible _pipe() call is implemented.
cygwin.din _pipe export is no longer an alias for pipe.
fhandler.cc (fhandler_make_pipe): new parameters psize and mode - pipe's
buffer size and
open mode; create pipe's handles noninherittable if O_NOINHERIT mode is
set,
use psize argument in CreatePipe() call, set pipe's mode to text if
O_TEXT
flag is set.
pipe.cc (pipe): call fhandler_make_pipe with a default buffer size and
_fmode.
(_pipe): new.
winsup.h prototype for fhandler_make_pipe changed.
include/fcntl.h O_NOINHERIT define added.
--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
begin 600 _pipe.diff
M26YD97 AT Z(&-Y9W=I;BYD:6X*/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/0I20U,@
M9FEL93H@+W5S<B]C=G-R;V]T+V-D:R]W:6YS=7 O8WEG=VEN+F1I;BQV"G)E
M=')I979I;F<@<F5V:7-I;VX@,2XR"F1I9F8@+74@+7 @+7(Q+C(@8WEG=VEN
M+F1I;@HM+2T AT 8WEG=VEN+F1I;@DQ.3DX+S T+S$X(#$Q.C,U.C T"3$N,@HK
M*RL AT 8WEG=VEN+F1I;@DQ.3DX+S T+S(R(#$V.C4X.C0Y"D! ("TT-C AT L-R K
M-#8X+#<@0$ @7W!A=&AC;VYF(#T@<&%T:&-O;F8*('!E<G)O<@H AT 7W!E<G)O
M<B ]('!E<G)O<@H@<&EP90HM7W!I<&4@/2!P:7!E"BM?<&EP90H@<&]W"B!?
M<&]W(#T@<&]W"B!P;W=F"DEN9&5X.B!F:&%N9&QE<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&9L86=S.PHM>PHM(" O*B _/S\@2&5R92=S(&%N
M(&]P<&]R='5N:71Y('1O(&-A;F]N:6-A;&EZ92!T:&4@=F%L=65S(&EN(%-4
M05154RX*+2 @(" @3F5E9&5D/R @*B\*+2 @<F5T=7)N(&-W86ET("AS=&%T
M=7,L('!I9"P AT 5T%)5%]#2$E,1"D["BU]"BT*("-E;'-E("\J("$@7U]#64=7
M24XS,E]?("HO"B *("\J(%1H:7,@:7,@82!K;'5D9V4@=&\@9V5T(&%R;W5N
M9"!T:&4 AT 36EC<F]S;V9T($,@<W!A=VX AT 9G5N8W1I;VYS)R!P<F]P96YS:71Y
M"D! ("TS,#,L-B K,C8U+#<@0$ @9FEX7V%R9W8@*&%R9W9E8RD*( H@("!R
M971U<FX@*&-O;G-T(&-H87(@*B!C;VYS=" J*2!A<F=V96,["B!]"BLC96YD
M:68)+RH AT 7U]#64=724XS,E]?("HO"B *("-I;F-L=61E(#QI;RYH/@H@(VEN
M8VQU9&4@/&9C;G1L+F@^"D! ("TS-3$L-R K,S$T+#<@0$ @<&5X96-U=&4@
M*'!R;V=R86TL(&%R9W8L('1H:7-?<&YA;64L('1E;0H@(" @("!A;F0@<F5C
M;W)D(&ET(&%S('=A:71I;F<@=&\@8F4@=&AE(&EN<'5T('1O('1H92!N97AT
M('!R;V-E<W,N(" J+PH@("!I9B H(2 H9FQA9W,@)B!015A%0U5415],05-4
M*2D*(" @("!["BT@(" @("!I9B H7W!I<&4@*'!D97,L(#(U-BP AT 3U]"24Y!
M4EDI(#P@,"D**R @(" @(&EF("A?<&EP92 H<&1E<RP@,C4V+"!/7T))3D%2
M62!\($]?3D])3DA%4DE4*2 \(# I"B )>PH@"2 @*F5R<FUS9U]F;70@/2 B
M<&EP92(["B )(" J97)R;7-G7V%R9R ]($Y53$P["D! ("TS.#$L-R K,S0T
M+#$Q($! ('!E>&5C=71E("AP<F]G<F%M+"!A<F=V+"!T:&ES7W!N86UE+"!T
M96T*(" @(" @(&-L;W-E("AO=71P=71?9&5S8RD["B @(" @?0H@"BLC:69N
M9&5F(%]?0UE'5TE.,S)?7PH@("!P:60@/2 H9FQA9W,@)B!015A%0U5415]3
M14%20T@@/R!?<W!A=VYV<" Z(%]S<&%W;G8I"BLC96QS90HK("!P:60@/2 H
M9FQA9W,@)B!015A%0U5415]314%20T@@/R!S<&%W;G9P(#H@<W!A=VYV*0HK
M(V5N9&EF"B @(" @*%]07TY/5T%)5"P@<')O9W)A;2P AT 9FEX7V%R9W8H87)G
M=BDI.PH@"B @(&EF("AI;G!U=%]D97-C("$](%-41$E.7T9)3$5?3D\I"D!
M("TT,3DL-B K,S AT V+#<@0$ @<'=A:70@*'!I9"P@<W1A='5S+"!F;&%G<RD*
M(" @(" @:6YT("IS=&%T=7,["B @(" @(&EN="!F;&%G<SL*('L**R-I9FYD
M968 AT 7U]#64=724XS,E]?"B @(&EN="!T97)M<W1A=#L*( H@("!P:60@/2!?
M8W=A:70@*"9T97)M<W1A="P@<&ED+"!704E47T-(24Q$*3L*0$ @+30S-BPY
M("LT,#0L,3 @0$ @<'=A:70@*'!I9"P@<W1A='5S+"!F;&%G<RD*(" @(" J
M<W1A='5S(#T@*"@H=&5R;7-T870I("8@,'AF9BD@/#P@."D["B *(" @<F5T
M=7)N('!I9#L**R-E;'-E"BL@(')E='5R;B!W86ET("AS=&%T=7,I.PHK(V5N
M9&EF"B!]"BT*+2-E;F1I9B O*B A(&1E9FEN960@*%]?0UE'5TE.,S)?7RD@
<*B\*( H@(V5N9&EF("\J(%]724XS,B J+PH@"F0@
`
end
- Raw text -