| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364 |
- This is libc.info, produced by makeinfo version 7.3 from libc.texinfo.
- This is ‘The GNU C Library Reference Manual’, for version 2.43.
- Copyright © 1993-2026 Free Software Foundation, Inc.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.3 or
- any later version published by the Free Software Foundation; with the
- Invariant Sections being "Free Software Needs Free Documentation" and
- "GNU Lesser General Public License", the Front-Cover texts being "A GNU
- Manual", and with the Back-Cover Texts as in (a) below. A copy of the
- license is included in the section entitled "GNU Free Documentation
- License".
- (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
- modify this GNU manual. Buying copies from the FSF supports it in
- developing GNU and promoting software freedom."
- INFO-DIR-SECTION Software libraries
- START-INFO-DIR-ENTRY
- * Libc: (libc). C library.
- END-INFO-DIR-ENTRY
- INFO-DIR-SECTION GNU C library functions and macros
- START-INFO-DIR-ENTRY
- * ALTWERASE: (libc)Local Modes.
- * ARGP_ERR_UNKNOWN: (libc)Argp Parser Functions.
- * ARG_MAX: (libc)General Limits.
- * BAUD_MAX: (libc)Line Speed.
- * BC_BASE_MAX: (libc)Utility Limits.
- * BC_DIM_MAX: (libc)Utility Limits.
- * BC_SCALE_MAX: (libc)Utility Limits.
- * BC_STRING_MAX: (libc)Utility Limits.
- * BRKINT: (libc)Input Modes.
- * BUFSIZ: (libc)Controlling Buffering.
- * CCTS_OFLOW: (libc)Control Modes.
- * CHAR_BIT: (libc)Width of Type.
- * CHILD_MAX: (libc)General Limits.
- * CIGNORE: (libc)Control Modes.
- * CLK_TCK: (libc)Processor Time.
- * CLOCAL: (libc)Control Modes.
- * CLOCKS_PER_SEC: (libc)CPU Time.
- * CLOCK_BOOTTIME: (libc)Getting the Time.
- * CLOCK_BOOTTIME_ALARM: (libc)Getting the Time.
- * CLOCK_MONOTONIC: (libc)Getting the Time.
- * CLOCK_MONOTONIC_COARSE: (libc)Getting the Time.
- * CLOCK_MONOTONIC_RAW: (libc)Getting the Time.
- * CLOCK_PROCESS_CPUTIME_ID: (libc)Getting the Time.
- * CLOCK_REALTIME: (libc)Getting the Time.
- * CLOCK_REALTIME_ALARM: (libc)Getting the Time.
- * CLOCK_REALTIME_COARSE: (libc)Getting the Time.
- * CLOCK_TAI: (libc)Getting the Time.
- * CLOCK_THREAD_CPUTIME_ID: (libc)Getting the Time.
- * COLL_WEIGHTS_MAX: (libc)Utility Limits.
- * CPU_ALLOC: (libc)CPU Affinity.
- * CPU_ALLOC_SIZE: (libc)CPU Affinity.
- * CPU_AND: (libc)CPU Affinity.
- * CPU_AND_S: (libc)CPU Affinity.
- * CPU_CLR: (libc)CPU Affinity.
- * CPU_CLR_S: (libc)CPU Affinity.
- * CPU_COUNT: (libc)CPU Affinity.
- * CPU_COUNT_S: (libc)CPU Affinity.
- * CPU_EQUAL: (libc)CPU Affinity.
- * CPU_EQUAL_S: (libc)CPU Affinity.
- * CPU_FEATURE_ACTIVE: (libc)X86.
- * CPU_FEATURE_PRESENT: (libc)X86.
- * CPU_FREE: (libc)CPU Affinity.
- * CPU_ISSET: (libc)CPU Affinity.
- * CPU_ISSET_S: (libc)CPU Affinity.
- * CPU_OR: (libc)CPU Affinity.
- * CPU_OR_S: (libc)CPU Affinity.
- * CPU_SET: (libc)CPU Affinity.
- * CPU_SETSIZE: (libc)CPU Affinity.
- * CPU_SET_S: (libc)CPU Affinity.
- * CPU_XOR: (libc)CPU Affinity.
- * CPU_XOR_S: (libc)CPU Affinity.
- * CPU_ZERO: (libc)CPU Affinity.
- * CPU_ZERO_S: (libc)CPU Affinity.
- * CREAD: (libc)Control Modes.
- * CRTS_IFLOW: (libc)Control Modes.
- * CS5: (libc)Control Modes.
- * CS6: (libc)Control Modes.
- * CS7: (libc)Control Modes.
- * CS8: (libc)Control Modes.
- * CSIZE: (libc)Control Modes.
- * CSTOPB: (libc)Control Modes.
- * DLFO_EH_SEGMENT_TYPE: (libc)Dynamic Linker Introspection.
- * DLFO_STRUCT_HAS_EH_COUNT: (libc)Dynamic Linker Introspection.
- * DLFO_STRUCT_HAS_EH_DBASE: (libc)Dynamic Linker Introspection.
- * DTTOIF: (libc)Directory Entries.
- * E2BIG: (libc)Error Codes.
- * EACCES: (libc)Error Codes.
- * EADDRINUSE: (libc)Error Codes.
- * EADDRNOTAVAIL: (libc)Error Codes.
- * EADV: (libc)Error Codes.
- * EAFNOSUPPORT: (libc)Error Codes.
- * EAGAIN: (libc)Error Codes.
- * EALREADY: (libc)Error Codes.
- * EAUTH: (libc)Error Codes.
- * EBACKGROUND: (libc)Error Codes.
- * EBADE: (libc)Error Codes.
- * EBADF: (libc)Error Codes.
- * EBADFD: (libc)Error Codes.
- * EBADMSG: (libc)Error Codes.
- * EBADR: (libc)Error Codes.
- * EBADRPC: (libc)Error Codes.
- * EBADRQC: (libc)Error Codes.
- * EBADSLT: (libc)Error Codes.
- * EBFONT: (libc)Error Codes.
- * EBUSY: (libc)Error Codes.
- * ECANCELED: (libc)Error Codes.
- * ECHILD: (libc)Error Codes.
- * ECHO: (libc)Local Modes.
- * ECHOCTL: (libc)Local Modes.
- * ECHOE: (libc)Local Modes.
- * ECHOK: (libc)Local Modes.
- * ECHOKE: (libc)Local Modes.
- * ECHONL: (libc)Local Modes.
- * ECHOPRT: (libc)Local Modes.
- * ECHRNG: (libc)Error Codes.
- * ECOMM: (libc)Error Codes.
- * ECONNABORTED: (libc)Error Codes.
- * ECONNREFUSED: (libc)Error Codes.
- * ECONNRESET: (libc)Error Codes.
- * ED: (libc)Error Codes.
- * EDEADLK: (libc)Error Codes.
- * EDEADLOCK: (libc)Error Codes.
- * EDESTADDRREQ: (libc)Error Codes.
- * EDIED: (libc)Error Codes.
- * EDOM: (libc)Error Codes.
- * EDOTDOT: (libc)Error Codes.
- * EDQUOT: (libc)Error Codes.
- * EEXIST: (libc)Error Codes.
- * EFAULT: (libc)Error Codes.
- * EFBIG: (libc)Error Codes.
- * EFTYPE: (libc)Error Codes.
- * EGRATUITOUS: (libc)Error Codes.
- * EGREGIOUS: (libc)Error Codes.
- * EHOSTDOWN: (libc)Error Codes.
- * EHOSTUNREACH: (libc)Error Codes.
- * EHWPOISON: (libc)Error Codes.
- * EIDRM: (libc)Error Codes.
- * EIEIO: (libc)Error Codes.
- * EILSEQ: (libc)Error Codes.
- * EINPROGRESS: (libc)Error Codes.
- * EINTR: (libc)Error Codes.
- * EINVAL: (libc)Error Codes.
- * EIO: (libc)Error Codes.
- * EISCONN: (libc)Error Codes.
- * EISDIR: (libc)Error Codes.
- * EISNAM: (libc)Error Codes.
- * EKEYEXPIRED: (libc)Error Codes.
- * EKEYREJECTED: (libc)Error Codes.
- * EKEYREVOKED: (libc)Error Codes.
- * EL2HLT: (libc)Error Codes.
- * EL2NSYNC: (libc)Error Codes.
- * EL3HLT: (libc)Error Codes.
- * EL3RST: (libc)Error Codes.
- * ELIBACC: (libc)Error Codes.
- * ELIBBAD: (libc)Error Codes.
- * ELIBEXEC: (libc)Error Codes.
- * ELIBMAX: (libc)Error Codes.
- * ELIBSCN: (libc)Error Codes.
- * ELNRNG: (libc)Error Codes.
- * ELOOP: (libc)Error Codes.
- * EMEDIUMTYPE: (libc)Error Codes.
- * EMFILE: (libc)Error Codes.
- * EMLINK: (libc)Error Codes.
- * EMSGSIZE: (libc)Error Codes.
- * EMULTIHOP: (libc)Error Codes.
- * ENAMETOOLONG: (libc)Error Codes.
- * ENAVAIL: (libc)Error Codes.
- * ENEEDAUTH: (libc)Error Codes.
- * ENETDOWN: (libc)Error Codes.
- * ENETRESET: (libc)Error Codes.
- * ENETUNREACH: (libc)Error Codes.
- * ENFILE: (libc)Error Codes.
- * ENOANO: (libc)Error Codes.
- * ENOBUFS: (libc)Error Codes.
- * ENOCSI: (libc)Error Codes.
- * ENODATA: (libc)Error Codes.
- * ENODEV: (libc)Error Codes.
- * ENOENT: (libc)Error Codes.
- * ENOEXEC: (libc)Error Codes.
- * ENOKEY: (libc)Error Codes.
- * ENOLCK: (libc)Error Codes.
- * ENOLINK: (libc)Error Codes.
- * ENOMEDIUM: (libc)Error Codes.
- * ENOMEM: (libc)Error Codes.
- * ENOMSG: (libc)Error Codes.
- * ENONET: (libc)Error Codes.
- * ENOPKG: (libc)Error Codes.
- * ENOPROTOOPT: (libc)Error Codes.
- * ENOSPC: (libc)Error Codes.
- * ENOSR: (libc)Error Codes.
- * ENOSTR: (libc)Error Codes.
- * ENOSYS: (libc)Error Codes.
- * ENOTBLK: (libc)Error Codes.
- * ENOTCONN: (libc)Error Codes.
- * ENOTDIR: (libc)Error Codes.
- * ENOTEMPTY: (libc)Error Codes.
- * ENOTNAM: (libc)Error Codes.
- * ENOTRECOVERABLE: (libc)Error Codes.
- * ENOTSOCK: (libc)Error Codes.
- * ENOTSUP: (libc)Error Codes.
- * ENOTTY: (libc)Error Codes.
- * ENOTUNIQ: (libc)Error Codes.
- * ENXIO: (libc)Error Codes.
- * EOF: (libc)EOF and Errors.
- * EOPNOTSUPP: (libc)Error Codes.
- * EOVERFLOW: (libc)Error Codes.
- * EOWNERDEAD: (libc)Error Codes.
- * EPERM: (libc)Error Codes.
- * EPFNOSUPPORT: (libc)Error Codes.
- * EPIPE: (libc)Error Codes.
- * EPROCLIM: (libc)Error Codes.
- * EPROCUNAVAIL: (libc)Error Codes.
- * EPROGMISMATCH: (libc)Error Codes.
- * EPROGUNAVAIL: (libc)Error Codes.
- * EPROTO: (libc)Error Codes.
- * EPROTONOSUPPORT: (libc)Error Codes.
- * EPROTOTYPE: (libc)Error Codes.
- * EQUIV_CLASS_MAX: (libc)Utility Limits.
- * ERANGE: (libc)Error Codes.
- * EREMCHG: (libc)Error Codes.
- * EREMOTE: (libc)Error Codes.
- * EREMOTEIO: (libc)Error Codes.
- * ERESTART: (libc)Error Codes.
- * ERFKILL: (libc)Error Codes.
- * EROFS: (libc)Error Codes.
- * ERPCMISMATCH: (libc)Error Codes.
- * ESHUTDOWN: (libc)Error Codes.
- * ESOCKTNOSUPPORT: (libc)Error Codes.
- * ESPIPE: (libc)Error Codes.
- * ESRCH: (libc)Error Codes.
- * ESRMNT: (libc)Error Codes.
- * ESTALE: (libc)Error Codes.
- * ESTRPIPE: (libc)Error Codes.
- * ETIME: (libc)Error Codes.
- * ETIMEDOUT: (libc)Error Codes.
- * ETOOMANYREFS: (libc)Error Codes.
- * ETXTBSY: (libc)Error Codes.
- * EUCLEAN: (libc)Error Codes.
- * EUNATCH: (libc)Error Codes.
- * EUSERS: (libc)Error Codes.
- * EWOULDBLOCK: (libc)Error Codes.
- * EXDEV: (libc)Error Codes.
- * EXFULL: (libc)Error Codes.
- * EXIT_FAILURE: (libc)Exit Status.
- * EXIT_SUCCESS: (libc)Exit Status.
- * EXPR_NEST_MAX: (libc)Utility Limits.
- * FD_CLOEXEC: (libc)Descriptor Flags.
- * FD_CLR: (libc)Waiting for I/O.
- * FD_ISSET: (libc)Waiting for I/O.
- * FD_SET: (libc)Waiting for I/O.
- * FD_SETSIZE: (libc)Waiting for I/O.
- * FD_ZERO: (libc)Waiting for I/O.
- * FE_SNANS_ALWAYS_SIGNAL: (libc)Infinity and NaN.
- * FILENAME_MAX: (libc)Limits for Files.
- * FLUSHO: (libc)Local Modes.
- * FOPEN_MAX: (libc)Opening Streams.
- * FP_ILOGB0: (libc)Exponents and Logarithms.
- * FP_ILOGBNAN: (libc)Exponents and Logarithms.
- * FP_LLOGB0: (libc)Exponents and Logarithms.
- * FP_LLOGBNAN: (libc)Exponents and Logarithms.
- * F_DUPFD: (libc)Duplicating Descriptors.
- * F_GETFD: (libc)Descriptor Flags.
- * F_GETFL: (libc)Getting File Status Flags.
- * F_GETLK: (libc)File Locks.
- * F_GETOWN: (libc)Interrupt Input.
- * F_OFD_GETLK: (libc)Open File Description Locks.
- * F_OFD_SETLK: (libc)Open File Description Locks.
- * F_OFD_SETLKW: (libc)Open File Description Locks.
- * F_OK: (libc)Testing File Access.
- * F_SETFD: (libc)Descriptor Flags.
- * F_SETFL: (libc)Getting File Status Flags.
- * F_SETLK: (libc)File Locks.
- * F_SETLKW: (libc)File Locks.
- * F_SETOWN: (libc)Interrupt Input.
- * HUGE_VAL: (libc)Math Error Reporting.
- * HUGE_VALF: (libc)Math Error Reporting.
- * HUGE_VALL: (libc)Math Error Reporting.
- * HUGE_VAL_FN: (libc)Math Error Reporting.
- * HUGE_VAL_FNx: (libc)Math Error Reporting.
- * HUPCL: (libc)Control Modes.
- * I: (libc)Complex Numbers.
- * ICANON: (libc)Local Modes.
- * ICRNL: (libc)Input Modes.
- * IEXTEN: (libc)Local Modes.
- * IFNAMSIZ: (libc)Interface Naming.
- * IFTODT: (libc)Directory Entries.
- * IGNBRK: (libc)Input Modes.
- * IGNCR: (libc)Input Modes.
- * IGNPAR: (libc)Input Modes.
- * IMAXBEL: (libc)Input Modes.
- * INADDR_ANY: (libc)Host Address Data Type.
- * INADDR_BROADCAST: (libc)Host Address Data Type.
- * INADDR_LOOPBACK: (libc)Host Address Data Type.
- * INADDR_NONE: (libc)Host Address Data Type.
- * INFINITY: (libc)Infinity and NaN.
- * INLCR: (libc)Input Modes.
- * INPCK: (libc)Input Modes.
- * IPPORT_RESERVED: (libc)Ports.
- * IPPORT_USERRESERVED: (libc)Ports.
- * ISIG: (libc)Local Modes.
- * ISTRIP: (libc)Input Modes.
- * IXANY: (libc)Input Modes.
- * IXOFF: (libc)Input Modes.
- * IXON: (libc)Input Modes.
- * LINE_MAX: (libc)Utility Limits.
- * LINK_MAX: (libc)Limits for Files.
- * L_ctermid: (libc)Identifying the Terminal.
- * L_cuserid: (libc)Who Logged In.
- * L_tmpnam: (libc)Temporary Files.
- * MAXNAMLEN: (libc)Limits for Files.
- * MAXSYMLINKS: (libc)Symbolic Links.
- * MAX_CANON: (libc)Limits for Files.
- * MAX_INPUT: (libc)Limits for Files.
- * MB_CUR_MAX: (libc)Selecting the Conversion.
- * MB_LEN_MAX: (libc)Selecting the Conversion.
- * MDMBUF: (libc)Control Modes.
- * MSG_DONTROUTE: (libc)Socket Data Options.
- * MSG_OOB: (libc)Socket Data Options.
- * MSG_PEEK: (libc)Socket Data Options.
- * NAME_MAX: (libc)Limits for Files.
- * NAN: (libc)Infinity and NaN.
- * NCCS: (libc)Mode Data Types.
- * NGROUPS_MAX: (libc)General Limits.
- * NOFLSH: (libc)Local Modes.
- * NOKERNINFO: (libc)Local Modes.
- * NSIG: (libc)Standard Signals.
- * NULL: (libc)Null Pointer Constant.
- * ONLCR: (libc)Output Modes.
- * ONOEOT: (libc)Output Modes.
- * OPEN_MAX: (libc)General Limits.
- * OPOST: (libc)Output Modes.
- * OXTABS: (libc)Output Modes.
- * O_ACCMODE: (libc)Access Modes.
- * O_APPEND: (libc)Operating Modes.
- * O_ASYNC: (libc)Operating Modes.
- * O_CREAT: (libc)Open-time Flags.
- * O_DIRECTORY: (libc)Open-time Flags.
- * O_EXCL: (libc)Open-time Flags.
- * O_EXEC: (libc)Access Modes.
- * O_EXLOCK: (libc)Open-time Flags.
- * O_FSYNC: (libc)Operating Modes.
- * O_IGNORE_CTTY: (libc)Open-time Flags.
- * O_NDELAY: (libc)Operating Modes.
- * O_NOATIME: (libc)Operating Modes.
- * O_NOCTTY: (libc)Open-time Flags.
- * O_NOFOLLOW: (libc)Open-time Flags.
- * O_NOLINK: (libc)Open-time Flags.
- * O_NONBLOCK: (libc)Open-time Flags.
- * O_NONBLOCK: (libc)Operating Modes.
- * O_NOTRANS: (libc)Open-time Flags.
- * O_PATH: (libc)Access Modes.
- * O_RDONLY: (libc)Access Modes.
- * O_RDWR: (libc)Access Modes.
- * O_READ: (libc)Access Modes.
- * O_SHLOCK: (libc)Open-time Flags.
- * O_SYNC: (libc)Operating Modes.
- * O_TMPFILE: (libc)Open-time Flags.
- * O_TRUNC: (libc)Open-time Flags.
- * O_WRITE: (libc)Access Modes.
- * O_WRONLY: (libc)Access Modes.
- * PARENB: (libc)Control Modes.
- * PARMRK: (libc)Input Modes.
- * PARODD: (libc)Control Modes.
- * PATH_MAX: (libc)Limits for Files.
- * PA_FLAG_MASK: (libc)Parsing a Template String.
- * PENDIN: (libc)Local Modes.
- * PF_FILE: (libc)Local Namespace Details.
- * PF_INET6: (libc)Internet Namespace.
- * PF_INET: (libc)Internet Namespace.
- * PF_LOCAL: (libc)Local Namespace Details.
- * PF_UNIX: (libc)Local Namespace Details.
- * PIPE_BUF: (libc)Limits for Files.
- * PTHREAD_ATTR_NO_SIGMASK_NP: (libc)Initial Thread Signal Mask.
- * P_tmpdir: (libc)Temporary Files.
- * RAND_MAX: (libc)ISO Random.
- * RE_DUP_MAX: (libc)General Limits.
- * RLIM_INFINITY: (libc)Limits on Resources.
- * RSEQ_SIG: (libc)Restartable Sequences.
- * R_OK: (libc)Testing File Access.
- * SA_NOCLDSTOP: (libc)Flags for Sigaction.
- * SA_NOCLDWAIT: (libc)Flags for Sigaction.
- * SA_NODEFER: (libc)Flags for Sigaction.
- * SA_ONSTACK: (libc)Flags for Sigaction.
- * SA_RESETHAND: (libc)Flags for Sigaction.
- * SA_RESTART: (libc)Flags for Sigaction.
- * SA_SIGINFO: (libc)Flags for Sigaction.
- * SEEK_CUR: (libc)File Positioning.
- * SEEK_END: (libc)File Positioning.
- * SEEK_SET: (libc)File Positioning.
- * SIGABRT: (libc)Program Error Signals.
- * SIGALRM: (libc)Alarm Signals.
- * SIGBUS: (libc)Program Error Signals.
- * SIGCHLD: (libc)Job Control Signals.
- * SIGCLD: (libc)Job Control Signals.
- * SIGCONT: (libc)Job Control Signals.
- * SIGEMT: (libc)Program Error Signals.
- * SIGFPE: (libc)Program Error Signals.
- * SIGHUP: (libc)Termination Signals.
- * SIGILL: (libc)Program Error Signals.
- * SIGINFO: (libc)Miscellaneous Signals.
- * SIGINT: (libc)Termination Signals.
- * SIGIO: (libc)Asynchronous I/O Signals.
- * SIGIOT: (libc)Program Error Signals.
- * SIGKILL: (libc)Termination Signals.
- * SIGLOST: (libc)Operation Error Signals.
- * SIGPIPE: (libc)Operation Error Signals.
- * SIGPOLL: (libc)Asynchronous I/O Signals.
- * SIGPROF: (libc)Alarm Signals.
- * SIGPWR: (libc)Miscellaneous Signals.
- * SIGQUIT: (libc)Termination Signals.
- * SIGSEGV: (libc)Program Error Signals.
- * SIGSTKFLT: (libc)Program Error Signals.
- * SIGSTOP: (libc)Job Control Signals.
- * SIGSYS: (libc)Program Error Signals.
- * SIGTERM: (libc)Termination Signals.
- * SIGTRAP: (libc)Program Error Signals.
- * SIGTSTP: (libc)Job Control Signals.
- * SIGTTIN: (libc)Job Control Signals.
- * SIGTTOU: (libc)Job Control Signals.
- * SIGURG: (libc)Asynchronous I/O Signals.
- * SIGUSR1: (libc)Miscellaneous Signals.
- * SIGUSR2: (libc)Miscellaneous Signals.
- * SIGVTALRM: (libc)Alarm Signals.
- * SIGWINCH: (libc)Miscellaneous Signals.
- * SIGXCPU: (libc)Operation Error Signals.
- * SIGXFSZ: (libc)Operation Error Signals.
- * SIG_ERR: (libc)Basic Signal Handling.
- * SNAN: (libc)Infinity and NaN.
- * SNANF: (libc)Infinity and NaN.
- * SNANFN: (libc)Infinity and NaN.
- * SNANFNx: (libc)Infinity and NaN.
- * SNANL: (libc)Infinity and NaN.
- * SOCK_DGRAM: (libc)Communication Styles.
- * SOCK_RAW: (libc)Communication Styles.
- * SOCK_RDM: (libc)Communication Styles.
- * SOCK_SEQPACKET: (libc)Communication Styles.
- * SOCK_STREAM: (libc)Communication Styles.
- * SOL_SOCKET: (libc)Socket-Level Options.
- * SPEED_MAX: (libc)Line Speed.
- * SSIZE_MAX: (libc)General Limits.
- * STREAM_MAX: (libc)General Limits.
- * SUN_LEN: (libc)Local Namespace Details.
- * S_IFMT: (libc)Testing File Type.
- * S_ISBLK: (libc)Testing File Type.
- * S_ISCHR: (libc)Testing File Type.
- * S_ISDIR: (libc)Testing File Type.
- * S_ISFIFO: (libc)Testing File Type.
- * S_ISLNK: (libc)Testing File Type.
- * S_ISREG: (libc)Testing File Type.
- * S_ISSOCK: (libc)Testing File Type.
- * S_TYPEISMQ: (libc)Testing File Type.
- * S_TYPEISSEM: (libc)Testing File Type.
- * S_TYPEISSHM: (libc)Testing File Type.
- * TIME_UTC: (libc)Getting the Time.
- * TMP_MAX: (libc)Temporary Files.
- * TOSTOP: (libc)Local Modes.
- * TZNAME_MAX: (libc)General Limits.
- * VDISCARD: (libc)Other Special.
- * VDSUSP: (libc)Signal Characters.
- * VEOF: (libc)Editing Characters.
- * VEOL2: (libc)Editing Characters.
- * VEOL: (libc)Editing Characters.
- * VERASE: (libc)Editing Characters.
- * VINTR: (libc)Signal Characters.
- * VKILL: (libc)Editing Characters.
- * VLNEXT: (libc)Other Special.
- * VMIN: (libc)Noncanonical Input.
- * VQUIT: (libc)Signal Characters.
- * VREPRINT: (libc)Editing Characters.
- * VSTART: (libc)Start/Stop Characters.
- * VSTATUS: (libc)Other Special.
- * VSTOP: (libc)Start/Stop Characters.
- * VSUSP: (libc)Signal Characters.
- * VTIME: (libc)Noncanonical Input.
- * VWERASE: (libc)Editing Characters.
- * WCHAR_MAX: (libc)Extended Char Intro.
- * WCHAR_MIN: (libc)Extended Char Intro.
- * WCOREDUMP: (libc)Process Completion Status.
- * WEOF: (libc)EOF and Errors.
- * WEOF: (libc)Extended Char Intro.
- * WEXITSTATUS: (libc)Process Completion Status.
- * WIFEXITED: (libc)Process Completion Status.
- * WIFSIGNALED: (libc)Process Completion Status.
- * WIFSTOPPED: (libc)Process Completion Status.
- * WSTOPSIG: (libc)Process Completion Status.
- * WTERMSIG: (libc)Process Completion Status.
- * W_OK: (libc)Testing File Access.
- * X_OK: (libc)Testing File Access.
- * _Complex_I: (libc)Complex Numbers.
- * _Exit: (libc)Termination Internals.
- * _Fork: (libc)Creating a Process.
- * _IOFBF: (libc)Controlling Buffering.
- * _IOLBF: (libc)Controlling Buffering.
- * _IONBF: (libc)Controlling Buffering.
- * _Imaginary_I: (libc)Complex Numbers.
- * _PATH_UTMP: (libc)Manipulating the Database.
- * _PATH_WTMP: (libc)Manipulating the Database.
- * _POSIX2_C_DEV: (libc)System Options.
- * _POSIX2_C_VERSION: (libc)Version Supported.
- * _POSIX2_FORT_DEV: (libc)System Options.
- * _POSIX2_FORT_RUN: (libc)System Options.
- * _POSIX2_LOCALEDEF: (libc)System Options.
- * _POSIX2_SW_DEV: (libc)System Options.
- * _POSIX_CHOWN_RESTRICTED: (libc)Options for Files.
- * _POSIX_JOB_CONTROL: (libc)System Options.
- * _POSIX_NO_TRUNC: (libc)Options for Files.
- * _POSIX_SAVED_IDS: (libc)System Options.
- * _POSIX_VDISABLE: (libc)Options for Files.
- * _POSIX_VERSION: (libc)Version Supported.
- * __fbufsize: (libc)Controlling Buffering.
- * __flbf: (libc)Controlling Buffering.
- * __fpending: (libc)Controlling Buffering.
- * __fpurge: (libc)Flushing Buffers.
- * __freadable: (libc)Opening Streams.
- * __freading: (libc)Opening Streams.
- * __fsetlocking: (libc)Streams and Threads.
- * __fwritable: (libc)Opening Streams.
- * __fwriting: (libc)Opening Streams.
- * __gconv_end_fct: (libc)glibc iconv Implementation.
- * __gconv_fct: (libc)glibc iconv Implementation.
- * __gconv_init_fct: (libc)glibc iconv Implementation.
- * __ppc_get_timebase: (libc)PowerPC.
- * __ppc_get_timebase_freq: (libc)PowerPC.
- * __ppc_mdoio: (libc)PowerPC.
- * __ppc_mdoom: (libc)PowerPC.
- * __ppc_set_ppr_low: (libc)PowerPC.
- * __ppc_set_ppr_med: (libc)PowerPC.
- * __ppc_set_ppr_med_high: (libc)PowerPC.
- * __ppc_set_ppr_med_low: (libc)PowerPC.
- * __ppc_set_ppr_very_low: (libc)PowerPC.
- * __ppc_yield: (libc)PowerPC.
- * __riscv_flush_icache: (libc)RISC-V.
- * __va_copy: (libc)Argument Macros.
- * __x86_get_cpuid_feature_leaf: (libc)X86.
- * _dl_find_object: (libc)Dynamic Linker Introspection.
- * _exit: (libc)Termination Internals.
- * _flushlbf: (libc)Flushing Buffers.
- * _tolower: (libc)Case Conversion.
- * _toupper: (libc)Case Conversion.
- * a64l: (libc)Encode Binary Data.
- * abort: (libc)Aborting a Program.
- * abs: (libc)Absolute Value.
- * accept: (libc)Accepting Connections.
- * access: (libc)Testing File Access.
- * acos: (libc)Inverse Trig Functions.
- * acosf: (libc)Inverse Trig Functions.
- * acosfN: (libc)Inverse Trig Functions.
- * acosfNx: (libc)Inverse Trig Functions.
- * acosh: (libc)Hyperbolic Functions.
- * acoshf: (libc)Hyperbolic Functions.
- * acoshfN: (libc)Hyperbolic Functions.
- * acoshfNx: (libc)Hyperbolic Functions.
- * acoshl: (libc)Hyperbolic Functions.
- * acosl: (libc)Inverse Trig Functions.
- * acospi: (libc)Inverse Trig Functions.
- * acospif: (libc)Inverse Trig Functions.
- * acospifN: (libc)Inverse Trig Functions.
- * acospifNx: (libc)Inverse Trig Functions.
- * acospil: (libc)Inverse Trig Functions.
- * addmntent: (libc)mtab.
- * addseverity: (libc)Adding Severity Classes.
- * adjtime: (libc)Setting and Adjusting the Time.
- * adjtimex: (libc)Setting and Adjusting the Time.
- * aio_cancel64: (libc)Cancel AIO Operations.
- * aio_cancel: (libc)Cancel AIO Operations.
- * aio_error64: (libc)Status of AIO Operations.
- * aio_error: (libc)Status of AIO Operations.
- * aio_fsync64: (libc)Synchronizing AIO Operations.
- * aio_fsync: (libc)Synchronizing AIO Operations.
- * aio_init: (libc)Configuration of AIO.
- * aio_read64: (libc)Asynchronous Reads/Writes.
- * aio_read: (libc)Asynchronous Reads/Writes.
- * aio_return64: (libc)Status of AIO Operations.
- * aio_return: (libc)Status of AIO Operations.
- * aio_suspend64: (libc)Synchronizing AIO Operations.
- * aio_suspend: (libc)Synchronizing AIO Operations.
- * aio_write64: (libc)Asynchronous Reads/Writes.
- * aio_write: (libc)Asynchronous Reads/Writes.
- * alarm: (libc)Setting an Alarm.
- * aligned_alloc: (libc)Aligned Memory Blocks.
- * alloca: (libc)Variable Size Automatic.
- * alphasort64: (libc)Scanning Directory Content.
- * alphasort: (libc)Scanning Directory Content.
- * arc4random: (libc)High Quality Random.
- * arc4random_buf: (libc)High Quality Random.
- * arc4random_uniform: (libc)High Quality Random.
- * argp_error: (libc)Argp Helper Functions.
- * argp_failure: (libc)Argp Helper Functions.
- * argp_help: (libc)Argp Help.
- * argp_parse: (libc)Argp.
- * argp_state_help: (libc)Argp Helper Functions.
- * argp_usage: (libc)Argp Helper Functions.
- * argz_add: (libc)Argz Functions.
- * argz_add_sep: (libc)Argz Functions.
- * argz_append: (libc)Argz Functions.
- * argz_count: (libc)Argz Functions.
- * argz_create: (libc)Argz Functions.
- * argz_create_sep: (libc)Argz Functions.
- * argz_delete: (libc)Argz Functions.
- * argz_extract: (libc)Argz Functions.
- * argz_insert: (libc)Argz Functions.
- * argz_next: (libc)Argz Functions.
- * argz_replace: (libc)Argz Functions.
- * argz_stringify: (libc)Argz Functions.
- * asctime: (libc)Formatting Calendar Time.
- * asctime_r: (libc)Formatting Calendar Time.
- * asin: (libc)Inverse Trig Functions.
- * asinf: (libc)Inverse Trig Functions.
- * asinfN: (libc)Inverse Trig Functions.
- * asinfNx: (libc)Inverse Trig Functions.
- * asinh: (libc)Hyperbolic Functions.
- * asinhf: (libc)Hyperbolic Functions.
- * asinhfN: (libc)Hyperbolic Functions.
- * asinhfNx: (libc)Hyperbolic Functions.
- * asinhl: (libc)Hyperbolic Functions.
- * asinl: (libc)Inverse Trig Functions.
- * asinpi: (libc)Inverse Trig Functions.
- * asinpif: (libc)Inverse Trig Functions.
- * asinpifN: (libc)Inverse Trig Functions.
- * asinpifNx: (libc)Inverse Trig Functions.
- * asinpil: (libc)Inverse Trig Functions.
- * asprintf: (libc)Dynamic Output.
- * assert: (libc)Consistency Checking.
- * assert_perror: (libc)Consistency Checking.
- * atan2: (libc)Inverse Trig Functions.
- * atan2f: (libc)Inverse Trig Functions.
- * atan2fN: (libc)Inverse Trig Functions.
- * atan2fNx: (libc)Inverse Trig Functions.
- * atan2l: (libc)Inverse Trig Functions.
- * atan2pi: (libc)Inverse Trig Functions.
- * atan2pif: (libc)Inverse Trig Functions.
- * atan2pifN: (libc)Inverse Trig Functions.
- * atan2pifNx: (libc)Inverse Trig Functions.
- * atan2pil: (libc)Inverse Trig Functions.
- * atan: (libc)Inverse Trig Functions.
- * atanf: (libc)Inverse Trig Functions.
- * atanfN: (libc)Inverse Trig Functions.
- * atanfNx: (libc)Inverse Trig Functions.
- * atanh: (libc)Hyperbolic Functions.
- * atanhf: (libc)Hyperbolic Functions.
- * atanhfN: (libc)Hyperbolic Functions.
- * atanhfNx: (libc)Hyperbolic Functions.
- * atanhl: (libc)Hyperbolic Functions.
- * atanl: (libc)Inverse Trig Functions.
- * atanpi: (libc)Inverse Trig Functions.
- * atanpif: (libc)Inverse Trig Functions.
- * atanpifN: (libc)Inverse Trig Functions.
- * atanpifNx: (libc)Inverse Trig Functions.
- * atanpil: (libc)Inverse Trig Functions.
- * atexit: (libc)Cleanups on Exit.
- * atof: (libc)Parsing of Floats.
- * atoi: (libc)Parsing of Integers.
- * atol: (libc)Parsing of Integers.
- * atoll: (libc)Parsing of Integers.
- * backtrace: (libc)Backtraces.
- * backtrace_symbols: (libc)Backtraces.
- * backtrace_symbols_fd: (libc)Backtraces.
- * basename: (libc)Finding Tokens in a String.
- * basename: (libc)Finding Tokens in a String.
- * bcmp: (libc)String/Array Comparison.
- * bcopy: (libc)Copying Strings and Arrays.
- * bind: (libc)Setting Address.
- * bind_textdomain_codeset: (libc)Charset conversion in gettext.
- * bindtextdomain: (libc)Locating gettext catalog.
- * brk: (libc)Resizing the Data Segment.
- * bsearch: (libc)Array Search Function.
- * btowc: (libc)Converting a Character.
- * bzero: (libc)Copying Strings and Arrays.
- * cabs: (libc)Absolute Value.
- * cabsf: (libc)Absolute Value.
- * cabsfN: (libc)Absolute Value.
- * cabsfNx: (libc)Absolute Value.
- * cabsl: (libc)Absolute Value.
- * cacos: (libc)Inverse Trig Functions.
- * cacosf: (libc)Inverse Trig Functions.
- * cacosfN: (libc)Inverse Trig Functions.
- * cacosfNx: (libc)Inverse Trig Functions.
- * cacosh: (libc)Hyperbolic Functions.
- * cacoshf: (libc)Hyperbolic Functions.
- * cacoshfN: (libc)Hyperbolic Functions.
- * cacoshfNx: (libc)Hyperbolic Functions.
- * cacoshl: (libc)Hyperbolic Functions.
- * cacosl: (libc)Inverse Trig Functions.
- * call_once: (libc)Call Once.
- * calloc: (libc)Allocating Cleared Space.
- * canonicalize: (libc)FP Bit Twiddling.
- * canonicalize_file_name: (libc)Symbolic Links.
- * canonicalizef: (libc)FP Bit Twiddling.
- * canonicalizefN: (libc)FP Bit Twiddling.
- * canonicalizefNx: (libc)FP Bit Twiddling.
- * canonicalizel: (libc)FP Bit Twiddling.
- * carg: (libc)Operations on Complex.
- * cargf: (libc)Operations on Complex.
- * cargfN: (libc)Operations on Complex.
- * cargfNx: (libc)Operations on Complex.
- * cargl: (libc)Operations on Complex.
- * casin: (libc)Inverse Trig Functions.
- * casinf: (libc)Inverse Trig Functions.
- * casinfN: (libc)Inverse Trig Functions.
- * casinfNx: (libc)Inverse Trig Functions.
- * casinh: (libc)Hyperbolic Functions.
- * casinhf: (libc)Hyperbolic Functions.
- * casinhfN: (libc)Hyperbolic Functions.
- * casinhfNx: (libc)Hyperbolic Functions.
- * casinhl: (libc)Hyperbolic Functions.
- * casinl: (libc)Inverse Trig Functions.
- * catan: (libc)Inverse Trig Functions.
- * catanf: (libc)Inverse Trig Functions.
- * catanfN: (libc)Inverse Trig Functions.
- * catanfNx: (libc)Inverse Trig Functions.
- * catanh: (libc)Hyperbolic Functions.
- * catanhf: (libc)Hyperbolic Functions.
- * catanhfN: (libc)Hyperbolic Functions.
- * catanhfNx: (libc)Hyperbolic Functions.
- * catanhl: (libc)Hyperbolic Functions.
- * catanl: (libc)Inverse Trig Functions.
- * catclose: (libc)The catgets Functions.
- * catgets: (libc)The catgets Functions.
- * catopen: (libc)The catgets Functions.
- * cbrt: (libc)Exponents and Logarithms.
- * cbrtf: (libc)Exponents and Logarithms.
- * cbrtfN: (libc)Exponents and Logarithms.
- * cbrtfNx: (libc)Exponents and Logarithms.
- * cbrtl: (libc)Exponents and Logarithms.
- * ccos: (libc)Trig Functions.
- * ccosf: (libc)Trig Functions.
- * ccosfN: (libc)Trig Functions.
- * ccosfNx: (libc)Trig Functions.
- * ccosh: (libc)Hyperbolic Functions.
- * ccoshf: (libc)Hyperbolic Functions.
- * ccoshfN: (libc)Hyperbolic Functions.
- * ccoshfNx: (libc)Hyperbolic Functions.
- * ccoshl: (libc)Hyperbolic Functions.
- * ccosl: (libc)Trig Functions.
- * ceil: (libc)Rounding Functions.
- * ceilf: (libc)Rounding Functions.
- * ceilfN: (libc)Rounding Functions.
- * ceilfNx: (libc)Rounding Functions.
- * ceill: (libc)Rounding Functions.
- * cexp: (libc)Exponents and Logarithms.
- * cexpf: (libc)Exponents and Logarithms.
- * cexpfN: (libc)Exponents and Logarithms.
- * cexpfNx: (libc)Exponents and Logarithms.
- * cexpl: (libc)Exponents and Logarithms.
- * cfgetibaud: (libc)Line Speed.
- * cfgetispeed: (libc)Line Speed.
- * cfgetobaud: (libc)Line Speed.
- * cfgetospeed: (libc)Line Speed.
- * cfmakeraw: (libc)Noncanonical Input.
- * cfsetbaud: (libc)Line Speed.
- * cfsetibaud: (libc)Line Speed.
- * cfsetispeed: (libc)Line Speed.
- * cfsetobaud: (libc)Line Speed.
- * cfsetospeed: (libc)Line Speed.
- * cfsetspeed: (libc)Line Speed.
- * chdir: (libc)Working Directory.
- * chmod: (libc)Setting Permissions.
- * chown: (libc)File Owner.
- * cimag: (libc)Operations on Complex.
- * cimagf: (libc)Operations on Complex.
- * cimagfN: (libc)Operations on Complex.
- * cimagfNx: (libc)Operations on Complex.
- * cimagl: (libc)Operations on Complex.
- * clearenv: (libc)Environment Access.
- * clearerr: (libc)Error Recovery.
- * clearerr_unlocked: (libc)Error Recovery.
- * clock: (libc)CPU Time.
- * clock_getres: (libc)Getting the Time.
- * clock_gettime: (libc)Getting the Time.
- * clock_nanosleep: (libc)Sleeping.
- * clock_settime: (libc)Setting and Adjusting the Time.
- * clog10: (libc)Exponents and Logarithms.
- * clog10f: (libc)Exponents and Logarithms.
- * clog10fN: (libc)Exponents and Logarithms.
- * clog10fNx: (libc)Exponents and Logarithms.
- * clog10l: (libc)Exponents and Logarithms.
- * clog: (libc)Exponents and Logarithms.
- * clogf: (libc)Exponents and Logarithms.
- * clogfN: (libc)Exponents and Logarithms.
- * clogfNx: (libc)Exponents and Logarithms.
- * clogl: (libc)Exponents and Logarithms.
- * close: (libc)Opening and Closing Files.
- * close_range: (libc)Opening and Closing Files.
- * closedir: (libc)Reading/Closing Directory.
- * closefrom: (libc)Opening and Closing Files.
- * closelog: (libc)closelog.
- * cnd_broadcast: (libc)ISO C Condition Variables.
- * cnd_destroy: (libc)ISO C Condition Variables.
- * cnd_init: (libc)ISO C Condition Variables.
- * cnd_signal: (libc)ISO C Condition Variables.
- * cnd_timedwait: (libc)ISO C Condition Variables.
- * cnd_wait: (libc)ISO C Condition Variables.
- * compoundn: (libc)Exponents and Logarithms.
- * compoundnf: (libc)Exponents and Logarithms.
- * compoundnfN: (libc)Exponents and Logarithms.
- * compoundnfNx: (libc)Exponents and Logarithms.
- * compoundnl: (libc)Exponents and Logarithms.
- * confstr: (libc)String Parameters.
- * conj: (libc)Operations on Complex.
- * conjf: (libc)Operations on Complex.
- * conjfN: (libc)Operations on Complex.
- * conjfNx: (libc)Operations on Complex.
- * conjl: (libc)Operations on Complex.
- * connect: (libc)Connecting.
- * copy_file_range: (libc)Copying File Data.
- * copysign: (libc)FP Bit Twiddling.
- * copysignf: (libc)FP Bit Twiddling.
- * copysignfN: (libc)FP Bit Twiddling.
- * copysignfNx: (libc)FP Bit Twiddling.
- * copysignl: (libc)FP Bit Twiddling.
- * cos: (libc)Trig Functions.
- * cosf: (libc)Trig Functions.
- * cosfN: (libc)Trig Functions.
- * cosfNx: (libc)Trig Functions.
- * cosh: (libc)Hyperbolic Functions.
- * coshf: (libc)Hyperbolic Functions.
- * coshfN: (libc)Hyperbolic Functions.
- * coshfNx: (libc)Hyperbolic Functions.
- * coshl: (libc)Hyperbolic Functions.
- * cosl: (libc)Trig Functions.
- * cospi: (libc)Trig Functions.
- * cospif: (libc)Trig Functions.
- * cospifN: (libc)Trig Functions.
- * cospifNx: (libc)Trig Functions.
- * cospil: (libc)Trig Functions.
- * cpow: (libc)Exponents and Logarithms.
- * cpowf: (libc)Exponents and Logarithms.
- * cpowfN: (libc)Exponents and Logarithms.
- * cpowfNx: (libc)Exponents and Logarithms.
- * cpowl: (libc)Exponents and Logarithms.
- * cproj: (libc)Operations on Complex.
- * cprojf: (libc)Operations on Complex.
- * cprojfN: (libc)Operations on Complex.
- * cprojfNx: (libc)Operations on Complex.
- * cprojl: (libc)Operations on Complex.
- * creal: (libc)Operations on Complex.
- * crealf: (libc)Operations on Complex.
- * crealfN: (libc)Operations on Complex.
- * crealfNx: (libc)Operations on Complex.
- * creall: (libc)Operations on Complex.
- * creat64: (libc)Opening and Closing Files.
- * creat: (libc)Opening and Closing Files.
- * csin: (libc)Trig Functions.
- * csinf: (libc)Trig Functions.
- * csinfN: (libc)Trig Functions.
- * csinfNx: (libc)Trig Functions.
- * csinh: (libc)Hyperbolic Functions.
- * csinhf: (libc)Hyperbolic Functions.
- * csinhfN: (libc)Hyperbolic Functions.
- * csinhfNx: (libc)Hyperbolic Functions.
- * csinhl: (libc)Hyperbolic Functions.
- * csinl: (libc)Trig Functions.
- * csqrt: (libc)Exponents and Logarithms.
- * csqrtf: (libc)Exponents and Logarithms.
- * csqrtfN: (libc)Exponents and Logarithms.
- * csqrtfNx: (libc)Exponents and Logarithms.
- * csqrtl: (libc)Exponents and Logarithms.
- * ctan: (libc)Trig Functions.
- * ctanf: (libc)Trig Functions.
- * ctanfN: (libc)Trig Functions.
- * ctanfNx: (libc)Trig Functions.
- * ctanh: (libc)Hyperbolic Functions.
- * ctanhf: (libc)Hyperbolic Functions.
- * ctanhfN: (libc)Hyperbolic Functions.
- * ctanhfNx: (libc)Hyperbolic Functions.
- * ctanhl: (libc)Hyperbolic Functions.
- * ctanl: (libc)Trig Functions.
- * ctermid: (libc)Identifying the Terminal.
- * ctime: (libc)Formatting Calendar Time.
- * ctime_r: (libc)Formatting Calendar Time.
- * cuserid: (libc)Who Logged In.
- * daddl: (libc)Misc FP Arithmetic.
- * dcgettext: (libc)Translation with gettext.
- * dcngettext: (libc)Advanced gettext functions.
- * ddivl: (libc)Misc FP Arithmetic.
- * dfmal: (libc)Misc FP Arithmetic.
- * dgettext: (libc)Translation with gettext.
- * difftime: (libc)Calculating Elapsed Time.
- * dirfd: (libc)Opening a Directory.
- * dirname: (libc)Finding Tokens in a String.
- * div: (libc)Integer Division.
- * dlinfo: (libc)Dynamic Linker Introspection.
- * dmull: (libc)Misc FP Arithmetic.
- * dngettext: (libc)Advanced gettext functions.
- * dprintf: (libc)Formatted Output Functions.
- * drand48: (libc)SVID Random.
- * drand48_r: (libc)SVID Random.
- * drem: (libc)Remainder Functions.
- * dremf: (libc)Remainder Functions.
- * dreml: (libc)Remainder Functions.
- * dsqrtl: (libc)Misc FP Arithmetic.
- * dsubl: (libc)Misc FP Arithmetic.
- * dup2: (libc)Duplicating Descriptors.
- * dup3: (libc)Duplicating Descriptors.
- * dup: (libc)Duplicating Descriptors.
- * ecvt: (libc)System V Number Conversion.
- * ecvt_r: (libc)System V Number Conversion.
- * endfsent: (libc)fstab.
- * endgrent: (libc)Scanning All Groups.
- * endhostent: (libc)Host Names.
- * endmntent: (libc)mtab.
- * endnetent: (libc)Networks Database.
- * endnetgrent: (libc)Lookup Netgroup.
- * endprotoent: (libc)Protocols Database.
- * endpwent: (libc)Scanning All Users.
- * endservent: (libc)Services Database.
- * endutent: (libc)Manipulating the Database.
- * endutxent: (libc)XPG Functions.
- * envz_add: (libc)Envz Functions.
- * envz_entry: (libc)Envz Functions.
- * envz_get: (libc)Envz Functions.
- * envz_merge: (libc)Envz Functions.
- * envz_remove: (libc)Envz Functions.
- * envz_strip: (libc)Envz Functions.
- * epoll_create: (libc)Other Low-Level I/O APIs.
- * epoll_wait: (libc)Other Low-Level I/O APIs.
- * erand48: (libc)SVID Random.
- * erand48_r: (libc)SVID Random.
- * erf: (libc)Special Functions.
- * erfc: (libc)Special Functions.
- * erfcf: (libc)Special Functions.
- * erfcfN: (libc)Special Functions.
- * erfcfNx: (libc)Special Functions.
- * erfcl: (libc)Special Functions.
- * erff: (libc)Special Functions.
- * erffN: (libc)Special Functions.
- * erffNx: (libc)Special Functions.
- * erfl: (libc)Special Functions.
- * err: (libc)Error Messages.
- * errno: (libc)Checking for Errors.
- * error: (libc)Error Messages.
- * error_at_line: (libc)Error Messages.
- * errx: (libc)Error Messages.
- * execl: (libc)Executing a File.
- * execle: (libc)Executing a File.
- * execlp: (libc)Executing a File.
- * execv: (libc)Executing a File.
- * execve: (libc)Executing a File.
- * execvp: (libc)Executing a File.
- * exit: (libc)Normal Termination.
- * exp10: (libc)Exponents and Logarithms.
- * exp10f: (libc)Exponents and Logarithms.
- * exp10fN: (libc)Exponents and Logarithms.
- * exp10fNx: (libc)Exponents and Logarithms.
- * exp10l: (libc)Exponents and Logarithms.
- * exp10m1: (libc)Exponents and Logarithms.
- * exp10m1f: (libc)Exponents and Logarithms.
- * exp10m1fN: (libc)Exponents and Logarithms.
- * exp10m1fNx: (libc)Exponents and Logarithms.
- * exp10m1l: (libc)Exponents and Logarithms.
- * exp2: (libc)Exponents and Logarithms.
- * exp2f: (libc)Exponents and Logarithms.
- * exp2fN: (libc)Exponents and Logarithms.
- * exp2fNx: (libc)Exponents and Logarithms.
- * exp2l: (libc)Exponents and Logarithms.
- * exp2m1: (libc)Exponents and Logarithms.
- * exp2m1f: (libc)Exponents and Logarithms.
- * exp2m1fN: (libc)Exponents and Logarithms.
- * exp2m1fNx: (libc)Exponents and Logarithms.
- * exp2m1l: (libc)Exponents and Logarithms.
- * exp: (libc)Exponents and Logarithms.
- * expf: (libc)Exponents and Logarithms.
- * expfN: (libc)Exponents and Logarithms.
- * expfNx: (libc)Exponents and Logarithms.
- * expl: (libc)Exponents and Logarithms.
- * explicit_bzero: (libc)Erasing Sensitive Data.
- * expm1: (libc)Exponents and Logarithms.
- * expm1f: (libc)Exponents and Logarithms.
- * expm1fN: (libc)Exponents and Logarithms.
- * expm1fNx: (libc)Exponents and Logarithms.
- * expm1l: (libc)Exponents and Logarithms.
- * fMaddfN: (libc)Misc FP Arithmetic.
- * fMaddfNx: (libc)Misc FP Arithmetic.
- * fMdivfN: (libc)Misc FP Arithmetic.
- * fMdivfNx: (libc)Misc FP Arithmetic.
- * fMfmafN: (libc)Misc FP Arithmetic.
- * fMfmafNx: (libc)Misc FP Arithmetic.
- * fMmulfN: (libc)Misc FP Arithmetic.
- * fMmulfNx: (libc)Misc FP Arithmetic.
- * fMsqrtfN: (libc)Misc FP Arithmetic.
- * fMsqrtfNx: (libc)Misc FP Arithmetic.
- * fMsubfN: (libc)Misc FP Arithmetic.
- * fMsubfNx: (libc)Misc FP Arithmetic.
- * fMxaddfN: (libc)Misc FP Arithmetic.
- * fMxaddfNx: (libc)Misc FP Arithmetic.
- * fMxdivfN: (libc)Misc FP Arithmetic.
- * fMxdivfNx: (libc)Misc FP Arithmetic.
- * fMxfmafN: (libc)Misc FP Arithmetic.
- * fMxfmafNx: (libc)Misc FP Arithmetic.
- * fMxmulfN: (libc)Misc FP Arithmetic.
- * fMxmulfNx: (libc)Misc FP Arithmetic.
- * fMxsqrtfN: (libc)Misc FP Arithmetic.
- * fMxsqrtfNx: (libc)Misc FP Arithmetic.
- * fMxsubfN: (libc)Misc FP Arithmetic.
- * fMxsubfNx: (libc)Misc FP Arithmetic.
- * fabs: (libc)Absolute Value.
- * fabsf: (libc)Absolute Value.
- * fabsfN: (libc)Absolute Value.
- * fabsfNx: (libc)Absolute Value.
- * fabsl: (libc)Absolute Value.
- * faccessat: (libc)Testing File Access.
- * fadd: (libc)Misc FP Arithmetic.
- * faddl: (libc)Misc FP Arithmetic.
- * fchdir: (libc)Working Directory.
- * fchmod: (libc)Setting Permissions.
- * fchown: (libc)File Owner.
- * fclose: (libc)Closing Streams.
- * fcloseall: (libc)Closing Streams.
- * fcntl: (libc)Control Operations.
- * fcvt: (libc)System V Number Conversion.
- * fcvt_r: (libc)System V Number Conversion.
- * fdatasync: (libc)Synchronizing I/O.
- * fdim: (libc)Misc FP Arithmetic.
- * fdimf: (libc)Misc FP Arithmetic.
- * fdimfN: (libc)Misc FP Arithmetic.
- * fdimfNx: (libc)Misc FP Arithmetic.
- * fdiml: (libc)Misc FP Arithmetic.
- * fdiv: (libc)Misc FP Arithmetic.
- * fdivl: (libc)Misc FP Arithmetic.
- * fdopen: (libc)Descriptors and Streams.
- * fdopendir: (libc)Opening a Directory.
- * feclearexcept: (libc)Status bit operations.
- * fedisableexcept: (libc)Control Functions.
- * feenableexcept: (libc)Control Functions.
- * fegetenv: (libc)Control Functions.
- * fegetexcept: (libc)Control Functions.
- * fegetexceptflag: (libc)Status bit operations.
- * fegetmode: (libc)Control Functions.
- * fegetround: (libc)Rounding.
- * feholdexcept: (libc)Control Functions.
- * feof: (libc)EOF and Errors.
- * feof_unlocked: (libc)EOF and Errors.
- * feraiseexcept: (libc)Status bit operations.
- * ferror: (libc)EOF and Errors.
- * ferror_unlocked: (libc)EOF and Errors.
- * fesetenv: (libc)Control Functions.
- * fesetexcept: (libc)Status bit operations.
- * fesetexceptflag: (libc)Status bit operations.
- * fesetmode: (libc)Control Functions.
- * fesetround: (libc)Rounding.
- * fetestexcept: (libc)Status bit operations.
- * fetestexceptflag: (libc)Status bit operations.
- * feupdateenv: (libc)Control Functions.
- * fexecve: (libc)Executing a File.
- * fflush: (libc)Flushing Buffers.
- * fflush_unlocked: (libc)Flushing Buffers.
- * ffma: (libc)Misc FP Arithmetic.
- * ffmal: (libc)Misc FP Arithmetic.
- * fgetc: (libc)Character Input.
- * fgetc_unlocked: (libc)Character Input.
- * fgetgrent: (libc)Scanning All Groups.
- * fgetgrent_r: (libc)Scanning All Groups.
- * fgetpos64: (libc)Portable Positioning.
- * fgetpos: (libc)Portable Positioning.
- * fgetpwent: (libc)Scanning All Users.
- * fgetpwent_r: (libc)Scanning All Users.
- * fgets: (libc)Line Input.
- * fgets_unlocked: (libc)Line Input.
- * fgetwc: (libc)Character Input.
- * fgetwc_unlocked: (libc)Character Input.
- * fgetws: (libc)Line Input.
- * fgetws_unlocked: (libc)Line Input.
- * fileno: (libc)Descriptors and Streams.
- * fileno_unlocked: (libc)Descriptors and Streams.
- * finite: (libc)Floating Point Classes.
- * finitef: (libc)Floating Point Classes.
- * finitel: (libc)Floating Point Classes.
- * flockfile: (libc)Streams and Threads.
- * floor: (libc)Rounding Functions.
- * floorf: (libc)Rounding Functions.
- * floorfN: (libc)Rounding Functions.
- * floorfNx: (libc)Rounding Functions.
- * floorl: (libc)Rounding Functions.
- * fma: (libc)Misc FP Arithmetic.
- * fmaf: (libc)Misc FP Arithmetic.
- * fmafN: (libc)Misc FP Arithmetic.
- * fmafNx: (libc)Misc FP Arithmetic.
- * fmal: (libc)Misc FP Arithmetic.
- * fmax: (libc)Misc FP Arithmetic.
- * fmaxf: (libc)Misc FP Arithmetic.
- * fmaxfN: (libc)Misc FP Arithmetic.
- * fmaxfNx: (libc)Misc FP Arithmetic.
- * fmaximum: (libc)Misc FP Arithmetic.
- * fmaximum_mag: (libc)Misc FP Arithmetic.
- * fmaximum_mag_num: (libc)Misc FP Arithmetic.
- * fmaximum_mag_numf: (libc)Misc FP Arithmetic.
- * fmaximum_mag_numfN: (libc)Misc FP Arithmetic.
- * fmaximum_mag_numfNx: (libc)Misc FP Arithmetic.
- * fmaximum_mag_numl: (libc)Misc FP Arithmetic.
- * fmaximum_magf: (libc)Misc FP Arithmetic.
- * fmaximum_magfN: (libc)Misc FP Arithmetic.
- * fmaximum_magfNx: (libc)Misc FP Arithmetic.
- * fmaximum_magl: (libc)Misc FP Arithmetic.
- * fmaximum_num: (libc)Misc FP Arithmetic.
- * fmaximum_numf: (libc)Misc FP Arithmetic.
- * fmaximum_numfN: (libc)Misc FP Arithmetic.
- * fmaximum_numfNx: (libc)Misc FP Arithmetic.
- * fmaximum_numl: (libc)Misc FP Arithmetic.
- * fmaximumf: (libc)Misc FP Arithmetic.
- * fmaximumfN: (libc)Misc FP Arithmetic.
- * fmaximumfNx: (libc)Misc FP Arithmetic.
- * fmaximuml: (libc)Misc FP Arithmetic.
- * fmaxl: (libc)Misc FP Arithmetic.
- * fmaxmag: (libc)Misc FP Arithmetic.
- * fmaxmagf: (libc)Misc FP Arithmetic.
- * fmaxmagfN: (libc)Misc FP Arithmetic.
- * fmaxmagfNx: (libc)Misc FP Arithmetic.
- * fmaxmagl: (libc)Misc FP Arithmetic.
- * fmemopen: (libc)String Streams.
- * fmin: (libc)Misc FP Arithmetic.
- * fminf: (libc)Misc FP Arithmetic.
- * fminfN: (libc)Misc FP Arithmetic.
- * fminfNx: (libc)Misc FP Arithmetic.
- * fminimum: (libc)Misc FP Arithmetic.
- * fminimum_mag: (libc)Misc FP Arithmetic.
- * fminimum_mag_num: (libc)Misc FP Arithmetic.
- * fminimum_mag_numf: (libc)Misc FP Arithmetic.
- * fminimum_mag_numfN: (libc)Misc FP Arithmetic.
- * fminimum_mag_numfNx: (libc)Misc FP Arithmetic.
- * fminimum_mag_numl: (libc)Misc FP Arithmetic.
- * fminimum_magf: (libc)Misc FP Arithmetic.
- * fminimum_magfN: (libc)Misc FP Arithmetic.
- * fminimum_magfNx: (libc)Misc FP Arithmetic.
- * fminimum_magl: (libc)Misc FP Arithmetic.
- * fminimum_num: (libc)Misc FP Arithmetic.
- * fminimum_numf: (libc)Misc FP Arithmetic.
- * fminimum_numfN: (libc)Misc FP Arithmetic.
- * fminimum_numfNx: (libc)Misc FP Arithmetic.
- * fminimum_numl: (libc)Misc FP Arithmetic.
- * fminimumf: (libc)Misc FP Arithmetic.
- * fminimumfN: (libc)Misc FP Arithmetic.
- * fminimumfNx: (libc)Misc FP Arithmetic.
- * fminimuml: (libc)Misc FP Arithmetic.
- * fminl: (libc)Misc FP Arithmetic.
- * fminmag: (libc)Misc FP Arithmetic.
- * fminmagf: (libc)Misc FP Arithmetic.
- * fminmagfN: (libc)Misc FP Arithmetic.
- * fminmagfNx: (libc)Misc FP Arithmetic.
- * fminmagl: (libc)Misc FP Arithmetic.
- * fmod: (libc)Remainder Functions.
- * fmodf: (libc)Remainder Functions.
- * fmodfN: (libc)Remainder Functions.
- * fmodfNx: (libc)Remainder Functions.
- * fmodl: (libc)Remainder Functions.
- * fmtmsg: (libc)Printing Formatted Messages.
- * fmul: (libc)Misc FP Arithmetic.
- * fmull: (libc)Misc FP Arithmetic.
- * fnmatch: (libc)Wildcard Matching.
- * fopen64: (libc)Opening Streams.
- * fopen: (libc)Opening Streams.
- * fopencookie: (libc)Streams and Cookies.
- * fork: (libc)Creating a Process.
- * forkpty: (libc)Pseudo-Terminal Pairs.
- * fpathconf: (libc)Pathconf.
- * fpclassify: (libc)Floating Point Classes.
- * fprintf: (libc)Formatted Output Functions.
- * fputc: (libc)Simple Output.
- * fputc_unlocked: (libc)Simple Output.
- * fputs: (libc)Simple Output.
- * fputs_unlocked: (libc)Simple Output.
- * fputwc: (libc)Simple Output.
- * fputwc_unlocked: (libc)Simple Output.
- * fputws: (libc)Simple Output.
- * fputws_unlocked: (libc)Simple Output.
- * fread: (libc)Block Input/Output.
- * fread_unlocked: (libc)Block Input/Output.
- * free: (libc)Freeing after Malloc.
- * free_aligned_sized: (libc)Freeing after Malloc.
- * free_sized: (libc)Freeing after Malloc.
- * freopen64: (libc)Opening Streams.
- * freopen: (libc)Opening Streams.
- * frexp: (libc)Normalization Functions.
- * frexpf: (libc)Normalization Functions.
- * frexpfN: (libc)Normalization Functions.
- * frexpfNx: (libc)Normalization Functions.
- * frexpl: (libc)Normalization Functions.
- * fromfp: (libc)Rounding Functions.
- * fromfpf: (libc)Rounding Functions.
- * fromfpfN: (libc)Rounding Functions.
- * fromfpfNx: (libc)Rounding Functions.
- * fromfpl: (libc)Rounding Functions.
- * fromfpx: (libc)Rounding Functions.
- * fromfpxf: (libc)Rounding Functions.
- * fromfpxfN: (libc)Rounding Functions.
- * fromfpxfNx: (libc)Rounding Functions.
- * fromfpxl: (libc)Rounding Functions.
- * fscanf: (libc)Formatted Input Functions.
- * fseek: (libc)File Positioning.
- * fseeko64: (libc)File Positioning.
- * fseeko: (libc)File Positioning.
- * fsetpos64: (libc)Portable Positioning.
- * fsetpos: (libc)Portable Positioning.
- * fsqrt: (libc)Misc FP Arithmetic.
- * fsqrtl: (libc)Misc FP Arithmetic.
- * fstat64: (libc)Reading Attributes.
- * fstat: (libc)Reading Attributes.
- * fstatat64: (libc)Reading Attributes.
- * fstatat: (libc)Reading Attributes.
- * fsub: (libc)Misc FP Arithmetic.
- * fsubl: (libc)Misc FP Arithmetic.
- * fsync: (libc)Synchronizing I/O.
- * ftell: (libc)File Positioning.
- * ftello64: (libc)File Positioning.
- * ftello: (libc)File Positioning.
- * ftruncate64: (libc)File Size.
- * ftruncate: (libc)File Size.
- * ftrylockfile: (libc)Streams and Threads.
- * ftw64: (libc)Working with Directory Trees.
- * ftw: (libc)Working with Directory Trees.
- * funlockfile: (libc)Streams and Threads.
- * futimens: (libc)File Times.
- * futimes: (libc)File Times.
- * fwide: (libc)Streams and I18N.
- * fwprintf: (libc)Formatted Output Functions.
- * fwrite: (libc)Block Input/Output.
- * fwrite_unlocked: (libc)Block Input/Output.
- * fwscanf: (libc)Formatted Input Functions.
- * gamma: (libc)Special Functions.
- * gammaf: (libc)Special Functions.
- * gammal: (libc)Special Functions.
- * gcvt: (libc)System V Number Conversion.
- * get_avphys_pages: (libc)Query Memory Parameters.
- * get_current_dir_name: (libc)Working Directory.
- * get_nprocs: (libc)Processor Resources.
- * get_nprocs_conf: (libc)Processor Resources.
- * get_phys_pages: (libc)Query Memory Parameters.
- * getauxval: (libc)Auxiliary Vector.
- * getc: (libc)Character Input.
- * getc_unlocked: (libc)Character Input.
- * getchar: (libc)Character Input.
- * getchar_unlocked: (libc)Character Input.
- * getcontext: (libc)System V contexts.
- * getcpu: (libc)CPU Affinity.
- * getcwd: (libc)Working Directory.
- * getdate: (libc)General Time String Parsing.
- * getdate_r: (libc)General Time String Parsing.
- * getdelim: (libc)Line Input.
- * getdents64: (libc)Low-level Directory Access.
- * getdomainname: (libc)Host Identification.
- * getegid: (libc)Reading Persona.
- * getentropy: (libc)Unpredictable Bytes.
- * getenv: (libc)Environment Access.
- * geteuid: (libc)Reading Persona.
- * getfsent: (libc)fstab.
- * getfsfile: (libc)fstab.
- * getfsspec: (libc)fstab.
- * getgid: (libc)Reading Persona.
- * getgrent: (libc)Scanning All Groups.
- * getgrent_r: (libc)Scanning All Groups.
- * getgrgid: (libc)Lookup Group.
- * getgrgid_r: (libc)Lookup Group.
- * getgrnam: (libc)Lookup Group.
- * getgrnam_r: (libc)Lookup Group.
- * getgrouplist: (libc)Setting Groups.
- * getgroups: (libc)Reading Persona.
- * gethostbyaddr: (libc)Host Names.
- * gethostbyaddr_r: (libc)Host Names.
- * gethostbyname2: (libc)Host Names.
- * gethostbyname2_r: (libc)Host Names.
- * gethostbyname: (libc)Host Names.
- * gethostbyname_r: (libc)Host Names.
- * gethostent: (libc)Host Names.
- * gethostid: (libc)Host Identification.
- * gethostname: (libc)Host Identification.
- * getitimer: (libc)Setting an Alarm.
- * getline: (libc)Line Input.
- * getloadavg: (libc)Processor Resources.
- * getlogin: (libc)Who Logged In.
- * getmntent: (libc)mtab.
- * getmntent_r: (libc)mtab.
- * getnetbyaddr: (libc)Networks Database.
- * getnetbyname: (libc)Networks Database.
- * getnetent: (libc)Networks Database.
- * getnetgrent: (libc)Lookup Netgroup.
- * getnetgrent_r: (libc)Lookup Netgroup.
- * getopt: (libc)Using Getopt.
- * getopt_long: (libc)Getopt Long Options.
- * getopt_long_only: (libc)Getopt Long Options.
- * getpagesize: (libc)Query Memory Parameters.
- * getpass: (libc)getpass.
- * getpayload: (libc)FP Bit Twiddling.
- * getpayloadf: (libc)FP Bit Twiddling.
- * getpayloadfN: (libc)FP Bit Twiddling.
- * getpayloadfNx: (libc)FP Bit Twiddling.
- * getpayloadl: (libc)FP Bit Twiddling.
- * getpeername: (libc)Who is Connected.
- * getpgid: (libc)Process Group Functions.
- * getpgrp: (libc)Process Group Functions.
- * getpid: (libc)Process Identification.
- * getppid: (libc)Process Identification.
- * getpriority: (libc)Traditional Scheduling Functions.
- * getprotobyname: (libc)Protocols Database.
- * getprotobynumber: (libc)Protocols Database.
- * getprotoent: (libc)Protocols Database.
- * getpt: (libc)Allocation.
- * getpwent: (libc)Scanning All Users.
- * getpwent_r: (libc)Scanning All Users.
- * getpwnam: (libc)Lookup User.
- * getpwnam_r: (libc)Lookup User.
- * getpwuid: (libc)Lookup User.
- * getpwuid_r: (libc)Lookup User.
- * getrandom: (libc)Unpredictable Bytes.
- * getrlimit64: (libc)Limits on Resources.
- * getrlimit: (libc)Limits on Resources.
- * getrusage: (libc)Resource Usage.
- * gets: (libc)Line Input.
- * getservbyname: (libc)Services Database.
- * getservbyport: (libc)Services Database.
- * getservent: (libc)Services Database.
- * getsid: (libc)Process Group Functions.
- * getsockname: (libc)Reading Address.
- * getsockopt: (libc)Socket Option Functions.
- * getsubopt: (libc)Suboptions.
- * gettext: (libc)Translation with gettext.
- * gettid: (libc)Process Identification.
- * gettimeofday: (libc)Getting the Time.
- * getuid: (libc)Reading Persona.
- * getumask: (libc)Setting Permissions.
- * getutent: (libc)Manipulating the Database.
- * getutent_r: (libc)Manipulating the Database.
- * getutid: (libc)Manipulating the Database.
- * getutid_r: (libc)Manipulating the Database.
- * getutline: (libc)Manipulating the Database.
- * getutline_r: (libc)Manipulating the Database.
- * getutmp: (libc)XPG Functions.
- * getutmpx: (libc)XPG Functions.
- * getutxent: (libc)XPG Functions.
- * getutxid: (libc)XPG Functions.
- * getutxline: (libc)XPG Functions.
- * getw: (libc)Character Input.
- * getwc: (libc)Character Input.
- * getwc_unlocked: (libc)Character Input.
- * getwchar: (libc)Character Input.
- * getwchar_unlocked: (libc)Character Input.
- * getwd: (libc)Working Directory.
- * glob64: (libc)Calling Glob.
- * glob: (libc)Calling Glob.
- * globfree64: (libc)More Flags for Globbing.
- * globfree: (libc)More Flags for Globbing.
- * gmtime: (libc)Broken-down Time.
- * gmtime_r: (libc)Broken-down Time.
- * grantpt: (libc)Allocation.
- * gsignal: (libc)Signaling Yourself.
- * gtty: (libc)BSD Terminal Modes.
- * hasmntopt: (libc)mtab.
- * hcreate: (libc)Hash Search Function.
- * hcreate_r: (libc)Hash Search Function.
- * hdestroy: (libc)Hash Search Function.
- * hdestroy_r: (libc)Hash Search Function.
- * hsearch: (libc)Hash Search Function.
- * hsearch_r: (libc)Hash Search Function.
- * htonl: (libc)Byte Order.
- * htons: (libc)Byte Order.
- * hypot: (libc)Exponents and Logarithms.
- * hypotf: (libc)Exponents and Logarithms.
- * hypotfN: (libc)Exponents and Logarithms.
- * hypotfNx: (libc)Exponents and Logarithms.
- * hypotl: (libc)Exponents and Logarithms.
- * iconv: (libc)Generic Conversion Interface.
- * iconv_close: (libc)Generic Conversion Interface.
- * iconv_open: (libc)Generic Conversion Interface.
- * if_freenameindex: (libc)Interface Naming.
- * if_indextoname: (libc)Interface Naming.
- * if_nameindex: (libc)Interface Naming.
- * if_nametoindex: (libc)Interface Naming.
- * ilogb: (libc)Exponents and Logarithms.
- * ilogbf: (libc)Exponents and Logarithms.
- * ilogbfN: (libc)Exponents and Logarithms.
- * ilogbfNx: (libc)Exponents and Logarithms.
- * ilogbl: (libc)Exponents and Logarithms.
- * imaxabs: (libc)Absolute Value.
- * imaxdiv: (libc)Integer Division.
- * in6addr_any: (libc)Host Address Data Type.
- * in6addr_loopback: (libc)Host Address Data Type.
- * index: (libc)Search Functions.
- * inet_addr: (libc)Host Address Functions.
- * inet_aton: (libc)Host Address Functions.
- * inet_lnaof: (libc)Host Address Functions.
- * inet_makeaddr: (libc)Host Address Functions.
- * inet_netof: (libc)Host Address Functions.
- * inet_network: (libc)Host Address Functions.
- * inet_ntoa: (libc)Host Address Functions.
- * inet_ntop: (libc)Host Address Functions.
- * inet_pton: (libc)Host Address Functions.
- * initgroups: (libc)Setting Groups.
- * initstate: (libc)BSD Random.
- * initstate_r: (libc)BSD Random.
- * innetgr: (libc)Netgroup Membership.
- * ioctl: (libc)IOCTLs.
- * isalnum: (libc)Classification of Characters.
- * isalpha: (libc)Classification of Characters.
- * isascii: (libc)Classification of Characters.
- * isatty: (libc)Is It a Terminal.
- * isblank: (libc)Classification of Characters.
- * iscanonical: (libc)Floating Point Classes.
- * iscntrl: (libc)Classification of Characters.
- * isdigit: (libc)Classification of Characters.
- * iseqsig: (libc)FP Comparison Functions.
- * isfinite: (libc)Floating Point Classes.
- * isgraph: (libc)Classification of Characters.
- * isgreater: (libc)FP Comparison Functions.
- * isgreaterequal: (libc)FP Comparison Functions.
- * isinf: (libc)Floating Point Classes.
- * isinff: (libc)Floating Point Classes.
- * isinfl: (libc)Floating Point Classes.
- * isless: (libc)FP Comparison Functions.
- * islessequal: (libc)FP Comparison Functions.
- * islessgreater: (libc)FP Comparison Functions.
- * islower: (libc)Classification of Characters.
- * isnan: (libc)Floating Point Classes.
- * isnan: (libc)Floating Point Classes.
- * isnanf: (libc)Floating Point Classes.
- * isnanl: (libc)Floating Point Classes.
- * isnormal: (libc)Floating Point Classes.
- * isprint: (libc)Classification of Characters.
- * ispunct: (libc)Classification of Characters.
- * issignaling: (libc)Floating Point Classes.
- * isspace: (libc)Classification of Characters.
- * issubnormal: (libc)Floating Point Classes.
- * isunordered: (libc)FP Comparison Functions.
- * isupper: (libc)Classification of Characters.
- * iswalnum: (libc)Classification of Wide Characters.
- * iswalpha: (libc)Classification of Wide Characters.
- * iswblank: (libc)Classification of Wide Characters.
- * iswcntrl: (libc)Classification of Wide Characters.
- * iswctype: (libc)Classification of Wide Characters.
- * iswdigit: (libc)Classification of Wide Characters.
- * iswgraph: (libc)Classification of Wide Characters.
- * iswlower: (libc)Classification of Wide Characters.
- * iswprint: (libc)Classification of Wide Characters.
- * iswpunct: (libc)Classification of Wide Characters.
- * iswspace: (libc)Classification of Wide Characters.
- * iswupper: (libc)Classification of Wide Characters.
- * iswxdigit: (libc)Classification of Wide Characters.
- * isxdigit: (libc)Classification of Characters.
- * iszero: (libc)Floating Point Classes.
- * j0: (libc)Special Functions.
- * j0f: (libc)Special Functions.
- * j0fN: (libc)Special Functions.
- * j0fNx: (libc)Special Functions.
- * j0l: (libc)Special Functions.
- * j1: (libc)Special Functions.
- * j1f: (libc)Special Functions.
- * j1fN: (libc)Special Functions.
- * j1fNx: (libc)Special Functions.
- * j1l: (libc)Special Functions.
- * jn: (libc)Special Functions.
- * jnf: (libc)Special Functions.
- * jnfN: (libc)Special Functions.
- * jnfNx: (libc)Special Functions.
- * jnl: (libc)Special Functions.
- * jrand48: (libc)SVID Random.
- * jrand48_r: (libc)SVID Random.
- * kill: (libc)Signaling Another Process.
- * killpg: (libc)Signaling Another Process.
- * l64a: (libc)Encode Binary Data.
- * labs: (libc)Absolute Value.
- * lcong48: (libc)SVID Random.
- * lcong48_r: (libc)SVID Random.
- * ldexp: (libc)Normalization Functions.
- * ldexpf: (libc)Normalization Functions.
- * ldexpfN: (libc)Normalization Functions.
- * ldexpfNx: (libc)Normalization Functions.
- * ldexpl: (libc)Normalization Functions.
- * ldiv: (libc)Integer Division.
- * lfind: (libc)Array Search Function.
- * lgamma: (libc)Special Functions.
- * lgamma_r: (libc)Special Functions.
- * lgammaf: (libc)Special Functions.
- * lgammafN: (libc)Special Functions.
- * lgammafN_r: (libc)Special Functions.
- * lgammafNx: (libc)Special Functions.
- * lgammafNx_r: (libc)Special Functions.
- * lgammaf_r: (libc)Special Functions.
- * lgammal: (libc)Special Functions.
- * lgammal_r: (libc)Special Functions.
- * link: (libc)Hard Links.
- * linkat: (libc)Hard Links.
- * lio_listio64: (libc)Asynchronous Reads/Writes.
- * lio_listio: (libc)Asynchronous Reads/Writes.
- * listen: (libc)Listening.
- * llabs: (libc)Absolute Value.
- * lldiv: (libc)Integer Division.
- * llogb: (libc)Exponents and Logarithms.
- * llogbf: (libc)Exponents and Logarithms.
- * llogbfN: (libc)Exponents and Logarithms.
- * llogbfNx: (libc)Exponents and Logarithms.
- * llogbl: (libc)Exponents and Logarithms.
- * llrint: (libc)Rounding Functions.
- * llrintf: (libc)Rounding Functions.
- * llrintfN: (libc)Rounding Functions.
- * llrintfNx: (libc)Rounding Functions.
- * llrintl: (libc)Rounding Functions.
- * llround: (libc)Rounding Functions.
- * llroundf: (libc)Rounding Functions.
- * llroundfN: (libc)Rounding Functions.
- * llroundfNx: (libc)Rounding Functions.
- * llroundl: (libc)Rounding Functions.
- * localeconv: (libc)The Lame Way to Locale Data.
- * localtime: (libc)Broken-down Time.
- * localtime_r: (libc)Broken-down Time.
- * log10: (libc)Exponents and Logarithms.
- * log10f: (libc)Exponents and Logarithms.
- * log10fN: (libc)Exponents and Logarithms.
- * log10fNx: (libc)Exponents and Logarithms.
- * log10l: (libc)Exponents and Logarithms.
- * log10p1: (libc)Exponents and Logarithms.
- * log10p1f: (libc)Exponents and Logarithms.
- * log10p1fN: (libc)Exponents and Logarithms.
- * log10p1fNx: (libc)Exponents and Logarithms.
- * log10p1l: (libc)Exponents and Logarithms.
- * log1p: (libc)Exponents and Logarithms.
- * log1pf: (libc)Exponents and Logarithms.
- * log1pfN: (libc)Exponents and Logarithms.
- * log1pfNx: (libc)Exponents and Logarithms.
- * log1pl: (libc)Exponents and Logarithms.
- * log2: (libc)Exponents and Logarithms.
- * log2f: (libc)Exponents and Logarithms.
- * log2fN: (libc)Exponents and Logarithms.
- * log2fNx: (libc)Exponents and Logarithms.
- * log2l: (libc)Exponents and Logarithms.
- * log2p1: (libc)Exponents and Logarithms.
- * log2p1f: (libc)Exponents and Logarithms.
- * log2p1fN: (libc)Exponents and Logarithms.
- * log2p1fNx: (libc)Exponents and Logarithms.
- * log2p1l: (libc)Exponents and Logarithms.
- * log: (libc)Exponents and Logarithms.
- * logb: (libc)Exponents and Logarithms.
- * logbf: (libc)Exponents and Logarithms.
- * logbfN: (libc)Exponents and Logarithms.
- * logbfNx: (libc)Exponents and Logarithms.
- * logbl: (libc)Exponents and Logarithms.
- * logf: (libc)Exponents and Logarithms.
- * logfN: (libc)Exponents and Logarithms.
- * logfNx: (libc)Exponents and Logarithms.
- * login: (libc)Logging In and Out.
- * login_tty: (libc)Logging In and Out.
- * logl: (libc)Exponents and Logarithms.
- * logout: (libc)Logging In and Out.
- * logp1: (libc)Exponents and Logarithms.
- * logp1f: (libc)Exponents and Logarithms.
- * logp1fN: (libc)Exponents and Logarithms.
- * logp1fNx: (libc)Exponents and Logarithms.
- * logp1l: (libc)Exponents and Logarithms.
- * logwtmp: (libc)Logging In and Out.
- * longjmp: (libc)Non-Local Details.
- * lrand48: (libc)SVID Random.
- * lrand48_r: (libc)SVID Random.
- * lrint: (libc)Rounding Functions.
- * lrintf: (libc)Rounding Functions.
- * lrintfN: (libc)Rounding Functions.
- * lrintfNx: (libc)Rounding Functions.
- * lrintl: (libc)Rounding Functions.
- * lround: (libc)Rounding Functions.
- * lroundf: (libc)Rounding Functions.
- * lroundfN: (libc)Rounding Functions.
- * lroundfNx: (libc)Rounding Functions.
- * lroundl: (libc)Rounding Functions.
- * lsearch: (libc)Array Search Function.
- * lseek64: (libc)File Position Primitive.
- * lseek: (libc)File Position Primitive.
- * lstat64: (libc)Reading Attributes.
- * lstat: (libc)Reading Attributes.
- * lutimes: (libc)File Times.
- * madvise: (libc)Memory-mapped I/O.
- * makecontext: (libc)System V contexts.
- * mallinfo2: (libc)Statistics of Malloc.
- * malloc: (libc)Basic Allocation.
- * mallopt: (libc)Malloc Tunable Parameters.
- * mblen: (libc)Non-reentrant Character Conversion.
- * mbrlen: (libc)Converting a Character.
- * mbrtowc: (libc)Converting a Character.
- * mbsinit: (libc)Keeping the state.
- * mbsnrtowcs: (libc)Converting Strings.
- * mbsrtowcs: (libc)Converting Strings.
- * mbstowcs: (libc)Non-reentrant String Conversion.
- * mbtowc: (libc)Non-reentrant Character Conversion.
- * mcheck: (libc)Heap Consistency Checking.
- * memalign: (libc)Aligned Memory Blocks.
- * memalignment: (libc)Aligned Memory Blocks.
- * memccpy: (libc)Copying Strings and Arrays.
- * memchr: (libc)Search Functions.
- * memcmp: (libc)String/Array Comparison.
- * memcpy: (libc)Copying Strings and Arrays.
- * memfd_create: (libc)Memory-mapped I/O.
- * memfrob: (libc)Obfuscating Data.
- * memmem: (libc)Search Functions.
- * memmove: (libc)Copying Strings and Arrays.
- * mempcpy: (libc)Copying Strings and Arrays.
- * memrchr: (libc)Search Functions.
- * memset: (libc)Copying Strings and Arrays.
- * memset_explicit: (libc)Erasing Sensitive Data.
- * mkdir: (libc)Creating Directories.
- * mkdirat: (libc)Creating Directories.
- * mkdtemp: (libc)Temporary Files.
- * mkfifo: (libc)FIFO Special Files.
- * mknod: (libc)Making Special Files.
- * mkstemp: (libc)Temporary Files.
- * mktemp: (libc)Temporary Files.
- * mktime: (libc)Broken-down Time.
- * mlock2: (libc)Page Lock Functions.
- * mlock: (libc)Page Lock Functions.
- * mlockall: (libc)Page Lock Functions.
- * mmap64: (libc)Memory-mapped I/O.
- * mmap: (libc)Memory-mapped I/O.
- * modf: (libc)Rounding Functions.
- * modff: (libc)Rounding Functions.
- * modffN: (libc)Rounding Functions.
- * modffNx: (libc)Rounding Functions.
- * modfl: (libc)Rounding Functions.
- * mount: (libc)Mount-Unmount-Remount.
- * mprobe: (libc)Heap Consistency Checking.
- * mprotect: (libc)Memory Protection.
- * mrand48: (libc)SVID Random.
- * mrand48_r: (libc)SVID Random.
- * mremap: (libc)Memory-mapped I/O.
- * mseal: (libc)Memory Protection.
- * msync: (libc)Memory-mapped I/O.
- * mtrace: (libc)Tracing malloc.
- * mtx_destroy: (libc)ISO C Mutexes.
- * mtx_init: (libc)ISO C Mutexes.
- * mtx_lock: (libc)ISO C Mutexes.
- * mtx_timedlock: (libc)ISO C Mutexes.
- * mtx_trylock: (libc)ISO C Mutexes.
- * mtx_unlock: (libc)ISO C Mutexes.
- * munlock: (libc)Page Lock Functions.
- * munlockall: (libc)Page Lock Functions.
- * munmap: (libc)Memory-mapped I/O.
- * muntrace: (libc)Tracing malloc.
- * nan: (libc)FP Bit Twiddling.
- * nanf: (libc)FP Bit Twiddling.
- * nanfN: (libc)FP Bit Twiddling.
- * nanfNx: (libc)FP Bit Twiddling.
- * nanl: (libc)FP Bit Twiddling.
- * nanosleep: (libc)Sleeping.
- * nearbyint: (libc)Rounding Functions.
- * nearbyintf: (libc)Rounding Functions.
- * nearbyintfN: (libc)Rounding Functions.
- * nearbyintfNx: (libc)Rounding Functions.
- * nearbyintl: (libc)Rounding Functions.
- * nextafter: (libc)FP Bit Twiddling.
- * nextafterf: (libc)FP Bit Twiddling.
- * nextafterfN: (libc)FP Bit Twiddling.
- * nextafterfNx: (libc)FP Bit Twiddling.
- * nextafterl: (libc)FP Bit Twiddling.
- * nextdown: (libc)FP Bit Twiddling.
- * nextdownf: (libc)FP Bit Twiddling.
- * nextdownfN: (libc)FP Bit Twiddling.
- * nextdownfNx: (libc)FP Bit Twiddling.
- * nextdownl: (libc)FP Bit Twiddling.
- * nexttoward: (libc)FP Bit Twiddling.
- * nexttowardf: (libc)FP Bit Twiddling.
- * nexttowardl: (libc)FP Bit Twiddling.
- * nextup: (libc)FP Bit Twiddling.
- * nextupf: (libc)FP Bit Twiddling.
- * nextupfN: (libc)FP Bit Twiddling.
- * nextupfNx: (libc)FP Bit Twiddling.
- * nextupl: (libc)FP Bit Twiddling.
- * nftw64: (libc)Working with Directory Trees.
- * nftw: (libc)Working with Directory Trees.
- * ngettext: (libc)Advanced gettext functions.
- * nice: (libc)Traditional Scheduling Functions.
- * nl_langinfo: (libc)The Elegant and Fast Way.
- * nrand48: (libc)SVID Random.
- * nrand48_r: (libc)SVID Random.
- * ntohl: (libc)Byte Order.
- * ntohs: (libc)Byte Order.
- * ntp_adjtime: (libc)Setting and Adjusting the Time.
- * ntp_gettime: (libc)Setting and Adjusting the Time.
- * obstack_1grow: (libc)Growing Objects.
- * obstack_1grow_fast: (libc)Extra Fast Growing.
- * obstack_alignment_mask: (libc)Obstacks Data Alignment.
- * obstack_alloc: (libc)Allocation in an Obstack.
- * obstack_base: (libc)Status of an Obstack.
- * obstack_blank: (libc)Growing Objects.
- * obstack_blank_fast: (libc)Extra Fast Growing.
- * obstack_chunk_size: (libc)Obstack Chunks.
- * obstack_copy0: (libc)Allocation in an Obstack.
- * obstack_copy: (libc)Allocation in an Obstack.
- * obstack_finish: (libc)Growing Objects.
- * obstack_free: (libc)Freeing Obstack Objects.
- * obstack_grow0: (libc)Growing Objects.
- * obstack_grow: (libc)Growing Objects.
- * obstack_init: (libc)Preparing for Obstacks.
- * obstack_int_grow: (libc)Growing Objects.
- * obstack_int_grow_fast: (libc)Extra Fast Growing.
- * obstack_next_free: (libc)Status of an Obstack.
- * obstack_object_size: (libc)Growing Objects.
- * obstack_object_size: (libc)Status of an Obstack.
- * obstack_printf: (libc)Dynamic Output.
- * obstack_ptr_grow: (libc)Growing Objects.
- * obstack_ptr_grow_fast: (libc)Extra Fast Growing.
- * obstack_room: (libc)Extra Fast Growing.
- * obstack_vprintf: (libc)Variable Arguments Output.
- * offsetof: (libc)Structure Measurement.
- * on_exit: (libc)Cleanups on Exit.
- * open64: (libc)Opening and Closing Files.
- * open: (libc)Opening and Closing Files.
- * open_memstream: (libc)String Streams.
- * openat2: (libc)Opening and Closing Files.
- * openat64: (libc)Opening and Closing Files.
- * openat: (libc)Opening and Closing Files.
- * opendir: (libc)Opening a Directory.
- * openlog: (libc)openlog.
- * openpty: (libc)Pseudo-Terminal Pairs.
- * parse_printf_format: (libc)Parsing a Template String.
- * pathconf: (libc)Pathconf.
- * pause: (libc)Using Pause.
- * pclose: (libc)Pipe to a Subprocess.
- * perror: (libc)Error Messages.
- * pidfd_getpid: (libc)Querying a Process.
- * pipe: (libc)Creating a Pipe.
- * pkey_alloc: (libc)Memory Protection.
- * pkey_free: (libc)Memory Protection.
- * pkey_get: (libc)Memory Protection.
- * pkey_mprotect: (libc)Memory Protection.
- * pkey_set: (libc)Memory Protection.
- * poll: (libc)Other Low-Level I/O APIs.
- * popen: (libc)Pipe to a Subprocess.
- * posix_fallocate64: (libc)Storage Allocation.
- * posix_fallocate: (libc)Storage Allocation.
- * posix_memalign: (libc)Aligned Memory Blocks.
- * posix_openpt: (libc)Allocation.
- * pow: (libc)Exponents and Logarithms.
- * powf: (libc)Exponents and Logarithms.
- * powfN: (libc)Exponents and Logarithms.
- * powfNx: (libc)Exponents and Logarithms.
- * powl: (libc)Exponents and Logarithms.
- * pown: (libc)Exponents and Logarithms.
- * pownf: (libc)Exponents and Logarithms.
- * pownfN: (libc)Exponents and Logarithms.
- * pownfNx: (libc)Exponents and Logarithms.
- * pownl: (libc)Exponents and Logarithms.
- * powr: (libc)Exponents and Logarithms.
- * powrf: (libc)Exponents and Logarithms.
- * powrfN: (libc)Exponents and Logarithms.
- * powrfNx: (libc)Exponents and Logarithms.
- * powrl: (libc)Exponents and Logarithms.
- * pread64: (libc)I/O Primitives.
- * pread: (libc)I/O Primitives.
- * preadv2: (libc)Scatter-Gather.
- * preadv64: (libc)Scatter-Gather.
- * preadv64v2: (libc)Scatter-Gather.
- * preadv: (libc)Scatter-Gather.
- * printf: (libc)Formatted Output Functions.
- * printf_size: (libc)Predefined Printf Handlers.
- * printf_size_info: (libc)Predefined Printf Handlers.
- * psignal: (libc)Signal Messages.
- * pthread_attr_destroy: (libc)Creating and Destroying Threads.
- * pthread_attr_getaffinity_np: (libc)Thread CPU Affinity.
- * pthread_attr_getdetachstate: (libc)Creating and Destroying Threads.
- * pthread_attr_getsigmask_np: (libc)Initial Thread Signal Mask.
- * pthread_attr_init: (libc)Creating and Destroying Threads.
- * pthread_attr_setaffinity_np: (libc)Thread CPU Affinity.
- * pthread_attr_setdetachstate: (libc)Creating and Destroying Threads.
- * pthread_attr_setsigmask_np: (libc)Initial Thread Signal Mask.
- * pthread_barrier_destroy: (libc)POSIX Barriers.
- * pthread_barrier_init: (libc)POSIX Barriers.
- * pthread_barrier_wait: (libc)POSIX Barriers.
- * pthread_clockjoin_np: (libc)Joining Threads.
- * pthread_cond_clockwait: (libc)Waiting with Explicit Clocks.
- * pthread_create: (libc)Creating and Destroying Threads.
- * pthread_detach: (libc)Creating and Destroying Threads.
- * pthread_equal: (libc)POSIX Threads Other APIs.
- * pthread_getaffinity_np: (libc)Thread CPU Affinity.
- * pthread_getattr_default_np: (libc)Default Thread Attributes.
- * pthread_getcpuclockid: (libc)POSIX Threads Other APIs.
- * pthread_getname_np: (libc)Thread Names.
- * pthread_getspecific: (libc)Thread-specific Data.
- * pthread_gettid_np: (libc)Process Identification.
- * pthread_join: (libc)Creating and Destroying Threads.
- * pthread_key_create: (libc)Thread-specific Data.
- * pthread_key_delete: (libc)Thread-specific Data.
- * pthread_kill: (libc)Creating and Destroying Threads.
- * pthread_mutex_clocklock: (libc)POSIX Mutexes.
- * pthread_mutex_destroy: (libc)POSIX Mutexes.
- * pthread_mutex_init: (libc)POSIX Mutexes.
- * pthread_mutex_lock: (libc)POSIX Mutexes.
- * pthread_mutex_timedlock: (libc)POSIX Mutexes.
- * pthread_mutex_trylock: (libc)POSIX Mutexes.
- * pthread_mutex_unlock: (libc)POSIX Mutexes.
- * pthread_mutexattr_destroy: (libc)POSIX Mutexes.
- * pthread_mutexattr_gettype: (libc)POSIX Mutexes.
- * pthread_mutexattr_init: (libc)POSIX Mutexes.
- * pthread_mutexattr_settype: (libc)POSIX Mutexes.
- * pthread_once: (libc)POSIX Threads Other APIs.
- * pthread_rwlock_clockrdlock: (libc)Waiting with Explicit Clocks.
- * pthread_rwlock_clockwrlock: (libc)Waiting with Explicit Clocks.
- * pthread_self: (libc)Creating and Destroying Threads.
- * pthread_setaffinity_np: (libc)Thread CPU Affinity.
- * pthread_setattr_default_np: (libc)Default Thread Attributes.
- * pthread_setname_np: (libc)Thread Names.
- * pthread_setspecific: (libc)Thread-specific Data.
- * pthread_sigmask: (libc)POSIX Threads Other APIs.
- * pthread_spin_destroy: (libc)POSIX Spin Locks.
- * pthread_spin_init: (libc)POSIX Spin Locks.
- * pthread_spin_lock: (libc)POSIX Spin Locks.
- * pthread_spin_trylock: (libc)POSIX Spin Locks.
- * pthread_spin_unlock: (libc)POSIX Spin Locks.
- * pthread_timedjoin_np: (libc)Joining Threads.
- * pthread_tryjoin_np: (libc)Joining Threads.
- * ptsname: (libc)Allocation.
- * ptsname_r: (libc)Allocation.
- * putc: (libc)Simple Output.
- * putc_unlocked: (libc)Simple Output.
- * putchar: (libc)Simple Output.
- * putchar_unlocked: (libc)Simple Output.
- * putenv: (libc)Environment Access.
- * putpwent: (libc)Writing a User Entry.
- * puts: (libc)Simple Output.
- * pututline: (libc)Manipulating the Database.
- * pututxline: (libc)XPG Functions.
- * putw: (libc)Simple Output.
- * putwc: (libc)Simple Output.
- * putwc_unlocked: (libc)Simple Output.
- * putwchar: (libc)Simple Output.
- * putwchar_unlocked: (libc)Simple Output.
- * pwrite64: (libc)I/O Primitives.
- * pwrite: (libc)I/O Primitives.
- * pwritev2: (libc)Scatter-Gather.
- * pwritev64: (libc)Scatter-Gather.
- * pwritev64v2: (libc)Scatter-Gather.
- * pwritev: (libc)Scatter-Gather.
- * qecvt: (libc)System V Number Conversion.
- * qecvt_r: (libc)System V Number Conversion.
- * qfcvt: (libc)System V Number Conversion.
- * qfcvt_r: (libc)System V Number Conversion.
- * qgcvt: (libc)System V Number Conversion.
- * qsort: (libc)Array Sort Function.
- * raise: (libc)Signaling Yourself.
- * rand: (libc)ISO Random.
- * rand_r: (libc)ISO Random.
- * random: (libc)BSD Random.
- * random_r: (libc)BSD Random.
- * rawmemchr: (libc)Search Functions.
- * read: (libc)I/O Primitives.
- * readdir64: (libc)Reading/Closing Directory.
- * readdir64_r: (libc)Reading/Closing Directory.
- * readdir: (libc)Reading/Closing Directory.
- * readdir_r: (libc)Reading/Closing Directory.
- * readlink: (libc)Symbolic Links.
- * readv: (libc)Scatter-Gather.
- * realloc: (libc)Changing Block Size.
- * reallocarray: (libc)Changing Block Size.
- * realpath: (libc)Symbolic Links.
- * recv: (libc)Receiving Data.
- * recvfrom: (libc)Receiving Datagrams.
- * recvmsg: (libc)Other Socket APIs.
- * regcomp: (libc)POSIX Regexp Compilation.
- * regerror: (libc)Regexp Cleanup.
- * regexec: (libc)Matching POSIX Regexps.
- * regfree: (libc)Regexp Cleanup.
- * register_printf_function: (libc)Registering New Conversions.
- * remainder: (libc)Remainder Functions.
- * remainderf: (libc)Remainder Functions.
- * remainderfN: (libc)Remainder Functions.
- * remainderfNx: (libc)Remainder Functions.
- * remainderl: (libc)Remainder Functions.
- * remove: (libc)Deleting Files.
- * rename: (libc)Renaming Files.
- * renameat: (libc)Renaming Files.
- * rewind: (libc)File Positioning.
- * rewinddir: (libc)Random Access Directory.
- * rindex: (libc)Search Functions.
- * rint: (libc)Rounding Functions.
- * rintf: (libc)Rounding Functions.
- * rintfN: (libc)Rounding Functions.
- * rintfNx: (libc)Rounding Functions.
- * rintl: (libc)Rounding Functions.
- * rmdir: (libc)Deleting Files.
- * rootn: (libc)Exponents and Logarithms.
- * rootnf: (libc)Exponents and Logarithms.
- * rootnfN: (libc)Exponents and Logarithms.
- * rootnfNx: (libc)Exponents and Logarithms.
- * rootnl: (libc)Exponents and Logarithms.
- * round: (libc)Rounding Functions.
- * roundeven: (libc)Rounding Functions.
- * roundevenf: (libc)Rounding Functions.
- * roundevenfN: (libc)Rounding Functions.
- * roundevenfNx: (libc)Rounding Functions.
- * roundevenl: (libc)Rounding Functions.
- * roundf: (libc)Rounding Functions.
- * roundfN: (libc)Rounding Functions.
- * roundfNx: (libc)Rounding Functions.
- * roundl: (libc)Rounding Functions.
- * rpmatch: (libc)Yes-or-No Questions.
- * rsqrt: (libc)Exponents and Logarithms.
- * rsqrtf: (libc)Exponents and Logarithms.
- * rsqrtfN: (libc)Exponents and Logarithms.
- * rsqrtfNx: (libc)Exponents and Logarithms.
- * rsqrtl: (libc)Exponents and Logarithms.
- * sbrk: (libc)Resizing the Data Segment.
- * scalb: (libc)Normalization Functions.
- * scalbf: (libc)Normalization Functions.
- * scalbl: (libc)Normalization Functions.
- * scalbln: (libc)Normalization Functions.
- * scalblnf: (libc)Normalization Functions.
- * scalblnfN: (libc)Normalization Functions.
- * scalblnfNx: (libc)Normalization Functions.
- * scalblnl: (libc)Normalization Functions.
- * scalbn: (libc)Normalization Functions.
- * scalbnf: (libc)Normalization Functions.
- * scalbnfN: (libc)Normalization Functions.
- * scalbnfNx: (libc)Normalization Functions.
- * scalbnl: (libc)Normalization Functions.
- * scandir64: (libc)Scanning Directory Content.
- * scandir: (libc)Scanning Directory Content.
- * scanf: (libc)Formatted Input Functions.
- * sched_get_priority_max: (libc)Basic Scheduling Functions.
- * sched_get_priority_min: (libc)Basic Scheduling Functions.
- * sched_getaffinity: (libc)CPU Affinity.
- * sched_getattr: (libc)Extensible Scheduling.
- * sched_getcpu: (libc)CPU Affinity.
- * sched_getparam: (libc)Basic Scheduling Functions.
- * sched_getscheduler: (libc)Basic Scheduling Functions.
- * sched_rr_get_interval: (libc)Basic Scheduling Functions.
- * sched_setaffinity: (libc)CPU Affinity.
- * sched_setattr: (libc)Extensible Scheduling.
- * sched_setparam: (libc)Basic Scheduling Functions.
- * sched_setscheduler: (libc)Basic Scheduling Functions.
- * sched_yield: (libc)Basic Scheduling Functions.
- * secure_getenv: (libc)Environment Access.
- * seed48: (libc)SVID Random.
- * seed48_r: (libc)SVID Random.
- * seekdir: (libc)Random Access Directory.
- * select: (libc)Waiting for I/O.
- * sem_clockwait: (libc)POSIX Semaphores.
- * sem_close: (libc)POSIX Semaphores.
- * sem_destroy: (libc)POSIX Semaphores.
- * sem_getvalue: (libc)POSIX Semaphores.
- * sem_init: (libc)POSIX Semaphores.
- * sem_open: (libc)POSIX Semaphores.
- * sem_post: (libc)POSIX Semaphores.
- * sem_timedwait: (libc)POSIX Semaphores.
- * sem_trywait: (libc)POSIX Semaphores.
- * sem_unlink: (libc)POSIX Semaphores.
- * sem_wait: (libc)POSIX Semaphores.
- * semctl: (libc)Semaphores.
- * semget: (libc)Semaphores.
- * semop: (libc)Semaphores.
- * semtimedop: (libc)Semaphores.
- * send: (libc)Sending Data.
- * sendmsg: (libc)Other Socket APIs.
- * sendto: (libc)Sending Datagrams.
- * setbuf: (libc)Controlling Buffering.
- * setbuffer: (libc)Controlling Buffering.
- * setcontext: (libc)System V contexts.
- * setdomainname: (libc)Host Identification.
- * setegid: (libc)Setting Groups.
- * setenv: (libc)Environment Access.
- * seteuid: (libc)Setting User ID.
- * setfsent: (libc)fstab.
- * setgid: (libc)Setting Groups.
- * setgrent: (libc)Scanning All Groups.
- * setgroups: (libc)Setting Groups.
- * sethostent: (libc)Host Names.
- * sethostid: (libc)Host Identification.
- * sethostname: (libc)Host Identification.
- * setitimer: (libc)Setting an Alarm.
- * setjmp: (libc)Non-Local Details.
- * setlinebuf: (libc)Controlling Buffering.
- * setlocale: (libc)Setting the Locale.
- * setlogmask: (libc)setlogmask.
- * setmntent: (libc)mtab.
- * setnetent: (libc)Networks Database.
- * setnetgrent: (libc)Lookup Netgroup.
- * setpayload: (libc)FP Bit Twiddling.
- * setpayloadf: (libc)FP Bit Twiddling.
- * setpayloadfN: (libc)FP Bit Twiddling.
- * setpayloadfNx: (libc)FP Bit Twiddling.
- * setpayloadl: (libc)FP Bit Twiddling.
- * setpayloadsig: (libc)FP Bit Twiddling.
- * setpayloadsigf: (libc)FP Bit Twiddling.
- * setpayloadsigfN: (libc)FP Bit Twiddling.
- * setpayloadsigfNx: (libc)FP Bit Twiddling.
- * setpayloadsigl: (libc)FP Bit Twiddling.
- * setpgid: (libc)Process Group Functions.
- * setpgrp: (libc)Process Group Functions.
- * setpriority: (libc)Traditional Scheduling Functions.
- * setprotoent: (libc)Protocols Database.
- * setpwent: (libc)Scanning All Users.
- * setregid: (libc)Setting Groups.
- * setreuid: (libc)Setting User ID.
- * setrlimit64: (libc)Limits on Resources.
- * setrlimit: (libc)Limits on Resources.
- * setservent: (libc)Services Database.
- * setsid: (libc)Process Group Functions.
- * setsockopt: (libc)Socket Option Functions.
- * setstate: (libc)BSD Random.
- * setstate_r: (libc)BSD Random.
- * settimeofday: (libc)Setting and Adjusting the Time.
- * setuid: (libc)Setting User ID.
- * setutent: (libc)Manipulating the Database.
- * setutxent: (libc)XPG Functions.
- * setvbuf: (libc)Controlling Buffering.
- * shm_open: (libc)Memory-mapped I/O.
- * shm_unlink: (libc)Memory-mapped I/O.
- * shutdown: (libc)Closing a Socket.
- * sigabbrev_np: (libc)Signal Messages.
- * sigaction: (libc)Advanced Signal Handling.
- * sigaddset: (libc)Signal Sets.
- * sigaltstack: (libc)Signal Stack.
- * sigblock: (libc)BSD Signal Handling.
- * sigdelset: (libc)Signal Sets.
- * sigdescr_np: (libc)Signal Messages.
- * sigemptyset: (libc)Signal Sets.
- * sigfillset: (libc)Signal Sets.
- * siginterrupt: (libc)BSD Signal Handling.
- * sigismember: (libc)Signal Sets.
- * siglongjmp: (libc)Non-Local Exits and Signals.
- * sigmask: (libc)BSD Signal Handling.
- * signal: (libc)Basic Signal Handling.
- * signbit: (libc)FP Bit Twiddling.
- * significand: (libc)Normalization Functions.
- * significandf: (libc)Normalization Functions.
- * significandl: (libc)Normalization Functions.
- * sigpause: (libc)BSD Signal Handling.
- * sigpending: (libc)Checking for Pending Signals.
- * sigprocmask: (libc)Process Signal Mask.
- * sigsetjmp: (libc)Non-Local Exits and Signals.
- * sigsetmask: (libc)BSD Signal Handling.
- * sigstack: (libc)Signal Stack.
- * sigsuspend: (libc)Sigsuspend.
- * sin: (libc)Trig Functions.
- * sincos: (libc)Trig Functions.
- * sincosf: (libc)Trig Functions.
- * sincosfN: (libc)Trig Functions.
- * sincosfNx: (libc)Trig Functions.
- * sincosl: (libc)Trig Functions.
- * sinf: (libc)Trig Functions.
- * sinfN: (libc)Trig Functions.
- * sinfNx: (libc)Trig Functions.
- * sinh: (libc)Hyperbolic Functions.
- * sinhf: (libc)Hyperbolic Functions.
- * sinhfN: (libc)Hyperbolic Functions.
- * sinhfNx: (libc)Hyperbolic Functions.
- * sinhl: (libc)Hyperbolic Functions.
- * sinl: (libc)Trig Functions.
- * sinpi: (libc)Trig Functions.
- * sinpif: (libc)Trig Functions.
- * sinpifN: (libc)Trig Functions.
- * sinpifNx: (libc)Trig Functions.
- * sinpil: (libc)Trig Functions.
- * sleep: (libc)Sleeping.
- * snprintf: (libc)Formatted Output Functions.
- * socket: (libc)Creating a Socket.
- * socketpair: (libc)Socket Pairs.
- * sprintf: (libc)Formatted Output Functions.
- * sqrt: (libc)Exponents and Logarithms.
- * sqrtf: (libc)Exponents and Logarithms.
- * sqrtfN: (libc)Exponents and Logarithms.
- * sqrtfNx: (libc)Exponents and Logarithms.
- * sqrtl: (libc)Exponents and Logarithms.
- * srand48: (libc)SVID Random.
- * srand48_r: (libc)SVID Random.
- * srand: (libc)ISO Random.
- * srandom: (libc)BSD Random.
- * srandom_r: (libc)BSD Random.
- * sscanf: (libc)Formatted Input Functions.
- * ssignal: (libc)Basic Signal Handling.
- * stat64: (libc)Reading Attributes.
- * stat: (libc)Reading Attributes.
- * stdc_bit_ceil_uc: (libc)Bit Manipulation.
- * stdc_bit_ceil_ui: (libc)Bit Manipulation.
- * stdc_bit_ceil_ul: (libc)Bit Manipulation.
- * stdc_bit_ceil_ull: (libc)Bit Manipulation.
- * stdc_bit_ceil_us: (libc)Bit Manipulation.
- * stdc_bit_floor_uc: (libc)Bit Manipulation.
- * stdc_bit_floor_ui: (libc)Bit Manipulation.
- * stdc_bit_floor_ul: (libc)Bit Manipulation.
- * stdc_bit_floor_ull: (libc)Bit Manipulation.
- * stdc_bit_floor_us: (libc)Bit Manipulation.
- * stdc_bit_width_uc: (libc)Bit Manipulation.
- * stdc_bit_width_ui: (libc)Bit Manipulation.
- * stdc_bit_width_ul: (libc)Bit Manipulation.
- * stdc_bit_width_ull: (libc)Bit Manipulation.
- * stdc_bit_width_us: (libc)Bit Manipulation.
- * stdc_count_ones_uc: (libc)Bit Manipulation.
- * stdc_count_ones_ui: (libc)Bit Manipulation.
- * stdc_count_ones_ul: (libc)Bit Manipulation.
- * stdc_count_ones_ull: (libc)Bit Manipulation.
- * stdc_count_ones_us: (libc)Bit Manipulation.
- * stdc_count_zeros_uc: (libc)Bit Manipulation.
- * stdc_count_zeros_ui: (libc)Bit Manipulation.
- * stdc_count_zeros_ul: (libc)Bit Manipulation.
- * stdc_count_zeros_ull: (libc)Bit Manipulation.
- * stdc_count_zeros_us: (libc)Bit Manipulation.
- * stdc_first_leading_one_uc: (libc)Bit Manipulation.
- * stdc_first_leading_one_ui: (libc)Bit Manipulation.
- * stdc_first_leading_one_ul: (libc)Bit Manipulation.
- * stdc_first_leading_one_ull: (libc)Bit Manipulation.
- * stdc_first_leading_one_us: (libc)Bit Manipulation.
- * stdc_first_leading_zero_uc: (libc)Bit Manipulation.
- * stdc_first_leading_zero_ui: (libc)Bit Manipulation.
- * stdc_first_leading_zero_ul: (libc)Bit Manipulation.
- * stdc_first_leading_zero_ull: (libc)Bit Manipulation.
- * stdc_first_leading_zero_us: (libc)Bit Manipulation.
- * stdc_first_trailing_one_uc: (libc)Bit Manipulation.
- * stdc_first_trailing_one_ui: (libc)Bit Manipulation.
- * stdc_first_trailing_one_ul: (libc)Bit Manipulation.
- * stdc_first_trailing_one_ull: (libc)Bit Manipulation.
- * stdc_first_trailing_one_us: (libc)Bit Manipulation.
- * stdc_first_trailing_zero_uc: (libc)Bit Manipulation.
- * stdc_first_trailing_zero_ui: (libc)Bit Manipulation.
- * stdc_first_trailing_zero_ul: (libc)Bit Manipulation.
- * stdc_first_trailing_zero_ull: (libc)Bit Manipulation.
- * stdc_first_trailing_zero_us: (libc)Bit Manipulation.
- * stdc_has_single_bit_uc: (libc)Bit Manipulation.
- * stdc_has_single_bit_ui: (libc)Bit Manipulation.
- * stdc_has_single_bit_ul: (libc)Bit Manipulation.
- * stdc_has_single_bit_ull: (libc)Bit Manipulation.
- * stdc_has_single_bit_us: (libc)Bit Manipulation.
- * stdc_leading_ones_uc: (libc)Bit Manipulation.
- * stdc_leading_ones_ui: (libc)Bit Manipulation.
- * stdc_leading_ones_ul: (libc)Bit Manipulation.
- * stdc_leading_ones_ull: (libc)Bit Manipulation.
- * stdc_leading_ones_us: (libc)Bit Manipulation.
- * stdc_leading_zeros_uc: (libc)Bit Manipulation.
- * stdc_leading_zeros_ui: (libc)Bit Manipulation.
- * stdc_leading_zeros_ul: (libc)Bit Manipulation.
- * stdc_leading_zeros_ull: (libc)Bit Manipulation.
- * stdc_leading_zeros_us: (libc)Bit Manipulation.
- * stdc_trailing_ones_uc: (libc)Bit Manipulation.
- * stdc_trailing_ones_ui: (libc)Bit Manipulation.
- * stdc_trailing_ones_ul: (libc)Bit Manipulation.
- * stdc_trailing_ones_ull: (libc)Bit Manipulation.
- * stdc_trailing_ones_us: (libc)Bit Manipulation.
- * stdc_trailing_zeros_uc: (libc)Bit Manipulation.
- * stdc_trailing_zeros_ui: (libc)Bit Manipulation.
- * stdc_trailing_zeros_ul: (libc)Bit Manipulation.
- * stdc_trailing_zeros_ull: (libc)Bit Manipulation.
- * stdc_trailing_zeros_us: (libc)Bit Manipulation.
- * stime: (libc)Setting and Adjusting the Time.
- * stpcpy: (libc)Copying Strings and Arrays.
- * stpncpy: (libc)Truncating Strings.
- * strcasecmp: (libc)String/Array Comparison.
- * strcasestr: (libc)Search Functions.
- * strcat: (libc)Concatenating Strings.
- * strchr: (libc)Search Functions.
- * strchrnul: (libc)Search Functions.
- * strcmp: (libc)String/Array Comparison.
- * strcoll: (libc)Collation Functions.
- * strcpy: (libc)Copying Strings and Arrays.
- * strcspn: (libc)Search Functions.
- * strdup: (libc)Copying Strings and Arrays.
- * strdupa: (libc)Copying Strings and Arrays.
- * strerror: (libc)Error Messages.
- * strerror_l: (libc)Error Messages.
- * strerror_r: (libc)Error Messages.
- * strerror_r: (libc)Error Messages.
- * strerrordesc_np: (libc)Error Messages.
- * strerrorname_np: (libc)Error Messages.
- * strfmon: (libc)Formatting Numbers.
- * strfromd: (libc)Printing of Floats.
- * strfromf: (libc)Printing of Floats.
- * strfromfN: (libc)Printing of Floats.
- * strfromfNx: (libc)Printing of Floats.
- * strfroml: (libc)Printing of Floats.
- * strfry: (libc)Shuffling Bytes.
- * strftime: (libc)Formatting Calendar Time.
- * strftime_l: (libc)Formatting Calendar Time.
- * strlcat: (libc)Truncating Strings.
- * strlcpy: (libc)Truncating Strings.
- * strlen: (libc)String Length.
- * strncasecmp: (libc)String/Array Comparison.
- * strncat: (libc)Truncating Strings.
- * strncmp: (libc)String/Array Comparison.
- * strncpy: (libc)Truncating Strings.
- * strndup: (libc)Truncating Strings.
- * strndupa: (libc)Truncating Strings.
- * strnlen: (libc)String Length.
- * strpbrk: (libc)Search Functions.
- * strptime: (libc)Low-Level Time String Parsing.
- * strrchr: (libc)Search Functions.
- * strsep: (libc)Finding Tokens in a String.
- * strsignal: (libc)Signal Messages.
- * strspn: (libc)Search Functions.
- * strstr: (libc)Search Functions.
- * strtod: (libc)Parsing of Floats.
- * strtof: (libc)Parsing of Floats.
- * strtofN: (libc)Parsing of Floats.
- * strtofNx: (libc)Parsing of Floats.
- * strtoimax: (libc)Parsing of Integers.
- * strtok: (libc)Finding Tokens in a String.
- * strtok_r: (libc)Finding Tokens in a String.
- * strtol: (libc)Parsing of Integers.
- * strtold: (libc)Parsing of Floats.
- * strtoll: (libc)Parsing of Integers.
- * strtoq: (libc)Parsing of Integers.
- * strtoul: (libc)Parsing of Integers.
- * strtoull: (libc)Parsing of Integers.
- * strtoumax: (libc)Parsing of Integers.
- * strtouq: (libc)Parsing of Integers.
- * strverscmp: (libc)String/Array Comparison.
- * strxfrm: (libc)Collation Functions.
- * stty: (libc)BSD Terminal Modes.
- * swapcontext: (libc)System V contexts.
- * swprintf: (libc)Formatted Output Functions.
- * swscanf: (libc)Formatted Input Functions.
- * symlink: (libc)Symbolic Links.
- * sync: (libc)Synchronizing I/O.
- * syscall: (libc)System Calls.
- * sysconf: (libc)Sysconf Definition.
- * syslog: (libc)syslog; vsyslog.
- * system: (libc)Running a Command.
- * sysv_signal: (libc)Basic Signal Handling.
- * tan: (libc)Trig Functions.
- * tanf: (libc)Trig Functions.
- * tanfN: (libc)Trig Functions.
- * tanfNx: (libc)Trig Functions.
- * tanh: (libc)Hyperbolic Functions.
- * tanhf: (libc)Hyperbolic Functions.
- * tanhfN: (libc)Hyperbolic Functions.
- * tanhfNx: (libc)Hyperbolic Functions.
- * tanhl: (libc)Hyperbolic Functions.
- * tanl: (libc)Trig Functions.
- * tanpi: (libc)Trig Functions.
- * tanpif: (libc)Trig Functions.
- * tanpifN: (libc)Trig Functions.
- * tanpifNx: (libc)Trig Functions.
- * tanpil: (libc)Trig Functions.
- * tcdrain: (libc)Line Control.
- * tcflow: (libc)Line Control.
- * tcflush: (libc)Line Control.
- * tcgetattr: (libc)Mode Functions.
- * tcgetpgrp: (libc)Terminal Access Functions.
- * tcgetsid: (libc)Terminal Access Functions.
- * tcsendbreak: (libc)Line Control.
- * tcsetattr: (libc)Mode Functions.
- * tcsetpgrp: (libc)Terminal Access Functions.
- * tdelete: (libc)Tree Search Function.
- * tdestroy: (libc)Tree Search Function.
- * telldir: (libc)Random Access Directory.
- * tempnam: (libc)Temporary Files.
- * textdomain: (libc)Locating gettext catalog.
- * tfind: (libc)Tree Search Function.
- * tgamma: (libc)Special Functions.
- * tgammaf: (libc)Special Functions.
- * tgammafN: (libc)Special Functions.
- * tgammafNx: (libc)Special Functions.
- * tgammal: (libc)Special Functions.
- * tgkill: (libc)Signaling Another Process.
- * thrd_create: (libc)ISO C Thread Management.
- * thrd_current: (libc)ISO C Thread Management.
- * thrd_detach: (libc)ISO C Thread Management.
- * thrd_equal: (libc)ISO C Thread Management.
- * thrd_exit: (libc)ISO C Thread Management.
- * thrd_join: (libc)ISO C Thread Management.
- * thrd_sleep: (libc)ISO C Thread Management.
- * thrd_yield: (libc)ISO C Thread Management.
- * time: (libc)Getting the Time.
- * timegm: (libc)Broken-down Time.
- * timelocal: (libc)Broken-down Time.
- * times: (libc)Processor Time.
- * timespec_get: (libc)Getting the Time.
- * timespec_getres: (libc)Getting the Time.
- * tmpfile64: (libc)Temporary Files.
- * tmpfile: (libc)Temporary Files.
- * tmpnam: (libc)Temporary Files.
- * tmpnam_r: (libc)Temporary Files.
- * toascii: (libc)Case Conversion.
- * tolower: (libc)Case Conversion.
- * totalorder: (libc)FP Comparison Functions.
- * totalorderf: (libc)FP Comparison Functions.
- * totalorderfN: (libc)FP Comparison Functions.
- * totalorderfNx: (libc)FP Comparison Functions.
- * totalorderl: (libc)FP Comparison Functions.
- * totalordermag: (libc)FP Comparison Functions.
- * totalordermagf: (libc)FP Comparison Functions.
- * totalordermagfN: (libc)FP Comparison Functions.
- * totalordermagfNx: (libc)FP Comparison Functions.
- * totalordermagl: (libc)FP Comparison Functions.
- * toupper: (libc)Case Conversion.
- * towctrans: (libc)Wide Character Case Conversion.
- * towlower: (libc)Wide Character Case Conversion.
- * towupper: (libc)Wide Character Case Conversion.
- * trunc: (libc)Rounding Functions.
- * truncate64: (libc)File Size.
- * truncate: (libc)File Size.
- * truncf: (libc)Rounding Functions.
- * truncfN: (libc)Rounding Functions.
- * truncfNx: (libc)Rounding Functions.
- * truncl: (libc)Rounding Functions.
- * tsearch: (libc)Tree Search Function.
- * tss_create: (libc)ISO C Thread-local Storage.
- * tss_delete: (libc)ISO C Thread-local Storage.
- * tss_get: (libc)ISO C Thread-local Storage.
- * tss_set: (libc)ISO C Thread-local Storage.
- * ttyname: (libc)Is It a Terminal.
- * ttyname_r: (libc)Is It a Terminal.
- * twalk: (libc)Tree Search Function.
- * twalk_r: (libc)Tree Search Function.
- * tzset: (libc)Time Zone State.
- * uabs: (libc)Absolute Value.
- * ufromfp: (libc)Rounding Functions.
- * ufromfpf: (libc)Rounding Functions.
- * ufromfpfN: (libc)Rounding Functions.
- * ufromfpfNx: (libc)Rounding Functions.
- * ufromfpl: (libc)Rounding Functions.
- * ufromfpx: (libc)Rounding Functions.
- * ufromfpxf: (libc)Rounding Functions.
- * ufromfpxfN: (libc)Rounding Functions.
- * ufromfpxfNx: (libc)Rounding Functions.
- * ufromfpxl: (libc)Rounding Functions.
- * ulabs: (libc)Absolute Value.
- * ulimit: (libc)Limits on Resources.
- * ullabs: (libc)Absolute Value.
- * umask: (libc)Setting Permissions.
- * umaxabs: (libc)Absolute Value.
- * umount2: (libc)Mount-Unmount-Remount.
- * umount: (libc)Mount-Unmount-Remount.
- * uname: (libc)Platform Type.
- * ungetc: (libc)How Unread.
- * ungetwc: (libc)How Unread.
- * unlink: (libc)Deleting Files.
- * unlinkat: (libc)Deleting Files.
- * unlockpt: (libc)Allocation.
- * unsetenv: (libc)Environment Access.
- * updwtmp: (libc)Manipulating the Database.
- * utime: (libc)File Times.
- * utimensat: (libc)File Times.
- * utimes: (libc)File Times.
- * utmpname: (libc)Manipulating the Database.
- * utmpxname: (libc)XPG Functions.
- * va_arg: (libc)Argument Macros.
- * va_copy: (libc)Argument Macros.
- * va_end: (libc)Argument Macros.
- * va_start: (libc)Argument Macros.
- * valloc: (libc)Aligned Memory Blocks.
- * vasprintf: (libc)Variable Arguments Output.
- * vdprintf: (libc)Variable Arguments Output.
- * verr: (libc)Error Messages.
- * verrx: (libc)Error Messages.
- * versionsort64: (libc)Scanning Directory Content.
- * versionsort: (libc)Scanning Directory Content.
- * vfork: (libc)Creating a Process.
- * vfprintf: (libc)Variable Arguments Output.
- * vfscanf: (libc)Variable Arguments Input.
- * vfwprintf: (libc)Variable Arguments Output.
- * vfwscanf: (libc)Variable Arguments Input.
- * vlimit: (libc)Limits on Resources.
- * vprintf: (libc)Variable Arguments Output.
- * vscanf: (libc)Variable Arguments Input.
- * vsnprintf: (libc)Variable Arguments Output.
- * vsprintf: (libc)Variable Arguments Output.
- * vsscanf: (libc)Variable Arguments Input.
- * vswprintf: (libc)Variable Arguments Output.
- * vswscanf: (libc)Variable Arguments Input.
- * vsyslog: (libc)syslog; vsyslog.
- * vwarn: (libc)Error Messages.
- * vwarnx: (libc)Error Messages.
- * vwprintf: (libc)Variable Arguments Output.
- * vwscanf: (libc)Variable Arguments Input.
- * wait3: (libc)BSD Wait Functions.
- * wait4: (libc)Process Completion.
- * wait: (libc)Process Completion.
- * waitpid: (libc)Process Completion.
- * warn: (libc)Error Messages.
- * warnx: (libc)Error Messages.
- * wcpcpy: (libc)Copying Strings and Arrays.
- * wcpncpy: (libc)Truncating Strings.
- * wcrtomb: (libc)Converting a Character.
- * wcscasecmp: (libc)String/Array Comparison.
- * wcscat: (libc)Concatenating Strings.
- * wcschr: (libc)Search Functions.
- * wcschrnul: (libc)Search Functions.
- * wcscmp: (libc)String/Array Comparison.
- * wcscoll: (libc)Collation Functions.
- * wcscpy: (libc)Copying Strings and Arrays.
- * wcscspn: (libc)Search Functions.
- * wcsdup: (libc)Copying Strings and Arrays.
- * wcsftime: (libc)Formatting Calendar Time.
- * wcslcat: (libc)Truncating Strings.
- * wcslcpy: (libc)Truncating Strings.
- * wcslen: (libc)String Length.
- * wcsncasecmp: (libc)String/Array Comparison.
- * wcsncat: (libc)Truncating Strings.
- * wcsncmp: (libc)String/Array Comparison.
- * wcsncpy: (libc)Truncating Strings.
- * wcsnlen: (libc)String Length.
- * wcsnrtombs: (libc)Converting Strings.
- * wcspbrk: (libc)Search Functions.
- * wcsrchr: (libc)Search Functions.
- * wcsrtombs: (libc)Converting Strings.
- * wcsspn: (libc)Search Functions.
- * wcsstr: (libc)Search Functions.
- * wcstod: (libc)Parsing of Floats.
- * wcstof: (libc)Parsing of Floats.
- * wcstofN: (libc)Parsing of Floats.
- * wcstofNx: (libc)Parsing of Floats.
- * wcstoimax: (libc)Parsing of Integers.
- * wcstok: (libc)Finding Tokens in a String.
- * wcstol: (libc)Parsing of Integers.
- * wcstold: (libc)Parsing of Floats.
- * wcstoll: (libc)Parsing of Integers.
- * wcstombs: (libc)Non-reentrant String Conversion.
- * wcstoq: (libc)Parsing of Integers.
- * wcstoul: (libc)Parsing of Integers.
- * wcstoull: (libc)Parsing of Integers.
- * wcstoumax: (libc)Parsing of Integers.
- * wcstouq: (libc)Parsing of Integers.
- * wcswcs: (libc)Search Functions.
- * wcsxfrm: (libc)Collation Functions.
- * wctob: (libc)Converting a Character.
- * wctomb: (libc)Non-reentrant Character Conversion.
- * wctrans: (libc)Wide Character Case Conversion.
- * wctype: (libc)Classification of Wide Characters.
- * wmemchr: (libc)Search Functions.
- * wmemcmp: (libc)String/Array Comparison.
- * wmemcpy: (libc)Copying Strings and Arrays.
- * wmemmove: (libc)Copying Strings and Arrays.
- * wmempcpy: (libc)Copying Strings and Arrays.
- * wmemset: (libc)Copying Strings and Arrays.
- * wordexp: (libc)Calling Wordexp.
- * wordfree: (libc)Calling Wordexp.
- * wprintf: (libc)Formatted Output Functions.
- * write: (libc)I/O Primitives.
- * writev: (libc)Scatter-Gather.
- * wscanf: (libc)Formatted Input Functions.
- * y0: (libc)Special Functions.
- * y0f: (libc)Special Functions.
- * y0fN: (libc)Special Functions.
- * y0fNx: (libc)Special Functions.
- * y0l: (libc)Special Functions.
- * y1: (libc)Special Functions.
- * y1f: (libc)Special Functions.
- * y1fN: (libc)Special Functions.
- * y1fNx: (libc)Special Functions.
- * y1l: (libc)Special Functions.
- * yn: (libc)Special Functions.
- * ynf: (libc)Special Functions.
- * ynfN: (libc)Special Functions.
- * ynfNx: (libc)Special Functions.
- * ynl: (libc)Special Functions.
- END-INFO-DIR-ENTRY
- File: libc.info, Node: Synchronizing AIO Operations, Next: Cancel AIO Operations, Prev: Status of AIO Operations, Up: Asynchronous I/O
- 13.11.3 Getting into a Consistent State
- ---------------------------------------
- When dealing with asynchronous operations it is sometimes necessary to
- get into a consistent state. This would mean for AIO that one wants to
- know whether a certain request or a group of requests were processed.
- This could be done by waiting for the notification sent by the system
- after the operation terminated, but this sometimes would mean wasting
- resources (mainly computation time). Instead POSIX.1b defines two
- functions which will help with most kinds of consistency.
- The ‘aio_fsync’ and ‘aio_fsync64’ functions are only available if the
- symbol ‘_POSIX_SYNCHRONIZED_IO’ is defined in ‘unistd.h’.
- -- Function: int aio_fsync (int OP, struct aiocb *AIOCBP)
- Preliminary: | MT-Safe | AS-Unsafe lock heap | AC-Unsafe lock mem |
- *Note POSIX Safety Concepts::.
- Calling this function forces all I/O operations queued at the time
- of the function call operating on the file descriptor
- ‘aiocbp->aio_fildes’ into the synchronized I/O completion state
- (*note Synchronizing I/O::). The ‘aio_fsync’ function returns
- immediately but the notification through the method described in
- ‘aiocbp->aio_sigevent’ will happen only after all requests for this
- file descriptor have terminated and the file is synchronized. This
- also means that requests for this very same file descriptor which
- are queued after the synchronization request are not affected.
- If OP is ‘O_DSYNC’ the synchronization happens as with a call to
- ‘fdatasync’. Otherwise OP should be ‘O_SYNC’ and the
- synchronization happens as with ‘fsync’.
- As long as the synchronization has not happened, a call to
- ‘aio_error’ with the reference to the object pointed to by AIOCBP
- returns ‘EINPROGRESS’. Once the synchronization is done
- ‘aio_error’ return 0 if the synchronization was not successful.
- Otherwise the value returned is the value to which the ‘fsync’ or
- ‘fdatasync’ function would have set the ‘errno’ variable. In this
- case nothing can be assumed about the consistency of the data
- written to this file descriptor.
- The return value of this function is 0 if the request was
- successfully enqueued. Otherwise the return value is -1 and
- ‘errno’ is set to one of the following values:
- ‘EAGAIN’
- The request could not be enqueued due to temporary lack of
- resources.
- ‘EBADF’
- The file descriptor ‘AIOCBP->aio_fildes’ is not valid.
- ‘EINVAL’
- The implementation does not support I/O synchronization or the
- OP parameter is other than ‘O_DSYNC’ and ‘O_SYNC’.
- ‘ENOSYS’
- This function is not implemented.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- function is in fact ‘aio_fsync64’ since the LFS interface
- transparently replaces the normal implementation.
- -- Function: int aio_fsync64 (int OP, struct aiocb64 *AIOCBP)
- Preliminary: | MT-Safe | AS-Unsafe lock heap | AC-Unsafe lock mem |
- *Note POSIX Safety Concepts::.
- This function is similar to ‘aio_fsync’ with the only difference
- that the argument is a reference to a variable of type ‘struct
- aiocb64’.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- function is available under the name ‘aio_fsync’ and so
- transparently replaces the interface for small files on 32 bit
- machines.
- Another method of synchronization is to wait until one or more
- requests of a specific set terminated. This could be achieved by the
- ‘aio_*’ functions to notify the initiating process about the termination
- but in some situations this is not the ideal solution. In a program
- which constantly updates clients somehow connected to the server it is
- not always the best solution to go round robin since some connections
- might be slow. On the other hand letting the ‘aio_*’ functions notify
- the caller might also be not the best solution since whenever the
- process works on preparing data for a client it makes no sense to be
- interrupted by a notification since the new client will not be handled
- before the current client is served. For situations like this
- ‘aio_suspend’ should be used.
- -- Function: int aio_suspend (const struct aiocb *const LIST[], int
- NENT, const struct timespec *TIMEOUT)
- Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
- POSIX Safety Concepts::.
- When calling this function, the calling thread is suspended until
- at least one of the requests pointed to by the NENT elements of the
- array LIST has completed. If any of the requests has already
- completed at the time ‘aio_suspend’ is called, the function returns
- immediately. Whether a request has terminated or not is determined
- by comparing the error status of the request with ‘EINPROGRESS’.
- If an element of LIST is ‘NULL’, the entry is simply ignored.
- If no request has finished, the calling process is suspended. If
- TIMEOUT is ‘NULL’, the process is not woken until a request has
- finished. If TIMEOUT is not ‘NULL’, the process remains suspended
- at least as long as specified in TIMEOUT. In this case,
- ‘aio_suspend’ returns with an error.
- The return value of the function is 0 if one or more requests from
- the LIST have terminated. Otherwise the function returns -1 and
- ‘errno’ is set to one of the following values:
- ‘EAGAIN’
- None of the requests from the LIST completed in the time
- specified by TIMEOUT.
- ‘EINTR’
- A signal interrupted the ‘aio_suspend’ function. This signal
- might also be sent by the AIO implementation while signalling
- the termination of one of the requests.
- ‘ENOSYS’
- The ‘aio_suspend’ function is not implemented.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- function is in fact ‘aio_suspend64’ since the LFS interface
- transparently replaces the normal implementation.
- -- Function: int aio_suspend64 (const struct aiocb64 *const LIST[], int
- NENT, const struct timespec *TIMEOUT)
- Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
- POSIX Safety Concepts::.
- This function is similar to ‘aio_suspend’ with the only difference
- that the argument is a reference to a variable of type ‘struct
- aiocb64’.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- function is available under the name ‘aio_suspend’ and so
- transparently replaces the interface for small files on 32 bit
- machines.
- File: libc.info, Node: Cancel AIO Operations, Next: Configuration of AIO, Prev: Synchronizing AIO Operations, Up: Asynchronous I/O
- 13.11.4 Cancellation of AIO Operations
- --------------------------------------
- When one or more requests are asynchronously processed, it might be
- useful in some situations to cancel a selected operation, e.g., if it
- becomes obvious that the written data is no longer accurate and would
- have to be overwritten soon. As an example, assume an application,
- which writes data in files in a situation where new incoming data would
- have to be written in a file which will be updated by an enqueued
- request. The POSIX AIO implementation provides such a function, but
- this function is not capable of forcing the cancellation of the request.
- It is up to the implementation to decide whether it is possible to
- cancel the operation or not. Therefore using this function is merely a
- hint.
- -- Function: int aio_cancel (int FILDES, struct aiocb *AIOCBP)
- Preliminary: | MT-Safe | AS-Unsafe lock heap | AC-Unsafe lock mem |
- *Note POSIX Safety Concepts::.
- The ‘aio_cancel’ function can be used to cancel one or more
- outstanding requests. If the AIOCBP parameter is ‘NULL’, the
- function tries to cancel all of the outstanding requests which
- would process the file descriptor FILDES (i.e., whose ‘aio_fildes’
- member is FILDES). If AIOCBP is not ‘NULL’, ‘aio_cancel’ attempts
- to cancel the specific request pointed to by AIOCBP.
- For requests which were successfully canceled, the normal
- notification about the termination of the request should take
- place. I.e., depending on the ‘struct sigevent’ object which
- controls this, nothing happens, a signal is sent or a thread is
- started. If the request cannot be canceled, it terminates the
- usual way after performing the operation.
- After a request is successfully canceled, a call to ‘aio_error’
- with a reference to this request as the parameter will return
- ‘ECANCELED’ and a call to ‘aio_return’ will return -1. If the
- request wasn't canceled and is still running the error status is
- still ‘EINPROGRESS’.
- The return value of the function is ‘AIO_CANCELED’ if there were
- requests which haven't terminated and which were successfully
- canceled. If there is one or more requests left which couldn't be
- canceled, the return value is ‘AIO_NOTCANCELED’. In this case
- ‘aio_error’ must be used to find out which of the, perhaps
- multiple, requests (if AIOCBP is ‘NULL’) weren't successfully
- canceled. If all requests already terminated at the time
- ‘aio_cancel’ is called the return value is ‘AIO_ALLDONE’.
- If an error occurred during the execution of ‘aio_cancel’ the
- function returns -1 and sets ‘errno’ to one of the following
- values.
- ‘EBADF’
- The file descriptor FILDES is not valid.
- ‘ENOSYS’
- ‘aio_cancel’ is not implemented.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’, this
- function is in fact ‘aio_cancel64’ since the LFS interface
- transparently replaces the normal implementation.
- -- Function: int aio_cancel64 (int FILDES, struct aiocb64 *AIOCBP)
- Preliminary: | MT-Safe | AS-Unsafe lock heap | AC-Unsafe lock mem |
- *Note POSIX Safety Concepts::.
- This function is similar to ‘aio_cancel’ with the only difference
- that the argument is a reference to a variable of type ‘struct
- aiocb64’.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’, this
- function is available under the name ‘aio_cancel’ and so
- transparently replaces the interface for small files on 32 bit
- machines.
- File: libc.info, Node: Configuration of AIO, Prev: Cancel AIO Operations, Up: Asynchronous I/O
- 13.11.5 How to optimize the AIO implementation
- ----------------------------------------------
- The POSIX standard does not specify how the AIO functions are
- implemented. They could be system calls, but it is also possible to
- emulate them at userlevel.
- At the time of writing, the available implementation is a user-level
- implementation which uses threads for handling the enqueued requests.
- While this implementation requires making some decisions about
- limitations, hard limitations are something best avoided in the GNU C
- Library. Therefore, the GNU C Library provides a means for tuning the
- AIO implementation according to the individual use.
- -- Data Type: struct aioinit
- This data type is used to pass the configuration or tunable
- parameters to the implementation. The program has to initialize
- the members of this struct and pass it to the implementation using
- the ‘aio_init’ function.
- ‘int aio_threads’
- This member specifies the maximal number of threads which may
- be used at any one time.
- ‘int aio_num’
- This number provides an estimate on the maximal number of
- simultaneously enqueued requests.
- ‘int aio_locks’
- Unused.
- ‘int aio_usedba’
- Unused.
- ‘int aio_debug’
- Unused.
- ‘int aio_numusers’
- Unused.
- ‘int aio_reserved[2]’
- Unused.
- -- Function: void aio_init (const struct aioinit *INIT)
- Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
- POSIX Safety Concepts::.
- This function must be called before any other AIO function.
- Calling it is completely voluntary, as it is only meant to help the
- AIO implementation perform better.
- Before calling ‘aio_init’, the members of a variable of type
- ‘struct aioinit’ must be initialized. Then a reference to this
- variable is passed as the parameter to ‘aio_init’ which itself may
- or may not pay attention to the hints.
- The function has no return value and no error cases are defined.
- It is an extension which follows a proposal from the SGI
- implementation in Irix 6. It is not covered by POSIX.1b or Unix98.
- File: libc.info, Node: Control Operations, Next: Duplicating Descriptors, Prev: Asynchronous I/O, Up: Low-Level I/O
- 13.12 Control Operations on Files
- =================================
- This section describes how you can perform various other operations on
- file descriptors, such as inquiring about or setting flags describing
- the status of the file descriptor, manipulating record locks, and the
- like. All of these operations are performed by the function ‘fcntl’.
- The second argument to the ‘fcntl’ function is a command that
- specifies which operation to perform. The function and macros that name
- various flags that are used with it are declared in the header file
- ‘fcntl.h’. Many of these flags are also used by the ‘open’ function;
- see *note Opening and Closing Files::.
- -- Function: int fcntl (int FILEDES, int COMMAND, ...)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘fcntl’ function performs the operation specified by COMMAND on
- the file descriptor FILEDES. Some commands require additional
- arguments to be supplied. These additional arguments and the
- return value and error conditions are given in the detailed
- descriptions of the individual commands.
- Briefly, here is a list of what the various commands are. For an
- exhaustive list of kernel-specific options, please see *Note System
- Calls::.
- ‘F_DUPFD’
- Duplicate the file descriptor (return another file descriptor
- pointing to the same open file). *Note Duplicating
- Descriptors::.
- ‘F_GETFD’
- Get flags associated with the file descriptor. *Note
- Descriptor Flags::.
- ‘F_SETFD’
- Set flags associated with the file descriptor. *Note
- Descriptor Flags::.
- ‘F_GETFL’
- Get flags associated with the open file. *Note File Status
- Flags::.
- ‘F_SETFL’
- Set flags associated with the open file. *Note File Status
- Flags::.
- ‘F_GETLK’
- Test a file lock. *Note File Locks::.
- ‘F_SETLK’
- Set or clear a file lock. *Note File Locks::.
- ‘F_SETLKW’
- Like ‘F_SETLK’, but wait for completion. *Note File Locks::.
- ‘F_OFD_GETLK’
- Test an open file description lock. *Note Open File
- Description Locks::. Specific to Linux.
- ‘F_OFD_SETLK’
- Set or clear an open file description lock. *Note Open File
- Description Locks::. Specific to Linux.
- ‘F_OFD_SETLKW’
- Like ‘F_OFD_SETLK’, but block until lock is acquired. *Note
- Open File Description Locks::. Specific to Linux.
- ‘F_GETOWN’
- Get process or process group ID to receive ‘SIGIO’ signals.
- *Note Interrupt Input::.
- ‘F_SETOWN’
- Set process or process group ID to receive ‘SIGIO’ signals.
- *Note Interrupt Input::.
- This function is a cancellation point in multi-threaded programs
- for the commands ‘F_SETLKW’ (and the LFS analogous ‘F_SETLKW64’)
- and ‘F_OFD_SETLKW’. This is a problem if the thread allocates some
- resources (like memory, file descriptors, semaphores or whatever)
- at the time ‘fcntl’ is called. If the thread gets canceled these
- resources stay allocated until the program ends. To avoid this
- calls to ‘fcntl’ should be protected using cancellation handlers.
- File: libc.info, Node: Duplicating Descriptors, Next: Descriptor Flags, Prev: Control Operations, Up: Low-Level I/O
- 13.13 Duplicating Descriptors
- =============================
- You can “duplicate” a file descriptor, or allocate another file
- descriptor that refers to the same open file as the original. Duplicate
- descriptors share one file position and one set of file status flags
- (*note File Status Flags::), but each has its own set of file descriptor
- flags (*note Descriptor Flags::).
- The major use of duplicating a file descriptor is to implement
- “redirection” of input or output: that is, to change the file or pipe
- that a particular file descriptor corresponds to.
- You can perform this operation using the ‘fcntl’ function with the
- ‘F_DUPFD’ command, but there are also convenient functions ‘dup’ and
- ‘dup2’ for duplicating descriptors.
- The ‘fcntl’ function and flags are declared in ‘fcntl.h’, while
- prototypes for ‘dup’ and ‘dup2’ are in the header file ‘unistd.h’.
- -- Function: int dup (int OLD)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function copies descriptor OLD to the first available
- descriptor number (the first number not currently open). It is
- equivalent to ‘fcntl (OLD, F_DUPFD, 0)’.
- -- Function: int dup2 (int OLD, int NEW)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function copies the descriptor OLD to descriptor number NEW.
- If OLD is an invalid descriptor, then ‘dup2’ does nothing; it does
- not close NEW. Otherwise, the new duplicate of OLD replaces any
- previous meaning of descriptor NEW, as if NEW were closed first.
- If OLD and NEW are different numbers, and OLD is a valid descriptor
- number, then ‘dup2’ is equivalent to:
- close (NEW);
- fcntl (OLD, F_DUPFD, NEW)
- However, ‘dup2’ does this atomically; there is no instant in the
- middle of calling ‘dup2’ at which NEW is closed and not yet a
- duplicate of OLD.
- -- Function: int dup3 (int OLD, int NEW, int FLAGS)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function is the same as ‘dup2’ but creates the new descriptor
- as if it had been opened with flags FLAGS. The only allowed flag
- is ‘O_CLOEXEC’.
- This function was originally a Linux extension, but was added in
- POSIX.1-2024.
- -- Macro: int F_DUPFD
- This macro is used as the COMMAND argument to ‘fcntl’, to copy the
- file descriptor given as the first argument.
- The form of the call in this case is:
- fcntl (OLD, F_DUPFD, NEXT-FILEDES)
- The NEXT-FILEDES argument is of type ‘int’ and specifies that the
- file descriptor returned should be the next available one greater
- than or equal to this value.
- The return value from ‘fcntl’ with this command is normally the
- value of the new file descriptor. A return value of -1 indicates
- an error. The following ‘errno’ error conditions are defined for
- this command:
- ‘EBADF’
- The OLD argument is invalid.
- ‘EINVAL’
- The NEXT-FILEDES argument is invalid.
- ‘EMFILE’
- There are no more file descriptors available--your program is
- already using the maximum. In BSD and GNU, the maximum is
- controlled by a resource limit that can be changed; *note
- Limits on Resources::, for more information about the
- ‘RLIMIT_NOFILE’ limit.
- ‘ENFILE’ is not a possible error code for ‘dup2’ because ‘dup2’
- does not create a new opening of a file; duplicate descriptors do
- not count toward the limit which ‘ENFILE’ indicates. ‘EMFILE’ is
- possible because it refers to the limit on distinct descriptor
- numbers in use in one process.
- Here is an example showing how to use ‘dup2’ to do redirection.
- Typically, redirection of the standard streams (like ‘stdin’) is done by
- a shell or shell-like program before calling one of the ‘exec’ functions
- (*note Executing a File::) to execute a new program in a child process.
- When the new program is executed, it creates and initializes the
- standard streams to point to the corresponding file descriptors, before
- its ‘main’ function is invoked.
- So, to redirect standard input to a file, the shell could do
- something like:
- pid = fork ();
- if (pid == 0)
- {
- char *filename;
- char *program;
- int file;
- ...
- file = TEMP_FAILURE_RETRY (open (filename, O_RDONLY));
- dup2 (file, STDIN_FILENO);
- TEMP_FAILURE_RETRY (close (file));
- execv (program, NULL);
- }
- There is also a more detailed example showing how to implement
- redirection in the context of a pipeline of processes in *note Launching
- Jobs::.
- File: libc.info, Node: Descriptor Flags, Next: File Status Flags, Prev: Duplicating Descriptors, Up: Low-Level I/O
- 13.14 File Descriptor Flags
- ===========================
- “File descriptor flags” are miscellaneous attributes of a file
- descriptor. These flags are associated with particular file
- descriptors, so that if you have created duplicate file descriptors from
- a single opening of a file, each descriptor has its own set of flags.
- Currently there is just one file descriptor flag: ‘FD_CLOEXEC’, which
- causes the descriptor to be closed if you use any of the ‘exec...’
- functions (*note Executing a File::).
- The symbols in this section are defined in the header file ‘fcntl.h’.
- -- Macro: int F_GETFD
- This macro is used as the COMMAND argument to ‘fcntl’, to specify
- that it should return the file descriptor flags associated with the
- FILEDES argument.
- The normal return value from ‘fcntl’ with this command is a
- nonnegative number which can be interpreted as the bitwise OR of
- the individual flags (except that currently there is only one flag
- to use).
- In case of an error, ‘fcntl’ returns -1. The following ‘errno’
- error conditions are defined for this command:
- ‘EBADF’
- The FILEDES argument is invalid.
- -- Macro: int F_SETFD
- This macro is used as the COMMAND argument to ‘fcntl’, to specify
- that it should set the file descriptor flags associated with the
- FILEDES argument. This requires a third ‘int’ argument to specify
- the new flags, so the form of the call is:
- fcntl (FILEDES, F_SETFD, NEW-FLAGS)
- The normal return value from ‘fcntl’ with this command is an
- unspecified value other than -1, which indicates an error. The
- flags and error conditions are the same as for the ‘F_GETFD’
- command.
- The following macro is defined for use as a file descriptor flag with
- the ‘fcntl’ function. The value is an integer constant usable as a bit
- mask value.
- -- Macro: int FD_CLOEXEC
- This flag specifies that the file descriptor should be closed when
- an ‘exec’ function is invoked; see *note Executing a File::. When
- a file descriptor is allocated (as with ‘open’ or ‘dup’), this bit
- is initially cleared on the new file descriptor, meaning that
- descriptor will survive into the new program after ‘exec’.
- If you want to modify the file descriptor flags, you should get the
- current flags with ‘F_GETFD’ and modify the value. Don't assume that
- the flags listed here are the only ones that are implemented; your
- program may be run years from now and more flags may exist then. For
- example, here is a function to set or clear the flag ‘FD_CLOEXEC’
- without altering any other flags:
- /* Set the ‘FD_CLOEXEC’ flag of DESC if VALUE is nonzero,
- or clear the flag if VALUE is 0.
- Return 0 on success, or -1 on error with ‘errno’ set. */
- int
- set_cloexec_flag (int desc, int value)
- {
- int oldflags = fcntl (desc, F_GETFD, 0);
- /* If reading the flags failed, return error indication now. */
- if (oldflags < 0)
- return oldflags;
- /* Set just the flag we want to set. */
- if (value != 0)
- oldflags |= FD_CLOEXEC;
- else
- oldflags &= ~FD_CLOEXEC;
- /* Store modified flag word in the descriptor. */
- return fcntl (desc, F_SETFD, oldflags);
- }
- File: libc.info, Node: File Status Flags, Next: File Locks, Prev: Descriptor Flags, Up: Low-Level I/O
- 13.15 File Status Flags
- =======================
- “File status flags” are used to specify attributes of the opening of a
- file. Unlike the file descriptor flags discussed in *note Descriptor
- Flags::, the file status flags are shared by duplicated file descriptors
- resulting from a single opening of the file. The file status flags are
- specified with the FLAGS argument to ‘open’; *note Opening and Closing
- Files::.
- File status flags fall into three categories, which are described in
- the following sections.
- • *note Access Modes::, specify what type of access is allowed to the
- file: reading, writing, or both. They are set by ‘open’ and are
- returned by ‘fcntl’, but cannot be changed.
- • *note Open-time Flags::, control details of what ‘open’ will do.
- These flags are not preserved after the ‘open’ call.
- • *note Operating Modes::, affect how operations such as ‘read’ and
- ‘write’ are done. They are set by ‘open’, and can be fetched or
- changed with ‘fcntl’.
- The symbols in this section are defined in the header file ‘fcntl.h’.
- * Menu:
- * Access Modes:: Whether the descriptor can read or write.
- * Open-time Flags:: Details of ‘open’.
- * Operating Modes:: Special modes to control I/O operations.
- * Getting File Status Flags:: Fetching and changing these flags.
- File: libc.info, Node: Access Modes, Next: Open-time Flags, Up: File Status Flags
- 13.15.1 File Access Modes
- -------------------------
- The file access mode allows a file descriptor to be used for reading,
- writing, both, or neither. The access mode is determined when the file
- is opened, and never change.
- -- Macro: int O_RDONLY
- Open the file for read access.
- -- Macro: int O_WRONLY
- Open the file for write access.
- -- Macro: int O_RDWR
- Open the file for both reading and writing.
- -- Macro: int O_PATH
- Obtain a file descriptor for the file, but do not open the file for
- reading or writing. Permission checks for the file itself are
- skipped when the file is opened (but permission to access the
- directory that contains it is still needed), and permissions are
- checked when the descriptor is used later on.
- For example, such descriptors can be used with the ‘fexecve’
- function (*note Executing a File::). Other applications involve
- the ‘*at’ function variants, along with the ‘AT_EMPTY_PATH’ flag.
- *Note Descriptor-Relative Access::.
- This access mode is specific to Linux. On GNU/Hurd systems, it is
- possible to use ‘O_EXEC’ explicitly, or specify no access modes at
- all (see below).
- The portable file access modes ‘O_RDONLY’, ‘O_WRONLY’, and ‘O_RDWR’
- may not correspond to individual bits. To determine the file access
- mode with ‘fcntl’, you must extract the access mode bits from the
- retrieved file status flags, using the ‘O_ACCMODE’ mask.
- -- Macro: int O_ACCMODE
- This macro is a mask that can be bitwise-ANDed with the file status
- flag value to recover the file access mode, assuming that a
- standard file access mode is in use.
- If a non-standard file access mode is used (such as ‘O_PATH’ or
- ‘O_EXEC’), masking with ‘O_ACCMODE’ may give incorrect results. These
- non-standard access modes are identified by individual bits and have to
- be checked directly (without masking with ‘O_ACCMODE’ first).
- On GNU/Hurd systems (but not on other systems), ‘O_RDONLY’ and
- ‘O_WRONLY’ are independent bits that can be bitwise-ORed together, and
- it is valid for either bit to be set or clear. This means that ‘O_RDWR’
- is the same as ‘O_RDONLY|O_WRONLY’. A file access mode of zero is
- permissible; it allows no operations that do input or output to the
- file, but does allow other operations such as ‘fchmod’. On GNU/Hurd
- systems, since "read-only" or "write-only" is a misnomer, ‘fcntl.h’
- defines additional names for the file access modes.
- -- Macro: int O_READ
- Open the file for reading. Same as ‘O_RDONLY’; only defined on
- GNU/Hurd.
- -- Macro: int O_WRITE
- Open the file for writing. Same as ‘O_WRONLY’; only defined on
- GNU/Hurd.
- -- Macro: int O_EXEC
- Open the file for executing. Only defined on GNU/Hurd.
- File: libc.info, Node: Open-time Flags, Next: Operating Modes, Prev: Access Modes, Up: File Status Flags
- 13.15.2 Open-time Flags
- -----------------------
- The open-time flags specify options affecting how ‘open’ will behave.
- These options are not preserved once the file is open. The exception to
- this is ‘O_NONBLOCK’, which is also an I/O operating mode and so it _is_
- saved. *Note Opening and Closing Files::, for how to call ‘open’.
- There are two sorts of options specified by open-time flags.
- • “File name translation flags” affect how ‘open’ looks up the file
- name to locate the file, and whether the file can be created.
- • “Open-time action flags” specify extra operations that ‘open’ will
- perform on the file once it is open.
- Here are the file name translation flags.
- -- Macro: int O_CREAT
- If set, the file will be created if it doesn't already exist.
- -- Macro: int O_EXCL
- If both ‘O_CREAT’ and ‘O_EXCL’ are set, then ‘open’ fails if the
- specified file already exists. This is guaranteed to never clobber
- an existing file.
- The ‘O_EXCL’ flag has a special meaning in combination with
- ‘O_TMPFILE’; see below.
- -- Macro: int O_DIRECTORY
- If set, the open operation fails if the given name is not the name
- of a directory. The ‘errno’ variable is set to ‘ENOTDIR’ for this
- error condition.
- -- Macro: int O_NOFOLLOW
- If set, the open operation fails if the final component of the file
- name refers to a symbolic link. The ‘errno’ variable is set to
- ‘ELOOP’ for this error condition.
- -- Macro: int O_TMPFILE
- If this flag is specified, functions in the ‘open’ family create an
- unnamed temporary file. In this case, the pathname argument to the
- ‘open’ family of functions (*note Opening and Closing Files::) is
- interpreted as the directory in which the temporary file is created
- (thus determining the file system which provides the storage for
- the file). The ‘O_TMPFILE’ flag must be combined with ‘O_WRONLY’
- or ‘O_RDWR’, and the MODE argument is required.
- The temporary file can later be given a name using ‘linkat’,
- turning it into a regular file. This allows the atomic creation of
- a file with the specific file attributes (mode and extended
- attributes) and file contents. If, for security reasons, it is not
- desirable that a name can be given to the file, the ‘O_EXCL’ flag
- can be specified along with ‘O_TMPFILE’.
- Not all kernels support this open flag. If this flag is
- unsupported, an attempt to create an unnamed temporary file fails
- with an error of ‘EINVAL’. If the underlying file system does not
- support the ‘O_TMPFILE’ flag, an ‘EOPNOTSUPP’ error is the result.
- The ‘O_TMPFILE’ flag is a GNU extension.
- -- Macro: int O_NONBLOCK
- This prevents ‘open’ from blocking for a "long time" to open the
- file. This is only meaningful for some kinds of files, usually
- devices such as serial ports; when it is not meaningful, it is
- harmless and ignored. Often, opening a port to a modem blocks
- until the modem reports carrier detection; if ‘O_NONBLOCK’ is
- specified, ‘open’ will return immediately without a carrier.
- Note that the ‘O_NONBLOCK’ flag is overloaded as both an I/O
- operating mode and a file name translation flag. This means that
- specifying ‘O_NONBLOCK’ in ‘open’ also sets nonblocking I/O mode;
- *note Operating Modes::. To open the file without blocking but do
- normal I/O that blocks, you must call ‘open’ with ‘O_NONBLOCK’ set
- and then call ‘fcntl’ to turn the bit off.
- -- Macro: int O_NOCTTY
- If the named file is a terminal device, don't make it the
- controlling terminal for the process. *Note Job Control::, for
- information about what it means to be the controlling terminal.
- On GNU/Hurd systems and 4.4 BSD, opening a file never makes it the
- controlling terminal and ‘O_NOCTTY’ is zero. However, GNU/Linux
- systems and some other systems use a nonzero value for ‘O_NOCTTY’
- and set the controlling terminal when you open a file that is a
- terminal device; so to be portable, use ‘O_NOCTTY’ when it is
- important to avoid this.
- The following three file name translation flags exist only on
- GNU/Hurd systems.
- -- Macro: int O_IGNORE_CTTY
- Do not recognize the named file as the controlling terminal, even
- if it refers to the process's existing controlling terminal device.
- Operations on the new file descriptor will never induce job control
- signals. *Note Job Control::.
- -- Macro: int O_NOLINK
- If the named file is a symbolic link, open the link itself instead
- of the file it refers to. (‘fstat’ on the new file descriptor will
- return the information returned by ‘lstat’ on the link's name.)
- -- Macro: int O_NOTRANS
- If the named file is specially translated, do not invoke the
- translator. Open the bare file the translator itself sees.
- The open-time action flags tell ‘open’ to do additional operations
- which are not really related to opening the file. The reason to do them
- as part of ‘open’ instead of in separate calls is that ‘open’ can do
- them atomically.
- -- Macro: int O_TRUNC
- Truncate the file to zero length. This option is only useful for
- regular files, not special files such as directories or FIFOs.
- POSIX.1 requires that you open the file for writing to use
- ‘O_TRUNC’. In BSD and GNU you must have permission to write the
- file to truncate it, but you need not open for write access.
- This is the only open-time action flag specified by POSIX.1. There
- is no good reason for truncation to be done by ‘open’, instead of
- by calling ‘ftruncate’ afterwards. The ‘O_TRUNC’ flag existed in
- Unix before ‘ftruncate’ was invented, and is retained for backward
- compatibility.
- The remaining operating modes are BSD extensions. They exist only on
- some systems. On other systems, these macros are not defined.
- -- Macro: int O_SHLOCK
- Acquire a shared lock on the file, as with ‘flock’. *Note File
- Locks::.
- If ‘O_CREAT’ is specified, the locking is done atomically when
- creating the file. You are guaranteed that no other process will
- get the lock on the new file first.
- -- Macro: int O_EXLOCK
- Acquire an exclusive lock on the file, as with ‘flock’. *Note File
- Locks::. This is atomic like ‘O_SHLOCK’.
- File: libc.info, Node: Operating Modes, Next: Getting File Status Flags, Prev: Open-time Flags, Up: File Status Flags
- 13.15.3 I/O Operating Modes
- ---------------------------
- The operating modes affect how input and output operations using a file
- descriptor work. These flags are set by ‘open’ and can be fetched and
- changed with ‘fcntl’.
- -- Macro: int O_APPEND
- The bit that enables append mode for the file. If set, then all
- ‘write’ operations write the data at the end of the file, extending
- it, regardless of the current file position. This is the only
- reliable way to append to a file. In append mode, you are
- guaranteed that the data you write will always go to the current
- end of the file, regardless of other processes writing to the file.
- Conversely, if you simply set the file position to the end of file
- and write, then another process can extend the file after you set
- the file position but before you write, resulting in your data
- appearing someplace before the real end of file.
- -- Macro: int O_NONBLOCK
- The bit that enables nonblocking mode for the file. If this bit is
- set, ‘read’ requests on the file can return immediately with a
- failure status if there is no input immediately available, instead
- of blocking. Likewise, ‘write’ requests can also return
- immediately with a failure status if the output can't be written
- immediately.
- Note that the ‘O_NONBLOCK’ flag is overloaded as both an I/O
- operating mode and a file name translation flag; *note Open-time
- Flags::.
- -- Macro: int O_NDELAY
- This is an obsolete name for ‘O_NONBLOCK’, provided for
- compatibility with BSD. It is not defined by the POSIX.1 standard.
- The remaining operating modes are BSD and GNU extensions. They exist
- only on some systems. On other systems, these macros are not defined.
- -- Macro: int O_ASYNC
- The bit that enables asynchronous input mode. If set, then ‘SIGIO’
- signals will be generated when input is available. *Note Interrupt
- Input::.
- Asynchronous input mode is a BSD feature.
- -- Macro: int O_FSYNC
- The bit that enables synchronous writing for the file. If set,
- each ‘write’ call will make sure the data is reliably stored on
- disk before returning.
- Synchronous writing is a BSD feature.
- -- Macro: int O_SYNC
- This is another name for ‘O_FSYNC’. They have the same value.
- -- Macro: int O_NOATIME
- If this bit is set, ‘read’ will not update the access time of the
- file. *Note File Times::. This is used by programs that do
- backups, so that backing a file up does not count as reading it.
- Only the owner of the file or the superuser may use this bit.
- This is a GNU extension.
- File: libc.info, Node: Getting File Status Flags, Prev: Operating Modes, Up: File Status Flags
- 13.15.4 Getting and Setting File Status Flags
- ---------------------------------------------
- The ‘fcntl’ function can fetch or change file status flags.
- -- Macro: int F_GETFL
- This macro is used as the COMMAND argument to ‘fcntl’, to read the
- file status flags for the open file with descriptor FILEDES.
- The normal return value from ‘fcntl’ with this command is a
- nonnegative number which can be interpreted as the bitwise OR of
- the individual flags. Since the file access modes are not
- single-bit values, you can mask off other bits in the returned
- flags with ‘O_ACCMODE’ to compare them.
- In case of an error, ‘fcntl’ returns -1. The following ‘errno’
- error conditions are defined for this command:
- ‘EBADF’
- The FILEDES argument is invalid.
- -- Macro: int F_SETFL
- This macro is used as the COMMAND argument to ‘fcntl’, to set the
- file status flags for the open file corresponding to the FILEDES
- argument. This command requires a third ‘int’ argument to specify
- the new flags, so the call looks like this:
- fcntl (FILEDES, F_SETFL, NEW-FLAGS)
- You can't change the access mode for the file in this way; that is,
- whether the file descriptor was opened for reading or writing.
- The normal return value from ‘fcntl’ with this command is an
- unspecified value other than -1, which indicates an error. The
- error conditions are the same as for the ‘F_GETFL’ command.
- If you want to modify the file status flags, you should get the
- current flags with ‘F_GETFL’ and modify the value. Don't assume that
- the flags listed here are the only ones that are implemented; your
- program may be run years from now and more flags may exist then. For
- example, here is a function to set or clear the flag ‘O_NONBLOCK’
- without altering any other flags:
- /* Set the ‘O_NONBLOCK’ flag of DESC if VALUE is nonzero,
- or clear the flag if VALUE is 0.
- Return 0 on success, or -1 on error with ‘errno’ set. */
- int
- set_nonblock_flag (int desc, int value)
- {
- int oldflags = fcntl (desc, F_GETFL, 0);
- /* If reading the flags failed, return error indication now. */
- if (oldflags == -1)
- return -1;
- /* Set just the flag we want to set. */
- if (value != 0)
- oldflags |= O_NONBLOCK;
- else
- oldflags &= ~O_NONBLOCK;
- /* Store modified flag word in the descriptor. */
- return fcntl (desc, F_SETFL, oldflags);
- }
- File: libc.info, Node: File Locks, Next: Open File Description Locks, Prev: File Status Flags, Up: Low-Level I/O
- 13.16 File Locks
- ================
- This section describes record locks that are associated with the
- process. There is also a different type of record lock that is
- associated with the open file description instead of the process. *Note
- Open File Description Locks::.
- The remaining ‘fcntl’ commands are used to support “record locking”,
- which permits multiple cooperating programs to prevent each other from
- simultaneously accessing parts of a file in error-prone ways.
- An “exclusive” or “write” lock gives a process exclusive access for
- writing to the specified part of the file. While a write lock is in
- place, no other process can lock that part of the file.
- A “shared” or “read” lock prohibits any other process from requesting
- a write lock on the specified part of the file. However, other
- processes can request read locks.
- The ‘read’ and ‘write’ functions do not actually check to see whether
- there are any locks in place. If you want to implement a locking
- protocol for a file shared by multiple processes, your application must
- do explicit ‘fcntl’ calls to request and clear locks at the appropriate
- points.
- Locks are associated with processes. A process can only have one
- kind of lock set for each byte of a given file. When any file
- descriptor for that file is closed by the process, all of the locks that
- process holds on that file are released, even if the locks were made
- using other descriptors that remain open. Likewise, locks are released
- when a process exits, and are not inherited by child processes created
- using ‘fork’ (*note Creating a Process::).
- When making a lock, use a ‘struct flock’ to specify what kind of lock
- and where. This data type and the associated macros for the ‘fcntl’
- function are declared in the header file ‘fcntl.h’.
- -- Data Type: struct flock
- This structure is used with the ‘fcntl’ function to describe a file
- lock. It has these members:
- ‘short int l_type’
- Specifies the type of the lock; one of ‘F_RDLCK’, ‘F_WRLCK’,
- or ‘F_UNLCK’.
- ‘short int l_whence’
- This corresponds to the WHENCE argument to ‘fseek’ or ‘lseek’,
- and specifies what the offset is relative to. Its value can
- be one of ‘SEEK_SET’, ‘SEEK_CUR’, or ‘SEEK_END’.
- ‘off_t l_start’
- This specifies the offset of the start of the region to which
- the lock applies, and is given in bytes relative to the point
- specified by the ‘l_whence’ member.
- ‘off_t l_len’
- This specifies the length of the region to be locked. A value
- of ‘0’ is treated specially; it means the region extends to
- the end of the file.
- ‘pid_t l_pid’
- This field is the process ID (*note Process Creation
- Concepts::) of the process holding the lock. It is filled in
- by calling ‘fcntl’ with the ‘F_GETLK’ command, but is ignored
- when making a lock. If the conflicting lock is an open file
- description lock (*note Open File Description Locks::), then
- this field will be set to -1.
- -- Macro: int F_GETLK
- This macro is used as the COMMAND argument to ‘fcntl’, to specify
- that it should get information about a lock. This command requires
- a third argument of type ‘struct flock *’ to be passed to ‘fcntl’,
- so that the form of the call is:
- fcntl (FILEDES, F_GETLK, LOCKP)
- If there is a lock already in place that would block the lock
- described by the LOCKP argument, information about that lock
- overwrites ‘*LOCKP’. Existing locks are not reported if they are
- compatible with making a new lock as specified. Thus, you should
- specify a lock type of ‘F_WRLCK’ if you want to find out about both
- read and write locks, or ‘F_RDLCK’ if you want to find out about
- write locks only.
- There might be more than one lock affecting the region specified by
- the LOCKP argument, but ‘fcntl’ only returns information about one
- of them. The ‘l_whence’ member of the LOCKP structure is set to
- ‘SEEK_SET’ and the ‘l_start’ and ‘l_len’ fields set to identify the
- locked region.
- If no lock applies, the only change to the LOCKP structure is to
- update the ‘l_type’ to a value of ‘F_UNLCK’.
- The normal return value from ‘fcntl’ with this command is an
- unspecified value other than -1, which is reserved to indicate an
- error. The following ‘errno’ error conditions are defined for this
- command:
- ‘EBADF’
- The FILEDES argument is invalid.
- ‘EINVAL’
- Either the LOCKP argument doesn't specify valid lock
- information, or the file associated with FILEDES doesn't
- support locks.
- -- Macro: int F_SETLK
- This macro is used as the COMMAND argument to ‘fcntl’, to specify
- that it should set or clear a lock. This command requires a third
- argument of type ‘struct flock *’ to be passed to ‘fcntl’, so that
- the form of the call is:
- fcntl (FILEDES, F_SETLK, LOCKP)
- If the process already has a lock on any part of the region, the
- old lock on that part is replaced with the new lock. You can
- remove a lock by specifying a lock type of ‘F_UNLCK’.
- If the lock cannot be set, ‘fcntl’ returns immediately with a value
- of -1. This function does not block while waiting for other
- processes to release locks. If ‘fcntl’ succeeds, it returns a
- value other than -1.
- The following ‘errno’ error conditions are defined for this
- function:
- ‘EAGAIN’
- ‘EACCES’
- The lock cannot be set because it is blocked by an existing
- lock on the file. Some systems use ‘EAGAIN’ in this case, and
- other systems use ‘EACCES’; your program should treat them
- alike, after ‘F_SETLK’. (GNU/Linux and GNU/Hurd systems
- always use ‘EAGAIN’.)
- ‘EBADF’
- Either: the FILEDES argument is invalid; you requested a read
- lock but the FILEDES is not open for read access; or, you
- requested a write lock but the FILEDES is not open for write
- access.
- ‘EINVAL’
- Either the LOCKP argument doesn't specify valid lock
- information, or the file associated with FILEDES doesn't
- support locks.
- ‘ENOLCK’
- The system has run out of file lock resources; there are
- already too many file locks in place.
- Well-designed file systems never report this error, because
- they have no limitation on the number of locks. However, you
- must still take account of the possibility of this error, as
- it could result from network access to a file system on
- another machine.
- -- Macro: int F_SETLKW
- This macro is used as the COMMAND argument to ‘fcntl’, to specify
- that it should set or clear a lock. It is just like the ‘F_SETLK’
- command, but causes the process to block (or wait) until the
- request can be specified.
- This command requires a third argument of type ‘struct flock *’, as
- for the ‘F_SETLK’ command.
- The ‘fcntl’ return values and errors are the same as for the
- ‘F_SETLK’ command, but these additional ‘errno’ error conditions
- are defined for this command:
- ‘EINTR’
- The function was interrupted by a signal while it was waiting.
- *Note Interrupted Primitives::.
- ‘EDEADLK’
- The specified region is being locked by another process. But
- that process is waiting to lock a region which the current
- process has locked, so waiting for the lock would result in
- deadlock. The system does not guarantee that it will detect
- all such conditions, but it lets you know if it notices one.
- The following macros are defined for use as values for the ‘l_type’
- member of the ‘flock’ structure. The values are integer constants.
- ‘F_RDLCK’
- This macro is used to specify a read (or shared) lock.
- ‘F_WRLCK’
- This macro is used to specify a write (or exclusive) lock.
- ‘F_UNLCK’
- This macro is used to specify that the region is unlocked.
- As an example of a situation where file locking is useful, consider a
- program that can be run simultaneously by several different users, that
- logs status information to a common file. One example of such a program
- might be a game that uses a file to keep track of high scores. Another
- example might be a program that records usage or accounting information
- for billing purposes.
- Having multiple copies of the program simultaneously writing to the
- file could cause the contents of the file to become mixed up. But you
- can prevent this kind of problem by setting a write lock on the file
- before actually writing to the file.
- If the program also needs to read the file and wants to make sure
- that the contents of the file are in a consistent state, then it can
- also use a read lock. While the read lock is set, no other process can
- lock that part of the file for writing.
- Remember that file locks are only an _advisory_ protocol for
- controlling access to a file. There is still potential for access to
- the file by programs that don't use the lock protocol.
- File: libc.info, Node: Open File Description Locks, Next: Open File Description Locks Example, Prev: File Locks, Up: Low-Level I/O
- 13.17 Open File Description Locks
- =================================
- In contrast to process-associated record locks (*note File Locks::),
- open file description record locks are associated with an open file
- description rather than a process.
- Using ‘fcntl’ to apply an open file description lock on a region that
- already has an existing open file description lock that was created via
- the same file descriptor will never cause a lock conflict.
- Open file description locks are also inherited by child processes
- across ‘fork’, or ‘clone’ with ‘CLONE_FILES’ set (*note Creating a
- Process::), along with the file descriptor.
- It is important to distinguish between the open file _description_
- (an instance of an open file, usually created by a call to ‘open’) and
- an open file _descriptor_, which is a numeric value that refers to the
- open file description. The locks described here are associated with the
- open file _description_ and not the open file _descriptor_.
- Using ‘dup’ (*note Duplicating Descriptors::) to copy a file
- descriptor does not give you a new open file description, but rather
- copies a reference to an existing open file description and assigns it
- to a new file descriptor. Thus, open file description locks set on a
- file descriptor cloned by ‘dup’ will never conflict with open file
- description locks set on the original descriptor since they refer to the
- same open file description. Depending on the range and type of lock
- involved, the original lock may be modified by a ‘F_OFD_SETLK’ or
- ‘F_OFD_SETLKW’ command in this situation however.
- Open file description locks always conflict with process-associated
- locks, even if acquired by the same process or on the same open file
- descriptor.
- Open file description locks use the same ‘struct flock’ as
- process-associated locks as an argument (*note File Locks::) and the
- macros for the ‘command’ values are also declared in the header file
- ‘fcntl.h’. To use them, the macro ‘_GNU_SOURCE’ must be defined prior
- to including any header file.
- In contrast to process-associated locks, any ‘struct flock’ used as
- an argument to open file description lock commands must have the ‘l_pid’
- value set to 0. Also, when returning information about an open file
- description lock in a ‘F_GETLK’ or ‘F_OFD_GETLK’ request, the ‘l_pid’
- field in ‘struct flock’ will be set to -1 to indicate that the lock is
- not associated with a process.
- When the same ‘struct flock’ is reused as an argument to a
- ‘F_OFD_SETLK’ or ‘F_OFD_SETLKW’ request after being used for an
- ‘F_OFD_GETLK’ request, it is necessary to inspect and reset the ‘l_pid’
- field to 0.
- -- Macro: int F_OFD_GETLK
- This macro is used as the COMMAND argument to ‘fcntl’, to specify
- that it should get information about a lock. This command requires
- a third argument of type ‘struct flock *’ to be passed to ‘fcntl’,
- so that the form of the call is:
- fcntl (FILEDES, F_OFD_GETLK, LOCKP)
- If there is a lock already in place that would block the lock
- described by the LOCKP argument, information about that lock is
- written to ‘*LOCKP’. Existing locks are not reported if they are
- compatible with making a new lock as specified. Thus, you should
- specify a lock type of ‘F_WRLCK’ if you want to find out about both
- read and write locks, or ‘F_RDLCK’ if you want to find out about
- write locks only.
- There might be more than one lock affecting the region specified by
- the LOCKP argument, but ‘fcntl’ only returns information about one
- of them. Which lock is returned in this situation is undefined.
- The ‘l_whence’ member of the LOCKP structure are set to ‘SEEK_SET’
- and the ‘l_start’ and ‘l_len’ fields are set to identify the locked
- region.
- If no conflicting lock exists, the only change to the LOCKP
- structure is to update the ‘l_type’ field to the value ‘F_UNLCK’.
- The normal return value from ‘fcntl’ with this command is either 0
- on success or -1, which indicates an error. The following ‘errno’
- error conditions are defined for this command:
- ‘EBADF’
- The FILEDES argument is invalid.
- ‘EINVAL’
- Either the LOCKP argument doesn't specify valid lock
- information, the operating system kernel doesn't support open
- file description locks, or the file associated with FILEDES
- doesn't support locks.
- -- Macro: int F_OFD_SETLK
- This macro is used as the COMMAND argument to ‘fcntl’, to specify
- that it should set or clear a lock. This command requires a third
- argument of type ‘struct flock *’ to be passed to ‘fcntl’, so that
- the form of the call is:
- fcntl (FILEDES, F_OFD_SETLK, LOCKP)
- If the open file already has a lock on any part of the region, the
- old lock on that part is replaced with the new lock. You can
- remove a lock by specifying a lock type of ‘F_UNLCK’.
- If the lock cannot be set, ‘fcntl’ returns immediately with a value
- of -1. This command does not wait for other tasks to release
- locks. If ‘fcntl’ succeeds, it returns 0.
- The following ‘errno’ error conditions are defined for this
- command:
- ‘EAGAIN’
- The lock cannot be set because it is blocked by an existing
- lock on the file.
- ‘EBADF’
- Either: the FILEDES argument is invalid; you requested a read
- lock but the FILEDES is not open for read access; or, you
- requested a write lock but the FILEDES is not open for write
- access.
- ‘EINVAL’
- Either the LOCKP argument doesn't specify valid lock
- information, the operating system kernel doesn't support open
- file description locks, or the file associated with FILEDES
- doesn't support locks.
- ‘ENOLCK’
- The system has run out of file lock resources; there are
- already too many file locks in place.
- Well-designed file systems never report this error, because
- they have no limitation on the number of locks. However, you
- must still take account of the possibility of this error, as
- it could result from network access to a file system on
- another machine.
- -- Macro: int F_OFD_SETLKW
- This macro is used as the COMMAND argument to ‘fcntl’, to specify
- that it should set or clear a lock. It is just like the
- ‘F_OFD_SETLK’ command, but causes the process to wait until the
- request can be completed.
- This command requires a third argument of type ‘struct flock *’, as
- for the ‘F_OFD_SETLK’ command.
- The ‘fcntl’ return values and errors are the same as for the
- ‘F_OFD_SETLK’ command, but these additional ‘errno’ error
- conditions are defined for this command:
- ‘EINTR’
- The function was interrupted by a signal while it was waiting.
- *Note Interrupted Primitives::.
- Open file description locks are useful in the same sorts of
- situations as process-associated locks. They can also be used to
- synchronize file access between threads within the same process by
- having each thread perform its own ‘open’ of the file, to obtain its own
- open file description.
- Because open file description locks are automatically freed only upon
- closing the last file descriptor that refers to the open file
- description, this locking mechanism avoids the possibility that locks
- are inadvertently released due to a library routine opening and closing
- a file without the application being aware.
- As with process-associated locks, open file description locks are
- advisory.
- File: libc.info, Node: Open File Description Locks Example, Next: Interrupt Input, Prev: Open File Description Locks, Up: Low-Level I/O
- 13.18 Open File Description Locks Example
- =========================================
- Here is an example of using open file description locks in a threaded
- program. If this program used process-associated locks, then it would
- be subject to data corruption because process-associated locks are
- shared by the threads inside a process, and thus cannot be used by one
- thread to lock out another thread in the same process.
- Proper error handling has been omitted in the following program for
- brevity.
- #define _GNU_SOURCE
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <pthread.h>
- #define FILENAME "/tmp/foo"
- #define NUM_THREADS 3
- #define ITERATIONS 5
- void *
- thread_start (void *arg)
- {
- int i, fd, len;
- long tid = (long) arg;
- char buf[256];
- struct flock lck = {
- .l_whence = SEEK_SET,
- .l_start = 0,
- .l_len = 1,
- };
- fd = open ("/tmp/foo", O_RDWR | O_CREAT, 0666);
- for (i = 0; i < ITERATIONS; i++)
- {
- lck.l_type = F_WRLCK;
- fcntl (fd, F_OFD_SETLKW, &lck);
- len = sprintf (buf, "%d: tid=%ld fd=%d\n", i, tid, fd);
- lseek (fd, 0, SEEK_END);
- write (fd, buf, len);
- fsync (fd);
- lck.l_type = F_UNLCK;
- fcntl (fd, F_OFD_SETLK, &lck);
- /* sleep to ensure lock is yielded to another thread */
- usleep (1);
- }
- pthread_exit (NULL);
- }
- int
- main (int argc, char **argv)
- {
- long i;
- pthread_t threads[NUM_THREADS];
- truncate (FILENAME, 0);
- for (i = 0; i < NUM_THREADS; i++)
- pthread_create (&threads[i], NULL, thread_start, (void *) i);
- pthread_exit (NULL);
- return 0;
- }
- This example creates three threads each of which loops five times,
- appending to the file. Access to the file is serialized via open file
- description locks. If we compile and run the above program, we'll end
- up with /tmp/foo that has 15 lines in it.
- If we, however, were to replace the ‘F_OFD_SETLK’ and ‘F_OFD_SETLKW’
- commands with their process-associated lock equivalents, the locking
- essentially becomes a noop since it is all done within the context of
- the same process. That leads to data corruption (typically manifested
- as missing lines) as some threads race in and overwrite the data written
- by others.
- File: libc.info, Node: Interrupt Input, Next: IOCTLs, Prev: Open File Description Locks Example, Up: Low-Level I/O
- 13.19 Interrupt-Driven Input
- ============================
- If you set the ‘O_ASYNC’ status flag on a file descriptor (*note File
- Status Flags::), a ‘SIGIO’ signal is sent whenever input or output
- becomes possible on that file descriptor. The process or process group
- to receive the signal can be selected by using the ‘F_SETOWN’ command to
- the ‘fcntl’ function. If the file descriptor is a socket, this also
- selects the recipient of ‘SIGURG’ signals that are delivered when
- out-of-band data arrives on that socket; see *note Out-of-Band Data::.
- (‘SIGURG’ is sent in any situation where ‘select’ would report the
- socket as having an "exceptional condition". *Note Waiting for I/O::.)
- If the file descriptor corresponds to a terminal device, then ‘SIGIO’
- signals are sent to the foreground process group of the terminal. *Note
- Job Control::.
- The symbols in this section are defined in the header file ‘fcntl.h’.
- -- Macro: int F_GETOWN
- This macro is used as the COMMAND argument to ‘fcntl’, to specify
- that it should get information about the process or process group
- to which ‘SIGIO’ signals are sent. (For a terminal, this is
- actually the foreground process group ID, which you can get using
- ‘tcgetpgrp’; see *note Terminal Access Functions::.)
- The return value is interpreted as a process ID; if negative, its
- absolute value is the process group ID.
- The following ‘errno’ error condition is defined for this command:
- ‘EBADF’
- The FILEDES argument is invalid.
- -- Macro: int F_SETOWN
- This macro is used as the COMMAND argument to ‘fcntl’, to specify
- that it should set the process or process group to which ‘SIGIO’
- signals are sent. This command requires a third argument of type
- ‘pid_t’ to be passed to ‘fcntl’, so that the form of the call is:
- fcntl (FILEDES, F_SETOWN, PID)
- The PID argument should be a process ID. You can also pass a
- negative number whose absolute value is a process group ID.
- The return value from ‘fcntl’ with this command is -1 in case of
- error and some other value if successful. The following ‘errno’
- error conditions are defined for this command:
- ‘EBADF’
- The FILEDES argument is invalid.
- ‘ESRCH’
- There is no process or process group corresponding to PID.
- File: libc.info, Node: IOCTLs, Next: Other Low-Level I/O APIs, Prev: Interrupt Input, Up: Low-Level I/O
- 13.20 Generic I/O Control operations
- ====================================
- GNU systems can handle most input/output operations on many different
- devices and objects in terms of a few file primitives - ‘read’, ‘write’
- and ‘lseek’. However, most devices also have a few peculiar operations
- which do not fit into this model. Such as:
- • Changing the character font used on a terminal.
- • Telling a magnetic tape system to rewind or fast forward. (Since
- they cannot move in byte increments, ‘lseek’ is inapplicable).
- • Ejecting a disk from a drive.
- • Playing an audio track from a CD-ROM drive.
- • Maintaining routing tables for a network.
- Although some such objects such as sockets and terminals (1) have
- special functions of their own, it would not be practical to create
- functions for all these cases.
- Instead these minor operations, known as “IOCTL”s, are assigned code
- numbers and multiplexed through the ‘ioctl’ function, defined in
- ‘sys/ioctl.h’. The code numbers themselves are defined in many
- different headers.
- -- Function: int ioctl (int FILEDES, int COMMAND, ...)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘ioctl’ function performs the generic I/O operation COMMAND on
- FILEDES.
- A third argument is usually present, either a single number or a
- pointer to a structure. The meaning of this argument, the returned
- value, and any error codes depends upon the command used. Often -1
- is returned for a failure.
- On some systems, IOCTLs used by different devices share the same
- numbers. Thus, although use of an inappropriate IOCTL _usually_ only
- produces an error, you should not attempt to use device-specific IOCTLs
- on an unknown device.
- Most IOCTLs are OS-specific and/or only used in special system
- utilities, and are thus beyond the scope of this document. For an
- example of the use of an IOCTL, see *note Out-of-Band Data::.
- ---------- Footnotes ----------
- (1) Actually, the terminal-specific functions are implemented with
- IOCTLs on many platforms.
- File: libc.info, Node: Other Low-Level I/O APIs, Prev: IOCTLs, Up: Low-Level I/O
- 13.21 Other low-level-I/O-related functions
- ===========================================
- -- Data Type: struct pollfd
- -- Data Type: struct epoll_event
- -- Function: int poll (struct pollfd *FDS, nfds_t NFDS, int TIMEOUT)
- This documentation is a stub. For additional information on this
- function, consult the manual page poll(2) (Latest, online:
- <https://man7.org/linux/man-pages/man2/poll.2.html>) *Note Linux
- Kernel::.
- -- Function: int epoll_create (int SIZE)
- This documentation is a stub. For additional information on this
- function, consult the manual page epoll_create(2) (Latest, online:
- <https://man7.org/linux/man-pages/man2/epoll_create.2.html>) *Note
- Linux Kernel::.
- -- Function: int epoll_wait (int EPFD, struct epoll_event *EVENTS, int
- MAXEVENTS, int TIMEOUT)
- This documentation is a stub. For additional information on this
- function, consult the manual page epoll_wait(2) (Latest, online:
- <https://man7.org/linux/man-pages/man2/epoll_wait.2.html>) *Note
- Linux Kernel::.
- File: libc.info, Node: File System Interface, Next: Pipes and FIFOs, Prev: Low-Level I/O, Up: Top
- 14 File System Interface
- ************************
- This chapter describes the GNU C Library's functions for manipulating
- files. Unlike the input and output functions (*note I/O on Streams::;
- *note Low-Level I/O::), these functions are concerned with operating on
- the files themselves rather than on their contents.
- Among the facilities described in this chapter are functions for
- examining or modifying directories, functions for renaming and deleting
- files, and functions for examining and setting file attributes such as
- access permissions and modification times.
- * Menu:
- * Working Directory:: This is used to resolve relative
- file names.
- * Descriptor-Relative Access:: Ways to control file name lookup.
- * Accessing Directories:: Finding out what files a directory
- contains.
- * Working with Directory Trees:: Apply actions to all files or a selectable
- subset of a directory hierarchy.
- * Hard Links:: Adding alternate names to a file.
- * Symbolic Links:: A file that "points to" a file name.
- * Deleting Files:: How to delete a file, and what that means.
- * Renaming Files:: Changing a file's name.
- * Creating Directories:: A system call just for creating a directory.
- * File Attributes:: Attributes of individual files.
- * Making Special Files:: How to create special files.
- * Temporary Files:: Naming and creating temporary files.
- File: libc.info, Node: Working Directory, Next: Descriptor-Relative Access, Up: File System Interface
- 14.1 Working Directory
- ======================
- Each process has associated with it a directory, called its “current
- working directory” or simply “working directory”, that is used in the
- resolution of relative file names (*note File Name Resolution::).
- When you log in and begin a new session, your working directory is
- initially set to the home directory associated with your login account
- in the system user database. You can find any user's home directory
- using the ‘getpwuid’ or ‘getpwnam’ functions; see *note User Database::.
- Users can change the working directory using shell commands like
- ‘cd’. The functions described in this section are the primitives used
- by those commands and by other programs for examining and changing the
- working directory.
- Prototypes for these functions are declared in the header file
- ‘unistd.h’.
- -- Function: char * getcwd (char *BUFFER, size_t SIZE)
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
- POSIX Safety Concepts::.
- The ‘getcwd’ function returns an absolute file name representing
- the current working directory, storing it in the character array
- BUFFER that you provide. The SIZE argument is how you tell the
- system the allocation size of BUFFER.
- The GNU C Library version of this function also permits you to
- specify a null pointer for the BUFFER argument. Then ‘getcwd’
- allocates a buffer automatically, as with ‘malloc’ (*note
- Unconstrained Allocation::). If the SIZE is greater than zero,
- then the buffer is that large; otherwise, the buffer is as large as
- necessary to hold the result.
- The return value is BUFFER on success and a null pointer on
- failure. The following ‘errno’ error conditions are defined for
- this function:
- ‘EINVAL’
- The SIZE argument is zero and BUFFER is not a null pointer.
- ‘ERANGE’
- The SIZE argument is less than the length of the working
- directory name. You need to allocate a bigger array and try
- again.
- ‘EACCES’
- Permission to read or search a component of the file name was
- denied.
- You could implement the behavior of GNU's ‘getcwd (NULL, 0)’ using
- only the standard behavior of ‘getcwd’:
- char *
- gnu_getcwd ()
- {
- size_t size = 100;
- while (1)
- {
- char *buffer = (char *) xmalloc (size);
- if (getcwd (buffer, size) == buffer)
- return buffer;
- free (buffer);
- if (errno != ERANGE)
- return 0;
- size *= 2;
- }
- }
- *Note Malloc Examples::, for information about ‘xmalloc’, which is not a
- library function but is a customary name used in most GNU software.
- -- Deprecated Function: char * getwd (char *BUFFER)
- Preliminary: | MT-Safe | AS-Unsafe heap i18n | AC-Unsafe mem fd |
- *Note POSIX Safety Concepts::.
- This is similar to ‘getcwd’, but has no way to specify the size of
- the buffer. The GNU C Library provides ‘getwd’ only for backwards
- compatibility with BSD.
- The BUFFER argument should be a pointer to an array at least
- ‘PATH_MAX’ bytes long (*note Limits for Files::). On GNU/Hurd
- systems there is no limit to the size of a file name, so this is
- not necessarily enough space to contain the directory name. That
- is why this function is deprecated.
- -- Function: char * get_current_dir_name (void)
- Preliminary: | MT-Safe env | AS-Unsafe heap | AC-Unsafe mem fd |
- *Note POSIX Safety Concepts::.
- The ‘get_current_dir_name’ function is basically equivalent to
- ‘getcwd (NULL, 0)’, except the value of the ‘PWD’ environment
- variable is first examined, and if it does in fact correspond to
- the current directory, that value is returned. This is a subtle
- difference which is visible if the path described by the value in
- ‘PWD’ is using one or more symbolic links, in which case the value
- returned by ‘getcwd’ would resolve the symbolic links and therefore
- yield a different result.
- This function is a GNU extension.
- -- Function: int chdir (const char *FILENAME)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function is used to set the process's working directory to
- FILENAME.
- The normal, successful return value from ‘chdir’ is ‘0’. A value
- of ‘-1’ is returned to indicate an error. The ‘errno’ error
- conditions defined for this function are the usual file name syntax
- errors (*note File Name Errors::), plus ‘ENOTDIR’ if the file
- FILENAME is not a directory.
- -- Function: int fchdir (int FILEDES)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function is used to set the process's working directory to
- directory associated with the file descriptor FILEDES.
- The normal, successful return value from ‘fchdir’ is ‘0’. A value
- of ‘-1’ is returned to indicate an error. The following ‘errno’
- error conditions are defined for this function:
- ‘EACCES’
- Read permission is denied for the directory named by
- ‘dirname’.
- ‘EBADF’
- The FILEDES argument is not a valid file descriptor.
- ‘ENOTDIR’
- The file descriptor FILEDES is not associated with a
- directory.
- ‘EINTR’
- The function call was interrupt by a signal.
- ‘EIO’
- An I/O error occurred.
- File: libc.info, Node: Descriptor-Relative Access, Next: Accessing Directories, Prev: Working Directory, Up: File System Interface
- 14.2 Descriptor-Relative Access
- ===============================
- Many functions that accept file names have ‘...at’ variants which accept
- a file descriptor and a file name argument instead of just a file name
- argument. For example, ‘fstatat’ is the descriptor-based variant of the
- ‘fstat’ function. Most such functions also accept an additional flags
- argument which changes the behavior of the file name lookup based on the
- passed ‘AT_...’ flags.
- There are several reasons to use descriptor-relative access:
- • The working directory is a process-wide resource, so individual
- threads cannot change it without affecting other threads in the
- process. Explicitly specifying the directory against which
- relative paths are resolved can be a thread-safe alternative to
- changing the working directory.
- • If a program wishes to access a directory tree which is being
- modified concurrently, perhaps even by a different user on the
- system, the program must avoid looking up file names with multiple
- components, in order to detect symbolic links, using the
- ‘O_NOFOLLOW’ flag (*note Open-time Flags::) or the
- ‘AT_SYMLINK_FOLLOW’ flag (described below). Without
- directory-relative access, it is necessary to use the ‘fchdir’
- function to change the working directory (*note Working
- Directory::), which is not thread-safe.
- • Listing directory contents using the ‘readdir’ or ‘readdir64’
- functions (*note Reading/Closing Directory::) does not provide full
- file name paths. Using ‘...at’ functions, it is possible to use
- the file names directly, without having to construct such full
- paths.
- • Additional flags available with some of the ‘...at’ functions
- provide access to functionality which is not available otherwise.
- The file descriptor used by these ‘...at’ functions has the following
- uses:
- • It can be a file descriptor referring to a directory. Such a
- descriptor can be created explicitly using the ‘open’ function and
- the ‘O_RDONLY’ file access mode, with or without the ‘O_DIRECTORY’
- flag. *Note Opening and Closing Files::. Or it can be created
- implicitly by ‘opendir’ and retrieved using the ‘dirfd’ function.
- *Note Opening a Directory::.
- If a directory descriptor is used with one of the ‘...at’
- functions, a relative file name argument is resolved relative to
- directory referred to by the file descriptor, just as if that
- directory were the current working directory. Absolute file name
- arguments (starting with ‘/’) are resolved against the file system
- root, and the descriptor argument is effectively ignored.
- This means that file name lookup is not constrained to the
- directory of the descriptor. For example, it is possible to access
- a file ‘example’ in the descriptor's parent directory using a file
- name argument ‘"../example"’, or in the root directory using
- ‘"/example"’.
- If the file descriptor refers to a directory, the empty string ‘""’
- is not a valid file name argument. It is possible to use ‘"."’ to
- refer to the directory itself. Also see ‘AT_EMPTY_PATH’ below.
- • The special value ‘AT_FDCWD’. This means that the current working
- directory is used for the lookup if the file name is a relative.
- For ‘...at’ functions with an ‘AT_...’ flags argument, this
- provides a shortcut to use those flags with regular (not
- descriptor-based) file name lookups.
- If ‘AT_FDCWD’ is used, the empty string ‘""’ is not a valid file
- name argument.
- • An arbitrary file descriptor, along with an empty string ‘""’ as
- the file name argument, and the ‘AT_EMPTY_PATH’ flag. In this
- case, the operation uses the file descriptor directly, without
- further file name resolution. On Linux, this allows operations on
- descriptors opened with the ‘O_PATH’ flag. For regular descriptors
- (opened without ‘O_PATH’), the same functionality is also available
- through the plain descriptor-based functions (for example, ‘fstat’
- instead of ‘fstatat’).
- This is a GNU extension.
- The flags argument in ‘...at’ functions can be a combination of the
- following flags, defined in ‘fcntl.h’. Not all such functions support
- all flags, and some (such as ‘openat’) do not accept a flags argument at
- all. Although the flags specific to each function have distinct values
- from each other, some flags (relevant to different functions) might
- share the same value and therefore are not guaranteed to have unique
- values.
- A non-exhaustive list of common flags and their descriptions follows.
- Flags specific to a function are described alongside the function
- itself. In these flag descriptions, the “effective final path
- component” refers to the final component (basename) of the full path
- constructed from the descriptor and file name arguments, using file name
- lookup, as described above.
- ‘AT_EMPTY_PATH’
- This flag is used with an empty file name ‘""’ and a descriptor
- which does not necessarily refer to a directory. It is most useful
- with ‘O_PATH’ descriptors, as described above. This flag is a GNU
- extension.
- ‘AT_NO_AUTOMOUNT’
- If the effective final path component refers to a potential file
- system mount point controlled by an auto-mounting service, the
- operation does not trigger auto-mounting and refers to the
- unmounted mount point instead. *Note Mount-Unmount-Remount::. If
- a file system has already been mounted at the effective final path
- component, the operation applies to the file or directory in the
- mounted file system, not the underlying file system that was
- mounted over. This flag is a GNU extension.
- ‘AT_SYMLINK_FOLLOW’
- If the effective final path component is a symbolic link, the
- operation follows the symbolic link and operates on its target.
- (For most functions, this is the default behavior.)
- ‘AT_SYMLINK_NOFOLLOW’
- If the effective final path component is a symbolic link, the
- operation operates on the symbolic link, without following it. The
- difference in behavior enabled by this flag is similar to the
- difference between the ‘lstat’ and ‘stat’ functions, or the
- behavior activated by the ‘O_NOFOLLOW’ argument to the ‘open’
- function. Even with the ‘AT_SYMLINK_NOFOLLOW’ flag present,
- symbolic links in a non-final component of the file name are still
- followed.
- *Note:* There is no relationship between these flags and the type
- argument to the ‘getauxval’ function (with ‘AT_...’ constants defined in
- ‘elf.h’). *Note Auxiliary Vector::.
- The ‘...at’ functions have some common error conditions due to the
- nature of descriptor-relative access. A list of common errors and their
- descriptions follows. Errors specific to a function are described
- alongside the function itself.
- ‘EBADF’
- The file name argument is a relative path but the descriptor
- argument is neither ‘AT_FDCWD’ nor a valid file descriptor.
- ‘EINVAL’
- If the function accepts a FLAGS argument, the flag combination
- passed is not valid for the function.
- ‘ENOTDIR’
- The file name argument is a relative file name but the descriptor
- argument is associated with a file that is not a directory.
- File: libc.info, Node: Accessing Directories, Next: Working with Directory Trees, Prev: Descriptor-Relative Access, Up: File System Interface
- 14.3 Accessing Directories
- ==========================
- The facilities described in this section let you read the contents of a
- directory file. This is useful if you want your program to list all the
- files in a directory, perhaps as part of a menu.
- The ‘opendir’ function opens a “directory stream” whose elements are
- directory entries. Alternatively ‘fdopendir’ can be used which can have
- advantages if the program needs to have more control over the way the
- directory is opened for reading. This allows, for instance, to pass the
- ‘O_NOATIME’ flag to ‘open’.
- You use the ‘readdir’ function on the directory stream to retrieve
- these entries, represented as ‘struct dirent’ objects. The name of the
- file for each entry is stored in the ‘d_name’ member of this structure.
- There are obvious parallels here to the stream facilities for ordinary
- files, described in *note I/O on Streams::.
- * Menu:
- * Directory Entries:: Format of one directory entry.
- * Opening a Directory:: How to open a directory stream.
- * Reading/Closing Directory:: How to read directory entries from the stream.
- * Simple Directory Lister:: A very simple directory listing program.
- * Random Access Directory:: Rereading part of the directory
- already read with the same stream.
- * Scanning Directory Content:: Get entries for user selected subset of
- contents in given directory.
- * Simple Directory Lister Mark II:: Revised version of the program.
- * Low-level Directory Access:: AS-Safe functions for directory access.
- File: libc.info, Node: Directory Entries, Next: Opening a Directory, Up: Accessing Directories
- 14.3.1 Format of a Directory Entry
- ----------------------------------
- This section describes what you find in a single directory entry, as you
- might obtain it from a directory stream. All the symbols are declared
- in the header file ‘dirent.h’.
- -- Data Type: struct dirent
- This is a structure type used to return information about directory
- entries. It contains the following fields:
- ‘char d_name[]’
- This is the null-terminated file name component. This is the
- only field you can count on in all POSIX systems.
- While this field is defined with a specified length, functions
- such as ‘readdir’ may return a pointer to a ‘struct dirent’
- where the ‘d_name’ extends beyond the end of the struct.
- ‘ino_t d_fileno’
- This is the file serial number. For BSD compatibility, you
- can also refer to this member as ‘d_ino’. On GNU/Linux and
- GNU/Hurd systems and most POSIX systems, for most files this
- the same as the ‘st_ino’ member that ‘stat’ will return for
- the file. *Note File Attributes::.
- ‘off_t d_off’
- This value contains the offset of the next directory entry
- (after this entry) in the directory stream. The value may not
- be compatible with ‘lseek’ or ‘seekdir’, especially if the
- width of ‘d_off’ is less than 64 bits. Directory entries are
- not ordered by offset, and the ‘d_off’ and ‘d_reclen’ values
- are unrelated. Seeking on directory streams is not
- recommended. The symbol ‘_DIRENT_HAVE_D_OFF’ is defined if
- the ‘d_ino’ member is available.
- ‘unsigned char d_namlen’
- This is the length of the file name, not including the
- terminating null character. Its type is ‘unsigned char’
- because that is the integer type of the appropriate size.
- This member is a BSD extension. The symbol
- ‘_DIRENT_HAVE_D_NAMLEN’ is defined if this member is
- available. (It is not available on Linux.)
- ‘unsigned short int d_reclen’
- This is the length of the entire directory record. When
- iterating through a buffer filled by ‘getdents64’ (*note
- Low-level Directory Access::), this value needs to be added to
- the offset of the current directory entry to obtain the offset
- of the next entry. When using ‘readdir’ and related
- functions, the value of ‘d_reclen’ is undefined and should not
- be accessed. The symbol ‘_DIRENT_HAVE_D_RECLEN’ is defined if
- this member is available.
- ‘unsigned char d_type’
- This is the type of the file, possibly unknown. The following
- constants are defined for its value:
- ‘DT_UNKNOWN’
- The type is unknown. Only some filesystems have full
- support to return the type of the file, others might
- always return this value.
- ‘DT_REG’
- A regular file.
- ‘DT_DIR’
- A directory.
- ‘DT_FIFO’
- A named pipe, or FIFO. *Note FIFO Special Files::.
- ‘DT_SOCK’
- A local-domain socket.
- ‘DT_CHR’
- A character device.
- ‘DT_BLK’
- A block device.
- ‘DT_LNK’
- A symbolic link.
- This member is a BSD extension. The symbol
- ‘_DIRENT_HAVE_D_TYPE’ is defined if this member is available.
- On systems where it is used, it corresponds to the file type
- bits in the ‘st_mode’ member of ‘struct stat’. If the value
- cannot be determined the member value is ‘DT_UNKNOWN’. These
- two macros convert between ‘d_type’ values and ‘st_mode’
- values:
- -- Function: int IFTODT (mode_t MODE)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX
- Safety Concepts::.
- This returns the ‘d_type’ value corresponding to MODE.
- -- Function: mode_t DTTOIF (int DTYPE)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX
- Safety Concepts::.
- This returns the ‘st_mode’ value corresponding to DTYPE.
- This structure may contain additional members in the future. Their
- availability is always announced in the compilation environment by
- a macro named ‘_DIRENT_HAVE_D_XXX’ where XXX is replaced by the
- name of the new member. For instance, the member ‘d_reclen’
- available on some systems is announced through the macro
- ‘_DIRENT_HAVE_D_RECLEN’.
- When a file has multiple names, each name has its own directory
- entry. The only way you can tell that the directory entries belong
- to a single file is that they have the same value for the
- ‘d_fileno’ field.
- File attributes such as size, modification times etc., are part of
- the file itself, not of any particular directory entry. *Note File
- Attributes::.
- File: libc.info, Node: Opening a Directory, Next: Reading/Closing Directory, Prev: Directory Entries, Up: Accessing Directories
- 14.3.2 Opening a Directory Stream
- ---------------------------------
- This section describes how to open a directory stream. All the symbols
- are declared in the header file ‘dirent.h’.
- -- Data Type: DIR
- The ‘DIR’ data type represents a directory stream.
- You shouldn't ever allocate objects of the ‘struct dirent’ or ‘DIR’
- data types, since the directory access functions do that for you.
- Instead, you refer to these objects using the pointers returned by the
- following functions.
- Directory streams are a high-level interface. On Linux, alternative
- interfaces for accessing directories using file descriptors are
- available. *Note Low-level Directory Access::.
- -- Function: DIR * opendir (const char *DIRNAME)
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
- POSIX Safety Concepts::.
- The ‘opendir’ function opens and returns a directory stream for
- reading the directory whose file name is DIRNAME. The stream has
- type ‘DIR *’.
- If unsuccessful, ‘opendir’ returns a null pointer. In addition to
- the usual file name errors (*note File Name Errors::), the
- following ‘errno’ error conditions are defined for this function:
- ‘EACCES’
- Read permission is denied for the directory named by
- ‘dirname’.
- ‘EMFILE’
- The process has too many files open.
- ‘ENFILE’
- The entire system, or perhaps the file system which contains
- the directory, cannot support any additional open files at the
- moment. (This problem cannot happen on GNU/Hurd systems.)
- ‘ENOMEM’
- Not enough memory available.
- The ‘DIR’ type is typically implemented using a file descriptor,
- and the ‘opendir’ function in terms of the ‘open’ function. *Note
- Low-Level I/O::. Directory streams and the underlying file
- descriptors are closed on ‘exec’ (*note Executing a File::).
- The directory which is opened for reading by ‘opendir’ is identified
- by the name. In some situations this is not sufficient. Or the way
- ‘opendir’ implicitly creates a file descriptor for the directory is not
- the way a program might want it. In these cases an alternative
- interface can be used.
- -- Function: DIR * fdopendir (int FD)
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
- POSIX Safety Concepts::.
- The ‘fdopendir’ function works just like ‘opendir’ but instead of
- taking a file name and opening a file descriptor for the directory
- the caller is required to provide a file descriptor. This file
- descriptor is then used in subsequent uses of the returned
- directory stream object.
- The caller must make sure the file descriptor is associated with a
- directory and it allows reading.
- If the ‘fdopendir’ call returns successfully the file descriptor is
- now under the control of the system. It can be used in the same
- way the descriptor implicitly created by ‘opendir’ can be used but
- the program must not close the descriptor.
- In case the function is unsuccessful it returns a null pointer and
- the file descriptor remains to be usable by the program. The
- following ‘errno’ error conditions are defined for this function:
- ‘EBADF’
- The file descriptor is not valid.
- ‘ENOTDIR’
- The file descriptor is not associated with a directory.
- ‘EINVAL’
- The descriptor does not allow reading the directory content.
- ‘ENOMEM’
- Not enough memory available.
- In some situations it can be desirable to get hold of the file
- descriptor which is created by the ‘opendir’ call. For instance, to
- switch the current working directory to the directory just read the
- ‘fchdir’ function could be used. Historically the ‘DIR’ type was
- exposed and programs could access the fields. This does not happen in
- the GNU C Library. Instead a separate function is provided to allow
- access.
- -- Function: int dirfd (DIR *DIRSTREAM)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The function ‘dirfd’ returns the file descriptor associated with
- the directory stream DIRSTREAM. This descriptor can be used until
- the directory is closed with ‘closedir’. If the directory stream
- implementation is not using file descriptors the return value is
- ‘-1’.
- File: libc.info, Node: Reading/Closing Directory, Next: Simple Directory Lister, Prev: Opening a Directory, Up: Accessing Directories
- 14.3.3 Reading and Closing a Directory Stream
- ---------------------------------------------
- This section describes how to read directory entries from a directory
- stream, and how to close the stream when you are done with it. All the
- symbols are declared in the header file ‘dirent.h’.
- -- Function: struct dirent * readdir (DIR *DIRSTREAM)
- Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
- POSIX Safety Concepts::.
- This function reads the next entry from the directory. It normally
- returns a pointer to a structure containing information about the
- file. This structure is associated with the DIRSTREAM handle and
- can be rewritten by a subsequent call.
- *Portability Note:* On some systems ‘readdir’ may not return
- entries for ‘.’ and ‘..’, even though these are always valid file
- names in any directory. *Note File Name Resolution::.
- If a directory is modified between a call to ‘readdir’ and after
- the directory stream was created or ‘rewinddir’ was last called on
- it, it is unspecified according to POSIX whether newly created or
- removed entries appear among the entries returned by repeated
- ‘readdir’ calls before the end of the directory is reached.
- However, due to practical implementation constraints, it is
- possible that entries (including unrelated, unmodified entries)
- appear multiple times or do not appear at all if the directory is
- modified while listing it. If the application intends to create
- files in the directory, it may be necessary to complete the
- iteration first and create a copy of the information obtained
- before creating any new files. (See below for instructions
- regarding copying of ‘d_name’.) The iteration can be restarted
- using ‘rewinddir’. *Note Random Access Directory::.
- If there are no more entries in the directory or an error is
- detected, ‘readdir’ returns a null pointer. The following ‘errno’
- error conditions are defined for this function:
- ‘EBADF’
- The DIRSTREAM argument is not valid.
- To distinguish between an end-of-directory condition or an error,
- you must set ‘errno’ to zero before calling ‘readdir’. To avoid
- entering an infinite loop, you should stop reading from the
- directory after the first error.
- *Caution:* The pointer returned by ‘readdir’ points to a buffer
- within the ‘DIR’ object. The data in that buffer will be
- overwritten by the next call to ‘readdir’. You must take care, for
- instance, to copy the ‘d_name’ string if you need it later.
- Because of this, it is not safe to share a ‘DIR’ object among
- multiple threads, unless you use your own locking to ensure that no
- thread calls ‘readdir’ while another thread is still using the data
- from the previous call. In the GNU C Library, it is safe to call
- ‘readdir’ from multiple threads as long as each thread uses its own
- ‘DIR’ object. POSIX.1-2008 does not require this to be safe, but
- we are not aware of any operating systems where it does not work.
- ‘readdir_r’ allows you to provide your own buffer for the ‘struct
- dirent’, but it is less portable than ‘readdir’, and has problems
- with very long filenames (see below). We recommend you use
- ‘readdir’, but do not share ‘DIR’ objects.
- -- Function: int readdir_r (DIR *DIRSTREAM, struct dirent *ENTRY,
- struct dirent **RESULT)
- Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
- POSIX Safety Concepts::.
- This function is a version of ‘readdir’ which performs internal
- locking. Like ‘readdir’ it returns the next entry from the
- directory. To prevent conflicts between simultaneously running
- threads the result is stored inside the ENTRY object.
- *Portability Note:* ‘readdir_r’ is deprecated. It is recommended
- to use ‘readdir’ instead of ‘readdir_r’ for the following reasons:
- • On systems which do not define ‘NAME_MAX’, it may not be
- possible to use ‘readdir_r’ safely because the caller does not
- specify the length of the buffer for the directory entry.
- • On some systems, ‘readdir_r’ cannot read directory entries
- with very long names. If such a name is encountered, the GNU
- C Library implementation of ‘readdir_r’ returns with an error
- code of ‘ENAMETOOLONG’ after the final directory entry has
- been read. On other systems, ‘readdir_r’ may return
- successfully, but the ‘d_name’ member may not be
- NUL-terminated or may be truncated.
- • POSIX-1.2008 does not guarantee that ‘readdir’ is thread-safe,
- even when access to the same DIRSTREAM is serialized. But in
- current implementations (including the GNU C Library), it is
- safe to call ‘readdir’ concurrently on different DIRSTREAMs,
- so there is no need to use ‘readdir_r’ in most multi-threaded
- programs. In the rare case that multiple threads need to read
- from the same DIRSTREAM, it is still better to use ‘readdir’
- and external synchronization.
- • It is expected that future versions of POSIX will obsolete
- ‘readdir_r’ and mandate the level of thread safety for
- ‘readdir’ which is provided by the GNU C Library and other
- implementations today.
- Normally ‘readdir_r’ returns zero and sets ‘*RESULT’ to ENTRY. If
- there are no more entries in the directory or an error is detected,
- ‘readdir_r’ sets ‘*RESULT’ to a null pointer and returns a nonzero
- error code, also stored in ‘errno’, as described for ‘readdir’.
- It is also important to look at the definition of the ‘struct
- dirent’ type. Simply passing a pointer to an object of this type
- for the second parameter of ‘readdir_r’ might not be enough. Some
- systems don't define the ‘d_name’ element sufficiently long. In
- this case the user has to provide additional space. There must be
- room for at least ‘NAME_MAX + 1’ characters in the ‘d_name’ array.
- Code to call ‘readdir_r’ could look like this:
- union
- {
- struct dirent d;
- char b[offsetof (struct dirent, d_name) + NAME_MAX + 1];
- } u;
- if (readdir_r (dir, &u.d, &res) == 0)
- ...
- To support large filesystems on 32-bit machines there are LFS
- variants of the last two functions.
- -- Function: struct dirent64 * readdir64 (DIR *DIRSTREAM)
- Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
- POSIX Safety Concepts::.
- The ‘readdir64’ function is just like the ‘readdir’ function except
- that it returns a pointer to a record of type ‘struct dirent64’.
- Some of the members of this data type (notably ‘d_ino’) might have
- a different size to allow large filesystems.
- In all other aspects this function is equivalent to ‘readdir’.
- -- Function: int readdir64_r (DIR *DIRSTREAM, struct dirent64 *ENTRY,
- struct dirent64 **RESULT)
- Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
- POSIX Safety Concepts::.
- The deprecated ‘readdir64_r’ function is equivalent to the
- ‘readdir_r’ function except that it takes parameters of base type
- ‘struct dirent64’ instead of ‘struct dirent’ in the second and
- third position. The same precautions mentioned in the
- documentation of ‘readdir_r’ also apply here.
- -- Function: int closedir (DIR *DIRSTREAM)
- Preliminary: | MT-Safe | AS-Unsafe heap lock/hurd | AC-Unsafe mem
- fd lock/hurd | *Note POSIX Safety Concepts::.
- This function closes the directory stream DIRSTREAM. It returns
- ‘0’ on success and ‘-1’ on failure.
- The following ‘errno’ error conditions are defined for this
- function:
- ‘EBADF’
- The DIRSTREAM argument is not valid.
- File: libc.info, Node: Simple Directory Lister, Next: Random Access Directory, Prev: Reading/Closing Directory, Up: Accessing Directories
- 14.3.4 Simple Program to List a Directory
- -----------------------------------------
- Here's a simple program that prints the names of the files in the
- current working directory:
- #include <stdio.h>
- #include <sys/types.h>
- #include <dirent.h>
- int
- main (void)
- {
- DIR *dp;
- struct dirent *ep;
- dp = opendir ("./");
- if (dp != NULL)
- {
- while (ep = readdir (dp))
- puts (ep->d_name);
- (void) closedir (dp);
- }
- else
- perror ("Couldn't open the directory");
- return 0;
- }
- The order in which files appear in a directory tends to be fairly
- random. A more useful program would sort the entries (perhaps by
- alphabetizing them) before printing them; see *note Scanning Directory
- Content::, and *note Array Sort Function::.
- File: libc.info, Node: Random Access Directory, Next: Scanning Directory Content, Prev: Simple Directory Lister, Up: Accessing Directories
- 14.3.5 Random Access in a Directory Stream
- ------------------------------------------
- This section describes how to reread parts of a directory that you have
- already read from an open directory stream. All the symbols are
- declared in the header file ‘dirent.h’.
- -- Function: void rewinddir (DIR *DIRSTREAM)
- Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
- POSIX Safety Concepts::.
- The ‘rewinddir’ function is used to reinitialize the directory
- stream DIRSTREAM, so that if you call ‘readdir’ it returns
- information about the first entry in the directory again. This
- function also notices if files have been added or removed to the
- directory since it was opened with ‘opendir’. (Entries for these
- files might or might not be returned by ‘readdir’ if they were
- added or removed since you last called ‘opendir’ or ‘rewinddir’.)
- For example, it is recommended to call ‘rewinddir’ followed by
- ‘readdir’ to check if a directory is empty after listing it with
- ‘readdir’ and deleting all encountered files from it.
- -- Function: long int telldir (DIR *DIRSTREAM)
- Preliminary: | MT-Safe | AS-Unsafe heap/bsd lock/bsd | AC-Unsafe
- mem/bsd lock/bsd | *Note POSIX Safety Concepts::.
- The ‘telldir’ function returns the file position of the directory
- stream DIRSTREAM. You can use this value with ‘seekdir’ to restore
- the directory stream to that position.
- Using the the ‘telldir’ function is not recommended.
- The value returned by ‘telldir’ may not be compatible with the
- ‘d_off’ field in ‘struct dirent’, and cannot be used with the
- ‘lseek’ function. The returned value may not unambiguously
- identify the position in the directory stream.
- -- Function: void seekdir (DIR *DIRSTREAM, long int POS)
- Preliminary: | MT-Safe | AS-Unsafe heap/bsd lock/bsd | AC-Unsafe
- mem/bsd lock/bsd | *Note POSIX Safety Concepts::.
- The ‘seekdir’ function sets the file position of the directory
- stream DIRSTREAM to POS. The value POS must be the result of a
- previous call to ‘telldir’ on this particular stream; closing and
- reopening the directory can invalidate values returned by
- ‘telldir’.
- Using the the ‘seekdir’ function is not recommended. To seek to
- the beginning of the directory stream, use ‘rewinddir’.
- File: libc.info, Node: Scanning Directory Content, Next: Simple Directory Lister Mark II, Prev: Random Access Directory, Up: Accessing Directories
- 14.3.6 Scanning the Content of a Directory
- ------------------------------------------
- A higher-level interface to the directory handling functions is the
- ‘scandir’ function. With its help one can select a subset of the
- entries in a directory, possibly sort them and get a list of names as
- the result.
- -- Function: int scandir (const char *DIR, struct dirent ***NAMELIST,
- int (*SELECTOR) (const struct dirent *), int (*CMP) (const
- struct dirent **, const struct dirent **))
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
- POSIX Safety Concepts::.
- The ‘scandir’ function scans the contents of the directory selected
- by DIR. The result in *NAMELIST is an array of pointers to
- structures of type ‘struct dirent’ which describe all selected
- directory entries and which is allocated using ‘malloc’. Instead
- of always getting all directory entries returned, the user supplied
- function SELECTOR can be used to decide which entries are in the
- result. Only the entries for which SELECTOR returns a non-zero
- value are selected.
- Finally the entries in *NAMELIST are sorted using the user-supplied
- function CMP. The arguments passed to the CMP function are of type
- ‘struct dirent **’, therefore one cannot directly use the ‘strcmp’
- or ‘strcoll’ functions; instead see the functions ‘alphasort’ and
- ‘versionsort’ below.
- The return value of the function is the number of entries placed in
- *NAMELIST. If it is ‘-1’ an error occurred (either the directory
- could not be opened for reading or memory allocation failed) and
- the global variable ‘errno’ contains more information on the error.
- As described above, the fourth argument to the ‘scandir’ function
- must be a pointer to a sorting function. For the convenience of the
- programmer the GNU C Library contains implementations of functions which
- are very helpful for this purpose.
- -- Function: int alphasort (const struct dirent **A, const struct
- dirent **B)
- Preliminary: | MT-Safe locale | AS-Unsafe heap | AC-Unsafe mem |
- *Note POSIX Safety Concepts::.
- The ‘alphasort’ function behaves like the ‘strcoll’ function (*note
- String/Array Comparison::). The difference is that the arguments
- are not string pointers but instead they are of type ‘struct dirent
- **’.
- The return value of ‘alphasort’ is less than, equal to, or greater
- than zero depending on the order of the two entries A and B.
- -- Function: int versionsort (const struct dirent **A, const struct
- dirent **B)
- Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
- Safety Concepts::.
- The ‘versionsort’ function is like ‘alphasort’ except that it uses
- the ‘strverscmp’ function internally.
- If the filesystem supports large files we cannot use the ‘scandir’
- anymore since the ‘dirent’ structure might not able to contain all the
- information. The LFS provides the new type ‘struct dirent64’. To use
- this we need a new function.
- -- Function: int scandir64 (const char *DIR, struct dirent64
- ***NAMELIST, int (*SELECTOR) (const struct dirent64 *), int
- (*CMP) (const struct dirent64 **, const struct dirent64 **))
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
- POSIX Safety Concepts::.
- The ‘scandir64’ function works like the ‘scandir’ function except
- that the directory entries it returns are described by elements of
- type ‘struct dirent64’. The function pointed to by SELECTOR is
- again used to select the desired entries, except that SELECTOR now
- must point to a function which takes a ‘struct dirent64 *’
- parameter.
- Similarly the CMP function should expect its two arguments to be of
- type ‘struct dirent64 **’.
- As CMP is now a function of a different type, the functions
- ‘alphasort’ and ‘versionsort’ cannot be supplied for that argument.
- Instead we provide the two replacement functions below.
- -- Function: int alphasort64 (const struct dirent64 **A, const struct
- dirent **B)
- Preliminary: | MT-Safe locale | AS-Unsafe heap | AC-Unsafe mem |
- *Note POSIX Safety Concepts::.
- The ‘alphasort64’ function behaves like the ‘strcoll’ function
- (*note String/Array Comparison::). The difference is that the
- arguments are not string pointers but instead they are of type
- ‘struct dirent64 **’.
- Return value of ‘alphasort64’ is less than, equal to, or greater
- than zero depending on the order of the two entries A and B.
- -- Function: int versionsort64 (const struct dirent64 **A, const struct
- dirent64 **B)
- Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
- Safety Concepts::.
- The ‘versionsort64’ function is like ‘alphasort64’, excepted that
- it uses the ‘strverscmp’ function internally.
- It is important not to mix the use of ‘scandir’ and the 64-bit
- comparison functions or vice versa. There are systems on which this
- works but on others it will fail miserably.
- File: libc.info, Node: Simple Directory Lister Mark II, Next: Low-level Directory Access, Prev: Scanning Directory Content, Up: Accessing Directories
- 14.3.7 Simple Program to List a Directory, Mark II
- --------------------------------------------------
- Here is a revised version of the directory lister found above (*note
- Simple Directory Lister::). Using the ‘scandir’ function we can avoid
- the functions which work directly with the directory contents. After
- the call the returned entries are available for direct use.
- #include <stdio.h>
- #include <dirent.h>
- static int
- one (const struct dirent *unused)
- {
- return 1;
- }
- int
- main (void)
- {
- struct dirent **eps;
- int n;
- n = scandir ("./", &eps, one, alphasort);
- if (n >= 0)
- {
- int cnt;
- for (cnt = 0; cnt < n; ++cnt)
- puts (eps[cnt]->d_name);
- }
- else
- perror ("Couldn't open the directory");
- return 0;
- }
- Note the simple selector function in this example. Since we want to
- see all directory entries we always return ‘1’.
- File: libc.info, Node: Low-level Directory Access, Prev: Simple Directory Lister Mark II, Up: Accessing Directories
- 14.3.8 Low-level Directory Access
- ---------------------------------
- The stream-based directory functions are not AS-Safe and cannot be used
- after ‘vfork’. *Note POSIX Safety Concepts::. The functions below
- provide an alternative that can be used in these contexts.
- Directory data is obtained from a file descriptor, as created by the
- ‘open’ function, with or without the ‘O_DIRECTORY’ flag. *Note Opening
- and Closing Files::.
- -- Function: ssize_t getdents64 (int FD, void *BUFFER, size_t LENGTH)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘getdents64’ function reads at most LENGTH bytes of directory
- entry data from the file descriptor FD and stores it into the byte
- array starting at BUFFER.
- On success, the function returns the number of bytes written to the
- buffer. This number is zero if FD is already at the end of the
- directory stream. On error, the function returns ‘-1’ and sets
- ‘errno’ to the appropriate error code.
- The data is stored as a sequence of ‘struct dirent64’ records,
- which can be traversed using the ‘d_reclen’ member. The buffer
- should be large enough to hold the largest possible directory
- entry. Note that some file systems support file names longer than
- ‘NAME_MAX’ bytes (e.g., because they support up to 255 Unicode
- characters), so a buffer size of at least 1024 is recommended.
- If the directory has been modified since the first call to
- ‘getdents64’ on the directory (opening the descriptor or seeking to
- offset zero), it is possible that the buffer contains entries that
- have been encountered before. Likewise, it is possible that files
- that are still present are not reported before the end of the
- directory is encountered (and ‘getdents64’ returns zero).
- This function is specific to Linux.
- Systems that support ‘getdents64’ support seeking on directory
- streams. *Note File Position Primitive::. However, the only offset
- that works reliably is offset zero, indicating that reading the
- directory should start from the beginning.
- File: libc.info, Node: Working with Directory Trees, Next: Hard Links, Prev: Accessing Directories, Up: File System Interface
- 14.4 Working with Directory Trees
- =================================
- The functions described so far for handling the files in a directory
- have allowed you to either retrieve the information bit by bit, or to
- process all the files as a group (see ‘scandir’). Sometimes it is
- useful to process whole hierarchies of directories and their contained
- files. The X/Open specification defines two functions to do this. The
- simpler form is derived from an early definition in System V systems and
- therefore this function is available on SVID-derived systems. The
- prototypes and required definitions can be found in the ‘ftw.h’ header.
- There are four functions in this family: ‘ftw’, ‘nftw’ and their
- 64-bit counterparts ‘ftw64’ and ‘nftw64’. These functions take as one
- of their arguments a pointer to a callback function of the appropriate
- type.
- -- Data Type: __ftw_func_t
- int (*) (const char *, const struct stat *, int)
- The type of callback functions given to the ‘ftw’ function. The
- first parameter points to the file name, the second parameter to an
- object of type ‘struct stat’ which is filled in for the file named
- in the first parameter.
- The last parameter is a flag giving more information about the
- current file. It can have the following values:
- ‘FTW_F’
- The item is either a normal file or a file which does not fit
- into one of the following categories. This could be special
- files, sockets etc.
- ‘FTW_D’
- The item is a directory.
- ‘FTW_NS’
- The ‘stat’ call failed and so the information pointed to by
- the second parameter is invalid.
- ‘FTW_DNR’
- The item is a directory which cannot be read.
- ‘FTW_SL’
- The item is a symbolic link. Since symbolic links are
- normally followed seeing this value in a ‘ftw’ callback
- function means the referenced file does not exist. The
- situation for ‘nftw’ is different.
- This value is only available if the program is compiled with
- ‘_XOPEN_EXTENDED’ defined before including the first header.
- The original SVID systems do not have symbolic links.
- If the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- type is in fact ‘__ftw64_func_t’ since this mode changes ‘struct
- stat’ to be ‘struct stat64’.
- For the LFS interface and for use in the function ‘ftw64’, the header
- ‘ftw.h’ defines another function type.
- -- Data Type: __ftw64_func_t
- int (*) (const char *, const struct stat64 *, int)
- This type is used just like ‘__ftw_func_t’ for the callback
- function, but this time is called from ‘ftw64’. The second
- parameter to the function is a pointer to a variable of type
- ‘struct stat64’ which is able to represent the larger values.
- -- Data Type: __nftw_func_t
- int (*) (const char *, const struct stat *, int, struct FTW *)
- The first three arguments are the same as for the ‘__ftw_func_t’
- type. However for the third argument some additional values are
- defined to allow finer differentiation:
- ‘FTW_DP’
- The current item is a directory and all subdirectories have
- already been visited and reported. This flag is returned
- instead of ‘FTW_D’ if the ‘FTW_DEPTH’ flag is passed to ‘nftw’
- (see below).
- ‘FTW_SLN’
- The current item is a stale symbolic link. The file it points
- to does not exist.
- The last parameter of the callback function is a pointer to a
- structure with some extra information as described below.
- If the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- type is in fact ‘__nftw64_func_t’ since this mode changes ‘struct
- stat’ to be ‘struct stat64’.
- For the LFS interface there is also a variant of this data type
- available which has to be used with the ‘nftw64’ function.
- -- Data Type: __nftw64_func_t
- int (*) (const char *, const struct stat64 *, int, struct FTW *)
- This type is used just like ‘__nftw_func_t’ for the callback
- function, but this time is called from ‘nftw64’. The second
- parameter to the function is this time a pointer to a variable of
- type ‘struct stat64’ which is able to represent the larger values.
- -- Data Type: struct FTW
- The information contained in this structure helps in interpreting
- the name parameter and gives some information about the current
- state of the traversal of the directory hierarchy.
- ‘int base’
- The value is the offset into the string passed in the first
- parameter to the callback function of the beginning of the
- file name. The rest of the string is the path of the file.
- This information is especially important if the ‘FTW_CHDIR’
- flag was set in calling ‘nftw’ since then the current
- directory is the one the current item is found in.
- ‘int level’
- Whilst processing, the code tracks how many directories down
- it has gone to find the current file. This nesting level
- starts at 0 for files in the initial directory (or is zero for
- the initial file if a file was passed).
- -- Function: int ftw (const char *FILENAME, __ftw_func_t FUNC, int
- DESCRIPTORS)
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
- POSIX Safety Concepts::.
- The ‘ftw’ function calls the callback function given in the
- parameter FUNC for every item which is found in the directory
- specified by FILENAME and all directories below. The function
- follows symbolic links if necessary but does not process an item
- twice. If FILENAME is not a directory then it itself is the only
- object returned to the callback function.
- The file name passed to the callback function is constructed by
- taking the FILENAME parameter and appending the names of all passed
- directories and then the local file name. So the callback function
- can use this parameter to access the file. ‘ftw’ also calls ‘stat’
- for the file and passes that information on to the callback
- function. If this ‘stat’ call is not successful the failure is
- indicated by setting the third argument of the callback function to
- ‘FTW_NS’. Otherwise it is set according to the description given
- in the account of ‘__ftw_func_t’ above.
- The callback function is expected to return 0 to indicate that no
- error occurred and that processing should continue. If an error
- occurred in the callback function or it wants ‘ftw’ to return
- immediately, the callback function can return a value other than 0.
- This is the only correct way to stop the function. The program
- must not use ‘setjmp’ or similar techniques to continue from
- another place. This would leave resources allocated by the ‘ftw’
- function unfreed.
- The DESCRIPTORS parameter to ‘ftw’ specifies how many file
- descriptors it is allowed to consume. The function runs faster the
- more descriptors it can use. For each level in the directory
- hierarchy at most one descriptor is used, but for very deep ones
- any limit on open file descriptors for the process or the system
- may be exceeded. Moreover, file descriptor limits in a
- multi-threaded program apply to all the threads as a group, and
- therefore it is a good idea to supply a reasonable limit to the
- number of open descriptors.
- The return value of the ‘ftw’ function is 0 if all callback
- function calls returned 0 and all actions performed by the ‘ftw’
- succeeded. If a function call failed (other than calling ‘stat’ on
- an item) the function returns -1. If a callback function returns a
- value other than 0 this value is returned as the return value of
- ‘ftw’.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ on a
- 32-bit system this function is in fact ‘ftw64’, i.e., the LFS
- interface transparently replaces the old interface.
- -- Function: int ftw64 (const char *FILENAME, __ftw64_func_t FUNC, int
- DESCRIPTORS)
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
- POSIX Safety Concepts::.
- This function is similar to ‘ftw’ but it can work on filesystems
- with large files. File information is reported using a variable of
- type ‘struct stat64’ which is passed by reference to the callback
- function.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ on a
- 32-bit system this function is available under the name ‘ftw’ and
- transparently replaces the old implementation.
- -- Function: int nftw (const char *FILENAME, __nftw_func_t FUNC, int
- DESCRIPTORS, int FLAG)
- Preliminary: | MT-Safe cwd | AS-Unsafe heap | AC-Unsafe mem fd cwd
- | *Note POSIX Safety Concepts::.
- The ‘nftw’ function works like the ‘ftw’ functions. They call the
- callback function FUNC for all items found in the directory
- FILENAME and below. At most DESCRIPTORS file descriptors are
- consumed during the ‘nftw’ call.
- One difference is that the callback function is of a different
- type. It is of type ‘struct FTW *’ and provides the callback
- function with the extra information described above.
- A second difference is that ‘nftw’ takes a fourth argument, which
- is 0 or a bitwise-OR combination of any of the following values.
- ‘FTW_PHYS’
- While traversing the directory symbolic links are not
- followed. Instead symbolic links are reported using the
- ‘FTW_SL’ value for the type parameter to the callback
- function. If the file referenced by a symbolic link does not
- exist ‘FTW_SLN’ is returned instead.
- ‘FTW_MOUNT’
- The callback function is only called for items which are on
- the same mounted filesystem as the directory given by the
- FILENAME parameter to ‘nftw’.
- ‘FTW_CHDIR’
- If this flag is given the current working directory is changed
- to the directory of the reported object before the callback
- function is called. When ‘ntfw’ finally returns the current
- directory is restored to its original value.
- ‘FTW_DEPTH’
- If this option is specified then all subdirectories and files
- within them are processed before processing the top directory
- itself (depth-first processing). This also means the type
- flag given to the callback function is ‘FTW_DP’ and not
- ‘FTW_D’.
- ‘FTW_ACTIONRETVAL’
- If this option is specified then return values from callbacks
- are handled differently. If the callback returns
- ‘FTW_CONTINUE’, walking continues normally. ‘FTW_STOP’ means
- walking stops and ‘FTW_STOP’ is returned to the caller. If
- ‘FTW_SKIP_SUBTREE’ is returned by the callback with ‘FTW_D’
- argument, the subtree is skipped and walking continues with
- next sibling of the directory. If ‘FTW_SKIP_SIBLINGS’ is
- returned by the callback, all siblings of the current entry
- are skipped and walking continues in its parent. No other
- return values should be returned from the callbacks if this
- option is set. This option is a GNU extension.
- The return value is computed in the same way as for ‘ftw’. ‘nftw’
- returns 0 if no failures occurred and all callback functions
- returned 0. In case of internal errors, such as memory problems,
- the return value is -1 and ‘errno’ is set accordingly. If the
- return value of a callback invocation was non-zero then that value
- is returned.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ on a
- 32-bit system this function is in fact ‘nftw64’, i.e., the LFS
- interface transparently replaces the old interface.
- -- Function: int nftw64 (const char *FILENAME, __nftw64_func_t FUNC,
- int DESCRIPTORS, int FLAG)
- Preliminary: | MT-Safe cwd | AS-Unsafe heap | AC-Unsafe mem fd cwd
- | *Note POSIX Safety Concepts::.
- This function is similar to ‘nftw’ but it can work on filesystems
- with large files. File information is reported using a variable of
- type ‘struct stat64’ which is passed by reference to the callback
- function.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ on a
- 32-bit system this function is available under the name ‘nftw’ and
- transparently replaces the old implementation.
- File: libc.info, Node: Hard Links, Next: Symbolic Links, Prev: Working with Directory Trees, Up: File System Interface
- 14.5 Hard Links
- ===============
- In POSIX systems, one file can have many names at the same time. All of
- the names are equally real, and no one of them is preferred to the
- others.
- To add a name to a file, use the ‘link’ function. (The new name is
- also called a “hard link” to the file.) Creating a new link to a file
- does not copy the contents of the file; it simply makes a new name by
- which the file can be known, in addition to the file's existing name or
- names.
- One file can have names in several directories, so the organization
- of the file system is not a strict hierarchy or tree.
- In most implementations, it is not possible to have hard links to the
- same file in multiple file systems. ‘link’ reports an error if you try
- to make a hard link to the file from another file system when this
- cannot be done.
- The prototype for the ‘link’ function is declared in the header file
- ‘unistd.h’.
- -- Function: int link (const char *OLDNAME, const char *NEWNAME)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘link’ function makes a new link to the existing file named by
- OLDNAME, under the new name NEWNAME.
- This function returns a value of ‘0’ if it is successful and ‘-1’
- on failure. In addition to the usual file name errors (*note File
- Name Errors::) for both OLDNAME and NEWNAME, the following ‘errno’
- error conditions are defined for this function:
- ‘EACCES’
- You are not allowed to write to the directory in which the new
- link is to be written.
- ‘EEXIST’
- There is already a file named NEWNAME. If you want to replace
- this link with a new link, you must remove the old link
- explicitly first.
- ‘EMLINK’
- There are already too many links to the file named by OLDNAME.
- (The maximum number of links to a file is ‘LINK_MAX’; see
- *note Limits for Files::.)
- ‘ENOENT’
- The file named by OLDNAME doesn't exist. You can't make a
- link to a file that doesn't exist.
- ‘ENOSPC’
- The directory or file system that would contain the new link
- is full and cannot be extended.
- ‘EPERM’
- On GNU/Linux and GNU/Hurd systems and some others, you cannot
- make links to directories. Many systems allow only privileged
- users to do so. This error is used to report the problem.
- ‘EROFS’
- The directory containing the new link can't be modified
- because it's on a read-only file system.
- ‘EXDEV’
- The directory specified in NEWNAME is on a different file
- system than the existing file.
- ‘EIO’
- A hardware error occurred while trying to read or write the to
- filesystem.
- -- Function: int linkat (int oldfd, const char *OLDNAME, int newfd,
- const char *NEWNAME, int flags)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘linkat’ function is analogous to the ‘link’ function, except
- that it identifies its source and target using a combination of a
- file descriptor (referring to a directory) and a file name. *Note
- Descriptor-Relative Access::. For ‘linkat’, if a file name is not
- absolute, it is resolved relative to the corresponding file
- descriptor. As usual, the special value ‘AT_FDCWD’ denotes the
- current directory.
- The FLAGS argument is a combination of the following flags:
- ‘AT_SYMLINK_FOLLOW’
- If the source path identified by OLDFD and OLDNAME is a
- symbolic link, ‘linkat’ follows the symbolic link and creates
- a link to its target. If the flag is not set, a link for the
- symbolic link itself is created; this is not supported by all
- file systems and ‘linkat’ can fail in this case.
- ‘AT_EMPTY_PATH’
- If this flag is specified, OLDNAME can be an empty string. In
- this case, a new link to the file denoted by the descriptor
- OLDFD is created, which may have been opened with ‘O_PATH’ or
- ‘O_TMPFILE’. This flag is a GNU extension.
- File: libc.info, Node: Symbolic Links, Next: Deleting Files, Prev: Hard Links, Up: File System Interface
- 14.6 Symbolic Links
- ===================
- GNU systems support “soft links” or “symbolic links”. This is a kind of
- "file" that is essentially a pointer to another file name. Unlike hard
- links, symbolic links can be made to directories or across file systems
- with no restrictions. You can also make a symbolic link to a name which
- is not the name of any file. (Opening this link will fail until a file
- by that name is created.) Likewise, if the symbolic link points to an
- existing file which is later deleted, the symbolic link continues to
- point to the same file name even though the name no longer names any
- file.
- The reason symbolic links work the way they do is that special things
- happen when you try to open the link. The ‘open’ function realizes you
- have specified the name of a link, reads the file name contained in the
- link, and opens that file name instead. The ‘stat’ function likewise
- operates on the file that the symbolic link points to, instead of on the
- link itself.
- By contrast, other operations such as deleting or renaming the file
- operate on the link itself. The functions ‘readlink’ and ‘lstat’ also
- refrain from following symbolic links, because their purpose is to
- obtain information about the link. ‘link’, the function that makes a
- hard link, does too. It makes a hard link to the symbolic link, which
- one rarely wants.
- Some systems have, for some functions operating on files, a limit on
- how many symbolic links are followed when resolving a path name. The
- limit if it exists is published in the ‘sys/param.h’ header file.
- -- Macro: int MAXSYMLINKS
- The macro ‘MAXSYMLINKS’ specifies how many symlinks some function
- will follow before returning ‘ELOOP’. Not all functions behave the
- same and this value is not the same as that returned for
- ‘_SC_SYMLOOP’ by ‘sysconf’. In fact, the ‘sysconf’ result can
- indicate that there is no fixed limit although ‘MAXSYMLINKS’ exists
- and has a finite value.
- Prototypes for most of the functions listed in this section are in
- ‘unistd.h’.
- -- Function: int symlink (const char *OLDNAME, const char *NEWNAME)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘symlink’ function makes a symbolic link to OLDNAME named
- NEWNAME.
- The normal return value from ‘symlink’ is ‘0’. A return value of
- ‘-1’ indicates an error. In addition to the usual file name syntax
- errors (*note File Name Errors::), the following ‘errno’ error
- conditions are defined for this function:
- ‘EEXIST’
- There is already an existing file named NEWNAME.
- ‘EROFS’
- The file NEWNAME would exist on a read-only file system.
- ‘ENOSPC’
- The directory or file system cannot be extended to make the
- new link.
- ‘EIO’
- A hardware error occurred while reading or writing data on the
- disk.
- -- Function: ssize_t readlink (const char *FILENAME, char *BUFFER,
- size_t SIZE)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘readlink’ function gets the value of the symbolic link
- FILENAME. The file name that the link points to is copied into
- BUFFER. This file name string is _not_ null-terminated; ‘readlink’
- normally returns the number of characters copied. The SIZE
- argument specifies the maximum number of characters to copy,
- usually the allocation size of BUFFER.
- If the return value equals SIZE, you cannot tell whether or not
- there was room to return the entire name. So make a bigger buffer
- and call ‘readlink’ again. Here is an example:
- char *
- readlink_malloc (const char *filename)
- {
- size_t size = 50;
- char *buffer = NULL;
- while (1)
- {
- buffer = xreallocarray (buffer, size, 2);
- size *= 2;
- ssize_t nchars = readlink (filename, buffer, size);
- if (nchars < 0)
- {
- free (buffer);
- return NULL;
- }
- if (nchars < size)
- return buffer;
- }
- }
- A value of ‘-1’ is returned in case of error. In addition to the
- usual file name errors (*note File Name Errors::), the following
- ‘errno’ error conditions are defined for this function:
- ‘EINVAL’
- The named file is not a symbolic link.
- ‘EIO’
- A hardware error occurred while reading or writing data on the
- disk.
- In some situations it is desirable to resolve all the symbolic links
- to get the real name of a file where no prefix names a symbolic link
- which is followed and no filename in the path is ‘.’ or ‘..’. This is
- for instance desirable if files have to be compared in which case
- different names can refer to the same inode.
- -- Function: char * canonicalize_file_name (const char *NAME)
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
- POSIX Safety Concepts::.
- The ‘canonicalize_file_name’ function returns the absolute name of
- the file named by NAME which contains no ‘.’, ‘..’ components nor
- any repeated path separators (‘/’) or symlinks. The result is
- passed back as the return value of the function in a block of
- memory allocated with ‘malloc’. If the result is not used anymore
- the memory should be freed with a call to ‘free’.
- If any of the path components are missing the function returns a
- NULL pointer. This is also what is returned if the length of the
- path reaches or exceeds ‘PATH_MAX’ characters. In any case ‘errno’
- is set accordingly.
- ‘ENAMETOOLONG’
- The resulting path is too long. This error only occurs on
- systems which have a limit on the file name length.
- ‘EACCES’
- At least one of the path components is not readable.
- ‘ENOENT’
- The input file name is empty.
- ‘ENOENT’
- At least one of the path components does not exist.
- ‘ELOOP’
- More than ‘MAXSYMLINKS’ many symlinks have been followed.
- This function is a GNU extension and is declared in ‘stdlib.h’.
- The Unix standard includes a similar function which differs from
- ‘canonicalize_file_name’ in that the user has to provide the buffer
- where the result is placed in.
- -- Function: char * realpath (const char *restrict NAME, char *restrict
- RESOLVED)
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
- POSIX Safety Concepts::.
- A call to ‘realpath’ where the RESOLVED parameter is ‘NULL’ behaves
- exactly like ‘canonicalize_file_name’. The function allocates a
- buffer for the file name and returns a pointer to it. If RESOLVED
- is not ‘NULL’ it points to a buffer into which the result is
- copied. It is the callers responsibility to allocate a buffer
- which is large enough. On systems which define ‘PATH_MAX’ this
- means the buffer must be large enough for a pathname of this size.
- For systems without limitations on the pathname length the
- requirement cannot be met and programs should not call ‘realpath’
- with anything but ‘NULL’ for the second parameter.
- One other difference is that the buffer RESOLVED (if nonzero) will
- contain the part of the path component which does not exist or is
- not readable if the function returns ‘NULL’ and ‘errno’ is set to
- ‘EACCES’ or ‘ENOENT’.
- This function is declared in ‘stdlib.h’.
- The advantage of using this function is that it is more widely
- available. The drawback is that it reports failures for long paths on
- systems which have no limits on the file name length.
- File: libc.info, Node: Deleting Files, Next: Renaming Files, Prev: Symbolic Links, Up: File System Interface
- 14.7 Deleting Files
- ===================
- You can delete a file with ‘unlink’ or ‘remove’.
- Deletion actually deletes a file name. If this is the file's only
- name, then the file is deleted as well. If the file has other remaining
- names (*note Hard Links::), it remains accessible under those names.
- -- Function: int unlink (const char *FILENAME)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘unlink’ function deletes the file name FILENAME. If this is a
- file's sole name, the file itself is also deleted. (Actually, if
- any process has the file open when this happens, deletion is
- postponed until all processes have closed the file.)
- The function ‘unlink’ is declared in the header file ‘unistd.h’.
- This function returns ‘0’ on successful completion, and ‘-1’ on
- error. In addition to the usual file name errors (*note File Name
- Errors::), the following ‘errno’ error conditions are defined for
- this function:
- ‘EACCES’
- Write permission is denied for the directory from which the
- file is to be removed, or the directory has the sticky bit set
- and you do not own the file.
- ‘EBUSY’
- This error indicates that the file is being used by the system
- in such a way that it can't be unlinked. For example, you
- might see this error if the file name specifies the root
- directory or a mount point for a file system.
- ‘ENOENT’
- The file name to be deleted doesn't exist.
- ‘EPERM’
- On some systems ‘unlink’ cannot be used to delete the name of
- a directory, or at least can only be used this way by a
- privileged user. To avoid such problems, use ‘rmdir’ to
- delete directories. (On GNU/Linux and GNU/Hurd systems
- ‘unlink’ can never delete the name of a directory.)
- ‘EROFS’
- The directory containing the file name to be deleted is on a
- read-only file system and can't be modified.
- -- Function: int unlinkat (int FILEDES, const char *FILENAME, int
- FLAGS)
- | MT-Safe | AS-Unsafe corrupt | AC-Unsafe corrupt | *Note POSIX
- Safety Concepts::.
- This function is a descriptor-relative version of the ‘unlink’
- function above. *Note Descriptor-Relative Access::. The FLAGS
- argument may either be ‘0’ or contain the flag ‘AT_REMOVEDIR’:
- ‘AT_REMOVEDIR’
- This flag causes ‘unlinkat’ to perform an ‘rmdir’ operation on
- ‘filename’ instead of performing the equivalent of ‘unlink’.
- Compared to ‘unlink’, some additional error conditions can occur
- due to descriptor-relative access. *Note Descriptor-Relative
- Access::. In addition to this, the following other errors can also
- occur:
- ‘EISDIR’
- The effective final path derived from FILENAME and FILEDES is
- a directory but ‘AT_REMOVEDIR’ was not passed in ‘flags’.
- -- Function: int rmdir (const char *FILENAME)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘rmdir’ function deletes a directory. The directory must be
- empty before it can be removed; in other words, it can only contain
- entries for ‘.’ and ‘..’.
- In most other respects, ‘rmdir’ behaves like ‘unlink’. There are
- two additional ‘errno’ error conditions defined for ‘rmdir’:
- ‘ENOTEMPTY’
- ‘EEXIST’
- The directory to be deleted is not empty.
- These two error codes are synonymous; some systems use one, and
- some use the other. GNU/Linux and GNU/Hurd systems always use
- ‘ENOTEMPTY’.
- The prototype for this function is declared in the header file
- ‘unistd.h’.
- -- Function: int remove (const char *FILENAME)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This is the ISO C function to remove a file. It works like
- ‘unlink’ for files and like ‘rmdir’ for directories. ‘remove’ is
- declared in ‘stdio.h’.
- File: libc.info, Node: Renaming Files, Next: Creating Directories, Prev: Deleting Files, Up: File System Interface
- 14.8 Renaming Files
- ===================
- The ‘rename’ function is used to change a file's name.
- -- Function: int rename (const char *OLDNAME, const char *NEWNAME)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘rename’ function renames the file OLDNAME to NEWNAME. The
- file formerly accessible under the name OLDNAME is afterwards
- accessible as NEWNAME instead. (If the file had any other names
- aside from OLDNAME, it continues to have those names.)
- The directory containing the name NEWNAME must be on the same file
- system as the directory containing the name OLDNAME.
- One special case for ‘rename’ is when OLDNAME and NEWNAME are two
- names for the same file. The consistent way to handle this case is
- to delete OLDNAME. However, in this case POSIX requires that
- ‘rename’ do nothing and report success--which is inconsistent. We
- don't know what your operating system will do.
- If OLDNAME is not a directory, then any existing file named NEWNAME
- is removed during the renaming operation. However, if NEWNAME is
- the name of a directory, ‘rename’ fails in this case.
- If OLDNAME is a directory, then either NEWNAME must not exist or it
- must name a directory that is empty. In the latter case, the
- existing directory named NEWNAME is deleted first. The name
- NEWNAME must not specify a subdirectory of the directory ‘oldname’
- which is being renamed.
- One useful feature of ‘rename’ is that the meaning of NEWNAME
- changes "atomically" from any previously existing file by that name
- to its new meaning (i.e., the file that was called OLDNAME). There
- is no instant at which NEWNAME is non-existent "in between" the old
- meaning and the new meaning. If there is a system crash during the
- operation, it is possible for both names to still exist; but
- NEWNAME will always be intact if it exists at all.
- If ‘rename’ fails, it returns ‘-1’. In addition to the usual file
- name errors (*note File Name Errors::), the following ‘errno’ error
- conditions are defined for this function:
- ‘EACCES’
- One of the directories containing NEWNAME or OLDNAME refuses
- write permission; or NEWNAME and OLDNAME are directories and
- write permission is refused for one of them.
- ‘EBUSY’
- A directory named by OLDNAME or NEWNAME is being used by the
- system in a way that prevents the renaming from working. This
- includes directories that are mount points for filesystems,
- and directories that are the current working directories of
- processes.
- ‘ENOTEMPTY’
- ‘EEXIST’
- The directory NEWNAME isn't empty. GNU/Linux and GNU/Hurd
- systems always return ‘ENOTEMPTY’ for this, but some other
- systems return ‘EEXIST’.
- ‘EINVAL’
- OLDNAME is a directory that contains NEWNAME.
- ‘EISDIR’
- NEWNAME is a directory but the OLDNAME isn't.
- ‘EMLINK’
- The parent directory of NEWNAME would have too many links
- (entries).
- ‘ENOENT’
- The file OLDNAME doesn't exist.
- ‘ENOSPC’
- The directory that would contain NEWNAME has no room for
- another entry, and there is no space left in the file system
- to expand it.
- ‘EROFS’
- The operation would involve writing to a directory on a
- read-only file system.
- ‘EXDEV’
- The two file names NEWNAME and OLDNAME are on different file
- systems.
- -- Function: int renameat (int OLDFILEDES, const char *OLDNAME, int
- NEWFILEDES, const char *NEWNAME)
- | MT-Safe | AS-Unsafe corrupt | AC-Unsafe corrupt | *Note POSIX
- Safety Concepts::.
- This function is a descriptor-relative version of the ‘rename’
- function above. *Note Descriptor-Relative Access::. If OLDNAME or
- NEWNAME is a relative path, it is interpreted relative to the
- directory associated with OLDFILEDES or NEWFILEDES, respectively.
- Absolute paths are interpreted in the usual way.
- Compared to ‘rename’, some additional error conditions can occur.
- *Note Descriptor-Relative Access::.
- File: libc.info, Node: Creating Directories, Next: File Attributes, Prev: Renaming Files, Up: File System Interface
- 14.9 Creating Directories
- =========================
- Directories are created with the ‘mkdir’ function. (There is also a
- shell command ‘mkdir’ which does the same thing.)
- -- Function: int mkdir (const char *FILENAME, mode_t MODE)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘mkdir’ function creates a new, empty directory with name
- FILENAME.
- The argument MODE specifies the file permissions for the new
- directory file. *Note Permission Bits::, for more information
- about this.
- A return value of ‘0’ indicates successful completion, and ‘-1’
- indicates failure. In addition to the usual file name syntax
- errors (*note File Name Errors::), the following ‘errno’ error
- conditions are defined for this function:
- ‘EACCES’
- Write permission is denied for the parent directory in which
- the new directory is to be added.
- ‘EEXIST’
- A file named FILENAME already exists.
- ‘EMLINK’
- The parent directory has too many links (entries).
- Well-designed file systems never report this error, because
- they permit more links than your disk could possibly hold.
- However, you must still take account of the possibility of
- this error, as it could result from network access to a file
- system on another machine.
- ‘ENOSPC’
- The file system doesn't have enough room to create the new
- directory.
- ‘EROFS’
- The parent directory of the directory being created is on a
- read-only file system and cannot be modified.
- To use this function, your program should include the header file
- ‘sys/stat.h’.
- -- Function: int mkdirat (int FILEDES, const char *FILENAME, mode_t
- MODE)
- | MT-Safe | AS-Unsafe corrupt | AC-Unsafe corrupt | *Note POSIX
- Safety Concepts::.
- This function is a descriptor-relative version of the ‘mkdir’
- function above. *Note Descriptor-Relative Access::.
- Compared to ‘mkdir’, some additional error conditions can occur.
- *Note Descriptor-Relative Access::.
- File: libc.info, Node: File Attributes, Next: Making Special Files, Prev: Creating Directories, Up: File System Interface
- 14.10 File Attributes
- =====================
- When you issue an ‘ls -l’ shell command on a file, it gives you
- information about the size of the file, who owns it, when it was last
- modified, etc. These are called the “file attributes”, and are
- associated with the file itself and not a particular one of its names.
- This section contains information about how you can inquire about and
- modify the attributes of a file.
- * Menu:
- * Attribute Meanings:: The names of the file attributes,
- and what their values mean.
- * Reading Attributes:: How to read the attributes of a file.
- * Testing File Type:: Distinguishing ordinary files,
- directories, links...
- * File Owner:: How ownership for new files is determined,
- and how to change it.
- * Permission Bits:: How information about a file's access
- mode is stored.
- * Access Permission:: How the system decides who can access a file.
- * Setting Permissions:: How permissions for new files are assigned,
- and how to change them.
- * Testing File Access:: How to find out if your process can
- access a file.
- * File Times:: About the time attributes of a file.
- * File Size:: Manually changing the size of a file.
- * Storage Allocation:: Allocate backing storage for files.
- File: libc.info, Node: Attribute Meanings, Next: Reading Attributes, Up: File Attributes
- 14.10.1 The meaning of the File Attributes
- ------------------------------------------
- When you read the attributes of a file, they come back in a structure
- called ‘struct stat’. This section describes the names of the
- attributes, their data types, and what they mean. For the functions to
- read the attributes of a file, see *note Reading Attributes::.
- The header file ‘sys/stat.h’ declares all the symbols defined in this
- section.
- -- Data Type: struct stat
- The ‘stat’ structure type is used to return information about the
- attributes of a file. It contains at least the following members:
- ‘mode_t st_mode’
- Specifies the mode of the file. This includes file type
- information (*note Testing File Type::) and the file
- permission bits (*note Permission Bits::).
- ‘ino_t st_ino’
- The file serial number, which distinguishes this file from all
- other files on the same device.
- ‘dev_t st_dev’
- Identifies the device containing the file. The ‘st_ino’ and
- ‘st_dev’, taken together, uniquely identify the file. The
- ‘st_dev’ value is not necessarily consistent across reboots or
- system crashes, however.
- ‘nlink_t st_nlink’
- The number of hard links to the file. This count keeps track
- of how many directories have entries for this file. If the
- count is ever decremented to zero, then the file itself is
- discarded as soon as no process still holds it open. Symbolic
- links are not counted in the total.
- ‘uid_t st_uid’
- The user ID of the file's owner. *Note File Owner::.
- ‘gid_t st_gid’
- The group ID of the file. *Note File Owner::.
- ‘off_t st_size’
- This specifies the size of a regular file in bytes. For files
- that are really devices this field isn't usually meaningful.
- For symbolic links this specifies the length of the file name
- the link refers to.
- ‘time_t st_atime’
- This is the last access time for the file. *Note File
- Times::.
- ‘unsigned long int st_atime_usec’
- This is the fractional part of the last access time for the
- file. *Note File Times::.
- ‘time_t st_mtime’
- This is the time of the last modification to the contents of
- the file. *Note File Times::.
- ‘unsigned long int st_mtime_usec’
- This is the fractional part of the time of the last
- modification to the contents of the file. *Note File Times::.
- ‘time_t st_ctime’
- This is the time of the last modification to the attributes of
- the file. *Note File Times::.
- ‘unsigned long int st_ctime_usec’
- This is the fractional part of the time of the last
- modification to the attributes of the file. *Note File
- Times::.
- ‘blkcnt_t st_blocks’
- This is the amount of disk space that the file occupies,
- measured in units of 512-byte blocks.
- The number of disk blocks is not strictly proportional to the
- size of the file, for two reasons: the file system may use
- some blocks for internal record keeping; and the file may be
- sparse--it may have "holes" which contain zeros but do not
- actually take up space on the disk.
- You can tell (approximately) whether a file is sparse by
- comparing this value with ‘st_size’, like this:
- (st.st_blocks * 512 < st.st_size)
- This test is not perfect because a file that is just slightly
- sparse might not be detected as sparse at all. For practical
- applications, this is not a problem.
- ‘unsigned int st_blksize’
- The optimal block size for reading or writing this file, in
- bytes. You might use this size for allocating the buffer
- space for reading or writing the file. (This is unrelated to
- ‘st_blocks’.)
- The extensions for the Large File Support (LFS) require, even on
- 32-bit machines, types which can handle file sizes up to 2^63.
- Therefore a new definition of ‘struct stat’ is necessary.
- -- Data Type: struct stat64
- The members of this type are the same and have the same names as
- those in ‘struct stat’. The only difference is that the members
- ‘st_ino’, ‘st_size’, and ‘st_blocks’ have a different type to
- support larger values.
- ‘mode_t st_mode’
- Specifies the mode of the file. This includes file type
- information (*note Testing File Type::) and the file
- permission bits (*note Permission Bits::).
- ‘ino64_t st_ino’
- The file serial number, which distinguishes this file from all
- other files on the same device.
- ‘dev_t st_dev’
- Identifies the device containing the file. The ‘st_ino’ and
- ‘st_dev’, taken together, uniquely identify the file. The
- ‘st_dev’ value is not necessarily consistent across reboots or
- system crashes, however.
- ‘nlink_t st_nlink’
- The number of hard links to the file. This count keeps track
- of how many directories have entries for this file. If the
- count is ever decremented to zero, then the file itself is
- discarded as soon as no process still holds it open. Symbolic
- links are not counted in the total.
- ‘uid_t st_uid’
- The user ID of the file's owner. *Note File Owner::.
- ‘gid_t st_gid’
- The group ID of the file. *Note File Owner::.
- ‘off64_t st_size’
- This specifies the size of a regular file in bytes. For files
- that are really devices this field isn't usually meaningful.
- For symbolic links this specifies the length of the file name
- the link refers to.
- ‘time_t st_atime’
- This is the last access time for the file. *Note File
- Times::.
- ‘unsigned long int st_atime_usec’
- This is the fractional part of the last access time for the
- file. *Note File Times::.
- ‘time_t st_mtime’
- This is the time of the last modification to the contents of
- the file. *Note File Times::.
- ‘unsigned long int st_mtime_usec’
- This is the fractional part of the time of the last
- modification to the contents of the file. *Note File Times::.
- ‘time_t st_ctime’
- This is the time of the last modification to the attributes of
- the file. *Note File Times::.
- ‘unsigned long int st_ctime_usec’
- This is the fractional part of the time of the last
- modification to the attributes of the file. *Note File
- Times::.
- ‘blkcnt64_t st_blocks’
- This is the amount of disk space that the file occupies,
- measured in units of 512-byte blocks.
- ‘unsigned int st_blksize’
- The optimal block size for reading of writing this file, in
- bytes. You might use this size for allocating the buffer
- space for reading of writing the file. (This is unrelated to
- ‘st_blocks’.)
- Some of the file attributes have special data type names which exist
- specifically for those attributes. (They are all aliases for well-known
- integer types that you know and love.) These typedef names are defined
- in the header file ‘sys/types.h’ as well as in ‘sys/stat.h’. Here is a
- list of them.
- -- Data Type: mode_t
- This is an integer data type used to represent file modes. In the
- GNU C Library, this is an unsigned type no narrower than ‘unsigned
- int’.
- -- Data Type: ino_t
- This is an unsigned integer type used to represent file serial
- numbers. (In Unix jargon, these are sometimes called “inode
- numbers”.) In the GNU C Library, this type is no narrower than
- ‘unsigned int’.
- If the source is compiled with ‘_FILE_OFFSET_BITS == 64’ this type
- is transparently replaced by ‘ino64_t’.
- -- Data Type: ino64_t
- This is an unsigned integer type used to represent file serial
- numbers for the use in LFS. In the GNU C Library, this type is no
- narrower than ‘unsigned int’.
- When compiling with ‘_FILE_OFFSET_BITS == 64’ this type is
- available under the name ‘ino_t’.
- -- Data Type: dev_t
- This is an arithmetic data type used to represent file device
- numbers. In the GNU C Library, this is an integer type no narrower
- than ‘int’.
- -- Data Type: nlink_t
- This is an integer type used to represent file link counts.
- -- Data Type: blkcnt_t
- This is a signed integer type used to represent block counts. In
- the GNU C Library, this type is no narrower than ‘int’.
- If the source is compiled with ‘_FILE_OFFSET_BITS == 64’ this type
- is transparently replaced by ‘blkcnt64_t’.
- -- Data Type: blkcnt64_t
- This is a signed integer type used to represent block counts for
- the use in LFS. In the GNU C Library, this type is no narrower than
- ‘int’.
- When compiling with ‘_FILE_OFFSET_BITS == 64’ this type is
- available under the name ‘blkcnt_t’.
- File: libc.info, Node: Reading Attributes, Next: Testing File Type, Prev: Attribute Meanings, Up: File Attributes
- 14.10.2 Reading the Attributes of a File
- ----------------------------------------
- To examine the attributes of files, use the functions ‘stat’, ‘fstat’
- and ‘lstat’. They return the attribute information in a ‘struct stat’
- object. All three functions are declared in the header file
- ‘sys/stat.h’.
- -- Function: int stat (const char *FILENAME, struct stat *BUF)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘stat’ function returns information about the attributes of the
- file named by FILENAME in the structure pointed to by BUF.
- If FILENAME is the name of a symbolic link, the attributes you get
- describe the file that the link points to. If the link points to a
- nonexistent file name, then ‘stat’ fails reporting a nonexistent
- file.
- The return value is ‘0’ if the operation is successful, or ‘-1’ on
- failure. In addition to the usual file name errors (*note File
- Name Errors::, the following ‘errno’ error conditions are defined
- for this function:
- ‘ENOENT’
- The file named by FILENAME doesn't exist.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- function is in fact ‘stat64’ since the LFS interface transparently
- replaces the normal implementation.
- -- Function: int stat64 (const char *FILENAME, struct stat64 *BUF)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function is similar to ‘stat’ but it is also able to work on
- files larger than 2^31 bytes on 32-bit systems. To be able to do
- this the result is stored in a variable of type ‘struct stat64’ to
- which BUF must point.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- function is available under the name ‘stat’ and so transparently
- replaces the interface for small files on 32-bit machines.
- -- Function: int fstat (int FILEDES, struct stat *BUF)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘fstat’ function is like ‘stat’, except that it takes an open
- file descriptor as an argument instead of a file name. *Note
- Low-Level I/O::.
- Like ‘stat’, ‘fstat’ returns ‘0’ on success and ‘-1’ on failure.
- The following ‘errno’ error conditions are defined for ‘fstat’:
- ‘EBADF’
- The FILEDES argument is not a valid file descriptor.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- function is in fact ‘fstat64’ since the LFS interface transparently
- replaces the normal implementation.
- -- Function: int fstat64 (int FILEDES, struct stat64 *BUF)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function is similar to ‘fstat’ but is able to work on large
- files on 32-bit platforms. For large files the file descriptor
- FILEDES should be obtained by ‘open64’ or ‘creat64’. The BUF
- pointer points to a variable of type ‘struct stat64’ which is able
- to represent the larger values.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- function is available under the name ‘fstat’ and so transparently
- replaces the interface for small files on 32-bit machines.
- -- Function: int fstatat (int FILEDES, const char *FILENAME, struct
- stat *BUF, int FLAGS)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function is a descriptor-relative version of the ‘fstat’
- function above. *Note Descriptor-Relative Access::. The FLAGS
- argument can contain a combination of the flags ‘AT_EMPTY_PATH’,
- ‘AT_NO_AUTOMOUNT’, ‘AT_SYMLINK_NOFOLLOW’.
- Compared to ‘fstat’, the following additional error conditions can
- occur:
- ‘EBADF’
- The FILEDES argument is not a valid file descriptor.
- ‘EINVAL’
- The FLAGS argument is not valid for this function.
- ‘ENOTDIR’
- The descriptor FILEDES is not associated with a directory, and
- FILENAME is a relative file name.
- ‘ENOENT’
- The file named by FILENAME does not exist, it's a dangling
- symbolic link and FLAGS does not contain
- ‘AT_SYMLINK_NOFOLLOW’, or FILENAME is an empty string and
- FLAGS does not contain ‘AT_EMPTY_PATH’.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- function is in fact ‘fstatat64’ since the LFS interface
- transparently replaces the normal implementation.
- -- Function: int fstatat64 (int FILEDES, const char *FILENAME, struct
- stat64 *BUF, int FLAGS)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function is the large-file variant of ‘fstatat’, similar to
- how ‘fstat64’ is the variant of ‘fstat’.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- function is available under the name ‘fstatat’ and so transparently
- replaces the interface for small files on 32-bit machines.
- -- Function: int lstat (const char *FILENAME, struct stat *BUF)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘lstat’ function is like ‘stat’, except that it does not follow
- symbolic links. If FILENAME is the name of a symbolic link,
- ‘lstat’ returns information about the link itself; otherwise
- ‘lstat’ works like ‘stat’. *Note Symbolic Links::.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- function is in fact ‘lstat64’ since the LFS interface transparently
- replaces the normal implementation.
- -- Function: int lstat64 (const char *FILENAME, struct stat64 *BUF)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function is similar to ‘lstat’ but it is also able to work on
- files larger than 2^31 bytes on 32-bit systems. To be able to do
- this the result is stored in a variable of type ‘struct stat64’ to
- which BUF must point.
- When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
- function is available under the name ‘lstat’ and so transparently
- replaces the interface for small files on 32-bit machines.
- File: libc.info, Node: Testing File Type, Next: File Owner, Prev: Reading Attributes, Up: File Attributes
- 14.10.3 Testing the Type of a File
- ----------------------------------
- The “file mode”, stored in the ‘st_mode’ field of the file attributes,
- contains two kinds of information: the file type code, and the access
- permission bits. This section discusses only the type code, which you
- can use to tell whether the file is a directory, socket, symbolic link,
- and so on. For details about access permissions see *note Permission
- Bits::.
- There are two ways you can access the file type information in a file
- mode. Firstly, for each file type there is a “predicate macro” which
- examines a given file mode and returns whether it is of that type or
- not. Secondly, you can mask out the rest of the file mode to leave just
- the file type code, and compare this against constants for each of the
- supported file types.
- All of the symbols listed in this section are defined in the header
- file ‘sys/stat.h’.
- The following predicate macros test the type of a file, given the
- value M which is the ‘st_mode’ field returned by ‘stat’ on that file:
- -- Macro: int S_ISDIR (mode_t M)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This macro returns non-zero if the file is a directory.
- -- Macro: int S_ISCHR (mode_t M)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This macro returns non-zero if the file is a character special file
- (a device like a terminal).
- -- Macro: int S_ISBLK (mode_t M)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This macro returns non-zero if the file is a block special file (a
- device like a disk).
- -- Macro: int S_ISREG (mode_t M)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This macro returns non-zero if the file is a regular file.
- -- Macro: int S_ISFIFO (mode_t M)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This macro returns non-zero if the file is a FIFO special file, or
- a pipe. *Note Pipes and FIFOs::.
- -- Macro: int S_ISLNK (mode_t M)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This macro returns non-zero if the file is a symbolic link. *Note
- Symbolic Links::.
- -- Macro: int S_ISSOCK (mode_t M)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This macro returns non-zero if the file is a socket. *Note
- Sockets::.
- An alternate non-POSIX method of testing the file type is supported
- for compatibility with BSD. The mode can be bitwise AND-ed with ‘S_IFMT’
- to extract the file type code, and compared to the appropriate constant.
- For example,
- S_ISCHR (MODE)
- is equivalent to:
- ((MODE & S_IFMT) == S_IFCHR)
- -- Macro: int S_IFMT
- This is a bit mask used to extract the file type code from a mode
- value.
- These are the symbolic names for the different file type codes:
- ‘S_IFDIR’
- This is the file type constant of a directory file.
- ‘S_IFCHR’
- This is the file type constant of a character-oriented device file.
- ‘S_IFBLK’
- This is the file type constant of a block-oriented device file.
- ‘S_IFREG’
- This is the file type constant of a regular file.
- ‘S_IFLNK’
- This is the file type constant of a symbolic link.
- ‘S_IFSOCK’
- This is the file type constant of a socket.
- ‘S_IFIFO’
- This is the file type constant of a FIFO or pipe.
- The POSIX.1b standard introduced a few more objects which possibly
- can be implemented as objects in the filesystem. These are message
- queues, semaphores, and shared memory objects. To allow differentiating
- these objects from other files the POSIX standard introduced three new
- test macros. But unlike the other macros they do not take the value of
- the ‘st_mode’ field as the parameter. Instead they expect a pointer to
- the whole ‘struct stat’ structure.
- -- Macro: int S_TYPEISMQ (struct stat *S)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- If the system implements POSIX message queues as distinct objects
- and the file is a message queue object, this macro returns a
- non-zero value. In all other cases the result is zero.
- -- Macro: int S_TYPEISSEM (struct stat *S)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- If the system implements POSIX semaphores as distinct objects and
- the file is a semaphore object, this macro returns a non-zero
- value. In all other cases the result is zero.
- -- Macro: int S_TYPEISSHM (struct stat *S)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- If the system implements POSIX shared memory objects as distinct
- objects and the file is a shared memory object, this macro returns
- a non-zero value. In all other cases the result is zero.
- File: libc.info, Node: File Owner, Next: Permission Bits, Prev: Testing File Type, Up: File Attributes
- 14.10.4 File Owner
- ------------------
- Every file has an “owner” which is one of the registered user names
- defined on the system. Each file also has a “group” which is one of the
- defined groups. The file owner can often be useful for showing you who
- edited the file (especially when you edit with GNU Emacs), but its main
- purpose is for access control.
- The file owner and group play a role in determining access because
- the file has one set of access permission bits for the owner, another
- set that applies to users who belong to the file's group, and a third
- set of bits that applies to everyone else. *Note Access Permission::,
- for the details of how access is decided based on this data.
- When a file is created, its owner is set to the effective user ID of
- the process that creates it (*note Process Persona::). The file's group
- ID may be set to either the effective group ID of the process, or the
- group ID of the directory that contains the file, depending on the
- system where the file is stored. When you access a remote file system,
- it behaves according to its own rules, not according to the system your
- program is running on. Thus, your program must be prepared to encounter
- either kind of behavior no matter what kind of system you run it on.
- You can change the owner and/or group owner of an existing file using
- the ‘chown’ function. This is the primitive for the ‘chown’ and ‘chgrp’
- shell commands.
- The prototype for this function is declared in ‘unistd.h’.
- -- Function: int chown (const char *FILENAME, uid_t OWNER, gid_t GROUP)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘chown’ function changes the owner of the file FILENAME to
- OWNER, and its group owner to GROUP.
- Changing the owner of the file on certain systems clears the
- set-user-ID and set-group-ID permission bits. (This is because
- those bits may not be appropriate for the new owner.) Other file
- permission bits are not changed.
- The return value is ‘0’ on success and ‘-1’ on failure. In
- addition to the usual file name errors (*note File Name Errors::),
- the following ‘errno’ error conditions are defined for this
- function:
- ‘EPERM’
- This process lacks permission to make the requested change.
- Only privileged users or the file's owner can change the
- file's group. On most file systems, only privileged users can
- change the file owner; some file systems allow you to change
- the owner if you are currently the owner. When you access a
- remote file system, the behavior you encounter is determined
- by the system that actually holds the file, not by the system
- your program is running on.
- *Note Options for Files::, for information about the
- ‘_POSIX_CHOWN_RESTRICTED’ macro.
- ‘EROFS’
- The file is on a read-only file system.
- -- Function: int fchown (int FILEDES, uid_t OWNER, gid_t GROUP)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This is like ‘chown’, except that it changes the owner of the open
- file with descriptor FILEDES.
- The return value from ‘fchown’ is ‘0’ on success and ‘-1’ on
- failure. The following ‘errno’ error codes are defined for this
- function:
- ‘EBADF’
- The FILEDES argument is not a valid file descriptor.
- ‘EINVAL’
- The FILEDES argument corresponds to a pipe or socket, not an
- ordinary file.
- ‘EPERM’
- This process lacks permission to make the requested change.
- For details see ‘chmod’ above.
- ‘EROFS’
- The file resides on a read-only file system.
- File: libc.info, Node: Permission Bits, Next: Access Permission, Prev: File Owner, Up: File Attributes
- 14.10.5 The Mode Bits for Access Permission
- -------------------------------------------
- The “file mode”, stored in the ‘st_mode’ field of the file attributes,
- contains two kinds of information: the file type code, and the access
- permission bits. This section discusses only the access permission
- bits, which control who can read or write the file. *Note Testing File
- Type::, for information about the file type code.
- All of the symbols listed in this section are defined in the header
- file ‘sys/stat.h’.
- These symbolic constants are defined for the file mode bits that
- control access permission for the file:
- ‘S_IRUSR’
- ‘S_IREAD’
- Read permission bit for the owner of the file. On many systems
- this bit is 0400. ‘S_IREAD’ is an obsolete synonym provided for
- BSD compatibility.
- ‘S_IWUSR’
- ‘S_IWRITE’
- Write permission bit for the owner of the file. Usually 0200.
- ‘S_IWRITE’ is an obsolete synonym provided for BSD compatibility.
- ‘S_IXUSR’
- ‘S_IEXEC’
- Execute (for ordinary files) or search (for directories) permission
- bit for the owner of the file. Usually 0100. ‘S_IEXEC’ is an
- obsolete synonym provided for BSD compatibility.
- ‘S_IRWXU’
- This is equivalent to ‘(S_IRUSR | S_IWUSR | S_IXUSR)’.
- ‘S_IRGRP’
- Read permission bit for the group owner of the file. Usually 040.
- ‘S_IWGRP’
- Write permission bit for the group owner of the file. Usually 020.
- ‘S_IXGRP’
- Execute or search permission bit for the group owner of the file.
- Usually 010.
- ‘S_IRWXG’
- This is equivalent to ‘(S_IRGRP | S_IWGRP | S_IXGRP)’.
- ‘S_IROTH’
- Read permission bit for other users. Usually 04.
- ‘S_IWOTH’
- Write permission bit for other users. Usually 02.
- ‘S_IXOTH’
- Execute or search permission bit for other users. Usually 01.
- ‘S_IRWXO’
- This is equivalent to ‘(S_IROTH | S_IWOTH | S_IXOTH)’.
- ‘S_ISUID’
- This is the set-user-ID on execute bit, usually 04000. *Note How
- Change Persona::.
- ‘S_ISGID’
- This is the set-group-ID on execute bit, usually 02000. *Note How
- Change Persona::.
- ‘S_ISVTX’
- This is the “sticky” bit, usually 01000.
- For a directory it gives permission to delete a file in that
- directory only if you own that file. Ordinarily, a user can either
- delete all the files in a directory or cannot delete any of them
- (based on whether the user has write permission for the directory).
- The same restriction applies--you must have both write permission
- for the directory and own the file you want to delete. The one
- exception is that the owner of the directory can delete any file in
- the directory, no matter who owns it (provided the owner has given
- himself write permission for the directory). This is commonly used
- for the ‘/tmp’ directory, where anyone may create files but not
- delete files created by other users.
- Originally the sticky bit on an executable file modified the
- swapping policies of the system. Normally, when a program
- terminated, its pages in core were immediately freed and reused.
- If the sticky bit was set on the executable file, the system kept
- the pages in core for a while as if the program were still running.
- This was advantageous for a program likely to be run many times in
- succession. This usage is obsolete in modern systems. When a
- program terminates, its pages always remain in core as long as
- there is no shortage of memory in the system. When the program is
- next run, its pages will still be in core if no shortage arose
- since the last run.
- On some modern systems where the sticky bit has no useful meaning
- for an executable file, you cannot set the bit at all for a
- non-directory. If you try, ‘chmod’ fails with ‘EFTYPE’; *note
- Setting Permissions::.
- Some systems (particularly SunOS) have yet another use for the
- sticky bit. If the sticky bit is set on a file that is _not_
- executable, it means the opposite: never cache the pages of this
- file at all. The main use of this is for the files on an NFS
- server machine which are used as the swap area of diskless client
- machines. The idea is that the pages of the file will be cached in
- the client's memory, so it is a waste of the server's memory to
- cache them a second time. With this usage the sticky bit also
- implies that the filesystem may fail to record the file's
- modification time onto disk reliably (the idea being that no-one
- cares for a swap file).
- This bit is only available on BSD systems (and those derived from
- them). Therefore one has to use the ‘_GNU_SOURCE’ feature select
- macro, or not define any feature test macros, to get the definition
- (*note Feature Test Macros::).
- The actual bit values of the symbols are listed in the table above so
- you can decode file mode values when debugging your programs. These bit
- values are correct for most systems, but they are not guaranteed.
- *Warning:* Writing explicit numbers for file permissions is bad
- practice. Not only is it not portable, it also requires everyone who
- reads your program to remember what the bits mean. To make your program
- clean use the symbolic names.
- File: libc.info, Node: Access Permission, Next: Setting Permissions, Prev: Permission Bits, Up: File Attributes
- 14.10.6 How Your Access to a File is Decided
- --------------------------------------------
- Recall that the operating system normally decides access permission for
- a file based on the effective user and group IDs of the process and its
- supplementary group IDs, together with the file's owner, group and
- permission bits. These concepts are discussed in detail in *note
- Process Persona::.
- If the effective user ID of the process matches the owner user ID of
- the file, then permissions for read, write, and execute/search are
- controlled by the corresponding "user" (or "owner") bits. Likewise, if
- any of the effective group ID or supplementary group IDs of the process
- matches the group owner ID of the file, then permissions are controlled
- by the "group" bits. Otherwise, permissions are controlled by the
- "other" bits.
- Privileged users, like ‘root’, can access any file regardless of its
- permission bits. As a special case, for a file to be executable even by
- a privileged user, at least one of its execute bits must be set.
- File: libc.info, Node: Setting Permissions, Next: Testing File Access, Prev: Access Permission, Up: File Attributes
- 14.10.7 Assigning File Permissions
- ----------------------------------
- The primitive functions for creating files (for example, ‘open’ or
- ‘mkdir’) take a MODE argument, which specifies the file permissions to
- give the newly created file. This mode is modified by the process's
- “file creation mask”, or “umask”, before it is used.
- The bits that are set in the file creation mask identify permissions
- that are always to be disabled for newly created files. For example, if
- you set all the "other" access bits in the mask, then newly created
- files are not accessible at all to processes in the "other" category,
- even if the MODE argument passed to the create function would permit
- such access. In other words, the file creation mask is the complement
- of the ordinary access permissions you want to grant.
- Programs that create files typically specify a MODE argument that
- includes all the permissions that make sense for the particular file.
- For an ordinary file, this is typically read and write permission for
- all classes of users. These permissions are then restricted as
- specified by the individual user's own file creation mask.
- To change the permission of an existing file given its name, call
- ‘chmod’. This function uses the specified permission bits and ignores
- the file creation mask.
- In normal use, the file creation mask is initialized by the user's
- login shell (using the ‘umask’ shell command), and inherited by all
- subprocesses. Application programs normally don't need to worry about
- the file creation mask. It will automatically do what it is supposed to
- do.
- When your program needs to create a file and bypass the umask for its
- access permissions, the easiest way to do this is to use ‘fchmod’ after
- opening the file, rather than changing the umask. In fact, changing the
- umask is usually done only by shells. They use the ‘umask’ function.
- The functions in this section are declared in ‘sys/stat.h’.
- -- Function: mode_t umask (mode_t MASK)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘umask’ function sets the file creation mask of the current
- process to MASK, and returns the previous value of the file
- creation mask.
- Here is an example showing how to read the mask with ‘umask’
- without changing it permanently:
- mode_t
- read_umask (void)
- {
- mode_t mask = umask (0);
- umask (mask);
- return mask;
- }
- However, on GNU/Hurd systems it is better to use ‘getumask’ if you
- just want to read the mask value, because it is reentrant.
- -- Function: mode_t getumask (void)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- Return the current value of the file creation mask for the current
- process. This function is a GNU extension and is only available on
- GNU/Hurd systems.
- -- Function: int chmod (const char *FILENAME, mode_t MODE)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘chmod’ function sets the access permission bits for the file
- named by FILENAME to MODE.
- If FILENAME is a symbolic link, ‘chmod’ changes the permissions of
- the file pointed to by the link, not those of the link itself.
- This function returns ‘0’ if successful and ‘-1’ if not. In
- addition to the usual file name errors (*note File Name Errors::),
- the following ‘errno’ error conditions are defined for this
- function:
- ‘ENOENT’
- The named file doesn't exist.
- ‘EPERM’
- This process does not have permission to change the access
- permissions of this file. Only the file's owner (as judged by
- the effective user ID of the process) or a privileged user can
- change them.
- ‘EROFS’
- The file resides on a read-only file system.
- ‘EFTYPE’
- MODE has the ‘S_ISVTX’ bit (the "sticky bit") set, and the
- named file is not a directory. Some systems do not allow
- setting the sticky bit on non-directory files, and some do
- (and only some of those assign a useful meaning to the bit for
- non-directory files).
- You only get ‘EFTYPE’ on systems where the sticky bit has no
- useful meaning for non-directory files, so it is always safe
- to just clear the bit in MODE and call ‘chmod’ again. *Note
- Permission Bits::, for full details on the sticky bit.
- -- Function: int fchmod (int FILEDES, mode_t MODE)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This is like ‘chmod’, except that it changes the permissions of the
- currently open file given by FILEDES.
- The return value from ‘fchmod’ is ‘0’ on success and ‘-1’ on
- failure. The following ‘errno’ error codes are defined for this
- function:
- ‘EBADF’
- The FILEDES argument is not a valid file descriptor.
- ‘EINVAL’
- The FILEDES argument corresponds to a pipe or socket, or
- something else that doesn't really have access permissions.
- ‘EPERM’
- This process does not have permission to change the access
- permissions of this file. Only the file's owner (as judged by
- the effective user ID of the process) or a privileged user can
- change them.
- ‘EROFS’
- The file resides on a read-only file system.
- File: libc.info, Node: Testing File Access, Next: File Times, Prev: Setting Permissions, Up: File Attributes
- 14.10.8 Testing Permission to Access a File
- -------------------------------------------
- In some situations it is desirable to allow programs to access files or
- devices even if this is not possible with the permissions granted to the
- user. One possible solution is to set the setuid-bit of the program
- file. If such a program is started the _effective_ user ID of the
- process is changed to that of the owner of the program file. So to
- allow write access to files like ‘/etc/passwd’, which normally can be
- written only by the super-user, the modifying program will have to be
- owned by ‘root’ and the setuid-bit must be set.
- But besides the files the program is intended to change the user
- should not be allowed to access any file to which s/he would not have
- access anyway. The program therefore must explicitly check whether _the
- user_ would have the necessary access to a file, before it reads or
- writes the file.
- To do this, use the function ‘access’, which checks for access
- permission based on the process's _real_ user ID rather than the
- effective user ID. (The setuid feature does not alter the real user ID,
- so it reflects the user who actually ran the program.)
- There is another way you could check this access, which is easy to
- describe, but very hard to use. This is to examine the file mode bits
- and mimic the system's own access computation. This method is
- undesirable because many systems have additional access control
- features; your program cannot portably mimic them, and you would not
- want to try to keep track of the diverse features that different systems
- have. Using ‘access’ is simple and automatically does whatever is
- appropriate for the system you are using.
- ‘access’ is _only_ appropriate to use in setuid programs. A
- non-setuid program will always use the effective ID rather than the real
- ID.
- The symbols in this section are declared in ‘unistd.h’.
- -- Function: int access (const char *FILENAME, int HOW)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘access’ function checks to see whether the file named by
- FILENAME can be accessed in the way specified by the HOW argument.
- The HOW argument either can be the bitwise OR of the flags ‘R_OK’,
- ‘W_OK’, ‘X_OK’, or the existence test ‘F_OK’.
- This function uses the _real_ user and group IDs of the calling
- process, rather than the _effective_ IDs, to check for access
- permission. As a result, if you use the function from a ‘setuid’
- or ‘setgid’ program (*note How Change Persona::), it gives
- information relative to the user who actually ran the program.
- The return value is ‘0’ if the access is permitted, and ‘-1’
- otherwise. (In other words, treated as a predicate function,
- ‘access’ returns true if the requested access is _denied_.)
- In addition to the usual file name errors (*note File Name
- Errors::), the following ‘errno’ error conditions are defined for
- this function:
- ‘EACCES’
- The access specified by HOW is denied.
- ‘ENOENT’
- The file doesn't exist.
- ‘EROFS’
- Write permission was requested for a file on a read-only file
- system.
- These macros are defined in the header file ‘unistd.h’ for use as the
- HOW argument to the ‘access’ function. The values are integer
- constants.
- -- Macro: int R_OK
- Flag meaning test for read permission.
- -- Macro: int W_OK
- Flag meaning test for write permission.
- -- Macro: int X_OK
- Flag meaning test for execute/search permission.
- -- Macro: int F_OK
- Flag meaning test for existence of the file.
- -- Function: int faccessat (int FILEDES, const char *FILENAME, int HOW,
- int FLAGS)
- | MT-Safe | AS-Unsafe corrupt | AC-Unsafe corrupt | *Note POSIX
- Safety Concepts::.
- This function is a descriptor-relative version of the ‘access’
- function above. *Note Descriptor-Relative Access::. The FLAGS
- argument can contain a combination of the flags ‘AT_EACCESS’
- described below, ‘AT_EMPTY_PATH’, and ‘AT_SYMLINK_NOFOLLOW’.
- ‘AT_EACCESS’
- This flag when passed to the ‘faccessat’ function causes it to
- perform access checks using effective user and group IDs
- instead of real IDs, which is the default and matches the
- ‘access’ function.
- Compared to ‘access’, some additional error conditions can occur.
- *Note Descriptor-Relative Access::.
- This function may not work correctly on older kernels missing the
- ‘faccessat2’ system call.
- File: libc.info, Node: File Times, Next: File Size, Prev: Testing File Access, Up: File Attributes
- 14.10.9 File Times
- ------------------
- Each file has three time stamps associated with it: its access time, its
- modification time, and its attribute modification time. These
- correspond to the ‘st_atime’, ‘st_mtime’, and ‘st_ctime’ members of the
- ‘stat’ structure; see *note File Attributes::.
- All of these times are represented in calendar time format, as
- ‘time_t’ objects. This data type is defined in ‘time.h’. For more
- information about representation and manipulation of time values, see
- *note Calendar Time::.
- Reading from a file updates its access time attribute, and writing
- updates its modification time. When a file is created, all three time
- stamps for that file are set to the current time. In addition, the
- attribute change time and modification time fields of the directory that
- contains the new entry are updated.
- Adding a new name for a file with the ‘link’ function updates the
- attribute change time field of the file being linked, and both the
- attribute change time and modification time fields of the directory
- containing the new name. These same fields are affected if a file name
- is deleted with ‘unlink’, ‘remove’ or ‘rmdir’. Renaming a file with
- ‘rename’ affects only the attribute change time and modification time
- fields of the two parent directories involved, and not the times for the
- file being renamed.
- Changing the attributes of a file (for example, with ‘chmod’) updates
- its attribute change time field.
- You can also change some of the time stamps of a file explicitly
- using the ‘utime’ function--all except the attribute change time. You
- need to include the header file ‘utime.h’ to use this facility.
- -- Data Type: struct utimbuf
- The ‘utimbuf’ structure is used with the ‘utime’ function to
- specify new access and modification times for a file. It contains
- the following members:
- ‘time_t actime’
- This is the access time for the file.
- ‘time_t modtime’
- This is the modification time for the file.
- -- Function: int utime (const char *FILENAME, const struct utimbuf
- *TIMES)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function is used to modify the file times associated with the
- file named FILENAME.
- If TIMES is a null pointer, then the access and modification times
- of the file are set to the current time. Otherwise, they are set
- to the values from the ‘actime’ and ‘modtime’ members
- (respectively) of the ‘utimbuf’ structure pointed to by TIMES.
- The attribute modification time for the file is set to the current
- time in either case (since changing the time stamps is itself a
- modification of the file attributes).
- The ‘utime’ function returns ‘0’ if successful and ‘-1’ on failure.
- In addition to the usual file name errors (*note File Name
- Errors::), the following ‘errno’ error conditions are defined for
- this function:
- ‘EACCES’
- There is a permission problem in the case where a null pointer
- was passed as the TIMES argument. In order to update the time
- stamp on the file, you must either be the owner of the file,
- have write permission for the file, or be a privileged user.
- ‘ENOENT’
- The file doesn't exist.
- ‘EPERM’
- If the TIMES argument is not a null pointer, you must either
- be the owner of the file or be a privileged user.
- ‘EROFS’
- The file lives on a read-only file system.
- Each of the three time stamps has a corresponding microsecond part,
- which extends its resolution. These fields are called ‘st_atime_usec’,
- ‘st_mtime_usec’, and ‘st_ctime_usec’; each has a value between 0 and
- 999,999, which indicates the time in microseconds. They correspond to
- the ‘tv_usec’ field of a ‘timeval’ structure; see *note Time Types::.
- The ‘utimes’ function is like ‘utime’, but also lets you specify the
- fractional part of the file times. The prototype for this function is
- in the header file ‘sys/time.h’.
- -- Function: int utimes (const char *FILENAME, const struct timeval
- TVP[2])
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function sets the file access and modification times of the
- file FILENAME. The new file access time is specified by ‘TVP[0]’,
- and the new modification time by ‘TVP[1]’. Similar to ‘utime’, if
- TVP is a null pointer then the access and modification times of the
- file are set to the current time. This function comes from BSD.
- The return values and error conditions are the same as for the
- ‘utime’ function.
- -- Function: int lutimes (const char *FILENAME, const struct timeval
- TVP[2])
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function is like ‘utimes’, except that it does not follow
- symbolic links. If FILENAME is the name of a symbolic link,
- ‘lutimes’ sets the file access and modification times of the
- symbolic link special file itself (as seen by ‘lstat’; *note
- Symbolic Links::) while ‘utimes’ sets the file access and
- modification times of the file the symbolic link refers to. This
- function comes from FreeBSD, and is not available on all platforms
- (if not available, it will fail with ‘ENOSYS’).
- The return values and error conditions are the same as for the
- ‘utime’ function.
- -- Function: int futimes (int FD, const struct timeval TVP[2])
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- This function is like ‘utimes’, except that it takes an open file
- descriptor as an argument instead of a file name. *Note Low-Level
- I/O::. This function comes from FreeBSD, and is not available on
- all platforms (if not available, it will fail with ‘ENOSYS’).
- Like ‘utimes’, ‘futimes’ returns ‘0’ on success and ‘-1’ on
- failure. The following ‘errno’ error conditions are defined for
- ‘futimes’:
- ‘EACCES’
- There is a permission problem in the case where a null pointer
- was passed as the TIMES argument. In order to update the time
- stamp on the file, you must either be the owner of the file,
- have write permission for the file, or be a privileged user.
- ‘EBADF’
- The FILEDES argument is not a valid file descriptor.
- ‘EINVAL’
- At least one of the fields in the ‘tvp’ array passed has an
- invalid value.
- ‘EPERM’
- If the TIMES argument is not a null pointer, you must either
- be the owner of the file or be a privileged user.
- ‘EROFS’
- The file lives on a read-only file system.
- -- Function: int futimens (int FILEDES, const struct timespec TSP[2])
- | MT-Safe | AS-Unsafe corrupt | AC-Unsafe corrupt | *Note POSIX
- Safety Concepts::.
- This function is like ‘futimes’, except that it sets the file
- access and modification timestamps with nanosecond precision. The
- argument ‘tsp’ is used similarly to ‘futimes’' ‘tvp’, but has a
- ‘const struct timespec’ type that can express calendar time with
- nanosecond precision. *Note Time Types::.
- -- Function: int utimensat (int FILEDES, const char *FILENAME, const
- struct timespec TSP[2], int FLAGS)
- | MT-Safe | AS-Unsafe corrupt | AC-Unsafe corrupt | *Note POSIX
- Safety Concepts::.
- This function is a descriptor-relative version of the ‘futimens’
- function above. *Note Descriptor-Relative Access::. The FLAGS
- argument can contain a combination of the flags ‘AT_EMPTY_PATH’,
- and ‘AT_SYMLINK_NOFOLLOW’. The call:
- futimens (FILEDES, TSP)
- is equivalent to:
- utimensat (FILEDES, NULL, TSP, 0)
- Compared to ‘futimens’, some additional error conditions can occur
- due to descriptor-relative access. *Note Descriptor-Relative
- Access::. In addition to this, the following other errors can also
- occur:
- ‘EINVAL’
- The FILENAME argument is NULL, FILEDES is not ‘AT_FDCWD’, and
- FLAGS is not ‘0’.
- ‘ELOOP’
- There are too many levels of indirection. This can be the
- result of circular symbolic links to directories.
- ‘ENAMETOOLONG’
- The resulting path is too long. This error only occurs on
- systems which have a limit on the file name length.
- ‘ENOENT’
- The FILENAME argument is an empty string and FLAGS does not
- contain ‘AT_EMPTY_PATH’, or FILENAME does not refer to an
- existing file.
- ‘ESRCH’
- Search permission was denied for one of the prefix components
- of the the FILENAME argument.
|