www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - ported UNISTD.H

reply "Thomas Kuehne" <eisvogel users.sourceforge.net> writes:
On each and every project I had to include some of unistd.h stuff (Linux /
POSIX calls).

In order to ease development I've tired to condense the most importend parts
into unistd.d.

Thomas


begin 666 unistd.d

M96AN92 H<&]R=&5D('1O($0I" ET:&4 8W5R<F5N="!V97)S:6]N(&-A;B!B
M92!F;W5N9"!A=#H " EH='1P.B\O9&UD+FMU96AN92YC;B]U;FES=&0N9 H)

M<F4 1F]U;F1A=&EO;BP 26YC+ H ("!4:&ES(&9I;&4 :7, <&%R="!O9B!T
M:&4 1TY5($, 3&EB<F%R>2X*"B  (%1H92!'3E4 0R!,:6)R87)Y(&ES(&9R
M964 <V]F='=A<F4[('EO=2!C86X <F5D:7-T<FEB=71E(&ET(&%N9"]O< H 
M("!M;V1I9GD :70 =6YD97( =&AE('1E<FUS(&]F('1H92!'3E4 3&5S<V5R
M($=E;F5R86P 4'5B;&EC"B  ($QI8V5N<V4 87, <'5B;&ES:&5D(&)Y('1H
M92!&<F5E(%-O9G1W87)E($9O=6YD871I;VX[(&5I=&AE< H ("!V97)S:6]N

M;&%T97( =F5R<VEO;BX*"B  (%1H92!'3E4 0R!,:6)R87)Y(&ES(&1I<W1R
M:6)U=&5D(&EN('1H92!H;W!E('1H870 :70 =VEL;"!B92!U<V5F=6PL"B  
M(&)U="!7251(3U54($%.62!705)204Y463L =VET:&]U="!E=F5N('1H92!I
M;7!L:65D('=A<G)A;G1Y(&]F"B  ($U%4D-(04Y404))3$E462!O<B!&251.
M15-3($9/4B!!(%!!4E1)0U5,05( 4%524$]312X (%-E92!T:&4 1TY5"B  
M($QE<W-E<B!'96YE<F%L(%!U8FQI8R!,:6-E;G-E(&9O<B!M;W)E(&1E=&%I
M;',N" H ("!9;W4 <VAO=6QD(&AA=F4 <F5C96EV960 82!C;W!Y(&]F('1H
M92!'3E4 3&5S<V5R($=E;F5R86P 4'5B;&EC"B  ($QI8V5N<V4 86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E
M<F%T:6]N(&]N(&YO;BUS;V-K970 *B\*"45$15-4041$4E)%40D],SDL"2\J
M($1E<W1I;F%T:6]N(&%D9')E<W, <F5Q=6ER960 *B\*"45-4T=325I%"3TT

M(%!R;W1O8V]L('=R;VYG('1Y<&4 9F]R('-O8VME=" J+PH)14Y/4%)/5$]/
M4%0)/30R+ DO*B!0<F]T;V-O;"!N;W0 879A:6QA8FQE("HO" E%4%)/5$].
M3U-54%!/4E0)/30S+ DO*B!0<F]T;V-O;"!N;W0 <W5P<&]R=&5D("HO" E%

M=&5D("HO" E%3U!.3U1355!0"3TT-2P)+RH 3W!E<F%T:6]N(&YO="!S=7!P
M;W)T960 ;VX <V]C:V5T("HO" E%4$9.3U-54%!/4E0)/30V+ DO*B!0<F]T
M;V-O;"!F86UI;'D ;F]T('-U<'!O<G1E9" J+PH)14%&3D]355!03U)4"3TT
M-RP)+RH 061D<F5S<R!F86UI;'D ;F]T('-U<'!O<G1E9"!B>2!P<F]T;V-O
M;"!F86UI;'D *B\*"45!1$1224Y54T4)/30X+ DO*B!!9&1R97-S(&%L<F5A
M9'D :6X =7-E("HO" E%041$4DY/5$%604E,"3TT.2P)+RH 0V%N)W0 87-S
M:6=N(')E<75E<W1E9"!A9&1R97-S("HO" E%3D541$]73 D]-3 L"2\J($YE
M='=O<FL :7, 9&]W;B J+PH)14Y%5%5.4D5!0T )/34Q+ DO*B!.971W;W)K
M(&ES('5N<F5A8VAA8FQE("HO" E%3D544D53150)/34R+ DO*B!.971W;W)K
M(&1R;W!P960 8V]N;F5C=&EO;B!O;B!R97-E=" J+PH)14-/3DY!0D]25$5$
M"3TU,RP)+RH 4V]F='=A<F4 8V%U<V5D(&-O;FYE8W1I;VX 86)O<G0 *B\*

M*B\*"45.3T)51E,)"3TU-2P)+RH 3F\ 8G5F9F5R('-P86-E(&%V86EL86)L
M92 J+PH)14E30T].3 D)/34V+ DO*B!3;V-K970 :7, 86QR96%D>2!C;VYN

M96-T960 *B\*"4532%541$]73 D]-3 L"2\J($-A;B=T('-E;F0 869T97( 
M<V]C:V5T('-H=71D;W=N("HO" E%5$]/34%.65)%1E,)/34Y+ DO*B!4;V\ 
M;6%N>2!R969E<F5N8V5S.B!C86XG="!S<&QI8V4 *B\*"45424U%1$]55 D]
M-C L"2\J($-O;FYE8W1I;VX =&EM960 ;W5T("HO" E%0T].3E)%1E53140)

M(%1O;R!M86YY(&QE=F5L<R!O9B!S>6UB;VQI8R!L:6YK<R J+PH)14Y!3454
M3T],3TY'"3TV,RP)+RH 1FEL92!N86UE('1O;R!L;VYG("HO" E%2$]35$1/

M"2\J($YO(')O=71E('1O(&AO<W0 *B\*"45.3U1%35!460D]-C8L"2\J($1I

M;GD <')O8V5S<V5S("HO" E%55-%4E,)"3TV."P)+RH 5&]O(&UA;GD =7-E
M<G, *B\*"45$455/5 D)/38Y+ DO*B!$:7-C('%U;W1A(&5X8V5E9&5D("HO
M" E%4U1!3$4)"3TW,"P)+RH 4W1A;&4 3D93(&9I;&4 :&%N9&QE("HO" E%
M4D5-3U1%"0D]-S$L"2\J(%1O;R!M86YY(&QE=F5L<R!O9B!R96UO=&4 :6X 
M<&%T:" J+PH)14)!1%)00PD)/3<R+ DO*B!24$, <W1R=6-T(&ES(&)A9" J

M"4504D]'54Y!5D%)3 D]-S0L"2\J(%)00R!P<F]G+B!N;W0 879A:6P *B\*
M"4504D]'34E334%40T )/3<U+ DO*B!0<F]G<F%M('9E<G-I;VX =W)O;F< 


M*B\*"45.3U-94PD)/3<X+ DO*B!&=6YC=&EO;B!N;W0 :6UP;&5M96YT960 
M*B\*"45/5D521DQ/5PD]-SDL"2\J(%9A;'5E('1O;R!L87)G92!T;R!B92!S

M3T1%>PH)4E]/2PD]-"P)+RH 5&5S="!F;W( <F5A9"!P97)M:7-S:6]N+B  
M*B\*"5=?3TL)/3(L"2\J(%1E<W0 9F]R('=R:71E('!E<FUI<W-I;VXN(" J
M+PH)6%]/2PD],2P)+RH 5&5S="!F;W( 97AE8W5T92!P97)M:7-S:6]N+B  
M*B\*"49?3TL)/3 L"2\J(%1E<W0 9F]R(&5X:7-T96YC92X ("HO"GT*"G!U


M(%-E96L 9G)O;2!C=7)R96YT('!O<VET:6]N+B  *B\*"5-%14M?14Y$"3TR
M+ DO*B!3965K(&9R;VT 96YD(&]F(&9I;&4N(" J+PI]" HO*BH 5F%L=65S
M(&9O<B!T:&4 3D%-12!A<F=U;65N="!T;R! <&%T:&-O;F8G(&%N9"! 9G!A


M0U].04U%7TU!6"P*"5]00U]0051(7TU!6"P*"5]00U]025!%7T)51BP*"5]0


M3RP*"5]00U]33T-+7TU!6$)51BP*"5]00U]&24Q%4TE:14))5%,L" E?4$-?





M<R!O9B!35$%455,N(" J+PH)=F]I9"!?97AI=" H:6YT('-T871U<RD[" D*
M"2\J(%1E<W0 9F]R(&%C8V5S<R!T;R!.04U%('5S:6YG('1H92!R96%L(%5)
M1"!A;F0 <F5A;"!'240N(" J+PH):6YT(&%C8V5S<R H8VAA<BH ;F%M92P 
M:6YT(&UO9&4I.PH*"2\J(%1E<W0 9F]R(&%C8V5S<R!T;R!.04U%('5S:6YG
M('1H92!E9F9E8W1I=F4 54E$(&%N9"!'240 *&%S(&YO<FUA;"!F:6QE(&]P
M97)A=&EO;G, =7-E*2X ("HO" EI;G0 975I9&%C8V5S<R H8VAA<BH ;F%M
M92P :6YT(&UO9&4I.PH*"2\J($-H86YG92!T:&4 <')O8V5S<R=S('=O<FMI
M;F< 9&ER96-T;W)Y('1O(%!!5$ N(" J+PH):6YT(&-H9&ER("AC:&%R*B!P
M871H*3L*"0H)+RH 0VAA;F=E('1H92!O=VYE<B!A;F0 9W)O=7  ;V8 <&%T
M:"X ("HO" EI;G0 8VAO=VX *&-H87(J('!A=& L('5I9%]T(&]W;F5R+"!G
M:61?="!G<F]U<"D[" D*"2\J($-L;W-E('1H92!F:6QE(&1E<V-R:7!T;W( 
M1D0N("HO" EI;G0 8VQO<V4 *&EN="!F9"D[" D*"2\J($1U<&QI8V%T92!&
M1"P <F5T=7)N:6YG(&$ ;F5W(&9I;&4 9&5S8W)I<'1O<B!O;B!T:&4 <V%M
M92!F:6QE+B  *B\*"6EN="!D=7  *&EN="!O;&1F9"D[" D*"2\J($1U<&QI

M;B!O;B!T:&4 <V%M92!F:6QE+B  *B\*"6EN="!D=7 R("AI;G0 ;VQD9F0L
M(&EN="!N97=F9"D[" D*"2\J($5X96-U=&4 4$%42"!W:71H(&%L;"!A<F=U
M;65N=', 869T97( 4$%42"!U;G1I; H)("  82!.54Q,('!O:6YT97( 86YD
M(&5N=FER;VYM96YT(&9R;VT 8&5N=FER;VXG+B  *B\*"6EN="!E>&5C;" H
M8VAA<BH <&%T:"P +BXN*3L*"0H)+RH 17AE8W5T92!0051(('=I=&  86QL
M(&%R9W5M96YT<R!A9G1E<B!0051(('5N=&EL(&$ 3E5,3"!P;VEN=&5R+ H)
M("  86YD('1H92!A<F=U;65N="!A9G1E<B!T:&%T(&9O<B!E;G9I<F]N;65N
M="X ("HO" EI;G0 97AE8VQE("AC:&%R*B!P871H+" N+BXI.PH)" DO*B!%
M>&5C=71E($9)3$4L('-E87)C:&EN9R!I;B!T:&4 8%!!5$ G(&5N=FER;VYM
M96YT('9A<FEA8FQE(&EF" D ("!I="!C;VYT86EN<R!N;R!S;&%S:&5S+"!W
M:71H(&%L;"!A<F=U;65N=', 869T97( 1DE,12!U;G1I;"!A" D ("!.54Q,
M('!O:6YT97( 86YD(&5N=FER;VYM96YT(&9R;VT 8&5N=FER;VXG+B  *B\*
M"6EN="!E>&5C;'  *&-H87(J(&9I;&4L("XN+BD[" D*"2\J($5X96-U=&4 
M4$%42"!W:71H(&%R9W5M96YT<R!!4D=6(&%N9"!E;G9I<F]N;65N="!F<F]M
M(&!E;G9I<F]N)RX ("HO" EI;G0 97AE8W8 *&-H87(J('!A=& L(&-H87(J
M*B!A<F=V*3L*"0H)+RH 4F5P;&%C92!T:&4 8W5R<F5N="!P<F]C97-S+"!E
M>&5C=71I;F< 4$%42"!W:71H(&%R9W5M96YT<R!!4D=6(&%N9 H)("  96YV
M:7)O;FUE;G0 14Y64"X ($%21U8 86YD($5.5E  87)E('1E<FUI;F%T960 
M8GD 3E5,3"!P;VEN=&5R<RX ("HO" EI;G0 97AE8W9E("AC:&%R*B!P871H
M+"!C:&%R*BH 87)G=BP 8VAA<BHJ(&5N=G I.PH*"2\J($5X96-U=&4 1DE,
M12P <V5A<F-H:6YG(&EN('1H92! 4$%42"< 96YV:7)O;FUE;G0 =F%R:6%B
M;&4 :68 :70 8V]N=&%I;G,*"2  (&YO('-L87-H97,L('=I=&  87)G=6UE
M;G1S($%21U8 86YD(&5N=FER;VYM96YT(&9R;VT 8&5N=FER;VXG+B  *B\)
M" EI;G0 97AE8W9P("AC:&%R*B!F:6QE+"!C:&%R*BH 87)G=BD[" D*"2\J
M($-L;VYE('1H92!C86QL:6YG('!R;V-E<W,L(&-R96%T:6YG(&%N(&5X86-T
M(&-O<'DN" D ("!2971U<FX +3$ 9F]R(&5R<F]R<RP ,"!T;R!T:&4 ;F5W
M('!R;V-E<W,L" D ("!A;F0 =&AE('!R;V-E<W, 240 ;V8 =&AE(&YE=R!P
M<F]C97-S('1O('1H92!O;&0 <')O8V5S<RX ("HO" EP:61?="!F;W)K(" I
M.PH)" DO*B!'970 =&AE('!A=&AN86UE(&]F('1H92!C=7)R96YT('=O<FMI
M;F< 9&ER96-T;W)Y+ H)("  86YD('!U="!I="!I;B!325I%(&)Y=&5S(&]F
M($)51BX (%)E='5R;G, 3E5,3"!I9B!T:&4*"2  (&1I<F5C=&]R>2!C;W5L
M9&XG="!B92!D971E<FUI;F5D(&]R(%-)6D4 =V%S('1O;R!S;6%L;"X*"2  
M($EF('-U8V-E<W-F=6PL(')E='5R;G, 0E5&+B  26X 1TY5+"!I9B!"548 
M:7, 3E5,3"P*"2  (&%N(&%R<F%Y(&ES(&%L;&]C871E9"!W:71H(&!M86QL
M;V,G.R!T:&4 87)R87D :7, 4TE:10H)("  8GET97, ;&]N9RP =6YL97-S
M(%-)6D4 /3T ,"P :6X =VAI8V  8V%S92!I="!I<R!A<PH)("  8FEG(&%S
M(&YE8V5S<V%R>2X ("HO" EC:&%R*B!G971C=V0 *&-H87(J(&)U9BP <VEZ
M95]T('-I>F4I.PH)" DO*B!'970 =&AE(&5F9F5C=&EV92!G<F]U<"!)1"!O
M9B!T:&4 8V%L;&EN9R!P<F]C97-S+B  *B\*"6=I9%]T(&=E=&5G:60 *"D[
M" D*"2\J($=E="!T:&4 969F96-T:79E('5S97( 240 ;V8 =&AE(&-A;&QI
M;F< <')O8V5S<RX ("HO" EU:61?="!G971E=6ED(" I.PH)" DO*B!'970 
M=&AE(')E86P 9W)O=7  240 ;V8 =&AE(&-A;&QI;F< <')O8V5S<RX ("HO
M" EG:61?="!G971G:60 *"D[" D*"2\J($EF(%-)6D4 :7, >F5R;RP <F5T
M=7)N('1H92!N=6UB97( ;V8 <W5P<&QE;65N=&%R>2!G<F]U<',*"2  ('1H
M92!C86QL:6YG('!R;V-E<W, :7, :6XN("!/=&AE<G=I<V4L(&9I;&P :6X 
M=&AE(&=R;W5P($E$<PH)("  ;V8 :71S('-U<'!L96UE;G1A<GD 9W)O=7!S
M(&EN($Q)4U0 86YD(')E='5R;B!T:&4 ;G5M8F5R('=R:71T96XN(" J+PH)
M:6YT(&=E=&=R;W5P<R H:6YT(&)U9E-I>F4L(&=I9%]T*B!B=69F97(I.PH)
M" DO*B!'970 =&AE('!R;V-E<W, 240 ;V8 =&AE(&-A;&QI;F< <')O8V5S
M<RX ("HO" EP:61?="!G971P:60 *"D[" H)+RH 1V5T('1H92!P<F]C97-S
M($E$(&]F('1H92!C86QL:6YG('!R;V-E<W,G<R!P87)E;G0N(" J+PH)<&ED
M7W0 9V5T<'!I9" H*3L*"0H)+RH 1V5T('1H92!R96%L('5S97( 240 ;V8 
M=&AE(&-A;&QI;F< <')O8V5S<RX ("HO" EU:61?="!G971U:60 *"D[" D*
M"2\J(%)E='5R;B Q(&EF($9$(&ES(&$ =F%L:60 9&5S8W)I<'1O<B!A<W-O
M8VEA=&5D" D ("!W:71H(&$ =&5R;6EN86PL('IE<F\ :68 ;F]T+B  *B\*
M"6EN="!I<V%T='D *&EN="!F9"D[" D*"2\J($UO=F4 1D0G<R!F:6QE('!O
M<VET:6]N('1O($]&1E-%5"!B>71E<R!F<F]M('1H90H)("  8F5G:6YN:6YG
M(&]F('1H92!F:6QE("AI9B!72$5.0T4 :7, 4T5%2U]3150I+ H)("  =&AE

M("!O<B!T:&4 96YD(&]F('1H92!F:6QE("AI9B!72$5.0T4 :7, 4T5%2U]%
M3D0I+ H)("  4F5T=7)N('1H92!N97< 9FEL92!P;W-I=&EO;BX ("HO" EL
M;VYG(&QS965K("AI;G0 9F0L(&QO;F< ;V9F<V5T+"!I;G0 =VAE;F-E*3L*
M" DO*B!296%D($Y"651%4R!I;G1O($)51B!F<F]M($9$+B  4F5T=7)N('1H
M90H)("  ;G5M8F5R(')E860L("TQ(&9O<B!E<G)O<G, ;W( ,"!F;W( 14]&
M+B J+PH):6YT(')E860 *&EN="!F9"P 8VAA<BH 8G5F+"!S:7IE7W0 <VEZ
M92D[" H)+RHJ($UA:V4 =&AE('!R;V-E<W, <VQE97  9F]R(%-%0T].1%, 
M<V5C;VYD<RP ;W( =6YT:6P 82!S:6=N86P 87)R:79E<PH)("  86YD(&ES
M(&YO="!I9VYO<F5D+B  5&AE(&9U;F-T:6]N(')E='5R;G, =&AE(&YU;6)E

M8W1U86QL>2!S;&5P=" H=&AU<R!Z97)O(&EF(&ET('-L97!T('1H92!F=6QL
M('1I;64I+ H)("  268 82!S:6=N86P :&%N9&QE<B!D;V5S(&$ 8&QO;F=J
M;7 G(&]R(&UO9&EF:65S('1H92!H86YD;&EN9R!O9B!T:&4*"2  (%-)1T%,
M4DT <VEG;F%L('=H:6QE(&EN<VED92! <VQE97 G(&-A;&PL('1H92!H86YD
M;&EN9R!O9B!T:&4 4TE'04Q230H)("  <VEG;F%L(&%F=&5R=V%R9', :7, 
M=6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:68 ;F]T+B  *B\*"6EN="!P:7!E("AI;G0 <&EP961E<ULR72D[" D*
M"2\J*B!38VAE9'5L92!A;B!A;&%R;2X ($EN(%-%0T].1%, <V5C;VYD<RP 

M4R!I<R!Z97)O+"!A;GD 8W5R<F5N=&QY('-C:&5D=6QE9"!A;&%R;2!W:6QL
M(&)E(&-A;F-E;&QE9"X*"2  (%1H92!F=6YC=&EO;B!R971U<FYS('1H92!N
M=6UB97( ;V8 <V5C;VYD<R!R96UA:6YI;F< =6YT:6P =&AE(&QA<W0*"2  
M(&%L87)M('-C:&5D=6QE9"!W;W5L9"!H879E('-I9VYA;&5D+"!O<B!Z97)O
M(&EF('1H97)E('=A<VXG="!O;F4N" D ("!4:&5R92!I<R!N;R!R971U<FX 
M=F%L=64 =&\ :6YD:6-A=&4 86X 97)R;W(L(&)U="!Y;W4 8V%N('-E="! 
M97)R;F\G" D ("!T;R P(&%N9"!C:&5C:R!I=', =F%L=64 869T97( 8V%L
M;&EN9R! 86QA<FTG+"!A;F0 =&AI<R!M:6=H="!T96QL('EO=2X*"2  (%1H
M92!S:6=N86P ;6%Y(&-O;64 ;&%T92!D=64 =&\ <')O8V5S<V]R('-C:&5D
M=6QI;F<N(" J+PH)=6EN="!A;&%R;2 H=6EN="!S96-O;F1S*3L*" DO*BH 
M4W5S<&5N9"!T:&4 <')O8V5S<R!U;G1I;"!A('-I9VYA;"!A<G)I=F5S+ H)
M("  5&AI<R!A;'=A>7, <F5T=7)N<R M,2!A;F0 <V5T<R! 97)R;F\G('1O
M($5)3E12+B J+PH):6YT('!A=7-E(" I.PH*"2\J*B!2971U<FX 82!M86QL
M;V,G9"!S=')I;F< 8V]N=&%I;FEN9R!T:&4 8W5R<F5N="!D:7)E8W1O<GD 
M;F%M92X*"2  ($EF('1H92!E;G9I<F]N;65N="!V87)I86)L92! 4%=$)R!I
M<R!S970L(&%N9"!I=', =F%L=64 :7, 8V]R<F5C="P*"2  ('1H870 =F%L
M=64 :7, =7-E9"X ("HO" EC:&%R*B!G971?8W5R<F5N=%]D:7)?;F%M92 H
M*3L*"0H)+RHJ($Y53$PM=&5R;6EN871E9"!A<G)A>2!O9B B3D%-13U604Q5
M12( 96YV:7)O;FUE;G0 =F%R:6%B;&5S+B  *B\*"6-H87( *BI?7V5N=FER
M;VX[" H)+RHJ($=E="!F:6QE+7-P96-I9FEC(&-O;F9I9W5R871I;VX :6YF
M;W)M871I;VX 86)O=70 4$%42"X ("HO" EL;VYG('!A=&AC;VYF("AC:&%R
M*B!P871H+"!I;G0 ;F%M92D[" H)+RHJ($=E="!F:6QE+7-P96-I9FEC(&-O
M;F9I9W5R871I;VX 86)O=70 9&5S8W)I<'1O<B!&1"X ("HO" EL;VYG(&9P
M871H8V]N9B H:6YT(&9D+"!I;G0 ;F%M92D[" D*"2\J*B!'970 =&AE('9A
M;'5E(&]F('1H92!S>7-T96T =F%R:6%B;&4 3D%-12X ("HO" EL;VYG('-Y

M<F%C=&5R<R!F<F]M($M%62!U<VEN9R!S86QT('1O('!E<G1U<F( 1$53+B  
M*B\*"6-H87(J(&-R>7!T("AC:&%R*B!K97DL("!C:&%R*B!A;'0I.PH)" DO
M*BH 16YC<GEP="!D871A(&EN($),3T-+(&EN('!L86-E(&EF($5$1DQ!1R!I
M<R!Z97)O.R!O=&AE<G=I<V4 9&5C<GEP= H)("  8FQO8VL :6X <&QA8V4N
M(" J+PH)=F]I9"!E;F-R>7!T("AC:&%R*B!B;&]C:RP :6YT(&5D9FQA9RD[
M" H)+RHJ(%-E="!T:&4 <')O8V5S<R!G<F]U<"!)1"!O9B!T:&4 <')O8V5S
M<R!M871C:&EN9R!0240 =&\ 4$=)1"X*"2  ($EF(%!)1"!I<R!Z97)O+"!T
M:&4 8W5R<F5N="!P<F]C97-S)W, <')O8V5S<R!G<F]U<"!)1"!I<R!S970N
M" D ("!)9B!01TE$(&ES('IE<F\L('1H92!P<F]C97-S($E$(&]F('1H92!P
M<F]C97-S(&ES('5S960N(" J+PH):6YT('-E='!G:60 *'!I9%]T('!I9"QP
M:61?="!P9VED*3L*" DO*BH 0W)E871E(&$ ;F5W('-E<W-I;VX =VET:"!T
M:&4 8V%L;&EN9R!P<F]C97-S(&%S(&ET<R!L96%D97(N" D ("!4:&4 <')O
M8V5S<R!G<F]U<"!)1', ;V8 =&AE('-E<W-I;VX 86YD('1H92!C86QL:6YG
M('!R;V-E<W,*"2  (&%R92!S970 =&\ =&AE('!R;V-E<W, 240 ;V8 =&AE
M(&-A;&QI;F< <')O8V5S<RP =VAI8V  :7, <F5T=7)N960N(" J+PH)<&ED
M7W0 <V5T<VED(" I.PH*"2\J*B!3970 =&AE('5S97( 240 ;V8 =&AE(&-A
M;&QI;F< <')O8V5S<R!T;R!5240N" D ("!)9B!T:&4 8V%L;&EN9R!P<F]C
M97-S(&ES('1H92!S=7!E<BUU<V5R+"!S970 =&AE(')E86P*"2  (&%N9"!E
M9F9E8W1I=F4 =7-E<B!)1',L(&%N9"!T:&4 <V%V960 <V5T+75S97(M240 
M=&\ 54E$.PH)("  :68 ;F]T+"!T:&4 969F96-T:79E('5S97( 240 :7, 
M<V5T('1O(%5)1"X ("HO" EI;G0 <V5T=6ED("AU:61?="!U:60I.PH*"2\J
M*B!3970 =&AE(&=R;W5P($E$(&]F('1H92!C86QL:6YG('!R;V-E<W, =&\ 
M1TE$+ H)("  268 =&AE(&-A;&QI;F< <')O8V5S<R!I<R!T:&4 <W5P97(M
M=7-E<BP <V5T('1H92!R96%L" D ("!A;F0 969F96-T:79E(&=R;W5P($E$
M<RP 86YD('1H92!S879E9"!S970M9W)O=7 M240 =&\ 1TE$.PH)("  :68 
M;F]T+"!T:&4 969F96-T:79E(&=R;W5P($E$(&ES('-E="!T;R!'240N(" J
M+PH):6YT('-E=&=I9" H9VED7W0 9W)O=7 I.PH*"2\J*B!-86ME(&$ ;&EN
M:R!T;R!&4D]-(&YA;65D(%1/+B  *B\*"6EN="!L:6YK("AC:&%R*B!F<F]M
M+"!C:&%R*B!T;RD[" D*"2\J*B!-86ME(&$ <WEM8F]L:6, ;&EN:R!T;R!&
M4D]-(&YA;65D(%1/+B  *B\*"6EN="!S>6UL:6YK("AC:&%R*B!F<F]M+"!C
M:&%R*B!T;RD[" H)+RHJ(%)E860 =&AE(&-O;G1E;G1S(&]F('1H92!S>6UB
M;VQI8R!L:6YK(%!!5$  :6YT;R!N;R!M;W)E('1H86X*"2  ($Q%3B!B>71E
M<R!O9B!"548N("!4:&4 8V]N=&5N=', 87)E(&YO="!N=6QL+71E<FUI;F%T
M960N" D ("!2971U<FYS('1H92!N=6UB97( ;V8 8VAA<F%C=&5R<R!R96%D
M+"!O<B M,2!F;W( 97)R;W)S+B  *B\*"6EN="!R96%D;&EN:R H8VAA<BH 
M<&%T:"P 8VAA<BH 8G5F+"!S:7IE7W0 ;&5N*3L*" DO*BH 4F5M;W9E('1H
M92!L:6YK($Y!344N(" J+PH):6YT('5N;&EN:R H8VAA<BH ;F%M92D[" H)
M+RHJ(%)E;6]V92!T:&4 9&ER96-T;W)Y(%!!5$ N(" J+PH):6YT(')M9&ER
M("AC:&%R*B!P871H*3L*" DO*BH 4F5T=7)N('1H92!F;W)E9W)O=6YD('!R
M;V-E<W, 9W)O=7  240 ;V8 1D0N(" J+PH)<&ED7W0 =&-G971P9W)P("AI
M;G0 9F0I.PH*"2\J*B!3970 =&AE(&9O<F5G<F]U;F0 <')O8V5S<R!G<F]U
M<"!)1"!O9B!&1"!S970 4$=24%])1"X ("HO" EI;G0 =&-S971P9W)P("AI
M;G0 9F0L('!I9%]T('!G<G!?:60I.PH)" DO*BH 4F5T=7)N('1H92!L;V=I
M;B!N86UE(&]F('1H92!U<V5R+B J+PH)8VAA<BH 9V5T;&]G:6X *"D["GT*
!" ``
`
end
Oct 17 2004
parent clayasaurus <clayasaurus gmail.com> writes:
Thomas Kuehne wrote:
 On each and every project I had to include some of unistd.h stuff (Linux /
POSIX calls).
 
 In order to ease development I've tired to condense the most importend parts
into unistd.d.
 
 Thomas
 
 
awesome :-)
Oct 19 2004