Unix Man ( )


EXEC(3) - 2


ooaecy oay popey poecca (c. ) ID poecca ID poecca-oa ID py poecco ae ceaopo (c. ) ID epao py (c. signal(3)) a paccpo (c. , apoc 0) aep poecca (c. ) ey aao opeo aao acy oa a (c. ) aca paep aa (c. ) tms_utime, tms_stime, tms_cutime, tms_cstime (c. ).

B popaax a e C peaa oa exec oo ooac y execl execv. y execl peec oa, oa oeoo aa epeaaee apye ec apaee; o yaac e cox cpo - apyeo y. o coae, ep apye oe coaa o c ee aa, o c oce ooeo oo e. oce apyeo cce oe yeo yaae.

y execv peec, oa apaee eeco co apyeo. Apyea o cyae c aa acc cpo, coepax epeaaee ay apye. oce eeo acca oe yeo yaae.

popaa a e C, oyaa ypaee peyae exec, oa e cey opao oca xo:

void main (argc, argv, envp) int argc; char **argv, **envp;

e argc - ce ca apyeo;
argv - acc yaaee a apye, pecaee e cox cpo;
envp - acc yaaee cpo, peca coo oay cpey.

argc oe , o pae epe, e ee 1 argv[0] oe coaa c ee oce ooeo e aa.

argv oe eocpeceo cooac pyo execv, ocoy argv[argc] pae 0.

Kaa cpoa acce, yaaeo envp, coco e, aa "=" ae (coo cpo, aepaeo coo NUL). Macc aepaec ye yaaee. eppeaop oa epeae aeo popae aece oao cpe ea ae oax epeex, oex coppye. Cco oo coppyex e c. . p oe popa aee envp pcaaec ee epeeo environ, oopa coyec execv execl epea oao cpe o opopae ao popa. epecee e y opao epea oay cpey: