⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 execve.2

📁 操作系统设计与实现源码
💻 2
📖 第 1 页 / 共 2 页
字号:
%!PS-Adobe-1.0%%Creator: devps (Pipeline Associates, Inc.)%%CreationDate: Fri Sep 13 13:05:39 1996%%Pages: (atend)%%DocumentFonts: (atend)/devps 180 dict def devps begin/res 10.000000 def/y_offset 843 def/X{exch}bind def/mm {transform round X round X itransform} bind def/r{rmoveto}bind def/m{moveto}bind def/l{lineto}bind def/rl{rlineto}bind def/st{stroke}bind def/gs{gsave}bind def/gr{grestore}bind def/cp{currentpoint}bind def/np{newpath}bind def/ct{curveto}bind defsystemdict /setpacking known { /savepacking currentpacking def true setpacking } if/m0{0 0 moveto}bind def/xc{//res div}bind def/yc{//res neg div //y_offset add}bind def/lc{yc X xc X l st}bind def/mc{yc X xc X m}bind def/el{gs /a X def a div 1 X scale cp np a xc 2 div 0 360 arc st gr}bind def/ar{cp 7 2 roll np xc 5 1 roll atan 3 1 roll atan X arc st}bind def/sp{yc X xc X 6 2 roll yc X xc X 6 2 roll yc X xc X 6 2 roll ct}bind def/V{//res neg div //y_offset addcurrentpoint pop Xm}bind def/H{//res div0 transform X round X itransform popcurrentpoint X popmoveto}bind def/h{//res div 0 r}bind def/v{//res neg div 0 X r}bind def/S{X H show}bind def/A{H //res div 1 index stringwidth pop sub 1 index length div 0 3 2 roll ashow}bind def/psize 10 def/height 0 def/cheight { height 0 ne { height } { psize } ifelse } bind def/slant 0 def/FF{findfont X dup 30 div 0 mm pop setlinewidth /psize X def    [psize 0 cheight slant sin slant cos div mul cheight 0 0]    makefont setfont}bind def/shade{gs /dy X def /dx X def np m 0 /dy rl /dx 0 rl 0 /dy neg rl /dx neg 0 rl closepath .9 setgray fillgr}bind def1 setlinecap/resolution res 72 mul def/startFig {	/SavedState save def	userdict maxlength dict begin	currentpoint transform	DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap		setlinewidth setmatrix	itransform moveto	/ury exch def	/urx exch def	/lly exch def	/llx exch def	/y exch 72 mul resolution div def	/x exch 72 mul resolution div def		currentpoint /cy exch def /cx exch def	/sx x urx llx sub div def	/sy y ury lly sub div def	sx sy scale	cx sx div llx sub	cy sy div ury sub translate		/DefFigCTM matrix currentmatrix def	/initmatrix {		DefFigCTM setmatrix	} def	/defaultmatrix {		DefFigCTM exch copy	} def	/initgraphics {		DocumentInitState setmiterlimit setgray setdash 			setlinejoin setlinecap setlinewidth setmatrix		DefFigCTM setmatrix	} def	/showpage {		initgraphics	} def}bind  def/clipFig {	currentpoint 6 2 roll	newpath 4 copy	4 2 roll moveto	6 -1 roll exch lineto	exch lineto	exch lineto	closepath clip	newpath	moveto}bind  def/doclip { llx lly urx ury clipFig } def/endFig {	end SavedState restore}bind  def/globalstart {	fontnum psize slant height resolution currentpoint 	pagesave restore gsave }bind  def/globalend {	grestore moveto	/resolution exch def /height exch def	/slant exch def /psize exch def /fontnum exch def	F	/pagesave save def}bind  def/fontnum 1 def systemdict /setpacking known { savepacking setpacking} ifend/BP{save mark devps begin m0/DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecapcurrentlinejoin currentdash currentgray currentmiterlimit ] cvx def}bind def/EP{end cleartomark restore showpage}def/Encoding-1 256 array def0 1 255 {Encoding-1 exch /.notdef put} forEncoding-1 8#301 StandardEncoding 8#101 26 getinterval putinterval %A-BEncoding-1 8#341 StandardEncoding 8#141 26 getinterval putinterval %a-bEncoding-1 8#241 StandardEncoding 8#301 16 getinterval putinterval %accentsEncoding-1 8#373 StandardEncoding 8#365 1 getinterval putinterval %dotlessiEncoding-1dup 8#41 /copyright putdup 8#42 /registered putdup 8#43 /trademark putdup 8#44 /logicalnot putdup 8#45 /Eth putdup 8#46 /eth putdup 8#47 /Thorn putdup 8#50 /thorn putdup 8#51 /brokenbar putdup 8#52 /degree putdup 8#53 /divide putdup 8#54 /multiply putdup 8#55 /minus putdup 8#56 /onehalf putdup 8#57 /onequarter putdup 8#60 /threequarters putdup 8#101 /Aacute putdup 8#102 /Acircumflex putdup 8#103 /Adieresis putdup 8#104 /Agrave putdup 8#105 /Aring putdup 8#106 /Atilde putdup 8#107 /Ccedilla putdup 8#110 /Eacute putdup 8#111 /Ecircumflex putdup 8#112 /Edieresis putdup 8#113 /Egrave putdup 8#114 /Iacute putdup 8#115 /Icircumflex putdup 8#116 /Idieresis putdup 8#117 /Igrave putdup 8#120 /Ntilde putdup 8#121 /Oacute putdup 8#122 /Ocircumflex putdup 8#123 /Odieresis putdup 8#124 /Ograve putdup 8#125 /Otilde putdup 8#126 /Scaron putdup 8#127 /Uacute putdup 8#130 /Ucircumflex putdup 8#131 /Udieresis putdup 8#132 /Ugrave putdup 8#133 /Ydieresis putdup 8#134 /Zcaron putdup 8#135 /aacute putdup 8#136 /acircumflex putdup 8#137 /adieresis putdup 8#140 /agrave putdup 8#141 /aring putdup 8#142 /atilde putdup 8#143 /ccedilla putdup 8#144 /eacute putdup 8#145 /ecircumflex putdup 8#146 /edieresis putdup 8#147 /egrave putdup 8#150 /iacute putdup 8#151 /icircumflex putdup 8#152 /idieresis putdup 8#153 /igrave putdup 8#154 /ntilde putdup 8#155 /oacute putdup 8#156 /ocircumflex putdup 8#157 /odieresis putdup 8#160 /ograve putdup 8#161 /otilde putdup 8#162 /scaron putdup 8#163 /uacute putdup 8#164 /ucircumflex putdup 8#165 /udieresis putdup 8#166 /ugrave putdup 8#167 /ydieresis putdup 8#170 /zcaron putpop/Enc-dict 30 dict defEnc-dict /tmpstr1 50 string putEnc-dict /tmpstr2 50 string putEnc-dict /tmpstr3 50 string dup (Encoding-) exch cvs pop put/AEnc-def { % arguments: the original font's name, encoding nrEnc-dict begintmpstr2 cvs /Enc-no exch def % Remember the number in a stringdup /OrigName exch def % remember the namefindfont dup maxlength dict /newdict exch def % get dictionary for new font{ exch dup /FID ne   { exch newdict 3 1 roll put }   { pop pop } % Ignore FID   ifelse} forallnewdict begin/Encoding  tmpstr3 9 Enc-no putinterval tmpstr3 0 9 Enc-no length add getinterval  cvn load  def % Replace encodingcurrentdict /UniqueID known{ /UniqueID UniqueID Enc-no cvi 49999 mul add def } if % Derive New UniqueIDend % newdict/FNlength OrigName tmpstr1 cvs length def % convert name, remember lengthFNlength 1 add Enc-no length add stringdup 0 OrigName tmpstr1 cvs putintervaldup FNlength (-) putintervaldup FNlength 1 add Enc-no putintervaldup 0 tmpstr1 0 FNlength getinterval putinterval % Add old namecvn dup newdict /FontName 3 2 roll put newdict definefontend % Enc-dict} def/Times-Roman 1 AEnc-def pop/R-1{/Times-Roman-1 FF}def/R{/Times-Roman FF}def/B{/Times-Bold FF}def/I{/Times-Italic FF}def%%EndProlog%%Page: 1 1BP/slant 0 def/height 0 def480 V10 R720(EXECVE)S1127(\()S1169(2)S1227(\))S2696(Eighth)S(Edition)296 2989 A4720(EXECVE)S5127(\()S5169(2)S5227(\))S960 V9 R720(N)S722(NA)S790(AM)S858(ME)S940(E)S1080 V10 R1080(execve)S10 R-11385(-)S10 R1467(execute)S1800(a)S1870(\256le)S1248 V9 R720(S)S722(SY)S774(YN)S842(NO)S910(OP)S978(PS)S1030(SI)S1082(IS)S1115(S)S1368 V10 B1080(#include)S1482(<unistd.h>)S1608 V1080(int)S1236(execve\(const)S1812(char)S2046(*)S10 I2096(name)S10 B2314(,)S2377(char)S2611(*const)S10 I2923(argv)S10 B3107([],)S3238(char)S3472(*const)S10 I3784(envp)S10 B([]\))102 3974 A1776 V9 R720(D)S722(DE)S790(ES)S848(SC)S900(CR)S962(RI)S1024(IP)S1057(PT)S1109(TI)S1167(IO)S1200(ON)S1268(N)S1896 V10 B1080(Execve)S10 R1420(transforms)S1889(the)S(calling)274 2050 A2362(process)S2702(into)S2896(a)S2980(new)S3187(process.)S3578(The)S3774(new)S3981(process)S4322(is)S4428(constructed)S4931(from)S5166(an)S2016 V1080(ordinary)S1449(\256le)S1606(called)S1875(the)S10 I2026(new)S2216(process)S2551(\256le)S10 R2674(.)S2751(This)S2957(\256le)S3113(is)S3207(either)S3464(an)S3586(executable)S4044(object)S4317(\256le,)S4498(or)S4609(a)S4681(\256le)S4837(of)S4948(data)S5143(for)S2136 V1080(an)S1209(interpreter.)S1714(An)S1871(executable)S2336(object)S2616(\256le)S2779(consists)S3131(of)S3249(an)S3378(identifying)S3853(header,)S4182(followed)S4575(by)S4710(pages)S4974(of)S5093(data)S2256 V1080(representing)S1606(the)S(initial)235 1757 A2020(program)S2389(\(text\))S2636(and)S(initialized)403 2809 A3240(data)S3435(pages.)S(Additional)430 3741 A4198(pages)S4454(may)S4654(be)S4776(speci\256ed)S5161(by)S2376 V1080(the)S1228(header)S1522(to)S1625(be)S(initialized)403 1745 A2173(with)S2377(zero)S2576(data.)S2819(See)S10 B2990(a.out)S10 R3205(\(5\).)S2544 V1080(An)S1231(interpreter)S1680(\256le)S1837(begins)S2127(with)S2334(a)S2407(line)S2586(of)S2698(the)S2849(form)S3074(``#!)S10 I3255(interpreter)S10 R3691(''.)S3838(\(Minix-vmd)S4358(only.\))S4649(When)S4918(an)S5042(inter-)S2664 V1080(preter)S1351(\256le)S1515(is)S10 B1617(execve)S10 R1913('d,)S2056(the)S2213(system)S10 B2526(execve)S10 R2822('s)S2929(the)S3086(speci\256ed)S10 I3478(interpreter)S10 R3914(,)S3973(giving)S4263(it)S4353(the)S4510(name)S4762(of)S4880(the)S5037(origi-)S2784 V1080(nally)S1306(exec'd)S1600(\256le)S1754(as)S1863(an)S1983(argument)S2388(and)S2558(shifting)S2890(over)S3094(the)S3242(rest)S3413(of)S3522(the)S3670(original)S4008(arguments.)S2952 V1080(There)S1353(can)S1530(be)S1662(no)S1799(return)S2077(from)S2310(a)S(successful)414 2392 A10 B2843(execve)S10 R(because)319 3160 A3516(the)S(calling)274 3676 A3987(core)S4198(image)S4481(is)S4585(lost.)S4817(This)S5033(is)S5138(the)S3072 V1080(mechanism)S1563(whereby)S1935(different)S2308(process)S2635(images)S2945(become)S3283(active.)S3240 V1080(The)S1266(argument)S10 I1675(argv)S10 R1888(is)S1984(a)S2058(null-terminated)S2708(array)S2945(of)S3058(character)S3458(pointers)S3811(to)S3918(null-terminated)S4568(character)S4968(strings.)S3360 V1080(These)S1354(strings)S(constitute)391 1655 A2079(the)S2235(argument)S2648(list)S2804(to)S2914(be)S3041(made)S3291(available)S3687(to)S3797(the)S3952(new)S4152(process.)S4536(By)S(convention,)471 4685 A5188(at)S3480 V1080(least)S1293(one)S1467(argument)S1876(must)S2100(be)S2224(present)S2544(in)S2651(this)S2825(array,)S3087(and)S3261(the)S3413(\256rst)S3599(element)S3947(of)S4060(this)S4234(array)S(should)267 4471 A4767(be)S4891(the)S5043(name)S3600 V1080(of)S1189(the)S1337(executed)S1720(program)S2086(\(i.e.,)S2293(the)S2441(last)S(component)446 2606 A3077(of)S10 I3186(name)S10 R3404(\).)S3768 V1080(The)S1281(argument)S10 I1705(envp)S10 R1939(is)S2050(also)S2256(a)S2346(null-terminated)S3012(array)S3265(of)S3394(character)S3810(pointers)S4179(to)S4302(null-terminated)S4968(strings.)S3888 V1080(These)S1349(strings)S1645(pass)S1846(information)S2349(to)S2455(the)S2605(new)S2800(process)S3129(that)S3307(is)S3401(not)S3556(directly)S3891(an)S4013(argument)S4420(to)S4525(the)S4675(command)S5098(\(see)S4008 V10 B1080(environ)S10 R1410(\(7\)\).)S4176 V1080(Descriptors)S1574(open)S1798(in)S1905(the)S(calling)274 2057 A2360(process)S2691(remain)S3000(open)S3224(in)S3331(the)S3483(new)S3680(process,)S4036(except)S4328(for)S4475(those)S4716(for)S4863(which)S5138(the)S4296 V1080(close-on-exec)S1665(\257ag)S1841(is)S1933(set)S2070(\(see)S10 B2258(close)S10 R2465(\(2\)\).)S2692(Descriptors)S3182(that)S3358(remain)S3663(open)S3883(are)S4032(unaffected)S4483(by)S10 B4608(execve)S10 R4888(.)S4464 V(Ignored)313 1080 A1426(signals)S1738(remain)S(ignored)307 2052 A2393(across)S2679(an)S10 B2808(execve)S10 R3088(,)S3147(but)S3309(signals)S3622(that)S3807(are)S(caught)268 3965 A4267(are)S4425(reset)S4650(to)S4762(their)S4981(default)S4584 V1080(values.)S1417(Blocked)S1782(signals)S2090(remain)S2399(blocked)S2746(regardless)S3184(of)S3297(changes)S3650(to)S3757(the)S3909(signal)S4178(action.)S4503(The)S4689(signal)S4958(stack)S5194(is)S4704 V1080(reset)S1296(to)S1399(be)S(unde\256ned)396 1519 A1940(\(see)S10 B2128(sigaction)S10 R2508(\(2\))S2651(for)S2794(more)S3026(information\).)S4872 V

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -