libc.info-1 295 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052
  1. This is libc.info, produced by makeinfo version 5.2 from libc.texinfo.
  2. This file documents the GNU C Library.
  3. This is ‘The GNU C Library Reference Manual’, for version 2.25.
  4. Copyright © 1993–2017 Free Software Foundation, Inc.
  5. Permission is granted to copy, distribute and/or modify this document
  6. under the terms of the GNU Free Documentation License, Version 1.3 or
  7. any later version published by the Free Software Foundation; with the
  8. Invariant Sections being “Free Software Needs Free Documentation” and
  9. “GNU Lesser General Public License”, the Front-Cover texts being “A GNU
  10. Manual”, and with the Back-Cover Texts as in (a) below. A copy of the
  11. license is included in the section entitled "GNU Free Documentation
  12. License".
  13. (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
  14. modify this GNU manual. Buying copies from the FSF supports it in
  15. developing GNU and promoting software freedom.”
  16. INFO-DIR-SECTION Software libraries
  17. START-INFO-DIR-ENTRY
  18. * Libc: (libc). C library.
  19. END-INFO-DIR-ENTRY
  20. INFO-DIR-SECTION GNU C library functions and macros
  21. START-INFO-DIR-ENTRY
  22. * a64l: (libc)Encode Binary Data.
  23. * abort: (libc)Aborting a Program.
  24. * abs: (libc)Absolute Value.
  25. * accept: (libc)Accepting Connections.
  26. * access: (libc)Testing File Access.
  27. * acosf: (libc)Inverse Trig Functions.
  28. * acoshf: (libc)Hyperbolic Functions.
  29. * acosh: (libc)Hyperbolic Functions.
  30. * acoshl: (libc)Hyperbolic Functions.
  31. * acos: (libc)Inverse Trig Functions.
  32. * acosl: (libc)Inverse Trig Functions.
  33. * addmntent: (libc)mtab.
  34. * addseverity: (libc)Adding Severity Classes.
  35. * adjtime: (libc)High-Resolution Calendar.
  36. * adjtimex: (libc)High-Resolution Calendar.
  37. * aio_cancel64: (libc)Cancel AIO Operations.
  38. * aio_cancel: (libc)Cancel AIO Operations.
  39. * aio_error64: (libc)Status of AIO Operations.
  40. * aio_error: (libc)Status of AIO Operations.
  41. * aio_fsync64: (libc)Synchronizing AIO Operations.
  42. * aio_fsync: (libc)Synchronizing AIO Operations.
  43. * aio_init: (libc)Configuration of AIO.
  44. * aio_read64: (libc)Asynchronous Reads/Writes.
  45. * aio_read: (libc)Asynchronous Reads/Writes.
  46. * aio_return64: (libc)Status of AIO Operations.
  47. * aio_return: (libc)Status of AIO Operations.
  48. * aio_suspend64: (libc)Synchronizing AIO Operations.
  49. * aio_suspend: (libc)Synchronizing AIO Operations.
  50. * aio_write64: (libc)Asynchronous Reads/Writes.
  51. * aio_write: (libc)Asynchronous Reads/Writes.
  52. * alarm: (libc)Setting an Alarm.
  53. * aligned_alloc: (libc)Aligned Memory Blocks.
  54. * alloca: (libc)Variable Size Automatic.
  55. * alphasort64: (libc)Scanning Directory Content.
  56. * alphasort: (libc)Scanning Directory Content.
  57. * ALTWERASE: (libc)Local Modes.
  58. * ARG_MAX: (libc)General Limits.
  59. * argp_error: (libc)Argp Helper Functions.
  60. * ARGP_ERR_UNKNOWN: (libc)Argp Parser Functions.
  61. * argp_failure: (libc)Argp Helper Functions.
  62. * argp_help: (libc)Argp Help.
  63. * argp_parse: (libc)Argp.
  64. * argp_state_help: (libc)Argp Helper Functions.
  65. * argp_usage: (libc)Argp Helper Functions.
  66. * argz_add: (libc)Argz Functions.
  67. * argz_add_sep: (libc)Argz Functions.
  68. * argz_append: (libc)Argz Functions.
  69. * argz_count: (libc)Argz Functions.
  70. * argz_create: (libc)Argz Functions.
  71. * argz_create_sep: (libc)Argz Functions.
  72. * argz_delete: (libc)Argz Functions.
  73. * argz_extract: (libc)Argz Functions.
  74. * argz_insert: (libc)Argz Functions.
  75. * argz_next: (libc)Argz Functions.
  76. * argz_replace: (libc)Argz Functions.
  77. * argz_stringify: (libc)Argz Functions.
  78. * asctime: (libc)Formatting Calendar Time.
  79. * asctime_r: (libc)Formatting Calendar Time.
  80. * asinf: (libc)Inverse Trig Functions.
  81. * asinhf: (libc)Hyperbolic Functions.
  82. * asinh: (libc)Hyperbolic Functions.
  83. * asinhl: (libc)Hyperbolic Functions.
  84. * asin: (libc)Inverse Trig Functions.
  85. * asinl: (libc)Inverse Trig Functions.
  86. * asprintf: (libc)Dynamic Output.
  87. * assert: (libc)Consistency Checking.
  88. * assert_perror: (libc)Consistency Checking.
  89. * atan2f: (libc)Inverse Trig Functions.
  90. * atan2: (libc)Inverse Trig Functions.
  91. * atan2l: (libc)Inverse Trig Functions.
  92. * atanf: (libc)Inverse Trig Functions.
  93. * atanhf: (libc)Hyperbolic Functions.
  94. * atanh: (libc)Hyperbolic Functions.
  95. * atanhl: (libc)Hyperbolic Functions.
  96. * atan: (libc)Inverse Trig Functions.
  97. * atanl: (libc)Inverse Trig Functions.
  98. * atexit: (libc)Cleanups on Exit.
  99. * atof: (libc)Parsing of Floats.
  100. * atoi: (libc)Parsing of Integers.
  101. * atol: (libc)Parsing of Integers.
  102. * atoll: (libc)Parsing of Integers.
  103. * backtrace: (libc)Backtraces.
  104. * backtrace_symbols_fd: (libc)Backtraces.
  105. * backtrace_symbols: (libc)Backtraces.
  106. * basename: (libc)Finding Tokens in a String.
  107. * basename: (libc)Finding Tokens in a String.
  108. * BC_BASE_MAX: (libc)Utility Limits.
  109. * BC_DIM_MAX: (libc)Utility Limits.
  110. * bcmp: (libc)String/Array Comparison.
  111. * bcopy: (libc)Copying Strings and Arrays.
  112. * BC_SCALE_MAX: (libc)Utility Limits.
  113. * BC_STRING_MAX: (libc)Utility Limits.
  114. * bind: (libc)Setting Address.
  115. * bind_textdomain_codeset: (libc)Charset conversion in gettext.
  116. * bindtextdomain: (libc)Locating gettext catalog.
  117. * BRKINT: (libc)Input Modes.
  118. * brk: (libc)Resizing the Data Segment.
  119. * bsearch: (libc)Array Search Function.
  120. * btowc: (libc)Converting a Character.
  121. * BUFSIZ: (libc)Controlling Buffering.
  122. * bzero: (libc)Copying Strings and Arrays.
  123. * cabsf: (libc)Absolute Value.
  124. * cabs: (libc)Absolute Value.
  125. * cabsl: (libc)Absolute Value.
  126. * cacosf: (libc)Inverse Trig Functions.
  127. * cacoshf: (libc)Hyperbolic Functions.
  128. * cacosh: (libc)Hyperbolic Functions.
  129. * cacoshl: (libc)Hyperbolic Functions.
  130. * cacos: (libc)Inverse Trig Functions.
  131. * cacosl: (libc)Inverse Trig Functions.
  132. * calloc: (libc)Allocating Cleared Space.
  133. * canonicalize_file_name: (libc)Symbolic Links.
  134. * canonicalizef: (libc)FP Bit Twiddling.
  135. * canonicalize: (libc)FP Bit Twiddling.
  136. * canonicalizel: (libc)FP Bit Twiddling.
  137. * cargf: (libc)Operations on Complex.
  138. * carg: (libc)Operations on Complex.
  139. * cargl: (libc)Operations on Complex.
  140. * casinf: (libc)Inverse Trig Functions.
  141. * casinhf: (libc)Hyperbolic Functions.
  142. * casinh: (libc)Hyperbolic Functions.
  143. * casinhl: (libc)Hyperbolic Functions.
  144. * casin: (libc)Inverse Trig Functions.
  145. * casinl: (libc)Inverse Trig Functions.
  146. * catanf: (libc)Inverse Trig Functions.
  147. * catanhf: (libc)Hyperbolic Functions.
  148. * catanh: (libc)Hyperbolic Functions.
  149. * catanhl: (libc)Hyperbolic Functions.
  150. * catan: (libc)Inverse Trig Functions.
  151. * catanl: (libc)Inverse Trig Functions.
  152. * catclose: (libc)The catgets Functions.
  153. * catgets: (libc)The catgets Functions.
  154. * catopen: (libc)The catgets Functions.
  155. * cbc_crypt: (libc)DES Encryption.
  156. * cbrtf: (libc)Exponents and Logarithms.
  157. * cbrt: (libc)Exponents and Logarithms.
  158. * cbrtl: (libc)Exponents and Logarithms.
  159. * ccosf: (libc)Trig Functions.
  160. * ccoshf: (libc)Hyperbolic Functions.
  161. * ccosh: (libc)Hyperbolic Functions.
  162. * ccoshl: (libc)Hyperbolic Functions.
  163. * ccos: (libc)Trig Functions.
  164. * ccosl: (libc)Trig Functions.
  165. * CCTS_OFLOW: (libc)Control Modes.
  166. * ceilf: (libc)Rounding Functions.
  167. * ceil: (libc)Rounding Functions.
  168. * ceill: (libc)Rounding Functions.
  169. * cexpf: (libc)Exponents and Logarithms.
  170. * cexp: (libc)Exponents and Logarithms.
  171. * cexpl: (libc)Exponents and Logarithms.
  172. * cfgetispeed: (libc)Line Speed.
  173. * cfgetospeed: (libc)Line Speed.
  174. * cfmakeraw: (libc)Noncanonical Input.
  175. * cfree: (libc)Freeing after Malloc.
  176. * cfsetispeed: (libc)Line Speed.
  177. * cfsetospeed: (libc)Line Speed.
  178. * cfsetspeed: (libc)Line Speed.
  179. * chdir: (libc)Working Directory.
  180. * CHILD_MAX: (libc)General Limits.
  181. * chmod: (libc)Setting Permissions.
  182. * chown: (libc)File Owner.
  183. * CIGNORE: (libc)Control Modes.
  184. * cimagf: (libc)Operations on Complex.
  185. * cimag: (libc)Operations on Complex.
  186. * cimagl: (libc)Operations on Complex.
  187. * clearenv: (libc)Environment Access.
  188. * clearerr: (libc)Error Recovery.
  189. * clearerr_unlocked: (libc)Error Recovery.
  190. * CLK_TCK: (libc)Processor Time.
  191. * CLOCAL: (libc)Control Modes.
  192. * clock: (libc)CPU Time.
  193. * CLOCKS_PER_SEC: (libc)CPU Time.
  194. * clog10f: (libc)Exponents and Logarithms.
  195. * clog10: (libc)Exponents and Logarithms.
  196. * clog10l: (libc)Exponents and Logarithms.
  197. * clogf: (libc)Exponents and Logarithms.
  198. * clog: (libc)Exponents and Logarithms.
  199. * clogl: (libc)Exponents and Logarithms.
  200. * closedir: (libc)Reading/Closing Directory.
  201. * close: (libc)Opening and Closing Files.
  202. * closelog: (libc)closelog.
  203. * COLL_WEIGHTS_MAX: (libc)Utility Limits.
  204. * _Complex_I: (libc)Complex Numbers.
  205. * confstr: (libc)String Parameters.
  206. * conjf: (libc)Operations on Complex.
  207. * conj: (libc)Operations on Complex.
  208. * conjl: (libc)Operations on Complex.
  209. * connect: (libc)Connecting.
  210. * copysignf: (libc)FP Bit Twiddling.
  211. * copysign: (libc)FP Bit Twiddling.
  212. * copysignl: (libc)FP Bit Twiddling.
  213. * cosf: (libc)Trig Functions.
  214. * coshf: (libc)Hyperbolic Functions.
  215. * cosh: (libc)Hyperbolic Functions.
  216. * coshl: (libc)Hyperbolic Functions.
  217. * cos: (libc)Trig Functions.
  218. * cosl: (libc)Trig Functions.
  219. * cpowf: (libc)Exponents and Logarithms.
  220. * cpow: (libc)Exponents and Logarithms.
  221. * cpowl: (libc)Exponents and Logarithms.
  222. * cprojf: (libc)Operations on Complex.
  223. * cproj: (libc)Operations on Complex.
  224. * cprojl: (libc)Operations on Complex.
  225. * CPU_CLR: (libc)CPU Affinity.
  226. * CPU_ISSET: (libc)CPU Affinity.
  227. * CPU_SET: (libc)CPU Affinity.
  228. * CPU_SETSIZE: (libc)CPU Affinity.
  229. * CPU_ZERO: (libc)CPU Affinity.
  230. * CREAD: (libc)Control Modes.
  231. * crealf: (libc)Operations on Complex.
  232. * creal: (libc)Operations on Complex.
  233. * creall: (libc)Operations on Complex.
  234. * creat64: (libc)Opening and Closing Files.
  235. * creat: (libc)Opening and Closing Files.
  236. * CRTS_IFLOW: (libc)Control Modes.
  237. * crypt: (libc)crypt.
  238. * crypt_r: (libc)crypt.
  239. * CS5: (libc)Control Modes.
  240. * CS6: (libc)Control Modes.
  241. * CS7: (libc)Control Modes.
  242. * CS8: (libc)Control Modes.
  243. * csinf: (libc)Trig Functions.
  244. * csinhf: (libc)Hyperbolic Functions.
  245. * csinh: (libc)Hyperbolic Functions.
  246. * csinhl: (libc)Hyperbolic Functions.
  247. * csin: (libc)Trig Functions.
  248. * csinl: (libc)Trig Functions.
  249. * CSIZE: (libc)Control Modes.
  250. * csqrtf: (libc)Exponents and Logarithms.
  251. * csqrt: (libc)Exponents and Logarithms.
  252. * csqrtl: (libc)Exponents and Logarithms.
  253. * CSTOPB: (libc)Control Modes.
  254. * ctanf: (libc)Trig Functions.
  255. * ctanhf: (libc)Hyperbolic Functions.
  256. * ctanh: (libc)Hyperbolic Functions.
  257. * ctanhl: (libc)Hyperbolic Functions.
  258. * ctan: (libc)Trig Functions.
  259. * ctanl: (libc)Trig Functions.
  260. * ctermid: (libc)Identifying the Terminal.
  261. * ctime: (libc)Formatting Calendar Time.
  262. * ctime_r: (libc)Formatting Calendar Time.
  263. * cuserid: (libc)Who Logged In.
  264. * dcgettext: (libc)Translation with gettext.
  265. * dcngettext: (libc)Advanced gettext functions.
  266. * DES_FAILED: (libc)DES Encryption.
  267. * des_setparity: (libc)DES Encryption.
  268. * dgettext: (libc)Translation with gettext.
  269. * difftime: (libc)Elapsed Time.
  270. * dirfd: (libc)Opening a Directory.
  271. * dirname: (libc)Finding Tokens in a String.
  272. * div: (libc)Integer Division.
  273. * dngettext: (libc)Advanced gettext functions.
  274. * drand48: (libc)SVID Random.
  275. * drand48_r: (libc)SVID Random.
  276. * dremf: (libc)Remainder Functions.
  277. * drem: (libc)Remainder Functions.
  278. * dreml: (libc)Remainder Functions.
  279. * DTTOIF: (libc)Directory Entries.
  280. * dup2: (libc)Duplicating Descriptors.
  281. * dup: (libc)Duplicating Descriptors.
  282. * E2BIG: (libc)Error Codes.
  283. * EACCES: (libc)Error Codes.
  284. * EADDRINUSE: (libc)Error Codes.
  285. * EADDRNOTAVAIL: (libc)Error Codes.
  286. * EADV: (libc)Error Codes.
  287. * EAFNOSUPPORT: (libc)Error Codes.
  288. * EAGAIN: (libc)Error Codes.
  289. * EALREADY: (libc)Error Codes.
  290. * EAUTH: (libc)Error Codes.
  291. * EBACKGROUND: (libc)Error Codes.
  292. * EBADE: (libc)Error Codes.
  293. * EBADFD: (libc)Error Codes.
  294. * EBADF: (libc)Error Codes.
  295. * EBADMSG: (libc)Error Codes.
  296. * EBADR: (libc)Error Codes.
  297. * EBADRPC: (libc)Error Codes.
  298. * EBADRQC: (libc)Error Codes.
  299. * EBADSLT: (libc)Error Codes.
  300. * EBFONT: (libc)Error Codes.
  301. * EBUSY: (libc)Error Codes.
  302. * ECANCELED: (libc)Error Codes.
  303. * ecb_crypt: (libc)DES Encryption.
  304. * ECHILD: (libc)Error Codes.
  305. * ECHOCTL: (libc)Local Modes.
  306. * ECHOE: (libc)Local Modes.
  307. * ECHOKE: (libc)Local Modes.
  308. * ECHOK: (libc)Local Modes.
  309. * ECHO: (libc)Local Modes.
  310. * ECHONL: (libc)Local Modes.
  311. * ECHOPRT: (libc)Local Modes.
  312. * ECHRNG: (libc)Error Codes.
  313. * ECOMM: (libc)Error Codes.
  314. * ECONNABORTED: (libc)Error Codes.
  315. * ECONNREFUSED: (libc)Error Codes.
  316. * ECONNRESET: (libc)Error Codes.
  317. * ecvt: (libc)System V Number Conversion.
  318. * ecvt_r: (libc)System V Number Conversion.
  319. * EDEADLK: (libc)Error Codes.
  320. * EDEADLOCK: (libc)Error Codes.
  321. * EDESTADDRREQ: (libc)Error Codes.
  322. * EDIED: (libc)Error Codes.
  323. * ED: (libc)Error Codes.
  324. * EDOM: (libc)Error Codes.
  325. * EDOTDOT: (libc)Error Codes.
  326. * EDQUOT: (libc)Error Codes.
  327. * EEXIST: (libc)Error Codes.
  328. * EFAULT: (libc)Error Codes.
  329. * EFBIG: (libc)Error Codes.
  330. * EFTYPE: (libc)Error Codes.
  331. * EGRATUITOUS: (libc)Error Codes.
  332. * EGREGIOUS: (libc)Error Codes.
  333. * EHOSTDOWN: (libc)Error Codes.
  334. * EHOSTUNREACH: (libc)Error Codes.
  335. * EHWPOISON: (libc)Error Codes.
  336. * EIDRM: (libc)Error Codes.
  337. * EIEIO: (libc)Error Codes.
  338. * EILSEQ: (libc)Error Codes.
  339. * EINPROGRESS: (libc)Error Codes.
  340. * EINTR: (libc)Error Codes.
  341. * EINVAL: (libc)Error Codes.
  342. * EIO: (libc)Error Codes.
  343. * EISCONN: (libc)Error Codes.
  344. * EISDIR: (libc)Error Codes.
  345. * EISNAM: (libc)Error Codes.
  346. * EKEYEXPIRED: (libc)Error Codes.
  347. * EKEYREJECTED: (libc)Error Codes.
  348. * EKEYREVOKED: (libc)Error Codes.
  349. * EL2HLT: (libc)Error Codes.
  350. * EL2NSYNC: (libc)Error Codes.
  351. * EL3HLT: (libc)Error Codes.
  352. * EL3RST: (libc)Error Codes.
  353. * ELIBACC: (libc)Error Codes.
  354. * ELIBBAD: (libc)Error Codes.
  355. * ELIBEXEC: (libc)Error Codes.
  356. * ELIBMAX: (libc)Error Codes.
  357. * ELIBSCN: (libc)Error Codes.
  358. * ELNRNG: (libc)Error Codes.
  359. * ELOOP: (libc)Error Codes.
  360. * EMEDIUMTYPE: (libc)Error Codes.
  361. * EMFILE: (libc)Error Codes.
  362. * EMLINK: (libc)Error Codes.
  363. * EMSGSIZE: (libc)Error Codes.
  364. * EMULTIHOP: (libc)Error Codes.
  365. * ENAMETOOLONG: (libc)Error Codes.
  366. * ENAVAIL: (libc)Error Codes.
  367. * encrypt: (libc)DES Encryption.
  368. * encrypt_r: (libc)DES Encryption.
  369. * endfsent: (libc)fstab.
  370. * endgrent: (libc)Scanning All Groups.
  371. * endhostent: (libc)Host Names.
  372. * endmntent: (libc)mtab.
  373. * endnetent: (libc)Networks Database.
  374. * endnetgrent: (libc)Lookup Netgroup.
  375. * endprotoent: (libc)Protocols Database.
  376. * endpwent: (libc)Scanning All Users.
  377. * endservent: (libc)Services Database.
  378. * endutent: (libc)Manipulating the Database.
  379. * endutxent: (libc)XPG Functions.
  380. * ENEEDAUTH: (libc)Error Codes.
  381. * ENETDOWN: (libc)Error Codes.
  382. * ENETRESET: (libc)Error Codes.
  383. * ENETUNREACH: (libc)Error Codes.
  384. * ENFILE: (libc)Error Codes.
  385. * ENOANO: (libc)Error Codes.
  386. * ENOBUFS: (libc)Error Codes.
  387. * ENOCSI: (libc)Error Codes.
  388. * ENODATA: (libc)Error Codes.
  389. * ENODEV: (libc)Error Codes.
  390. * ENOENT: (libc)Error Codes.
  391. * ENOEXEC: (libc)Error Codes.
  392. * ENOKEY: (libc)Error Codes.
  393. * ENOLCK: (libc)Error Codes.
  394. * ENOLINK: (libc)Error Codes.
  395. * ENOMEDIUM: (libc)Error Codes.
  396. * ENOMEM: (libc)Error Codes.
  397. * ENOMSG: (libc)Error Codes.
  398. * ENONET: (libc)Error Codes.
  399. * ENOPKG: (libc)Error Codes.
  400. * ENOPROTOOPT: (libc)Error Codes.
  401. * ENOSPC: (libc)Error Codes.
  402. * ENOSR: (libc)Error Codes.
  403. * ENOSTR: (libc)Error Codes.
  404. * ENOSYS: (libc)Error Codes.
  405. * ENOTBLK: (libc)Error Codes.
  406. * ENOTCONN: (libc)Error Codes.
  407. * ENOTDIR: (libc)Error Codes.
  408. * ENOTEMPTY: (libc)Error Codes.
  409. * ENOTNAM: (libc)Error Codes.
  410. * ENOTRECOVERABLE: (libc)Error Codes.
  411. * ENOTSOCK: (libc)Error Codes.
  412. * ENOTSUP: (libc)Error Codes.
  413. * ENOTTY: (libc)Error Codes.
  414. * ENOTUNIQ: (libc)Error Codes.
  415. * envz_add: (libc)Envz Functions.
  416. * envz_entry: (libc)Envz Functions.
  417. * envz_get: (libc)Envz Functions.
  418. * envz_merge: (libc)Envz Functions.
  419. * envz_remove: (libc)Envz Functions.
  420. * envz_strip: (libc)Envz Functions.
  421. * ENXIO: (libc)Error Codes.
  422. * EOF: (libc)EOF and Errors.
  423. * EOPNOTSUPP: (libc)Error Codes.
  424. * EOVERFLOW: (libc)Error Codes.
  425. * EOWNERDEAD: (libc)Error Codes.
  426. * EPERM: (libc)Error Codes.
  427. * EPFNOSUPPORT: (libc)Error Codes.
  428. * EPIPE: (libc)Error Codes.
  429. * EPROCLIM: (libc)Error Codes.
  430. * EPROCUNAVAIL: (libc)Error Codes.
  431. * EPROGMISMATCH: (libc)Error Codes.
  432. * EPROGUNAVAIL: (libc)Error Codes.
  433. * EPROTO: (libc)Error Codes.
  434. * EPROTONOSUPPORT: (libc)Error Codes.
  435. * EPROTOTYPE: (libc)Error Codes.
  436. * EQUIV_CLASS_MAX: (libc)Utility Limits.
  437. * erand48: (libc)SVID Random.
  438. * erand48_r: (libc)SVID Random.
  439. * ERANGE: (libc)Error Codes.
  440. * EREMCHG: (libc)Error Codes.
  441. * EREMOTEIO: (libc)Error Codes.
  442. * EREMOTE: (libc)Error Codes.
  443. * ERESTART: (libc)Error Codes.
  444. * erfcf: (libc)Special Functions.
  445. * erfc: (libc)Special Functions.
  446. * erfcl: (libc)Special Functions.
  447. * erff: (libc)Special Functions.
  448. * ERFKILL: (libc)Error Codes.
  449. * erf: (libc)Special Functions.
  450. * erfl: (libc)Special Functions.
  451. * EROFS: (libc)Error Codes.
  452. * ERPCMISMATCH: (libc)Error Codes.
  453. * err: (libc)Error Messages.
  454. * errno: (libc)Checking for Errors.
  455. * error_at_line: (libc)Error Messages.
  456. * error: (libc)Error Messages.
  457. * errx: (libc)Error Messages.
  458. * ESHUTDOWN: (libc)Error Codes.
  459. * ESOCKTNOSUPPORT: (libc)Error Codes.
  460. * ESPIPE: (libc)Error Codes.
  461. * ESRCH: (libc)Error Codes.
  462. * ESRMNT: (libc)Error Codes.
  463. * ESTALE: (libc)Error Codes.
  464. * ESTRPIPE: (libc)Error Codes.
  465. * ETIMEDOUT: (libc)Error Codes.
  466. * ETIME: (libc)Error Codes.
  467. * ETOOMANYREFS: (libc)Error Codes.
  468. * ETXTBSY: (libc)Error Codes.
  469. * EUCLEAN: (libc)Error Codes.
  470. * EUNATCH: (libc)Error Codes.
  471. * EUSERS: (libc)Error Codes.
  472. * EWOULDBLOCK: (libc)Error Codes.
  473. * EXDEV: (libc)Error Codes.
  474. * execle: (libc)Executing a File.
  475. * execl: (libc)Executing a File.
  476. * execlp: (libc)Executing a File.
  477. * execve: (libc)Executing a File.
  478. * execv: (libc)Executing a File.
  479. * execvp: (libc)Executing a File.
  480. * EXFULL: (libc)Error Codes.
  481. * EXIT_FAILURE: (libc)Exit Status.
  482. * exit: (libc)Normal Termination.
  483. * _exit: (libc)Termination Internals.
  484. * _Exit: (libc)Termination Internals.
  485. * EXIT_SUCCESS: (libc)Exit Status.
  486. * exp10f: (libc)Exponents and Logarithms.
  487. * exp10: (libc)Exponents and Logarithms.
  488. * exp10l: (libc)Exponents and Logarithms.
  489. * exp2f: (libc)Exponents and Logarithms.
  490. * exp2: (libc)Exponents and Logarithms.
  491. * exp2l: (libc)Exponents and Logarithms.
  492. * expf: (libc)Exponents and Logarithms.
  493. * exp: (libc)Exponents and Logarithms.
  494. * explicit_bzero: (libc)Erasing Sensitive Data.
  495. * expl: (libc)Exponents and Logarithms.
  496. * expm1f: (libc)Exponents and Logarithms.
  497. * expm1: (libc)Exponents and Logarithms.
  498. * expm1l: (libc)Exponents and Logarithms.
  499. * EXPR_NEST_MAX: (libc)Utility Limits.
  500. * fabsf: (libc)Absolute Value.
  501. * fabs: (libc)Absolute Value.
  502. * fabsl: (libc)Absolute Value.
  503. * __fbufsize: (libc)Controlling Buffering.
  504. * fchdir: (libc)Working Directory.
  505. * fchmod: (libc)Setting Permissions.
  506. * fchown: (libc)File Owner.
  507. * fcloseall: (libc)Closing Streams.
  508. * fclose: (libc)Closing Streams.
  509. * fcntl: (libc)Control Operations.
  510. * fcvt: (libc)System V Number Conversion.
  511. * fcvt_r: (libc)System V Number Conversion.
  512. * fdatasync: (libc)Synchronizing I/O.
  513. * FD_CLOEXEC: (libc)Descriptor Flags.
  514. * FD_CLR: (libc)Waiting for I/O.
  515. * fdimf: (libc)Misc FP Arithmetic.
  516. * fdim: (libc)Misc FP Arithmetic.
  517. * fdiml: (libc)Misc FP Arithmetic.
  518. * FD_ISSET: (libc)Waiting for I/O.
  519. * fdopendir: (libc)Opening a Directory.
  520. * fdopen: (libc)Descriptors and Streams.
  521. * FD_SET: (libc)Waiting for I/O.
  522. * FD_SETSIZE: (libc)Waiting for I/O.
  523. * F_DUPFD: (libc)Duplicating Descriptors.
  524. * FD_ZERO: (libc)Waiting for I/O.
  525. * feclearexcept: (libc)Status bit operations.
  526. * fedisableexcept: (libc)Control Functions.
  527. * feenableexcept: (libc)Control Functions.
  528. * fegetenv: (libc)Control Functions.
  529. * fegetexceptflag: (libc)Status bit operations.
  530. * fegetexcept: (libc)Control Functions.
  531. * fegetmode: (libc)Control Functions.
  532. * fegetround: (libc)Rounding.
  533. * feholdexcept: (libc)Control Functions.
  534. * feof: (libc)EOF and Errors.
  535. * feof_unlocked: (libc)EOF and Errors.
  536. * feraiseexcept: (libc)Status bit operations.
  537. * ferror: (libc)EOF and Errors.
  538. * ferror_unlocked: (libc)EOF and Errors.
  539. * fesetenv: (libc)Control Functions.
  540. * fesetexceptflag: (libc)Status bit operations.
  541. * fesetexcept: (libc)Status bit operations.
  542. * fesetmode: (libc)Control Functions.
  543. * fesetround: (libc)Rounding.
  544. * FE_SNANS_ALWAYS_SIGNAL: (libc)Infinity and NaN.
  545. * fetestexceptflag: (libc)Status bit operations.
  546. * fetestexcept: (libc)Status bit operations.
  547. * feupdateenv: (libc)Control Functions.
  548. * fflush: (libc)Flushing Buffers.
  549. * fflush_unlocked: (libc)Flushing Buffers.
  550. * fgetc: (libc)Character Input.
  551. * fgetc_unlocked: (libc)Character Input.
  552. * F_GETFD: (libc)Descriptor Flags.
  553. * F_GETFL: (libc)Getting File Status Flags.
  554. * fgetgrent: (libc)Scanning All Groups.
  555. * fgetgrent_r: (libc)Scanning All Groups.
  556. * F_GETLK: (libc)File Locks.
  557. * F_GETOWN: (libc)Interrupt Input.
  558. * fgetpos64: (libc)Portable Positioning.
  559. * fgetpos: (libc)Portable Positioning.
  560. * fgetpwent: (libc)Scanning All Users.
  561. * fgetpwent_r: (libc)Scanning All Users.
  562. * fgets: (libc)Line Input.
  563. * fgets_unlocked: (libc)Line Input.
  564. * fgetwc: (libc)Character Input.
  565. * fgetwc_unlocked: (libc)Character Input.
  566. * fgetws: (libc)Line Input.
  567. * fgetws_unlocked: (libc)Line Input.
  568. * FILENAME_MAX: (libc)Limits for Files.
  569. * fileno: (libc)Descriptors and Streams.
  570. * fileno_unlocked: (libc)Descriptors and Streams.
  571. * finitef: (libc)Floating Point Classes.
  572. * finite: (libc)Floating Point Classes.
  573. * finitel: (libc)Floating Point Classes.
  574. * __flbf: (libc)Controlling Buffering.
  575. * flockfile: (libc)Streams and Threads.
  576. * floorf: (libc)Rounding Functions.
  577. * floor: (libc)Rounding Functions.
  578. * floorl: (libc)Rounding Functions.
  579. * _flushlbf: (libc)Flushing Buffers.
  580. * FLUSHO: (libc)Local Modes.
  581. * fmaf: (libc)Misc FP Arithmetic.
  582. * fma: (libc)Misc FP Arithmetic.
  583. * fmal: (libc)Misc FP Arithmetic.
  584. * fmaxf: (libc)Misc FP Arithmetic.
  585. * fmax: (libc)Misc FP Arithmetic.
  586. * fmaxl: (libc)Misc FP Arithmetic.
  587. * fmaxmagf: (libc)Misc FP Arithmetic.
  588. * fmaxmag: (libc)Misc FP Arithmetic.
  589. * fmaxmagl: (libc)Misc FP Arithmetic.
  590. * fmemopen: (libc)String Streams.
  591. * fminf: (libc)Misc FP Arithmetic.
  592. * fmin: (libc)Misc FP Arithmetic.
  593. * fminl: (libc)Misc FP Arithmetic.
  594. * fminmagf: (libc)Misc FP Arithmetic.
  595. * fminmag: (libc)Misc FP Arithmetic.
  596. * fminmagl: (libc)Misc FP Arithmetic.
  597. * fmodf: (libc)Remainder Functions.
  598. * fmod: (libc)Remainder Functions.
  599. * fmodl: (libc)Remainder Functions.
  600. * fmtmsg: (libc)Printing Formatted Messages.
  601. * fnmatch: (libc)Wildcard Matching.
  602. * F_OFD_GETLK: (libc)Open File Description Locks.
  603. * F_OFD_SETLK: (libc)Open File Description Locks.
  604. * F_OFD_SETLKW: (libc)Open File Description Locks.
  605. * F_OK: (libc)Testing File Access.
  606. * fopen64: (libc)Opening Streams.
  607. * fopencookie: (libc)Streams and Cookies.
  608. * fopen: (libc)Opening Streams.
  609. * FOPEN_MAX: (libc)Opening Streams.
  610. * fork: (libc)Creating a Process.
  611. * forkpty: (libc)Pseudo-Terminal Pairs.
  612. * fpathconf: (libc)Pathconf.
  613. * fpclassify: (libc)Floating Point Classes.
  614. * __fpending: (libc)Controlling Buffering.
  615. * FP_ILOGB0: (libc)Exponents and Logarithms.
  616. * FP_ILOGBNAN: (libc)Exponents and Logarithms.
  617. * FP_LLOGB0: (libc)Exponents and Logarithms.
  618. * FP_LLOGBNAN: (libc)Exponents and Logarithms.
  619. * fprintf: (libc)Formatted Output Functions.
  620. * __fpurge: (libc)Flushing Buffers.
  621. * fputc: (libc)Simple Output.
  622. * fputc_unlocked: (libc)Simple Output.
  623. * fputs: (libc)Simple Output.
  624. * fputs_unlocked: (libc)Simple Output.
  625. * fputwc: (libc)Simple Output.
  626. * fputwc_unlocked: (libc)Simple Output.
  627. * fputws: (libc)Simple Output.
  628. * fputws_unlocked: (libc)Simple Output.
  629. * __freadable: (libc)Opening Streams.
  630. * __freading: (libc)Opening Streams.
  631. * fread: (libc)Block Input/Output.
  632. * fread_unlocked: (libc)Block Input/Output.
  633. * free: (libc)Freeing after Malloc.
  634. * freopen64: (libc)Opening Streams.
  635. * freopen: (libc)Opening Streams.
  636. * frexpf: (libc)Normalization Functions.
  637. * frexp: (libc)Normalization Functions.
  638. * frexpl: (libc)Normalization Functions.
  639. * fromfpf: (libc)Rounding Functions.
  640. * fromfp: (libc)Rounding Functions.
  641. * fromfpl: (libc)Rounding Functions.
  642. * fromfpxf: (libc)Rounding Functions.
  643. * fromfpx: (libc)Rounding Functions.
  644. * fromfpxl: (libc)Rounding Functions.
  645. * fscanf: (libc)Formatted Input Functions.
  646. * fseek: (libc)File Positioning.
  647. * fseeko64: (libc)File Positioning.
  648. * fseeko: (libc)File Positioning.
  649. * F_SETFD: (libc)Descriptor Flags.
  650. * F_SETFL: (libc)Getting File Status Flags.
  651. * F_SETLK: (libc)File Locks.
  652. * F_SETLKW: (libc)File Locks.
  653. * __fsetlocking: (libc)Streams and Threads.
  654. * F_SETOWN: (libc)Interrupt Input.
  655. * fsetpos64: (libc)Portable Positioning.
  656. * fsetpos: (libc)Portable Positioning.
  657. * fstat64: (libc)Reading Attributes.
  658. * fstat: (libc)Reading Attributes.
  659. * fsync: (libc)Synchronizing I/O.
  660. * ftell: (libc)File Positioning.
  661. * ftello64: (libc)File Positioning.
  662. * ftello: (libc)File Positioning.
  663. * ftruncate64: (libc)File Size.
  664. * ftruncate: (libc)File Size.
  665. * ftrylockfile: (libc)Streams and Threads.
  666. * ftw64: (libc)Working with Directory Trees.
  667. * ftw: (libc)Working with Directory Trees.
  668. * funlockfile: (libc)Streams and Threads.
  669. * futimes: (libc)File Times.
  670. * fwide: (libc)Streams and I18N.
  671. * fwprintf: (libc)Formatted Output Functions.
  672. * __fwritable: (libc)Opening Streams.
  673. * fwrite: (libc)Block Input/Output.
  674. * fwrite_unlocked: (libc)Block Input/Output.
  675. * __fwriting: (libc)Opening Streams.
  676. * fwscanf: (libc)Formatted Input Functions.
  677. * gammaf: (libc)Special Functions.
  678. * gamma: (libc)Special Functions.
  679. * gammal: (libc)Special Functions.
  680. * __gconv_end_fct: (libc)glibc iconv Implementation.
  681. * __gconv_fct: (libc)glibc iconv Implementation.
  682. * __gconv_init_fct: (libc)glibc iconv Implementation.
  683. * gcvt: (libc)System V Number Conversion.
  684. * getauxval: (libc)Auxiliary Vector.
  685. * get_avphys_pages: (libc)Query Memory Parameters.
  686. * getchar: (libc)Character Input.
  687. * getchar_unlocked: (libc)Character Input.
  688. * getc: (libc)Character Input.
  689. * getcontext: (libc)System V contexts.
  690. * getc_unlocked: (libc)Character Input.
  691. * get_current_dir_name: (libc)Working Directory.
  692. * getcwd: (libc)Working Directory.
  693. * getdate: (libc)General Time String Parsing.
  694. * getdate_r: (libc)General Time String Parsing.
  695. * getdelim: (libc)Line Input.
  696. * getdomainnname: (libc)Host Identification.
  697. * getegid: (libc)Reading Persona.
  698. * getentropy: (libc)Unpredictable Bytes.
  699. * getenv: (libc)Environment Access.
  700. * geteuid: (libc)Reading Persona.
  701. * getfsent: (libc)fstab.
  702. * getfsfile: (libc)fstab.
  703. * getfsspec: (libc)fstab.
  704. * getgid: (libc)Reading Persona.
  705. * getgrent: (libc)Scanning All Groups.
  706. * getgrent_r: (libc)Scanning All Groups.
  707. * getgrgid: (libc)Lookup Group.
  708. * getgrgid_r: (libc)Lookup Group.
  709. * getgrnam: (libc)Lookup Group.
  710. * getgrnam_r: (libc)Lookup Group.
  711. * getgrouplist: (libc)Setting Groups.
  712. * getgroups: (libc)Reading Persona.
  713. * gethostbyaddr: (libc)Host Names.
  714. * gethostbyaddr_r: (libc)Host Names.
  715. * gethostbyname2: (libc)Host Names.
  716. * gethostbyname2_r: (libc)Host Names.
  717. * gethostbyname: (libc)Host Names.
  718. * gethostbyname_r: (libc)Host Names.
  719. * gethostent: (libc)Host Names.
  720. * gethostid: (libc)Host Identification.
  721. * gethostname: (libc)Host Identification.
  722. * getitimer: (libc)Setting an Alarm.
  723. * getline: (libc)Line Input.
  724. * getloadavg: (libc)Processor Resources.
  725. * getlogin: (libc)Who Logged In.
  726. * getmntent: (libc)mtab.
  727. * getmntent_r: (libc)mtab.
  728. * getnetbyaddr: (libc)Networks Database.
  729. * getnetbyname: (libc)Networks Database.
  730. * getnetent: (libc)Networks Database.
  731. * getnetgrent: (libc)Lookup Netgroup.
  732. * getnetgrent_r: (libc)Lookup Netgroup.
  733. * get_nprocs_conf: (libc)Processor Resources.
  734. * get_nprocs: (libc)Processor Resources.
  735. * getopt: (libc)Using Getopt.
  736. * getopt_long: (libc)Getopt Long Options.
  737. * getopt_long_only: (libc)Getopt Long Options.
  738. * getpagesize: (libc)Query Memory Parameters.
  739. * getpass: (libc)getpass.
  740. * getpayloadf: (libc)FP Bit Twiddling.
  741. * getpayload: (libc)FP Bit Twiddling.
  742. * getpayloadl: (libc)FP Bit Twiddling.
  743. * getpeername: (libc)Who is Connected.
  744. * getpgid: (libc)Process Group Functions.
  745. * getpgrp: (libc)Process Group Functions.
  746. * get_phys_pages: (libc)Query Memory Parameters.
  747. * getpid: (libc)Process Identification.
  748. * getppid: (libc)Process Identification.
  749. * getpriority: (libc)Traditional Scheduling Functions.
  750. * getprotobyname: (libc)Protocols Database.
  751. * getprotobynumber: (libc)Protocols Database.
  752. * getprotoent: (libc)Protocols Database.
  753. * getpt: (libc)Allocation.
  754. * getpwent: (libc)Scanning All Users.
  755. * getpwent_r: (libc)Scanning All Users.
  756. * getpwnam: (libc)Lookup User.
  757. * getpwnam_r: (libc)Lookup User.
  758. * getpwuid: (libc)Lookup User.
  759. * getpwuid_r: (libc)Lookup User.
  760. * getrandom: (libc)Unpredictable Bytes.
  761. * getrlimit64: (libc)Limits on Resources.
  762. * getrlimit: (libc)Limits on Resources.
  763. * getrusage: (libc)Resource Usage.
  764. * getservbyname: (libc)Services Database.
  765. * getservbyport: (libc)Services Database.
  766. * getservent: (libc)Services Database.
  767. * getsid: (libc)Process Group Functions.
  768. * gets: (libc)Line Input.
  769. * getsockname: (libc)Reading Address.
  770. * getsockopt: (libc)Socket Option Functions.
  771. * getsubopt: (libc)Suboptions.
  772. * gettext: (libc)Translation with gettext.
  773. * gettimeofday: (libc)High-Resolution Calendar.
  774. * getuid: (libc)Reading Persona.
  775. * getumask: (libc)Setting Permissions.
  776. * getutent: (libc)Manipulating the Database.
  777. * getutent_r: (libc)Manipulating the Database.
  778. * getutid: (libc)Manipulating the Database.
  779. * getutid_r: (libc)Manipulating the Database.
  780. * getutline: (libc)Manipulating the Database.
  781. * getutline_r: (libc)Manipulating the Database.
  782. * getutmp: (libc)XPG Functions.
  783. * getutmpx: (libc)XPG Functions.
  784. * getutxent: (libc)XPG Functions.
  785. * getutxid: (libc)XPG Functions.
  786. * getutxline: (libc)XPG Functions.
  787. * getwchar: (libc)Character Input.
  788. * getwchar_unlocked: (libc)Character Input.
  789. * getwc: (libc)Character Input.
  790. * getwc_unlocked: (libc)Character Input.
  791. * getwd: (libc)Working Directory.
  792. * getw: (libc)Character Input.
  793. * glob64: (libc)Calling Glob.
  794. * globfree64: (libc)More Flags for Globbing.
  795. * globfree: (libc)More Flags for Globbing.
  796. * glob: (libc)Calling Glob.
  797. * gmtime: (libc)Broken-down Time.
  798. * gmtime_r: (libc)Broken-down Time.
  799. * grantpt: (libc)Allocation.
  800. * gsignal: (libc)Signaling Yourself.
  801. * gtty: (libc)BSD Terminal Modes.
  802. * hasmntopt: (libc)mtab.
  803. * hcreate: (libc)Hash Search Function.
  804. * hcreate_r: (libc)Hash Search Function.
  805. * hdestroy: (libc)Hash Search Function.
  806. * hdestroy_r: (libc)Hash Search Function.
  807. * hsearch: (libc)Hash Search Function.
  808. * hsearch_r: (libc)Hash Search Function.
  809. * htonl: (libc)Byte Order.
  810. * htons: (libc)Byte Order.
  811. * HUGE_VALF: (libc)Math Error Reporting.
  812. * HUGE_VAL: (libc)Math Error Reporting.
  813. * HUGE_VALL: (libc)Math Error Reporting.
  814. * HUPCL: (libc)Control Modes.
  815. * hypotf: (libc)Exponents and Logarithms.
  816. * hypot: (libc)Exponents and Logarithms.
  817. * hypotl: (libc)Exponents and Logarithms.
  818. * ICANON: (libc)Local Modes.
  819. * iconv_close: (libc)Generic Conversion Interface.
  820. * iconv: (libc)Generic Conversion Interface.
  821. * iconv_open: (libc)Generic Conversion Interface.
  822. * ICRNL: (libc)Input Modes.
  823. * IEXTEN: (libc)Local Modes.
  824. * if_freenameindex: (libc)Interface Naming.
  825. * if_indextoname: (libc)Interface Naming.
  826. * if_nameindex: (libc)Interface Naming.
  827. * if_nametoindex: (libc)Interface Naming.
  828. * IFNAMSIZ: (libc)Interface Naming.
  829. * IFTODT: (libc)Directory Entries.
  830. * IGNBRK: (libc)Input Modes.
  831. * IGNCR: (libc)Input Modes.
  832. * IGNPAR: (libc)Input Modes.
  833. * I: (libc)Complex Numbers.
  834. * ilogbf: (libc)Exponents and Logarithms.
  835. * ilogb: (libc)Exponents and Logarithms.
  836. * ilogbl: (libc)Exponents and Logarithms.
  837. * _Imaginary_I: (libc)Complex Numbers.
  838. * imaxabs: (libc)Absolute Value.
  839. * IMAXBEL: (libc)Input Modes.
  840. * imaxdiv: (libc)Integer Division.
  841. * in6addr_any: (libc)Host Address Data Type.
  842. * in6addr_loopback: (libc)Host Address Data Type.
  843. * INADDR_ANY: (libc)Host Address Data Type.
  844. * INADDR_BROADCAST: (libc)Host Address Data Type.
  845. * INADDR_LOOPBACK: (libc)Host Address Data Type.
  846. * INADDR_NONE: (libc)Host Address Data Type.
  847. * index: (libc)Search Functions.
  848. * inet_addr: (libc)Host Address Functions.
  849. * inet_aton: (libc)Host Address Functions.
  850. * inet_lnaof: (libc)Host Address Functions.
  851. * inet_makeaddr: (libc)Host Address Functions.
  852. * inet_netof: (libc)Host Address Functions.
  853. * inet_network: (libc)Host Address Functions.
  854. * inet_ntoa: (libc)Host Address Functions.
  855. * inet_ntop: (libc)Host Address Functions.
  856. * inet_pton: (libc)Host Address Functions.
  857. * INFINITY: (libc)Infinity and NaN.
  858. * initgroups: (libc)Setting Groups.
  859. * initstate: (libc)BSD Random.
  860. * initstate_r: (libc)BSD Random.
  861. * INLCR: (libc)Input Modes.
  862. * innetgr: (libc)Netgroup Membership.
  863. * INPCK: (libc)Input Modes.
  864. * ioctl: (libc)IOCTLs.
  865. * _IOFBF: (libc)Controlling Buffering.
  866. * _IOLBF: (libc)Controlling Buffering.
  867. * _IONBF: (libc)Controlling Buffering.
  868. * IPPORT_RESERVED: (libc)Ports.
  869. * IPPORT_USERRESERVED: (libc)Ports.
  870. * isalnum: (libc)Classification of Characters.
  871. * isalpha: (libc)Classification of Characters.
  872. * isascii: (libc)Classification of Characters.
  873. * isatty: (libc)Is It a Terminal.
  874. * isblank: (libc)Classification of Characters.
  875. * iscanonical: (libc)Floating Point Classes.
  876. * iscntrl: (libc)Classification of Characters.
  877. * isdigit: (libc)Classification of Characters.
  878. * iseqsig: (libc)FP Comparison Functions.
  879. * isfinite: (libc)Floating Point Classes.
  880. * isgraph: (libc)Classification of Characters.
  881. * isgreaterequal: (libc)FP Comparison Functions.
  882. * isgreater: (libc)FP Comparison Functions.
  883. * ISIG: (libc)Local Modes.
  884. * isinff: (libc)Floating Point Classes.
  885. * isinf: (libc)Floating Point Classes.
  886. * isinfl: (libc)Floating Point Classes.
  887. * islessequal: (libc)FP Comparison Functions.
  888. * islessgreater: (libc)FP Comparison Functions.
  889. * isless: (libc)FP Comparison Functions.
  890. * islower: (libc)Classification of Characters.
  891. * isnanf: (libc)Floating Point Classes.
  892. * isnan: (libc)Floating Point Classes.
  893. * isnan: (libc)Floating Point Classes.
  894. * isnanl: (libc)Floating Point Classes.
  895. * isnormal: (libc)Floating Point Classes.
  896. * isprint: (libc)Classification of Characters.
  897. * ispunct: (libc)Classification of Characters.
  898. * issignaling: (libc)Floating Point Classes.
  899. * isspace: (libc)Classification of Characters.
  900. * issubnormal: (libc)Floating Point Classes.
  901. * ISTRIP: (libc)Input Modes.
  902. * isunordered: (libc)FP Comparison Functions.
  903. * isupper: (libc)Classification of Characters.
  904. * iswalnum: (libc)Classification of Wide Characters.
  905. * iswalpha: (libc)Classification of Wide Characters.
  906. * iswblank: (libc)Classification of Wide Characters.
  907. * iswcntrl: (libc)Classification of Wide Characters.
  908. * iswctype: (libc)Classification of Wide Characters.
  909. * iswdigit: (libc)Classification of Wide Characters.
  910. * iswgraph: (libc)Classification of Wide Characters.
  911. * iswlower: (libc)Classification of Wide Characters.
  912. * iswprint: (libc)Classification of Wide Characters.
  913. * iswpunct: (libc)Classification of Wide Characters.
  914. * iswspace: (libc)Classification of Wide Characters.
  915. * iswupper: (libc)Classification of Wide Characters.
  916. * iswxdigit: (libc)Classification of Wide Characters.
  917. * isxdigit: (libc)Classification of Characters.
  918. * iszero: (libc)Floating Point Classes.
  919. * IXANY: (libc)Input Modes.
  920. * IXOFF: (libc)Input Modes.
  921. * IXON: (libc)Input Modes.
  922. * j0f: (libc)Special Functions.
  923. * j0: (libc)Special Functions.
  924. * j0l: (libc)Special Functions.
  925. * j1f: (libc)Special Functions.
  926. * j1: (libc)Special Functions.
  927. * j1l: (libc)Special Functions.
  928. * jnf: (libc)Special Functions.
  929. * jn: (libc)Special Functions.
  930. * jnl: (libc)Special Functions.
  931. * jrand48: (libc)SVID Random.
  932. * jrand48_r: (libc)SVID Random.
  933. * kill: (libc)Signaling Another Process.
  934. * killpg: (libc)Signaling Another Process.
  935. * l64a: (libc)Encode Binary Data.
  936. * labs: (libc)Absolute Value.
  937. * lcong48: (libc)SVID Random.
  938. * lcong48_r: (libc)SVID Random.
  939. * L_ctermid: (libc)Identifying the Terminal.
  940. * L_cuserid: (libc)Who Logged In.
  941. * ldexpf: (libc)Normalization Functions.
  942. * ldexp: (libc)Normalization Functions.
  943. * ldexpl: (libc)Normalization Functions.
  944. * ldiv: (libc)Integer Division.
  945. * lfind: (libc)Array Search Function.
  946. * lgammaf: (libc)Special Functions.
  947. * lgammaf_r: (libc)Special Functions.
  948. * lgamma: (libc)Special Functions.
  949. * lgammal: (libc)Special Functions.
  950. * lgammal_r: (libc)Special Functions.
  951. * lgamma_r: (libc)Special Functions.
  952. * LINE_MAX: (libc)Utility Limits.
  953. * link: (libc)Hard Links.
  954. * LINK_MAX: (libc)Limits for Files.
  955. * lio_listio64: (libc)Asynchronous Reads/Writes.
  956. * lio_listio: (libc)Asynchronous Reads/Writes.
  957. * listen: (libc)Listening.
  958. * llabs: (libc)Absolute Value.
  959. * lldiv: (libc)Integer Division.
  960. * llogbf: (libc)Exponents and Logarithms.
  961. * llogb: (libc)Exponents and Logarithms.
  962. * llogbl: (libc)Exponents and Logarithms.
  963. * llrintf: (libc)Rounding Functions.
  964. * llrint: (libc)Rounding Functions.
  965. * llrintl: (libc)Rounding Functions.
  966. * llroundf: (libc)Rounding Functions.
  967. * llround: (libc)Rounding Functions.
  968. * llroundl: (libc)Rounding Functions.
  969. * localeconv: (libc)The Lame Way to Locale Data.
  970. * localtime: (libc)Broken-down Time.
  971. * localtime_r: (libc)Broken-down Time.
  972. * log10f: (libc)Exponents and Logarithms.
  973. * log10: (libc)Exponents and Logarithms.
  974. * log10l: (libc)Exponents and Logarithms.
  975. * log1pf: (libc)Exponents and Logarithms.
  976. * log1p: (libc)Exponents and Logarithms.
  977. * log1pl: (libc)Exponents and Logarithms.
  978. * log2f: (libc)Exponents and Logarithms.
  979. * log2: (libc)Exponents and Logarithms.
  980. * log2l: (libc)Exponents and Logarithms.
  981. * logbf: (libc)Exponents and Logarithms.
  982. * logb: (libc)Exponents and Logarithms.
  983. * logbl: (libc)Exponents and Logarithms.
  984. * logf: (libc)Exponents and Logarithms.
  985. * login: (libc)Logging In and Out.
  986. * login_tty: (libc)Logging In and Out.
  987. * log: (libc)Exponents and Logarithms.
  988. * logl: (libc)Exponents and Logarithms.
  989. * logout: (libc)Logging In and Out.
  990. * logwtmp: (libc)Logging In and Out.
  991. * longjmp: (libc)Non-Local Details.
  992. * lrand48: (libc)SVID Random.
  993. * lrand48_r: (libc)SVID Random.
  994. * lrintf: (libc)Rounding Functions.
  995. * lrint: (libc)Rounding Functions.
  996. * lrintl: (libc)Rounding Functions.
  997. * lroundf: (libc)Rounding Functions.
  998. * lround: (libc)Rounding Functions.
  999. * lroundl: (libc)Rounding Functions.
  1000. * lsearch: (libc)Array Search Function.
  1001. * lseek64: (libc)File Position Primitive.
  1002. * lseek: (libc)File Position Primitive.
  1003. * lstat64: (libc)Reading Attributes.
  1004. * lstat: (libc)Reading Attributes.
  1005. * L_tmpnam: (libc)Temporary Files.
  1006. * lutimes: (libc)File Times.
  1007. * madvise: (libc)Memory-mapped I/O.
  1008. * makecontext: (libc)System V contexts.
  1009. * mallinfo: (libc)Statistics of Malloc.
  1010. * malloc: (libc)Basic Allocation.
  1011. * mallopt: (libc)Malloc Tunable Parameters.
  1012. * MAX_CANON: (libc)Limits for Files.
  1013. * MAX_INPUT: (libc)Limits for Files.
  1014. * MAXNAMLEN: (libc)Limits for Files.
  1015. * MAXSYMLINKS: (libc)Symbolic Links.
  1016. * MB_CUR_MAX: (libc)Selecting the Conversion.
  1017. * mblen: (libc)Non-reentrant Character Conversion.
  1018. * MB_LEN_MAX: (libc)Selecting the Conversion.
  1019. * mbrlen: (libc)Converting a Character.
  1020. * mbrtowc: (libc)Converting a Character.
  1021. * mbsinit: (libc)Keeping the state.
  1022. * mbsnrtowcs: (libc)Converting Strings.
  1023. * mbsrtowcs: (libc)Converting Strings.
  1024. * mbstowcs: (libc)Non-reentrant String Conversion.
  1025. * mbtowc: (libc)Non-reentrant Character Conversion.
  1026. * mcheck: (libc)Heap Consistency Checking.
  1027. * MDMBUF: (libc)Control Modes.
  1028. * memalign: (libc)Aligned Memory Blocks.
  1029. * memccpy: (libc)Copying Strings and Arrays.
  1030. * memchr: (libc)Search Functions.
  1031. * memcmp: (libc)String/Array Comparison.
  1032. * memcpy: (libc)Copying Strings and Arrays.
  1033. * memfrob: (libc)Trivial Encryption.
  1034. * memmem: (libc)Search Functions.
  1035. * memmove: (libc)Copying Strings and Arrays.
  1036. * mempcpy: (libc)Copying Strings and Arrays.
  1037. * memrchr: (libc)Search Functions.
  1038. * memset: (libc)Copying Strings and Arrays.
  1039. * mkdir: (libc)Creating Directories.
  1040. * mkdtemp: (libc)Temporary Files.
  1041. * mkfifo: (libc)FIFO Special Files.
  1042. * mknod: (libc)Making Special Files.
  1043. * mkstemp: (libc)Temporary Files.
  1044. * mktemp: (libc)Temporary Files.
  1045. * mktime: (libc)Broken-down Time.
  1046. * mlockall: (libc)Page Lock Functions.
  1047. * mlock: (libc)Page Lock Functions.
  1048. * mmap64: (libc)Memory-mapped I/O.
  1049. * mmap: (libc)Memory-mapped I/O.
  1050. * modff: (libc)Rounding Functions.
  1051. * modf: (libc)Rounding Functions.
  1052. * modfl: (libc)Rounding Functions.
  1053. * mount: (libc)Mount-Unmount-Remount.
  1054. * mprobe: (libc)Heap Consistency Checking.
  1055. * mrand48: (libc)SVID Random.
  1056. * mrand48_r: (libc)SVID Random.
  1057. * mremap: (libc)Memory-mapped I/O.
  1058. * MSG_DONTROUTE: (libc)Socket Data Options.
  1059. * MSG_OOB: (libc)Socket Data Options.
  1060. * MSG_PEEK: (libc)Socket Data Options.
  1061. * msync: (libc)Memory-mapped I/O.
  1062. * mtrace: (libc)Tracing malloc.
  1063. * munlockall: (libc)Page Lock Functions.
  1064. * munlock: (libc)Page Lock Functions.
  1065. * munmap: (libc)Memory-mapped I/O.
  1066. * muntrace: (libc)Tracing malloc.
  1067. * NAME_MAX: (libc)Limits for Files.
  1068. * nanf: (libc)FP Bit Twiddling.
  1069. * nan: (libc)FP Bit Twiddling.
  1070. * NAN: (libc)Infinity and NaN.
  1071. * nanl: (libc)FP Bit Twiddling.
  1072. * nanosleep: (libc)Sleeping.
  1073. * NCCS: (libc)Mode Data Types.
  1074. * nearbyintf: (libc)Rounding Functions.
  1075. * nearbyint: (libc)Rounding Functions.
  1076. * nearbyintl: (libc)Rounding Functions.
  1077. * nextafterf: (libc)FP Bit Twiddling.
  1078. * nextafter: (libc)FP Bit Twiddling.
  1079. * nextafterl: (libc)FP Bit Twiddling.
  1080. * nextdownf: (libc)FP Bit Twiddling.
  1081. * nextdown: (libc)FP Bit Twiddling.
  1082. * nextdownl: (libc)FP Bit Twiddling.
  1083. * nexttowardf: (libc)FP Bit Twiddling.
  1084. * nexttoward: (libc)FP Bit Twiddling.
  1085. * nexttowardl: (libc)FP Bit Twiddling.
  1086. * nextupf: (libc)FP Bit Twiddling.
  1087. * nextup: (libc)FP Bit Twiddling.
  1088. * nextupl: (libc)FP Bit Twiddling.
  1089. * nftw64: (libc)Working with Directory Trees.
  1090. * nftw: (libc)Working with Directory Trees.
  1091. * ngettext: (libc)Advanced gettext functions.
  1092. * NGROUPS_MAX: (libc)General Limits.
  1093. * nice: (libc)Traditional Scheduling Functions.
  1094. * nl_langinfo: (libc)The Elegant and Fast Way.
  1095. * NOFLSH: (libc)Local Modes.
  1096. * NOKERNINFO: (libc)Local Modes.
  1097. * nrand48: (libc)SVID Random.
  1098. * nrand48_r: (libc)SVID Random.
  1099. * NSIG: (libc)Standard Signals.
  1100. * ntohl: (libc)Byte Order.
  1101. * ntohs: (libc)Byte Order.
  1102. * ntp_adjtime: (libc)High Accuracy Clock.
  1103. * ntp_gettime: (libc)High Accuracy Clock.
  1104. * NULL: (libc)Null Pointer Constant.
  1105. * O_ACCMODE: (libc)Access Modes.
  1106. * O_APPEND: (libc)Operating Modes.
  1107. * O_ASYNC: (libc)Operating Modes.
  1108. * obstack_1grow_fast: (libc)Extra Fast Growing.
  1109. * obstack_1grow: (libc)Growing Objects.
  1110. * obstack_alignment_mask: (libc)Obstacks Data Alignment.
  1111. * obstack_alloc: (libc)Allocation in an Obstack.
  1112. * obstack_base: (libc)Status of an Obstack.
  1113. * obstack_blank_fast: (libc)Extra Fast Growing.
  1114. * obstack_blank: (libc)Growing Objects.
  1115. * obstack_chunk_size: (libc)Obstack Chunks.
  1116. * obstack_copy0: (libc)Allocation in an Obstack.
  1117. * obstack_copy: (libc)Allocation in an Obstack.
  1118. * obstack_finish: (libc)Growing Objects.
  1119. * obstack_free: (libc)Freeing Obstack Objects.
  1120. * obstack_grow0: (libc)Growing Objects.
  1121. * obstack_grow: (libc)Growing Objects.
  1122. * obstack_init: (libc)Preparing for Obstacks.
  1123. * obstack_int_grow_fast: (libc)Extra Fast Growing.
  1124. * obstack_int_grow: (libc)Growing Objects.
  1125. * obstack_next_free: (libc)Status of an Obstack.
  1126. * obstack_object_size: (libc)Growing Objects.
  1127. * obstack_object_size: (libc)Status of an Obstack.
  1128. * obstack_printf: (libc)Dynamic Output.
  1129. * obstack_ptr_grow_fast: (libc)Extra Fast Growing.
  1130. * obstack_ptr_grow: (libc)Growing Objects.
  1131. * obstack_room: (libc)Extra Fast Growing.
  1132. * obstack_vprintf: (libc)Variable Arguments Output.
  1133. * O_CREAT: (libc)Open-time Flags.
  1134. * O_EXCL: (libc)Open-time Flags.
  1135. * O_EXEC: (libc)Access Modes.
  1136. * O_EXLOCK: (libc)Open-time Flags.
  1137. * offsetof: (libc)Structure Measurement.
  1138. * O_FSYNC: (libc)Operating Modes.
  1139. * O_IGNORE_CTTY: (libc)Open-time Flags.
  1140. * O_NDELAY: (libc)Operating Modes.
  1141. * on_exit: (libc)Cleanups on Exit.
  1142. * ONLCR: (libc)Output Modes.
  1143. * O_NOATIME: (libc)Operating Modes.
  1144. * O_NOCTTY: (libc)Open-time Flags.
  1145. * ONOEOT: (libc)Output Modes.
  1146. * O_NOLINK: (libc)Open-time Flags.
  1147. * O_NONBLOCK: (libc)Open-time Flags.
  1148. * O_NONBLOCK: (libc)Operating Modes.
  1149. * O_NOTRANS: (libc)Open-time Flags.
  1150. * open64: (libc)Opening and Closing Files.
  1151. * opendir: (libc)Opening a Directory.
  1152. * open: (libc)Opening and Closing Files.
  1153. * openlog: (libc)openlog.
  1154. * OPEN_MAX: (libc)General Limits.
  1155. * open_memstream: (libc)String Streams.
  1156. * openpty: (libc)Pseudo-Terminal Pairs.
  1157. * OPOST: (libc)Output Modes.
  1158. * O_RDONLY: (libc)Access Modes.
  1159. * O_RDWR: (libc)Access Modes.
  1160. * O_READ: (libc)Access Modes.
  1161. * O_SHLOCK: (libc)Open-time Flags.
  1162. * O_SYNC: (libc)Operating Modes.
  1163. * O_TRUNC: (libc)Open-time Flags.
  1164. * O_WRITE: (libc)Access Modes.
  1165. * O_WRONLY: (libc)Access Modes.
  1166. * OXTABS: (libc)Output Modes.
  1167. * PA_FLAG_MASK: (libc)Parsing a Template String.
  1168. * PARENB: (libc)Control Modes.
  1169. * PARMRK: (libc)Input Modes.
  1170. * PARODD: (libc)Control Modes.
  1171. * parse_printf_format: (libc)Parsing a Template String.
  1172. * pathconf: (libc)Pathconf.
  1173. * PATH_MAX: (libc)Limits for Files.
  1174. * _PATH_UTMP: (libc)Manipulating the Database.
  1175. * _PATH_WTMP: (libc)Manipulating the Database.
  1176. * pause: (libc)Using Pause.
  1177. * pclose: (libc)Pipe to a Subprocess.
  1178. * PENDIN: (libc)Local Modes.
  1179. * perror: (libc)Error Messages.
  1180. * PF_FILE: (libc)Local Namespace Details.
  1181. * PF_INET6: (libc)Internet Namespace.
  1182. * PF_INET: (libc)Internet Namespace.
  1183. * PF_LOCAL: (libc)Local Namespace Details.
  1184. * PF_UNIX: (libc)Local Namespace Details.
  1185. * PIPE_BUF: (libc)Limits for Files.
  1186. * pipe: (libc)Creating a Pipe.
  1187. * popen: (libc)Pipe to a Subprocess.
  1188. * _POSIX2_C_DEV: (libc)System Options.
  1189. * _POSIX2_C_VERSION: (libc)Version Supported.
  1190. * _POSIX2_FORT_DEV: (libc)System Options.
  1191. * _POSIX2_FORT_RUN: (libc)System Options.
  1192. * _POSIX2_LOCALEDEF: (libc)System Options.
  1193. * _POSIX2_SW_DEV: (libc)System Options.
  1194. * _POSIX_CHOWN_RESTRICTED: (libc)Options for Files.
  1195. * posix_fallocate64: (libc)Storage Allocation.
  1196. * posix_fallocate: (libc)Storage Allocation.
  1197. * _POSIX_JOB_CONTROL: (libc)System Options.
  1198. * posix_memalign: (libc)Aligned Memory Blocks.
  1199. * _POSIX_NO_TRUNC: (libc)Options for Files.
  1200. * _POSIX_SAVED_IDS: (libc)System Options.
  1201. * _POSIX_VDISABLE: (libc)Options for Files.
  1202. * _POSIX_VERSION: (libc)Version Supported.
  1203. * pow10f: (libc)Exponents and Logarithms.
  1204. * pow10: (libc)Exponents and Logarithms.
  1205. * pow10l: (libc)Exponents and Logarithms.
  1206. * powf: (libc)Exponents and Logarithms.
  1207. * pow: (libc)Exponents and Logarithms.
  1208. * powl: (libc)Exponents and Logarithms.
  1209. * __ppc_get_timebase_freq: (libc)PowerPC.
  1210. * __ppc_get_timebase: (libc)PowerPC.
  1211. * __ppc_mdoio: (libc)PowerPC.
  1212. * __ppc_mdoom: (libc)PowerPC.
  1213. * __ppc_set_ppr_low: (libc)PowerPC.
  1214. * __ppc_set_ppr_med_high: (libc)PowerPC.
  1215. * __ppc_set_ppr_med: (libc)PowerPC.
  1216. * __ppc_set_ppr_med_low: (libc)PowerPC.
  1217. * __ppc_set_ppr_very_low: (libc)PowerPC.
  1218. * __ppc_yield: (libc)PowerPC.
  1219. * pread64: (libc)I/O Primitives.
  1220. * pread: (libc)I/O Primitives.
  1221. * printf: (libc)Formatted Output Functions.
  1222. * printf_size_info: (libc)Predefined Printf Handlers.
  1223. * printf_size: (libc)Predefined Printf Handlers.
  1224. * psignal: (libc)Signal Messages.
  1225. * pthread_getattr_default_np: (libc)Default Thread Attributes.
  1226. * pthread_getspecific: (libc)Thread-specific Data.
  1227. * pthread_key_create: (libc)Thread-specific Data.
  1228. * pthread_key_delete: (libc)Thread-specific Data.
  1229. * pthread_setattr_default_np: (libc)Default Thread Attributes.
  1230. * pthread_setspecific: (libc)Thread-specific Data.
  1231. * P_tmpdir: (libc)Temporary Files.
  1232. * ptsname: (libc)Allocation.
  1233. * ptsname_r: (libc)Allocation.
  1234. * putchar: (libc)Simple Output.
  1235. * putchar_unlocked: (libc)Simple Output.
  1236. * putc: (libc)Simple Output.
  1237. * putc_unlocked: (libc)Simple Output.
  1238. * putenv: (libc)Environment Access.
  1239. * putpwent: (libc)Writing a User Entry.
  1240. * puts: (libc)Simple Output.
  1241. * pututline: (libc)Manipulating the Database.
  1242. * pututxline: (libc)XPG Functions.
  1243. * putwchar: (libc)Simple Output.
  1244. * putwchar_unlocked: (libc)Simple Output.
  1245. * putwc: (libc)Simple Output.
  1246. * putwc_unlocked: (libc)Simple Output.
  1247. * putw: (libc)Simple Output.
  1248. * pwrite64: (libc)I/O Primitives.
  1249. * pwrite: (libc)I/O Primitives.
  1250. * qecvt: (libc)System V Number Conversion.
  1251. * qecvt_r: (libc)System V Number Conversion.
  1252. * qfcvt: (libc)System V Number Conversion.
  1253. * qfcvt_r: (libc)System V Number Conversion.
  1254. * qgcvt: (libc)System V Number Conversion.
  1255. * qsort: (libc)Array Sort Function.
  1256. * raise: (libc)Signaling Yourself.
  1257. * rand: (libc)ISO Random.
  1258. * RAND_MAX: (libc)ISO Random.
  1259. * random: (libc)BSD Random.
  1260. * random_r: (libc)BSD Random.
  1261. * rand_r: (libc)ISO Random.
  1262. * rawmemchr: (libc)Search Functions.
  1263. * readdir64: (libc)Reading/Closing Directory.
  1264. * readdir64_r: (libc)Reading/Closing Directory.
  1265. * readdir: (libc)Reading/Closing Directory.
  1266. * readdir_r: (libc)Reading/Closing Directory.
  1267. * read: (libc)I/O Primitives.
  1268. * readlink: (libc)Symbolic Links.
  1269. * readv: (libc)Scatter-Gather.
  1270. * realloc: (libc)Changing Block Size.
  1271. * realpath: (libc)Symbolic Links.
  1272. * recvfrom: (libc)Receiving Datagrams.
  1273. * recv: (libc)Receiving Data.
  1274. * recvmsg: (libc)Receiving Datagrams.
  1275. * RE_DUP_MAX: (libc)General Limits.
  1276. * regcomp: (libc)POSIX Regexp Compilation.
  1277. * regerror: (libc)Regexp Cleanup.
  1278. * regexec: (libc)Matching POSIX Regexps.
  1279. * regfree: (libc)Regexp Cleanup.
  1280. * register_printf_function: (libc)Registering New Conversions.
  1281. * remainderf: (libc)Remainder Functions.
  1282. * remainder: (libc)Remainder Functions.
  1283. * remainderl: (libc)Remainder Functions.
  1284. * remove: (libc)Deleting Files.
  1285. * rename: (libc)Renaming Files.
  1286. * rewinddir: (libc)Random Access Directory.
  1287. * rewind: (libc)File Positioning.
  1288. * rindex: (libc)Search Functions.
  1289. * rintf: (libc)Rounding Functions.
  1290. * rint: (libc)Rounding Functions.
  1291. * rintl: (libc)Rounding Functions.
  1292. * RLIM_INFINITY: (libc)Limits on Resources.
  1293. * rmdir: (libc)Deleting Files.
  1294. * R_OK: (libc)Testing File Access.
  1295. * roundevenf: (libc)Rounding Functions.
  1296. * roundeven: (libc)Rounding Functions.
  1297. * roundevenl: (libc)Rounding Functions.
  1298. * roundf: (libc)Rounding Functions.
  1299. * round: (libc)Rounding Functions.
  1300. * roundl: (libc)Rounding Functions.
  1301. * rpmatch: (libc)Yes-or-No Questions.
  1302. * SA_NOCLDSTOP: (libc)Flags for Sigaction.
  1303. * SA_ONSTACK: (libc)Flags for Sigaction.
  1304. * SA_RESTART: (libc)Flags for Sigaction.
  1305. * sbrk: (libc)Resizing the Data Segment.
  1306. * scalbf: (libc)Normalization Functions.
  1307. * scalb: (libc)Normalization Functions.
  1308. * scalbl: (libc)Normalization Functions.
  1309. * scalblnf: (libc)Normalization Functions.
  1310. * scalbln: (libc)Normalization Functions.
  1311. * scalblnl: (libc)Normalization Functions.
  1312. * scalbnf: (libc)Normalization Functions.
  1313. * scalbn: (libc)Normalization Functions.
  1314. * scalbnl: (libc)Normalization Functions.
  1315. * scandir64: (libc)Scanning Directory Content.
  1316. * scandir: (libc)Scanning Directory Content.
  1317. * scanf: (libc)Formatted Input Functions.
  1318. * sched_getaffinity: (libc)CPU Affinity.
  1319. * sched_getparam: (libc)Basic Scheduling Functions.
  1320. * sched_get_priority_max: (libc)Basic Scheduling Functions.
  1321. * sched_get_priority_min: (libc)Basic Scheduling Functions.
  1322. * sched_getscheduler: (libc)Basic Scheduling Functions.
  1323. * sched_rr_get_interval: (libc)Basic Scheduling Functions.
  1324. * sched_setaffinity: (libc)CPU Affinity.
  1325. * sched_setparam: (libc)Basic Scheduling Functions.
  1326. * sched_setscheduler: (libc)Basic Scheduling Functions.
  1327. * sched_yield: (libc)Basic Scheduling Functions.
  1328. * secure_getenv: (libc)Environment Access.
  1329. * seed48: (libc)SVID Random.
  1330. * seed48_r: (libc)SVID Random.
  1331. * SEEK_CUR: (libc)File Positioning.
  1332. * seekdir: (libc)Random Access Directory.
  1333. * SEEK_END: (libc)File Positioning.
  1334. * SEEK_SET: (libc)File Positioning.
  1335. * select: (libc)Waiting for I/O.
  1336. * sem_close: (libc)Semaphores.
  1337. * semctl: (libc)Semaphores.
  1338. * sem_destroy: (libc)Semaphores.
  1339. * semget: (libc)Semaphores.
  1340. * sem_getvalue: (libc)Semaphores.
  1341. * sem_init: (libc)Semaphores.
  1342. * sem_open: (libc)Semaphores.
  1343. * semop: (libc)Semaphores.
  1344. * sem_post: (libc)Semaphores.
  1345. * semtimedop: (libc)Semaphores.
  1346. * sem_timedwait: (libc)Semaphores.
  1347. * sem_trywait: (libc)Semaphores.
  1348. * sem_unlink: (libc)Semaphores.
  1349. * sem_wait: (libc)Semaphores.
  1350. * send: (libc)Sending Data.
  1351. * sendmsg: (libc)Receiving Datagrams.
  1352. * sendto: (libc)Sending Datagrams.
  1353. * setbuffer: (libc)Controlling Buffering.
  1354. * setbuf: (libc)Controlling Buffering.
  1355. * setcontext: (libc)System V contexts.
  1356. * setdomainname: (libc)Host Identification.
  1357. * setegid: (libc)Setting Groups.
  1358. * setenv: (libc)Environment Access.
  1359. * seteuid: (libc)Setting User ID.
  1360. * setfsent: (libc)fstab.
  1361. * setgid: (libc)Setting Groups.
  1362. * setgrent: (libc)Scanning All Groups.
  1363. * setgroups: (libc)Setting Groups.
  1364. * sethostent: (libc)Host Names.
  1365. * sethostid: (libc)Host Identification.
  1366. * sethostname: (libc)Host Identification.
  1367. * setitimer: (libc)Setting an Alarm.
  1368. * setjmp: (libc)Non-Local Details.
  1369. * setkey: (libc)DES Encryption.
  1370. * setkey_r: (libc)DES Encryption.
  1371. * setlinebuf: (libc)Controlling Buffering.
  1372. * setlocale: (libc)Setting the Locale.
  1373. * setlogmask: (libc)setlogmask.
  1374. * setmntent: (libc)mtab.
  1375. * setnetent: (libc)Networks Database.
  1376. * setnetgrent: (libc)Lookup Netgroup.
  1377. * setpayloadf: (libc)FP Bit Twiddling.
  1378. * setpayload: (libc)FP Bit Twiddling.
  1379. * setpayloadl: (libc)FP Bit Twiddling.
  1380. * setpayloadsigf: (libc)FP Bit Twiddling.
  1381. * setpayloadsig: (libc)FP Bit Twiddling.
  1382. * setpayloadsigl: (libc)FP Bit Twiddling.
  1383. * setpgid: (libc)Process Group Functions.
  1384. * setpgrp: (libc)Process Group Functions.
  1385. * setpriority: (libc)Traditional Scheduling Functions.
  1386. * setprotoent: (libc)Protocols Database.
  1387. * setpwent: (libc)Scanning All Users.
  1388. * setregid: (libc)Setting Groups.
  1389. * setreuid: (libc)Setting User ID.
  1390. * setrlimit64: (libc)Limits on Resources.
  1391. * setrlimit: (libc)Limits on Resources.
  1392. * setservent: (libc)Services Database.
  1393. * setsid: (libc)Process Group Functions.
  1394. * setsockopt: (libc)Socket Option Functions.
  1395. * setstate: (libc)BSD Random.
  1396. * setstate_r: (libc)BSD Random.
  1397. * settimeofday: (libc)High-Resolution Calendar.
  1398. * setuid: (libc)Setting User ID.
  1399. * setutent: (libc)Manipulating the Database.
  1400. * setutxent: (libc)XPG Functions.
  1401. * setvbuf: (libc)Controlling Buffering.
  1402. * shm_open: (libc)Memory-mapped I/O.
  1403. * shm_unlink: (libc)Memory-mapped I/O.
  1404. * shutdown: (libc)Closing a Socket.
  1405. * S_IFMT: (libc)Testing File Type.
  1406. * SIGABRT: (libc)Program Error Signals.
  1407. * sigaction: (libc)Advanced Signal Handling.
  1408. * sigaddset: (libc)Signal Sets.
  1409. * SIGALRM: (libc)Alarm Signals.
  1410. * sigaltstack: (libc)Signal Stack.
  1411. * sigblock: (libc)BSD Signal Handling.
  1412. * SIGBUS: (libc)Program Error Signals.
  1413. * SIGCHLD: (libc)Job Control Signals.
  1414. * SIGCLD: (libc)Job Control Signals.
  1415. * SIGCONT: (libc)Job Control Signals.
  1416. * sigdelset: (libc)Signal Sets.
  1417. * sigemptyset: (libc)Signal Sets.
  1418. * SIGEMT: (libc)Program Error Signals.
  1419. * SIG_ERR: (libc)Basic Signal Handling.
  1420. * sigfillset: (libc)Signal Sets.
  1421. * SIGFPE: (libc)Program Error Signals.
  1422. * SIGHUP: (libc)Termination Signals.
  1423. * SIGILL: (libc)Program Error Signals.
  1424. * SIGINFO: (libc)Miscellaneous Signals.
  1425. * siginterrupt: (libc)BSD Signal Handling.
  1426. * SIGINT: (libc)Termination Signals.
  1427. * SIGIO: (libc)Asynchronous I/O Signals.
  1428. * SIGIOT: (libc)Program Error Signals.
  1429. * sigismember: (libc)Signal Sets.
  1430. * SIGKILL: (libc)Termination Signals.
  1431. * siglongjmp: (libc)Non-Local Exits and Signals.
  1432. * SIGLOST: (libc)Operation Error Signals.
  1433. * sigmask: (libc)BSD Signal Handling.
  1434. * signal: (libc)Basic Signal Handling.
  1435. * signbit: (libc)FP Bit Twiddling.
  1436. * significandf: (libc)Normalization Functions.
  1437. * significand: (libc)Normalization Functions.
  1438. * significandl: (libc)Normalization Functions.
  1439. * sigpause: (libc)BSD Signal Handling.
  1440. * sigpending: (libc)Checking for Pending Signals.
  1441. * SIGPIPE: (libc)Operation Error Signals.
  1442. * SIGPOLL: (libc)Asynchronous I/O Signals.
  1443. * sigprocmask: (libc)Process Signal Mask.
  1444. * SIGPROF: (libc)Alarm Signals.
  1445. * SIGQUIT: (libc)Termination Signals.
  1446. * SIGSEGV: (libc)Program Error Signals.
  1447. * sigsetjmp: (libc)Non-Local Exits and Signals.
  1448. * sigsetmask: (libc)BSD Signal Handling.
  1449. * sigstack: (libc)Signal Stack.
  1450. * SIGSTOP: (libc)Job Control Signals.
  1451. * sigsuspend: (libc)Sigsuspend.
  1452. * SIGSYS: (libc)Program Error Signals.
  1453. * SIGTERM: (libc)Termination Signals.
  1454. * SIGTRAP: (libc)Program Error Signals.
  1455. * SIGTSTP: (libc)Job Control Signals.
  1456. * SIGTTIN: (libc)Job Control Signals.
  1457. * SIGTTOU: (libc)Job Control Signals.
  1458. * SIGURG: (libc)Asynchronous I/O Signals.
  1459. * SIGUSR1: (libc)Miscellaneous Signals.
  1460. * SIGUSR2: (libc)Miscellaneous Signals.
  1461. * SIGVTALRM: (libc)Alarm Signals.
  1462. * SIGWINCH: (libc)Miscellaneous Signals.
  1463. * SIGXCPU: (libc)Operation Error Signals.
  1464. * SIGXFSZ: (libc)Operation Error Signals.
  1465. * sincosf: (libc)Trig Functions.
  1466. * sincos: (libc)Trig Functions.
  1467. * sincosl: (libc)Trig Functions.
  1468. * sinf: (libc)Trig Functions.
  1469. * sinhf: (libc)Hyperbolic Functions.
  1470. * sinh: (libc)Hyperbolic Functions.
  1471. * sinhl: (libc)Hyperbolic Functions.
  1472. * sin: (libc)Trig Functions.
  1473. * sinl: (libc)Trig Functions.
  1474. * S_ISBLK: (libc)Testing File Type.
  1475. * S_ISCHR: (libc)Testing File Type.
  1476. * S_ISDIR: (libc)Testing File Type.
  1477. * S_ISFIFO: (libc)Testing File Type.
  1478. * S_ISLNK: (libc)Testing File Type.
  1479. * S_ISREG: (libc)Testing File Type.
  1480. * S_ISSOCK: (libc)Testing File Type.
  1481. * sleep: (libc)Sleeping.
  1482. * SNANF: (libc)Infinity and NaN.
  1483. * SNAN: (libc)Infinity and NaN.
  1484. * SNANL: (libc)Infinity and NaN.
  1485. * snprintf: (libc)Formatted Output Functions.
  1486. * SOCK_DGRAM: (libc)Communication Styles.
  1487. * socket: (libc)Creating a Socket.
  1488. * socketpair: (libc)Socket Pairs.
  1489. * SOCK_RAW: (libc)Communication Styles.
  1490. * SOCK_RDM: (libc)Communication Styles.
  1491. * SOCK_SEQPACKET: (libc)Communication Styles.
  1492. * SOCK_STREAM: (libc)Communication Styles.
  1493. * SOL_SOCKET: (libc)Socket-Level Options.
  1494. * sprintf: (libc)Formatted Output Functions.
  1495. * sqrtf: (libc)Exponents and Logarithms.
  1496. * sqrt: (libc)Exponents and Logarithms.
  1497. * sqrtl: (libc)Exponents and Logarithms.
  1498. * srand48: (libc)SVID Random.
  1499. * srand48_r: (libc)SVID Random.
  1500. * srand: (libc)ISO Random.
  1501. * srandom: (libc)BSD Random.
  1502. * srandom_r: (libc)BSD Random.
  1503. * sscanf: (libc)Formatted Input Functions.
  1504. * ssignal: (libc)Basic Signal Handling.
  1505. * SSIZE_MAX: (libc)General Limits.
  1506. * stat64: (libc)Reading Attributes.
  1507. * stat: (libc)Reading Attributes.
  1508. * stime: (libc)Simple Calendar Time.
  1509. * stpcpy: (libc)Copying Strings and Arrays.
  1510. * stpncpy: (libc)Truncating Strings.
  1511. * strcasecmp: (libc)String/Array Comparison.
  1512. * strcasestr: (libc)Search Functions.
  1513. * strcat: (libc)Concatenating Strings.
  1514. * strchr: (libc)Search Functions.
  1515. * strchrnul: (libc)Search Functions.
  1516. * strcmp: (libc)String/Array Comparison.
  1517. * strcoll: (libc)Collation Functions.
  1518. * strcpy: (libc)Copying Strings and Arrays.
  1519. * strcspn: (libc)Search Functions.
  1520. * strdupa: (libc)Copying Strings and Arrays.
  1521. * strdup: (libc)Copying Strings and Arrays.
  1522. * STREAM_MAX: (libc)General Limits.
  1523. * strerror: (libc)Error Messages.
  1524. * strerror_r: (libc)Error Messages.
  1525. * strfmon: (libc)Formatting Numbers.
  1526. * strfromd: (libc)Printing of Floats.
  1527. * strfromf: (libc)Printing of Floats.
  1528. * strfroml: (libc)Printing of Floats.
  1529. * strfry: (libc)strfry.
  1530. * strftime: (libc)Formatting Calendar Time.
  1531. * strlen: (libc)String Length.
  1532. * strncasecmp: (libc)String/Array Comparison.
  1533. * strncat: (libc)Truncating Strings.
  1534. * strncmp: (libc)String/Array Comparison.
  1535. * strncpy: (libc)Truncating Strings.
  1536. * strndupa: (libc)Truncating Strings.
  1537. * strndup: (libc)Truncating Strings.
  1538. * strnlen: (libc)String Length.
  1539. * strpbrk: (libc)Search Functions.
  1540. * strptime: (libc)Low-Level Time String Parsing.
  1541. * strrchr: (libc)Search Functions.
  1542. * strsep: (libc)Finding Tokens in a String.
  1543. * strsignal: (libc)Signal Messages.
  1544. * strspn: (libc)Search Functions.
  1545. * strstr: (libc)Search Functions.
  1546. * strtod: (libc)Parsing of Floats.
  1547. * strtof: (libc)Parsing of Floats.
  1548. * strtoimax: (libc)Parsing of Integers.
  1549. * strtok: (libc)Finding Tokens in a String.
  1550. * strtok_r: (libc)Finding Tokens in a String.
  1551. * strtold: (libc)Parsing of Floats.
  1552. * strtol: (libc)Parsing of Integers.
  1553. * strtoll: (libc)Parsing of Integers.
  1554. * strtoq: (libc)Parsing of Integers.
  1555. * strtoul: (libc)Parsing of Integers.
  1556. * strtoull: (libc)Parsing of Integers.
  1557. * strtoumax: (libc)Parsing of Integers.
  1558. * strtouq: (libc)Parsing of Integers.
  1559. * strverscmp: (libc)String/Array Comparison.
  1560. * strxfrm: (libc)Collation Functions.
  1561. * stty: (libc)BSD Terminal Modes.
  1562. * S_TYPEISMQ: (libc)Testing File Type.
  1563. * S_TYPEISSEM: (libc)Testing File Type.
  1564. * S_TYPEISSHM: (libc)Testing File Type.
  1565. * SUN_LEN: (libc)Local Namespace Details.
  1566. * swapcontext: (libc)System V contexts.
  1567. * swprintf: (libc)Formatted Output Functions.
  1568. * swscanf: (libc)Formatted Input Functions.
  1569. * symlink: (libc)Symbolic Links.
  1570. * sync: (libc)Synchronizing I/O.
  1571. * syscall: (libc)System Calls.
  1572. * sysconf: (libc)Sysconf Definition.
  1573. * sysctl: (libc)System Parameters.
  1574. * syslog: (libc)syslog; vsyslog.
  1575. * system: (libc)Running a Command.
  1576. * sysv_signal: (libc)Basic Signal Handling.
  1577. * tanf: (libc)Trig Functions.
  1578. * tanhf: (libc)Hyperbolic Functions.
  1579. * tanh: (libc)Hyperbolic Functions.
  1580. * tanhl: (libc)Hyperbolic Functions.
  1581. * tan: (libc)Trig Functions.
  1582. * tanl: (libc)Trig Functions.
  1583. * tcdrain: (libc)Line Control.
  1584. * tcflow: (libc)Line Control.
  1585. * tcflush: (libc)Line Control.
  1586. * tcgetattr: (libc)Mode Functions.
  1587. * tcgetpgrp: (libc)Terminal Access Functions.
  1588. * tcgetsid: (libc)Terminal Access Functions.
  1589. * tcsendbreak: (libc)Line Control.
  1590. * tcsetattr: (libc)Mode Functions.
  1591. * tcsetpgrp: (libc)Terminal Access Functions.
  1592. * tdelete: (libc)Tree Search Function.
  1593. * tdestroy: (libc)Tree Search Function.
  1594. * telldir: (libc)Random Access Directory.
  1595. * tempnam: (libc)Temporary Files.
  1596. * textdomain: (libc)Locating gettext catalog.
  1597. * tfind: (libc)Tree Search Function.
  1598. * tgammaf: (libc)Special Functions.
  1599. * tgamma: (libc)Special Functions.
  1600. * tgammal: (libc)Special Functions.
  1601. * timegm: (libc)Broken-down Time.
  1602. * time: (libc)Simple Calendar Time.
  1603. * timelocal: (libc)Broken-down Time.
  1604. * times: (libc)Processor Time.
  1605. * tmpfile64: (libc)Temporary Files.
  1606. * tmpfile: (libc)Temporary Files.
  1607. * TMP_MAX: (libc)Temporary Files.
  1608. * tmpnam: (libc)Temporary Files.
  1609. * tmpnam_r: (libc)Temporary Files.
  1610. * toascii: (libc)Case Conversion.
  1611. * _tolower: (libc)Case Conversion.
  1612. * tolower: (libc)Case Conversion.
  1613. * TOSTOP: (libc)Local Modes.
  1614. * totalorderf: (libc)FP Comparison Functions.
  1615. * totalorder: (libc)FP Comparison Functions.
  1616. * totalorderl: (libc)FP Comparison Functions.
  1617. * totalordermagf: (libc)FP Comparison Functions.
  1618. * totalordermag: (libc)FP Comparison Functions.
  1619. * totalordermagl: (libc)FP Comparison Functions.
  1620. * _toupper: (libc)Case Conversion.
  1621. * toupper: (libc)Case Conversion.
  1622. * towctrans: (libc)Wide Character Case Conversion.
  1623. * towlower: (libc)Wide Character Case Conversion.
  1624. * towupper: (libc)Wide Character Case Conversion.
  1625. * truncate64: (libc)File Size.
  1626. * truncate: (libc)File Size.
  1627. * truncf: (libc)Rounding Functions.
  1628. * trunc: (libc)Rounding Functions.
  1629. * truncl: (libc)Rounding Functions.
  1630. * tsearch: (libc)Tree Search Function.
  1631. * ttyname: (libc)Is It a Terminal.
  1632. * ttyname_r: (libc)Is It a Terminal.
  1633. * twalk: (libc)Tree Search Function.
  1634. * TZNAME_MAX: (libc)General Limits.
  1635. * tzset: (libc)Time Zone Functions.
  1636. * ufromfpf: (libc)Rounding Functions.
  1637. * ufromfp: (libc)Rounding Functions.
  1638. * ufromfpl: (libc)Rounding Functions.
  1639. * ufromfpxf: (libc)Rounding Functions.
  1640. * ufromfpx: (libc)Rounding Functions.
  1641. * ufromfpxl: (libc)Rounding Functions.
  1642. * ulimit: (libc)Limits on Resources.
  1643. * umask: (libc)Setting Permissions.
  1644. * umount2: (libc)Mount-Unmount-Remount.
  1645. * umount: (libc)Mount-Unmount-Remount.
  1646. * uname: (libc)Platform Type.
  1647. * ungetc: (libc)How Unread.
  1648. * ungetwc: (libc)How Unread.
  1649. * unlink: (libc)Deleting Files.
  1650. * unlockpt: (libc)Allocation.
  1651. * unsetenv: (libc)Environment Access.
  1652. * updwtmp: (libc)Manipulating the Database.
  1653. * utime: (libc)File Times.
  1654. * utimes: (libc)File Times.
  1655. * utmpname: (libc)Manipulating the Database.
  1656. * utmpxname: (libc)XPG Functions.
  1657. * va_arg: (libc)Argument Macros.
  1658. * __va_copy: (libc)Argument Macros.
  1659. * va_copy: (libc)Argument Macros.
  1660. * va_end: (libc)Argument Macros.
  1661. * valloc: (libc)Aligned Memory Blocks.
  1662. * vasprintf: (libc)Variable Arguments Output.
  1663. * va_start: (libc)Argument Macros.
  1664. * VDISCARD: (libc)Other Special.
  1665. * VDSUSP: (libc)Signal Characters.
  1666. * VEOF: (libc)Editing Characters.
  1667. * VEOL2: (libc)Editing Characters.
  1668. * VEOL: (libc)Editing Characters.
  1669. * VERASE: (libc)Editing Characters.
  1670. * verr: (libc)Error Messages.
  1671. * verrx: (libc)Error Messages.
  1672. * versionsort64: (libc)Scanning Directory Content.
  1673. * versionsort: (libc)Scanning Directory Content.
  1674. * vfork: (libc)Creating a Process.
  1675. * vfprintf: (libc)Variable Arguments Output.
  1676. * vfscanf: (libc)Variable Arguments Input.
  1677. * vfwprintf: (libc)Variable Arguments Output.
  1678. * vfwscanf: (libc)Variable Arguments Input.
  1679. * VINTR: (libc)Signal Characters.
  1680. * VKILL: (libc)Editing Characters.
  1681. * vlimit: (libc)Limits on Resources.
  1682. * VLNEXT: (libc)Other Special.
  1683. * VMIN: (libc)Noncanonical Input.
  1684. * vprintf: (libc)Variable Arguments Output.
  1685. * VQUIT: (libc)Signal Characters.
  1686. * VREPRINT: (libc)Editing Characters.
  1687. * vscanf: (libc)Variable Arguments Input.
  1688. * vsnprintf: (libc)Variable Arguments Output.
  1689. * vsprintf: (libc)Variable Arguments Output.
  1690. * vsscanf: (libc)Variable Arguments Input.
  1691. * VSTART: (libc)Start/Stop Characters.
  1692. * VSTATUS: (libc)Other Special.
  1693. * VSTOP: (libc)Start/Stop Characters.
  1694. * VSUSP: (libc)Signal Characters.
  1695. * vswprintf: (libc)Variable Arguments Output.
  1696. * vswscanf: (libc)Variable Arguments Input.
  1697. * vsyslog: (libc)syslog; vsyslog.
  1698. * VTIME: (libc)Noncanonical Input.
  1699. * vtimes: (libc)Resource Usage.
  1700. * vwarn: (libc)Error Messages.
  1701. * vwarnx: (libc)Error Messages.
  1702. * VWERASE: (libc)Editing Characters.
  1703. * vwprintf: (libc)Variable Arguments Output.
  1704. * vwscanf: (libc)Variable Arguments Input.
  1705. * wait3: (libc)BSD Wait Functions.
  1706. * wait4: (libc)Process Completion.
  1707. * wait: (libc)Process Completion.
  1708. * waitpid: (libc)Process Completion.
  1709. * warn: (libc)Error Messages.
  1710. * warnx: (libc)Error Messages.
  1711. * WCHAR_MAX: (libc)Extended Char Intro.
  1712. * WCHAR_MIN: (libc)Extended Char Intro.
  1713. * WCOREDUMP: (libc)Process Completion Status.
  1714. * wcpcpy: (libc)Copying Strings and Arrays.
  1715. * wcpncpy: (libc)Truncating Strings.
  1716. * wcrtomb: (libc)Converting a Character.
  1717. * wcscasecmp: (libc)String/Array Comparison.
  1718. * wcscat: (libc)Concatenating Strings.
  1719. * wcschr: (libc)Search Functions.
  1720. * wcschrnul: (libc)Search Functions.
  1721. * wcscmp: (libc)String/Array Comparison.
  1722. * wcscoll: (libc)Collation Functions.
  1723. * wcscpy: (libc)Copying Strings and Arrays.
  1724. * wcscspn: (libc)Search Functions.
  1725. * wcsdup: (libc)Copying Strings and Arrays.
  1726. * wcsftime: (libc)Formatting Calendar Time.
  1727. * wcslen: (libc)String Length.
  1728. * wcsncasecmp: (libc)String/Array Comparison.
  1729. * wcsncat: (libc)Truncating Strings.
  1730. * wcsncmp: (libc)String/Array Comparison.
  1731. * wcsncpy: (libc)Truncating Strings.
  1732. * wcsnlen: (libc)String Length.
  1733. * wcsnrtombs: (libc)Converting Strings.
  1734. * wcspbrk: (libc)Search Functions.
  1735. * wcsrchr: (libc)Search Functions.
  1736. * wcsrtombs: (libc)Converting Strings.
  1737. * wcsspn: (libc)Search Functions.
  1738. * wcsstr: (libc)Search Functions.
  1739. * wcstod: (libc)Parsing of Floats.
  1740. * wcstof: (libc)Parsing of Floats.
  1741. * wcstoimax: (libc)Parsing of Integers.
  1742. * wcstok: (libc)Finding Tokens in a String.
  1743. * wcstold: (libc)Parsing of Floats.
  1744. * wcstol: (libc)Parsing of Integers.
  1745. * wcstoll: (libc)Parsing of Integers.
  1746. * wcstombs: (libc)Non-reentrant String Conversion.
  1747. * wcstoq: (libc)Parsing of Integers.
  1748. * wcstoul: (libc)Parsing of Integers.
  1749. * wcstoull: (libc)Parsing of Integers.
  1750. * wcstoumax: (libc)Parsing of Integers.
  1751. * wcstouq: (libc)Parsing of Integers.
  1752. * wcswcs: (libc)Search Functions.
  1753. * wcsxfrm: (libc)Collation Functions.
  1754. * wctob: (libc)Converting a Character.
  1755. * wctomb: (libc)Non-reentrant Character Conversion.
  1756. * wctrans: (libc)Wide Character Case Conversion.
  1757. * wctype: (libc)Classification of Wide Characters.
  1758. * WEOF: (libc)EOF and Errors.
  1759. * WEOF: (libc)Extended Char Intro.
  1760. * WEXITSTATUS: (libc)Process Completion Status.
  1761. * WIFEXITED: (libc)Process Completion Status.
  1762. * WIFSIGNALED: (libc)Process Completion Status.
  1763. * WIFSTOPPED: (libc)Process Completion Status.
  1764. * wmemchr: (libc)Search Functions.
  1765. * wmemcmp: (libc)String/Array Comparison.
  1766. * wmemcpy: (libc)Copying Strings and Arrays.
  1767. * wmemmove: (libc)Copying Strings and Arrays.
  1768. * wmempcpy: (libc)Copying Strings and Arrays.
  1769. * wmemset: (libc)Copying Strings and Arrays.
  1770. * W_OK: (libc)Testing File Access.
  1771. * wordexp: (libc)Calling Wordexp.
  1772. * wordfree: (libc)Calling Wordexp.
  1773. * wprintf: (libc)Formatted Output Functions.
  1774. * write: (libc)I/O Primitives.
  1775. * writev: (libc)Scatter-Gather.
  1776. * wscanf: (libc)Formatted Input Functions.
  1777. * WSTOPSIG: (libc)Process Completion Status.
  1778. * WTERMSIG: (libc)Process Completion Status.
  1779. * X_OK: (libc)Testing File Access.
  1780. * y0f: (libc)Special Functions.
  1781. * y0: (libc)Special Functions.
  1782. * y0l: (libc)Special Functions.
  1783. * y1f: (libc)Special Functions.
  1784. * y1: (libc)Special Functions.
  1785. * y1l: (libc)Special Functions.
  1786. * ynf: (libc)Special Functions.
  1787. * yn: (libc)Special Functions.
  1788. * ynl: (libc)Special Functions.
  1789. END-INFO-DIR-ENTRY
  1790. 
  1791. File: libc.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
  1792. Main Menu
  1793. *********
  1794. This is ‘The GNU C Library Reference Manual’, for Version 2.25 of the
  1795. GNU C Library.
  1796. * Menu:
  1797. * Introduction:: Purpose of the GNU C Library.
  1798. * Error Reporting:: How library functions report errors.
  1799. * Memory:: Allocating virtual memory and controlling
  1800. paging.
  1801. * Character Handling:: Character testing and conversion functions.
  1802. * String and Array Utilities:: Utilities for copying and comparing strings
  1803. and arrays.
  1804. * Character Set Handling:: Support for extended character sets.
  1805. * Locales:: The country and language can affect the
  1806. behavior of library functions.
  1807. * Message Translation:: How to make the program speak the user’s
  1808. language.
  1809. * Searching and Sorting:: General searching and sorting functions.
  1810. * Pattern Matching:: Matching shell “globs” and regular
  1811. expressions.
  1812. * I/O Overview:: Introduction to the I/O facilities.
  1813. * I/O on Streams:: High-level, portable I/O facilities.
  1814. * Low-Level I/O:: Low-level, less portable I/O.
  1815. * File System Interface:: Functions for manipulating files.
  1816. * Pipes and FIFOs:: A simple interprocess communication
  1817. mechanism.
  1818. * Sockets:: A more complicated IPC mechanism, with
  1819. networking support.
  1820. * Low-Level Terminal Interface:: How to change the characteristics of a
  1821. terminal device.
  1822. * Syslog:: System logging and messaging.
  1823. * Mathematics:: Math functions, useful constants, random
  1824. numbers.
  1825. * Arithmetic:: Low level arithmetic functions.
  1826. * Date and Time:: Functions for getting the date and time and
  1827. formatting them nicely.
  1828. * Resource Usage And Limitation:: Functions for examining resource usage and
  1829. getting and setting limits.
  1830. * Non-Local Exits:: Jumping out of nested function calls.
  1831. * Signal Handling:: How to send, block, and handle signals.
  1832. * Program Basics:: Writing the beginning and end of your
  1833. program.
  1834. * Processes:: How to create processes and run other
  1835. programs.
  1836. * Inter-Process Communication:: All about inter-process communication.
  1837. * Job Control:: All about process groups and sessions.
  1838. * Name Service Switch:: Accessing system databases.
  1839. * Users and Groups:: How users are identified and classified.
  1840. * System Management:: Controlling the system and getting
  1841. information about it.
  1842. * System Configuration:: Parameters describing operating system
  1843. limits.
  1844. * Cryptographic Functions:: DES encryption and password handling.
  1845. * Debugging Support:: Functions to help debugging applications.
  1846. * POSIX Threads:: POSIX Threads.
  1847. * Internal Probes:: Probes to monitor libc internal behavior.
  1848. * Tunables:: Tunable switches to alter libc internal
  1849. behavior.
  1850. Appendices
  1851. * Language Features:: C language features provided by the library.
  1852. * Library Summary:: A summary showing the syntax, header file,
  1853. and derivation of each library feature.
  1854. * Installation:: How to install the GNU C Library.
  1855. * Maintenance:: How to enhance and port the GNU C Library.
  1856. * Platform:: Describe all platform-specific facilities
  1857. provided.
  1858. * Contributors:: Who wrote what parts of the GNU C Library.
  1859. * Free Manuals:: Free Software Needs Free Documentation.
  1860. * Copying:: The GNU Lesser General Public License says
  1861. how you can copy and share the GNU C Library.
  1862. * Documentation License:: This manual is under the GNU Free
  1863. Documentation License.
  1864. Indices
  1865. * Concept Index:: Index of concepts and names.
  1866. * Type Index:: Index of types and type qualifiers.
  1867. * Function Index:: Index of functions and function-like macros.
  1868. * Variable Index:: Index of variables and variable-like macros.
  1869. * File Index:: Index of programs and files.
  1870. — The Detailed Node Listing —
  1871. Introduction
  1872. * Getting Started:: What this manual is for and how to use it.
  1873. * Standards and Portability:: Standards and sources upon which the GNU
  1874. C library is based.
  1875. * Using the Library:: Some practical uses for the library.
  1876. * Roadmap to the Manual:: Overview of the remaining chapters in
  1877. this manual.
  1878. Standards and Portability
  1879. * ISO C:: The international standard for the C
  1880. programming language.
  1881. * POSIX:: The ISO/IEC 9945 (aka IEEE 1003) standards
  1882. for operating systems.
  1883. * Berkeley Unix:: BSD and SunOS.
  1884. * SVID:: The System V Interface Description.
  1885. * XPG:: The X/Open Portability Guide.
  1886. POSIX
  1887. * POSIX Safety Concepts:: Safety concepts from POSIX.
  1888. * Unsafe Features:: Features that make functions unsafe.
  1889. * Conditionally Safe Features:: Features that make functions unsafe
  1890. in the absence of workarounds.
  1891. * Other Safety Remarks:: Additional safety features and remarks.
  1892. Using the Library
  1893. * Header Files:: How to include the header files in your
  1894. programs.
  1895. * Macro Definitions:: Some functions in the library may really
  1896. be implemented as macros.
  1897. * Reserved Names:: The C standard reserves some names for
  1898. the library, and some for users.
  1899. * Feature Test Macros:: How to control what names are defined.
  1900. Error Reporting
  1901. * Checking for Errors:: How errors are reported by library functions.
  1902. * Error Codes:: Error code macros; all of these expand
  1903. into integer constant values.
  1904. * Error Messages:: Mapping error codes onto error messages.
  1905. Memory
  1906. * Memory Concepts:: An introduction to concepts and terminology.
  1907. * Memory Allocation:: Allocating storage for your program data
  1908. * Resizing the Data Segment:: ‘brk’, ‘sbrk’
  1909. * Locking Pages:: Preventing page faults
  1910. Memory Allocation
  1911. * Memory Allocation and C:: How to get different kinds of allocation in C.
  1912. * The GNU Allocator:: An overview of the GNU ‘malloc’
  1913. implementation.
  1914. * Unconstrained Allocation:: The ‘malloc’ facility allows fully general
  1915. dynamic allocation.
  1916. * Allocation Debugging:: Finding memory leaks and not freed memory.
  1917. * Obstacks:: Obstacks are less general than malloc
  1918. but more efficient and convenient.
  1919. * Variable Size Automatic:: Allocation of variable-sized blocks
  1920. of automatic storage that are freed when the
  1921. calling function returns.
  1922. Unconstrained Allocation
  1923. * Basic Allocation:: Simple use of ‘malloc’.
  1924. * Malloc Examples:: Examples of ‘malloc’. ‘xmalloc’.
  1925. * Freeing after Malloc:: Use ‘free’ to free a block you
  1926. got with ‘malloc’.
  1927. * Changing Block Size:: Use ‘realloc’ to make a block
  1928. bigger or smaller.
  1929. * Allocating Cleared Space:: Use ‘calloc’ to allocate a
  1930. block and clear it.
  1931. * Aligned Memory Blocks:: Allocating specially aligned memory.
  1932. * Malloc Tunable Parameters:: Use ‘mallopt’ to adjust allocation
  1933. parameters.
  1934. * Heap Consistency Checking:: Automatic checking for errors.
  1935. * Hooks for Malloc:: You can use these hooks for debugging
  1936. programs that use ‘malloc’.
  1937. * Statistics of Malloc:: Getting information about how much
  1938. memory your program is using.
  1939. * Summary of Malloc:: Summary of ‘malloc’ and related functions.
  1940. Allocation Debugging
  1941. * Tracing malloc:: How to install the tracing functionality.
  1942. * Using the Memory Debugger:: Example programs excerpts.
  1943. * Tips for the Memory Debugger:: Some more or less clever ideas.
  1944. * Interpreting the traces:: What do all these lines mean?
  1945. Obstacks
  1946. * Creating Obstacks:: How to declare an obstack in your program.
  1947. * Preparing for Obstacks:: Preparations needed before you can
  1948. use obstacks.
  1949. * Allocation in an Obstack:: Allocating objects in an obstack.
  1950. * Freeing Obstack Objects:: Freeing objects in an obstack.
  1951. * Obstack Functions:: The obstack functions are both
  1952. functions and macros.
  1953. * Growing Objects:: Making an object bigger by stages.
  1954. * Extra Fast Growing:: Extra-high-efficiency (though more
  1955. complicated) growing objects.
  1956. * Status of an Obstack:: Inquiries about the status of an obstack.
  1957. * Obstacks Data Alignment:: Controlling alignment of objects in obstacks.
  1958. * Obstack Chunks:: How obstacks obtain and release chunks;
  1959. efficiency considerations.
  1960. * Summary of Obstacks::
  1961. Variable Size Automatic
  1962. * Alloca Example:: Example of using ‘alloca’.
  1963. * Advantages of Alloca:: Reasons to use ‘alloca’.
  1964. * Disadvantages of Alloca:: Reasons to avoid ‘alloca’.
  1965. * GNU C Variable-Size Arrays:: Only in GNU C, here is an alternative
  1966. method of allocating dynamically and
  1967. freeing automatically.
  1968. Locking Pages
  1969. * Why Lock Pages:: Reasons to read this section.
  1970. * Locked Memory Details:: Everything you need to know locked
  1971. memory
  1972. * Page Lock Functions:: Here’s how to do it.
  1973. Character Handling
  1974. * Classification of Characters:: Testing whether characters are
  1975. letters, digits, punctuation, etc.
  1976. * Case Conversion:: Case mapping, and the like.
  1977. * Classification of Wide Characters:: Character class determination for
  1978. wide characters.
  1979. * Using Wide Char Classes:: Notes on using the wide character
  1980. classes.
  1981. * Wide Character Case Conversion:: Mapping of wide characters.
  1982. String and Array Utilities
  1983. * Representation of Strings:: Introduction to basic concepts.
  1984. * String/Array Conventions:: Whether to use a string function or an
  1985. arbitrary array function.
  1986. * String Length:: Determining the length of a string.
  1987. * Copying Strings and Arrays:: Functions to copy strings and arrays.
  1988. * Concatenating Strings:: Functions to concatenate strings while copying.
  1989. * Truncating Strings:: Functions to truncate strings while copying.
  1990. * String/Array Comparison:: Functions for byte-wise and character-wise
  1991. comparison.
  1992. * Collation Functions:: Functions for collating strings.
  1993. * Search Functions:: Searching for a specific element or substring.
  1994. * Finding Tokens in a String:: Splitting a string into tokens by looking
  1995. for delimiters.
  1996. * Erasing Sensitive Data:: Clearing memory which contains sensitive
  1997. data, after it’s no longer needed.
  1998. * strfry:: Function for flash-cooking a string.
  1999. * Trivial Encryption:: Obscuring data.
  2000. * Encode Binary Data:: Encoding and Decoding of Binary Data.
  2001. * Argz and Envz Vectors:: Null-separated string vectors.
  2002. Argz and Envz Vectors
  2003. * Argz Functions:: Operations on argz vectors.
  2004. * Envz Functions:: Additional operations on environment vectors.
  2005. Character Set Handling
  2006. * Extended Char Intro:: Introduction to Extended Characters.
  2007. * Charset Function Overview:: Overview about Character Handling
  2008. Functions.
  2009. * Restartable multibyte conversion:: Restartable multibyte conversion
  2010. Functions.
  2011. * Non-reentrant Conversion:: Non-reentrant Conversion Function.
  2012. * Generic Charset Conversion:: Generic Charset Conversion.
  2013. Restartable multibyte conversion
  2014. * Selecting the Conversion:: Selecting the conversion and its properties.
  2015. * Keeping the state:: Representing the state of the conversion.
  2016. * Converting a Character:: Converting Single Characters.
  2017. * Converting Strings:: Converting Multibyte and Wide Character
  2018. Strings.
  2019. * Multibyte Conversion Example:: A Complete Multibyte Conversion Example.
  2020. Non-reentrant Conversion
  2021. * Non-reentrant Character Conversion:: Non-reentrant Conversion of Single
  2022. Characters.
  2023. * Non-reentrant String Conversion:: Non-reentrant Conversion of Strings.
  2024. * Shift State:: States in Non-reentrant Functions.
  2025. Generic Charset Conversion
  2026. * Generic Conversion Interface:: Generic Character Set Conversion Interface.
  2027. * iconv Examples:: A complete ‘iconv’ example.
  2028. * Other iconv Implementations:: Some Details about other ‘iconv’
  2029. Implementations.
  2030. * glibc iconv Implementation:: The ‘iconv’ Implementation in the GNU C
  2031. library.
  2032. Locales
  2033. * Effects of Locale:: Actions affected by the choice of
  2034. locale.
  2035. * Choosing Locale:: How the user specifies a locale.
  2036. * Locale Categories:: Different purposes for which you can
  2037. select a locale.
  2038. * Setting the Locale:: How a program specifies the locale
  2039. with library functions.
  2040. * Standard Locales:: Locale names available on all systems.
  2041. * Locale Names:: Format of system-specific locale names.
  2042. * Locale Information:: How to access the information for the locale.
  2043. * Formatting Numbers:: A dedicated function to format numbers.
  2044. * Yes-or-No Questions:: Check a Response against the locale.
  2045. Locale Information
  2046. * The Lame Way to Locale Data:: ISO C’s ‘localeconv’.
  2047. * The Elegant and Fast Way:: X/Open’s ‘nl_langinfo’.
  2048. The Lame Way to Locale Data
  2049. * General Numeric:: Parameters for formatting numbers and
  2050. currency amounts.
  2051. * Currency Symbol:: How to print the symbol that identifies an
  2052. amount of money (e.g. ‘$’).
  2053. * Sign of Money Amount:: How to print the (positive or negative) sign
  2054. for a monetary amount, if one exists.
  2055. Message Translation
  2056. * Message catalogs a la X/Open:: The ‘catgets’ family of functions.
  2057. * The Uniforum approach:: The ‘gettext’ family of functions.
  2058. Message catalogs a la X/Open
  2059. * The catgets Functions:: The ‘catgets’ function family.
  2060. * The message catalog files:: Format of the message catalog files.
  2061. * The gencat program:: How to generate message catalogs files which
  2062. can be used by the functions.
  2063. * Common Usage:: How to use the ‘catgets’ interface.
  2064. The Uniforum approach
  2065. * Message catalogs with gettext:: The ‘gettext’ family of functions.
  2066. * Helper programs for gettext:: Programs to handle message catalogs
  2067. for ‘gettext’.
  2068. Message catalogs with gettext
  2069. * Translation with gettext:: What has to be done to translate a message.
  2070. * Locating gettext catalog:: How to determine which catalog to be used.
  2071. * Advanced gettext functions:: Additional functions for more complicated
  2072. situations.
  2073. * Charset conversion in gettext:: How to specify the output character set
  2074. ‘gettext’ uses.
  2075. * GUI program problems:: How to use ‘gettext’ in GUI programs.
  2076. * Using gettextized software:: The possibilities of the user to influence
  2077. the way ‘gettext’ works.
  2078. Searching and Sorting
  2079. * Comparison Functions:: Defining how to compare two objects.
  2080. Since the sort and search facilities
  2081. are general, you have to specify the
  2082. ordering.
  2083. * Array Search Function:: The ‘bsearch’ function.
  2084. * Array Sort Function:: The ‘qsort’ function.
  2085. * Search/Sort Example:: An example program.
  2086. * Hash Search Function:: The ‘hsearch’ function.
  2087. * Tree Search Function:: The ‘tsearch’ function.
  2088. Pattern Matching
  2089. * Wildcard Matching:: Matching a wildcard pattern against a single string.
  2090. * Globbing:: Finding the files that match a wildcard pattern.
  2091. * Regular Expressions:: Matching regular expressions against strings.
  2092. * Word Expansion:: Expanding shell variables, nested commands,
  2093. arithmetic, and wildcards.
  2094. This is what the shell does with shell commands.
  2095. Globbing
  2096. * Calling Glob:: Basic use of ‘glob’.
  2097. * Flags for Globbing:: Flags that enable various options in ‘glob’.
  2098. * More Flags for Globbing:: GNU specific extensions to ‘glob’.
  2099. Regular Expressions
  2100. * POSIX Regexp Compilation:: Using ‘regcomp’ to prepare to match.
  2101. * Flags for POSIX Regexps:: Syntax variations for ‘regcomp’.
  2102. * Matching POSIX Regexps:: Using ‘regexec’ to match the compiled
  2103. pattern that you get from ‘regcomp’.
  2104. * Regexp Subexpressions:: Finding which parts of the string were matched.
  2105. * Subexpression Complications:: Find points of which parts were matched.
  2106. * Regexp Cleanup:: Freeing storage; reporting errors.
  2107. Word Expansion
  2108. * Expansion Stages:: What word expansion does to a string.
  2109. * Calling Wordexp:: How to call ‘wordexp’.
  2110. * Flags for Wordexp:: Options you can enable in ‘wordexp’.
  2111. * Wordexp Example:: A sample program that does word expansion.
  2112. * Tilde Expansion:: Details of how tilde expansion works.
  2113. * Variable Substitution:: Different types of variable substitution.
  2114. I/O Overview
  2115. * I/O Concepts:: Some basic information and terminology.
  2116. * File Names:: How to refer to a file.
  2117. I/O Concepts
  2118. * Streams and File Descriptors:: The GNU C Library provides two ways
  2119. to access the contents of files.
  2120. * File Position:: The number of bytes from the
  2121. beginning of the file.
  2122. File Names
  2123. * Directories:: Directories contain entries for files.
  2124. * File Name Resolution:: A file name specifies how to look up a file.
  2125. * File Name Errors:: Error conditions relating to file names.
  2126. * File Name Portability:: File name portability and syntax issues.
  2127. I/O on Streams
  2128. * Streams:: About the data type representing a stream.
  2129. * Standard Streams:: Streams to the standard input and output
  2130. devices are created for you.
  2131. * Opening Streams:: How to create a stream to talk to a file.
  2132. * Closing Streams:: Close a stream when you are finished with it.
  2133. * Streams and Threads:: Issues with streams in threaded programs.
  2134. * Streams and I18N:: Streams in internationalized applications.
  2135. * Simple Output:: Unformatted output by characters and lines.
  2136. * Character Input:: Unformatted input by characters and words.
  2137. * Line Input:: Reading a line or a record from a stream.
  2138. * Unreading:: Peeking ahead/pushing back input just read.
  2139. * Block Input/Output:: Input and output operations on blocks of data.
  2140. * Formatted Output:: ‘printf’ and related functions.
  2141. * Customizing Printf:: You can define new conversion specifiers for
  2142. ‘printf’ and friends.
  2143. * Formatted Input:: ‘scanf’ and related functions.
  2144. * EOF and Errors:: How you can tell if an I/O error happens.
  2145. * Error Recovery:: What you can do about errors.
  2146. * Binary Streams:: Some systems distinguish between text files
  2147. and binary files.
  2148. * File Positioning:: About random-access streams.
  2149. * Portable Positioning:: Random access on peculiar ISO C systems.
  2150. * Stream Buffering:: How to control buffering of streams.
  2151. * Other Kinds of Streams:: Streams that do not necessarily correspond
  2152. to an open file.
  2153. * Formatted Messages:: Print strictly formatted messages.
  2154. Unreading
  2155. * Unreading Idea:: An explanation of unreading with pictures.
  2156. * How Unread:: How to call ‘ungetc’ to do unreading.
  2157. Formatted Output
  2158. * Formatted Output Basics:: Some examples to get you started.
  2159. * Output Conversion Syntax:: General syntax of conversion
  2160. specifications.
  2161. * Table of Output Conversions:: Summary of output conversions and
  2162. what they do.
  2163. * Integer Conversions:: Details about formatting of integers.
  2164. * Floating-Point Conversions:: Details about formatting of
  2165. floating-point numbers.
  2166. * Other Output Conversions:: Details about formatting of strings,
  2167. characters, pointers, and the like.
  2168. * Formatted Output Functions:: Descriptions of the actual functions.
  2169. * Dynamic Output:: Functions that allocate memory for the output.
  2170. * Variable Arguments Output:: ‘vprintf’ and friends.
  2171. * Parsing a Template String:: What kinds of args does a given template
  2172. call for?
  2173. * Example of Parsing:: Sample program using ‘parse_printf_format’.
  2174. Customizing Printf
  2175. * Registering New Conversions:: Using ‘register_printf_function’
  2176. to register a new output conversion.
  2177. * Conversion Specifier Options:: The handler must be able to get
  2178. the options specified in the
  2179. template when it is called.
  2180. * Defining the Output Handler:: Defining the handler and arginfo
  2181. functions that are passed as arguments
  2182. to ‘register_printf_function’.
  2183. * Printf Extension Example:: How to define a ‘printf’
  2184. handler function.
  2185. * Predefined Printf Handlers:: Predefined ‘printf’ handlers.
  2186. Formatted Input
  2187. * Formatted Input Basics:: Some basics to get you started.
  2188. * Input Conversion Syntax:: Syntax of conversion specifications.
  2189. * Table of Input Conversions:: Summary of input conversions and what they do.
  2190. * Numeric Input Conversions:: Details of conversions for reading numbers.
  2191. * String Input Conversions:: Details of conversions for reading strings.
  2192. * Dynamic String Input:: String conversions that ‘malloc’ the buffer.
  2193. * Other Input Conversions:: Details of miscellaneous other conversions.
  2194. * Formatted Input Functions:: Descriptions of the actual functions.
  2195. * Variable Arguments Input:: ‘vscanf’ and friends.
  2196. Stream Buffering
  2197. * Buffering Concepts:: Terminology is defined here.
  2198. * Flushing Buffers:: How to ensure that output buffers are flushed.
  2199. * Controlling Buffering:: How to specify what kind of buffering to use.
  2200. Other Kinds of Streams
  2201. * String Streams:: Streams that get data from or put data in
  2202. a string or memory buffer.
  2203. * Custom Streams:: Defining your own streams with an arbitrary
  2204. input data source and/or output data sink.
  2205. Custom Streams
  2206. * Streams and Cookies:: The "cookie" records where to fetch or
  2207. store data that is read or written.
  2208. * Hook Functions:: How you should define the four "hook
  2209. functions" that a custom stream needs.
  2210. Formatted Messages
  2211. * Printing Formatted Messages:: The ‘fmtmsg’ function.
  2212. * Adding Severity Classes:: Add more severity classes.
  2213. * Example:: How to use ‘fmtmsg’ and ‘addseverity’.
  2214. Low-Level I/O
  2215. * Opening and Closing Files:: How to open and close file
  2216. descriptors.
  2217. * I/O Primitives:: Reading and writing data.
  2218. * File Position Primitive:: Setting a descriptor’s file
  2219. position.
  2220. * Descriptors and Streams:: Converting descriptor to stream
  2221. or vice-versa.
  2222. * Stream/Descriptor Precautions:: Precautions needed if you use both
  2223. descriptors and streams.
  2224. * Scatter-Gather:: Fast I/O to discontinuous buffers.
  2225. * Memory-mapped I/O:: Using files like memory.
  2226. * Waiting for I/O:: How to check for input or output
  2227. on multiple file descriptors.
  2228. * Synchronizing I/O:: Making sure all I/O actions completed.
  2229. * Asynchronous I/O:: Perform I/O in parallel.
  2230. * Control Operations:: Various other operations on file
  2231. descriptors.
  2232. * Duplicating Descriptors:: Fcntl commands for duplicating
  2233. file descriptors.
  2234. * Descriptor Flags:: Fcntl commands for manipulating
  2235. flags associated with file
  2236. descriptors.
  2237. * File Status Flags:: Fcntl commands for manipulating
  2238. flags associated with open files.
  2239. * File Locks:: Fcntl commands for implementing
  2240. file locking.
  2241. * Open File Description Locks:: Fcntl commands for implementing
  2242. open file description locking.
  2243. * Open File Description Locks Example:: An example of open file description lock
  2244. usage
  2245. * Interrupt Input:: Getting an asynchronous signal when
  2246. input arrives.
  2247. * IOCTLs:: Generic I/O Control operations.
  2248. Stream/Descriptor Precautions
  2249. * Linked Channels:: Dealing with channels sharing a file position.
  2250. * Independent Channels:: Dealing with separately opened, unlinked channels.
  2251. * Cleaning Streams:: Cleaning a stream makes it safe to use
  2252. another channel.
  2253. Asynchronous I/O
  2254. * Asynchronous Reads/Writes:: Asynchronous Read and Write Operations.
  2255. * Status of AIO Operations:: Getting the Status of AIO Operations.
  2256. * Synchronizing AIO Operations:: Getting into a consistent state.
  2257. * Cancel AIO Operations:: Cancellation of AIO Operations.
  2258. * Configuration of AIO:: How to optimize the AIO implementation.
  2259. File Status Flags
  2260. * Access Modes:: Whether the descriptor can read or write.
  2261. * Open-time Flags:: Details of ‘open’.
  2262. * Operating Modes:: Special modes to control I/O operations.
  2263. * Getting File Status Flags:: Fetching and changing these flags.
  2264. File System Interface
  2265. * Working Directory:: This is used to resolve relative
  2266. file names.
  2267. * Accessing Directories:: Finding out what files a directory
  2268. contains.
  2269. * Working with Directory Trees:: Apply actions to all files or a selectable
  2270. subset of a directory hierarchy.
  2271. * Hard Links:: Adding alternate names to a file.
  2272. * Symbolic Links:: A file that “points to” a file name.
  2273. * Deleting Files:: How to delete a file, and what that means.
  2274. * Renaming Files:: Changing a file’s name.
  2275. * Creating Directories:: A system call just for creating a directory.
  2276. * File Attributes:: Attributes of individual files.
  2277. * Making Special Files:: How to create special files.
  2278. * Temporary Files:: Naming and creating temporary files.
  2279. Accessing Directories
  2280. * Directory Entries:: Format of one directory entry.
  2281. * Opening a Directory:: How to open a directory stream.
  2282. * Reading/Closing Directory:: How to read directory entries from the stream.
  2283. * Simple Directory Lister:: A very simple directory listing program.
  2284. * Random Access Directory:: Rereading part of the directory
  2285. already read with the same stream.
  2286. * Scanning Directory Content:: Get entries for user selected subset of
  2287. contents in given directory.
  2288. * Simple Directory Lister Mark II:: Revised version of the program.
  2289. File Attributes
  2290. * Attribute Meanings:: The names of the file attributes,
  2291. and what their values mean.
  2292. * Reading Attributes:: How to read the attributes of a file.
  2293. * Testing File Type:: Distinguishing ordinary files,
  2294. directories, links…
  2295. * File Owner:: How ownership for new files is determined,
  2296. and how to change it.
  2297. * Permission Bits:: How information about a file’s access
  2298. mode is stored.
  2299. * Access Permission:: How the system decides who can access a file.
  2300. * Setting Permissions:: How permissions for new files are assigned,
  2301. and how to change them.
  2302. * Testing File Access:: How to find out if your process can
  2303. access a file.
  2304. * File Times:: About the time attributes of a file.
  2305. * File Size:: Manually changing the size of a file.
  2306. * Storage Allocation:: Allocate backing storage for files.
  2307. Pipes and FIFOs
  2308. * Creating a Pipe:: Making a pipe with the ‘pipe’ function.
  2309. * Pipe to a Subprocess:: Using a pipe to communicate with a
  2310. child process.
  2311. * FIFO Special Files:: Making a FIFO special file.
  2312. * Pipe Atomicity:: When pipe (or FIFO) I/O is atomic.
  2313. Sockets
  2314. * Socket Concepts:: Basic concepts you need to know about.
  2315. * Communication Styles::Stream communication, datagrams and other styles.
  2316. * Socket Addresses:: How socket names (“addresses”) work.
  2317. * Interface Naming:: Identifying specific network interfaces.
  2318. * Local Namespace:: Details about the local namespace.
  2319. * Internet Namespace:: Details about the Internet namespace.
  2320. * Misc Namespaces:: Other namespaces not documented fully here.
  2321. * Open/Close Sockets:: Creating sockets and destroying them.
  2322. * Connections:: Operations on sockets with connection state.
  2323. * Datagrams:: Operations on datagram sockets.
  2324. * Inetd:: Inetd is a daemon that starts servers on request.
  2325. The most convenient way to write a server
  2326. is to make it work with Inetd.
  2327. * Socket Options:: Miscellaneous low-level socket options.
  2328. * Networks Database:: Accessing the database of network names.
  2329. Socket Addresses
  2330. * Address Formats:: About ‘struct sockaddr’.
  2331. * Setting Address:: Binding an address to a socket.
  2332. * Reading Address:: Reading the address of a socket.
  2333. Local Namespace
  2334. * Concepts: Local Namespace Concepts. What you need to understand.
  2335. * Details: Local Namespace Details. Address format, symbolic names, etc.
  2336. * Example: Local Socket Example. Example of creating a socket.
  2337. Internet Namespace
  2338. * Internet Address Formats:: How socket addresses are specified in the
  2339. Internet namespace.
  2340. * Host Addresses:: All about host addresses of Internet host.
  2341. * Ports:: Internet port numbers.
  2342. * Services Database:: Ports may have symbolic names.
  2343. * Byte Order:: Different hosts may use different byte
  2344. ordering conventions; you need to
  2345. canonicalize host address and port number.
  2346. * Protocols Database:: Referring to protocols by name.
  2347. * Inet Example:: Putting it all together.
  2348. Host Addresses
  2349. * Abstract Host Addresses:: What a host number consists of.
  2350. * Data type: Host Address Data Type. Data type for a host number.
  2351. * Functions: Host Address Functions. Functions to operate on them.
  2352. * Names: Host Names. Translating host names to host numbers.
  2353. Open/Close Sockets
  2354. * Creating a Socket:: How to open a socket.
  2355. * Closing a Socket:: How to close a socket.
  2356. * Socket Pairs:: These are created like pipes.
  2357. Connections
  2358. * Connecting:: What the client program must do.
  2359. * Listening:: How a server program waits for requests.
  2360. * Accepting Connections:: What the server does when it gets a request.
  2361. * Who is Connected:: Getting the address of the
  2362. other side of a connection.
  2363. * Transferring Data:: How to send and receive data.
  2364. * Byte Stream Example:: An example program: a client for communicating
  2365. over a byte stream socket in the Internet namespace.
  2366. * Server Example:: A corresponding server program.
  2367. * Out-of-Band Data:: This is an advanced feature.
  2368. Transferring Data
  2369. * Sending Data:: Sending data with ‘send’.
  2370. * Receiving Data:: Reading data with ‘recv’.
  2371. * Socket Data Options:: Using ‘send’ and ‘recv’.
  2372. Datagrams
  2373. * Sending Datagrams:: Sending packets on a datagram socket.
  2374. * Receiving Datagrams:: Receiving packets on a datagram socket.
  2375. * Datagram Example:: An example program: packets sent over a
  2376. datagram socket in the local namespace.
  2377. * Example Receiver:: Another program, that receives those packets.
  2378. Inetd
  2379. * Inetd Servers::
  2380. * Configuring Inetd::
  2381. Socket Options
  2382. * Socket Option Functions:: The basic functions for setting and getting
  2383. socket options.
  2384. * Socket-Level Options:: Details of the options at the socket level.
  2385. Low-Level Terminal Interface
  2386. * Is It a Terminal:: How to determine if a file is a terminal
  2387. device, and what its name is.
  2388. * I/O Queues:: About flow control and typeahead.
  2389. * Canonical or Not:: Two basic styles of input processing.
  2390. * Terminal Modes:: How to examine and modify flags controlling
  2391. details of terminal I/O: echoing,
  2392. signals, editing. Posix.
  2393. * BSD Terminal Modes:: BSD compatible terminal mode setting
  2394. * Line Control:: Sending break sequences, clearing
  2395. terminal buffers …
  2396. * Noncanon Example:: How to read single characters without echo.
  2397. * Pseudo-Terminals:: How to open a pseudo-terminal.
  2398. Terminal Modes
  2399. * Mode Data Types:: The data type ‘struct termios’ and
  2400. related types.
  2401. * Mode Functions:: Functions to read and set the terminal
  2402. attributes.
  2403. * Setting Modes:: The right way to set terminal attributes
  2404. reliably.
  2405. * Input Modes:: Flags controlling low-level input handling.
  2406. * Output Modes:: Flags controlling low-level output handling.
  2407. * Control Modes:: Flags controlling serial port behavior.
  2408. * Local Modes:: Flags controlling high-level input handling.
  2409. * Line Speed:: How to read and set the terminal line speed.
  2410. * Special Characters:: Characters that have special effects,
  2411. and how to change them.
  2412. * Noncanonical Input:: Controlling how long to wait for input.
  2413. Special Characters
  2414. * Editing Characters:: Special characters that terminate lines and
  2415. delete text, and other editing functions.
  2416. * Signal Characters:: Special characters that send or raise signals
  2417. to or for certain classes of processes.
  2418. * Start/Stop Characters:: Special characters that suspend or resume
  2419. suspended output.
  2420. * Other Special:: Other special characters for BSD systems:
  2421. they can discard output, and print status.
  2422. Pseudo-Terminals
  2423. * Allocation:: Allocating a pseudo terminal.
  2424. * Pseudo-Terminal Pairs:: How to open both sides of a
  2425. pseudo-terminal in a single operation.
  2426. Syslog
  2427. * Overview of Syslog:: Overview of a system’s Syslog facility
  2428. * Submitting Syslog Messages:: Functions to submit messages to Syslog
  2429. Submitting Syslog Messages
  2430. * openlog:: Open connection to Syslog
  2431. * syslog; vsyslog:: Submit message to Syslog
  2432. * closelog:: Close connection to Syslog
  2433. * setlogmask:: Cause certain messages to be ignored
  2434. * Syslog Example:: Example of all of the above
  2435. Mathematics
  2436. * Mathematical Constants:: Precise numeric values for often-used
  2437. constants.
  2438. * Trig Functions:: Sine, cosine, tangent, and friends.
  2439. * Inverse Trig Functions:: Arcsine, arccosine, etc.
  2440. * Exponents and Logarithms:: Also pow and sqrt.
  2441. * Hyperbolic Functions:: sinh, cosh, tanh, etc.
  2442. * Special Functions:: Bessel, gamma, erf.
  2443. * Errors in Math Functions:: Known Maximum Errors in Math Functions.
  2444. * Pseudo-Random Numbers:: Functions for generating pseudo-random
  2445. numbers.
  2446. * FP Function Optimizations:: Fast code or small code.
  2447. Pseudo-Random Numbers
  2448. * ISO Random:: ‘rand’ and friends.
  2449. * BSD Random:: ‘random’ and friends.
  2450. * SVID Random:: ‘drand48’ and friends.
  2451. Arithmetic
  2452. * Integers:: Basic integer types and concepts
  2453. * Integer Division:: Integer division with guaranteed rounding.
  2454. * Floating Point Numbers:: Basic concepts. IEEE 754.
  2455. * Floating Point Classes:: The five kinds of floating-point number.
  2456. * Floating Point Errors:: When something goes wrong in a calculation.
  2457. * Rounding:: Controlling how results are rounded.
  2458. * Control Functions:: Saving and restoring the FPU’s state.
  2459. * Arithmetic Functions:: Fundamental operations provided by the library.
  2460. * Complex Numbers:: The types. Writing complex constants.
  2461. * Operations on Complex:: Projection, conjugation, decomposition.
  2462. * Parsing of Numbers:: Converting strings to numbers.
  2463. * Printing of Floats:: Converting floating-point numbers to strings.
  2464. * System V Number Conversion:: An archaic way to convert numbers to strings.
  2465. Floating Point Errors
  2466. * FP Exceptions:: IEEE 754 math exceptions and how to detect them.
  2467. * Infinity and NaN:: Special values returned by calculations.
  2468. * Status bit operations:: Checking for exceptions after the fact.
  2469. * Math Error Reporting:: How the math functions report errors.
  2470. Arithmetic Functions
  2471. * Absolute Value:: Absolute values of integers and floats.
  2472. * Normalization Functions:: Extracting exponents and putting them back.
  2473. * Rounding Functions:: Rounding floats to integers.
  2474. * Remainder Functions:: Remainders on division, precisely defined.
  2475. * FP Bit Twiddling:: Sign bit adjustment. Adding epsilon.
  2476. * FP Comparison Functions:: Comparisons without risk of exceptions.
  2477. * Misc FP Arithmetic:: Max, min, positive difference, multiply-add.
  2478. Parsing of Numbers
  2479. * Parsing of Integers:: Functions for conversion of integer values.
  2480. * Parsing of Floats:: Functions for conversion of floating-point
  2481. values.
  2482. Date and Time
  2483. * Time Basics:: Concepts and definitions.
  2484. * Elapsed Time:: Data types to represent elapsed times
  2485. * Processor And CPU Time:: Time a program has spent executing.
  2486. * Calendar Time:: Manipulation of “real” dates and times.
  2487. * Setting an Alarm:: Sending a signal after a specified time.
  2488. * Sleeping:: Waiting for a period of time.
  2489. Processor And CPU Time
  2490. * CPU Time:: The ‘clock’ function.
  2491. * Processor Time:: The ‘times’ function.
  2492. Calendar Time
  2493. * Simple Calendar Time:: Facilities for manipulating calendar time.
  2494. * High-Resolution Calendar:: A time representation with greater precision.
  2495. * Broken-down Time:: Facilities for manipulating local time.
  2496. * High Accuracy Clock:: Maintaining a high accuracy system clock.
  2497. * Formatting Calendar Time:: Converting times to strings.
  2498. * Parsing Date and Time:: Convert textual time and date information back
  2499. into broken-down time values.
  2500. * TZ Variable:: How users specify the time zone.
  2501. * Time Zone Functions:: Functions to examine or specify the time zone.
  2502. * Time Functions Example:: An example program showing use of some of
  2503. the time functions.
  2504. Parsing Date and Time
  2505. * Low-Level Time String Parsing:: Interpret string according to given format.
  2506. * General Time String Parsing:: User-friendly function to parse data and
  2507. time strings.
  2508. Resource Usage And Limitation
  2509. * Resource Usage:: Measuring various resources used.
  2510. * Limits on Resources:: Specifying limits on resource usage.
  2511. * Priority:: Reading or setting process run priority.
  2512. * Memory Resources:: Querying memory available resources.
  2513. * Processor Resources:: Learn about the processors available.
  2514. Priority
  2515. * Absolute Priority:: The first tier of priority. Posix
  2516. * Realtime Scheduling:: Scheduling among the process nobility
  2517. * Basic Scheduling Functions:: Get/set scheduling policy, priority
  2518. * Traditional Scheduling:: Scheduling among the vulgar masses
  2519. * CPU Affinity:: Limiting execution to certain CPUs
  2520. Traditional Scheduling
  2521. * Traditional Scheduling Intro::
  2522. * Traditional Scheduling Functions::
  2523. Memory Resources
  2524. * Memory Subsystem:: Overview about traditional Unix memory handling.
  2525. * Query Memory Parameters:: How to get information about the memory
  2526. subsystem?
  2527. Non-Local Exits
  2528. * Intro: Non-Local Intro. When and how to use these facilities.
  2529. * Details: Non-Local Details. Functions for non-local exits.
  2530. * Non-Local Exits and Signals:: Portability issues.
  2531. * System V contexts:: Complete context control a la System V.
  2532. Signal Handling
  2533. * Concepts of Signals:: Introduction to the signal facilities.
  2534. * Standard Signals:: Particular kinds of signals with
  2535. standard names and meanings.
  2536. * Signal Actions:: Specifying what happens when a
  2537. particular signal is delivered.
  2538. * Defining Handlers:: How to write a signal handler function.
  2539. * Interrupted Primitives:: Signal handlers affect use of ‘open’,
  2540. ‘read’, ‘write’ and other functions.
  2541. * Generating Signals:: How to send a signal to a process.
  2542. * Blocking Signals:: Making the system hold signals temporarily.
  2543. * Waiting for a Signal:: Suspending your program until a signal
  2544. arrives.
  2545. * Signal Stack:: Using a Separate Signal Stack.
  2546. * BSD Signal Handling:: Additional functions for backward
  2547. compatibility with BSD.
  2548. Concepts of Signals
  2549. * Kinds of Signals:: Some examples of what can cause a signal.
  2550. * Signal Generation:: Concepts of why and how signals occur.
  2551. * Delivery of Signal:: Concepts of what a signal does to the
  2552. process.
  2553. Standard Signals
  2554. * Program Error Signals:: Used to report serious program errors.
  2555. * Termination Signals:: Used to interrupt and/or terminate the
  2556. program.
  2557. * Alarm Signals:: Used to indicate expiration of timers.
  2558. * Asynchronous I/O Signals:: Used to indicate input is available.
  2559. * Job Control Signals:: Signals used to support job control.
  2560. * Operation Error Signals:: Used to report operational system errors.
  2561. * Miscellaneous Signals:: Miscellaneous Signals.
  2562. * Signal Messages:: Printing a message describing a signal.
  2563. Signal Actions
  2564. * Basic Signal Handling:: The simple ‘signal’ function.
  2565. * Advanced Signal Handling:: The more powerful ‘sigaction’ function.
  2566. * Signal and Sigaction:: How those two functions interact.
  2567. * Sigaction Function Example:: An example of using the sigaction function.
  2568. * Flags for Sigaction:: Specifying options for signal handling.
  2569. * Initial Signal Actions:: How programs inherit signal actions.
  2570. Defining Handlers
  2571. * Handler Returns:: Handlers that return normally, and what
  2572. this means.
  2573. * Termination in Handler:: How handler functions terminate a program.
  2574. * Longjmp in Handler:: Nonlocal transfer of control out of a
  2575. signal handler.
  2576. * Signals in Handler:: What happens when signals arrive while
  2577. the handler is already occupied.
  2578. * Merged Signals:: When a second signal arrives before the
  2579. first is handled.
  2580. * Nonreentrancy:: Do not call any functions unless you know they
  2581. are reentrant with respect to signals.
  2582. * Atomic Data Access:: A single handler can run in the middle of
  2583. reading or writing a single object.
  2584. Atomic Data Access
  2585. * Non-atomic Example:: A program illustrating interrupted access.
  2586. * Types: Atomic Types. Data types that guarantee no interruption.
  2587. * Usage: Atomic Usage. Proving that interruption is harmless.
  2588. Generating Signals
  2589. * Signaling Yourself:: A process can send a signal to itself.
  2590. * Signaling Another Process:: Send a signal to another process.
  2591. * Permission for kill:: Permission for using ‘kill’.
  2592. * Kill Example:: Using ‘kill’ for Communication.
  2593. Blocking Signals
  2594. * Why Block:: The purpose of blocking signals.
  2595. * Signal Sets:: How to specify which signals to
  2596. block.
  2597. * Process Signal Mask:: Blocking delivery of signals to your
  2598. process during normal execution.
  2599. * Testing for Delivery:: Blocking to Test for Delivery of
  2600. a Signal.
  2601. * Blocking for Handler:: Blocking additional signals while a
  2602. handler is being run.
  2603. * Checking for Pending Signals:: Checking for Pending Signals
  2604. * Remembering a Signal:: How you can get almost the same
  2605. effect as blocking a signal, by
  2606. handling it and setting a flag
  2607. to be tested later.
  2608. Waiting for a Signal
  2609. * Using Pause:: The simple way, using ‘pause’.
  2610. * Pause Problems:: Why the simple way is often not very good.
  2611. * Sigsuspend:: Reliably waiting for a specific signal.
  2612. Program Basics
  2613. * Program Arguments:: Parsing your program’s command-line arguments
  2614. * Environment Variables:: Less direct parameters affecting your program
  2615. * Auxiliary Vector:: Least direct parameters affecting your program
  2616. * System Calls:: Requesting service from the system
  2617. * Program Termination:: Telling the system you’re done; return status
  2618. Program Arguments
  2619. * Argument Syntax:: By convention, options start with a hyphen.
  2620. * Parsing Program Arguments:: Ways to parse program options and arguments.
  2621. Parsing Program Arguments
  2622. * Getopt:: Parsing program options using ‘getopt’.
  2623. * Argp:: Parsing program options using ‘argp_parse’.
  2624. * Suboptions:: Some programs need more detailed options.
  2625. * Suboptions Example:: This shows how it could be done for ‘mount’.
  2626. Environment Variables
  2627. * Environment Access:: How to get and set the values of
  2628. environment variables.
  2629. * Standard Environment:: These environment variables have
  2630. standard interpretations.
  2631. Program Termination
  2632. * Normal Termination:: If a program calls ‘exit’, a
  2633. process terminates normally.
  2634. * Exit Status:: The ‘exit status’ provides information
  2635. about why the process terminated.
  2636. * Cleanups on Exit:: A process can run its own cleanup
  2637. functions upon normal termination.
  2638. * Aborting a Program:: The ‘abort’ function causes
  2639. abnormal program termination.
  2640. * Termination Internals:: What happens when a process terminates.
  2641. Processes
  2642. * Running a Command:: The easy way to run another program.
  2643. * Process Creation Concepts:: An overview of the hard way to do it.
  2644. * Process Identification:: How to get the process ID of a process.
  2645. * Creating a Process:: How to fork a child process.
  2646. * Executing a File:: How to make a process execute another program.
  2647. * Process Completion:: How to tell when a child process has completed.
  2648. * Process Completion Status:: How to interpret the status value
  2649. returned from a child process.
  2650. * BSD Wait Functions:: More functions, for backward compatibility.
  2651. * Process Creation Example:: A complete example program.
  2652. Inter-Process Communication
  2653. * Semaphores:: Support for creating and managing semaphores
  2654. Job Control
  2655. * Concepts of Job Control:: Jobs can be controlled by a shell.
  2656. * Job Control is Optional:: Not all POSIX systems support job control.
  2657. * Controlling Terminal:: How a process gets its controlling terminal.
  2658. * Access to the Terminal:: How processes share the controlling terminal.
  2659. * Orphaned Process Groups:: Jobs left after the user logs out.
  2660. * Implementing a Shell:: What a shell must do to implement job control.
  2661. * Functions for Job Control:: Functions to control process groups.
  2662. Implementing a Shell
  2663. * Data Structures:: Introduction to the sample shell.
  2664. * Initializing the Shell:: What the shell must do to take
  2665. responsibility for job control.
  2666. * Launching Jobs:: Creating jobs to execute commands.
  2667. * Foreground and Background:: Putting a job in foreground of background.
  2668. * Stopped and Terminated Jobs:: Reporting job status.
  2669. * Continuing Stopped Jobs:: How to continue a stopped job in
  2670. the foreground or background.
  2671. * Missing Pieces:: Other parts of the shell.
  2672. Functions for Job Control
  2673. * Identifying the Terminal:: Determining the controlling terminal’s name.
  2674. * Process Group Functions:: Functions for manipulating process groups.
  2675. * Terminal Access Functions:: Functions for controlling terminal access.
  2676. Name Service Switch
  2677. * NSS Basics:: What is this NSS good for.
  2678. * NSS Configuration File:: Configuring NSS.
  2679. * NSS Module Internals:: How does it work internally.
  2680. * Extending NSS:: What to do to add services or databases.
  2681. NSS Configuration File
  2682. * Services in the NSS configuration:: Service names in the NSS configuration.
  2683. * Actions in the NSS configuration:: React appropriately to the lookup result.
  2684. * Notes on NSS Configuration File:: Things to take care about while
  2685. configuring NSS.
  2686. NSS Module Internals
  2687. * NSS Module Names:: Construction of the interface function of
  2688. the NSS modules.
  2689. * NSS Modules Interface:: Programming interface in the NSS module
  2690. functions.
  2691. Extending NSS
  2692. * Adding another Service to NSS:: What is to do to add a new service.
  2693. * NSS Module Function Internals:: Guidelines for writing new NSS
  2694. service functions.
  2695. Users and Groups
  2696. * User and Group IDs:: Each user has a unique numeric ID;
  2697. likewise for groups.
  2698. * Process Persona:: The user IDs and group IDs of a process.
  2699. * Why Change Persona:: Why a program might need to change
  2700. its user and/or group IDs.
  2701. * How Change Persona:: Changing the user and group IDs.
  2702. * Reading Persona:: How to examine the user and group IDs.
  2703. * Setting User ID:: Functions for setting the user ID.
  2704. * Setting Groups:: Functions for setting the group IDs.
  2705. * Enable/Disable Setuid:: Turning setuid access on and off.
  2706. * Setuid Program Example:: The pertinent parts of one sample program.
  2707. * Tips for Setuid:: How to avoid granting unlimited access.
  2708. * Who Logged In:: Getting the name of the user who logged in,
  2709. or of the real user ID of the current process.
  2710. * User Accounting Database:: Keeping information about users and various
  2711. actions in databases.
  2712. * User Database:: Functions and data structures for
  2713. accessing the user database.
  2714. * Group Database:: Functions and data structures for
  2715. accessing the group database.
  2716. * Database Example:: Example program showing the use of database
  2717. inquiry functions.
  2718. * Netgroup Database:: Functions for accessing the netgroup database.
  2719. User Accounting Database
  2720. * Manipulating the Database:: Scanning and modifying the user
  2721. accounting database.
  2722. * XPG Functions:: A standardized way for doing the same thing.
  2723. * Logging In and Out:: Functions from BSD that modify the user
  2724. accounting database.
  2725. User Database
  2726. * User Data Structure:: What each user record contains.
  2727. * Lookup User:: How to look for a particular user.
  2728. * Scanning All Users:: Scanning the list of all users, one by one.
  2729. * Writing a User Entry:: How a program can rewrite a user’s record.
  2730. Group Database
  2731. * Group Data Structure:: What each group record contains.
  2732. * Lookup Group:: How to look for a particular group.
  2733. * Scanning All Groups:: Scanning the list of all groups.
  2734. Netgroup Database
  2735. * Netgroup Data:: Data in the Netgroup database and where
  2736. it comes from.
  2737. * Lookup Netgroup:: How to look for a particular netgroup.
  2738. * Netgroup Membership:: How to test for netgroup membership.
  2739. System Management
  2740. * Host Identification:: Determining the name of the machine.
  2741. * Platform Type:: Determining operating system and basic
  2742. machine type
  2743. * Filesystem Handling:: Controlling/querying mounts
  2744. * System Parameters:: Getting and setting various system parameters
  2745. Filesystem Handling
  2746. * Mount Information:: What is or could be mounted?
  2747. * Mount-Unmount-Remount:: Controlling what is mounted and how
  2748. Mount Information
  2749. * fstab:: The ‘fstab’ file
  2750. * mtab:: The ‘mtab’ file
  2751. * Other Mount Information:: Other (non-libc) sources of mount information
  2752. System Configuration
  2753. * General Limits:: Constants and functions that describe
  2754. various process-related limits that have
  2755. one uniform value for any given machine.
  2756. * System Options:: Optional POSIX features.
  2757. * Version Supported:: Version numbers of POSIX.1 and POSIX.2.
  2758. * Sysconf:: Getting specific configuration values
  2759. of general limits and system options.
  2760. * Minimums:: Minimum values for general limits.
  2761. * Limits for Files:: Size limitations that pertain to individual files.
  2762. These can vary between file systems
  2763. or even from file to file.
  2764. * Options for Files:: Optional features that some files may support.
  2765. * File Minimums:: Minimum values for file limits.
  2766. * Pathconf:: Getting the limit values for a particular file.
  2767. * Utility Limits:: Capacity limits of some POSIX.2 utility programs.
  2768. * Utility Minimums:: Minimum allowable values of those limits.
  2769. * String Parameters:: Getting the default search path.
  2770. Sysconf
  2771. * Sysconf Definition:: Detailed specifications of ‘sysconf’.
  2772. * Constants for Sysconf:: The list of parameters ‘sysconf’ can read.
  2773. * Examples of Sysconf:: How to use ‘sysconf’ and the parameter
  2774. macros properly together.
  2775. Cryptographic Functions
  2776. * Legal Problems:: This software can get you locked up, or worse.
  2777. * getpass:: Prompting the user for a password.
  2778. * crypt:: A one-way function for passwords.
  2779. * DES Encryption:: Routines for DES encryption.
  2780. * Unpredictable Bytes:: Randomness for cryptography purposes.
  2781. Debugging Support
  2782. * Backtraces:: Obtaining and printing a back trace of the
  2783. current stack.
  2784. POSIX Threads
  2785. * Thread-specific Data:: Support for creating and
  2786. managing thread-specific data
  2787. * Non-POSIX Extensions:: Additional functions to extend
  2788. POSIX Thread functionality
  2789. Non-POSIX Extensions
  2790. * Default Thread Attributes:: Setting default attributes for
  2791. threads in a process.
  2792. Internal Probes
  2793. * Memory Allocation Probes:: Probes in the memory allocation subsystem
  2794. * Mathematical Function Probes:: Probes in mathematical functions
  2795. * Non-local Goto Probes:: Probes in setjmp and longjmp
  2796. Tunables
  2797. * Tunable names:: The structure of a tunable name
  2798. * Memory Allocation Tunables:: Tunables in the memory allocation subsystem
  2799. Language Features
  2800. * Consistency Checking:: Using ‘assert’ to abort if
  2801. something “impossible” happens.
  2802. * Variadic Functions:: Defining functions with varying numbers
  2803. of args.
  2804. * Null Pointer Constant:: The macro ‘NULL’.
  2805. * Important Data Types:: Data types for object sizes.
  2806. * Data Type Measurements:: Parameters of data type representations.
  2807. Variadic Functions
  2808. * Why Variadic:: Reasons for making functions take
  2809. variable arguments.
  2810. * How Variadic:: How to define and call variadic functions.
  2811. * Variadic Example:: A complete example.
  2812. How Variadic
  2813. * Variadic Prototypes:: How to make a prototype for a function
  2814. with variable arguments.
  2815. * Receiving Arguments:: Steps you must follow to access the
  2816. optional argument values.
  2817. * How Many Arguments:: How to decide whether there are more arguments.
  2818. * Calling Variadics:: Things you need to know about calling
  2819. variable arguments functions.
  2820. * Argument Macros:: Detailed specification of the macros
  2821. for accessing variable arguments.
  2822. Data Type Measurements
  2823. * Width of Type:: How many bits does an integer type hold?
  2824. * Range of Type:: What are the largest and smallest values
  2825. that an integer type can hold?
  2826. * Floating Type Macros:: Parameters that measure the floating point types.
  2827. * Structure Measurement:: Getting measurements on structure types.
  2828. Floating Type Macros
  2829. * Floating Point Concepts:: Definitions of terminology.
  2830. * Floating Point Parameters:: Details of specific macros.
  2831. * IEEE Floating Point:: The measurements for one common
  2832. representation.
  2833. Installation
  2834. * Configuring and compiling:: How to compile and test GNU libc.
  2835. * Running make install:: How to install it once you’ve got it
  2836. compiled.
  2837. * Tools for Compilation:: You’ll need these first.
  2838. * Linux:: Specific advice for GNU/Linux systems.
  2839. * Reporting Bugs:: So they’ll get fixed.
  2840. Maintenance
  2841. * Source Layout:: How to add new functions or header files
  2842. to the GNU C Library.
  2843. * Porting:: How to port the GNU C Library to
  2844. a new machine or operating system.
  2845. Source Layout
  2846. * Platform: Adding Platform-specific. Adding platform-specific
  2847. features.
  2848. Porting
  2849. * Hierarchy Conventions:: The layout of the ‘sysdeps’ hierarchy.
  2850. * Porting to Unix:: Porting the library to an average
  2851. Unix-like system.
  2852. Platform
  2853. * PowerPC:: Facilities Specific to the PowerPC Architecture
  2854. 
  2855. File: libc.info, Node: Introduction, Next: Error Reporting, Prev: Top, Up: Top
  2856. 1 Introduction
  2857. **************
  2858. The C language provides no built-in facilities for performing such
  2859. common operations as input/output, memory management, string
  2860. manipulation, and the like. Instead, these facilities are defined in a
  2861. standard "library", which you compile and link with your programs.
  2862. The GNU C Library, described in this document, defines all of the
  2863. library functions that are specified by the ISO C standard, as well as
  2864. additional features specific to POSIX and other derivatives of the Unix
  2865. operating system, and extensions specific to GNU systems.
  2866. The purpose of this manual is to tell you how to use the facilities
  2867. of the GNU C Library. We have mentioned which features belong to which
  2868. standards to help you identify things that are potentially non-portable
  2869. to other systems. But the emphasis in this manual is not on strict
  2870. portability.
  2871. * Menu:
  2872. * Getting Started:: What this manual is for and how to use it.
  2873. * Standards and Portability:: Standards and sources upon which the GNU
  2874. C library is based.
  2875. * Using the Library:: Some practical uses for the library.
  2876. * Roadmap to the Manual:: Overview of the remaining chapters in
  2877. this manual.
  2878. 
  2879. File: libc.info, Node: Getting Started, Next: Standards and Portability, Up: Introduction
  2880. 1.1 Getting Started
  2881. ===================
  2882. This manual is written with the assumption that you are at least
  2883. somewhat familiar with the C programming language and basic programming
  2884. concepts. Specifically, familiarity with ISO standard C (*note ISO
  2885. C::), rather than “traditional” pre-ISO C dialects, is assumed.
  2886. The GNU C Library includes several "header files", each of which
  2887. provides definitions and declarations for a group of related facilities;
  2888. this information is used by the C compiler when processing your program.
  2889. For example, the header file ‘stdio.h’ declares facilities for
  2890. performing input and output, and the header file ‘string.h’ declares
  2891. string processing utilities. The organization of this manual generally
  2892. follows the same division as the header files.
  2893. If you are reading this manual for the first time, you should read
  2894. all of the introductory material and skim the remaining chapters. There
  2895. are a _lot_ of functions in the GNU C Library and it’s not realistic to
  2896. expect that you will be able to remember exactly _how_ to use each and
  2897. every one of them. It’s more important to become generally familiar
  2898. with the kinds of facilities that the library provides, so that when you
  2899. are writing your programs you can recognize _when_ to make use of
  2900. library functions, and _where_ in this manual you can find more specific
  2901. information about them.
  2902. 
  2903. File: libc.info, Node: Standards and Portability, Next: Using the Library, Prev: Getting Started, Up: Introduction
  2904. 1.2 Standards and Portability
  2905. =============================
  2906. This section discusses the various standards and other sources that the
  2907. GNU C Library is based upon. These sources include the ISO C and POSIX
  2908. standards, and the System V and Berkeley Unix implementations.
  2909. The primary focus of this manual is to tell you how to make effective
  2910. use of the GNU C Library facilities. But if you are concerned about
  2911. making your programs compatible with these standards, or portable to
  2912. operating systems other than GNU, this can affect how you use the
  2913. library. This section gives you an overview of these standards, so that
  2914. you will know what they are when they are mentioned in other parts of
  2915. the manual.
  2916. *Note Library Summary::, for an alphabetical list of the functions
  2917. and other symbols provided by the library. This list also states which
  2918. standards each function or symbol comes from.
  2919. * Menu:
  2920. * ISO C:: The international standard for the C
  2921. programming language.
  2922. * POSIX:: The ISO/IEC 9945 (aka IEEE 1003) standards
  2923. for operating systems.
  2924. * Berkeley Unix:: BSD and SunOS.
  2925. * SVID:: The System V Interface Description.
  2926. * XPG:: The X/Open Portability Guide.
  2927. 
  2928. File: libc.info, Node: ISO C, Next: POSIX, Up: Standards and Portability
  2929. 1.2.1 ISO C
  2930. -----------
  2931. The GNU C Library is compatible with the C standard adopted by the
  2932. American National Standards Institute (ANSI): ‘American National
  2933. Standard X3.159-1989—“ANSI C”’ and later by the International
  2934. Standardization Organization (ISO): ‘ISO/IEC 9899:1990, “Programming
  2935. languages—C”’. We here refer to the standard as ISO C since this is the
  2936. more general standard in respect of ratification. The header files and
  2937. library facilities that make up the GNU C Library are a superset of
  2938. those specified by the ISO C standard.
  2939. If you are concerned about strict adherence to the ISO C standard,
  2940. you should use the ‘-ansi’ option when you compile your programs with
  2941. the GNU C compiler. This tells the compiler to define _only_ ISO
  2942. standard features from the library header files, unless you explicitly
  2943. ask for additional features. *Note Feature Test Macros::, for
  2944. information on how to do this.
  2945. Being able to restrict the library to include only ISO C features is
  2946. important because ISO C puts limitations on what names can be defined by
  2947. the library implementation, and the GNU extensions don’t fit these
  2948. limitations. *Note Reserved Names::, for more information about these
  2949. restrictions.
  2950. This manual does not attempt to give you complete details on the
  2951. differences between ISO C and older dialects. It gives advice on how to
  2952. write programs to work portably under multiple C dialects, but does not
  2953. aim for completeness.
  2954. 
  2955. File: libc.info, Node: POSIX, Next: Berkeley Unix, Prev: ISO C, Up: Standards and Portability
  2956. 1.2.2 POSIX (The Portable Operating System Interface)
  2957. -----------------------------------------------------
  2958. The GNU C Library is also compatible with the ISO "POSIX" family of
  2959. standards, known more formally as the "Portable Operating System
  2960. Interface for Computer Environments" (ISO/IEC 9945). They were also
  2961. published as ANSI/IEEE Std 1003. POSIX is derived mostly from various
  2962. versions of the Unix operating system.
  2963. The library facilities specified by the POSIX standards are a
  2964. superset of those required by ISO C; POSIX specifies additional features
  2965. for ISO C functions, as well as specifying new additional functions. In
  2966. general, the additional requirements and functionality defined by the
  2967. POSIX standards are aimed at providing lower-level support for a
  2968. particular kind of operating system environment, rather than general
  2969. programming language support which can run in many diverse operating
  2970. system environments.
  2971. The GNU C Library implements all of the functions specified in
  2972. ‘ISO/IEC 9945-1:1996, the POSIX System Application Program Interface’,
  2973. commonly referred to as POSIX.1. The primary extensions to the ISO C
  2974. facilities specified by this standard include file system interface
  2975. primitives (*note File System Interface::), device-specific terminal
  2976. control functions (*note Low-Level Terminal Interface::), and process
  2977. control functions (*note Processes::).
  2978. Some facilities from ‘ISO/IEC 9945-2:1993, the POSIX Shell and
  2979. Utilities standard’ (POSIX.2) are also implemented in the GNU C Library.
  2980. These include utilities for dealing with regular expressions and other
  2981. pattern matching facilities (*note Pattern Matching::).
  2982. * Menu:
  2983. * POSIX Safety Concepts:: Safety concepts from POSIX.
  2984. * Unsafe Features:: Features that make functions unsafe.
  2985. * Conditionally Safe Features:: Features that make functions unsafe
  2986. in the absence of workarounds.
  2987. * Other Safety Remarks:: Additional safety features and remarks.
  2988. 
  2989. File: libc.info, Node: POSIX Safety Concepts, Next: Unsafe Features, Up: POSIX
  2990. 1.2.2.1 POSIX Safety Concepts
  2991. .............................
  2992. This manual documents various safety properties of GNU C Library
  2993. functions, in lines that follow their prototypes and look like:
  2994. Preliminary: | MT-Safe | AS-Safe | AC-Safe |
  2995. The properties are assessed according to the criteria set forth in
  2996. the POSIX standard for such safety contexts as Thread-, Async-Signal-
  2997. and Async-Cancel- -Safety. Intuitive definitions of these properties,
  2998. attempting to capture the meaning of the standard definitions, follow.
  2999. • ‘MT-Safe’ or Thread-Safe functions are safe to call in the presence
  3000. of other threads. MT, in MT-Safe, stands for Multi Thread.
  3001. Being MT-Safe does not imply a function is atomic, nor that it uses
  3002. any of the memory synchronization mechanisms POSIX exposes to
  3003. users. It is even possible that calling MT-Safe functions in
  3004. sequence does not yield an MT-Safe combination. For example,
  3005. having a thread call two MT-Safe functions one right after the
  3006. other does not guarantee behavior equivalent to atomic execution of
  3007. a combination of both functions, since concurrent calls in other
  3008. threads may interfere in a destructive way.
  3009. Whole-program optimizations that could inline functions across
  3010. library interfaces may expose unsafe reordering, and so performing
  3011. inlining across the GNU C Library interface is not recommended.
  3012. The documented MT-Safety status is not guaranteed under
  3013. whole-program optimization. However, functions defined in
  3014. user-visible headers are designed to be safe for inlining.
  3015. • ‘AS-Safe’ or Async-Signal-Safe functions are safe to call from
  3016. asynchronous signal handlers. AS, in AS-Safe, stands for
  3017. Asynchronous Signal.
  3018. Many functions that are AS-Safe may set ‘errno’, or modify the
  3019. floating-point environment, because their doing so does not make
  3020. them unsuitable for use in signal handlers. However, programs
  3021. could misbehave should asynchronous signal handlers modify this
  3022. thread-local state, and the signal handling machinery cannot be
  3023. counted on to preserve it. Therefore, signal handlers that call
  3024. functions that may set ‘errno’ or modify the floating-point
  3025. environment _must_ save their original values, and restore them
  3026. before returning.
  3027. • ‘AC-Safe’ or Async-Cancel-Safe functions are safe to call when
  3028. asynchronous cancellation is enabled. AC in AC-Safe stands for
  3029. Asynchronous Cancellation.
  3030. The POSIX standard defines only three functions to be AC-Safe,
  3031. namely ‘pthread_cancel’, ‘pthread_setcancelstate’, and
  3032. ‘pthread_setcanceltype’. At present the GNU C Library provides no
  3033. guarantees beyond these three functions, but does document which
  3034. functions are presently AC-Safe. This documentation is provided
  3035. for use by the GNU C Library developers.
  3036. Just like signal handlers, cancellation cleanup routines must
  3037. configure the floating point environment they require. The
  3038. routines cannot assume a floating point environment, particularly
  3039. when asynchronous cancellation is enabled. If the configuration of
  3040. the floating point environment cannot be performed atomically then
  3041. it is also possible that the environment encountered is internally
  3042. inconsistent.
  3043. • ‘MT-Unsafe’, ‘AS-Unsafe’, ‘AC-Unsafe’ functions are not safe to
  3044. call within the safety contexts described above. Calling them
  3045. within such contexts invokes undefined behavior.
  3046. Functions not explicitly documented as safe in a safety context
  3047. should be regarded as Unsafe.
  3048. • ‘Preliminary’ safety properties are documented, indicating these
  3049. properties may _not_ be counted on in future releases of the GNU C
  3050. Library.
  3051. Such preliminary properties are the result of an assessment of the
  3052. properties of our current implementation, rather than of what is
  3053. mandated and permitted by current and future standards.
  3054. Although we strive to abide by the standards, in some cases our
  3055. implementation is safe even when the standard does not demand
  3056. safety, and in other cases our implementation does not meet the
  3057. standard safety requirements. The latter are most likely bugs; the
  3058. former, when marked as ‘Preliminary’, should not be counted on:
  3059. future standards may require changes that are not compatible with
  3060. the additional safety properties afforded by the current
  3061. implementation.
  3062. Furthermore, the POSIX standard does not offer a detailed
  3063. definition of safety. We assume that, by “safe to call”, POSIX
  3064. means that, as long as the program does not invoke undefined
  3065. behavior, the “safe to call” function behaves as specified, and
  3066. does not cause other functions to deviate from their specified
  3067. behavior. We have chosen to use its loose definitions of safety,
  3068. not because they are the best definitions to use, but because
  3069. choosing them harmonizes this manual with POSIX.
  3070. Please keep in mind that these are preliminary definitions and
  3071. annotations, and certain aspects of the definitions are still under
  3072. discussion and might be subject to clarification or change.
  3073. Over time, we envision evolving the preliminary safety notes into
  3074. stable commitments, as stable as those of our interfaces. As we
  3075. do, we will remove the ‘Preliminary’ keyword from safety notes. As
  3076. long as the keyword remains, however, they are not to be regarded
  3077. as a promise of future behavior.
  3078. Other keywords that appear in safety notes are defined in subsequent
  3079. sections.
  3080. 
  3081. File: libc.info, Node: Unsafe Features, Next: Conditionally Safe Features, Prev: POSIX Safety Concepts, Up: POSIX
  3082. 1.2.2.2 Unsafe Features
  3083. .......................
  3084. Functions that are unsafe to call in certain contexts are annotated with
  3085. keywords that document their features that make them unsafe to call.
  3086. AS-Unsafe features in this section indicate the functions are never safe
  3087. to call when asynchronous signals are enabled. AC-Unsafe features
  3088. indicate they are never safe to call when asynchronous cancellation is
  3089. enabled. There are no MT-Unsafe marks in this section.
  3090. • ‘lock’
  3091. Functions marked with ‘lock’ as an AS-Unsafe feature may be
  3092. interrupted by a signal while holding a non-recursive lock. If the
  3093. signal handler calls another such function that takes the same
  3094. lock, the result is a deadlock.
  3095. Functions annotated with ‘lock’ as an AC-Unsafe feature may, if
  3096. cancelled asynchronously, fail to release a lock that would have
  3097. been released if their execution had not been interrupted by
  3098. asynchronous thread cancellation. Once a lock is left taken,
  3099. attempts to take that lock will block indefinitely.
  3100. • ‘corrupt’
  3101. Functions marked with ‘corrupt’ as an AS-Unsafe feature may corrupt
  3102. data structures and misbehave when they interrupt, or are
  3103. interrupted by, another such function. Unlike functions marked
  3104. with ‘lock’, these take recursive locks to avoid MT-Safety
  3105. problems, but this is not enough to stop a signal handler from
  3106. observing a partially-updated data structure. Further corruption
  3107. may arise from the interrupted function’s failure to notice updates
  3108. made by signal handlers.
  3109. Functions marked with ‘corrupt’ as an AC-Unsafe feature may leave
  3110. data structures in a corrupt, partially updated state. Subsequent
  3111. uses of the data structure may misbehave.
  3112. • ‘heap’
  3113. Functions marked with ‘heap’ may call heap memory management
  3114. functions from the ‘malloc’/‘free’ family of functions and are only
  3115. as safe as those functions. This note is thus equivalent to:
  3116. | AS-Unsafe lock | AC-Unsafe lock fd mem |
  3117. • ‘dlopen’
  3118. Functions marked with ‘dlopen’ use the dynamic loader to load
  3119. shared libraries into the current execution image. This involves
  3120. opening files, mapping them into memory, allocating additional
  3121. memory, resolving symbols, applying relocations and more, all of
  3122. this while holding internal dynamic loader locks.
  3123. The locks are enough for these functions to be AS- and AC-Unsafe,
  3124. but other issues may arise. At present this is a placeholder for
  3125. all potential safety issues raised by ‘dlopen’.
  3126. • ‘plugin’
  3127. Functions annotated with ‘plugin’ may run code from plugins that
  3128. may be external to the GNU C Library. Such plugin functions are
  3129. assumed to be MT-Safe, AS-Unsafe and AC-Unsafe. Examples of such
  3130. plugins are stack unwinding libraries, name service switch (NSS)
  3131. and character set conversion (iconv) back-ends.
  3132. Although the plugins mentioned as examples are all brought in by
  3133. means of dlopen, the ‘plugin’ keyword does not imply any direct
  3134. involvement of the dynamic loader or the ‘libdl’ interfaces, those
  3135. are covered by ‘dlopen’. For example, if one function loads a
  3136. module and finds the addresses of some of its functions, while
  3137. another just calls those already-resolved functions, the former
  3138. will be marked with ‘dlopen’, whereas the latter will get the
  3139. ‘plugin’. When a single function takes all of these actions, then
  3140. it gets both marks.
  3141. • ‘i18n’
  3142. Functions marked with ‘i18n’ may call internationalization
  3143. functions of the ‘gettext’ family and will be only as safe as those
  3144. functions. This note is thus equivalent to:
  3145. | MT-Safe env | AS-Unsafe corrupt heap dlopen | AC-Unsafe corrupt |
  3146. • ‘timer’
  3147. Functions marked with ‘timer’ use the ‘alarm’ function or similar
  3148. to set a time-out for a system call or a long-running operation.
  3149. In a multi-threaded program, there is a risk that the time-out
  3150. signal will be delivered to a different thread, thus failing to
  3151. interrupt the intended thread. Besides being MT-Unsafe, such
  3152. functions are always AS-Unsafe, because calling them in signal
  3153. handlers may interfere with timers set in the interrupted code, and
  3154. AC-Unsafe, because there is no safe way to guarantee an earlier
  3155. timer will be reset in case of asynchronous cancellation.
  3156. 
  3157. File: libc.info, Node: Conditionally Safe Features, Next: Other Safety Remarks, Prev: Unsafe Features, Up: POSIX
  3158. 1.2.2.3 Conditionally Safe Features
  3159. ...................................
  3160. For some features that make functions unsafe to call in certain
  3161. contexts, there are known ways to avoid the safety problem other than
  3162. refraining from calling the function altogether. The keywords that
  3163. follow refer to such features, and each of their definitions indicate
  3164. how the whole program needs to be constrained in order to remove the
  3165. safety problem indicated by the keyword. Only when all the reasons that
  3166. make a function unsafe are observed and addressed, by applying the
  3167. documented constraints, does the function become safe to call in a
  3168. context.
  3169. • ‘init’
  3170. Functions marked with ‘init’ as an MT-Unsafe feature perform
  3171. MT-Unsafe initialization when they are first called.
  3172. Calling such a function at least once in single-threaded mode
  3173. removes this specific cause for the function to be regarded as
  3174. MT-Unsafe. If no other cause for that remains, the function can
  3175. then be safely called after other threads are started.
  3176. Functions marked with ‘init’ as an AS- or AC-Unsafe feature use the
  3177. internal ‘libc_once’ machinery or similar to initialize internal
  3178. data structures.
  3179. If a signal handler interrupts such an initializer, and calls any
  3180. function that also performs ‘libc_once’ initialization, it will
  3181. deadlock if the thread library has been loaded.
  3182. Furthermore, if an initializer is partially complete before it is
  3183. canceled or interrupted by a signal whose handler requires the same
  3184. initialization, some or all of the initialization may be performed
  3185. more than once, leaking resources or even resulting in corrupt
  3186. internal data.
  3187. Applications that need to call functions marked with ‘init’ as an
  3188. AS- or AC-Unsafe feature should ensure the initialization is
  3189. performed before configuring signal handlers or enabling
  3190. cancellation, so that the AS- and AC-Safety issues related with
  3191. ‘libc_once’ do not arise.
  3192. • ‘race’
  3193. Functions annotated with ‘race’ as an MT-Safety issue operate on
  3194. objects in ways that may cause data races or similar forms of
  3195. destructive interference out of concurrent execution. In some
  3196. cases, the objects are passed to the functions by users; in others,
  3197. they are used by the functions to return values to users; in
  3198. others, they are not even exposed to users.
  3199. We consider access to objects passed as (indirect) arguments to
  3200. functions to be data race free. The assurance of data race free
  3201. objects is the caller’s responsibility. We will not mark a
  3202. function as MT-Unsafe or AS-Unsafe if it misbehaves when users fail
  3203. to take the measures required by POSIX to avoid data races when
  3204. dealing with such objects. As a general rule, if a function is
  3205. documented as reading from an object passed (by reference) to it,
  3206. or modifying it, users ought to use memory synchronization
  3207. primitives to avoid data races just as they would should they
  3208. perform the accesses themselves rather than by calling the library
  3209. function. ‘FILE’ streams are the exception to the general rule, in
  3210. that POSIX mandates the library to guard against data races in many
  3211. functions that manipulate objects of this specific opaque type. We
  3212. regard this as a convenience provided to users, rather than as a
  3213. general requirement whose expectations should extend to other
  3214. types.
  3215. In order to remind users that guarding certain arguments is their
  3216. responsibility, we will annotate functions that take objects of
  3217. certain types as arguments. We draw the line for objects passed by
  3218. users as follows: objects whose types are exposed to users, and
  3219. that users are expected to access directly, such as memory buffers,
  3220. strings, and various user-visible ‘struct’ types, do _not_ give
  3221. reason for functions to be annotated with ‘race’. It would be
  3222. noisy and redundant with the general requirement, and not many
  3223. would be surprised by the library’s lack of internal guards when
  3224. accessing objects that can be accessed directly by users.
  3225. As for objects that are opaque or opaque-like, in that they are to
  3226. be manipulated only by passing them to library functions (e.g.,
  3227. ‘FILE’, ‘DIR’, ‘obstack’, ‘iconv_t’), there might be additional
  3228. expectations as to internal coordination of access by the library.
  3229. We will annotate, with ‘race’ followed by a colon and the argument
  3230. name, functions that take such objects but that do not take care of
  3231. synchronizing access to them by default. For example, ‘FILE’
  3232. stream ‘unlocked’ functions will be annotated, but those that
  3233. perform implicit locking on ‘FILE’ streams by default will not,
  3234. even though the implicit locking may be disabled on a per-stream
  3235. basis.
  3236. In either case, we will not regard as MT-Unsafe functions that may
  3237. access user-supplied objects in unsafe ways should users fail to
  3238. ensure the accesses are well defined. The notion prevails that
  3239. users are expected to safeguard against data races any
  3240. user-supplied objects that the library accesses on their behalf.
  3241. This user responsibility does not apply, however, to objects
  3242. controlled by the library itself, such as internal objects and
  3243. static buffers used to return values from certain calls. When the
  3244. library doesn’t guard them against concurrent uses, these cases are
  3245. regarded as MT-Unsafe and AS-Unsafe (although the ‘race’ mark under
  3246. AS-Unsafe will be omitted as redundant with the one under
  3247. MT-Unsafe). As in the case of user-exposed objects, the mark may
  3248. be followed by a colon and an identifier. The identifier groups
  3249. all functions that operate on a certain unguarded object; users may
  3250. avoid the MT-Safety issues related with unguarded concurrent access
  3251. to such internal objects by creating a non-recursive mutex related
  3252. with the identifier, and always holding the mutex when calling any
  3253. function marked as racy on that identifier, as they would have to
  3254. should the identifier be an object under user control. The
  3255. non-recursive mutex avoids the MT-Safety issue, but it trades one
  3256. AS-Safety issue for another, so use in asynchronous signals remains
  3257. undefined.
  3258. When the identifier relates to a static buffer used to hold return
  3259. values, the mutex must be held for as long as the buffer remains in
  3260. use by the caller. Many functions that return pointers to static
  3261. buffers offer reentrant variants that store return values in
  3262. caller-supplied buffers instead. In some cases, such as ‘tmpname’,
  3263. the variant is chosen not by calling an alternate entry point, but
  3264. by passing a non-‘NULL’ pointer to the buffer in which the returned
  3265. values are to be stored. These variants are generally preferable
  3266. in multi-threaded programs, although some of them are not MT-Safe
  3267. because of other internal buffers, also documented with ‘race’
  3268. notes.
  3269. • ‘const’
  3270. Functions marked with ‘const’ as an MT-Safety issue non-atomically
  3271. modify internal objects that are better regarded as constant,
  3272. because a substantial portion of the GNU C Library accesses them
  3273. without synchronization. Unlike ‘race’, that causes both readers
  3274. and writers of internal objects to be regarded as MT-Unsafe and
  3275. AS-Unsafe, this mark is applied to writers only. Writers remain
  3276. equally MT- and AS-Unsafe to call, but the then-mandatory constness
  3277. of objects they modify enables readers to be regarded as MT-Safe
  3278. and AS-Safe (as long as no other reasons for them to be unsafe
  3279. remain), since the lack of synchronization is not a problem when
  3280. the objects are effectively constant.
  3281. The identifier that follows the ‘const’ mark will appear by itself
  3282. as a safety note in readers. Programs that wish to work around
  3283. this safety issue, so as to call writers, may use a non-recursve
  3284. ‘rwlock’ associated with the identifier, and guard _all_ calls to
  3285. functions marked with ‘const’ followed by the identifier with a
  3286. write lock, and _all_ calls to functions marked with the identifier
  3287. by itself with a read lock. The non-recursive locking removes the
  3288. MT-Safety problem, but it trades one AS-Safety problem for another,
  3289. so use in asynchronous signals remains undefined.
  3290. • ‘sig’
  3291. Functions marked with ‘sig’ as a MT-Safety issue (that implies an
  3292. identical AS-Safety issue, omitted for brevity) may temporarily
  3293. install a signal handler for internal purposes, which may interfere
  3294. with other uses of the signal, identified after a colon.
  3295. This safety problem can be worked around by ensuring that no other
  3296. uses of the signal will take place for the duration of the call.
  3297. Holding a non-recursive mutex while calling all functions that use
  3298. the same temporary signal; blocking that signal before the call and
  3299. resetting its handler afterwards is recommended.
  3300. There is no safe way to guarantee the original signal handler is
  3301. restored in case of asynchronous cancellation, therefore so-marked
  3302. functions are also AC-Unsafe.
  3303. Besides the measures recommended to work around the MT- and
  3304. AS-Safety problem, in order to avert the cancellation problem,
  3305. disabling asynchronous cancellation _and_ installing a cleanup
  3306. handler to restore the signal to the desired state and to release
  3307. the mutex are recommended.
  3308. • ‘term’
  3309. Functions marked with ‘term’ as an MT-Safety issue may change the
  3310. terminal settings in the recommended way, namely: call ‘tcgetattr’,
  3311. modify some flags, and then call ‘tcsetattr’; this creates a window
  3312. in which changes made by other threads are lost. Thus, functions
  3313. marked with ‘term’ are MT-Unsafe. The same window enables changes
  3314. made by asynchronous signals to be lost. These functions are also
  3315. AS-Unsafe, but the corresponding mark is omitted as redundant.
  3316. It is thus advisable for applications using the terminal to avoid
  3317. concurrent and reentrant interactions with it, by not using it in
  3318. signal handlers or blocking signals that might use it, and holding
  3319. a lock while calling these functions and interacting with the
  3320. terminal. This lock should also be used for mutual exclusion with
  3321. functions marked with ‘race:tcattr(fd)’, where FD is a file
  3322. descriptor for the controlling terminal. The caller may use a
  3323. single mutex for simplicity, or use one mutex per terminal, even if
  3324. referenced by different file descriptors.
  3325. Functions marked with ‘term’ as an AC-Safety issue are supposed to
  3326. restore terminal settings to their original state, after
  3327. temporarily changing them, but they may fail to do so if cancelled.
  3328. Besides the measures recommended to work around the MT- and
  3329. AS-Safety problem, in order to avert the cancellation problem,
  3330. disabling asynchronous cancellation _and_ installing a cleanup
  3331. handler to restore the terminal settings to the original state and
  3332. to release the mutex are recommended.
  3333. 
  3334. File: libc.info, Node: Other Safety Remarks, Prev: Conditionally Safe Features, Up: POSIX
  3335. 1.2.2.4 Other Safety Remarks
  3336. ............................
  3337. Additional keywords may be attached to functions, indicating features
  3338. that do not make a function unsafe to call, but that may need to be
  3339. taken into account in certain classes of programs:
  3340. • ‘locale’
  3341. Functions annotated with ‘locale’ as an MT-Safety issue read from
  3342. the locale object without any form of synchronization. Functions
  3343. annotated with ‘locale’ called concurrently with locale changes may
  3344. behave in ways that do not correspond to any of the locales active
  3345. during their execution, but an unpredictable mix thereof.
  3346. We do not mark these functions as MT- or AS-Unsafe, however,
  3347. because functions that modify the locale object are marked with
  3348. ‘const:locale’ and regarded as unsafe. Being unsafe, the latter
  3349. are not to be called when multiple threads are running or
  3350. asynchronous signals are enabled, and so the locale can be
  3351. considered effectively constant in these contexts, which makes the
  3352. former safe.
  3353. • ‘env’
  3354. Functions marked with ‘env’ as an MT-Safety issue access the
  3355. environment with ‘getenv’ or similar, without any guards to ensure
  3356. safety in the presence of concurrent modifications.
  3357. We do not mark these functions as MT- or AS-Unsafe, however,
  3358. because functions that modify the environment are all marked with
  3359. ‘const:env’ and regarded as unsafe. Being unsafe, the latter are
  3360. not to be called when multiple threads are running or asynchronous
  3361. signals are enabled, and so the environment can be considered
  3362. effectively constant in these contexts, which makes the former
  3363. safe.
  3364. • ‘hostid’
  3365. The function marked with ‘hostid’ as an MT-Safety issue reads from
  3366. the system-wide data structures that hold the “host ID” of the
  3367. machine. These data structures cannot generally be modified
  3368. atomically. Since it is expected that the “host ID” will not
  3369. normally change, the function that reads from it (‘gethostid’) is
  3370. regarded as safe, whereas the function that modifies it
  3371. (‘sethostid’) is marked with ‘const:hostid’, indicating it may
  3372. require special care if it is to be called. In this specific case,
  3373. the special care amounts to system-wide (not merely intra-process)
  3374. coordination.
  3375. • ‘sigintr’
  3376. Functions marked with ‘sigintr’ as an MT-Safety issue access the
  3377. ‘_sigintr’ internal data structure without any guards to ensure
  3378. safety in the presence of concurrent modifications.
  3379. We do not mark these functions as MT- or AS-Unsafe, however,
  3380. because functions that modify the this data structure are all
  3381. marked with ‘const:sigintr’ and regarded as unsafe. Being unsafe,
  3382. the latter are not to be called when multiple threads are running
  3383. or asynchronous signals are enabled, and so the data structure can
  3384. be considered effectively constant in these contexts, which makes
  3385. the former safe.
  3386. • ‘fd’
  3387. Functions annotated with ‘fd’ as an AC-Safety issue may leak file
  3388. descriptors if asynchronous thread cancellation interrupts their
  3389. execution.
  3390. Functions that allocate or deallocate file descriptors will
  3391. generally be marked as such. Even if they attempted to protect the
  3392. file descriptor allocation and deallocation with cleanup regions,
  3393. allocating a new descriptor and storing its number where the
  3394. cleanup region could release it cannot be performed as a single
  3395. atomic operation. Similarly, releasing the descriptor and taking
  3396. it out of the data structure normally responsible for releasing it
  3397. cannot be performed atomically. There will always be a window in
  3398. which the descriptor cannot be released because it was not stored
  3399. in the cleanup handler argument yet, or it was already taken out
  3400. before releasing it. It cannot be taken out after release: an open
  3401. descriptor could mean either that the descriptor still has to be
  3402. closed, or that it already did so but the descriptor was
  3403. reallocated by another thread or signal handler.
  3404. Such leaks could be internally avoided, with some performance
  3405. penalty, by temporarily disabling asynchronous thread cancellation.
  3406. However, since callers of allocation or deallocation functions
  3407. would have to do this themselves, to avoid the same sort of leak in
  3408. their own layer, it makes more sense for the library to assume they
  3409. are taking care of it than to impose a performance penalty that is
  3410. redundant when the problem is solved in upper layers, and
  3411. insufficient when it is not.
  3412. This remark by itself does not cause a function to be regarded as
  3413. AC-Unsafe. However, cumulative effects of such leaks may pose a
  3414. problem for some programs. If this is the case, suspending
  3415. asynchronous cancellation for the duration of calls to such
  3416. functions is recommended.
  3417. • ‘mem’
  3418. Functions annotated with ‘mem’ as an AC-Safety issue may leak
  3419. memory if asynchronous thread cancellation interrupts their
  3420. execution.
  3421. The problem is similar to that of file descriptors: there is no
  3422. atomic interface to allocate memory and store its address in the
  3423. argument to a cleanup handler, or to release it and remove its
  3424. address from that argument, without at least temporarily disabling
  3425. asynchronous cancellation, which these functions do not do.
  3426. This remark does not by itself cause a function to be regarded as
  3427. generally AC-Unsafe. However, cumulative effects of such leaks may
  3428. be severe enough for some programs that disabling asynchronous
  3429. cancellation for the duration of calls to such functions may be
  3430. required.
  3431. • ‘cwd’
  3432. Functions marked with ‘cwd’ as an MT-Safety issue may temporarily
  3433. change the current working directory during their execution, which
  3434. may cause relative pathnames to be resolved in unexpected ways in
  3435. other threads or within asynchronous signal or cancellation
  3436. handlers.
  3437. This is not enough of a reason to mark so-marked functions as MT-
  3438. or AS-Unsafe, but when this behavior is optional (e.g., ‘nftw’ with
  3439. ‘FTW_CHDIR’), avoiding the option may be a good alternative to
  3440. using full pathnames or file descriptor-relative (e.g. ‘openat’)
  3441. system calls.
  3442. • ‘!posix’
  3443. This remark, as an MT-, AS- or AC-Safety note to a function,
  3444. indicates the safety status of the function is known to differ from
  3445. the specified status in the POSIX standard. For example, POSIX
  3446. does not require a function to be Safe, but our implementation is,
  3447. or vice-versa.
  3448. For the time being, the absence of this remark does not imply the
  3449. safety properties we documented are identical to those mandated by
  3450. POSIX for the corresponding functions.
  3451. • ‘:identifier’
  3452. Annotations may sometimes be followed by identifiers, intended to
  3453. group several functions that e.g. access the data structures in an
  3454. unsafe way, as in ‘race’ and ‘const’, or to provide more specific
  3455. information, such as naming a signal in a function marked with
  3456. ‘sig’. It is envisioned that it may be applied to ‘lock’ and
  3457. ‘corrupt’ as well in the future.
  3458. In most cases, the identifier will name a set of functions, but it
  3459. may name global objects or function arguments, or identifiable
  3460. properties or logical components associated with them, with a
  3461. notation such as e.g. ‘:buf(arg)’ to denote a buffer associated
  3462. with the argument ARG, or ‘:tcattr(fd)’ to denote the terminal
  3463. attributes of a file descriptor FD.
  3464. The most common use for identifiers is to provide logical groups of
  3465. functions and arguments that need to be protected by the same
  3466. synchronization primitive in order to ensure safe operation in a
  3467. given context.
  3468. • ‘/condition’
  3469. Some safety annotations may be conditional, in that they only apply
  3470. if a boolean expression involving arguments, global variables or
  3471. even the underlying kernel evaluates to true. Such conditions as
  3472. ‘/hurd’ or ‘/!linux!bsd’ indicate the preceding marker only applies
  3473. when the underlying kernel is the HURD, or when it is neither Linux
  3474. nor a BSD kernel, respectively. ‘/!ps’ and ‘/one_per_line’
  3475. indicate the preceding marker only applies when argument PS is
  3476. NULL, or global variable ONE_PER_LINE is nonzero.
  3477. When all marks that render a function unsafe are adorned with such
  3478. conditions, and none of the named conditions hold, then the
  3479. function can be regarded as safe.
  3480. 
  3481. File: libc.info, Node: Berkeley Unix, Next: SVID, Prev: POSIX, Up: Standards and Portability
  3482. 1.2.3 Berkeley Unix
  3483. -------------------
  3484. The GNU C Library defines facilities from some versions of Unix which
  3485. are not formally standardized, specifically from the 4.2 BSD, 4.3 BSD,
  3486. and 4.4 BSD Unix systems (also known as "Berkeley Unix") and from
  3487. "SunOS" (a popular 4.2 BSD derivative that includes some Unix System V
  3488. functionality). These systems support most of the ISO C and POSIX
  3489. facilities, and 4.4 BSD and newer releases of SunOS in fact support them
  3490. all.
  3491. The BSD facilities include symbolic links (*note Symbolic Links::),
  3492. the ‘select’ function (*note Waiting for I/O::), the BSD signal
  3493. functions (*note BSD Signal Handling::), and sockets (*note Sockets::).
  3494. 
  3495. File: libc.info, Node: SVID, Next: XPG, Prev: Berkeley Unix, Up: Standards and Portability
  3496. 1.2.4 SVID (The System V Interface Description)
  3497. -----------------------------------------------
  3498. The "System V Interface Description" (SVID) is a document describing the
  3499. AT&T Unix System V operating system. It is to some extent a superset of
  3500. the POSIX standard (*note POSIX::).
  3501. The GNU C Library defines most of the facilities required by the SVID
  3502. that are not also required by the ISO C or POSIX standards, for
  3503. compatibility with System V Unix and other Unix systems (such as SunOS)
  3504. which include these facilities. However, many of the more obscure and
  3505. less generally useful facilities required by the SVID are not included.
  3506. (In fact, Unix System V itself does not provide them all.)
  3507. The supported facilities from System V include the methods for
  3508. inter-process communication and shared memory, the ‘hsearch’ and
  3509. ‘drand48’ families of functions, ‘fmtmsg’ and several of the
  3510. mathematical functions.
  3511. 
  3512. File: libc.info, Node: XPG, Prev: SVID, Up: Standards and Portability
  3513. 1.2.5 XPG (The X/Open Portability Guide)
  3514. ----------------------------------------
  3515. The X/Open Portability Guide, published by the X/Open Company, Ltd., is
  3516. a more general standard than POSIX. X/Open owns the Unix copyright and
  3517. the XPG specifies the requirements for systems which are intended to be
  3518. a Unix system.
  3519. The GNU C Library complies to the X/Open Portability Guide, Issue
  3520. 4.2, with all extensions common to XSI (X/Open System Interface)
  3521. compliant systems and also all X/Open UNIX extensions.
  3522. The additions on top of POSIX are mainly derived from functionality
  3523. available in System V and BSD systems. Some of the really bad mistakes
  3524. in System V systems were corrected, though. Since fulfilling the XPG
  3525. standard with the Unix extensions is a precondition for getting the Unix
  3526. brand chances are good that the functionality is available on commercial
  3527. systems.
  3528. 
  3529. File: libc.info, Node: Using the Library, Next: Roadmap to the Manual, Prev: Standards and Portability, Up: Introduction
  3530. 1.3 Using the Library
  3531. =====================
  3532. This section describes some of the practical issues involved in using
  3533. the GNU C Library.
  3534. * Menu:
  3535. * Header Files:: How to include the header files in your
  3536. programs.
  3537. * Macro Definitions:: Some functions in the library may really
  3538. be implemented as macros.
  3539. * Reserved Names:: The C standard reserves some names for
  3540. the library, and some for users.
  3541. * Feature Test Macros:: How to control what names are defined.
  3542. 
  3543. File: libc.info, Node: Header Files, Next: Macro Definitions, Up: Using the Library
  3544. 1.3.1 Header Files
  3545. ------------------
  3546. Libraries for use by C programs really consist of two parts: "header
  3547. files" that define types and macros and declare variables and functions;
  3548. and the actual library or "archive" that contains the definitions of the
  3549. variables and functions.
  3550. (Recall that in C, a "declaration" merely provides information that a
  3551. function or variable exists and gives its type. For a function
  3552. declaration, information about the types of its arguments might be
  3553. provided as well. The purpose of declarations is to allow the compiler
  3554. to correctly process references to the declared variables and functions.
  3555. A "definition", on the other hand, actually allocates storage for a
  3556. variable or says what a function does.)
  3557. In order to use the facilities in the GNU C Library, you should be
  3558. sure that your program source files include the appropriate header
  3559. files. This is so that the compiler has declarations of these
  3560. facilities available and can correctly process references to them. Once
  3561. your program has been compiled, the linker resolves these references to
  3562. the actual definitions provided in the archive file.
  3563. Header files are included into a program source file by the
  3564. ‘#include’ preprocessor directive. The C language supports two forms of
  3565. this directive; the first,
  3566. #include "HEADER"
  3567. is typically used to include a header file HEADER that you write
  3568. yourself; this would contain definitions and declarations describing the
  3569. interfaces between the different parts of your particular application.
  3570. By contrast,
  3571. #include <file.h>
  3572. is typically used to include a header file ‘file.h’ that contains
  3573. definitions and declarations for a standard library. This file would
  3574. normally be installed in a standard place by your system administrator.
  3575. You should use this second form for the C library header files.
  3576. Typically, ‘#include’ directives are placed at the top of the C
  3577. source file, before any other code. If you begin your source files with
  3578. some comments explaining what the code in the file does (a good idea),
  3579. put the ‘#include’ directives immediately afterwards, following the
  3580. feature test macro definition (*note Feature Test Macros::).
  3581. For more information about the use of header files and ‘#include’
  3582. directives, *note (cpp.info)Header Files::.
  3583. The GNU C Library provides several header files, each of which
  3584. contains the type and macro definitions and variable and function
  3585. declarations for a group of related facilities. This means that your
  3586. programs may need to include several header files, depending on exactly
  3587. which facilities you are using.
  3588. Some library header files include other library header files
  3589. automatically. However, as a matter of programming style, you should
  3590. not rely on this; it is better to explicitly include all the header
  3591. files required for the library facilities you are using. The GNU C
  3592. Library header files have been written in such a way that it doesn’t
  3593. matter if a header file is accidentally included more than once;
  3594. including a header file a second time has no effect. Likewise, if your
  3595. program needs to include multiple header files, the order in which they
  3596. are included doesn’t matter.
  3597. *Compatibility Note:* Inclusion of standard header files in any order
  3598. and any number of times works in any ISO C implementation. However,
  3599. this has traditionally not been the case in many older C
  3600. implementations.
  3601. Strictly speaking, you don’t _have to_ include a header file to use a
  3602. function it declares; you could declare the function explicitly
  3603. yourself, according to the specifications in this manual. But it is
  3604. usually better to include the header file because it may define types
  3605. and macros that are not otherwise available and because it may define
  3606. more efficient macro replacements for some functions. It is also a sure
  3607. way to have the correct declaration.
  3608. 
  3609. File: libc.info, Node: Macro Definitions, Next: Reserved Names, Prev: Header Files, Up: Using the Library
  3610. 1.3.2 Macro Definitions of Functions
  3611. ------------------------------------
  3612. If we describe something as a function in this manual, it may have a
  3613. macro definition as well. This normally has no effect on how your
  3614. program runs—the macro definition does the same thing as the function
  3615. would. In particular, macro equivalents for library functions evaluate
  3616. arguments exactly once, in the same way that a function call would. The
  3617. main reason for these macro definitions is that sometimes they can
  3618. produce an inline expansion that is considerably faster than an actual
  3619. function call.
  3620. Taking the address of a library function works even if it is also
  3621. defined as a macro. This is because, in this context, the name of the
  3622. function isn’t followed by the left parenthesis that is syntactically
  3623. necessary to recognize a macro call.
  3624. You might occasionally want to avoid using the macro definition of a
  3625. function—perhaps to make your program easier to debug. There are two
  3626. ways you can do this:
  3627. • You can avoid a macro definition in a specific use by enclosing the
  3628. name of the function in parentheses. This works because the name
  3629. of the function doesn’t appear in a syntactic context where it is
  3630. recognizable as a macro call.
  3631. • You can suppress any macro definition for a whole source file by
  3632. using the ‘#undef’ preprocessor directive, unless otherwise stated
  3633. explicitly in the description of that facility.
  3634. For example, suppose the header file ‘stdlib.h’ declares a function
  3635. named ‘abs’ with
  3636. extern int abs (int);
  3637. and also provides a macro definition for ‘abs’. Then, in:
  3638. #include <stdlib.h>
  3639. int f (int *i) { return abs (++*i); }
  3640. the reference to ‘abs’ might refer to either a macro or a function. On
  3641. the other hand, in each of the following examples the reference is to a
  3642. function and not a macro.
  3643. #include <stdlib.h>
  3644. int g (int *i) { return (abs) (++*i); }
  3645. #undef abs
  3646. int h (int *i) { return abs (++*i); }
  3647. Since macro definitions that double for a function behave in exactly
  3648. the same way as the actual function version, there is usually no need
  3649. for any of these methods. In fact, removing macro definitions usually
  3650. just makes your program slower.
  3651. 
  3652. File: libc.info, Node: Reserved Names, Next: Feature Test Macros, Prev: Macro Definitions, Up: Using the Library
  3653. 1.3.3 Reserved Names
  3654. --------------------
  3655. The names of all library types, macros, variables and functions that
  3656. come from the ISO C standard are reserved unconditionally; your program
  3657. *may not* redefine these names. All other library names are reserved if
  3658. your program explicitly includes the header file that defines or
  3659. declares them. There are several reasons for these restrictions:
  3660. • Other people reading your code could get very confused if you were
  3661. using a function named ‘exit’ to do something completely different
  3662. from what the standard ‘exit’ function does, for example.
  3663. Preventing this situation helps to make your programs easier to
  3664. understand and contributes to modularity and maintainability.
  3665. • It avoids the possibility of a user accidentally redefining a
  3666. library function that is called by other library functions. If
  3667. redefinition were allowed, those other functions would not work
  3668. properly.
  3669. • It allows the compiler to do whatever special optimizations it
  3670. pleases on calls to these functions, without the possibility that
  3671. they may have been redefined by the user. Some library facilities,
  3672. such as those for dealing with variadic arguments (*note Variadic
  3673. Functions::) and non-local exits (*note Non-Local Exits::),
  3674. actually require a considerable amount of cooperation on the part
  3675. of the C compiler, and with respect to the implementation, it might
  3676. be easier for the compiler to treat these as built-in parts of the
  3677. language.
  3678. In addition to the names documented in this manual, reserved names
  3679. include all external identifiers (global functions and variables) that
  3680. begin with an underscore (‘_’) and all identifiers regardless of use
  3681. that begin with either two underscores or an underscore followed by a
  3682. capital letter are reserved names. This is so that the library and
  3683. header files can define functions, variables, and macros for internal
  3684. purposes without risk of conflict with names in user programs.
  3685. Some additional classes of identifier names are reserved for future
  3686. extensions to the C language or the POSIX.1 environment. While using
  3687. these names for your own purposes right now might not cause a problem,
  3688. they do raise the possibility of conflict with future versions of the C
  3689. or POSIX standards, so you should avoid these names.
  3690. • Names beginning with a capital ‘E’ followed a digit or uppercase
  3691. letter may be used for additional error code names. *Note Error
  3692. Reporting::.
  3693. • Names that begin with either ‘is’ or ‘to’ followed by a lowercase
  3694. letter may be used for additional character testing and conversion
  3695. functions. *Note Character Handling::.
  3696. • Names that begin with ‘LC_’ followed by an uppercase letter may be
  3697. used for additional macros specifying locale attributes. *Note
  3698. Locales::.
  3699. • Names of all existing mathematics functions (*note Mathematics::)
  3700. suffixed with ‘f’ or ‘l’ are reserved for corresponding functions
  3701. that operate on ‘float’ and ‘long double’ arguments, respectively.
  3702. • Names that begin with ‘SIG’ followed by an uppercase letter are
  3703. reserved for additional signal names. *Note Standard Signals::.
  3704. • Names that begin with ‘SIG_’ followed by an uppercase letter are
  3705. reserved for additional signal actions. *Note Basic Signal
  3706. Handling::.
  3707. • Names beginning with ‘str’, ‘mem’, or ‘wcs’ followed by a lowercase
  3708. letter are reserved for additional string and array functions.
  3709. *Note String and Array Utilities::.
  3710. • Names that end with ‘_t’ are reserved for additional type names.
  3711. In addition, some individual header files reserve names beyond those
  3712. that they actually define. You only need to worry about these
  3713. restrictions if your program includes that particular header file.
  3714. • The header file ‘dirent.h’ reserves names prefixed with ‘d_’.
  3715. • The header file ‘fcntl.h’ reserves names prefixed with ‘l_’, ‘F_’,
  3716. ‘O_’, and ‘S_’.
  3717. • The header file ‘grp.h’ reserves names prefixed with ‘gr_’.
  3718. • The header file ‘limits.h’ reserves names suffixed with ‘_MAX’.
  3719. • The header file ‘pwd.h’ reserves names prefixed with ‘pw_’.
  3720. • The header file ‘signal.h’ reserves names prefixed with ‘sa_’ and
  3721. ‘SA_’.
  3722. • The header file ‘sys/stat.h’ reserves names prefixed with ‘st_’ and
  3723. ‘S_’.
  3724. • The header file ‘sys/times.h’ reserves names prefixed with ‘tms_’.
  3725. • The header file ‘termios.h’ reserves names prefixed with ‘c_’, ‘V’,
  3726. ‘I’, ‘O’, and ‘TC’; and names prefixed with ‘B’ followed by a
  3727. digit.
  3728. 
  3729. File: libc.info, Node: Feature Test Macros, Prev: Reserved Names, Up: Using the Library
  3730. 1.3.4 Feature Test Macros
  3731. -------------------------
  3732. The exact set of features available when you compile a source file is
  3733. controlled by which "feature test macros" you define.
  3734. If you compile your programs using ‘gcc -ansi’, you get only the ISO C
  3735. library features, unless you explicitly request additional features by
  3736. defining one or more of the feature macros. *Note GNU CC Command
  3737. Options: (gcc.info)Invoking GCC, for more information about GCC options.
  3738. You should define these macros by using ‘#define’ preprocessor
  3739. directives at the top of your source code files. These directives
  3740. _must_ come before any ‘#include’ of a system header file. It is best
  3741. to make them the very first thing in the file, preceded only by
  3742. comments. You could also use the ‘-D’ option to GCC, but it’s better if
  3743. you make the source files indicate their own meaning in a self-contained
  3744. way.
  3745. This system exists to allow the library to conform to multiple
  3746. standards. Although the different standards are often described as
  3747. supersets of each other, they are usually incompatible because larger
  3748. standards require functions with names that smaller ones reserve to the
  3749. user program. This is not mere pedantry — it has been a problem in
  3750. practice. For instance, some non-GNU programs define functions named
  3751. ‘getline’ that have nothing to do with this library’s ‘getline’. They
  3752. would not be compilable if all features were enabled indiscriminately.
  3753. This should not be used to verify that a program conforms to a
  3754. limited standard. It is insufficient for this purpose, as it will not
  3755. protect you from including header files outside the standard, or relying
  3756. on semantics undefined within the standard.
  3757. -- Macro: _POSIX_SOURCE
  3758. If you define this macro, then the functionality from the POSIX.1
  3759. standard (IEEE Standard 1003.1) is available, as well as all of the
  3760. ISO C facilities.
  3761. The state of ‘_POSIX_SOURCE’ is irrelevant if you define the macro
  3762. ‘_POSIX_C_SOURCE’ to a positive integer.
  3763. -- Macro: _POSIX_C_SOURCE
  3764. Define this macro to a positive integer to control which POSIX
  3765. functionality is made available. The greater the value of this
  3766. macro, the more functionality is made available.
  3767. If you define this macro to a value greater than or equal to ‘1’,
  3768. then the functionality from the 1990 edition of the POSIX.1
  3769. standard (IEEE Standard 1003.1-1990) is made available.
  3770. If you define this macro to a value greater than or equal to ‘2’,
  3771. then the functionality from the 1992 edition of the POSIX.2
  3772. standard (IEEE Standard 1003.2-1992) is made available.
  3773. If you define this macro to a value greater than or equal to
  3774. ‘199309L’, then the functionality from the 1993 edition of the
  3775. POSIX.1b standard (IEEE Standard 1003.1b-1993) is made available.
  3776. Greater values for ‘_POSIX_C_SOURCE’ will enable future extensions.
  3777. The POSIX standards process will define these values as necessary,
  3778. and the GNU C Library should support them some time after they
  3779. become standardized. The 1996 edition of POSIX.1 (ISO/IEC 9945-1:
  3780. 1996) states that if you define ‘_POSIX_C_SOURCE’ to a value
  3781. greater than or equal to ‘199506L’, then the functionality from the
  3782. 1996 edition is made available.
  3783. -- Macro: _XOPEN_SOURCE
  3784. -- Macro: _XOPEN_SOURCE_EXTENDED
  3785. If you define this macro, functionality described in the X/Open
  3786. Portability Guide is included. This is a superset of the POSIX.1
  3787. and POSIX.2 functionality and in fact ‘_POSIX_SOURCE’ and
  3788. ‘_POSIX_C_SOURCE’ are automatically defined.
  3789. As the unification of all Unices, functionality only available in
  3790. BSD and SVID is also included.
  3791. If the macro ‘_XOPEN_SOURCE_EXTENDED’ is also defined, even more
  3792. functionality is available. The extra functions will make all
  3793. functions available which are necessary for the X/Open Unix brand.
  3794. If the macro ‘_XOPEN_SOURCE’ has the value 500 this includes all
  3795. functionality described so far plus some new definitions from the
  3796. Single Unix Specification, version 2.
  3797. -- Macro: _LARGEFILE_SOURCE
  3798. If this macro is defined some extra functions are available which
  3799. rectify a few shortcomings in all previous standards.
  3800. Specifically, the functions ‘fseeko’ and ‘ftello’ are available.
  3801. Without these functions the difference between the ISO C interface
  3802. (‘fseek’, ‘ftell’) and the low-level POSIX interface (‘lseek’)
  3803. would lead to problems.
  3804. This macro was introduced as part of the Large File Support
  3805. extension (LFS).
  3806. -- Macro: _LARGEFILE64_SOURCE
  3807. If you define this macro an additional set of functions is made
  3808. available which enables 32 bit systems to use files of sizes beyond
  3809. the usual limit of 2GB. This interface is not available if the
  3810. system does not support files that large. On systems where the
  3811. natural file size limit is greater than 2GB (i.e., on 64 bit
  3812. systems) the new functions are identical to the replaced functions.
  3813. The new functionality is made available by a new set of types and
  3814. functions which replace the existing ones. The names of these new
  3815. objects contain ‘64’ to indicate the intention, e.g., ‘off_t’ vs.
  3816. ‘off64_t’ and ‘fseeko’ vs. ‘fseeko64’.
  3817. This macro was introduced as part of the Large File Support
  3818. extension (LFS). It is a transition interface for the period when 64 bit
  3819. offsets are not generally used (see ‘_FILE_OFFSET_BITS’).
  3820. -- Macro: _FILE_OFFSET_BITS
  3821. This macro determines which file system interface shall be used,
  3822. one replacing the other. Whereas ‘_LARGEFILE64_SOURCE’ makes the 64 bit
  3823. interface available as an additional interface, ‘_FILE_OFFSET_BITS’
  3824. allows the 64 bit interface to replace the old interface.
  3825. If ‘_FILE_OFFSET_BITS’ is undefined, or if it is defined to the
  3826. value ‘32’, nothing changes. The 32 bit interface is used and
  3827. types like ‘off_t’ have a size of 32 bits on 32 bit systems.
  3828. If the macro is defined to the value ‘64’, the large file interface
  3829. replaces the old interface. I.e., the functions are not made
  3830. available under different names (as they are with
  3831. ‘_LARGEFILE64_SOURCE’). Instead the old function names now
  3832. reference the new functions, e.g., a call to ‘fseeko’ now indeed
  3833. calls ‘fseeko64’.
  3834. This macro should only be selected if the system provides
  3835. mechanisms for handling large files. On 64 bit systems this macro
  3836. has no effect since the ‘*64’ functions are identical to the normal
  3837. functions.
  3838. This macro was introduced as part of the Large File Support
  3839. extension (LFS).
  3840. -- Macro: _ISOC99_SOURCE
  3841. Until the revised ISO C standard is widely adopted the new features
  3842. are not automatically enabled. The GNU C Library nevertheless has
  3843. a complete implementation of the new standard and to enable the new
  3844. features the macro ‘_ISOC99_SOURCE’ should be defined.
  3845. -- Macro: __STDC_WANT_LIB_EXT2__
  3846. If you define this macro to the value ‘1’, features from ISO/IEC TR
  3847. 24731-2:2010 (Dynamic Allocation Functions) are enabled. Only some
  3848. of the features from this TR are supported by the GNU C Library.
  3849. -- Macro: __STDC_WANT_IEC_60559_BFP_EXT__
  3850. If you define this macro, features from ISO/IEC TS 18661-1:2014
  3851. (Floating-point extensions for C: Binary floating-point arithmetic)
  3852. are enabled. Only some of the features from this TS are supported
  3853. by the GNU C Library.
  3854. -- Macro: __STDC_WANT_IEC_60559_FUNCS_EXT__
  3855. If you define this macro, features from ISO/IEC TS 18661-4:2015
  3856. (Floating-point extensions for C: Supplementary functions) are
  3857. enabled. Only some of the features from this TS are supported by
  3858. the GNU C Library.
  3859. -- Macro: _GNU_SOURCE
  3860. If you define this macro, everything is included: ISO C89, ISO C99,
  3861. POSIX.1, POSIX.2, BSD, SVID, X/Open, LFS, and GNU extensions. In
  3862. the cases where POSIX.1 conflicts with BSD, the POSIX definitions
  3863. take precedence.
  3864. -- Macro: _DEFAULT_SOURCE
  3865. If you define this macro, most features are included apart from
  3866. X/Open, LFS and GNU extensions: the effect is to enable features
  3867. from the 2008 edition of POSIX, as well as certain BSD and SVID
  3868. features without a separate feature test macro to control them.
  3869. Defining this macro, on its own and without using compiler options
  3870. such as ‘-ansi’ or ‘-std=c99’, has the same effect as not defining
  3871. any feature test macros; defining it together with other feature
  3872. test macros, or when options such as ‘-ansi’ are used, enables
  3873. those features even when the other options would otherwise cause
  3874. them to be disabled.
  3875. -- Macro: _REENTRANT
  3876. -- Macro: _THREAD_SAFE
  3877. These macros are obsolete. They have the same effect as defining
  3878. ‘_POSIX_C_SOURCE’ with the value ‘199506L’.
  3879. Some very old C libraries required one of these macros to be
  3880. defined for basic functionality (e.g. ‘getchar’) to be thread-safe.
  3881. We recommend you use ‘_GNU_SOURCE’ in new programs. If you don’t
  3882. specify the ‘-ansi’ option to GCC, or other conformance options such as
  3883. ‘-std=c99’, and don’t define any of these macros explicitly, the effect
  3884. is the same as defining ‘_DEFAULT_SOURCE’ to 1.
  3885. When you define a feature test macro to request a larger class of
  3886. features, it is harmless to define in addition a feature test macro for
  3887. a subset of those features. For example, if you define
  3888. ‘_POSIX_C_SOURCE’, then defining ‘_POSIX_SOURCE’ as well has no effect.
  3889. Likewise, if you define ‘_GNU_SOURCE’, then defining either
  3890. ‘_POSIX_SOURCE’ or ‘_POSIX_C_SOURCE’ as well has no effect.
  3891. 
  3892. File: libc.info, Node: Roadmap to the Manual, Prev: Using the Library, Up: Introduction
  3893. 1.4 Roadmap to the Manual
  3894. =========================
  3895. Here is an overview of the contents of the remaining chapters of this
  3896. manual.
  3897. • *note Error Reporting::, describes how errors detected by the
  3898. library are reported.
  3899. • *note Memory::, describes the GNU C Library’s facilities for
  3900. managing and using virtual and real memory, including dynamic
  3901. allocation of virtual memory. If you do not know in advance how
  3902. much memory your program needs, you can allocate it dynamically
  3903. instead, and manipulate it via pointers.
  3904. • *note Character Handling::, contains information about character
  3905. classification functions (such as ‘isspace’) and functions for
  3906. performing case conversion.
  3907. • *note String and Array Utilities::, has descriptions of functions
  3908. for manipulating strings (null-terminated character arrays) and
  3909. general byte arrays, including operations such as copying and
  3910. comparison.
  3911. • *note Character Set Handling::, contains information about
  3912. manipulating characters and strings using character sets larger
  3913. than will fit in the usual ‘char’ data type.
  3914. • *note Locales::, describes how selecting a particular country or
  3915. language affects the behavior of the library. For example, the
  3916. locale affects collation sequences for strings and how monetary
  3917. values are formatted.
  3918. • *note Searching and Sorting::, contains information about functions
  3919. for searching and sorting arrays. You can use these functions on
  3920. any kind of array by providing an appropriate comparison function.
  3921. • *note Pattern Matching::, presents functions for matching regular
  3922. expressions and shell file name patterns, and for expanding words
  3923. as the shell does.
  3924. • *note I/O Overview::, gives an overall look at the input and output
  3925. facilities in the library, and contains information about basic
  3926. concepts such as file names.
  3927. • *note I/O on Streams::, describes I/O operations involving streams
  3928. (or ‘FILE *’ objects). These are the normal C library functions
  3929. from ‘stdio.h’.
  3930. • *note Low-Level I/O::, contains information about I/O operations on
  3931. file descriptors. File descriptors are a lower-level mechanism
  3932. specific to the Unix family of operating systems.
  3933. • *note File System Interface::, has descriptions of operations on
  3934. entire files, such as functions for deleting and renaming them and
  3935. for creating new directories. This chapter also contains
  3936. information about how you can access the attributes of a file, such
  3937. as its owner and file protection modes.
  3938. • *note Pipes and FIFOs::, contains information about simple
  3939. interprocess communication mechanisms. Pipes allow communication
  3940. between two related processes (such as between a parent and child),
  3941. while FIFOs allow communication between processes sharing a common
  3942. file system on the same machine.
  3943. • *note Sockets::, describes a more complicated interprocess
  3944. communication mechanism that allows processes running on different
  3945. machines to communicate over a network. This chapter also contains
  3946. information about Internet host addressing and how to use the
  3947. system network databases.
  3948. • *note Low-Level Terminal Interface::, describes how you can change
  3949. the attributes of a terminal device. If you want to disable echo
  3950. of characters typed by the user, for example, read this chapter.
  3951. • *note Mathematics::, contains information about the math library
  3952. functions. These include things like random-number generators and
  3953. remainder functions on integers as well as the usual trigonometric
  3954. and exponential functions on floating-point numbers.
  3955. • *note Low-Level Arithmetic Functions: Arithmetic, describes
  3956. functions for simple arithmetic, analysis of floating-point values,
  3957. and reading numbers from strings.
  3958. • *note Date and Time::, describes functions for measuring both
  3959. calendar time and CPU time, as well as functions for setting alarms
  3960. and timers.
  3961. • *note Non-Local Exits::, contains descriptions of the ‘setjmp’ and
  3962. ‘longjmp’ functions. These functions provide a facility for
  3963. ‘goto’-like jumps which can jump from one function to another.
  3964. • *note Signal Handling::, tells you all about signals—what they are,
  3965. how to establish a handler that is called when a particular kind of
  3966. signal is delivered, and how to prevent signals from arriving
  3967. during critical sections of your program.
  3968. • *note Program Basics::, tells how your programs can access their
  3969. command-line arguments and environment variables.
  3970. • *note Processes::, contains information about how to start new
  3971. processes and run programs.
  3972. • *note Job Control::, describes functions for manipulating process
  3973. groups and the controlling terminal. This material is probably
  3974. only of interest if you are writing a shell or other program which
  3975. handles job control specially.
  3976. • *note Name Service Switch::, describes the services which are
  3977. available for looking up names in the system databases, how to
  3978. determine which service is used for which database, and how these
  3979. services are implemented so that contributors can design their own
  3980. services.
  3981. • *note User Database::, and *note Group Database::, tell you how to
  3982. access the system user and group databases.
  3983. • *note System Management::, describes functions for controlling and
  3984. getting information about the hardware and software configuration
  3985. your program is executing under.
  3986. • *note System Configuration::, tells you how you can get information
  3987. about various operating system limits. Most of these parameters
  3988. are provided for compatibility with POSIX.
  3989. • *note Language Features::, contains information about library
  3990. support for standard parts of the C language, including things like
  3991. the ‘sizeof’ operator and the symbolic constant ‘NULL’, how to
  3992. write functions accepting variable numbers of arguments, and
  3993. constants describing the ranges and other properties of the
  3994. numerical types. There is also a simple debugging mechanism which
  3995. allows you to put assertions in your code, and have diagnostic
  3996. messages printed if the tests fail.
  3997. • *note Library Summary::, gives a summary of all the functions,
  3998. variables, and macros in the library, with complete data types and
  3999. function prototypes, and says what standard or system each is
  4000. derived from.
  4001. • *note Installation::, explains how to build and install the GNU C
  4002. Library on your system, and how to report any bugs you might find.
  4003. • *note Maintenance::, explains how to add new functions or port the
  4004. library to a new system.
  4005. If you already know the name of the facility you are interested in,
  4006. you can look it up in *note Library Summary::. This gives you a summary
  4007. of its syntax and a pointer to where you can find a more detailed
  4008. description. This appendix is particularly useful if you just want to
  4009. verify the order and type of arguments to a function, for example. It
  4010. also tells you what standard or system each function, variable, or macro
  4011. is derived from.
  4012. 
  4013. File: libc.info, Node: Error Reporting, Next: Memory, Prev: Introduction, Up: Top
  4014. 2 Error Reporting
  4015. *****************
  4016. Many functions in the GNU C Library detect and report error conditions,
  4017. and sometimes your programs need to check for these error conditions.
  4018. For example, when you open an input file, you should verify that the
  4019. file was actually opened correctly, and print an error message or take
  4020. other appropriate action if the call to the library function failed.
  4021. This chapter describes how the error reporting facility works. Your
  4022. program should include the header file ‘errno.h’ to use this facility.
  4023. * Menu:
  4024. * Checking for Errors:: How errors are reported by library functions.
  4025. * Error Codes:: Error code macros; all of these expand
  4026. into integer constant values.
  4027. * Error Messages:: Mapping error codes onto error messages.
  4028. 
  4029. File: libc.info, Node: Checking for Errors, Next: Error Codes, Up: Error Reporting
  4030. 2.1 Checking for Errors
  4031. =======================
  4032. Most library functions return a special value to indicate that they have
  4033. failed. The special value is typically ‘-1’, a null pointer, or a
  4034. constant such as ‘EOF’ that is defined for that purpose. But this
  4035. return value tells you only that an error has occurred. To find out
  4036. what kind of error it was, you need to look at the error code stored in
  4037. the variable ‘errno’. This variable is declared in the header file
  4038. ‘errno.h’.
  4039. -- Variable: volatile int errno
  4040. The variable ‘errno’ contains the system error number. You can
  4041. change the value of ‘errno’.
  4042. Since ‘errno’ is declared ‘volatile’, it might be changed
  4043. asynchronously by a signal handler; see *note Defining Handlers::.
  4044. However, a properly written signal handler saves and restores the
  4045. value of ‘errno’, so you generally do not need to worry about this
  4046. possibility except when writing signal handlers.
  4047. The initial value of ‘errno’ at program startup is zero. Many
  4048. library functions are guaranteed to set it to certain nonzero
  4049. values when they encounter certain kinds of errors. These error
  4050. conditions are listed for each function. These functions do not
  4051. change ‘errno’ when they succeed; thus, the value of ‘errno’ after
  4052. a successful call is not necessarily zero, and you should not use
  4053. ‘errno’ to determine _whether_ a call failed. The proper way to do
  4054. that is documented for each function. _If_ the call failed, you
  4055. can examine ‘errno’.
  4056. Many library functions can set ‘errno’ to a nonzero value as a
  4057. result of calling other library functions which might fail. You
  4058. should assume that any library function might alter ‘errno’ when
  4059. the function returns an error.
  4060. *Portability Note:* ISO C specifies ‘errno’ as a “modifiable
  4061. lvalue” rather than as a variable, permitting it to be implemented
  4062. as a macro. For example, its expansion might involve a function
  4063. call, like ‘*__errno_location ()’. In fact, that is what it is on
  4064. GNU/Linux and GNU/Hurd systems. The GNU C Library, on each system,
  4065. does whatever is right for the particular system.
  4066. There are a few library functions, like ‘sqrt’ and ‘atan’, that
  4067. return a perfectly legitimate value in case of an error, but also
  4068. set ‘errno’. For these functions, if you want to check to see
  4069. whether an error occurred, the recommended method is to set ‘errno’
  4070. to zero before calling the function, and then check its value
  4071. afterward.
  4072. All the error codes have symbolic names; they are macros defined in
  4073. ‘errno.h’. The names start with ‘E’ and an upper-case letter or digit;
  4074. you should consider names of this form to be reserved names. *Note
  4075. Reserved Names::.
  4076. The error code values are all positive integers and are all distinct,
  4077. with one exception: ‘EWOULDBLOCK’ and ‘EAGAIN’ are the same. Since the
  4078. values are distinct, you can use them as labels in a ‘switch’ statement;
  4079. just don’t use both ‘EWOULDBLOCK’ and ‘EAGAIN’. Your program should not
  4080. make any other assumptions about the specific values of these symbolic
  4081. constants.
  4082. The value of ‘errno’ doesn’t necessarily have to correspond to any of
  4083. these macros, since some library functions might return other error
  4084. codes of their own for other situations. The only values that are
  4085. guaranteed to be meaningful for a particular library function are the
  4086. ones that this manual lists for that function.
  4087. Except on GNU/Hurd systems, almost any system call can return
  4088. ‘EFAULT’ if it is given an invalid pointer as an argument. Since this
  4089. could only happen as a result of a bug in your program, and since it
  4090. will not happen on GNU/Hurd systems, we have saved space by not
  4091. mentioning ‘EFAULT’ in the descriptions of individual functions.
  4092. In some Unix systems, many system calls can also return ‘EFAULT’ if
  4093. given as an argument a pointer into the stack, and the kernel for some
  4094. obscure reason fails in its attempt to extend the stack. If this ever
  4095. happens, you should probably try using statically or dynamically
  4096. allocated memory instead of stack memory on that system.
  4097. 
  4098. File: libc.info, Node: Error Codes, Next: Error Messages, Prev: Checking for Errors, Up: Error Reporting
  4099. 2.2 Error Codes
  4100. ===============
  4101. The error code macros are defined in the header file ‘errno.h’. All of
  4102. them expand into integer constant values. Some of these error codes
  4103. can’t occur on GNU systems, but they can occur using the GNU C Library
  4104. on other systems.
  4105. -- Macro: int EPERM
  4106. Operation not permitted; only the owner of the file (or other
  4107. resource) or processes with special privileges can perform the
  4108. operation.
  4109. -- Macro: int ENOENT
  4110. No such file or directory. This is a “file doesn’t exist” error
  4111. for ordinary files that are referenced in contexts where they are
  4112. expected to already exist.
  4113. -- Macro: int ESRCH
  4114. No process matches the specified process ID.
  4115. -- Macro: int EINTR
  4116. Interrupted function call; an asynchronous signal occurred and
  4117. prevented completion of the call. When this happens, you should
  4118. try the call again.
  4119. You can choose to have functions resume after a signal that is
  4120. handled, rather than failing with ‘EINTR’; see *note Interrupted
  4121. Primitives::.
  4122. -- Macro: int EIO
  4123. Input/output error; usually used for physical read or write errors.
  4124. -- Macro: int ENXIO
  4125. No such device or address. The system tried to use the device
  4126. represented by a file you specified, and it couldn’t find the
  4127. device. This can mean that the device file was installed
  4128. incorrectly, or that the physical device is missing or not
  4129. correctly attached to the computer.
  4130. -- Macro: int E2BIG
  4131. Argument list too long; used when the arguments passed to a new
  4132. program being executed with one of the ‘exec’ functions (*note
  4133. Executing a File::) occupy too much memory space. This condition
  4134. never arises on GNU/Hurd systems.
  4135. -- Macro: int ENOEXEC
  4136. Invalid executable file format. This condition is detected by the
  4137. ‘exec’ functions; see *note Executing a File::.
  4138. -- Macro: int EBADF
  4139. Bad file descriptor; for example, I/O on a descriptor that has been
  4140. closed or reading from a descriptor open only for writing (or vice
  4141. versa).
  4142. -- Macro: int ECHILD
  4143. There are no child processes. This error happens on operations
  4144. that are supposed to manipulate child processes, when there aren’t
  4145. any processes to manipulate.
  4146. -- Macro: int EDEADLK
  4147. Deadlock avoided; allocating a system resource would have resulted
  4148. in a deadlock situation. The system does not guarantee that it
  4149. will notice all such situations. This error means you got lucky
  4150. and the system noticed; it might just hang. *Note File Locks::,
  4151. for an example.
  4152. -- Macro: int ENOMEM
  4153. No memory available. The system cannot allocate more virtual
  4154. memory because its capacity is full.
  4155. -- Macro: int EACCES
  4156. Permission denied; the file permissions do not allow the attempted
  4157. operation.
  4158. -- Macro: int EFAULT
  4159. Bad address; an invalid pointer was detected. On GNU/Hurd systems,
  4160. this error never happens; you get a signal instead.
  4161. -- Macro: int ENOTBLK
  4162. A file that isn’t a block special file was given in a situation
  4163. that requires one. For example, trying to mount an ordinary file
  4164. as a file system in Unix gives this error.
  4165. -- Macro: int EBUSY
  4166. Resource busy; a system resource that can’t be shared is already in
  4167. use. For example, if you try to delete a file that is the root of
  4168. a currently mounted filesystem, you get this error.
  4169. -- Macro: int EEXIST
  4170. File exists; an existing file was specified in a context where it
  4171. only makes sense to specify a new file.
  4172. -- Macro: int EXDEV
  4173. An attempt to make an improper link across file systems was
  4174. detected. This happens not only when you use ‘link’ (*note Hard
  4175. Links::) but also when you rename a file with ‘rename’ (*note
  4176. Renaming Files::).
  4177. -- Macro: int ENODEV
  4178. The wrong type of device was given to a function that expects a
  4179. particular sort of device.
  4180. -- Macro: int ENOTDIR
  4181. A file that isn’t a directory was specified when a directory is
  4182. required.
  4183. -- Macro: int EISDIR
  4184. File is a directory; you cannot open a directory for writing, or
  4185. create or remove hard links to it.
  4186. -- Macro: int EINVAL
  4187. Invalid argument. This is used to indicate various kinds of
  4188. problems with passing the wrong argument to a library function.
  4189. -- Macro: int EMFILE
  4190. The current process has too many files open and can’t open any
  4191. more. Duplicate descriptors do count toward this limit.
  4192. In BSD and GNU, the number of open files is controlled by a
  4193. resource limit that can usually be increased. If you get this
  4194. error, you might want to increase the ‘RLIMIT_NOFILE’ limit or make
  4195. it unlimited; *note Limits on Resources::.
  4196. -- Macro: int ENFILE
  4197. There are too many distinct file openings in the entire system.
  4198. Note that any number of linked channels count as just one file
  4199. opening; see *note Linked Channels::. This error never occurs on
  4200. GNU/Hurd systems.
  4201. -- Macro: int ENOTTY
  4202. Inappropriate I/O control operation, such as trying to set terminal
  4203. modes on an ordinary file.
  4204. -- Macro: int ETXTBSY
  4205. An attempt to execute a file that is currently open for writing, or
  4206. write to a file that is currently being executed. Often using a
  4207. debugger to run a program is considered having it open for writing
  4208. and will cause this error. (The name stands for “text file busy”.)
  4209. This is not an error on GNU/Hurd systems; the text is copied as
  4210. necessary.
  4211. -- Macro: int EFBIG
  4212. File too big; the size of a file would be larger than allowed by
  4213. the system.
  4214. -- Macro: int ENOSPC
  4215. No space left on device; write operation on a file failed because
  4216. the disk is full.
  4217. -- Macro: int ESPIPE
  4218. Invalid seek operation (such as on a pipe).
  4219. -- Macro: int EROFS
  4220. An attempt was made to modify something on a read-only file system.
  4221. -- Macro: int EMLINK
  4222. Too many links; the link count of a single file would become too
  4223. large. ‘rename’ can cause this error if the file being renamed
  4224. already has as many links as it can take (*note Renaming Files::).
  4225. -- Macro: int EPIPE
  4226. Broken pipe; there is no process reading from the other end of a
  4227. pipe. Every library function that returns this error code also
  4228. generates a ‘SIGPIPE’ signal; this signal terminates the program if
  4229. not handled or blocked. Thus, your program will never actually see
  4230. ‘EPIPE’ unless it has handled or blocked ‘SIGPIPE’.
  4231. -- Macro: int EDOM
  4232. Domain error; used by mathematical functions when an argument value
  4233. does not fall into the domain over which the function is defined.
  4234. -- Macro: int ERANGE
  4235. Range error; used by mathematical functions when the result value
  4236. is not representable because of overflow or underflow.
  4237. -- Macro: int EAGAIN
  4238. Resource temporarily unavailable; the call might work if you try
  4239. again later. The macro ‘EWOULDBLOCK’ is another name for ‘EAGAIN’;
  4240. they are always the same in the GNU C Library.
  4241. This error can happen in a few different situations:
  4242. • An operation that would block was attempted on an object that
  4243. has non-blocking mode selected. Trying the same operation
  4244. again will block until some external condition makes it
  4245. possible to read, write, or connect (whatever the operation).
  4246. You can use ‘select’ to find out when the operation will be
  4247. possible; *note Waiting for I/O::.
  4248. *Portability Note:* In many older Unix systems, this condition
  4249. was indicated by ‘EWOULDBLOCK’, which was a distinct error
  4250. code different from ‘EAGAIN’. To make your program portable,
  4251. you should check for both codes and treat them the same.
  4252. • A temporary resource shortage made an operation impossible.
  4253. ‘fork’ can return this error. It indicates that the shortage
  4254. is expected to pass, so your program can try the call again
  4255. later and it may succeed. It is probably a good idea to delay
  4256. for a few seconds before trying it again, to allow time for
  4257. other processes to release scarce resources. Such shortages
  4258. are usually fairly serious and affect the whole system, so
  4259. usually an interactive program should report the error to the
  4260. user and return to its command loop.
  4261. -- Macro: int EWOULDBLOCK
  4262. In the GNU C Library, this is another name for ‘EAGAIN’ (above).
  4263. The values are always the same, on every operating system.
  4264. C libraries in many older Unix systems have ‘EWOULDBLOCK’ as a
  4265. separate error code.
  4266. -- Macro: int EINPROGRESS
  4267. An operation that cannot complete immediately was initiated on an
  4268. object that has non-blocking mode selected. Some functions that
  4269. must always block (such as ‘connect’; *note Connecting::) never
  4270. return ‘EAGAIN’. Instead, they return ‘EINPROGRESS’ to indicate
  4271. that the operation has begun and will take some time. Attempts to
  4272. manipulate the object before the call completes return ‘EALREADY’.
  4273. You can use the ‘select’ function to find out when the pending
  4274. operation has completed; *note Waiting for I/O::.
  4275. -- Macro: int EALREADY
  4276. An operation is already in progress on an object that has
  4277. non-blocking mode selected.
  4278. -- Macro: int ENOTSOCK
  4279. A file that isn’t a socket was specified when a socket is required.
  4280. -- Macro: int EMSGSIZE
  4281. The size of a message sent on a socket was larger than the
  4282. supported maximum size.
  4283. -- Macro: int EPROTOTYPE
  4284. The socket type does not support the requested communications
  4285. protocol.
  4286. -- Macro: int ENOPROTOOPT
  4287. You specified a socket option that doesn’t make sense for the
  4288. particular protocol being used by the socket. *Note Socket
  4289. Options::.
  4290. -- Macro: int EPROTONOSUPPORT
  4291. The socket domain does not support the requested communications
  4292. protocol (perhaps because the requested protocol is completely
  4293. invalid). *Note Creating a Socket::.
  4294. -- Macro: int ESOCKTNOSUPPORT
  4295. The socket type is not supported.
  4296. -- Macro: int EOPNOTSUPP
  4297. The operation you requested is not supported. Some socket
  4298. functions don’t make sense for all types of sockets, and others may
  4299. not be implemented for all communications protocols. On GNU/Hurd
  4300. systems, this error can happen for many calls when the object does
  4301. not support the particular operation; it is a generic indication
  4302. that the server knows nothing to do for that call.
  4303. -- Macro: int EPFNOSUPPORT
  4304. The socket communications protocol family you requested is not
  4305. supported.
  4306. -- Macro: int EAFNOSUPPORT
  4307. The address family specified for a socket is not supported; it is
  4308. inconsistent with the protocol being used on the socket. *Note
  4309. Sockets::.
  4310. -- Macro: int EADDRINUSE
  4311. The requested socket address is already in use. *Note Socket
  4312. Addresses::.
  4313. -- Macro: int EADDRNOTAVAIL
  4314. The requested socket address is not available; for example, you
  4315. tried to give a socket a name that doesn’t match the local host
  4316. name. *Note Socket Addresses::.
  4317. -- Macro: int ENETDOWN
  4318. A socket operation failed because the network was down.
  4319. -- Macro: int ENETUNREACH
  4320. A socket operation failed because the subnet containing the remote
  4321. host was unreachable.
  4322. -- Macro: int ENETRESET
  4323. A network connection was reset because the remote host crashed.
  4324. -- Macro: int ECONNABORTED
  4325. A network connection was aborted locally.
  4326. -- Macro: int ECONNRESET
  4327. A network connection was closed for reasons outside the control of
  4328. the local host, such as by the remote machine rebooting or an
  4329. unrecoverable protocol violation.
  4330. -- Macro: int ENOBUFS
  4331. The kernel’s buffers for I/O operations are all in use. In GNU,
  4332. this error is always synonymous with ‘ENOMEM’; you may get one or
  4333. the other from network operations.
  4334. -- Macro: int EISCONN
  4335. You tried to connect a socket that is already connected. *Note
  4336. Connecting::.
  4337. -- Macro: int ENOTCONN
  4338. The socket is not connected to anything. You get this error when
  4339. you try to transmit data over a socket, without first specifying a
  4340. destination for the data. For a connectionless socket (for
  4341. datagram protocols, such as UDP), you get ‘EDESTADDRREQ’ instead.
  4342. -- Macro: int EDESTADDRREQ
  4343. No default destination address was set for the socket. You get
  4344. this error when you try to transmit data over a connectionless
  4345. socket, without first specifying a destination for the data with
  4346. ‘connect’.
  4347. -- Macro: int ESHUTDOWN
  4348. The socket has already been shut down.
  4349. -- Macro: int ETOOMANYREFS
  4350. ???
  4351. -- Macro: int ETIMEDOUT
  4352. A socket operation with a specified timeout received no response
  4353. during the timeout period.
  4354. -- Macro: int ECONNREFUSED
  4355. A remote host refused to allow the network connection (typically
  4356. because it is not running the requested service).
  4357. -- Macro: int ELOOP
  4358. Too many levels of symbolic links were encountered in looking up a
  4359. file name. This often indicates a cycle of symbolic links.
  4360. -- Macro: int ENAMETOOLONG
  4361. Filename too long (longer than ‘PATH_MAX’; *note Limits for
  4362. Files::) or host name too long (in ‘gethostname’ or ‘sethostname’;
  4363. *note Host Identification::).
  4364. -- Macro: int EHOSTDOWN
  4365. The remote host for a requested network connection is down.
  4366. -- Macro: int EHOSTUNREACH
  4367. The remote host for a requested network connection is not
  4368. reachable.
  4369. -- Macro: int ENOTEMPTY
  4370. Directory not empty, where an empty directory was expected.
  4371. Typically, this error occurs when you are trying to delete a
  4372. directory.
  4373. -- Macro: int EPROCLIM
  4374. This means that the per-user limit on new process would be exceeded
  4375. by an attempted ‘fork’. *Note Limits on Resources::, for details
  4376. on the ‘RLIMIT_NPROC’ limit.
  4377. -- Macro: int EUSERS
  4378. The file quota system is confused because there are too many users.
  4379. -- Macro: int EDQUOT
  4380. The user’s disk quota was exceeded.
  4381. -- Macro: int ESTALE
  4382. Stale file handle. This indicates an internal confusion in the
  4383. file system which is due to file system rearrangements on the
  4384. server host for NFS file systems or corruption in other file
  4385. systems. Repairing this condition usually requires unmounting,
  4386. possibly repairing and remounting the file system.
  4387. -- Macro: int EREMOTE
  4388. An attempt was made to NFS-mount a remote file system with a file
  4389. name that already specifies an NFS-mounted file. (This is an error
  4390. on some operating systems, but we expect it to work properly on
  4391. GNU/Hurd systems, making this error code impossible.)
  4392. -- Macro: int EBADRPC
  4393. ???
  4394. -- Macro: int ERPCMISMATCH
  4395. ???
  4396. -- Macro: int EPROGUNAVAIL
  4397. ???
  4398. -- Macro: int EPROGMISMATCH
  4399. ???
  4400. -- Macro: int EPROCUNAVAIL
  4401. ???
  4402. -- Macro: int ENOLCK
  4403. No locks available. This is used by the file locking facilities;
  4404. see *note File Locks::. This error is never generated by GNU/Hurd
  4405. systems, but it can result from an operation to an NFS server
  4406. running another operating system.
  4407. -- Macro: int EFTYPE
  4408. Inappropriate file type or format. The file was the wrong type for
  4409. the operation, or a data file had the wrong format.
  4410. On some systems ‘chmod’ returns this error if you try to set the
  4411. sticky bit on a non-directory file; *note Setting Permissions::.
  4412. -- Macro: int EAUTH
  4413. ???
  4414. -- Macro: int ENEEDAUTH
  4415. ???
  4416. -- Macro: int ENOSYS
  4417. Function not implemented. This indicates that the function called
  4418. is not implemented at all, either in the C library itself or in the
  4419. operating system. When you get this error, you can be sure that
  4420. this particular function will always fail with ‘ENOSYS’ unless you
  4421. install a new version of the C library or the operating system.
  4422. -- Macro: int ENOTSUP
  4423. Not supported. A function returns this error when certain
  4424. parameter values are valid, but the functionality they request is
  4425. not available. This can mean that the function does not implement
  4426. a particular command or option value or flag bit at all. For
  4427. functions that operate on some object given in a parameter, such as
  4428. a file descriptor or a port, it might instead mean that only _that
  4429. specific object_ (file descriptor, port, etc.) is unable to
  4430. support the other parameters given; different file descriptors
  4431. might support different ranges of parameter values.
  4432. If the entire function is not available at all in the
  4433. implementation, it returns ‘ENOSYS’ instead.
  4434. -- Macro: int EILSEQ
  4435. While decoding a multibyte character the function came along an
  4436. invalid or an incomplete sequence of bytes or the given wide
  4437. character is invalid.
  4438. -- Macro: int EBACKGROUND
  4439. On GNU/Hurd systems, servers supporting the ‘term’ protocol return
  4440. this error for certain operations when the caller is not in the
  4441. foreground process group of the terminal. Users do not usually see
  4442. this error because functions such as ‘read’ and ‘write’ translate
  4443. it into a ‘SIGTTIN’ or ‘SIGTTOU’ signal. *Note Job Control::, for
  4444. information on process groups and these signals.
  4445. -- Macro: int EDIED
  4446. On GNU/Hurd systems, opening a file returns this error when the
  4447. file is translated by a program and the translator program dies
  4448. while starting up, before it has connected to the file.
  4449. -- Macro: int ED
  4450. The experienced user will know what is wrong.
  4451. -- Macro: int EGREGIOUS
  4452. You did *what*?
  4453. -- Macro: int EIEIO
  4454. Go home and have a glass of warm, dairy-fresh milk.
  4455. -- Macro: int EGRATUITOUS
  4456. This error code has no purpose.
  4457. -- Macro: int EBADMSG
  4458. -- Macro: int EIDRM
  4459. -- Macro: int EMULTIHOP
  4460. -- Macro: int ENODATA
  4461. -- Macro: int ENOLINK
  4462. -- Macro: int ENOMSG
  4463. -- Macro: int ENOSR
  4464. -- Macro: int ENOSTR
  4465. -- Macro: int EOVERFLOW
  4466. -- Macro: int EPROTO
  4467. -- Macro: int ETIME
  4468. -- Macro: int ECANCELED
  4469. Operation canceled; an asynchronous operation was canceled before
  4470. it completed. *Note Asynchronous I/O::. When you call
  4471. ‘aio_cancel’, the normal result is for the operations affected to
  4472. complete with this error; *note Cancel AIO Operations::.
  4473. _The following error codes are defined by the Linux/i386 kernel.
  4474. They are not yet documented._
  4475. -- Macro: int ERESTART
  4476. -- Macro: int ECHRNG
  4477. -- Macro: int EL2NSYNC
  4478. -- Macro: int EL3HLT
  4479. -- Macro: int EL3RST
  4480. -- Macro: int ELNRNG
  4481. -- Macro: int EUNATCH
  4482. -- Macro: int ENOCSI
  4483. -- Macro: int EL2HLT
  4484. -- Macro: int EBADE
  4485. -- Macro: int EBADR
  4486. -- Macro: int EXFULL
  4487. -- Macro: int ENOANO
  4488. -- Macro: int EBADRQC
  4489. -- Macro: int EBADSLT
  4490. -- Macro: int EDEADLOCK
  4491. -- Macro: int EBFONT
  4492. -- Macro: int ENONET
  4493. -- Macro: int ENOPKG
  4494. -- Macro: int EADV
  4495. -- Macro: int ESRMNT
  4496. -- Macro: int ECOMM
  4497. -- Macro: int EDOTDOT
  4498. -- Macro: int ENOTUNIQ
  4499. -- Macro: int EBADFD
  4500. -- Macro: int EREMCHG
  4501. -- Macro: int ELIBACC
  4502. -- Macro: int ELIBBAD
  4503. -- Macro: int ELIBSCN
  4504. -- Macro: int ELIBMAX
  4505. -- Macro: int ELIBEXEC
  4506. -- Macro: int ESTRPIPE
  4507. -- Macro: int EUCLEAN
  4508. -- Macro: int ENOTNAM
  4509. -- Macro: int ENAVAIL
  4510. -- Macro: int EISNAM
  4511. -- Macro: int EREMOTEIO
  4512. -- Macro: int ENOMEDIUM
  4513. -- Macro: int EMEDIUMTYPE
  4514. -- Macro: int ENOKEY
  4515. -- Macro: int EKEYEXPIRED
  4516. -- Macro: int EKEYREVOKED
  4517. -- Macro: int EKEYREJECTED
  4518. -- Macro: int EOWNERDEAD
  4519. -- Macro: int ENOTRECOVERABLE
  4520. -- Macro: int ERFKILL
  4521. -- Macro: int EHWPOISON
  4522. 
  4523. File: libc.info, Node: Error Messages, Prev: Error Codes, Up: Error Reporting
  4524. 2.3 Error Messages
  4525. ==================
  4526. The library has functions and variables designed to make it easy for
  4527. your program to report informative error messages in the customary
  4528. format about the failure of a library call. The functions ‘strerror’
  4529. and ‘perror’ give you the standard error message for a given error code;
  4530. the variable ‘program_invocation_short_name’ gives you convenient access
  4531. to the name of the program that encountered the error.
  4532. -- Function: char * strerror (int ERRNUM)
  4533. Preliminary: | MT-Unsafe race:strerror | AS-Unsafe heap i18n |
  4534. AC-Unsafe mem | *Note POSIX Safety Concepts::.
  4535. The ‘strerror’ function maps the error code (*note Checking for
  4536. Errors::) specified by the ERRNUM argument to a descriptive error
  4537. message string. The return value is a pointer to this string.
  4538. The value ERRNUM normally comes from the variable ‘errno’.
  4539. You should not modify the string returned by ‘strerror’. Also, if
  4540. you make subsequent calls to ‘strerror’, the string might be
  4541. overwritten. (But it’s guaranteed that no library function ever
  4542. calls ‘strerror’ behind your back.)
  4543. The function ‘strerror’ is declared in ‘string.h’.
  4544. -- Function: char * strerror_r (int ERRNUM, char *BUF, size_t N)
  4545. Preliminary: | MT-Safe | AS-Unsafe i18n | AC-Unsafe | *Note POSIX
  4546. Safety Concepts::.
  4547. The ‘strerror_r’ function works like ‘strerror’ but instead of
  4548. returning the error message in a statically allocated buffer shared
  4549. by all threads in the process, it returns a private copy for the
  4550. thread. This might be either some permanent global data or a
  4551. message string in the user supplied buffer starting at BUF with the
  4552. length of N bytes.
  4553. At most N characters are written (including the NUL byte) so it is
  4554. up to the user to select a buffer large enough.
  4555. This function should always be used in multi-threaded programs
  4556. since there is no way to guarantee the string returned by
  4557. ‘strerror’ really belongs to the last call of the current thread.
  4558. The function ‘strerror_r’ is a GNU extension and it is declared in
  4559. ‘string.h’.
  4560. -- Function: void perror (const char *MESSAGE)
  4561. Preliminary: | MT-Safe race:stderr | AS-Unsafe corrupt i18n heap
  4562. lock | AC-Unsafe corrupt lock mem fd | *Note POSIX Safety
  4563. Concepts::.
  4564. This function prints an error message to the stream ‘stderr’; see
  4565. *note Standard Streams::. The orientation of ‘stderr’ is not
  4566. changed.
  4567. If you call ‘perror’ with a MESSAGE that is either a null pointer
  4568. or an empty string, ‘perror’ just prints the error message
  4569. corresponding to ‘errno’, adding a trailing newline.
  4570. If you supply a non-null MESSAGE argument, then ‘perror’ prefixes
  4571. its output with this string. It adds a colon and a space character
  4572. to separate the MESSAGE from the error string corresponding to
  4573. ‘errno’.
  4574. The function ‘perror’ is declared in ‘stdio.h’.
  4575. ‘strerror’ and ‘perror’ produce the exact same message for any given
  4576. error code; the precise text varies from system to system. With the GNU
  4577. C Library, the messages are fairly short; there are no multi-line
  4578. messages or embedded newlines. Each error message begins with a capital
  4579. letter and does not include any terminating punctuation.
  4580. Many programs that don’t read input from the terminal are designed to
  4581. exit if any system call fails. By convention, the error message from
  4582. such a program should start with the program’s name, sans directories.
  4583. You can find that name in the variable ‘program_invocation_short_name’;
  4584. the full file name is stored the variable ‘program_invocation_name’.
  4585. -- Variable: char * program_invocation_name
  4586. This variable’s value is the name that was used to invoke the
  4587. program running in the current process. It is the same as
  4588. ‘argv[0]’. Note that this is not necessarily a useful file name;
  4589. often it contains no directory names. *Note Program Arguments::.
  4590. This variable is a GNU extension and is declared in ‘errno.h’.
  4591. -- Variable: char * program_invocation_short_name
  4592. This variable’s value is the name that was used to invoke the
  4593. program running in the current process, with directory names
  4594. removed. (That is to say, it is the same as
  4595. ‘program_invocation_name’ minus everything up to the last slash, if
  4596. any.)
  4597. This variable is a GNU extension and is declared in ‘errno.h’.
  4598. The library initialization code sets up both of these variables
  4599. before calling ‘main’.
  4600. *Portability Note:* If you want your program to work with non-GNU
  4601. libraries, you must save the value of ‘argv[0]’ in ‘main’, and then
  4602. strip off the directory names yourself. We added these extensions to
  4603. make it possible to write self-contained error-reporting subroutines
  4604. that require no explicit cooperation from ‘main’.
  4605. Here is an example showing how to handle failure to open a file
  4606. correctly. The function ‘open_sesame’ tries to open the named file for
  4607. reading and returns a stream if successful. The ‘fopen’ library
  4608. function returns a null pointer if it couldn’t open the file for some
  4609. reason. In that situation, ‘open_sesame’ constructs an appropriate
  4610. error message using the ‘strerror’ function, and terminates the program.
  4611. If we were going to make some other library calls before passing the
  4612. error code to ‘strerror’, we’d have to save it in a local variable
  4613. instead, because those other library functions might overwrite ‘errno’
  4614. in the meantime.
  4615. #define _GNU_SOURCE
  4616. #include <errno.h>
  4617. #include <stdio.h>
  4618. #include <stdlib.h>
  4619. #include <string.h>
  4620. FILE *
  4621. open_sesame (char *name)
  4622. {
  4623. FILE *stream;
  4624. errno = 0;
  4625. stream = fopen (name, "r");
  4626. if (stream == NULL)
  4627. {
  4628. fprintf (stderr, "%s: Couldn't open file %s; %s\n",
  4629. program_invocation_short_name, name, strerror (errno));
  4630. exit (EXIT_FAILURE);
  4631. }
  4632. else
  4633. return stream;
  4634. }
  4635. Using ‘perror’ has the advantage that the function is portable and
  4636. available on all systems implementing ISO C. But often the text ‘perror’
  4637. generates is not what is wanted and there is no way to extend or change
  4638. what ‘perror’ does. The GNU coding standard, for instance, requires
  4639. error messages to be preceded by the program name and programs which
  4640. read some input files should provide information about the input file
  4641. name and the line number in case an error is encountered while reading
  4642. the file. For these occasions there are two functions available which
  4643. are widely used throughout the GNU project. These functions are
  4644. declared in ‘error.h’.
  4645. -- Function: void error (int STATUS, int ERRNUM, const char *FORMAT, …)
  4646. Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap i18n |
  4647. AC-Safe | *Note POSIX Safety Concepts::.
  4648. The ‘error’ function can be used to report general problems during
  4649. program execution. The FORMAT argument is a format string just
  4650. like those given to the ‘printf’ family of functions. The
  4651. arguments required for the format can follow the FORMAT parameter.
  4652. Just like ‘perror’, ‘error’ also can report an error code in
  4653. textual form. But unlike ‘perror’ the error value is explicitly
  4654. passed to the function in the ERRNUM parameter. This eliminates
  4655. the problem mentioned above that the error reporting function must
  4656. be called immediately after the function causing the error since
  4657. otherwise ‘errno’ might have a different value.
  4658. ‘error’ prints first the program name. If the application defined
  4659. a global variable ‘error_print_progname’ and points it to a
  4660. function this function will be called to print the program name.
  4661. Otherwise the string from the global variable ‘program_name’ is
  4662. used. The program name is followed by a colon and a space which in
  4663. turn is followed by the output produced by the format string. If
  4664. the ERRNUM parameter is non-zero the format string output is
  4665. followed by a colon and a space, followed by the error message for
  4666. the error code ERRNUM. In any case is the output terminated with a
  4667. newline.
  4668. The output is directed to the ‘stderr’ stream. If the ‘stderr’
  4669. wasn’t oriented before the call it will be narrow-oriented
  4670. afterwards.
  4671. The function will return unless the STATUS parameter has a non-zero
  4672. value. In this case the function will call ‘exit’ with the STATUS
  4673. value for its parameter and therefore never return. If ‘error’
  4674. returns, the global variable ‘error_message_count’ is incremented
  4675. by one to keep track of the number of errors reported.
  4676. -- Function: void error_at_line (int STATUS, int ERRNUM, const char
  4677. *FNAME, unsigned int LINENO, const char *FORMAT, …)
  4678. Preliminary: | MT-Unsafe race:error_at_line/error_one_per_line
  4679. locale | AS-Unsafe corrupt heap i18n | AC-Unsafe
  4680. corrupt/error_one_per_line | *Note POSIX Safety Concepts::.
  4681. The ‘error_at_line’ function is very similar to the ‘error’
  4682. function. The only differences are the additional parameters FNAME
  4683. and LINENO. The handling of the other parameters is identical to
  4684. that of ‘error’ except that between the program name and the string
  4685. generated by the format string additional text is inserted.
  4686. Directly following the program name a colon, followed by the file
  4687. name pointed to by FNAME, another colon, and the value of LINENO is
  4688. printed.
  4689. This additional output of course is meant to be used to locate an
  4690. error in an input file (like a programming language source code
  4691. file etc).
  4692. If the global variable ‘error_one_per_line’ is set to a non-zero
  4693. value ‘error_at_line’ will avoid printing consecutive messages for
  4694. the same file and line. Repetition which are not directly
  4695. following each other are not caught.
  4696. Just like ‘error’ this function only returns if STATUS is zero.
  4697. Otherwise ‘exit’ is called with the non-zero value. If ‘error’
  4698. returns, the global variable ‘error_message_count’ is incremented
  4699. by one to keep track of the number of errors reported.
  4700. As mentioned above, the ‘error’ and ‘error_at_line’ functions can be
  4701. customized by defining a variable named ‘error_print_progname’.
  4702. -- Variable: void (*error_print_progname) (void)
  4703. If the ‘error_print_progname’ variable is defined to a non-zero
  4704. value the function pointed to is called by ‘error’ or
  4705. ‘error_at_line’. It is expected to print the program name or do
  4706. something similarly useful.
  4707. The function is expected to print to the ‘stderr’ stream and must
  4708. be able to handle whatever orientation the stream has.
  4709. The variable is global and shared by all threads.
  4710. -- Variable: unsigned int error_message_count
  4711. The ‘error_message_count’ variable is incremented whenever one of
  4712. the functions ‘error’ or ‘error_at_line’ returns. The variable is
  4713. global and shared by all threads.
  4714. -- Variable: int error_one_per_line
  4715. The ‘error_one_per_line’ variable influences only ‘error_at_line’.
  4716. Normally the ‘error_at_line’ function creates output for every
  4717. invocation. If ‘error_one_per_line’ is set to a non-zero value
  4718. ‘error_at_line’ keeps track of the last file name and line number
  4719. for which an error was reported and avoids directly following
  4720. messages for the same file and line. This variable is global and
  4721. shared by all threads.
  4722. A program which read some input file and reports errors in it could look
  4723. like this:
  4724. {
  4725. char *line = NULL;
  4726. size_t len = 0;
  4727. unsigned int lineno = 0;
  4728. error_message_count = 0;
  4729. while (! feof_unlocked (fp))
  4730. {
  4731. ssize_t n = getline (&line, &len, fp);
  4732. if (n <= 0)
  4733. /* End of file or error. */
  4734. break;
  4735. ++lineno;
  4736. /* Process the line. */
  4737. if (Detect error in line)
  4738. error_at_line (0, errval, filename, lineno,
  4739. "some error text %s", some_variable);
  4740. }
  4741. if (error_message_count != 0)
  4742. error (EXIT_FAILURE, 0, "%u errors found", error_message_count);
  4743. }
  4744. ‘error’ and ‘error_at_line’ are clearly the functions of choice and
  4745. enable the programmer to write applications which follow the GNU coding
  4746. standard. The GNU C Library additionally contains functions which are
  4747. used in BSD for the same purpose. These functions are declared in
  4748. ‘err.h’. It is generally advised to not use these functions. They are
  4749. included only for compatibility.
  4750. -- Function: void warn (const char *FORMAT, …)
  4751. Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap i18n |
  4752. AC-Unsafe corrupt lock mem | *Note POSIX Safety Concepts::.
  4753. The ‘warn’ function is roughly equivalent to a call like
  4754. error (0, errno, format, the parameters)
  4755. except that the global variables ‘error’ respects and modifies are
  4756. not used.
  4757. -- Function: void vwarn (const char *FORMAT, va_list AP)
  4758. Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap i18n |
  4759. AC-Unsafe corrupt lock mem | *Note POSIX Safety Concepts::.
  4760. The ‘vwarn’ function is just like ‘warn’ except that the parameters
  4761. for the handling of the format string FORMAT are passed in as a
  4762. value of type ‘va_list’.
  4763. -- Function: void warnx (const char *FORMAT, …)
  4764. Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap | AC-Unsafe
  4765. corrupt lock mem | *Note POSIX Safety Concepts::.
  4766. The ‘warnx’ function is roughly equivalent to a call like
  4767. error (0, 0, format, the parameters)
  4768. except that the global variables ‘error’ respects and modifies are
  4769. not used. The difference to ‘warn’ is that no error number string
  4770. is printed.
  4771. -- Function: void vwarnx (const char *FORMAT, va_list AP)
  4772. Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap | AC-Unsafe
  4773. corrupt lock mem | *Note POSIX Safety Concepts::.
  4774. The ‘vwarnx’ function is just like ‘warnx’ except that the
  4775. parameters for the handling of the format string FORMAT are passed
  4776. in as a value of type ‘va_list’.
  4777. -- Function: void err (int STATUS, const char *FORMAT, …)
  4778. Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap i18n |
  4779. AC-Unsafe corrupt lock mem | *Note POSIX Safety Concepts::.
  4780. The ‘err’ function is roughly equivalent to a call like
  4781. error (status, errno, format, the parameters)
  4782. except that the global variables ‘error’ respects and modifies are
  4783. not used and that the program is exited even if STATUS is zero.
  4784. -- Function: void verr (int STATUS, const char *FORMAT, va_list AP)
  4785. Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap i18n |
  4786. AC-Unsafe corrupt lock mem | *Note POSIX Safety Concepts::.
  4787. The ‘verr’ function is just like ‘err’ except that the parameters
  4788. for the handling of the format string FORMAT are passed in as a
  4789. value of type ‘va_list’.
  4790. -- Function: void errx (int STATUS, const char *FORMAT, …)
  4791. Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap | AC-Unsafe
  4792. corrupt lock mem | *Note POSIX Safety Concepts::.
  4793. The ‘errx’ function is roughly equivalent to a call like
  4794. error (status, 0, format, the parameters)
  4795. except that the global variables ‘error’ respects and modifies are
  4796. not used and that the program is exited even if STATUS is zero.
  4797. The difference to ‘err’ is that no error number string is printed.
  4798. -- Function: void verrx (int STATUS, const char *FORMAT, va_list AP)
  4799. Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap | AC-Unsafe
  4800. corrupt lock mem | *Note POSIX Safety Concepts::.
  4801. The ‘verrx’ function is just like ‘errx’ except that the parameters
  4802. for the handling of the format string FORMAT are passed in as a
  4803. value of type ‘va_list’.
  4804. 
  4805. File: libc.info, Node: Memory, Next: Character Handling, Prev: Error Reporting, Up: Top
  4806. 3 Virtual Memory Allocation And Paging
  4807. **************************************
  4808. This chapter describes how processes manage and use memory in a system
  4809. that uses the GNU C Library.
  4810. The GNU C Library has several functions for dynamically allocating
  4811. virtual memory in various ways. They vary in generality and in
  4812. efficiency. The library also provides functions for controlling paging
  4813. and allocation of real memory.
  4814. * Menu:
  4815. * Memory Concepts:: An introduction to concepts and terminology.
  4816. * Memory Allocation:: Allocating storage for your program data
  4817. * Resizing the Data Segment:: ‘brk’, ‘sbrk’
  4818. * Locking Pages:: Preventing page faults
  4819. Memory mapped I/O is not discussed in this chapter. *Note
  4820. Memory-mapped I/O::.
  4821. 
  4822. File: libc.info, Node: Memory Concepts, Next: Memory Allocation, Up: Memory
  4823. 3.1 Process Memory Concepts
  4824. ===========================
  4825. One of the most basic resources a process has available to it is memory.
  4826. There are a lot of different ways systems organize memory, but in a
  4827. typical one, each process has one linear virtual address space, with
  4828. addresses running from zero to some huge maximum. It need not be
  4829. contiguous; i.e., not all of these addresses actually can be used to
  4830. store data.
  4831. The virtual memory is divided into pages (4 kilobytes is typical).
  4832. Backing each page of virtual memory is a page of real memory (called a
  4833. "frame") or some secondary storage, usually disk space. The disk space
  4834. might be swap space or just some ordinary disk file. Actually, a page
  4835. of all zeroes sometimes has nothing at all backing it – there’s just a
  4836. flag saying it is all zeroes.
  4837. The same frame of real memory or backing store can back multiple
  4838. virtual pages belonging to multiple processes. This is normally the
  4839. case, for example, with virtual memory occupied by GNU C Library code.
  4840. The same real memory frame containing the ‘printf’ function backs a
  4841. virtual memory page in each of the existing processes that has a
  4842. ‘printf’ call in its program.
  4843. In order for a program to access any part of a virtual page, the page
  4844. must at that moment be backed by (“connected to”) a real frame. But
  4845. because there is usually a lot more virtual memory than real memory, the
  4846. pages must move back and forth between real memory and backing store
  4847. regularly, coming into real memory when a process needs to access them
  4848. and then retreating to backing store when not needed anymore. This
  4849. movement is called "paging".
  4850. When a program attempts to access a page which is not at that moment
  4851. backed by real memory, this is known as a "page fault". When a page
  4852. fault occurs, the kernel suspends the process, places the page into a
  4853. real page frame (this is called “paging in” or “faulting in”), then
  4854. resumes the process so that from the process’ point of view, the page
  4855. was in real memory all along. In fact, to the process, all pages always
  4856. seem to be in real memory. Except for one thing: the elapsed execution
  4857. time of an instruction that would normally be a few nanoseconds is
  4858. suddenly much, much, longer (because the kernel normally has to do I/O
  4859. to complete the page-in). For programs sensitive to that, the functions
  4860. described in *note Locking Pages:: can control it.
  4861. Within each virtual address space, a process has to keep track of
  4862. what is at which addresses, and that process is called memory
  4863. allocation. Allocation usually brings to mind meting out scarce
  4864. resources, but in the case of virtual memory, that’s not a major goal,
  4865. because there is generally much more of it than anyone needs. Memory
  4866. allocation within a process is mainly just a matter of making sure that
  4867. the same byte of memory isn’t used to store two different things.
  4868. Processes allocate memory in two major ways: by exec and
  4869. programmatically. Actually, forking is a third way, but it’s not very
  4870. interesting. *Note Creating a Process::.
  4871. Exec is the operation of creating a virtual address space for a
  4872. process, loading its basic program into it, and executing the program.
  4873. It is done by the “exec” family of functions (e.g. ‘execl’). The
  4874. operation takes a program file (an executable), it allocates space to
  4875. load all the data in the executable, loads it, and transfers control to
  4876. it. That data is most notably the instructions of the program (the
  4877. "text"), but also literals and constants in the program and even some
  4878. variables: C variables with the static storage class (*note Memory
  4879. Allocation and C::).
  4880. Once that program begins to execute, it uses programmatic allocation
  4881. to gain additional memory. In a C program with the GNU C Library, there
  4882. are two kinds of programmatic allocation: automatic and dynamic. *Note
  4883. Memory Allocation and C::.
  4884. Memory-mapped I/O is another form of dynamic virtual memory
  4885. allocation. Mapping memory to a file means declaring that the contents
  4886. of certain range of a process’ addresses shall be identical to the
  4887. contents of a specified regular file. The system makes the virtual
  4888. memory initially contain the contents of the file, and if you modify the
  4889. memory, the system writes the same modification to the file. Note that
  4890. due to the magic of virtual memory and page faults, there is no reason
  4891. for the system to do I/O to read the file, or allocate real memory for
  4892. its contents, until the program accesses the virtual memory. *Note
  4893. Memory-mapped I/O::.
  4894. Just as it programmatically allocates memory, the program can
  4895. programmatically deallocate ("free") it. You can’t free the memory that
  4896. was allocated by exec. When the program exits or execs, you might say
  4897. that all its memory gets freed, but since in both cases the address
  4898. space ceases to exist, the point is really moot. *Note Program
  4899. Termination::.
  4900. A process’ virtual address space is divided into segments. A segment
  4901. is a contiguous range of virtual addresses. Three important segments
  4902. are:
  4903. The "text segment" contains a program’s instructions and literals
  4904. and static constants. It is allocated by exec and stays the same
  4905. size for the life of the virtual address space.
  4906. • The "data segment" is working storage for the program. It can be
  4907. preallocated and preloaded by exec and the process can extend or
  4908. shrink it by calling functions as described in *Note Resizing the
  4909. Data Segment::. Its lower end is fixed.
  4910. • The "stack segment" contains a program stack. It grows as the
  4911. stack grows, but doesn’t shrink when the stack shrinks.
  4912. 
  4913. File: libc.info, Node: Memory Allocation, Next: Resizing the Data Segment, Prev: Memory Concepts, Up: Memory
  4914. 3.2 Allocating Storage For Program Data
  4915. =======================================
  4916. This section covers how ordinary programs manage storage for their data,
  4917. including the famous ‘malloc’ function and some fancier facilities
  4918. special to the GNU C Library and GNU Compiler.
  4919. * Menu:
  4920. * Memory Allocation and C:: How to get different kinds of allocation in C.
  4921. * The GNU Allocator:: An overview of the GNU ‘malloc’
  4922. implementation.
  4923. * Unconstrained Allocation:: The ‘malloc’ facility allows fully general
  4924. dynamic allocation.
  4925. * Allocation Debugging:: Finding memory leaks and not freed memory.
  4926. * Obstacks:: Obstacks are less general than malloc
  4927. but more efficient and convenient.
  4928. * Variable Size Automatic:: Allocation of variable-sized blocks
  4929. of automatic storage that are freed when the
  4930. calling function returns.
  4931. 
  4932. File: libc.info, Node: Memory Allocation and C, Next: The GNU Allocator, Up: Memory Allocation
  4933. 3.2.1 Memory Allocation in C Programs
  4934. -------------------------------------
  4935. The C language supports two kinds of memory allocation through the
  4936. variables in C programs:
  4937. • "Static allocation" is what happens when you declare a static or
  4938. global variable. Each static or global variable defines one block
  4939. of space, of a fixed size. The space is allocated once, when your
  4940. program is started (part of the exec operation), and is never
  4941. freed.
  4942. • "Automatic allocation" happens when you declare an automatic
  4943. variable, such as a function argument or a local variable. The
  4944. space for an automatic variable is allocated when the compound
  4945. statement containing the declaration is entered, and is freed when
  4946. that compound statement is exited.
  4947. In GNU C, the size of the automatic storage can be an expression
  4948. that varies. In other C implementations, it must be a constant.
  4949. A third important kind of memory allocation, "dynamic allocation", is
  4950. not supported by C variables but is available via GNU C Library
  4951. functions.
  4952. 3.2.1.1 Dynamic Memory Allocation
  4953. .................................
  4954. "Dynamic memory allocation" is a technique in which programs determine
  4955. as they are running where to store some information. You need dynamic
  4956. allocation when the amount of memory you need, or how long you continue
  4957. to need it, depends on factors that are not known before the program
  4958. runs.
  4959. For example, you may need a block to store a line read from an input
  4960. file; since there is no limit to how long a line can be, you must
  4961. allocate the memory dynamically and make it dynamically larger as you
  4962. read more of the line.
  4963. Or, you may need a block for each record or each definition in the
  4964. input data; since you can’t know in advance how many there will be, you
  4965. must allocate a new block for each record or definition as you read it.
  4966. When you use dynamic allocation, the allocation of a block of memory
  4967. is an action that the program requests explicitly. You call a function
  4968. or macro when you want to allocate space, and specify the size with an
  4969. argument. If you want to free the space, you do so by calling another
  4970. function or macro. You can do these things whenever you want, as often
  4971. as you want.
  4972. Dynamic allocation is not supported by C variables; there is no
  4973. storage class “dynamic”, and there can never be a C variable whose value
  4974. is stored in dynamically allocated space. The only way to get
  4975. dynamically allocated memory is via a system call (which is generally
  4976. via a GNU C Library function call), and the only way to refer to
  4977. dynamically allocated space is through a pointer. Because it is less
  4978. convenient, and because the actual process of dynamic allocation
  4979. requires more computation time, programmers generally use dynamic
  4980. allocation only when neither static nor automatic allocation will serve.
  4981. For example, if you want to allocate dynamically some space to hold a
  4982. ‘struct foobar’, you cannot declare a variable of type ‘struct foobar’
  4983. whose contents are the dynamically allocated space. But you can declare
  4984. a variable of pointer type ‘struct foobar *’ and assign it the address
  4985. of the space. Then you can use the operators ‘*’ and ‘->’ on this
  4986. pointer variable to refer to the contents of the space:
  4987. {
  4988. struct foobar *ptr
  4989. = (struct foobar *) malloc (sizeof (struct foobar));
  4990. ptr->name = x;
  4991. ptr->next = current_foobar;
  4992. current_foobar = ptr;
  4993. }
  4994. 
  4995. File: libc.info, Node: The GNU Allocator, Next: Unconstrained Allocation, Prev: Memory Allocation and C, Up: Memory Allocation
  4996. 3.2.2 The GNU Allocator
  4997. -----------------------
  4998. The ‘malloc’ implementation in the GNU C Library is derived from
  4999. ptmalloc (pthreads malloc), which in turn is derived from dlmalloc (Doug
  5000. Lea malloc). This malloc may allocate memory in two different ways
  5001. depending on their size and certain parameters that may be controlled by
  5002. users. The most common way is to allocate portions of memory (called
  5003. chunks) from a large contiguous area of memory and manage these areas to
  5004. optimize their use and reduce wastage in the form of unusable chunks.
  5005. Traditionally the system heap was set up to be the one large memory area
  5006. but the GNU C Library ‘malloc’ implementation maintains multiple such
  5007. areas to optimize their use in multi-threaded applications. Each such
  5008. area is internally referred to as an "arena".
  5009. As opposed to other versions, the ‘malloc’ in the GNU C Library does
  5010. not round up chunk sizes to powers of two, neither for large nor for
  5011. small sizes. Neighboring chunks can be coalesced on a ‘free’ no matter
  5012. what their size is. This makes the implementation suitable for all
  5013. kinds of allocation patterns without generally incurring high memory
  5014. waste through fragmentation. The presence of multiple arenas allows
  5015. multiple threads to allocate memory simultaneously in separate arenas,
  5016. thus improving performance.
  5017. The other way of memory allocation is for very large blocks, i.e.
  5018. much larger than a page. These requests are allocated with ‘mmap’
  5019. (anonymous or via ‘/dev/zero’; *note Memory-mapped I/O::)). This has
  5020. the great advantage that these chunks are returned to the system
  5021. immediately when they are freed. Therefore, it cannot happen that a
  5022. large chunk becomes “locked” in between smaller ones and even after
  5023. calling ‘free’ wastes memory. The size threshold for ‘mmap’ to be used
  5024. is dynamic and gets adjusted according to allocation patterns of the
  5025. program. ‘mallopt’ can be used to statically adjust the threshold using
  5026. ‘M_MMAP_THRESHOLD’ and the use of ‘mmap’ can be disabled completely with
  5027. ‘M_MMAP_MAX’; *note Malloc Tunable Parameters::.
  5028. A more detailed technical description of the GNU Allocator is
  5029. maintained in the GNU C Library wiki. See
  5030. <https://sourceware.org/glibc/wiki/MallocInternals>.
  5031. 
  5032. File: libc.info, Node: Unconstrained Allocation, Next: Allocation Debugging, Prev: The GNU Allocator, Up: Memory Allocation
  5033. 3.2.3 Unconstrained Allocation
  5034. ------------------------------
  5035. The most general dynamic allocation facility is ‘malloc’. It allows you
  5036. to allocate blocks of memory of any size at any time, make them bigger
  5037. or smaller at any time, and free the blocks individually at any time (or
  5038. never).
  5039. * Menu:
  5040. * Basic Allocation:: Simple use of ‘malloc’.
  5041. * Malloc Examples:: Examples of ‘malloc’. ‘xmalloc’.
  5042. * Freeing after Malloc:: Use ‘free’ to free a block you
  5043. got with ‘malloc’.
  5044. * Changing Block Size:: Use ‘realloc’ to make a block
  5045. bigger or smaller.
  5046. * Allocating Cleared Space:: Use ‘calloc’ to allocate a
  5047. block and clear it.
  5048. * Aligned Memory Blocks:: Allocating specially aligned memory.
  5049. * Malloc Tunable Parameters:: Use ‘mallopt’ to adjust allocation
  5050. parameters.
  5051. * Heap Consistency Checking:: Automatic checking for errors.
  5052. * Hooks for Malloc:: You can use these hooks for debugging
  5053. programs that use ‘malloc’.
  5054. * Statistics of Malloc:: Getting information about how much
  5055. memory your program is using.
  5056. * Summary of Malloc:: Summary of ‘malloc’ and related functions.
  5057. 
  5058. File: libc.info, Node: Basic Allocation, Next: Malloc Examples, Up: Unconstrained Allocation
  5059. 3.2.3.1 Basic Memory Allocation
  5060. ...............................
  5061. To allocate a block of memory, call ‘malloc’. The prototype for this
  5062. function is in ‘stdlib.h’.
  5063. -- Function: void * malloc (size_t SIZE)
  5064. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock fd mem |
  5065. *Note POSIX Safety Concepts::.
  5066. This function returns a pointer to a newly allocated block SIZE
  5067. bytes long, or a null pointer if the block could not be allocated.
  5068. The contents of the block are undefined; you must initialize it
  5069. yourself (or use ‘calloc’ instead; *note Allocating Cleared Space::).
  5070. Normally you would cast the value as a pointer to the kind of object
  5071. that you want to store in the block. Here we show an example of doing
  5072. so, and of initializing the space with zeros using the library function
  5073. ‘memset’ (*note Copying Strings and Arrays::):
  5074. struct foo *ptr;
  5075. ptr = (struct foo *) malloc (sizeof (struct foo));
  5076. if (ptr == 0) abort ();
  5077. memset (ptr, 0, sizeof (struct foo));
  5078. You can store the result of ‘malloc’ into any pointer variable
  5079. without a cast, because ISO C automatically converts the type ‘void *’
  5080. to another type of pointer when necessary. But the cast is necessary in
  5081. contexts other than assignment operators or if you might want your code
  5082. to run in traditional C.
  5083. Remember that when allocating space for a string, the argument to
  5084. ‘malloc’ must be one plus the length of the string. This is because a
  5085. string is terminated with a null character that doesn’t count in the
  5086. “length” of the string but does need space. For example:
  5087. char *ptr;
  5088. ptr = (char *) malloc (length + 1);
  5089. *Note Representation of Strings::, for more information about this.
  5090. 
  5091. File: libc.info, Node: Malloc Examples, Next: Freeing after Malloc, Prev: Basic Allocation, Up: Unconstrained Allocation
  5092. 3.2.3.2 Examples of ‘malloc’
  5093. ............................
  5094. If no more space is available, ‘malloc’ returns a null pointer. You
  5095. should check the value of _every_ call to ‘malloc’. It is useful to
  5096. write a subroutine that calls ‘malloc’ and reports an error if the value
  5097. is a null pointer, returning only if the value is nonzero. This
  5098. function is conventionally called ‘xmalloc’. Here it is:
  5099. void *
  5100. xmalloc (size_t size)
  5101. {
  5102. void *value = malloc (size);
  5103. if (value == 0)
  5104. fatal ("virtual memory exhausted");
  5105. return value;
  5106. }
  5107. Here is a real example of using ‘malloc’ (by way of ‘xmalloc’). The
  5108. function ‘savestring’ will copy a sequence of characters into a newly
  5109. allocated null-terminated string:
  5110. char *
  5111. savestring (const char *ptr, size_t len)
  5112. {
  5113. char *value = (char *) xmalloc (len + 1);
  5114. value[len] = '\0';
  5115. return (char *) memcpy (value, ptr, len);
  5116. }
  5117. The block that ‘malloc’ gives you is guaranteed to be aligned so that
  5118. it can hold any type of data. On GNU systems, the address is always a
  5119. multiple of eight on 32-bit systems, and a multiple of 16 on 64-bit
  5120. systems. Only rarely is any higher boundary (such as a page boundary)
  5121. necessary; for those cases, use ‘aligned_alloc’ or ‘posix_memalign’
  5122. (*note Aligned Memory Blocks::).
  5123. Note that the memory located after the end of the block is likely to
  5124. be in use for something else; perhaps a block already allocated by
  5125. another call to ‘malloc’. If you attempt to treat the block as longer
  5126. than you asked for it to be, you are liable to destroy the data that
  5127. ‘malloc’ uses to keep track of its blocks, or you may destroy the
  5128. contents of another block. If you have already allocated a block and
  5129. discover you want it to be bigger, use ‘realloc’ (*note Changing Block
  5130. Size::).
  5131. 
  5132. File: libc.info, Node: Freeing after Malloc, Next: Changing Block Size, Prev: Malloc Examples, Up: Unconstrained Allocation
  5133. 3.2.3.3 Freeing Memory Allocated with ‘malloc’
  5134. ..............................................
  5135. When you no longer need a block that you got with ‘malloc’, use the
  5136. function ‘free’ to make the block available to be allocated again. The
  5137. prototype for this function is in ‘stdlib.h’.
  5138. -- Function: void free (void *PTR)
  5139. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock fd mem |
  5140. *Note POSIX Safety Concepts::.
  5141. The ‘free’ function deallocates the block of memory pointed at by
  5142. PTR.
  5143. -- Function: void cfree (void *PTR)
  5144. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock fd mem |
  5145. *Note POSIX Safety Concepts::.
  5146. This function does the same thing as ‘free’. It’s provided for
  5147. backward compatibility with SunOS; you should use ‘free’ instead.
  5148. Freeing a block alters the contents of the block. *Do not expect to
  5149. find any data (such as a pointer to the next block in a chain of blocks)
  5150. in the block after freeing it.* Copy whatever you need out of the block
  5151. before freeing it! Here is an example of the proper way to free all the
  5152. blocks in a chain, and the strings that they point to:
  5153. struct chain
  5154. {
  5155. struct chain *next;
  5156. char *name;
  5157. }
  5158. void
  5159. free_chain (struct chain *chain)
  5160. {
  5161. while (chain != 0)
  5162. {
  5163. struct chain *next = chain->next;
  5164. free (chain->name);
  5165. free (chain);
  5166. chain = next;
  5167. }
  5168. }
  5169. Occasionally, ‘free’ can actually return memory to the operating
  5170. system and make the process smaller. Usually, all it can do is allow a
  5171. later call to ‘malloc’ to reuse the space. In the meantime, the space
  5172. remains in your program as part of a free-list used internally by
  5173. ‘malloc’.
  5174. There is no point in freeing blocks at the end of a program, because
  5175. all of the program’s space is given back to the system when the process
  5176. terminates.
  5177. 
  5178. File: libc.info, Node: Changing Block Size, Next: Allocating Cleared Space, Prev: Freeing after Malloc, Up: Unconstrained Allocation
  5179. 3.2.3.4 Changing the Size of a Block
  5180. ....................................
  5181. Often you do not know for certain how big a block you will ultimately
  5182. need at the time you must begin to use the block. For example, the
  5183. block might be a buffer that you use to hold a line being read from a
  5184. file; no matter how long you make the buffer initially, you may
  5185. encounter a line that is longer.
  5186. You can make the block longer by calling ‘realloc’. This function is
  5187. declared in ‘stdlib.h’.
  5188. -- Function: void * realloc (void *PTR, size_t NEWSIZE)
  5189. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock fd mem |
  5190. *Note POSIX Safety Concepts::.
  5191. The ‘realloc’ function changes the size of the block whose address
  5192. is PTR to be NEWSIZE.
  5193. Since the space after the end of the block may be in use, ‘realloc’
  5194. may find it necessary to copy the block to a new address where more
  5195. free space is available. The value of ‘realloc’ is the new address
  5196. of the block. If the block needs to be moved, ‘realloc’ copies the
  5197. old contents.
  5198. If you pass a null pointer for PTR, ‘realloc’ behaves just like
  5199. ‘malloc (NEWSIZE)’. This can be convenient, but beware that older
  5200. implementations (before ISO C) may not support this behavior, and
  5201. will probably crash when ‘realloc’ is passed a null pointer.
  5202. Like ‘malloc’, ‘realloc’ may return a null pointer if no memory space
  5203. is available to make the block bigger. When this happens, the original
  5204. block is untouched; it has not been modified or relocated.
  5205. In most cases it makes no difference what happens to the original
  5206. block when ‘realloc’ fails, because the application program cannot
  5207. continue when it is out of memory, and the only thing to do is to give a
  5208. fatal error message. Often it is convenient to write and use a
  5209. subroutine, conventionally called ‘xrealloc’, that takes care of the
  5210. error message as ‘xmalloc’ does for ‘malloc’:
  5211. void *
  5212. xrealloc (void *ptr, size_t size)
  5213. {
  5214. void *value = realloc (ptr, size);
  5215. if (value == 0)
  5216. fatal ("Virtual memory exhausted");
  5217. return value;
  5218. }
  5219. You can also use ‘realloc’ to make a block smaller. The reason you
  5220. would do this is to avoid tying up a lot of memory space when only a
  5221. little is needed. In several allocation implementations, making a block
  5222. smaller sometimes necessitates copying it, so it can fail if no other
  5223. space is available.
  5224. If the new size you specify is the same as the old size, ‘realloc’ is
  5225. guaranteed to change nothing and return the same address that you gave.
  5226. 
  5227. File: libc.info, Node: Allocating Cleared Space, Next: Aligned Memory Blocks, Prev: Changing Block Size, Up: Unconstrained Allocation
  5228. 3.2.3.5 Allocating Cleared Space
  5229. ................................
  5230. The function ‘calloc’ allocates memory and clears it to zero. It is
  5231. declared in ‘stdlib.h’.
  5232. -- Function: void * calloc (size_t COUNT, size_t ELTSIZE)
  5233. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock fd mem |
  5234. *Note POSIX Safety Concepts::.
  5235. This function allocates a block long enough to contain a vector of
  5236. COUNT elements, each of size ELTSIZE. Its contents are cleared to
  5237. zero before ‘calloc’ returns.
  5238. You could define ‘calloc’ as follows:
  5239. void *
  5240. calloc (size_t count, size_t eltsize)
  5241. {
  5242. size_t size = count * eltsize;
  5243. void *value = malloc (size);
  5244. if (value != 0)
  5245. memset (value, 0, size);
  5246. return value;
  5247. }
  5248. But in general, it is not guaranteed that ‘calloc’ calls ‘malloc’
  5249. internally. Therefore, if an application provides its own
  5250. ‘malloc’/‘realloc’/‘free’ outside the C library, it should always define
  5251. ‘calloc’, too.
  5252. 
  5253. File: libc.info, Node: Aligned Memory Blocks, Next: Malloc Tunable Parameters, Prev: Allocating Cleared Space, Up: Unconstrained Allocation
  5254. 3.2.3.6 Allocating Aligned Memory Blocks
  5255. ........................................
  5256. The address of a block returned by ‘malloc’ or ‘realloc’ in GNU systems
  5257. is always a multiple of eight (or sixteen on 64-bit systems). If you
  5258. need a block whose address is a multiple of a higher power of two than
  5259. that, use ‘aligned_alloc’ or ‘posix_memalign’. ‘aligned_alloc’ and
  5260. ‘posix_memalign’ are declared in ‘stdlib.h’.
  5261. -- Function: void * aligned_alloc (size_t ALIGNMENT, size_t SIZE)
  5262. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock fd mem |
  5263. *Note POSIX Safety Concepts::.
  5264. The ‘aligned_alloc’ function allocates a block of SIZE bytes whose
  5265. address is a multiple of ALIGNMENT. The ALIGNMENT must be a power
  5266. of two and SIZE must be a multiple of ALIGNMENT.
  5267. The ‘aligned_alloc’ function returns a null pointer on error and
  5268. sets ‘errno’ to one of the following values:
  5269. ‘ENOMEM’
  5270. There was insufficient memory available to satisfy the
  5271. request.
  5272. ‘EINVAL’
  5273. ALIGNMENT is not a power of two.
  5274. This function was introduced in ISO C11 and hence may have
  5275. better portability to modern non-POSIX systems than
  5276. ‘posix_memalign’.
  5277. -- Function: void * memalign (size_t BOUNDARY, size_t SIZE)
  5278. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock fd mem |
  5279. *Note POSIX Safety Concepts::.
  5280. The ‘memalign’ function allocates a block of SIZE bytes whose
  5281. address is a multiple of BOUNDARY. The BOUNDARY must be a power of
  5282. two! The function ‘memalign’ works by allocating a somewhat larger
  5283. block, and then returning an address within the block that is on
  5284. the specified boundary.
  5285. The ‘memalign’ function returns a null pointer on error and sets
  5286. ‘errno’ to one of the following values:
  5287. ‘ENOMEM’
  5288. There was insufficient memory available to satisfy the
  5289. request.
  5290. ‘EINVAL’
  5291. BOUNDARY is not a power of two.
  5292. The ‘memalign’ function is obsolete and ‘aligned_alloc’ or
  5293. ‘posix_memalign’ should be used instead.
  5294. -- Function: int posix_memalign (void **MEMPTR, size_t ALIGNMENT,
  5295. size_t SIZE)
  5296. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock fd mem |
  5297. *Note POSIX Safety Concepts::.
  5298. The ‘posix_memalign’ function is similar to the ‘memalign’ function
  5299. in that it returns a buffer of SIZE bytes aligned to a multiple of
  5300. ALIGNMENT. But it adds one requirement to the parameter ALIGNMENT:
  5301. the value must be a power of two multiple of ‘sizeof (void *)’.
  5302. If the function succeeds in allocation memory a pointer to the
  5303. allocated memory is returned in ‘*MEMPTR’ and the return value is
  5304. zero. Otherwise the function returns an error value indicating the
  5305. problem. The possible error values returned are:
  5306. ‘ENOMEM’
  5307. There was insufficient memory available to satisfy the
  5308. request.
  5309. ‘EINVAL’
  5310. ALIGNMENT is not a power of two multiple of ‘sizeof (void *)’.
  5311. This function was introduced in POSIX 1003.1d. Although this
  5312. function is superseded by ‘aligned_alloc’, it is more portable to
  5313. older POSIX systems that do not support ISO C11.
  5314. -- Function: void * valloc (size_t SIZE)
  5315. Preliminary: | MT-Unsafe init | AS-Unsafe init lock | AC-Unsafe
  5316. init lock fd mem | *Note POSIX Safety Concepts::.
  5317. Using ‘valloc’ is like using ‘memalign’ and passing the page size
  5318. as the value of the first argument. It is implemented like this:
  5319. void *
  5320. valloc (size_t size)
  5321. {
  5322. return memalign (getpagesize (), size);
  5323. }
  5324. *note Query Memory Parameters:: for more information about the
  5325. memory subsystem.
  5326. The ‘valloc’ function is obsolete and ‘aligned_alloc’ or
  5327. ‘posix_memalign’ should be used instead.
  5328. 
  5329. File: libc.info, Node: Malloc Tunable Parameters, Next: Heap Consistency Checking, Prev: Aligned Memory Blocks, Up: Unconstrained Allocation
  5330. 3.2.3.7 Malloc Tunable Parameters
  5331. .................................
  5332. You can adjust some parameters for dynamic memory allocation with the
  5333. ‘mallopt’ function. This function is the general SVID/XPG interface,
  5334. defined in ‘malloc.h’.
  5335. -- Function: int mallopt (int PARAM, int VALUE)
  5336. Preliminary: | MT-Unsafe init const:mallopt | AS-Unsafe init lock |
  5337. AC-Unsafe init lock | *Note POSIX Safety Concepts::.
  5338. When calling ‘mallopt’, the PARAM argument specifies the parameter
  5339. to be set, and VALUE the new value to be set. Possible choices for
  5340. PARAM, as defined in ‘malloc.h’, are:
  5341. ‘M_MMAP_MAX’
  5342. The maximum number of chunks to allocate with ‘mmap’. Setting
  5343. this to zero disables all use of ‘mmap’.
  5344. The default value of this parameter is ‘65536’.
  5345. This parameter can also be set for the process at startup by
  5346. setting the environment variable ‘MALLOC_MMAP_MAX_’ to the
  5347. desired value.
  5348. ‘M_MMAP_THRESHOLD’
  5349. All chunks larger than this value are allocated outside the
  5350. normal heap, using the ‘mmap’ system call. This way it is
  5351. guaranteed that the memory for these chunks can be returned to
  5352. the system on ‘free’. Note that requests smaller than this
  5353. threshold might still be allocated via ‘mmap’.
  5354. If this parameter is not set, the default value is set as 128
  5355. KiB and the threshold is adjusted dynamically to suit the
  5356. allocation patterns of the program. If the parameter is set,
  5357. the dynamic adjustment is disabled and the value is set
  5358. statically to the input value.
  5359. This parameter can also be set for the process at startup by
  5360. setting the environment variable ‘MALLOC_MMAP_THRESHOLD_’ to
  5361. the desired value.
  5362. ‘M_PERTURB’
  5363. If non-zero, memory blocks are filled with values depending on
  5364. some low order bits of this parameter when they are allocated
  5365. (except when allocated by ‘calloc’) and freed. This can be
  5366. used to debug the use of uninitialized or freed heap memory.
  5367. Note that this option does not guarantee that the freed block
  5368. will have any specific values. It only guarantees that the
  5369. content the block had before it was freed will be overwritten.
  5370. The default value of this parameter is ‘0’.
  5371. This parameter can also be set for the process at startup by
  5372. setting the environment variable ‘MALLOC_MMAP_PERTURB_’ to the
  5373. desired value.
  5374. ‘M_TOP_PAD’
  5375. This parameter determines the amount of extra memory to obtain
  5376. from the system when an arena needs to be extended. It also
  5377. specifies the number of bytes to retain when shrinking an
  5378. arena. This provides the necessary hysteresis in heap size
  5379. such that excessive amounts of system calls can be avoided.
  5380. The default value of this parameter is ‘0’.
  5381. This parameter can also be set for the process at startup by
  5382. setting the environment variable ‘MALLOC_TOP_PAD_’ to the
  5383. desired value.
  5384. ‘M_TRIM_THRESHOLD’
  5385. This is the minimum size (in bytes) of the top-most,
  5386. releasable chunk that will trigger a system call in order to
  5387. return memory to the system.
  5388. If this parameter is not set, the default value is set as 128
  5389. KiB and the threshold is adjusted dynamically to suit the
  5390. allocation patterns of the program. If the parameter is set,
  5391. the dynamic adjustment is disabled and the value is set
  5392. statically to the provided input.
  5393. This parameter can also be set for the process at startup by
  5394. setting the environment variable ‘MALLOC_TRIM_THRESHOLD_’ to
  5395. the desired value.
  5396. ‘M_ARENA_TEST’
  5397. This parameter specifies the number of arenas that can be
  5398. created before the test on the limit to the number of arenas
  5399. is conducted. The value is ignored if ‘M_ARENA_MAX’ is set.
  5400. The default value of this parameter is 2 on 32-bit systems and
  5401. 8 on 64-bit systems.
  5402. This parameter can also be set for the process at startup by
  5403. setting the environment variable ‘MALLOC_ARENA_TEST’ to the
  5404. desired value.
  5405. ‘M_ARENA_MAX’
  5406. This parameter sets the number of arenas to use regardless of
  5407. the number of cores in the system.
  5408. The default value of this tunable is ‘0’, meaning that the
  5409. limit on the number of arenas is determined by the number of
  5410. CPU cores online. For 32-bit systems the limit is twice the
  5411. number of cores online and on 64-bit systems, it is eight
  5412. times the number of cores online. Note that the default value
  5413. is not derived from the default value of M_ARENA_TEST and is
  5414. computed independently.
  5415. This parameter can also be set for the process at startup by
  5416. setting the environment variable ‘MALLOC_ARENA_MAX’ to the
  5417. desired value.
  5418. 
  5419. File: libc.info, Node: Heap Consistency Checking, Next: Hooks for Malloc, Prev: Malloc Tunable Parameters, Up: Unconstrained Allocation
  5420. 3.2.3.8 Heap Consistency Checking
  5421. .................................
  5422. You can ask ‘malloc’ to check the consistency of dynamic memory by using
  5423. the ‘mcheck’ function. This function is a GNU extension, declared in
  5424. ‘mcheck.h’.
  5425. -- Function: int mcheck (void (*ABORTFN) (enum mcheck_status STATUS))
  5426. Preliminary: | MT-Unsafe race:mcheck const:malloc_hooks | AS-Unsafe
  5427. corrupt | AC-Unsafe corrupt | *Note POSIX Safety Concepts::.
  5428. Calling ‘mcheck’ tells ‘malloc’ to perform occasional consistency
  5429. checks. These will catch things such as writing past the end of a
  5430. block that was allocated with ‘malloc’.
  5431. The ABORTFN argument is the function to call when an inconsistency
  5432. is found. If you supply a null pointer, then ‘mcheck’ uses a
  5433. default function which prints a message and calls ‘abort’ (*note
  5434. Aborting a Program::). The function you supply is called with one
  5435. argument, which says what sort of inconsistency was detected; its
  5436. type is described below.
  5437. It is too late to begin allocation checking once you have allocated
  5438. anything with ‘malloc’. So ‘mcheck’ does nothing in that case.
  5439. The function returns ‘-1’ if you call it too late, and ‘0’
  5440. otherwise (when it is successful).
  5441. The easiest way to arrange to call ‘mcheck’ early enough is to use
  5442. the option ‘-lmcheck’ when you link your program; then you don’t
  5443. need to modify your program source at all. Alternatively you might
  5444. use a debugger to insert a call to ‘mcheck’ whenever the program is
  5445. started, for example these gdb commands will automatically call
  5446. ‘mcheck’ whenever the program starts:
  5447. (gdb) break main
  5448. Breakpoint 1, main (argc=2, argv=0xbffff964) at whatever.c:10
  5449. (gdb) command 1
  5450. Type commands for when breakpoint 1 is hit, one per line.
  5451. End with a line saying just "end".
  5452. >call mcheck(0)
  5453. >continue
  5454. >end
  5455. (gdb) …
  5456. This will however only work if no initialization function of any
  5457. object involved calls any of the ‘malloc’ functions since ‘mcheck’
  5458. must be called before the first such function.
  5459. -- Function: enum mcheck_status mprobe (void *POINTER)
  5460. Preliminary: | MT-Unsafe race:mcheck const:malloc_hooks | AS-Unsafe
  5461. corrupt | AC-Unsafe corrupt | *Note POSIX Safety Concepts::.
  5462. The ‘mprobe’ function lets you explicitly check for inconsistencies
  5463. in a particular allocated block. You must have already called
  5464. ‘mcheck’ at the beginning of the program, to do its occasional
  5465. checks; calling ‘mprobe’ requests an additional consistency check
  5466. to be done at the time of the call.
  5467. The argument POINTER must be a pointer returned by ‘malloc’ or
  5468. ‘realloc’. ‘mprobe’ returns a value that says what inconsistency,
  5469. if any, was found. The values are described below.
  5470. -- Data Type: enum mcheck_status
  5471. This enumerated type describes what kind of inconsistency was
  5472. detected in an allocated block, if any. Here are the possible
  5473. values:
  5474. ‘MCHECK_DISABLED’
  5475. ‘mcheck’ was not called before the first allocation. No
  5476. consistency checking can be done.
  5477. ‘MCHECK_OK’
  5478. No inconsistency detected.
  5479. ‘MCHECK_HEAD’
  5480. The data immediately before the block was modified. This
  5481. commonly happens when an array index or pointer is decremented
  5482. too far.
  5483. ‘MCHECK_TAIL’
  5484. The data immediately after the block was modified. This
  5485. commonly happens when an array index or pointer is incremented
  5486. too far.
  5487. ‘MCHECK_FREE’
  5488. The block was already freed.
  5489. Another possibility to check for and guard against bugs in the use of
  5490. ‘malloc’, ‘realloc’ and ‘free’ is to set the environment variable
  5491. ‘MALLOC_CHECK_’. When ‘MALLOC_CHECK_’ is set, a special (less
  5492. efficient) implementation is used which is designed to be tolerant
  5493. against simple errors, such as double calls of ‘free’ with the same
  5494. argument, or overruns of a single byte (off-by-one bugs). Not all such
  5495. errors can be protected against, however, and memory leaks can result.
  5496. If ‘MALLOC_CHECK_’ is set to ‘0’, any detected heap corruption is
  5497. silently ignored; if set to ‘1’, a diagnostic is printed on ‘stderr’; if
  5498. set to ‘2’, ‘abort’ is called immediately. This can be useful because
  5499. otherwise a crash may happen much later, and the true cause for the
  5500. problem is then very hard to track down.
  5501. There is one problem with ‘MALLOC_CHECK_’: in SUID or SGID binaries
  5502. it could possibly be exploited since diverging from the normal programs
  5503. behavior it now writes something to the standard error descriptor.
  5504. Therefore the use of ‘MALLOC_CHECK_’ is disabled by default for SUID and
  5505. SGID binaries. It can be enabled again by the system administrator by
  5506. adding a file ‘/etc/suid-debug’ (the content is not important it could
  5507. be empty).
  5508. So, what’s the difference between using ‘MALLOC_CHECK_’ and linking
  5509. with ‘-lmcheck’? ‘MALLOC_CHECK_’ is orthogonal with respect to
  5510. ‘-lmcheck’. ‘-lmcheck’ has been added for backward compatibility. Both
  5511. ‘MALLOC_CHECK_’ and ‘-lmcheck’ should uncover the same bugs - but using
  5512. ‘MALLOC_CHECK_’ you don’t need to recompile your application.
  5513. 
  5514. File: libc.info, Node: Hooks for Malloc, Next: Statistics of Malloc, Prev: Heap Consistency Checking, Up: Unconstrained Allocation
  5515. 3.2.3.9 Memory Allocation Hooks
  5516. ...............................
  5517. The GNU C Library lets you modify the behavior of ‘malloc’, ‘realloc’,
  5518. and ‘free’ by specifying appropriate hook functions. You can use these
  5519. hooks to help you debug programs that use dynamic memory allocation, for
  5520. example.
  5521. The hook variables are declared in ‘malloc.h’.
  5522. -- Variable: __malloc_hook
  5523. The value of this variable is a pointer to the function that
  5524. ‘malloc’ uses whenever it is called. You should define this
  5525. function to look like ‘malloc’; that is, like:
  5526. void *FUNCTION (size_t SIZE, const void *CALLER)
  5527. The value of CALLER is the return address found on the stack when
  5528. the ‘malloc’ function was called. This value allows you to trace
  5529. the memory consumption of the program.
  5530. -- Variable: __realloc_hook
  5531. The value of this variable is a pointer to function that ‘realloc’
  5532. uses whenever it is called. You should define this function to
  5533. look like ‘realloc’; that is, like:
  5534. void *FUNCTION (void *PTR, size_t SIZE, const void *CALLER)
  5535. The value of CALLER is the return address found on the stack when
  5536. the ‘realloc’ function was called. This value allows you to trace
  5537. the memory consumption of the program.
  5538. -- Variable: __free_hook
  5539. The value of this variable is a pointer to function that ‘free’
  5540. uses whenever it is called. You should define this function to
  5541. look like ‘free’; that is, like:
  5542. void FUNCTION (void *PTR, const void *CALLER)
  5543. The value of CALLER is the return address found on the stack when
  5544. the ‘free’ function was called. This value allows you to trace the
  5545. memory consumption of the program.
  5546. -- Variable: __memalign_hook
  5547. The value of this variable is a pointer to function that
  5548. ‘aligned_alloc’, ‘memalign’, ‘posix_memalign’ and ‘valloc’ use
  5549. whenever they are called. You should define this function to look
  5550. like ‘aligned_alloc’; that is, like:
  5551. void *FUNCTION (size_t ALIGNMENT, size_t SIZE, const void *CALLER)
  5552. The value of CALLER is the return address found on the stack when
  5553. the ‘aligned_alloc’, ‘memalign’, ‘posix_memalign’ or ‘valloc’
  5554. functions are called. This value allows you to trace the memory
  5555. consumption of the program.
  5556. You must make sure that the function you install as a hook for one of
  5557. these functions does not call that function recursively without
  5558. restoring the old value of the hook first! Otherwise, your program will
  5559. get stuck in an infinite recursion. Before calling the function
  5560. recursively, one should make sure to restore all the hooks to their
  5561. previous value. When coming back from the recursive call, all the hooks
  5562. should be resaved since a hook might modify itself.
  5563. An issue to look out for is the time at which the malloc hook
  5564. functions can be safely installed. If the hook functions call the
  5565. malloc-related functions recursively, it is necessary that malloc has
  5566. already properly initialized itself at the time when ‘__malloc_hook’
  5567. etc. is assigned to. On the other hand, if the hook functions provide
  5568. a complete malloc implementation of their own, it is vital that the
  5569. hooks are assigned to _before_ the very first ‘malloc’ call has
  5570. completed, because otherwise a chunk obtained from the ordinary,
  5571. un-hooked malloc may later be handed to ‘__free_hook’, for example.
  5572. Here is an example showing how to use ‘__malloc_hook’ and
  5573. ‘__free_hook’ properly. It installs a function that prints out
  5574. information every time ‘malloc’ or ‘free’ is called. We just assume
  5575. here that ‘realloc’ and ‘memalign’ are not used in our program.
  5576. /* Prototypes for __malloc_hook, __free_hook */
  5577. #include <malloc.h>
  5578. /* Prototypes for our hooks. */
  5579. static void my_init_hook (void);
  5580. static void *my_malloc_hook (size_t, const void *);
  5581. static void my_free_hook (void*, const void *);
  5582. static void
  5583. my_init (void)
  5584. {
  5585. old_malloc_hook = __malloc_hook;
  5586. old_free_hook = __free_hook;
  5587. __malloc_hook = my_malloc_hook;
  5588. __free_hook = my_free_hook;
  5589. }
  5590. static void *
  5591. my_malloc_hook (size_t size, const void *caller)
  5592. {
  5593. void *result;
  5594. /* Restore all old hooks */
  5595. __malloc_hook = old_malloc_hook;
  5596. __free_hook = old_free_hook;
  5597. /* Call recursively */
  5598. result = malloc (size);
  5599. /* Save underlying hooks */
  5600. old_malloc_hook = __malloc_hook;
  5601. old_free_hook = __free_hook;
  5602. /* ‘printf’ might call ‘malloc’, so protect it too. */
  5603. printf ("malloc (%u) returns %p\n", (unsigned int) size, result);
  5604. /* Restore our own hooks */
  5605. __malloc_hook = my_malloc_hook;
  5606. __free_hook = my_free_hook;
  5607. return result;
  5608. }
  5609. static void
  5610. my_free_hook (void *ptr, const void *caller)
  5611. {
  5612. /* Restore all old hooks */
  5613. __malloc_hook = old_malloc_hook;
  5614. __free_hook = old_free_hook;
  5615. /* Call recursively */
  5616. free (ptr);
  5617. /* Save underlying hooks */
  5618. old_malloc_hook = __malloc_hook;
  5619. old_free_hook = __free_hook;
  5620. /* ‘printf’ might call ‘free’, so protect it too. */
  5621. printf ("freed pointer %p\n", ptr);
  5622. /* Restore our own hooks */
  5623. __malloc_hook = my_malloc_hook;
  5624. __free_hook = my_free_hook;
  5625. }
  5626. main ()
  5627. {
  5628. my_init ();
  5629. }
  5630. The ‘mcheck’ function (*note Heap Consistency Checking::) works by
  5631. installing such hooks.
  5632. 
  5633. File: libc.info, Node: Statistics of Malloc, Next: Summary of Malloc, Prev: Hooks for Malloc, Up: Unconstrained Allocation
  5634. 3.2.3.10 Statistics for Memory Allocation with ‘malloc’
  5635. .......................................................
  5636. You can get information about dynamic memory allocation by calling the
  5637. ‘mallinfo’ function. This function and its associated data type are
  5638. declared in ‘malloc.h’; they are an extension of the standard SVID/XPG
  5639. version.
  5640. -- Data Type: struct mallinfo
  5641. This structure type is used to return information about the dynamic
  5642. memory allocator. It contains the following members:
  5643. ‘int arena’
  5644. This is the total size of memory allocated with ‘sbrk’ by
  5645. ‘malloc’, in bytes.
  5646. ‘int ordblks’
  5647. This is the number of chunks not in use. (The memory
  5648. allocator internally gets chunks of memory from the operating
  5649. system, and then carves them up to satisfy individual ‘malloc’
  5650. requests; *note The GNU Allocator::.)
  5651. ‘int smblks’
  5652. This field is unused.
  5653. ‘int hblks’
  5654. This is the total number of chunks allocated with ‘mmap’.
  5655. ‘int hblkhd’
  5656. This is the total size of memory allocated with ‘mmap’, in
  5657. bytes.
  5658. ‘int usmblks’
  5659. This field is unused and always 0.
  5660. ‘int fsmblks’
  5661. This field is unused.
  5662. ‘int uordblks’
  5663. This is the total size of memory occupied by chunks handed out
  5664. by ‘malloc’.
  5665. ‘int fordblks’
  5666. This is the total size of memory occupied by free (not in use)
  5667. chunks.
  5668. ‘int keepcost’
  5669. This is the size of the top-most releasable chunk that
  5670. normally borders the end of the heap (i.e., the high end of
  5671. the virtual address space’s data segment).
  5672. -- Function: struct mallinfo mallinfo (void)
  5673. Preliminary: | MT-Unsafe init const:mallopt | AS-Unsafe init lock |
  5674. AC-Unsafe init lock | *Note POSIX Safety Concepts::.
  5675. This function returns information about the current dynamic memory
  5676. usage in a structure of type ‘struct mallinfo’.
  5677. 
  5678. File: libc.info, Node: Summary of Malloc, Prev: Statistics of Malloc, Up: Unconstrained Allocation
  5679. 3.2.3.11 Summary of ‘malloc’-Related Functions
  5680. ..............................................
  5681. Here is a summary of the functions that work with ‘malloc’:
  5682. ‘void *malloc (size_t SIZE)’
  5683. Allocate a block of SIZE bytes. *Note Basic Allocation::.
  5684. ‘void free (void *ADDR)’
  5685. Free a block previously allocated by ‘malloc’. *Note Freeing after
  5686. Malloc::.
  5687. ‘void *realloc (void *ADDR, size_t SIZE)’
  5688. Make a block previously allocated by ‘malloc’ larger or smaller,
  5689. possibly by copying it to a new location. *Note Changing Block
  5690. Size::.
  5691. ‘void *calloc (size_t COUNT, size_t ELTSIZE)’
  5692. Allocate a block of COUNT * ELTSIZE bytes using ‘malloc’, and set
  5693. its contents to zero. *Note Allocating Cleared Space::.
  5694. ‘void *valloc (size_t SIZE)’
  5695. Allocate a block of SIZE bytes, starting on a page boundary. *Note
  5696. Aligned Memory Blocks::.
  5697. ‘void *aligned_alloc (size_t SIZE, size_t ALIGNMENT)’
  5698. Allocate a block of SIZE bytes, starting on an address that is a
  5699. multiple of ALIGNMENT. *Note Aligned Memory Blocks::.
  5700. ‘int posix_memalign (void **MEMPTR, size_t ALIGNMENT, size_t SIZE)’
  5701. Allocate a block of SIZE bytes, starting on an address that is a
  5702. multiple of ALIGNMENT. *Note Aligned Memory Blocks::.
  5703. ‘void *memalign (size_t SIZE, size_t BOUNDARY)’
  5704. Allocate a block of SIZE bytes, starting on an address that is a
  5705. multiple of BOUNDARY. *Note Aligned Memory Blocks::.
  5706. ‘int mallopt (int PARAM, int VALUE)’
  5707. Adjust a tunable parameter. *Note Malloc Tunable Parameters::.
  5708. ‘int mcheck (void (*ABORTFN) (void))’
  5709. Tell ‘malloc’ to perform occasional consistency checks on
  5710. dynamically allocated memory, and to call ABORTFN when an
  5711. inconsistency is found. *Note Heap Consistency Checking::.
  5712. ‘void *(*__malloc_hook) (size_t SIZE, const void *CALLER)’
  5713. A pointer to a function that ‘malloc’ uses whenever it is called.
  5714. ‘void *(*__realloc_hook) (void *PTR, size_t SIZE, const void *CALLER)’
  5715. A pointer to a function that ‘realloc’ uses whenever it is called.
  5716. ‘void (*__free_hook) (void *PTR, const void *CALLER)’
  5717. A pointer to a function that ‘free’ uses whenever it is called.
  5718. ‘void (*__memalign_hook) (size_t SIZE, size_t ALIGNMENT, const void *CALLER)’
  5719. A pointer to a function that ‘aligned_alloc’, ‘memalign’,
  5720. ‘posix_memalign’ and ‘valloc’ use whenever they are called.
  5721. ‘struct mallinfo mallinfo (void)’
  5722. Return information about the current dynamic memory usage. *Note
  5723. Statistics of Malloc::.
  5724. 
  5725. File: libc.info, Node: Allocation Debugging, Next: Obstacks, Prev: Unconstrained Allocation, Up: Memory Allocation
  5726. 3.2.4 Allocation Debugging
  5727. --------------------------
  5728. A complicated task when programming with languages which do not use
  5729. garbage collected dynamic memory allocation is to find memory leaks.
  5730. Long running programs must ensure that dynamically allocated objects are
  5731. freed at the end of their lifetime. If this does not happen the system
  5732. runs out of memory, sooner or later.
  5733. The ‘malloc’ implementation in the GNU C Library provides some simple
  5734. means to detect such leaks and obtain some information to find the
  5735. location. To do this the application must be started in a special mode
  5736. which is enabled by an environment variable. There are no speed
  5737. penalties for the program if the debugging mode is not enabled.
  5738. * Menu:
  5739. * Tracing malloc:: How to install the tracing functionality.
  5740. * Using the Memory Debugger:: Example programs excerpts.
  5741. * Tips for the Memory Debugger:: Some more or less clever ideas.
  5742. * Interpreting the traces:: What do all these lines mean?
  5743. 
  5744. File: libc.info, Node: Tracing malloc, Next: Using the Memory Debugger, Up: Allocation Debugging
  5745. 3.2.4.1 How to install the tracing functionality
  5746. ................................................
  5747. -- Function: void mtrace (void)
  5748. Preliminary: | MT-Unsafe env race:mtrace const:malloc_hooks init |
  5749. AS-Unsafe init heap corrupt lock | AC-Unsafe init corrupt lock fd
  5750. mem | *Note POSIX Safety Concepts::.
  5751. When the ‘mtrace’ function is called it looks for an environment
  5752. variable named ‘MALLOC_TRACE’. This variable is supposed to
  5753. contain a valid file name. The user must have write access. If
  5754. the file already exists it is truncated. If the environment
  5755. variable is not set or it does not name a valid file which can be
  5756. opened for writing nothing is done. The behavior of ‘malloc’ etc.
  5757. is not changed. For obvious reasons this also happens if the
  5758. application is installed with the SUID or SGID bit set.
  5759. If the named file is successfully opened, ‘mtrace’ installs special
  5760. handlers for the functions ‘malloc’, ‘realloc’, and ‘free’ (*note
  5761. Hooks for Malloc::). From then on, all uses of these functions are
  5762. traced and protocolled into the file. There is now of course a
  5763. speed penalty for all calls to the traced functions so tracing
  5764. should not be enabled during normal use.
  5765. This function is a GNU extension and generally not available on
  5766. other systems. The prototype can be found in ‘mcheck.h’.
  5767. -- Function: void muntrace (void)
  5768. Preliminary: | MT-Unsafe race:mtrace const:malloc_hooks locale |
  5769. AS-Unsafe corrupt heap | AC-Unsafe corrupt mem lock fd | *Note
  5770. POSIX Safety Concepts::.
  5771. The ‘muntrace’ function can be called after ‘mtrace’ was used to
  5772. enable tracing the ‘malloc’ calls. If no (successful) call of
  5773. ‘mtrace’ was made ‘muntrace’ does nothing.
  5774. Otherwise it deinstalls the handlers for ‘malloc’, ‘realloc’, and
  5775. ‘free’ and then closes the protocol file. No calls are protocolled
  5776. anymore and the program runs again at full speed.
  5777. This function is a GNU extension and generally not available on
  5778. other systems. The prototype can be found in ‘mcheck.h’.
  5779. 
  5780. File: libc.info, Node: Using the Memory Debugger, Next: Tips for the Memory Debugger, Prev: Tracing malloc, Up: Allocation Debugging
  5781. 3.2.4.2 Example program excerpts
  5782. ................................
  5783. Even though the tracing functionality does not influence the runtime
  5784. behavior of the program it is not a good idea to call ‘mtrace’ in all
  5785. programs. Just imagine that you debug a program using ‘mtrace’ and all
  5786. other programs used in the debugging session also trace their ‘malloc’
  5787. calls. The output file would be the same for all programs and thus is
  5788. unusable. Therefore one should call ‘mtrace’ only if compiled for
  5789. debugging. A program could therefore start like this:
  5790. #include <mcheck.h>
  5791. int
  5792. main (int argc, char *argv[])
  5793. {
  5794. #ifdef DEBUGGING
  5795. mtrace ();
  5796. #endif
  5797. }
  5798. This is all that is needed if you want to trace the calls during the
  5799. whole runtime of the program. Alternatively you can stop the tracing at
  5800. any time with a call to ‘muntrace’. It is even possible to restart the
  5801. tracing again with a new call to ‘mtrace’. But this can cause
  5802. unreliable results since there may be calls of the functions which are
  5803. not called. Please note that not only the application uses the traced
  5804. functions, also libraries (including the C library itself) use these
  5805. functions.
  5806. This last point is also why it is not a good idea to call ‘muntrace’
  5807. before the program terminates. The libraries are informed about the
  5808. termination of the program only after the program returns from ‘main’ or
  5809. calls ‘exit’ and so cannot free the memory they use before this time.
  5810. So the best thing one can do is to call ‘mtrace’ as the very first
  5811. function in the program and never call ‘muntrace’. So the program
  5812. traces almost all uses of the ‘malloc’ functions (except those calls
  5813. which are executed by constructors of the program or used libraries).
  5814. 
  5815. File: libc.info, Node: Tips for the Memory Debugger, Next: Interpreting the traces, Prev: Using the Memory Debugger, Up: Allocation Debugging
  5816. 3.2.4.3 Some more or less clever ideas
  5817. ......................................
  5818. You know the situation. The program is prepared for debugging and in
  5819. all debugging sessions it runs well. But once it is started without
  5820. debugging the error shows up. A typical example is a memory leak that
  5821. becomes visible only when we turn off the debugging. If you foresee
  5822. such situations you can still win. Simply use something equivalent to
  5823. the following little program:
  5824. #include <mcheck.h>
  5825. #include <signal.h>
  5826. static void
  5827. enable (int sig)
  5828. {
  5829. mtrace ();
  5830. signal (SIGUSR1, enable);
  5831. }
  5832. static void
  5833. disable (int sig)
  5834. {
  5835. muntrace ();
  5836. signal (SIGUSR2, disable);
  5837. }
  5838. int
  5839. main (int argc, char *argv[])
  5840. {
  5841. signal (SIGUSR1, enable);
  5842. signal (SIGUSR2, disable);
  5843. }
  5844. I.e., the user can start the memory debugger any time s/he wants if
  5845. the program was started with ‘MALLOC_TRACE’ set in the environment. The
  5846. output will of course not show the allocations which happened before the
  5847. first signal but if there is a memory leak this will show up
  5848. nevertheless.
  5849. 
  5850. File: libc.info, Node: Interpreting the traces, Prev: Tips for the Memory Debugger, Up: Allocation Debugging
  5851. 3.2.4.4 Interpreting the traces
  5852. ...............................
  5853. If you take a look at the output it will look similar to this:
  5854. = Start
  5855. [0x8048209] - 0x8064cc8
  5856. [0x8048209] - 0x8064ce0
  5857. [0x8048209] - 0x8064cf8
  5858. [0x80481eb] + 0x8064c48 0x14
  5859. [0x80481eb] + 0x8064c60 0x14
  5860. [0x80481eb] + 0x8064c78 0x14
  5861. [0x80481eb] + 0x8064c90 0x14
  5862. = End
  5863. What this all means is not really important since the trace file is
  5864. not meant to be read by a human. Therefore no attention is given to
  5865. readability. Instead there is a program which comes with the GNU C
  5866. Library which interprets the traces and outputs a summary in an
  5867. user-friendly way. The program is called ‘mtrace’ (it is in fact a Perl
  5868. script) and it takes one or two arguments. In any case the name of the
  5869. file with the trace output must be specified. If an optional argument
  5870. precedes the name of the trace file this must be the name of the program
  5871. which generated the trace.
  5872. drepper$ mtrace tst-mtrace log
  5873. No memory leaks.
  5874. In this case the program ‘tst-mtrace’ was run and it produced a trace
  5875. file ‘log’. The message printed by ‘mtrace’ shows there are no problems
  5876. with the code, all allocated memory was freed afterwards.
  5877. If we call ‘mtrace’ on the example trace given above we would get a
  5878. different outout:
  5879. drepper$ mtrace errlog
  5880. - 0x08064cc8 Free 2 was never alloc'd 0x8048209
  5881. - 0x08064ce0 Free 3 was never alloc'd 0x8048209
  5882. - 0x08064cf8 Free 4 was never alloc'd 0x8048209
  5883. Memory not freed:
  5884. -----------------
  5885. Address Size Caller
  5886. 0x08064c48 0x14 at 0x80481eb
  5887. 0x08064c60 0x14 at 0x80481eb
  5888. 0x08064c78 0x14 at 0x80481eb
  5889. 0x08064c90 0x14 at 0x80481eb
  5890. We have called ‘mtrace’ with only one argument and so the script has
  5891. no chance to find out what is meant with the addresses given in the
  5892. trace. We can do better:
  5893. drepper$ mtrace tst errlog
  5894. - 0x08064cc8 Free 2 was never alloc'd /home/drepper/tst.c:39
  5895. - 0x08064ce0 Free 3 was never alloc'd /home/drepper/tst.c:39
  5896. - 0x08064cf8 Free 4 was never alloc'd /home/drepper/tst.c:39
  5897. Memory not freed:
  5898. -----------------
  5899. Address Size Caller
  5900. 0x08064c48 0x14 at /home/drepper/tst.c:33
  5901. 0x08064c60 0x14 at /home/drepper/tst.c:33
  5902. 0x08064c78 0x14 at /home/drepper/tst.c:33
  5903. 0x08064c90 0x14 at /home/drepper/tst.c:33
  5904. Suddenly the output makes much more sense and the user can see
  5905. immediately where the function calls causing the trouble can be found.
  5906. Interpreting this output is not complicated. There are at most two
  5907. different situations being detected. First, ‘free’ was called for
  5908. pointers which were never returned by one of the allocation functions.
  5909. This is usually a very bad problem and what this looks like is shown in
  5910. the first three lines of the output. Situations like this are quite
  5911. rare and if they appear they show up very drastically: the program
  5912. normally crashes.
  5913. The other situation which is much harder to detect are memory leaks.
  5914. As you can see in the output the ‘mtrace’ function collects all this
  5915. information and so can say that the program calls an allocation function
  5916. from line 33 in the source file ‘/home/drepper/tst-mtrace.c’ four times
  5917. without freeing this memory before the program terminates. Whether this
  5918. is a real problem remains to be investigated.