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

📄 brk.2

📁 Unix操作系统minix 2.0源码
💻 2
字号:
%!PS-Adobe-1.0%%Creator: devps (Pipeline Associates, Inc.)%%CreationDate: Fri Sep 13 13:05:33 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/Times-Bold 1 AEnc-def pop/B-1{/Times-Bold-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(BRK)S935(\()S977(2)S1035(\))S2696(Eighth)S(Edition)296 2989 A4912(BRK)S5127(\()S5169(2)S5227(\))S960 V9 R720(N)S722(NA)S790(AM)S858(ME)S940(E)S1080 V10 R1080(brk,)S1264(sbrk)S10 R-11462(-)S10 R1544(change)S1854(data)S2047(segment)S2407(size)S1248 V9 R720(S)S722(SY)S774(YN)S842(NO)S910(OP)S978(PS)S1030(SI)S1082(IS)S1115(S)S1368 V10 R1080(#include)S1464(<unistd.h>)S1536 V10 B1080(char)S1314(*brk\(char)S1789(*)S10 I(addr)189 1839 A10 B2028(\))S1704 V1080(char)S1314(*sbrk\(int)S10 I1750(incr)S10 B1912(\))S1872 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)S1992 V10 B1080(Brk)S10 R1286(sets)S1475(the)S1636(system's)S2026(idea)S2232(of)S2354(the)S2515(lowest)S2816(data)S3022(segment)S3395(location)S3757(not)S3923(used)S4145(by)S4283(the)S4444(program)S4824(\(called)S5138(the)S2112 V1080(break\))S1372(to)S10 I(addr)189 1484 A10 R1681(.)S1765(Locations)S2196(greater)S2511(than)S10 I(addr)189 2718 A10 R2941(and)S3120(below)S3400(the)S3557(stack)S3798(pointer)S4117(are)S4274(not)S4435(in)S4546(the)S4702(address)S(space)224 5037 A2232 V1080(and)S(will)157 1250 A1432(thus)S1624(cause)S1873(a)S1943(memory)S2303(violation)S2685(if)S(accessed.)378 2772 A2400 V1080(In)S1195(the)S1349(alternate)S1728(function)S10 B2094(sbrk)S10 R2290(,)S10 I2346(incr)S10 R2539(more)S2777(bytes)S3020(are)S3175(added)S3446(to)S3555(the)S3710(program's)S4156(data)S(space)224 4356 A4612(and)S4789(a)S4866(pointer)S5183(to)S2520 V1080(the)S1228(start)S1427(of)S1536(the)S1684(new)S1877(area)S2071(is)S2163(returned.)S2688 V1080(When)S1346(a)S1417(program)S1784(begins)S2072(execution)S2489(via)S10 B2638(execve)S10 R2944(the)S3093(break)S3343(is)S3436(set)S3575(at)S3675(the)S3825(highest)S4142(location)S4493(de\256ned)S4816(by)S4943(the)S5093(pro-)S2808 V1080(gram)S1316(and)S1490(data)S1687(storage)S2007(areas.)S2294(Ordinarily,)S2768(therefore,)S3187(only)S3393(programs)S3801(with)S4008(growing)S4371(data)S4567(areas)S4803(need)S5021(to)S5127(use)S2928 V10 B1080(sbrk)S10 R1276(.)S3096 V9 R720(R)S722(RE)S784(ET)S842(TU)S900(UR)S968(RN)S1030(N)S1121(V)S1123(VA)S1191(AL)S1259(LU)S1317(UE)S1385(E)S3216 V10 R1080(The)S1272(address)S1609(of)S1729(the)S1888(new)S2092(break)S2352(is)S2455(returned)S2827(if)S10 B2925(brk)S10 R(succeeds;)386 3118 A10 B-13540(-)S10 B3597(1)S10 R3683(if)S3781(the)S3940(program)S4317(requests)S4683(more)S4926(memory)S3336 V1080(than)S1278(the)S1426(system)S1730(limit.)S10 B1995(Sbrk)S10 R2233(returns)S10 B-12538(-)S10 B2595(1)S10 R2670(if)S2757(the)S2905(break)S3154(could)S3402(not)S3555(be)S3675(set.)S3504 V9 R720(E)S722(ER)S780(RR)S842(RO)S904(OR)S972(RS)S1034(S)S3624 V10 B1080(Sbrk)S10 R(will)157 1318 A1500(fail)S1660(and)S1830(no)S(additional)402 1955 A2382(memory)S(will)157 2742 A2924(be)S3044(allocated)S3433(if)S3520(one)S3690(of)S3799(the)S3947(following)S4363(are)S4512(true:)S3792 V1080([ENOMEM])S1830(The)S2012(maximum)S2444(possible)S2798(size)S2980(of)S3089(a)S3159(data)S3352(segment)S3712(\(as)S3855(set)S3992(by)S10 B4117(chmem)S10 R4431(\(1\)\))S4608(was)S(exceeded.)400 4790 A3960 V1080([ENOMEM])S1830(Insuf\256cient)S2314(virtual)S2602(memory)S(space)224 2962 A3211(existed)S3521(to)S(support)301 3624 A3950(the)S4098(expansion.)S4580(\(Minix-vmd\))S4128 V9 R720(S)S722(SE)S774(EE)S832(E)S913(A)S915(AL)S983(LS)S1041(SO)S1093(O)S4248 V10 B1080(chmem)S10 R1394(\(1\),)S10 B1562(execve)S10 R1842(\(2\),)S10 B2010(malloc)S10 R2295(\(3\),)S10 B2463(end)S10 R2620(\(3\).)S4416 V9 R720(N)S722(NO)S790(OT)S858(TE)S916(ES)S974(S)S4536 V10 R1080(Minix-vmd)S(rounds)273 1562 A1860(a)S1930(small)S2173(data)S2366(segment)S2726(limit)S2941(up)S3066(to)S3169(3)S3244(megabytes.)S4704 V9 R720(B)S722(BU)S784(UG)S852(GS)S920(S)S4824 V10 R(Setting)285 1080 A1391(the)S1540(break)S1790(may)S1989(fail)S2150(due)S2321(to)S2425(a)S2496(temporary)S2936(lack)S3130(of)S3241(virtual)S3531(memory)S(under)229 3893 A4149(Minix-vmd.)S4683(It)S4772(is)S4866(not)S5021(possi-)S4944 V1080(ble)S1228(to)S(distinguish)440 1331 A1796(this)S1966(from)S2187(a)S2257(failure)S2546(caused)S2845(by)S(exceeding)408 2970 A3403(the)S3551(maximum)S3983(size)S4165(of)S4274(the)S4422(data)S4615(segment.)S7903 V720(Page)S941(1)S2669(\()S2711(May)S2920(22,)S(1986)200 3070 A3278(\))S4455(September)S4911(13,)S(1996)200 5061 A8143 VEP%%Trailer%%DocumentFonts: Times-Roman Times-Bold Times-Italic%%Pages: 1

⌨️ 快捷键说明

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