libc.info-7 293 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364
  1. This is libc.info, produced by makeinfo version 7.3 from libc.texinfo.
  2. This is ‘The GNU C Library Reference Manual’, for version 2.43.
  3. Copyright © 1993-2026 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software Needs Free Documentation" and
  8. "GNU Lesser General Public License", the Front-Cover texts being "A GNU
  9. Manual", and with the Back-Cover Texts as in (a) below. A copy of the
  10. license is included in the section entitled "GNU Free Documentation
  11. License".
  12. (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
  13. modify this GNU manual. Buying copies from the FSF supports it in
  14. developing GNU and promoting software freedom."
  15. INFO-DIR-SECTION Software libraries
  16. START-INFO-DIR-ENTRY
  17. * Libc: (libc). C library.
  18. END-INFO-DIR-ENTRY
  19. INFO-DIR-SECTION GNU C library functions and macros
  20. START-INFO-DIR-ENTRY
  21. * ALTWERASE: (libc)Local Modes.
  22. * ARGP_ERR_UNKNOWN: (libc)Argp Parser Functions.
  23. * ARG_MAX: (libc)General Limits.
  24. * BAUD_MAX: (libc)Line Speed.
  25. * BC_BASE_MAX: (libc)Utility Limits.
  26. * BC_DIM_MAX: (libc)Utility Limits.
  27. * BC_SCALE_MAX: (libc)Utility Limits.
  28. * BC_STRING_MAX: (libc)Utility Limits.
  29. * BRKINT: (libc)Input Modes.
  30. * BUFSIZ: (libc)Controlling Buffering.
  31. * CCTS_OFLOW: (libc)Control Modes.
  32. * CHAR_BIT: (libc)Width of Type.
  33. * CHILD_MAX: (libc)General Limits.
  34. * CIGNORE: (libc)Control Modes.
  35. * CLK_TCK: (libc)Processor Time.
  36. * CLOCAL: (libc)Control Modes.
  37. * CLOCKS_PER_SEC: (libc)CPU Time.
  38. * CLOCK_BOOTTIME: (libc)Getting the Time.
  39. * CLOCK_BOOTTIME_ALARM: (libc)Getting the Time.
  40. * CLOCK_MONOTONIC: (libc)Getting the Time.
  41. * CLOCK_MONOTONIC_COARSE: (libc)Getting the Time.
  42. * CLOCK_MONOTONIC_RAW: (libc)Getting the Time.
  43. * CLOCK_PROCESS_CPUTIME_ID: (libc)Getting the Time.
  44. * CLOCK_REALTIME: (libc)Getting the Time.
  45. * CLOCK_REALTIME_ALARM: (libc)Getting the Time.
  46. * CLOCK_REALTIME_COARSE: (libc)Getting the Time.
  47. * CLOCK_TAI: (libc)Getting the Time.
  48. * CLOCK_THREAD_CPUTIME_ID: (libc)Getting the Time.
  49. * COLL_WEIGHTS_MAX: (libc)Utility Limits.
  50. * CPU_ALLOC: (libc)CPU Affinity.
  51. * CPU_ALLOC_SIZE: (libc)CPU Affinity.
  52. * CPU_AND: (libc)CPU Affinity.
  53. * CPU_AND_S: (libc)CPU Affinity.
  54. * CPU_CLR: (libc)CPU Affinity.
  55. * CPU_CLR_S: (libc)CPU Affinity.
  56. * CPU_COUNT: (libc)CPU Affinity.
  57. * CPU_COUNT_S: (libc)CPU Affinity.
  58. * CPU_EQUAL: (libc)CPU Affinity.
  59. * CPU_EQUAL_S: (libc)CPU Affinity.
  60. * CPU_FEATURE_ACTIVE: (libc)X86.
  61. * CPU_FEATURE_PRESENT: (libc)X86.
  62. * CPU_FREE: (libc)CPU Affinity.
  63. * CPU_ISSET: (libc)CPU Affinity.
  64. * CPU_ISSET_S: (libc)CPU Affinity.
  65. * CPU_OR: (libc)CPU Affinity.
  66. * CPU_OR_S: (libc)CPU Affinity.
  67. * CPU_SET: (libc)CPU Affinity.
  68. * CPU_SETSIZE: (libc)CPU Affinity.
  69. * CPU_SET_S: (libc)CPU Affinity.
  70. * CPU_XOR: (libc)CPU Affinity.
  71. * CPU_XOR_S: (libc)CPU Affinity.
  72. * CPU_ZERO: (libc)CPU Affinity.
  73. * CPU_ZERO_S: (libc)CPU Affinity.
  74. * CREAD: (libc)Control Modes.
  75. * CRTS_IFLOW: (libc)Control Modes.
  76. * CS5: (libc)Control Modes.
  77. * CS6: (libc)Control Modes.
  78. * CS7: (libc)Control Modes.
  79. * CS8: (libc)Control Modes.
  80. * CSIZE: (libc)Control Modes.
  81. * CSTOPB: (libc)Control Modes.
  82. * DLFO_EH_SEGMENT_TYPE: (libc)Dynamic Linker Introspection.
  83. * DLFO_STRUCT_HAS_EH_COUNT: (libc)Dynamic Linker Introspection.
  84. * DLFO_STRUCT_HAS_EH_DBASE: (libc)Dynamic Linker Introspection.
  85. * DTTOIF: (libc)Directory Entries.
  86. * E2BIG: (libc)Error Codes.
  87. * EACCES: (libc)Error Codes.
  88. * EADDRINUSE: (libc)Error Codes.
  89. * EADDRNOTAVAIL: (libc)Error Codes.
  90. * EADV: (libc)Error Codes.
  91. * EAFNOSUPPORT: (libc)Error Codes.
  92. * EAGAIN: (libc)Error Codes.
  93. * EALREADY: (libc)Error Codes.
  94. * EAUTH: (libc)Error Codes.
  95. * EBACKGROUND: (libc)Error Codes.
  96. * EBADE: (libc)Error Codes.
  97. * EBADF: (libc)Error Codes.
  98. * EBADFD: (libc)Error Codes.
  99. * EBADMSG: (libc)Error Codes.
  100. * EBADR: (libc)Error Codes.
  101. * EBADRPC: (libc)Error Codes.
  102. * EBADRQC: (libc)Error Codes.
  103. * EBADSLT: (libc)Error Codes.
  104. * EBFONT: (libc)Error Codes.
  105. * EBUSY: (libc)Error Codes.
  106. * ECANCELED: (libc)Error Codes.
  107. * ECHILD: (libc)Error Codes.
  108. * ECHO: (libc)Local Modes.
  109. * ECHOCTL: (libc)Local Modes.
  110. * ECHOE: (libc)Local Modes.
  111. * ECHOK: (libc)Local Modes.
  112. * ECHOKE: (libc)Local Modes.
  113. * ECHONL: (libc)Local Modes.
  114. * ECHOPRT: (libc)Local Modes.
  115. * ECHRNG: (libc)Error Codes.
  116. * ECOMM: (libc)Error Codes.
  117. * ECONNABORTED: (libc)Error Codes.
  118. * ECONNREFUSED: (libc)Error Codes.
  119. * ECONNRESET: (libc)Error Codes.
  120. * ED: (libc)Error Codes.
  121. * EDEADLK: (libc)Error Codes.
  122. * EDEADLOCK: (libc)Error Codes.
  123. * EDESTADDRREQ: (libc)Error Codes.
  124. * EDIED: (libc)Error Codes.
  125. * EDOM: (libc)Error Codes.
  126. * EDOTDOT: (libc)Error Codes.
  127. * EDQUOT: (libc)Error Codes.
  128. * EEXIST: (libc)Error Codes.
  129. * EFAULT: (libc)Error Codes.
  130. * EFBIG: (libc)Error Codes.
  131. * EFTYPE: (libc)Error Codes.
  132. * EGRATUITOUS: (libc)Error Codes.
  133. * EGREGIOUS: (libc)Error Codes.
  134. * EHOSTDOWN: (libc)Error Codes.
  135. * EHOSTUNREACH: (libc)Error Codes.
  136. * EHWPOISON: (libc)Error Codes.
  137. * EIDRM: (libc)Error Codes.
  138. * EIEIO: (libc)Error Codes.
  139. * EILSEQ: (libc)Error Codes.
  140. * EINPROGRESS: (libc)Error Codes.
  141. * EINTR: (libc)Error Codes.
  142. * EINVAL: (libc)Error Codes.
  143. * EIO: (libc)Error Codes.
  144. * EISCONN: (libc)Error Codes.
  145. * EISDIR: (libc)Error Codes.
  146. * EISNAM: (libc)Error Codes.
  147. * EKEYEXPIRED: (libc)Error Codes.
  148. * EKEYREJECTED: (libc)Error Codes.
  149. * EKEYREVOKED: (libc)Error Codes.
  150. * EL2HLT: (libc)Error Codes.
  151. * EL2NSYNC: (libc)Error Codes.
  152. * EL3HLT: (libc)Error Codes.
  153. * EL3RST: (libc)Error Codes.
  154. * ELIBACC: (libc)Error Codes.
  155. * ELIBBAD: (libc)Error Codes.
  156. * ELIBEXEC: (libc)Error Codes.
  157. * ELIBMAX: (libc)Error Codes.
  158. * ELIBSCN: (libc)Error Codes.
  159. * ELNRNG: (libc)Error Codes.
  160. * ELOOP: (libc)Error Codes.
  161. * EMEDIUMTYPE: (libc)Error Codes.
  162. * EMFILE: (libc)Error Codes.
  163. * EMLINK: (libc)Error Codes.
  164. * EMSGSIZE: (libc)Error Codes.
  165. * EMULTIHOP: (libc)Error Codes.
  166. * ENAMETOOLONG: (libc)Error Codes.
  167. * ENAVAIL: (libc)Error Codes.
  168. * ENEEDAUTH: (libc)Error Codes.
  169. * ENETDOWN: (libc)Error Codes.
  170. * ENETRESET: (libc)Error Codes.
  171. * ENETUNREACH: (libc)Error Codes.
  172. * ENFILE: (libc)Error Codes.
  173. * ENOANO: (libc)Error Codes.
  174. * ENOBUFS: (libc)Error Codes.
  175. * ENOCSI: (libc)Error Codes.
  176. * ENODATA: (libc)Error Codes.
  177. * ENODEV: (libc)Error Codes.
  178. * ENOENT: (libc)Error Codes.
  179. * ENOEXEC: (libc)Error Codes.
  180. * ENOKEY: (libc)Error Codes.
  181. * ENOLCK: (libc)Error Codes.
  182. * ENOLINK: (libc)Error Codes.
  183. * ENOMEDIUM: (libc)Error Codes.
  184. * ENOMEM: (libc)Error Codes.
  185. * ENOMSG: (libc)Error Codes.
  186. * ENONET: (libc)Error Codes.
  187. * ENOPKG: (libc)Error Codes.
  188. * ENOPROTOOPT: (libc)Error Codes.
  189. * ENOSPC: (libc)Error Codes.
  190. * ENOSR: (libc)Error Codes.
  191. * ENOSTR: (libc)Error Codes.
  192. * ENOSYS: (libc)Error Codes.
  193. * ENOTBLK: (libc)Error Codes.
  194. * ENOTCONN: (libc)Error Codes.
  195. * ENOTDIR: (libc)Error Codes.
  196. * ENOTEMPTY: (libc)Error Codes.
  197. * ENOTNAM: (libc)Error Codes.
  198. * ENOTRECOVERABLE: (libc)Error Codes.
  199. * ENOTSOCK: (libc)Error Codes.
  200. * ENOTSUP: (libc)Error Codes.
  201. * ENOTTY: (libc)Error Codes.
  202. * ENOTUNIQ: (libc)Error Codes.
  203. * ENXIO: (libc)Error Codes.
  204. * EOF: (libc)EOF and Errors.
  205. * EOPNOTSUPP: (libc)Error Codes.
  206. * EOVERFLOW: (libc)Error Codes.
  207. * EOWNERDEAD: (libc)Error Codes.
  208. * EPERM: (libc)Error Codes.
  209. * EPFNOSUPPORT: (libc)Error Codes.
  210. * EPIPE: (libc)Error Codes.
  211. * EPROCLIM: (libc)Error Codes.
  212. * EPROCUNAVAIL: (libc)Error Codes.
  213. * EPROGMISMATCH: (libc)Error Codes.
  214. * EPROGUNAVAIL: (libc)Error Codes.
  215. * EPROTO: (libc)Error Codes.
  216. * EPROTONOSUPPORT: (libc)Error Codes.
  217. * EPROTOTYPE: (libc)Error Codes.
  218. * EQUIV_CLASS_MAX: (libc)Utility Limits.
  219. * ERANGE: (libc)Error Codes.
  220. * EREMCHG: (libc)Error Codes.
  221. * EREMOTE: (libc)Error Codes.
  222. * EREMOTEIO: (libc)Error Codes.
  223. * ERESTART: (libc)Error Codes.
  224. * ERFKILL: (libc)Error Codes.
  225. * EROFS: (libc)Error Codes.
  226. * ERPCMISMATCH: (libc)Error Codes.
  227. * ESHUTDOWN: (libc)Error Codes.
  228. * ESOCKTNOSUPPORT: (libc)Error Codes.
  229. * ESPIPE: (libc)Error Codes.
  230. * ESRCH: (libc)Error Codes.
  231. * ESRMNT: (libc)Error Codes.
  232. * ESTALE: (libc)Error Codes.
  233. * ESTRPIPE: (libc)Error Codes.
  234. * ETIME: (libc)Error Codes.
  235. * ETIMEDOUT: (libc)Error Codes.
  236. * ETOOMANYREFS: (libc)Error Codes.
  237. * ETXTBSY: (libc)Error Codes.
  238. * EUCLEAN: (libc)Error Codes.
  239. * EUNATCH: (libc)Error Codes.
  240. * EUSERS: (libc)Error Codes.
  241. * EWOULDBLOCK: (libc)Error Codes.
  242. * EXDEV: (libc)Error Codes.
  243. * EXFULL: (libc)Error Codes.
  244. * EXIT_FAILURE: (libc)Exit Status.
  245. * EXIT_SUCCESS: (libc)Exit Status.
  246. * EXPR_NEST_MAX: (libc)Utility Limits.
  247. * FD_CLOEXEC: (libc)Descriptor Flags.
  248. * FD_CLR: (libc)Waiting for I/O.
  249. * FD_ISSET: (libc)Waiting for I/O.
  250. * FD_SET: (libc)Waiting for I/O.
  251. * FD_SETSIZE: (libc)Waiting for I/O.
  252. * FD_ZERO: (libc)Waiting for I/O.
  253. * FE_SNANS_ALWAYS_SIGNAL: (libc)Infinity and NaN.
  254. * FILENAME_MAX: (libc)Limits for Files.
  255. * FLUSHO: (libc)Local Modes.
  256. * FOPEN_MAX: (libc)Opening Streams.
  257. * FP_ILOGB0: (libc)Exponents and Logarithms.
  258. * FP_ILOGBNAN: (libc)Exponents and Logarithms.
  259. * FP_LLOGB0: (libc)Exponents and Logarithms.
  260. * FP_LLOGBNAN: (libc)Exponents and Logarithms.
  261. * F_DUPFD: (libc)Duplicating Descriptors.
  262. * F_GETFD: (libc)Descriptor Flags.
  263. * F_GETFL: (libc)Getting File Status Flags.
  264. * F_GETLK: (libc)File Locks.
  265. * F_GETOWN: (libc)Interrupt Input.
  266. * F_OFD_GETLK: (libc)Open File Description Locks.
  267. * F_OFD_SETLK: (libc)Open File Description Locks.
  268. * F_OFD_SETLKW: (libc)Open File Description Locks.
  269. * F_OK: (libc)Testing File Access.
  270. * F_SETFD: (libc)Descriptor Flags.
  271. * F_SETFL: (libc)Getting File Status Flags.
  272. * F_SETLK: (libc)File Locks.
  273. * F_SETLKW: (libc)File Locks.
  274. * F_SETOWN: (libc)Interrupt Input.
  275. * HUGE_VAL: (libc)Math Error Reporting.
  276. * HUGE_VALF: (libc)Math Error Reporting.
  277. * HUGE_VALL: (libc)Math Error Reporting.
  278. * HUGE_VAL_FN: (libc)Math Error Reporting.
  279. * HUGE_VAL_FNx: (libc)Math Error Reporting.
  280. * HUPCL: (libc)Control Modes.
  281. * I: (libc)Complex Numbers.
  282. * ICANON: (libc)Local Modes.
  283. * ICRNL: (libc)Input Modes.
  284. * IEXTEN: (libc)Local Modes.
  285. * IFNAMSIZ: (libc)Interface Naming.
  286. * IFTODT: (libc)Directory Entries.
  287. * IGNBRK: (libc)Input Modes.
  288. * IGNCR: (libc)Input Modes.
  289. * IGNPAR: (libc)Input Modes.
  290. * IMAXBEL: (libc)Input Modes.
  291. * INADDR_ANY: (libc)Host Address Data Type.
  292. * INADDR_BROADCAST: (libc)Host Address Data Type.
  293. * INADDR_LOOPBACK: (libc)Host Address Data Type.
  294. * INADDR_NONE: (libc)Host Address Data Type.
  295. * INFINITY: (libc)Infinity and NaN.
  296. * INLCR: (libc)Input Modes.
  297. * INPCK: (libc)Input Modes.
  298. * IPPORT_RESERVED: (libc)Ports.
  299. * IPPORT_USERRESERVED: (libc)Ports.
  300. * ISIG: (libc)Local Modes.
  301. * ISTRIP: (libc)Input Modes.
  302. * IXANY: (libc)Input Modes.
  303. * IXOFF: (libc)Input Modes.
  304. * IXON: (libc)Input Modes.
  305. * LINE_MAX: (libc)Utility Limits.
  306. * LINK_MAX: (libc)Limits for Files.
  307. * L_ctermid: (libc)Identifying the Terminal.
  308. * L_cuserid: (libc)Who Logged In.
  309. * L_tmpnam: (libc)Temporary Files.
  310. * MAXNAMLEN: (libc)Limits for Files.
  311. * MAXSYMLINKS: (libc)Symbolic Links.
  312. * MAX_CANON: (libc)Limits for Files.
  313. * MAX_INPUT: (libc)Limits for Files.
  314. * MB_CUR_MAX: (libc)Selecting the Conversion.
  315. * MB_LEN_MAX: (libc)Selecting the Conversion.
  316. * MDMBUF: (libc)Control Modes.
  317. * MSG_DONTROUTE: (libc)Socket Data Options.
  318. * MSG_OOB: (libc)Socket Data Options.
  319. * MSG_PEEK: (libc)Socket Data Options.
  320. * NAME_MAX: (libc)Limits for Files.
  321. * NAN: (libc)Infinity and NaN.
  322. * NCCS: (libc)Mode Data Types.
  323. * NGROUPS_MAX: (libc)General Limits.
  324. * NOFLSH: (libc)Local Modes.
  325. * NOKERNINFO: (libc)Local Modes.
  326. * NSIG: (libc)Standard Signals.
  327. * NULL: (libc)Null Pointer Constant.
  328. * ONLCR: (libc)Output Modes.
  329. * ONOEOT: (libc)Output Modes.
  330. * OPEN_MAX: (libc)General Limits.
  331. * OPOST: (libc)Output Modes.
  332. * OXTABS: (libc)Output Modes.
  333. * O_ACCMODE: (libc)Access Modes.
  334. * O_APPEND: (libc)Operating Modes.
  335. * O_ASYNC: (libc)Operating Modes.
  336. * O_CREAT: (libc)Open-time Flags.
  337. * O_DIRECTORY: (libc)Open-time Flags.
  338. * O_EXCL: (libc)Open-time Flags.
  339. * O_EXEC: (libc)Access Modes.
  340. * O_EXLOCK: (libc)Open-time Flags.
  341. * O_FSYNC: (libc)Operating Modes.
  342. * O_IGNORE_CTTY: (libc)Open-time Flags.
  343. * O_NDELAY: (libc)Operating Modes.
  344. * O_NOATIME: (libc)Operating Modes.
  345. * O_NOCTTY: (libc)Open-time Flags.
  346. * O_NOFOLLOW: (libc)Open-time Flags.
  347. * O_NOLINK: (libc)Open-time Flags.
  348. * O_NONBLOCK: (libc)Open-time Flags.
  349. * O_NONBLOCK: (libc)Operating Modes.
  350. * O_NOTRANS: (libc)Open-time Flags.
  351. * O_PATH: (libc)Access Modes.
  352. * O_RDONLY: (libc)Access Modes.
  353. * O_RDWR: (libc)Access Modes.
  354. * O_READ: (libc)Access Modes.
  355. * O_SHLOCK: (libc)Open-time Flags.
  356. * O_SYNC: (libc)Operating Modes.
  357. * O_TMPFILE: (libc)Open-time Flags.
  358. * O_TRUNC: (libc)Open-time Flags.
  359. * O_WRITE: (libc)Access Modes.
  360. * O_WRONLY: (libc)Access Modes.
  361. * PARENB: (libc)Control Modes.
  362. * PARMRK: (libc)Input Modes.
  363. * PARODD: (libc)Control Modes.
  364. * PATH_MAX: (libc)Limits for Files.
  365. * PA_FLAG_MASK: (libc)Parsing a Template String.
  366. * PENDIN: (libc)Local Modes.
  367. * PF_FILE: (libc)Local Namespace Details.
  368. * PF_INET6: (libc)Internet Namespace.
  369. * PF_INET: (libc)Internet Namespace.
  370. * PF_LOCAL: (libc)Local Namespace Details.
  371. * PF_UNIX: (libc)Local Namespace Details.
  372. * PIPE_BUF: (libc)Limits for Files.
  373. * PTHREAD_ATTR_NO_SIGMASK_NP: (libc)Initial Thread Signal Mask.
  374. * P_tmpdir: (libc)Temporary Files.
  375. * RAND_MAX: (libc)ISO Random.
  376. * RE_DUP_MAX: (libc)General Limits.
  377. * RLIM_INFINITY: (libc)Limits on Resources.
  378. * RSEQ_SIG: (libc)Restartable Sequences.
  379. * R_OK: (libc)Testing File Access.
  380. * SA_NOCLDSTOP: (libc)Flags for Sigaction.
  381. * SA_NOCLDWAIT: (libc)Flags for Sigaction.
  382. * SA_NODEFER: (libc)Flags for Sigaction.
  383. * SA_ONSTACK: (libc)Flags for Sigaction.
  384. * SA_RESETHAND: (libc)Flags for Sigaction.
  385. * SA_RESTART: (libc)Flags for Sigaction.
  386. * SA_SIGINFO: (libc)Flags for Sigaction.
  387. * SEEK_CUR: (libc)File Positioning.
  388. * SEEK_END: (libc)File Positioning.
  389. * SEEK_SET: (libc)File Positioning.
  390. * SIGABRT: (libc)Program Error Signals.
  391. * SIGALRM: (libc)Alarm Signals.
  392. * SIGBUS: (libc)Program Error Signals.
  393. * SIGCHLD: (libc)Job Control Signals.
  394. * SIGCLD: (libc)Job Control Signals.
  395. * SIGCONT: (libc)Job Control Signals.
  396. * SIGEMT: (libc)Program Error Signals.
  397. * SIGFPE: (libc)Program Error Signals.
  398. * SIGHUP: (libc)Termination Signals.
  399. * SIGILL: (libc)Program Error Signals.
  400. * SIGINFO: (libc)Miscellaneous Signals.
  401. * SIGINT: (libc)Termination Signals.
  402. * SIGIO: (libc)Asynchronous I/O Signals.
  403. * SIGIOT: (libc)Program Error Signals.
  404. * SIGKILL: (libc)Termination Signals.
  405. * SIGLOST: (libc)Operation Error Signals.
  406. * SIGPIPE: (libc)Operation Error Signals.
  407. * SIGPOLL: (libc)Asynchronous I/O Signals.
  408. * SIGPROF: (libc)Alarm Signals.
  409. * SIGPWR: (libc)Miscellaneous Signals.
  410. * SIGQUIT: (libc)Termination Signals.
  411. * SIGSEGV: (libc)Program Error Signals.
  412. * SIGSTKFLT: (libc)Program Error Signals.
  413. * SIGSTOP: (libc)Job Control Signals.
  414. * SIGSYS: (libc)Program Error Signals.
  415. * SIGTERM: (libc)Termination Signals.
  416. * SIGTRAP: (libc)Program Error Signals.
  417. * SIGTSTP: (libc)Job Control Signals.
  418. * SIGTTIN: (libc)Job Control Signals.
  419. * SIGTTOU: (libc)Job Control Signals.
  420. * SIGURG: (libc)Asynchronous I/O Signals.
  421. * SIGUSR1: (libc)Miscellaneous Signals.
  422. * SIGUSR2: (libc)Miscellaneous Signals.
  423. * SIGVTALRM: (libc)Alarm Signals.
  424. * SIGWINCH: (libc)Miscellaneous Signals.
  425. * SIGXCPU: (libc)Operation Error Signals.
  426. * SIGXFSZ: (libc)Operation Error Signals.
  427. * SIG_ERR: (libc)Basic Signal Handling.
  428. * SNAN: (libc)Infinity and NaN.
  429. * SNANF: (libc)Infinity and NaN.
  430. * SNANFN: (libc)Infinity and NaN.
  431. * SNANFNx: (libc)Infinity and NaN.
  432. * SNANL: (libc)Infinity and NaN.
  433. * SOCK_DGRAM: (libc)Communication Styles.
  434. * SOCK_RAW: (libc)Communication Styles.
  435. * SOCK_RDM: (libc)Communication Styles.
  436. * SOCK_SEQPACKET: (libc)Communication Styles.
  437. * SOCK_STREAM: (libc)Communication Styles.
  438. * SOL_SOCKET: (libc)Socket-Level Options.
  439. * SPEED_MAX: (libc)Line Speed.
  440. * SSIZE_MAX: (libc)General Limits.
  441. * STREAM_MAX: (libc)General Limits.
  442. * SUN_LEN: (libc)Local Namespace Details.
  443. * S_IFMT: (libc)Testing File Type.
  444. * S_ISBLK: (libc)Testing File Type.
  445. * S_ISCHR: (libc)Testing File Type.
  446. * S_ISDIR: (libc)Testing File Type.
  447. * S_ISFIFO: (libc)Testing File Type.
  448. * S_ISLNK: (libc)Testing File Type.
  449. * S_ISREG: (libc)Testing File Type.
  450. * S_ISSOCK: (libc)Testing File Type.
  451. * S_TYPEISMQ: (libc)Testing File Type.
  452. * S_TYPEISSEM: (libc)Testing File Type.
  453. * S_TYPEISSHM: (libc)Testing File Type.
  454. * TIME_UTC: (libc)Getting the Time.
  455. * TMP_MAX: (libc)Temporary Files.
  456. * TOSTOP: (libc)Local Modes.
  457. * TZNAME_MAX: (libc)General Limits.
  458. * VDISCARD: (libc)Other Special.
  459. * VDSUSP: (libc)Signal Characters.
  460. * VEOF: (libc)Editing Characters.
  461. * VEOL2: (libc)Editing Characters.
  462. * VEOL: (libc)Editing Characters.
  463. * VERASE: (libc)Editing Characters.
  464. * VINTR: (libc)Signal Characters.
  465. * VKILL: (libc)Editing Characters.
  466. * VLNEXT: (libc)Other Special.
  467. * VMIN: (libc)Noncanonical Input.
  468. * VQUIT: (libc)Signal Characters.
  469. * VREPRINT: (libc)Editing Characters.
  470. * VSTART: (libc)Start/Stop Characters.
  471. * VSTATUS: (libc)Other Special.
  472. * VSTOP: (libc)Start/Stop Characters.
  473. * VSUSP: (libc)Signal Characters.
  474. * VTIME: (libc)Noncanonical Input.
  475. * VWERASE: (libc)Editing Characters.
  476. * WCHAR_MAX: (libc)Extended Char Intro.
  477. * WCHAR_MIN: (libc)Extended Char Intro.
  478. * WCOREDUMP: (libc)Process Completion Status.
  479. * WEOF: (libc)EOF and Errors.
  480. * WEOF: (libc)Extended Char Intro.
  481. * WEXITSTATUS: (libc)Process Completion Status.
  482. * WIFEXITED: (libc)Process Completion Status.
  483. * WIFSIGNALED: (libc)Process Completion Status.
  484. * WIFSTOPPED: (libc)Process Completion Status.
  485. * WSTOPSIG: (libc)Process Completion Status.
  486. * WTERMSIG: (libc)Process Completion Status.
  487. * W_OK: (libc)Testing File Access.
  488. * X_OK: (libc)Testing File Access.
  489. * _Complex_I: (libc)Complex Numbers.
  490. * _Exit: (libc)Termination Internals.
  491. * _Fork: (libc)Creating a Process.
  492. * _IOFBF: (libc)Controlling Buffering.
  493. * _IOLBF: (libc)Controlling Buffering.
  494. * _IONBF: (libc)Controlling Buffering.
  495. * _Imaginary_I: (libc)Complex Numbers.
  496. * _PATH_UTMP: (libc)Manipulating the Database.
  497. * _PATH_WTMP: (libc)Manipulating the Database.
  498. * _POSIX2_C_DEV: (libc)System Options.
  499. * _POSIX2_C_VERSION: (libc)Version Supported.
  500. * _POSIX2_FORT_DEV: (libc)System Options.
  501. * _POSIX2_FORT_RUN: (libc)System Options.
  502. * _POSIX2_LOCALEDEF: (libc)System Options.
  503. * _POSIX2_SW_DEV: (libc)System Options.
  504. * _POSIX_CHOWN_RESTRICTED: (libc)Options for Files.
  505. * _POSIX_JOB_CONTROL: (libc)System Options.
  506. * _POSIX_NO_TRUNC: (libc)Options for Files.
  507. * _POSIX_SAVED_IDS: (libc)System Options.
  508. * _POSIX_VDISABLE: (libc)Options for Files.
  509. * _POSIX_VERSION: (libc)Version Supported.
  510. * __fbufsize: (libc)Controlling Buffering.
  511. * __flbf: (libc)Controlling Buffering.
  512. * __fpending: (libc)Controlling Buffering.
  513. * __fpurge: (libc)Flushing Buffers.
  514. * __freadable: (libc)Opening Streams.
  515. * __freading: (libc)Opening Streams.
  516. * __fsetlocking: (libc)Streams and Threads.
  517. * __fwritable: (libc)Opening Streams.
  518. * __fwriting: (libc)Opening Streams.
  519. * __gconv_end_fct: (libc)glibc iconv Implementation.
  520. * __gconv_fct: (libc)glibc iconv Implementation.
  521. * __gconv_init_fct: (libc)glibc iconv Implementation.
  522. * __ppc_get_timebase: (libc)PowerPC.
  523. * __ppc_get_timebase_freq: (libc)PowerPC.
  524. * __ppc_mdoio: (libc)PowerPC.
  525. * __ppc_mdoom: (libc)PowerPC.
  526. * __ppc_set_ppr_low: (libc)PowerPC.
  527. * __ppc_set_ppr_med: (libc)PowerPC.
  528. * __ppc_set_ppr_med_high: (libc)PowerPC.
  529. * __ppc_set_ppr_med_low: (libc)PowerPC.
  530. * __ppc_set_ppr_very_low: (libc)PowerPC.
  531. * __ppc_yield: (libc)PowerPC.
  532. * __riscv_flush_icache: (libc)RISC-V.
  533. * __va_copy: (libc)Argument Macros.
  534. * __x86_get_cpuid_feature_leaf: (libc)X86.
  535. * _dl_find_object: (libc)Dynamic Linker Introspection.
  536. * _exit: (libc)Termination Internals.
  537. * _flushlbf: (libc)Flushing Buffers.
  538. * _tolower: (libc)Case Conversion.
  539. * _toupper: (libc)Case Conversion.
  540. * a64l: (libc)Encode Binary Data.
  541. * abort: (libc)Aborting a Program.
  542. * abs: (libc)Absolute Value.
  543. * accept: (libc)Accepting Connections.
  544. * access: (libc)Testing File Access.
  545. * acos: (libc)Inverse Trig Functions.
  546. * acosf: (libc)Inverse Trig Functions.
  547. * acosfN: (libc)Inverse Trig Functions.
  548. * acosfNx: (libc)Inverse Trig Functions.
  549. * acosh: (libc)Hyperbolic Functions.
  550. * acoshf: (libc)Hyperbolic Functions.
  551. * acoshfN: (libc)Hyperbolic Functions.
  552. * acoshfNx: (libc)Hyperbolic Functions.
  553. * acoshl: (libc)Hyperbolic Functions.
  554. * acosl: (libc)Inverse Trig Functions.
  555. * acospi: (libc)Inverse Trig Functions.
  556. * acospif: (libc)Inverse Trig Functions.
  557. * acospifN: (libc)Inverse Trig Functions.
  558. * acospifNx: (libc)Inverse Trig Functions.
  559. * acospil: (libc)Inverse Trig Functions.
  560. * addmntent: (libc)mtab.
  561. * addseverity: (libc)Adding Severity Classes.
  562. * adjtime: (libc)Setting and Adjusting the Time.
  563. * adjtimex: (libc)Setting and Adjusting the Time.
  564. * aio_cancel64: (libc)Cancel AIO Operations.
  565. * aio_cancel: (libc)Cancel AIO Operations.
  566. * aio_error64: (libc)Status of AIO Operations.
  567. * aio_error: (libc)Status of AIO Operations.
  568. * aio_fsync64: (libc)Synchronizing AIO Operations.
  569. * aio_fsync: (libc)Synchronizing AIO Operations.
  570. * aio_init: (libc)Configuration of AIO.
  571. * aio_read64: (libc)Asynchronous Reads/Writes.
  572. * aio_read: (libc)Asynchronous Reads/Writes.
  573. * aio_return64: (libc)Status of AIO Operations.
  574. * aio_return: (libc)Status of AIO Operations.
  575. * aio_suspend64: (libc)Synchronizing AIO Operations.
  576. * aio_suspend: (libc)Synchronizing AIO Operations.
  577. * aio_write64: (libc)Asynchronous Reads/Writes.
  578. * aio_write: (libc)Asynchronous Reads/Writes.
  579. * alarm: (libc)Setting an Alarm.
  580. * aligned_alloc: (libc)Aligned Memory Blocks.
  581. * alloca: (libc)Variable Size Automatic.
  582. * alphasort64: (libc)Scanning Directory Content.
  583. * alphasort: (libc)Scanning Directory Content.
  584. * arc4random: (libc)High Quality Random.
  585. * arc4random_buf: (libc)High Quality Random.
  586. * arc4random_uniform: (libc)High Quality Random.
  587. * argp_error: (libc)Argp Helper Functions.
  588. * argp_failure: (libc)Argp Helper Functions.
  589. * argp_help: (libc)Argp Help.
  590. * argp_parse: (libc)Argp.
  591. * argp_state_help: (libc)Argp Helper Functions.
  592. * argp_usage: (libc)Argp Helper Functions.
  593. * argz_add: (libc)Argz Functions.
  594. * argz_add_sep: (libc)Argz Functions.
  595. * argz_append: (libc)Argz Functions.
  596. * argz_count: (libc)Argz Functions.
  597. * argz_create: (libc)Argz Functions.
  598. * argz_create_sep: (libc)Argz Functions.
  599. * argz_delete: (libc)Argz Functions.
  600. * argz_extract: (libc)Argz Functions.
  601. * argz_insert: (libc)Argz Functions.
  602. * argz_next: (libc)Argz Functions.
  603. * argz_replace: (libc)Argz Functions.
  604. * argz_stringify: (libc)Argz Functions.
  605. * asctime: (libc)Formatting Calendar Time.
  606. * asctime_r: (libc)Formatting Calendar Time.
  607. * asin: (libc)Inverse Trig Functions.
  608. * asinf: (libc)Inverse Trig Functions.
  609. * asinfN: (libc)Inverse Trig Functions.
  610. * asinfNx: (libc)Inverse Trig Functions.
  611. * asinh: (libc)Hyperbolic Functions.
  612. * asinhf: (libc)Hyperbolic Functions.
  613. * asinhfN: (libc)Hyperbolic Functions.
  614. * asinhfNx: (libc)Hyperbolic Functions.
  615. * asinhl: (libc)Hyperbolic Functions.
  616. * asinl: (libc)Inverse Trig Functions.
  617. * asinpi: (libc)Inverse Trig Functions.
  618. * asinpif: (libc)Inverse Trig Functions.
  619. * asinpifN: (libc)Inverse Trig Functions.
  620. * asinpifNx: (libc)Inverse Trig Functions.
  621. * asinpil: (libc)Inverse Trig Functions.
  622. * asprintf: (libc)Dynamic Output.
  623. * assert: (libc)Consistency Checking.
  624. * assert_perror: (libc)Consistency Checking.
  625. * atan2: (libc)Inverse Trig Functions.
  626. * atan2f: (libc)Inverse Trig Functions.
  627. * atan2fN: (libc)Inverse Trig Functions.
  628. * atan2fNx: (libc)Inverse Trig Functions.
  629. * atan2l: (libc)Inverse Trig Functions.
  630. * atan2pi: (libc)Inverse Trig Functions.
  631. * atan2pif: (libc)Inverse Trig Functions.
  632. * atan2pifN: (libc)Inverse Trig Functions.
  633. * atan2pifNx: (libc)Inverse Trig Functions.
  634. * atan2pil: (libc)Inverse Trig Functions.
  635. * atan: (libc)Inverse Trig Functions.
  636. * atanf: (libc)Inverse Trig Functions.
  637. * atanfN: (libc)Inverse Trig Functions.
  638. * atanfNx: (libc)Inverse Trig Functions.
  639. * atanh: (libc)Hyperbolic Functions.
  640. * atanhf: (libc)Hyperbolic Functions.
  641. * atanhfN: (libc)Hyperbolic Functions.
  642. * atanhfNx: (libc)Hyperbolic Functions.
  643. * atanhl: (libc)Hyperbolic Functions.
  644. * atanl: (libc)Inverse Trig Functions.
  645. * atanpi: (libc)Inverse Trig Functions.
  646. * atanpif: (libc)Inverse Trig Functions.
  647. * atanpifN: (libc)Inverse Trig Functions.
  648. * atanpifNx: (libc)Inverse Trig Functions.
  649. * atanpil: (libc)Inverse Trig Functions.
  650. * atexit: (libc)Cleanups on Exit.
  651. * atof: (libc)Parsing of Floats.
  652. * atoi: (libc)Parsing of Integers.
  653. * atol: (libc)Parsing of Integers.
  654. * atoll: (libc)Parsing of Integers.
  655. * backtrace: (libc)Backtraces.
  656. * backtrace_symbols: (libc)Backtraces.
  657. * backtrace_symbols_fd: (libc)Backtraces.
  658. * basename: (libc)Finding Tokens in a String.
  659. * basename: (libc)Finding Tokens in a String.
  660. * bcmp: (libc)String/Array Comparison.
  661. * bcopy: (libc)Copying Strings and Arrays.
  662. * bind: (libc)Setting Address.
  663. * bind_textdomain_codeset: (libc)Charset conversion in gettext.
  664. * bindtextdomain: (libc)Locating gettext catalog.
  665. * brk: (libc)Resizing the Data Segment.
  666. * bsearch: (libc)Array Search Function.
  667. * btowc: (libc)Converting a Character.
  668. * bzero: (libc)Copying Strings and Arrays.
  669. * cabs: (libc)Absolute Value.
  670. * cabsf: (libc)Absolute Value.
  671. * cabsfN: (libc)Absolute Value.
  672. * cabsfNx: (libc)Absolute Value.
  673. * cabsl: (libc)Absolute Value.
  674. * cacos: (libc)Inverse Trig Functions.
  675. * cacosf: (libc)Inverse Trig Functions.
  676. * cacosfN: (libc)Inverse Trig Functions.
  677. * cacosfNx: (libc)Inverse Trig Functions.
  678. * cacosh: (libc)Hyperbolic Functions.
  679. * cacoshf: (libc)Hyperbolic Functions.
  680. * cacoshfN: (libc)Hyperbolic Functions.
  681. * cacoshfNx: (libc)Hyperbolic Functions.
  682. * cacoshl: (libc)Hyperbolic Functions.
  683. * cacosl: (libc)Inverse Trig Functions.
  684. * call_once: (libc)Call Once.
  685. * calloc: (libc)Allocating Cleared Space.
  686. * canonicalize: (libc)FP Bit Twiddling.
  687. * canonicalize_file_name: (libc)Symbolic Links.
  688. * canonicalizef: (libc)FP Bit Twiddling.
  689. * canonicalizefN: (libc)FP Bit Twiddling.
  690. * canonicalizefNx: (libc)FP Bit Twiddling.
  691. * canonicalizel: (libc)FP Bit Twiddling.
  692. * carg: (libc)Operations on Complex.
  693. * cargf: (libc)Operations on Complex.
  694. * cargfN: (libc)Operations on Complex.
  695. * cargfNx: (libc)Operations on Complex.
  696. * cargl: (libc)Operations on Complex.
  697. * casin: (libc)Inverse Trig Functions.
  698. * casinf: (libc)Inverse Trig Functions.
  699. * casinfN: (libc)Inverse Trig Functions.
  700. * casinfNx: (libc)Inverse Trig Functions.
  701. * casinh: (libc)Hyperbolic Functions.
  702. * casinhf: (libc)Hyperbolic Functions.
  703. * casinhfN: (libc)Hyperbolic Functions.
  704. * casinhfNx: (libc)Hyperbolic Functions.
  705. * casinhl: (libc)Hyperbolic Functions.
  706. * casinl: (libc)Inverse Trig Functions.
  707. * catan: (libc)Inverse Trig Functions.
  708. * catanf: (libc)Inverse Trig Functions.
  709. * catanfN: (libc)Inverse Trig Functions.
  710. * catanfNx: (libc)Inverse Trig Functions.
  711. * catanh: (libc)Hyperbolic Functions.
  712. * catanhf: (libc)Hyperbolic Functions.
  713. * catanhfN: (libc)Hyperbolic Functions.
  714. * catanhfNx: (libc)Hyperbolic Functions.
  715. * catanhl: (libc)Hyperbolic Functions.
  716. * catanl: (libc)Inverse Trig Functions.
  717. * catclose: (libc)The catgets Functions.
  718. * catgets: (libc)The catgets Functions.
  719. * catopen: (libc)The catgets Functions.
  720. * cbrt: (libc)Exponents and Logarithms.
  721. * cbrtf: (libc)Exponents and Logarithms.
  722. * cbrtfN: (libc)Exponents and Logarithms.
  723. * cbrtfNx: (libc)Exponents and Logarithms.
  724. * cbrtl: (libc)Exponents and Logarithms.
  725. * ccos: (libc)Trig Functions.
  726. * ccosf: (libc)Trig Functions.
  727. * ccosfN: (libc)Trig Functions.
  728. * ccosfNx: (libc)Trig Functions.
  729. * ccosh: (libc)Hyperbolic Functions.
  730. * ccoshf: (libc)Hyperbolic Functions.
  731. * ccoshfN: (libc)Hyperbolic Functions.
  732. * ccoshfNx: (libc)Hyperbolic Functions.
  733. * ccoshl: (libc)Hyperbolic Functions.
  734. * ccosl: (libc)Trig Functions.
  735. * ceil: (libc)Rounding Functions.
  736. * ceilf: (libc)Rounding Functions.
  737. * ceilfN: (libc)Rounding Functions.
  738. * ceilfNx: (libc)Rounding Functions.
  739. * ceill: (libc)Rounding Functions.
  740. * cexp: (libc)Exponents and Logarithms.
  741. * cexpf: (libc)Exponents and Logarithms.
  742. * cexpfN: (libc)Exponents and Logarithms.
  743. * cexpfNx: (libc)Exponents and Logarithms.
  744. * cexpl: (libc)Exponents and Logarithms.
  745. * cfgetibaud: (libc)Line Speed.
  746. * cfgetispeed: (libc)Line Speed.
  747. * cfgetobaud: (libc)Line Speed.
  748. * cfgetospeed: (libc)Line Speed.
  749. * cfmakeraw: (libc)Noncanonical Input.
  750. * cfsetbaud: (libc)Line Speed.
  751. * cfsetibaud: (libc)Line Speed.
  752. * cfsetispeed: (libc)Line Speed.
  753. * cfsetobaud: (libc)Line Speed.
  754. * cfsetospeed: (libc)Line Speed.
  755. * cfsetspeed: (libc)Line Speed.
  756. * chdir: (libc)Working Directory.
  757. * chmod: (libc)Setting Permissions.
  758. * chown: (libc)File Owner.
  759. * cimag: (libc)Operations on Complex.
  760. * cimagf: (libc)Operations on Complex.
  761. * cimagfN: (libc)Operations on Complex.
  762. * cimagfNx: (libc)Operations on Complex.
  763. * cimagl: (libc)Operations on Complex.
  764. * clearenv: (libc)Environment Access.
  765. * clearerr: (libc)Error Recovery.
  766. * clearerr_unlocked: (libc)Error Recovery.
  767. * clock: (libc)CPU Time.
  768. * clock_getres: (libc)Getting the Time.
  769. * clock_gettime: (libc)Getting the Time.
  770. * clock_nanosleep: (libc)Sleeping.
  771. * clock_settime: (libc)Setting and Adjusting the Time.
  772. * clog10: (libc)Exponents and Logarithms.
  773. * clog10f: (libc)Exponents and Logarithms.
  774. * clog10fN: (libc)Exponents and Logarithms.
  775. * clog10fNx: (libc)Exponents and Logarithms.
  776. * clog10l: (libc)Exponents and Logarithms.
  777. * clog: (libc)Exponents and Logarithms.
  778. * clogf: (libc)Exponents and Logarithms.
  779. * clogfN: (libc)Exponents and Logarithms.
  780. * clogfNx: (libc)Exponents and Logarithms.
  781. * clogl: (libc)Exponents and Logarithms.
  782. * close: (libc)Opening and Closing Files.
  783. * close_range: (libc)Opening and Closing Files.
  784. * closedir: (libc)Reading/Closing Directory.
  785. * closefrom: (libc)Opening and Closing Files.
  786. * closelog: (libc)closelog.
  787. * cnd_broadcast: (libc)ISO C Condition Variables.
  788. * cnd_destroy: (libc)ISO C Condition Variables.
  789. * cnd_init: (libc)ISO C Condition Variables.
  790. * cnd_signal: (libc)ISO C Condition Variables.
  791. * cnd_timedwait: (libc)ISO C Condition Variables.
  792. * cnd_wait: (libc)ISO C Condition Variables.
  793. * compoundn: (libc)Exponents and Logarithms.
  794. * compoundnf: (libc)Exponents and Logarithms.
  795. * compoundnfN: (libc)Exponents and Logarithms.
  796. * compoundnfNx: (libc)Exponents and Logarithms.
  797. * compoundnl: (libc)Exponents and Logarithms.
  798. * confstr: (libc)String Parameters.
  799. * conj: (libc)Operations on Complex.
  800. * conjf: (libc)Operations on Complex.
  801. * conjfN: (libc)Operations on Complex.
  802. * conjfNx: (libc)Operations on Complex.
  803. * conjl: (libc)Operations on Complex.
  804. * connect: (libc)Connecting.
  805. * copy_file_range: (libc)Copying File Data.
  806. * copysign: (libc)FP Bit Twiddling.
  807. * copysignf: (libc)FP Bit Twiddling.
  808. * copysignfN: (libc)FP Bit Twiddling.
  809. * copysignfNx: (libc)FP Bit Twiddling.
  810. * copysignl: (libc)FP Bit Twiddling.
  811. * cos: (libc)Trig Functions.
  812. * cosf: (libc)Trig Functions.
  813. * cosfN: (libc)Trig Functions.
  814. * cosfNx: (libc)Trig Functions.
  815. * cosh: (libc)Hyperbolic Functions.
  816. * coshf: (libc)Hyperbolic Functions.
  817. * coshfN: (libc)Hyperbolic Functions.
  818. * coshfNx: (libc)Hyperbolic Functions.
  819. * coshl: (libc)Hyperbolic Functions.
  820. * cosl: (libc)Trig Functions.
  821. * cospi: (libc)Trig Functions.
  822. * cospif: (libc)Trig Functions.
  823. * cospifN: (libc)Trig Functions.
  824. * cospifNx: (libc)Trig Functions.
  825. * cospil: (libc)Trig Functions.
  826. * cpow: (libc)Exponents and Logarithms.
  827. * cpowf: (libc)Exponents and Logarithms.
  828. * cpowfN: (libc)Exponents and Logarithms.
  829. * cpowfNx: (libc)Exponents and Logarithms.
  830. * cpowl: (libc)Exponents and Logarithms.
  831. * cproj: (libc)Operations on Complex.
  832. * cprojf: (libc)Operations on Complex.
  833. * cprojfN: (libc)Operations on Complex.
  834. * cprojfNx: (libc)Operations on Complex.
  835. * cprojl: (libc)Operations on Complex.
  836. * creal: (libc)Operations on Complex.
  837. * crealf: (libc)Operations on Complex.
  838. * crealfN: (libc)Operations on Complex.
  839. * crealfNx: (libc)Operations on Complex.
  840. * creall: (libc)Operations on Complex.
  841. * creat64: (libc)Opening and Closing Files.
  842. * creat: (libc)Opening and Closing Files.
  843. * csin: (libc)Trig Functions.
  844. * csinf: (libc)Trig Functions.
  845. * csinfN: (libc)Trig Functions.
  846. * csinfNx: (libc)Trig Functions.
  847. * csinh: (libc)Hyperbolic Functions.
  848. * csinhf: (libc)Hyperbolic Functions.
  849. * csinhfN: (libc)Hyperbolic Functions.
  850. * csinhfNx: (libc)Hyperbolic Functions.
  851. * csinhl: (libc)Hyperbolic Functions.
  852. * csinl: (libc)Trig Functions.
  853. * csqrt: (libc)Exponents and Logarithms.
  854. * csqrtf: (libc)Exponents and Logarithms.
  855. * csqrtfN: (libc)Exponents and Logarithms.
  856. * csqrtfNx: (libc)Exponents and Logarithms.
  857. * csqrtl: (libc)Exponents and Logarithms.
  858. * ctan: (libc)Trig Functions.
  859. * ctanf: (libc)Trig Functions.
  860. * ctanfN: (libc)Trig Functions.
  861. * ctanfNx: (libc)Trig Functions.
  862. * ctanh: (libc)Hyperbolic Functions.
  863. * ctanhf: (libc)Hyperbolic Functions.
  864. * ctanhfN: (libc)Hyperbolic Functions.
  865. * ctanhfNx: (libc)Hyperbolic Functions.
  866. * ctanhl: (libc)Hyperbolic Functions.
  867. * ctanl: (libc)Trig Functions.
  868. * ctermid: (libc)Identifying the Terminal.
  869. * ctime: (libc)Formatting Calendar Time.
  870. * ctime_r: (libc)Formatting Calendar Time.
  871. * cuserid: (libc)Who Logged In.
  872. * daddl: (libc)Misc FP Arithmetic.
  873. * dcgettext: (libc)Translation with gettext.
  874. * dcngettext: (libc)Advanced gettext functions.
  875. * ddivl: (libc)Misc FP Arithmetic.
  876. * dfmal: (libc)Misc FP Arithmetic.
  877. * dgettext: (libc)Translation with gettext.
  878. * difftime: (libc)Calculating Elapsed Time.
  879. * dirfd: (libc)Opening a Directory.
  880. * dirname: (libc)Finding Tokens in a String.
  881. * div: (libc)Integer Division.
  882. * dlinfo: (libc)Dynamic Linker Introspection.
  883. * dmull: (libc)Misc FP Arithmetic.
  884. * dngettext: (libc)Advanced gettext functions.
  885. * dprintf: (libc)Formatted Output Functions.
  886. * drand48: (libc)SVID Random.
  887. * drand48_r: (libc)SVID Random.
  888. * drem: (libc)Remainder Functions.
  889. * dremf: (libc)Remainder Functions.
  890. * dreml: (libc)Remainder Functions.
  891. * dsqrtl: (libc)Misc FP Arithmetic.
  892. * dsubl: (libc)Misc FP Arithmetic.
  893. * dup2: (libc)Duplicating Descriptors.
  894. * dup3: (libc)Duplicating Descriptors.
  895. * dup: (libc)Duplicating Descriptors.
  896. * ecvt: (libc)System V Number Conversion.
  897. * ecvt_r: (libc)System V Number Conversion.
  898. * endfsent: (libc)fstab.
  899. * endgrent: (libc)Scanning All Groups.
  900. * endhostent: (libc)Host Names.
  901. * endmntent: (libc)mtab.
  902. * endnetent: (libc)Networks Database.
  903. * endnetgrent: (libc)Lookup Netgroup.
  904. * endprotoent: (libc)Protocols Database.
  905. * endpwent: (libc)Scanning All Users.
  906. * endservent: (libc)Services Database.
  907. * endutent: (libc)Manipulating the Database.
  908. * endutxent: (libc)XPG Functions.
  909. * envz_add: (libc)Envz Functions.
  910. * envz_entry: (libc)Envz Functions.
  911. * envz_get: (libc)Envz Functions.
  912. * envz_merge: (libc)Envz Functions.
  913. * envz_remove: (libc)Envz Functions.
  914. * envz_strip: (libc)Envz Functions.
  915. * epoll_create: (libc)Other Low-Level I/O APIs.
  916. * epoll_wait: (libc)Other Low-Level I/O APIs.
  917. * erand48: (libc)SVID Random.
  918. * erand48_r: (libc)SVID Random.
  919. * erf: (libc)Special Functions.
  920. * erfc: (libc)Special Functions.
  921. * erfcf: (libc)Special Functions.
  922. * erfcfN: (libc)Special Functions.
  923. * erfcfNx: (libc)Special Functions.
  924. * erfcl: (libc)Special Functions.
  925. * erff: (libc)Special Functions.
  926. * erffN: (libc)Special Functions.
  927. * erffNx: (libc)Special Functions.
  928. * erfl: (libc)Special Functions.
  929. * err: (libc)Error Messages.
  930. * errno: (libc)Checking for Errors.
  931. * error: (libc)Error Messages.
  932. * error_at_line: (libc)Error Messages.
  933. * errx: (libc)Error Messages.
  934. * execl: (libc)Executing a File.
  935. * execle: (libc)Executing a File.
  936. * execlp: (libc)Executing a File.
  937. * execv: (libc)Executing a File.
  938. * execve: (libc)Executing a File.
  939. * execvp: (libc)Executing a File.
  940. * exit: (libc)Normal Termination.
  941. * exp10: (libc)Exponents and Logarithms.
  942. * exp10f: (libc)Exponents and Logarithms.
  943. * exp10fN: (libc)Exponents and Logarithms.
  944. * exp10fNx: (libc)Exponents and Logarithms.
  945. * exp10l: (libc)Exponents and Logarithms.
  946. * exp10m1: (libc)Exponents and Logarithms.
  947. * exp10m1f: (libc)Exponents and Logarithms.
  948. * exp10m1fN: (libc)Exponents and Logarithms.
  949. * exp10m1fNx: (libc)Exponents and Logarithms.
  950. * exp10m1l: (libc)Exponents and Logarithms.
  951. * exp2: (libc)Exponents and Logarithms.
  952. * exp2f: (libc)Exponents and Logarithms.
  953. * exp2fN: (libc)Exponents and Logarithms.
  954. * exp2fNx: (libc)Exponents and Logarithms.
  955. * exp2l: (libc)Exponents and Logarithms.
  956. * exp2m1: (libc)Exponents and Logarithms.
  957. * exp2m1f: (libc)Exponents and Logarithms.
  958. * exp2m1fN: (libc)Exponents and Logarithms.
  959. * exp2m1fNx: (libc)Exponents and Logarithms.
  960. * exp2m1l: (libc)Exponents and Logarithms.
  961. * exp: (libc)Exponents and Logarithms.
  962. * expf: (libc)Exponents and Logarithms.
  963. * expfN: (libc)Exponents and Logarithms.
  964. * expfNx: (libc)Exponents and Logarithms.
  965. * expl: (libc)Exponents and Logarithms.
  966. * explicit_bzero: (libc)Erasing Sensitive Data.
  967. * expm1: (libc)Exponents and Logarithms.
  968. * expm1f: (libc)Exponents and Logarithms.
  969. * expm1fN: (libc)Exponents and Logarithms.
  970. * expm1fNx: (libc)Exponents and Logarithms.
  971. * expm1l: (libc)Exponents and Logarithms.
  972. * fMaddfN: (libc)Misc FP Arithmetic.
  973. * fMaddfNx: (libc)Misc FP Arithmetic.
  974. * fMdivfN: (libc)Misc FP Arithmetic.
  975. * fMdivfNx: (libc)Misc FP Arithmetic.
  976. * fMfmafN: (libc)Misc FP Arithmetic.
  977. * fMfmafNx: (libc)Misc FP Arithmetic.
  978. * fMmulfN: (libc)Misc FP Arithmetic.
  979. * fMmulfNx: (libc)Misc FP Arithmetic.
  980. * fMsqrtfN: (libc)Misc FP Arithmetic.
  981. * fMsqrtfNx: (libc)Misc FP Arithmetic.
  982. * fMsubfN: (libc)Misc FP Arithmetic.
  983. * fMsubfNx: (libc)Misc FP Arithmetic.
  984. * fMxaddfN: (libc)Misc FP Arithmetic.
  985. * fMxaddfNx: (libc)Misc FP Arithmetic.
  986. * fMxdivfN: (libc)Misc FP Arithmetic.
  987. * fMxdivfNx: (libc)Misc FP Arithmetic.
  988. * fMxfmafN: (libc)Misc FP Arithmetic.
  989. * fMxfmafNx: (libc)Misc FP Arithmetic.
  990. * fMxmulfN: (libc)Misc FP Arithmetic.
  991. * fMxmulfNx: (libc)Misc FP Arithmetic.
  992. * fMxsqrtfN: (libc)Misc FP Arithmetic.
  993. * fMxsqrtfNx: (libc)Misc FP Arithmetic.
  994. * fMxsubfN: (libc)Misc FP Arithmetic.
  995. * fMxsubfNx: (libc)Misc FP Arithmetic.
  996. * fabs: (libc)Absolute Value.
  997. * fabsf: (libc)Absolute Value.
  998. * fabsfN: (libc)Absolute Value.
  999. * fabsfNx: (libc)Absolute Value.
  1000. * fabsl: (libc)Absolute Value.
  1001. * faccessat: (libc)Testing File Access.
  1002. * fadd: (libc)Misc FP Arithmetic.
  1003. * faddl: (libc)Misc FP Arithmetic.
  1004. * fchdir: (libc)Working Directory.
  1005. * fchmod: (libc)Setting Permissions.
  1006. * fchown: (libc)File Owner.
  1007. * fclose: (libc)Closing Streams.
  1008. * fcloseall: (libc)Closing Streams.
  1009. * fcntl: (libc)Control Operations.
  1010. * fcvt: (libc)System V Number Conversion.
  1011. * fcvt_r: (libc)System V Number Conversion.
  1012. * fdatasync: (libc)Synchronizing I/O.
  1013. * fdim: (libc)Misc FP Arithmetic.
  1014. * fdimf: (libc)Misc FP Arithmetic.
  1015. * fdimfN: (libc)Misc FP Arithmetic.
  1016. * fdimfNx: (libc)Misc FP Arithmetic.
  1017. * fdiml: (libc)Misc FP Arithmetic.
  1018. * fdiv: (libc)Misc FP Arithmetic.
  1019. * fdivl: (libc)Misc FP Arithmetic.
  1020. * fdopen: (libc)Descriptors and Streams.
  1021. * fdopendir: (libc)Opening a Directory.
  1022. * feclearexcept: (libc)Status bit operations.
  1023. * fedisableexcept: (libc)Control Functions.
  1024. * feenableexcept: (libc)Control Functions.
  1025. * fegetenv: (libc)Control Functions.
  1026. * fegetexcept: (libc)Control Functions.
  1027. * fegetexceptflag: (libc)Status bit operations.
  1028. * fegetmode: (libc)Control Functions.
  1029. * fegetround: (libc)Rounding.
  1030. * feholdexcept: (libc)Control Functions.
  1031. * feof: (libc)EOF and Errors.
  1032. * feof_unlocked: (libc)EOF and Errors.
  1033. * feraiseexcept: (libc)Status bit operations.
  1034. * ferror: (libc)EOF and Errors.
  1035. * ferror_unlocked: (libc)EOF and Errors.
  1036. * fesetenv: (libc)Control Functions.
  1037. * fesetexcept: (libc)Status bit operations.
  1038. * fesetexceptflag: (libc)Status bit operations.
  1039. * fesetmode: (libc)Control Functions.
  1040. * fesetround: (libc)Rounding.
  1041. * fetestexcept: (libc)Status bit operations.
  1042. * fetestexceptflag: (libc)Status bit operations.
  1043. * feupdateenv: (libc)Control Functions.
  1044. * fexecve: (libc)Executing a File.
  1045. * fflush: (libc)Flushing Buffers.
  1046. * fflush_unlocked: (libc)Flushing Buffers.
  1047. * ffma: (libc)Misc FP Arithmetic.
  1048. * ffmal: (libc)Misc FP Arithmetic.
  1049. * fgetc: (libc)Character Input.
  1050. * fgetc_unlocked: (libc)Character Input.
  1051. * fgetgrent: (libc)Scanning All Groups.
  1052. * fgetgrent_r: (libc)Scanning All Groups.
  1053. * fgetpos64: (libc)Portable Positioning.
  1054. * fgetpos: (libc)Portable Positioning.
  1055. * fgetpwent: (libc)Scanning All Users.
  1056. * fgetpwent_r: (libc)Scanning All Users.
  1057. * fgets: (libc)Line Input.
  1058. * fgets_unlocked: (libc)Line Input.
  1059. * fgetwc: (libc)Character Input.
  1060. * fgetwc_unlocked: (libc)Character Input.
  1061. * fgetws: (libc)Line Input.
  1062. * fgetws_unlocked: (libc)Line Input.
  1063. * fileno: (libc)Descriptors and Streams.
  1064. * fileno_unlocked: (libc)Descriptors and Streams.
  1065. * finite: (libc)Floating Point Classes.
  1066. * finitef: (libc)Floating Point Classes.
  1067. * finitel: (libc)Floating Point Classes.
  1068. * flockfile: (libc)Streams and Threads.
  1069. * floor: (libc)Rounding Functions.
  1070. * floorf: (libc)Rounding Functions.
  1071. * floorfN: (libc)Rounding Functions.
  1072. * floorfNx: (libc)Rounding Functions.
  1073. * floorl: (libc)Rounding Functions.
  1074. * fma: (libc)Misc FP Arithmetic.
  1075. * fmaf: (libc)Misc FP Arithmetic.
  1076. * fmafN: (libc)Misc FP Arithmetic.
  1077. * fmafNx: (libc)Misc FP Arithmetic.
  1078. * fmal: (libc)Misc FP Arithmetic.
  1079. * fmax: (libc)Misc FP Arithmetic.
  1080. * fmaxf: (libc)Misc FP Arithmetic.
  1081. * fmaxfN: (libc)Misc FP Arithmetic.
  1082. * fmaxfNx: (libc)Misc FP Arithmetic.
  1083. * fmaximum: (libc)Misc FP Arithmetic.
  1084. * fmaximum_mag: (libc)Misc FP Arithmetic.
  1085. * fmaximum_mag_num: (libc)Misc FP Arithmetic.
  1086. * fmaximum_mag_numf: (libc)Misc FP Arithmetic.
  1087. * fmaximum_mag_numfN: (libc)Misc FP Arithmetic.
  1088. * fmaximum_mag_numfNx: (libc)Misc FP Arithmetic.
  1089. * fmaximum_mag_numl: (libc)Misc FP Arithmetic.
  1090. * fmaximum_magf: (libc)Misc FP Arithmetic.
  1091. * fmaximum_magfN: (libc)Misc FP Arithmetic.
  1092. * fmaximum_magfNx: (libc)Misc FP Arithmetic.
  1093. * fmaximum_magl: (libc)Misc FP Arithmetic.
  1094. * fmaximum_num: (libc)Misc FP Arithmetic.
  1095. * fmaximum_numf: (libc)Misc FP Arithmetic.
  1096. * fmaximum_numfN: (libc)Misc FP Arithmetic.
  1097. * fmaximum_numfNx: (libc)Misc FP Arithmetic.
  1098. * fmaximum_numl: (libc)Misc FP Arithmetic.
  1099. * fmaximumf: (libc)Misc FP Arithmetic.
  1100. * fmaximumfN: (libc)Misc FP Arithmetic.
  1101. * fmaximumfNx: (libc)Misc FP Arithmetic.
  1102. * fmaximuml: (libc)Misc FP Arithmetic.
  1103. * fmaxl: (libc)Misc FP Arithmetic.
  1104. * fmaxmag: (libc)Misc FP Arithmetic.
  1105. * fmaxmagf: (libc)Misc FP Arithmetic.
  1106. * fmaxmagfN: (libc)Misc FP Arithmetic.
  1107. * fmaxmagfNx: (libc)Misc FP Arithmetic.
  1108. * fmaxmagl: (libc)Misc FP Arithmetic.
  1109. * fmemopen: (libc)String Streams.
  1110. * fmin: (libc)Misc FP Arithmetic.
  1111. * fminf: (libc)Misc FP Arithmetic.
  1112. * fminfN: (libc)Misc FP Arithmetic.
  1113. * fminfNx: (libc)Misc FP Arithmetic.
  1114. * fminimum: (libc)Misc FP Arithmetic.
  1115. * fminimum_mag: (libc)Misc FP Arithmetic.
  1116. * fminimum_mag_num: (libc)Misc FP Arithmetic.
  1117. * fminimum_mag_numf: (libc)Misc FP Arithmetic.
  1118. * fminimum_mag_numfN: (libc)Misc FP Arithmetic.
  1119. * fminimum_mag_numfNx: (libc)Misc FP Arithmetic.
  1120. * fminimum_mag_numl: (libc)Misc FP Arithmetic.
  1121. * fminimum_magf: (libc)Misc FP Arithmetic.
  1122. * fminimum_magfN: (libc)Misc FP Arithmetic.
  1123. * fminimum_magfNx: (libc)Misc FP Arithmetic.
  1124. * fminimum_magl: (libc)Misc FP Arithmetic.
  1125. * fminimum_num: (libc)Misc FP Arithmetic.
  1126. * fminimum_numf: (libc)Misc FP Arithmetic.
  1127. * fminimum_numfN: (libc)Misc FP Arithmetic.
  1128. * fminimum_numfNx: (libc)Misc FP Arithmetic.
  1129. * fminimum_numl: (libc)Misc FP Arithmetic.
  1130. * fminimumf: (libc)Misc FP Arithmetic.
  1131. * fminimumfN: (libc)Misc FP Arithmetic.
  1132. * fminimumfNx: (libc)Misc FP Arithmetic.
  1133. * fminimuml: (libc)Misc FP Arithmetic.
  1134. * fminl: (libc)Misc FP Arithmetic.
  1135. * fminmag: (libc)Misc FP Arithmetic.
  1136. * fminmagf: (libc)Misc FP Arithmetic.
  1137. * fminmagfN: (libc)Misc FP Arithmetic.
  1138. * fminmagfNx: (libc)Misc FP Arithmetic.
  1139. * fminmagl: (libc)Misc FP Arithmetic.
  1140. * fmod: (libc)Remainder Functions.
  1141. * fmodf: (libc)Remainder Functions.
  1142. * fmodfN: (libc)Remainder Functions.
  1143. * fmodfNx: (libc)Remainder Functions.
  1144. * fmodl: (libc)Remainder Functions.
  1145. * fmtmsg: (libc)Printing Formatted Messages.
  1146. * fmul: (libc)Misc FP Arithmetic.
  1147. * fmull: (libc)Misc FP Arithmetic.
  1148. * fnmatch: (libc)Wildcard Matching.
  1149. * fopen64: (libc)Opening Streams.
  1150. * fopen: (libc)Opening Streams.
  1151. * fopencookie: (libc)Streams and Cookies.
  1152. * fork: (libc)Creating a Process.
  1153. * forkpty: (libc)Pseudo-Terminal Pairs.
  1154. * fpathconf: (libc)Pathconf.
  1155. * fpclassify: (libc)Floating Point Classes.
  1156. * fprintf: (libc)Formatted Output Functions.
  1157. * fputc: (libc)Simple Output.
  1158. * fputc_unlocked: (libc)Simple Output.
  1159. * fputs: (libc)Simple Output.
  1160. * fputs_unlocked: (libc)Simple Output.
  1161. * fputwc: (libc)Simple Output.
  1162. * fputwc_unlocked: (libc)Simple Output.
  1163. * fputws: (libc)Simple Output.
  1164. * fputws_unlocked: (libc)Simple Output.
  1165. * fread: (libc)Block Input/Output.
  1166. * fread_unlocked: (libc)Block Input/Output.
  1167. * free: (libc)Freeing after Malloc.
  1168. * free_aligned_sized: (libc)Freeing after Malloc.
  1169. * free_sized: (libc)Freeing after Malloc.
  1170. * freopen64: (libc)Opening Streams.
  1171. * freopen: (libc)Opening Streams.
  1172. * frexp: (libc)Normalization Functions.
  1173. * frexpf: (libc)Normalization Functions.
  1174. * frexpfN: (libc)Normalization Functions.
  1175. * frexpfNx: (libc)Normalization Functions.
  1176. * frexpl: (libc)Normalization Functions.
  1177. * fromfp: (libc)Rounding Functions.
  1178. * fromfpf: (libc)Rounding Functions.
  1179. * fromfpfN: (libc)Rounding Functions.
  1180. * fromfpfNx: (libc)Rounding Functions.
  1181. * fromfpl: (libc)Rounding Functions.
  1182. * fromfpx: (libc)Rounding Functions.
  1183. * fromfpxf: (libc)Rounding Functions.
  1184. * fromfpxfN: (libc)Rounding Functions.
  1185. * fromfpxfNx: (libc)Rounding Functions.
  1186. * fromfpxl: (libc)Rounding Functions.
  1187. * fscanf: (libc)Formatted Input Functions.
  1188. * fseek: (libc)File Positioning.
  1189. * fseeko64: (libc)File Positioning.
  1190. * fseeko: (libc)File Positioning.
  1191. * fsetpos64: (libc)Portable Positioning.
  1192. * fsetpos: (libc)Portable Positioning.
  1193. * fsqrt: (libc)Misc FP Arithmetic.
  1194. * fsqrtl: (libc)Misc FP Arithmetic.
  1195. * fstat64: (libc)Reading Attributes.
  1196. * fstat: (libc)Reading Attributes.
  1197. * fstatat64: (libc)Reading Attributes.
  1198. * fstatat: (libc)Reading Attributes.
  1199. * fsub: (libc)Misc FP Arithmetic.
  1200. * fsubl: (libc)Misc FP Arithmetic.
  1201. * fsync: (libc)Synchronizing I/O.
  1202. * ftell: (libc)File Positioning.
  1203. * ftello64: (libc)File Positioning.
  1204. * ftello: (libc)File Positioning.
  1205. * ftruncate64: (libc)File Size.
  1206. * ftruncate: (libc)File Size.
  1207. * ftrylockfile: (libc)Streams and Threads.
  1208. * ftw64: (libc)Working with Directory Trees.
  1209. * ftw: (libc)Working with Directory Trees.
  1210. * funlockfile: (libc)Streams and Threads.
  1211. * futimens: (libc)File Times.
  1212. * futimes: (libc)File Times.
  1213. * fwide: (libc)Streams and I18N.
  1214. * fwprintf: (libc)Formatted Output Functions.
  1215. * fwrite: (libc)Block Input/Output.
  1216. * fwrite_unlocked: (libc)Block Input/Output.
  1217. * fwscanf: (libc)Formatted Input Functions.
  1218. * gamma: (libc)Special Functions.
  1219. * gammaf: (libc)Special Functions.
  1220. * gammal: (libc)Special Functions.
  1221. * gcvt: (libc)System V Number Conversion.
  1222. * get_avphys_pages: (libc)Query Memory Parameters.
  1223. * get_current_dir_name: (libc)Working Directory.
  1224. * get_nprocs: (libc)Processor Resources.
  1225. * get_nprocs_conf: (libc)Processor Resources.
  1226. * get_phys_pages: (libc)Query Memory Parameters.
  1227. * getauxval: (libc)Auxiliary Vector.
  1228. * getc: (libc)Character Input.
  1229. * getc_unlocked: (libc)Character Input.
  1230. * getchar: (libc)Character Input.
  1231. * getchar_unlocked: (libc)Character Input.
  1232. * getcontext: (libc)System V contexts.
  1233. * getcpu: (libc)CPU Affinity.
  1234. * getcwd: (libc)Working Directory.
  1235. * getdate: (libc)General Time String Parsing.
  1236. * getdate_r: (libc)General Time String Parsing.
  1237. * getdelim: (libc)Line Input.
  1238. * getdents64: (libc)Low-level Directory Access.
  1239. * getdomainname: (libc)Host Identification.
  1240. * getegid: (libc)Reading Persona.
  1241. * getentropy: (libc)Unpredictable Bytes.
  1242. * getenv: (libc)Environment Access.
  1243. * geteuid: (libc)Reading Persona.
  1244. * getfsent: (libc)fstab.
  1245. * getfsfile: (libc)fstab.
  1246. * getfsspec: (libc)fstab.
  1247. * getgid: (libc)Reading Persona.
  1248. * getgrent: (libc)Scanning All Groups.
  1249. * getgrent_r: (libc)Scanning All Groups.
  1250. * getgrgid: (libc)Lookup Group.
  1251. * getgrgid_r: (libc)Lookup Group.
  1252. * getgrnam: (libc)Lookup Group.
  1253. * getgrnam_r: (libc)Lookup Group.
  1254. * getgrouplist: (libc)Setting Groups.
  1255. * getgroups: (libc)Reading Persona.
  1256. * gethostbyaddr: (libc)Host Names.
  1257. * gethostbyaddr_r: (libc)Host Names.
  1258. * gethostbyname2: (libc)Host Names.
  1259. * gethostbyname2_r: (libc)Host Names.
  1260. * gethostbyname: (libc)Host Names.
  1261. * gethostbyname_r: (libc)Host Names.
  1262. * gethostent: (libc)Host Names.
  1263. * gethostid: (libc)Host Identification.
  1264. * gethostname: (libc)Host Identification.
  1265. * getitimer: (libc)Setting an Alarm.
  1266. * getline: (libc)Line Input.
  1267. * getloadavg: (libc)Processor Resources.
  1268. * getlogin: (libc)Who Logged In.
  1269. * getmntent: (libc)mtab.
  1270. * getmntent_r: (libc)mtab.
  1271. * getnetbyaddr: (libc)Networks Database.
  1272. * getnetbyname: (libc)Networks Database.
  1273. * getnetent: (libc)Networks Database.
  1274. * getnetgrent: (libc)Lookup Netgroup.
  1275. * getnetgrent_r: (libc)Lookup Netgroup.
  1276. * getopt: (libc)Using Getopt.
  1277. * getopt_long: (libc)Getopt Long Options.
  1278. * getopt_long_only: (libc)Getopt Long Options.
  1279. * getpagesize: (libc)Query Memory Parameters.
  1280. * getpass: (libc)getpass.
  1281. * getpayload: (libc)FP Bit Twiddling.
  1282. * getpayloadf: (libc)FP Bit Twiddling.
  1283. * getpayloadfN: (libc)FP Bit Twiddling.
  1284. * getpayloadfNx: (libc)FP Bit Twiddling.
  1285. * getpayloadl: (libc)FP Bit Twiddling.
  1286. * getpeername: (libc)Who is Connected.
  1287. * getpgid: (libc)Process Group Functions.
  1288. * getpgrp: (libc)Process Group Functions.
  1289. * getpid: (libc)Process Identification.
  1290. * getppid: (libc)Process Identification.
  1291. * getpriority: (libc)Traditional Scheduling Functions.
  1292. * getprotobyname: (libc)Protocols Database.
  1293. * getprotobynumber: (libc)Protocols Database.
  1294. * getprotoent: (libc)Protocols Database.
  1295. * getpt: (libc)Allocation.
  1296. * getpwent: (libc)Scanning All Users.
  1297. * getpwent_r: (libc)Scanning All Users.
  1298. * getpwnam: (libc)Lookup User.
  1299. * getpwnam_r: (libc)Lookup User.
  1300. * getpwuid: (libc)Lookup User.
  1301. * getpwuid_r: (libc)Lookup User.
  1302. * getrandom: (libc)Unpredictable Bytes.
  1303. * getrlimit64: (libc)Limits on Resources.
  1304. * getrlimit: (libc)Limits on Resources.
  1305. * getrusage: (libc)Resource Usage.
  1306. * gets: (libc)Line Input.
  1307. * getservbyname: (libc)Services Database.
  1308. * getservbyport: (libc)Services Database.
  1309. * getservent: (libc)Services Database.
  1310. * getsid: (libc)Process Group Functions.
  1311. * getsockname: (libc)Reading Address.
  1312. * getsockopt: (libc)Socket Option Functions.
  1313. * getsubopt: (libc)Suboptions.
  1314. * gettext: (libc)Translation with gettext.
  1315. * gettid: (libc)Process Identification.
  1316. * gettimeofday: (libc)Getting the Time.
  1317. * getuid: (libc)Reading Persona.
  1318. * getumask: (libc)Setting Permissions.
  1319. * getutent: (libc)Manipulating the Database.
  1320. * getutent_r: (libc)Manipulating the Database.
  1321. * getutid: (libc)Manipulating the Database.
  1322. * getutid_r: (libc)Manipulating the Database.
  1323. * getutline: (libc)Manipulating the Database.
  1324. * getutline_r: (libc)Manipulating the Database.
  1325. * getutmp: (libc)XPG Functions.
  1326. * getutmpx: (libc)XPG Functions.
  1327. * getutxent: (libc)XPG Functions.
  1328. * getutxid: (libc)XPG Functions.
  1329. * getutxline: (libc)XPG Functions.
  1330. * getw: (libc)Character Input.
  1331. * getwc: (libc)Character Input.
  1332. * getwc_unlocked: (libc)Character Input.
  1333. * getwchar: (libc)Character Input.
  1334. * getwchar_unlocked: (libc)Character Input.
  1335. * getwd: (libc)Working Directory.
  1336. * glob64: (libc)Calling Glob.
  1337. * glob: (libc)Calling Glob.
  1338. * globfree64: (libc)More Flags for Globbing.
  1339. * globfree: (libc)More Flags for Globbing.
  1340. * gmtime: (libc)Broken-down Time.
  1341. * gmtime_r: (libc)Broken-down Time.
  1342. * grantpt: (libc)Allocation.
  1343. * gsignal: (libc)Signaling Yourself.
  1344. * gtty: (libc)BSD Terminal Modes.
  1345. * hasmntopt: (libc)mtab.
  1346. * hcreate: (libc)Hash Search Function.
  1347. * hcreate_r: (libc)Hash Search Function.
  1348. * hdestroy: (libc)Hash Search Function.
  1349. * hdestroy_r: (libc)Hash Search Function.
  1350. * hsearch: (libc)Hash Search Function.
  1351. * hsearch_r: (libc)Hash Search Function.
  1352. * htonl: (libc)Byte Order.
  1353. * htons: (libc)Byte Order.
  1354. * hypot: (libc)Exponents and Logarithms.
  1355. * hypotf: (libc)Exponents and Logarithms.
  1356. * hypotfN: (libc)Exponents and Logarithms.
  1357. * hypotfNx: (libc)Exponents and Logarithms.
  1358. * hypotl: (libc)Exponents and Logarithms.
  1359. * iconv: (libc)Generic Conversion Interface.
  1360. * iconv_close: (libc)Generic Conversion Interface.
  1361. * iconv_open: (libc)Generic Conversion Interface.
  1362. * if_freenameindex: (libc)Interface Naming.
  1363. * if_indextoname: (libc)Interface Naming.
  1364. * if_nameindex: (libc)Interface Naming.
  1365. * if_nametoindex: (libc)Interface Naming.
  1366. * ilogb: (libc)Exponents and Logarithms.
  1367. * ilogbf: (libc)Exponents and Logarithms.
  1368. * ilogbfN: (libc)Exponents and Logarithms.
  1369. * ilogbfNx: (libc)Exponents and Logarithms.
  1370. * ilogbl: (libc)Exponents and Logarithms.
  1371. * imaxabs: (libc)Absolute Value.
  1372. * imaxdiv: (libc)Integer Division.
  1373. * in6addr_any: (libc)Host Address Data Type.
  1374. * in6addr_loopback: (libc)Host Address Data Type.
  1375. * index: (libc)Search Functions.
  1376. * inet_addr: (libc)Host Address Functions.
  1377. * inet_aton: (libc)Host Address Functions.
  1378. * inet_lnaof: (libc)Host Address Functions.
  1379. * inet_makeaddr: (libc)Host Address Functions.
  1380. * inet_netof: (libc)Host Address Functions.
  1381. * inet_network: (libc)Host Address Functions.
  1382. * inet_ntoa: (libc)Host Address Functions.
  1383. * inet_ntop: (libc)Host Address Functions.
  1384. * inet_pton: (libc)Host Address Functions.
  1385. * initgroups: (libc)Setting Groups.
  1386. * initstate: (libc)BSD Random.
  1387. * initstate_r: (libc)BSD Random.
  1388. * innetgr: (libc)Netgroup Membership.
  1389. * ioctl: (libc)IOCTLs.
  1390. * isalnum: (libc)Classification of Characters.
  1391. * isalpha: (libc)Classification of Characters.
  1392. * isascii: (libc)Classification of Characters.
  1393. * isatty: (libc)Is It a Terminal.
  1394. * isblank: (libc)Classification of Characters.
  1395. * iscanonical: (libc)Floating Point Classes.
  1396. * iscntrl: (libc)Classification of Characters.
  1397. * isdigit: (libc)Classification of Characters.
  1398. * iseqsig: (libc)FP Comparison Functions.
  1399. * isfinite: (libc)Floating Point Classes.
  1400. * isgraph: (libc)Classification of Characters.
  1401. * isgreater: (libc)FP Comparison Functions.
  1402. * isgreaterequal: (libc)FP Comparison Functions.
  1403. * isinf: (libc)Floating Point Classes.
  1404. * isinff: (libc)Floating Point Classes.
  1405. * isinfl: (libc)Floating Point Classes.
  1406. * isless: (libc)FP Comparison Functions.
  1407. * islessequal: (libc)FP Comparison Functions.
  1408. * islessgreater: (libc)FP Comparison Functions.
  1409. * islower: (libc)Classification of Characters.
  1410. * isnan: (libc)Floating Point Classes.
  1411. * isnan: (libc)Floating Point Classes.
  1412. * isnanf: (libc)Floating Point Classes.
  1413. * isnanl: (libc)Floating Point Classes.
  1414. * isnormal: (libc)Floating Point Classes.
  1415. * isprint: (libc)Classification of Characters.
  1416. * ispunct: (libc)Classification of Characters.
  1417. * issignaling: (libc)Floating Point Classes.
  1418. * isspace: (libc)Classification of Characters.
  1419. * issubnormal: (libc)Floating Point Classes.
  1420. * isunordered: (libc)FP Comparison Functions.
  1421. * isupper: (libc)Classification of Characters.
  1422. * iswalnum: (libc)Classification of Wide Characters.
  1423. * iswalpha: (libc)Classification of Wide Characters.
  1424. * iswblank: (libc)Classification of Wide Characters.
  1425. * iswcntrl: (libc)Classification of Wide Characters.
  1426. * iswctype: (libc)Classification of Wide Characters.
  1427. * iswdigit: (libc)Classification of Wide Characters.
  1428. * iswgraph: (libc)Classification of Wide Characters.
  1429. * iswlower: (libc)Classification of Wide Characters.
  1430. * iswprint: (libc)Classification of Wide Characters.
  1431. * iswpunct: (libc)Classification of Wide Characters.
  1432. * iswspace: (libc)Classification of Wide Characters.
  1433. * iswupper: (libc)Classification of Wide Characters.
  1434. * iswxdigit: (libc)Classification of Wide Characters.
  1435. * isxdigit: (libc)Classification of Characters.
  1436. * iszero: (libc)Floating Point Classes.
  1437. * j0: (libc)Special Functions.
  1438. * j0f: (libc)Special Functions.
  1439. * j0fN: (libc)Special Functions.
  1440. * j0fNx: (libc)Special Functions.
  1441. * j0l: (libc)Special Functions.
  1442. * j1: (libc)Special Functions.
  1443. * j1f: (libc)Special Functions.
  1444. * j1fN: (libc)Special Functions.
  1445. * j1fNx: (libc)Special Functions.
  1446. * j1l: (libc)Special Functions.
  1447. * jn: (libc)Special Functions.
  1448. * jnf: (libc)Special Functions.
  1449. * jnfN: (libc)Special Functions.
  1450. * jnfNx: (libc)Special Functions.
  1451. * jnl: (libc)Special Functions.
  1452. * jrand48: (libc)SVID Random.
  1453. * jrand48_r: (libc)SVID Random.
  1454. * kill: (libc)Signaling Another Process.
  1455. * killpg: (libc)Signaling Another Process.
  1456. * l64a: (libc)Encode Binary Data.
  1457. * labs: (libc)Absolute Value.
  1458. * lcong48: (libc)SVID Random.
  1459. * lcong48_r: (libc)SVID Random.
  1460. * ldexp: (libc)Normalization Functions.
  1461. * ldexpf: (libc)Normalization Functions.
  1462. * ldexpfN: (libc)Normalization Functions.
  1463. * ldexpfNx: (libc)Normalization Functions.
  1464. * ldexpl: (libc)Normalization Functions.
  1465. * ldiv: (libc)Integer Division.
  1466. * lfind: (libc)Array Search Function.
  1467. * lgamma: (libc)Special Functions.
  1468. * lgamma_r: (libc)Special Functions.
  1469. * lgammaf: (libc)Special Functions.
  1470. * lgammafN: (libc)Special Functions.
  1471. * lgammafN_r: (libc)Special Functions.
  1472. * lgammafNx: (libc)Special Functions.
  1473. * lgammafNx_r: (libc)Special Functions.
  1474. * lgammaf_r: (libc)Special Functions.
  1475. * lgammal: (libc)Special Functions.
  1476. * lgammal_r: (libc)Special Functions.
  1477. * link: (libc)Hard Links.
  1478. * linkat: (libc)Hard Links.
  1479. * lio_listio64: (libc)Asynchronous Reads/Writes.
  1480. * lio_listio: (libc)Asynchronous Reads/Writes.
  1481. * listen: (libc)Listening.
  1482. * llabs: (libc)Absolute Value.
  1483. * lldiv: (libc)Integer Division.
  1484. * llogb: (libc)Exponents and Logarithms.
  1485. * llogbf: (libc)Exponents and Logarithms.
  1486. * llogbfN: (libc)Exponents and Logarithms.
  1487. * llogbfNx: (libc)Exponents and Logarithms.
  1488. * llogbl: (libc)Exponents and Logarithms.
  1489. * llrint: (libc)Rounding Functions.
  1490. * llrintf: (libc)Rounding Functions.
  1491. * llrintfN: (libc)Rounding Functions.
  1492. * llrintfNx: (libc)Rounding Functions.
  1493. * llrintl: (libc)Rounding Functions.
  1494. * llround: (libc)Rounding Functions.
  1495. * llroundf: (libc)Rounding Functions.
  1496. * llroundfN: (libc)Rounding Functions.
  1497. * llroundfNx: (libc)Rounding Functions.
  1498. * llroundl: (libc)Rounding Functions.
  1499. * localeconv: (libc)The Lame Way to Locale Data.
  1500. * localtime: (libc)Broken-down Time.
  1501. * localtime_r: (libc)Broken-down Time.
  1502. * log10: (libc)Exponents and Logarithms.
  1503. * log10f: (libc)Exponents and Logarithms.
  1504. * log10fN: (libc)Exponents and Logarithms.
  1505. * log10fNx: (libc)Exponents and Logarithms.
  1506. * log10l: (libc)Exponents and Logarithms.
  1507. * log10p1: (libc)Exponents and Logarithms.
  1508. * log10p1f: (libc)Exponents and Logarithms.
  1509. * log10p1fN: (libc)Exponents and Logarithms.
  1510. * log10p1fNx: (libc)Exponents and Logarithms.
  1511. * log10p1l: (libc)Exponents and Logarithms.
  1512. * log1p: (libc)Exponents and Logarithms.
  1513. * log1pf: (libc)Exponents and Logarithms.
  1514. * log1pfN: (libc)Exponents and Logarithms.
  1515. * log1pfNx: (libc)Exponents and Logarithms.
  1516. * log1pl: (libc)Exponents and Logarithms.
  1517. * log2: (libc)Exponents and Logarithms.
  1518. * log2f: (libc)Exponents and Logarithms.
  1519. * log2fN: (libc)Exponents and Logarithms.
  1520. * log2fNx: (libc)Exponents and Logarithms.
  1521. * log2l: (libc)Exponents and Logarithms.
  1522. * log2p1: (libc)Exponents and Logarithms.
  1523. * log2p1f: (libc)Exponents and Logarithms.
  1524. * log2p1fN: (libc)Exponents and Logarithms.
  1525. * log2p1fNx: (libc)Exponents and Logarithms.
  1526. * log2p1l: (libc)Exponents and Logarithms.
  1527. * log: (libc)Exponents and Logarithms.
  1528. * logb: (libc)Exponents and Logarithms.
  1529. * logbf: (libc)Exponents and Logarithms.
  1530. * logbfN: (libc)Exponents and Logarithms.
  1531. * logbfNx: (libc)Exponents and Logarithms.
  1532. * logbl: (libc)Exponents and Logarithms.
  1533. * logf: (libc)Exponents and Logarithms.
  1534. * logfN: (libc)Exponents and Logarithms.
  1535. * logfNx: (libc)Exponents and Logarithms.
  1536. * login: (libc)Logging In and Out.
  1537. * login_tty: (libc)Logging In and Out.
  1538. * logl: (libc)Exponents and Logarithms.
  1539. * logout: (libc)Logging In and Out.
  1540. * logp1: (libc)Exponents and Logarithms.
  1541. * logp1f: (libc)Exponents and Logarithms.
  1542. * logp1fN: (libc)Exponents and Logarithms.
  1543. * logp1fNx: (libc)Exponents and Logarithms.
  1544. * logp1l: (libc)Exponents and Logarithms.
  1545. * logwtmp: (libc)Logging In and Out.
  1546. * longjmp: (libc)Non-Local Details.
  1547. * lrand48: (libc)SVID Random.
  1548. * lrand48_r: (libc)SVID Random.
  1549. * lrint: (libc)Rounding Functions.
  1550. * lrintf: (libc)Rounding Functions.
  1551. * lrintfN: (libc)Rounding Functions.
  1552. * lrintfNx: (libc)Rounding Functions.
  1553. * lrintl: (libc)Rounding Functions.
  1554. * lround: (libc)Rounding Functions.
  1555. * lroundf: (libc)Rounding Functions.
  1556. * lroundfN: (libc)Rounding Functions.
  1557. * lroundfNx: (libc)Rounding Functions.
  1558. * lroundl: (libc)Rounding Functions.
  1559. * lsearch: (libc)Array Search Function.
  1560. * lseek64: (libc)File Position Primitive.
  1561. * lseek: (libc)File Position Primitive.
  1562. * lstat64: (libc)Reading Attributes.
  1563. * lstat: (libc)Reading Attributes.
  1564. * lutimes: (libc)File Times.
  1565. * madvise: (libc)Memory-mapped I/O.
  1566. * makecontext: (libc)System V contexts.
  1567. * mallinfo2: (libc)Statistics of Malloc.
  1568. * malloc: (libc)Basic Allocation.
  1569. * mallopt: (libc)Malloc Tunable Parameters.
  1570. * mblen: (libc)Non-reentrant Character Conversion.
  1571. * mbrlen: (libc)Converting a Character.
  1572. * mbrtowc: (libc)Converting a Character.
  1573. * mbsinit: (libc)Keeping the state.
  1574. * mbsnrtowcs: (libc)Converting Strings.
  1575. * mbsrtowcs: (libc)Converting Strings.
  1576. * mbstowcs: (libc)Non-reentrant String Conversion.
  1577. * mbtowc: (libc)Non-reentrant Character Conversion.
  1578. * mcheck: (libc)Heap Consistency Checking.
  1579. * memalign: (libc)Aligned Memory Blocks.
  1580. * memalignment: (libc)Aligned Memory Blocks.
  1581. * memccpy: (libc)Copying Strings and Arrays.
  1582. * memchr: (libc)Search Functions.
  1583. * memcmp: (libc)String/Array Comparison.
  1584. * memcpy: (libc)Copying Strings and Arrays.
  1585. * memfd_create: (libc)Memory-mapped I/O.
  1586. * memfrob: (libc)Obfuscating Data.
  1587. * memmem: (libc)Search Functions.
  1588. * memmove: (libc)Copying Strings and Arrays.
  1589. * mempcpy: (libc)Copying Strings and Arrays.
  1590. * memrchr: (libc)Search Functions.
  1591. * memset: (libc)Copying Strings and Arrays.
  1592. * memset_explicit: (libc)Erasing Sensitive Data.
  1593. * mkdir: (libc)Creating Directories.
  1594. * mkdirat: (libc)Creating Directories.
  1595. * mkdtemp: (libc)Temporary Files.
  1596. * mkfifo: (libc)FIFO Special Files.
  1597. * mknod: (libc)Making Special Files.
  1598. * mkstemp: (libc)Temporary Files.
  1599. * mktemp: (libc)Temporary Files.
  1600. * mktime: (libc)Broken-down Time.
  1601. * mlock2: (libc)Page Lock Functions.
  1602. * mlock: (libc)Page Lock Functions.
  1603. * mlockall: (libc)Page Lock Functions.
  1604. * mmap64: (libc)Memory-mapped I/O.
  1605. * mmap: (libc)Memory-mapped I/O.
  1606. * modf: (libc)Rounding Functions.
  1607. * modff: (libc)Rounding Functions.
  1608. * modffN: (libc)Rounding Functions.
  1609. * modffNx: (libc)Rounding Functions.
  1610. * modfl: (libc)Rounding Functions.
  1611. * mount: (libc)Mount-Unmount-Remount.
  1612. * mprobe: (libc)Heap Consistency Checking.
  1613. * mprotect: (libc)Memory Protection.
  1614. * mrand48: (libc)SVID Random.
  1615. * mrand48_r: (libc)SVID Random.
  1616. * mremap: (libc)Memory-mapped I/O.
  1617. * mseal: (libc)Memory Protection.
  1618. * msync: (libc)Memory-mapped I/O.
  1619. * mtrace: (libc)Tracing malloc.
  1620. * mtx_destroy: (libc)ISO C Mutexes.
  1621. * mtx_init: (libc)ISO C Mutexes.
  1622. * mtx_lock: (libc)ISO C Mutexes.
  1623. * mtx_timedlock: (libc)ISO C Mutexes.
  1624. * mtx_trylock: (libc)ISO C Mutexes.
  1625. * mtx_unlock: (libc)ISO C Mutexes.
  1626. * munlock: (libc)Page Lock Functions.
  1627. * munlockall: (libc)Page Lock Functions.
  1628. * munmap: (libc)Memory-mapped I/O.
  1629. * muntrace: (libc)Tracing malloc.
  1630. * nan: (libc)FP Bit Twiddling.
  1631. * nanf: (libc)FP Bit Twiddling.
  1632. * nanfN: (libc)FP Bit Twiddling.
  1633. * nanfNx: (libc)FP Bit Twiddling.
  1634. * nanl: (libc)FP Bit Twiddling.
  1635. * nanosleep: (libc)Sleeping.
  1636. * nearbyint: (libc)Rounding Functions.
  1637. * nearbyintf: (libc)Rounding Functions.
  1638. * nearbyintfN: (libc)Rounding Functions.
  1639. * nearbyintfNx: (libc)Rounding Functions.
  1640. * nearbyintl: (libc)Rounding Functions.
  1641. * nextafter: (libc)FP Bit Twiddling.
  1642. * nextafterf: (libc)FP Bit Twiddling.
  1643. * nextafterfN: (libc)FP Bit Twiddling.
  1644. * nextafterfNx: (libc)FP Bit Twiddling.
  1645. * nextafterl: (libc)FP Bit Twiddling.
  1646. * nextdown: (libc)FP Bit Twiddling.
  1647. * nextdownf: (libc)FP Bit Twiddling.
  1648. * nextdownfN: (libc)FP Bit Twiddling.
  1649. * nextdownfNx: (libc)FP Bit Twiddling.
  1650. * nextdownl: (libc)FP Bit Twiddling.
  1651. * nexttoward: (libc)FP Bit Twiddling.
  1652. * nexttowardf: (libc)FP Bit Twiddling.
  1653. * nexttowardl: (libc)FP Bit Twiddling.
  1654. * nextup: (libc)FP Bit Twiddling.
  1655. * nextupf: (libc)FP Bit Twiddling.
  1656. * nextupfN: (libc)FP Bit Twiddling.
  1657. * nextupfNx: (libc)FP Bit Twiddling.
  1658. * nextupl: (libc)FP Bit Twiddling.
  1659. * nftw64: (libc)Working with Directory Trees.
  1660. * nftw: (libc)Working with Directory Trees.
  1661. * ngettext: (libc)Advanced gettext functions.
  1662. * nice: (libc)Traditional Scheduling Functions.
  1663. * nl_langinfo: (libc)The Elegant and Fast Way.
  1664. * nrand48: (libc)SVID Random.
  1665. * nrand48_r: (libc)SVID Random.
  1666. * ntohl: (libc)Byte Order.
  1667. * ntohs: (libc)Byte Order.
  1668. * ntp_adjtime: (libc)Setting and Adjusting the Time.
  1669. * ntp_gettime: (libc)Setting and Adjusting the Time.
  1670. * obstack_1grow: (libc)Growing Objects.
  1671. * obstack_1grow_fast: (libc)Extra Fast Growing.
  1672. * obstack_alignment_mask: (libc)Obstacks Data Alignment.
  1673. * obstack_alloc: (libc)Allocation in an Obstack.
  1674. * obstack_base: (libc)Status of an Obstack.
  1675. * obstack_blank: (libc)Growing Objects.
  1676. * obstack_blank_fast: (libc)Extra Fast Growing.
  1677. * obstack_chunk_size: (libc)Obstack Chunks.
  1678. * obstack_copy0: (libc)Allocation in an Obstack.
  1679. * obstack_copy: (libc)Allocation in an Obstack.
  1680. * obstack_finish: (libc)Growing Objects.
  1681. * obstack_free: (libc)Freeing Obstack Objects.
  1682. * obstack_grow0: (libc)Growing Objects.
  1683. * obstack_grow: (libc)Growing Objects.
  1684. * obstack_init: (libc)Preparing for Obstacks.
  1685. * obstack_int_grow: (libc)Growing Objects.
  1686. * obstack_int_grow_fast: (libc)Extra Fast Growing.
  1687. * obstack_next_free: (libc)Status of an Obstack.
  1688. * obstack_object_size: (libc)Growing Objects.
  1689. * obstack_object_size: (libc)Status of an Obstack.
  1690. * obstack_printf: (libc)Dynamic Output.
  1691. * obstack_ptr_grow: (libc)Growing Objects.
  1692. * obstack_ptr_grow_fast: (libc)Extra Fast Growing.
  1693. * obstack_room: (libc)Extra Fast Growing.
  1694. * obstack_vprintf: (libc)Variable Arguments Output.
  1695. * offsetof: (libc)Structure Measurement.
  1696. * on_exit: (libc)Cleanups on Exit.
  1697. * open64: (libc)Opening and Closing Files.
  1698. * open: (libc)Opening and Closing Files.
  1699. * open_memstream: (libc)String Streams.
  1700. * openat2: (libc)Opening and Closing Files.
  1701. * openat64: (libc)Opening and Closing Files.
  1702. * openat: (libc)Opening and Closing Files.
  1703. * opendir: (libc)Opening a Directory.
  1704. * openlog: (libc)openlog.
  1705. * openpty: (libc)Pseudo-Terminal Pairs.
  1706. * parse_printf_format: (libc)Parsing a Template String.
  1707. * pathconf: (libc)Pathconf.
  1708. * pause: (libc)Using Pause.
  1709. * pclose: (libc)Pipe to a Subprocess.
  1710. * perror: (libc)Error Messages.
  1711. * pidfd_getpid: (libc)Querying a Process.
  1712. * pipe: (libc)Creating a Pipe.
  1713. * pkey_alloc: (libc)Memory Protection.
  1714. * pkey_free: (libc)Memory Protection.
  1715. * pkey_get: (libc)Memory Protection.
  1716. * pkey_mprotect: (libc)Memory Protection.
  1717. * pkey_set: (libc)Memory Protection.
  1718. * poll: (libc)Other Low-Level I/O APIs.
  1719. * popen: (libc)Pipe to a Subprocess.
  1720. * posix_fallocate64: (libc)Storage Allocation.
  1721. * posix_fallocate: (libc)Storage Allocation.
  1722. * posix_memalign: (libc)Aligned Memory Blocks.
  1723. * posix_openpt: (libc)Allocation.
  1724. * pow: (libc)Exponents and Logarithms.
  1725. * powf: (libc)Exponents and Logarithms.
  1726. * powfN: (libc)Exponents and Logarithms.
  1727. * powfNx: (libc)Exponents and Logarithms.
  1728. * powl: (libc)Exponents and Logarithms.
  1729. * pown: (libc)Exponents and Logarithms.
  1730. * pownf: (libc)Exponents and Logarithms.
  1731. * pownfN: (libc)Exponents and Logarithms.
  1732. * pownfNx: (libc)Exponents and Logarithms.
  1733. * pownl: (libc)Exponents and Logarithms.
  1734. * powr: (libc)Exponents and Logarithms.
  1735. * powrf: (libc)Exponents and Logarithms.
  1736. * powrfN: (libc)Exponents and Logarithms.
  1737. * powrfNx: (libc)Exponents and Logarithms.
  1738. * powrl: (libc)Exponents and Logarithms.
  1739. * pread64: (libc)I/O Primitives.
  1740. * pread: (libc)I/O Primitives.
  1741. * preadv2: (libc)Scatter-Gather.
  1742. * preadv64: (libc)Scatter-Gather.
  1743. * preadv64v2: (libc)Scatter-Gather.
  1744. * preadv: (libc)Scatter-Gather.
  1745. * printf: (libc)Formatted Output Functions.
  1746. * printf_size: (libc)Predefined Printf Handlers.
  1747. * printf_size_info: (libc)Predefined Printf Handlers.
  1748. * psignal: (libc)Signal Messages.
  1749. * pthread_attr_destroy: (libc)Creating and Destroying Threads.
  1750. * pthread_attr_getaffinity_np: (libc)Thread CPU Affinity.
  1751. * pthread_attr_getdetachstate: (libc)Creating and Destroying Threads.
  1752. * pthread_attr_getsigmask_np: (libc)Initial Thread Signal Mask.
  1753. * pthread_attr_init: (libc)Creating and Destroying Threads.
  1754. * pthread_attr_setaffinity_np: (libc)Thread CPU Affinity.
  1755. * pthread_attr_setdetachstate: (libc)Creating and Destroying Threads.
  1756. * pthread_attr_setsigmask_np: (libc)Initial Thread Signal Mask.
  1757. * pthread_barrier_destroy: (libc)POSIX Barriers.
  1758. * pthread_barrier_init: (libc)POSIX Barriers.
  1759. * pthread_barrier_wait: (libc)POSIX Barriers.
  1760. * pthread_clockjoin_np: (libc)Joining Threads.
  1761. * pthread_cond_clockwait: (libc)Waiting with Explicit Clocks.
  1762. * pthread_create: (libc)Creating and Destroying Threads.
  1763. * pthread_detach: (libc)Creating and Destroying Threads.
  1764. * pthread_equal: (libc)POSIX Threads Other APIs.
  1765. * pthread_getaffinity_np: (libc)Thread CPU Affinity.
  1766. * pthread_getattr_default_np: (libc)Default Thread Attributes.
  1767. * pthread_getcpuclockid: (libc)POSIX Threads Other APIs.
  1768. * pthread_getname_np: (libc)Thread Names.
  1769. * pthread_getspecific: (libc)Thread-specific Data.
  1770. * pthread_gettid_np: (libc)Process Identification.
  1771. * pthread_join: (libc)Creating and Destroying Threads.
  1772. * pthread_key_create: (libc)Thread-specific Data.
  1773. * pthread_key_delete: (libc)Thread-specific Data.
  1774. * pthread_kill: (libc)Creating and Destroying Threads.
  1775. * pthread_mutex_clocklock: (libc)POSIX Mutexes.
  1776. * pthread_mutex_destroy: (libc)POSIX Mutexes.
  1777. * pthread_mutex_init: (libc)POSIX Mutexes.
  1778. * pthread_mutex_lock: (libc)POSIX Mutexes.
  1779. * pthread_mutex_timedlock: (libc)POSIX Mutexes.
  1780. * pthread_mutex_trylock: (libc)POSIX Mutexes.
  1781. * pthread_mutex_unlock: (libc)POSIX Mutexes.
  1782. * pthread_mutexattr_destroy: (libc)POSIX Mutexes.
  1783. * pthread_mutexattr_gettype: (libc)POSIX Mutexes.
  1784. * pthread_mutexattr_init: (libc)POSIX Mutexes.
  1785. * pthread_mutexattr_settype: (libc)POSIX Mutexes.
  1786. * pthread_once: (libc)POSIX Threads Other APIs.
  1787. * pthread_rwlock_clockrdlock: (libc)Waiting with Explicit Clocks.
  1788. * pthread_rwlock_clockwrlock: (libc)Waiting with Explicit Clocks.
  1789. * pthread_self: (libc)Creating and Destroying Threads.
  1790. * pthread_setaffinity_np: (libc)Thread CPU Affinity.
  1791. * pthread_setattr_default_np: (libc)Default Thread Attributes.
  1792. * pthread_setname_np: (libc)Thread Names.
  1793. * pthread_setspecific: (libc)Thread-specific Data.
  1794. * pthread_sigmask: (libc)POSIX Threads Other APIs.
  1795. * pthread_spin_destroy: (libc)POSIX Spin Locks.
  1796. * pthread_spin_init: (libc)POSIX Spin Locks.
  1797. * pthread_spin_lock: (libc)POSIX Spin Locks.
  1798. * pthread_spin_trylock: (libc)POSIX Spin Locks.
  1799. * pthread_spin_unlock: (libc)POSIX Spin Locks.
  1800. * pthread_timedjoin_np: (libc)Joining Threads.
  1801. * pthread_tryjoin_np: (libc)Joining Threads.
  1802. * ptsname: (libc)Allocation.
  1803. * ptsname_r: (libc)Allocation.
  1804. * putc: (libc)Simple Output.
  1805. * putc_unlocked: (libc)Simple Output.
  1806. * putchar: (libc)Simple Output.
  1807. * putchar_unlocked: (libc)Simple Output.
  1808. * putenv: (libc)Environment Access.
  1809. * putpwent: (libc)Writing a User Entry.
  1810. * puts: (libc)Simple Output.
  1811. * pututline: (libc)Manipulating the Database.
  1812. * pututxline: (libc)XPG Functions.
  1813. * putw: (libc)Simple Output.
  1814. * putwc: (libc)Simple Output.
  1815. * putwc_unlocked: (libc)Simple Output.
  1816. * putwchar: (libc)Simple Output.
  1817. * putwchar_unlocked: (libc)Simple Output.
  1818. * pwrite64: (libc)I/O Primitives.
  1819. * pwrite: (libc)I/O Primitives.
  1820. * pwritev2: (libc)Scatter-Gather.
  1821. * pwritev64: (libc)Scatter-Gather.
  1822. * pwritev64v2: (libc)Scatter-Gather.
  1823. * pwritev: (libc)Scatter-Gather.
  1824. * qecvt: (libc)System V Number Conversion.
  1825. * qecvt_r: (libc)System V Number Conversion.
  1826. * qfcvt: (libc)System V Number Conversion.
  1827. * qfcvt_r: (libc)System V Number Conversion.
  1828. * qgcvt: (libc)System V Number Conversion.
  1829. * qsort: (libc)Array Sort Function.
  1830. * raise: (libc)Signaling Yourself.
  1831. * rand: (libc)ISO Random.
  1832. * rand_r: (libc)ISO Random.
  1833. * random: (libc)BSD Random.
  1834. * random_r: (libc)BSD Random.
  1835. * rawmemchr: (libc)Search Functions.
  1836. * read: (libc)I/O Primitives.
  1837. * readdir64: (libc)Reading/Closing Directory.
  1838. * readdir64_r: (libc)Reading/Closing Directory.
  1839. * readdir: (libc)Reading/Closing Directory.
  1840. * readdir_r: (libc)Reading/Closing Directory.
  1841. * readlink: (libc)Symbolic Links.
  1842. * readv: (libc)Scatter-Gather.
  1843. * realloc: (libc)Changing Block Size.
  1844. * reallocarray: (libc)Changing Block Size.
  1845. * realpath: (libc)Symbolic Links.
  1846. * recv: (libc)Receiving Data.
  1847. * recvfrom: (libc)Receiving Datagrams.
  1848. * recvmsg: (libc)Other Socket APIs.
  1849. * regcomp: (libc)POSIX Regexp Compilation.
  1850. * regerror: (libc)Regexp Cleanup.
  1851. * regexec: (libc)Matching POSIX Regexps.
  1852. * regfree: (libc)Regexp Cleanup.
  1853. * register_printf_function: (libc)Registering New Conversions.
  1854. * remainder: (libc)Remainder Functions.
  1855. * remainderf: (libc)Remainder Functions.
  1856. * remainderfN: (libc)Remainder Functions.
  1857. * remainderfNx: (libc)Remainder Functions.
  1858. * remainderl: (libc)Remainder Functions.
  1859. * remove: (libc)Deleting Files.
  1860. * rename: (libc)Renaming Files.
  1861. * renameat: (libc)Renaming Files.
  1862. * rewind: (libc)File Positioning.
  1863. * rewinddir: (libc)Random Access Directory.
  1864. * rindex: (libc)Search Functions.
  1865. * rint: (libc)Rounding Functions.
  1866. * rintf: (libc)Rounding Functions.
  1867. * rintfN: (libc)Rounding Functions.
  1868. * rintfNx: (libc)Rounding Functions.
  1869. * rintl: (libc)Rounding Functions.
  1870. * rmdir: (libc)Deleting Files.
  1871. * rootn: (libc)Exponents and Logarithms.
  1872. * rootnf: (libc)Exponents and Logarithms.
  1873. * rootnfN: (libc)Exponents and Logarithms.
  1874. * rootnfNx: (libc)Exponents and Logarithms.
  1875. * rootnl: (libc)Exponents and Logarithms.
  1876. * round: (libc)Rounding Functions.
  1877. * roundeven: (libc)Rounding Functions.
  1878. * roundevenf: (libc)Rounding Functions.
  1879. * roundevenfN: (libc)Rounding Functions.
  1880. * roundevenfNx: (libc)Rounding Functions.
  1881. * roundevenl: (libc)Rounding Functions.
  1882. * roundf: (libc)Rounding Functions.
  1883. * roundfN: (libc)Rounding Functions.
  1884. * roundfNx: (libc)Rounding Functions.
  1885. * roundl: (libc)Rounding Functions.
  1886. * rpmatch: (libc)Yes-or-No Questions.
  1887. * rsqrt: (libc)Exponents and Logarithms.
  1888. * rsqrtf: (libc)Exponents and Logarithms.
  1889. * rsqrtfN: (libc)Exponents and Logarithms.
  1890. * rsqrtfNx: (libc)Exponents and Logarithms.
  1891. * rsqrtl: (libc)Exponents and Logarithms.
  1892. * sbrk: (libc)Resizing the Data Segment.
  1893. * scalb: (libc)Normalization Functions.
  1894. * scalbf: (libc)Normalization Functions.
  1895. * scalbl: (libc)Normalization Functions.
  1896. * scalbln: (libc)Normalization Functions.
  1897. * scalblnf: (libc)Normalization Functions.
  1898. * scalblnfN: (libc)Normalization Functions.
  1899. * scalblnfNx: (libc)Normalization Functions.
  1900. * scalblnl: (libc)Normalization Functions.
  1901. * scalbn: (libc)Normalization Functions.
  1902. * scalbnf: (libc)Normalization Functions.
  1903. * scalbnfN: (libc)Normalization Functions.
  1904. * scalbnfNx: (libc)Normalization Functions.
  1905. * scalbnl: (libc)Normalization Functions.
  1906. * scandir64: (libc)Scanning Directory Content.
  1907. * scandir: (libc)Scanning Directory Content.
  1908. * scanf: (libc)Formatted Input Functions.
  1909. * sched_get_priority_max: (libc)Basic Scheduling Functions.
  1910. * sched_get_priority_min: (libc)Basic Scheduling Functions.
  1911. * sched_getaffinity: (libc)CPU Affinity.
  1912. * sched_getattr: (libc)Extensible Scheduling.
  1913. * sched_getcpu: (libc)CPU Affinity.
  1914. * sched_getparam: (libc)Basic Scheduling Functions.
  1915. * sched_getscheduler: (libc)Basic Scheduling Functions.
  1916. * sched_rr_get_interval: (libc)Basic Scheduling Functions.
  1917. * sched_setaffinity: (libc)CPU Affinity.
  1918. * sched_setattr: (libc)Extensible Scheduling.
  1919. * sched_setparam: (libc)Basic Scheduling Functions.
  1920. * sched_setscheduler: (libc)Basic Scheduling Functions.
  1921. * sched_yield: (libc)Basic Scheduling Functions.
  1922. * secure_getenv: (libc)Environment Access.
  1923. * seed48: (libc)SVID Random.
  1924. * seed48_r: (libc)SVID Random.
  1925. * seekdir: (libc)Random Access Directory.
  1926. * select: (libc)Waiting for I/O.
  1927. * sem_clockwait: (libc)POSIX Semaphores.
  1928. * sem_close: (libc)POSIX Semaphores.
  1929. * sem_destroy: (libc)POSIX Semaphores.
  1930. * sem_getvalue: (libc)POSIX Semaphores.
  1931. * sem_init: (libc)POSIX Semaphores.
  1932. * sem_open: (libc)POSIX Semaphores.
  1933. * sem_post: (libc)POSIX Semaphores.
  1934. * sem_timedwait: (libc)POSIX Semaphores.
  1935. * sem_trywait: (libc)POSIX Semaphores.
  1936. * sem_unlink: (libc)POSIX Semaphores.
  1937. * sem_wait: (libc)POSIX Semaphores.
  1938. * semctl: (libc)Semaphores.
  1939. * semget: (libc)Semaphores.
  1940. * semop: (libc)Semaphores.
  1941. * semtimedop: (libc)Semaphores.
  1942. * send: (libc)Sending Data.
  1943. * sendmsg: (libc)Other Socket APIs.
  1944. * sendto: (libc)Sending Datagrams.
  1945. * setbuf: (libc)Controlling Buffering.
  1946. * setbuffer: (libc)Controlling Buffering.
  1947. * setcontext: (libc)System V contexts.
  1948. * setdomainname: (libc)Host Identification.
  1949. * setegid: (libc)Setting Groups.
  1950. * setenv: (libc)Environment Access.
  1951. * seteuid: (libc)Setting User ID.
  1952. * setfsent: (libc)fstab.
  1953. * setgid: (libc)Setting Groups.
  1954. * setgrent: (libc)Scanning All Groups.
  1955. * setgroups: (libc)Setting Groups.
  1956. * sethostent: (libc)Host Names.
  1957. * sethostid: (libc)Host Identification.
  1958. * sethostname: (libc)Host Identification.
  1959. * setitimer: (libc)Setting an Alarm.
  1960. * setjmp: (libc)Non-Local Details.
  1961. * setlinebuf: (libc)Controlling Buffering.
  1962. * setlocale: (libc)Setting the Locale.
  1963. * setlogmask: (libc)setlogmask.
  1964. * setmntent: (libc)mtab.
  1965. * setnetent: (libc)Networks Database.
  1966. * setnetgrent: (libc)Lookup Netgroup.
  1967. * setpayload: (libc)FP Bit Twiddling.
  1968. * setpayloadf: (libc)FP Bit Twiddling.
  1969. * setpayloadfN: (libc)FP Bit Twiddling.
  1970. * setpayloadfNx: (libc)FP Bit Twiddling.
  1971. * setpayloadl: (libc)FP Bit Twiddling.
  1972. * setpayloadsig: (libc)FP Bit Twiddling.
  1973. * setpayloadsigf: (libc)FP Bit Twiddling.
  1974. * setpayloadsigfN: (libc)FP Bit Twiddling.
  1975. * setpayloadsigfNx: (libc)FP Bit Twiddling.
  1976. * setpayloadsigl: (libc)FP Bit Twiddling.
  1977. * setpgid: (libc)Process Group Functions.
  1978. * setpgrp: (libc)Process Group Functions.
  1979. * setpriority: (libc)Traditional Scheduling Functions.
  1980. * setprotoent: (libc)Protocols Database.
  1981. * setpwent: (libc)Scanning All Users.
  1982. * setregid: (libc)Setting Groups.
  1983. * setreuid: (libc)Setting User ID.
  1984. * setrlimit64: (libc)Limits on Resources.
  1985. * setrlimit: (libc)Limits on Resources.
  1986. * setservent: (libc)Services Database.
  1987. * setsid: (libc)Process Group Functions.
  1988. * setsockopt: (libc)Socket Option Functions.
  1989. * setstate: (libc)BSD Random.
  1990. * setstate_r: (libc)BSD Random.
  1991. * settimeofday: (libc)Setting and Adjusting the Time.
  1992. * setuid: (libc)Setting User ID.
  1993. * setutent: (libc)Manipulating the Database.
  1994. * setutxent: (libc)XPG Functions.
  1995. * setvbuf: (libc)Controlling Buffering.
  1996. * shm_open: (libc)Memory-mapped I/O.
  1997. * shm_unlink: (libc)Memory-mapped I/O.
  1998. * shutdown: (libc)Closing a Socket.
  1999. * sigabbrev_np: (libc)Signal Messages.
  2000. * sigaction: (libc)Advanced Signal Handling.
  2001. * sigaddset: (libc)Signal Sets.
  2002. * sigaltstack: (libc)Signal Stack.
  2003. * sigblock: (libc)BSD Signal Handling.
  2004. * sigdelset: (libc)Signal Sets.
  2005. * sigdescr_np: (libc)Signal Messages.
  2006. * sigemptyset: (libc)Signal Sets.
  2007. * sigfillset: (libc)Signal Sets.
  2008. * siginterrupt: (libc)BSD Signal Handling.
  2009. * sigismember: (libc)Signal Sets.
  2010. * siglongjmp: (libc)Non-Local Exits and Signals.
  2011. * sigmask: (libc)BSD Signal Handling.
  2012. * signal: (libc)Basic Signal Handling.
  2013. * signbit: (libc)FP Bit Twiddling.
  2014. * significand: (libc)Normalization Functions.
  2015. * significandf: (libc)Normalization Functions.
  2016. * significandl: (libc)Normalization Functions.
  2017. * sigpause: (libc)BSD Signal Handling.
  2018. * sigpending: (libc)Checking for Pending Signals.
  2019. * sigprocmask: (libc)Process Signal Mask.
  2020. * sigsetjmp: (libc)Non-Local Exits and Signals.
  2021. * sigsetmask: (libc)BSD Signal Handling.
  2022. * sigstack: (libc)Signal Stack.
  2023. * sigsuspend: (libc)Sigsuspend.
  2024. * sin: (libc)Trig Functions.
  2025. * sincos: (libc)Trig Functions.
  2026. * sincosf: (libc)Trig Functions.
  2027. * sincosfN: (libc)Trig Functions.
  2028. * sincosfNx: (libc)Trig Functions.
  2029. * sincosl: (libc)Trig Functions.
  2030. * sinf: (libc)Trig Functions.
  2031. * sinfN: (libc)Trig Functions.
  2032. * sinfNx: (libc)Trig Functions.
  2033. * sinh: (libc)Hyperbolic Functions.
  2034. * sinhf: (libc)Hyperbolic Functions.
  2035. * sinhfN: (libc)Hyperbolic Functions.
  2036. * sinhfNx: (libc)Hyperbolic Functions.
  2037. * sinhl: (libc)Hyperbolic Functions.
  2038. * sinl: (libc)Trig Functions.
  2039. * sinpi: (libc)Trig Functions.
  2040. * sinpif: (libc)Trig Functions.
  2041. * sinpifN: (libc)Trig Functions.
  2042. * sinpifNx: (libc)Trig Functions.
  2043. * sinpil: (libc)Trig Functions.
  2044. * sleep: (libc)Sleeping.
  2045. * snprintf: (libc)Formatted Output Functions.
  2046. * socket: (libc)Creating a Socket.
  2047. * socketpair: (libc)Socket Pairs.
  2048. * sprintf: (libc)Formatted Output Functions.
  2049. * sqrt: (libc)Exponents and Logarithms.
  2050. * sqrtf: (libc)Exponents and Logarithms.
  2051. * sqrtfN: (libc)Exponents and Logarithms.
  2052. * sqrtfNx: (libc)Exponents and Logarithms.
  2053. * sqrtl: (libc)Exponents and Logarithms.
  2054. * srand48: (libc)SVID Random.
  2055. * srand48_r: (libc)SVID Random.
  2056. * srand: (libc)ISO Random.
  2057. * srandom: (libc)BSD Random.
  2058. * srandom_r: (libc)BSD Random.
  2059. * sscanf: (libc)Formatted Input Functions.
  2060. * ssignal: (libc)Basic Signal Handling.
  2061. * stat64: (libc)Reading Attributes.
  2062. * stat: (libc)Reading Attributes.
  2063. * stdc_bit_ceil_uc: (libc)Bit Manipulation.
  2064. * stdc_bit_ceil_ui: (libc)Bit Manipulation.
  2065. * stdc_bit_ceil_ul: (libc)Bit Manipulation.
  2066. * stdc_bit_ceil_ull: (libc)Bit Manipulation.
  2067. * stdc_bit_ceil_us: (libc)Bit Manipulation.
  2068. * stdc_bit_floor_uc: (libc)Bit Manipulation.
  2069. * stdc_bit_floor_ui: (libc)Bit Manipulation.
  2070. * stdc_bit_floor_ul: (libc)Bit Manipulation.
  2071. * stdc_bit_floor_ull: (libc)Bit Manipulation.
  2072. * stdc_bit_floor_us: (libc)Bit Manipulation.
  2073. * stdc_bit_width_uc: (libc)Bit Manipulation.
  2074. * stdc_bit_width_ui: (libc)Bit Manipulation.
  2075. * stdc_bit_width_ul: (libc)Bit Manipulation.
  2076. * stdc_bit_width_ull: (libc)Bit Manipulation.
  2077. * stdc_bit_width_us: (libc)Bit Manipulation.
  2078. * stdc_count_ones_uc: (libc)Bit Manipulation.
  2079. * stdc_count_ones_ui: (libc)Bit Manipulation.
  2080. * stdc_count_ones_ul: (libc)Bit Manipulation.
  2081. * stdc_count_ones_ull: (libc)Bit Manipulation.
  2082. * stdc_count_ones_us: (libc)Bit Manipulation.
  2083. * stdc_count_zeros_uc: (libc)Bit Manipulation.
  2084. * stdc_count_zeros_ui: (libc)Bit Manipulation.
  2085. * stdc_count_zeros_ul: (libc)Bit Manipulation.
  2086. * stdc_count_zeros_ull: (libc)Bit Manipulation.
  2087. * stdc_count_zeros_us: (libc)Bit Manipulation.
  2088. * stdc_first_leading_one_uc: (libc)Bit Manipulation.
  2089. * stdc_first_leading_one_ui: (libc)Bit Manipulation.
  2090. * stdc_first_leading_one_ul: (libc)Bit Manipulation.
  2091. * stdc_first_leading_one_ull: (libc)Bit Manipulation.
  2092. * stdc_first_leading_one_us: (libc)Bit Manipulation.
  2093. * stdc_first_leading_zero_uc: (libc)Bit Manipulation.
  2094. * stdc_first_leading_zero_ui: (libc)Bit Manipulation.
  2095. * stdc_first_leading_zero_ul: (libc)Bit Manipulation.
  2096. * stdc_first_leading_zero_ull: (libc)Bit Manipulation.
  2097. * stdc_first_leading_zero_us: (libc)Bit Manipulation.
  2098. * stdc_first_trailing_one_uc: (libc)Bit Manipulation.
  2099. * stdc_first_trailing_one_ui: (libc)Bit Manipulation.
  2100. * stdc_first_trailing_one_ul: (libc)Bit Manipulation.
  2101. * stdc_first_trailing_one_ull: (libc)Bit Manipulation.
  2102. * stdc_first_trailing_one_us: (libc)Bit Manipulation.
  2103. * stdc_first_trailing_zero_uc: (libc)Bit Manipulation.
  2104. * stdc_first_trailing_zero_ui: (libc)Bit Manipulation.
  2105. * stdc_first_trailing_zero_ul: (libc)Bit Manipulation.
  2106. * stdc_first_trailing_zero_ull: (libc)Bit Manipulation.
  2107. * stdc_first_trailing_zero_us: (libc)Bit Manipulation.
  2108. * stdc_has_single_bit_uc: (libc)Bit Manipulation.
  2109. * stdc_has_single_bit_ui: (libc)Bit Manipulation.
  2110. * stdc_has_single_bit_ul: (libc)Bit Manipulation.
  2111. * stdc_has_single_bit_ull: (libc)Bit Manipulation.
  2112. * stdc_has_single_bit_us: (libc)Bit Manipulation.
  2113. * stdc_leading_ones_uc: (libc)Bit Manipulation.
  2114. * stdc_leading_ones_ui: (libc)Bit Manipulation.
  2115. * stdc_leading_ones_ul: (libc)Bit Manipulation.
  2116. * stdc_leading_ones_ull: (libc)Bit Manipulation.
  2117. * stdc_leading_ones_us: (libc)Bit Manipulation.
  2118. * stdc_leading_zeros_uc: (libc)Bit Manipulation.
  2119. * stdc_leading_zeros_ui: (libc)Bit Manipulation.
  2120. * stdc_leading_zeros_ul: (libc)Bit Manipulation.
  2121. * stdc_leading_zeros_ull: (libc)Bit Manipulation.
  2122. * stdc_leading_zeros_us: (libc)Bit Manipulation.
  2123. * stdc_trailing_ones_uc: (libc)Bit Manipulation.
  2124. * stdc_trailing_ones_ui: (libc)Bit Manipulation.
  2125. * stdc_trailing_ones_ul: (libc)Bit Manipulation.
  2126. * stdc_trailing_ones_ull: (libc)Bit Manipulation.
  2127. * stdc_trailing_ones_us: (libc)Bit Manipulation.
  2128. * stdc_trailing_zeros_uc: (libc)Bit Manipulation.
  2129. * stdc_trailing_zeros_ui: (libc)Bit Manipulation.
  2130. * stdc_trailing_zeros_ul: (libc)Bit Manipulation.
  2131. * stdc_trailing_zeros_ull: (libc)Bit Manipulation.
  2132. * stdc_trailing_zeros_us: (libc)Bit Manipulation.
  2133. * stime: (libc)Setting and Adjusting the Time.
  2134. * stpcpy: (libc)Copying Strings and Arrays.
  2135. * stpncpy: (libc)Truncating Strings.
  2136. * strcasecmp: (libc)String/Array Comparison.
  2137. * strcasestr: (libc)Search Functions.
  2138. * strcat: (libc)Concatenating Strings.
  2139. * strchr: (libc)Search Functions.
  2140. * strchrnul: (libc)Search Functions.
  2141. * strcmp: (libc)String/Array Comparison.
  2142. * strcoll: (libc)Collation Functions.
  2143. * strcpy: (libc)Copying Strings and Arrays.
  2144. * strcspn: (libc)Search Functions.
  2145. * strdup: (libc)Copying Strings and Arrays.
  2146. * strdupa: (libc)Copying Strings and Arrays.
  2147. * strerror: (libc)Error Messages.
  2148. * strerror_l: (libc)Error Messages.
  2149. * strerror_r: (libc)Error Messages.
  2150. * strerror_r: (libc)Error Messages.
  2151. * strerrordesc_np: (libc)Error Messages.
  2152. * strerrorname_np: (libc)Error Messages.
  2153. * strfmon: (libc)Formatting Numbers.
  2154. * strfromd: (libc)Printing of Floats.
  2155. * strfromf: (libc)Printing of Floats.
  2156. * strfromfN: (libc)Printing of Floats.
  2157. * strfromfNx: (libc)Printing of Floats.
  2158. * strfroml: (libc)Printing of Floats.
  2159. * strfry: (libc)Shuffling Bytes.
  2160. * strftime: (libc)Formatting Calendar Time.
  2161. * strftime_l: (libc)Formatting Calendar Time.
  2162. * strlcat: (libc)Truncating Strings.
  2163. * strlcpy: (libc)Truncating Strings.
  2164. * strlen: (libc)String Length.
  2165. * strncasecmp: (libc)String/Array Comparison.
  2166. * strncat: (libc)Truncating Strings.
  2167. * strncmp: (libc)String/Array Comparison.
  2168. * strncpy: (libc)Truncating Strings.
  2169. * strndup: (libc)Truncating Strings.
  2170. * strndupa: (libc)Truncating Strings.
  2171. * strnlen: (libc)String Length.
  2172. * strpbrk: (libc)Search Functions.
  2173. * strptime: (libc)Low-Level Time String Parsing.
  2174. * strrchr: (libc)Search Functions.
  2175. * strsep: (libc)Finding Tokens in a String.
  2176. * strsignal: (libc)Signal Messages.
  2177. * strspn: (libc)Search Functions.
  2178. * strstr: (libc)Search Functions.
  2179. * strtod: (libc)Parsing of Floats.
  2180. * strtof: (libc)Parsing of Floats.
  2181. * strtofN: (libc)Parsing of Floats.
  2182. * strtofNx: (libc)Parsing of Floats.
  2183. * strtoimax: (libc)Parsing of Integers.
  2184. * strtok: (libc)Finding Tokens in a String.
  2185. * strtok_r: (libc)Finding Tokens in a String.
  2186. * strtol: (libc)Parsing of Integers.
  2187. * strtold: (libc)Parsing of Floats.
  2188. * strtoll: (libc)Parsing of Integers.
  2189. * strtoq: (libc)Parsing of Integers.
  2190. * strtoul: (libc)Parsing of Integers.
  2191. * strtoull: (libc)Parsing of Integers.
  2192. * strtoumax: (libc)Parsing of Integers.
  2193. * strtouq: (libc)Parsing of Integers.
  2194. * strverscmp: (libc)String/Array Comparison.
  2195. * strxfrm: (libc)Collation Functions.
  2196. * stty: (libc)BSD Terminal Modes.
  2197. * swapcontext: (libc)System V contexts.
  2198. * swprintf: (libc)Formatted Output Functions.
  2199. * swscanf: (libc)Formatted Input Functions.
  2200. * symlink: (libc)Symbolic Links.
  2201. * sync: (libc)Synchronizing I/O.
  2202. * syscall: (libc)System Calls.
  2203. * sysconf: (libc)Sysconf Definition.
  2204. * syslog: (libc)syslog; vsyslog.
  2205. * system: (libc)Running a Command.
  2206. * sysv_signal: (libc)Basic Signal Handling.
  2207. * tan: (libc)Trig Functions.
  2208. * tanf: (libc)Trig Functions.
  2209. * tanfN: (libc)Trig Functions.
  2210. * tanfNx: (libc)Trig Functions.
  2211. * tanh: (libc)Hyperbolic Functions.
  2212. * tanhf: (libc)Hyperbolic Functions.
  2213. * tanhfN: (libc)Hyperbolic Functions.
  2214. * tanhfNx: (libc)Hyperbolic Functions.
  2215. * tanhl: (libc)Hyperbolic Functions.
  2216. * tanl: (libc)Trig Functions.
  2217. * tanpi: (libc)Trig Functions.
  2218. * tanpif: (libc)Trig Functions.
  2219. * tanpifN: (libc)Trig Functions.
  2220. * tanpifNx: (libc)Trig Functions.
  2221. * tanpil: (libc)Trig Functions.
  2222. * tcdrain: (libc)Line Control.
  2223. * tcflow: (libc)Line Control.
  2224. * tcflush: (libc)Line Control.
  2225. * tcgetattr: (libc)Mode Functions.
  2226. * tcgetpgrp: (libc)Terminal Access Functions.
  2227. * tcgetsid: (libc)Terminal Access Functions.
  2228. * tcsendbreak: (libc)Line Control.
  2229. * tcsetattr: (libc)Mode Functions.
  2230. * tcsetpgrp: (libc)Terminal Access Functions.
  2231. * tdelete: (libc)Tree Search Function.
  2232. * tdestroy: (libc)Tree Search Function.
  2233. * telldir: (libc)Random Access Directory.
  2234. * tempnam: (libc)Temporary Files.
  2235. * textdomain: (libc)Locating gettext catalog.
  2236. * tfind: (libc)Tree Search Function.
  2237. * tgamma: (libc)Special Functions.
  2238. * tgammaf: (libc)Special Functions.
  2239. * tgammafN: (libc)Special Functions.
  2240. * tgammafNx: (libc)Special Functions.
  2241. * tgammal: (libc)Special Functions.
  2242. * tgkill: (libc)Signaling Another Process.
  2243. * thrd_create: (libc)ISO C Thread Management.
  2244. * thrd_current: (libc)ISO C Thread Management.
  2245. * thrd_detach: (libc)ISO C Thread Management.
  2246. * thrd_equal: (libc)ISO C Thread Management.
  2247. * thrd_exit: (libc)ISO C Thread Management.
  2248. * thrd_join: (libc)ISO C Thread Management.
  2249. * thrd_sleep: (libc)ISO C Thread Management.
  2250. * thrd_yield: (libc)ISO C Thread Management.
  2251. * time: (libc)Getting the Time.
  2252. * timegm: (libc)Broken-down Time.
  2253. * timelocal: (libc)Broken-down Time.
  2254. * times: (libc)Processor Time.
  2255. * timespec_get: (libc)Getting the Time.
  2256. * timespec_getres: (libc)Getting the Time.
  2257. * tmpfile64: (libc)Temporary Files.
  2258. * tmpfile: (libc)Temporary Files.
  2259. * tmpnam: (libc)Temporary Files.
  2260. * tmpnam_r: (libc)Temporary Files.
  2261. * toascii: (libc)Case Conversion.
  2262. * tolower: (libc)Case Conversion.
  2263. * totalorder: (libc)FP Comparison Functions.
  2264. * totalorderf: (libc)FP Comparison Functions.
  2265. * totalorderfN: (libc)FP Comparison Functions.
  2266. * totalorderfNx: (libc)FP Comparison Functions.
  2267. * totalorderl: (libc)FP Comparison Functions.
  2268. * totalordermag: (libc)FP Comparison Functions.
  2269. * totalordermagf: (libc)FP Comparison Functions.
  2270. * totalordermagfN: (libc)FP Comparison Functions.
  2271. * totalordermagfNx: (libc)FP Comparison Functions.
  2272. * totalordermagl: (libc)FP Comparison Functions.
  2273. * toupper: (libc)Case Conversion.
  2274. * towctrans: (libc)Wide Character Case Conversion.
  2275. * towlower: (libc)Wide Character Case Conversion.
  2276. * towupper: (libc)Wide Character Case Conversion.
  2277. * trunc: (libc)Rounding Functions.
  2278. * truncate64: (libc)File Size.
  2279. * truncate: (libc)File Size.
  2280. * truncf: (libc)Rounding Functions.
  2281. * truncfN: (libc)Rounding Functions.
  2282. * truncfNx: (libc)Rounding Functions.
  2283. * truncl: (libc)Rounding Functions.
  2284. * tsearch: (libc)Tree Search Function.
  2285. * tss_create: (libc)ISO C Thread-local Storage.
  2286. * tss_delete: (libc)ISO C Thread-local Storage.
  2287. * tss_get: (libc)ISO C Thread-local Storage.
  2288. * tss_set: (libc)ISO C Thread-local Storage.
  2289. * ttyname: (libc)Is It a Terminal.
  2290. * ttyname_r: (libc)Is It a Terminal.
  2291. * twalk: (libc)Tree Search Function.
  2292. * twalk_r: (libc)Tree Search Function.
  2293. * tzset: (libc)Time Zone State.
  2294. * uabs: (libc)Absolute Value.
  2295. * ufromfp: (libc)Rounding Functions.
  2296. * ufromfpf: (libc)Rounding Functions.
  2297. * ufromfpfN: (libc)Rounding Functions.
  2298. * ufromfpfNx: (libc)Rounding Functions.
  2299. * ufromfpl: (libc)Rounding Functions.
  2300. * ufromfpx: (libc)Rounding Functions.
  2301. * ufromfpxf: (libc)Rounding Functions.
  2302. * ufromfpxfN: (libc)Rounding Functions.
  2303. * ufromfpxfNx: (libc)Rounding Functions.
  2304. * ufromfpxl: (libc)Rounding Functions.
  2305. * ulabs: (libc)Absolute Value.
  2306. * ulimit: (libc)Limits on Resources.
  2307. * ullabs: (libc)Absolute Value.
  2308. * umask: (libc)Setting Permissions.
  2309. * umaxabs: (libc)Absolute Value.
  2310. * umount2: (libc)Mount-Unmount-Remount.
  2311. * umount: (libc)Mount-Unmount-Remount.
  2312. * uname: (libc)Platform Type.
  2313. * ungetc: (libc)How Unread.
  2314. * ungetwc: (libc)How Unread.
  2315. * unlink: (libc)Deleting Files.
  2316. * unlinkat: (libc)Deleting Files.
  2317. * unlockpt: (libc)Allocation.
  2318. * unsetenv: (libc)Environment Access.
  2319. * updwtmp: (libc)Manipulating the Database.
  2320. * utime: (libc)File Times.
  2321. * utimensat: (libc)File Times.
  2322. * utimes: (libc)File Times.
  2323. * utmpname: (libc)Manipulating the Database.
  2324. * utmpxname: (libc)XPG Functions.
  2325. * va_arg: (libc)Argument Macros.
  2326. * va_copy: (libc)Argument Macros.
  2327. * va_end: (libc)Argument Macros.
  2328. * va_start: (libc)Argument Macros.
  2329. * valloc: (libc)Aligned Memory Blocks.
  2330. * vasprintf: (libc)Variable Arguments Output.
  2331. * vdprintf: (libc)Variable Arguments Output.
  2332. * verr: (libc)Error Messages.
  2333. * verrx: (libc)Error Messages.
  2334. * versionsort64: (libc)Scanning Directory Content.
  2335. * versionsort: (libc)Scanning Directory Content.
  2336. * vfork: (libc)Creating a Process.
  2337. * vfprintf: (libc)Variable Arguments Output.
  2338. * vfscanf: (libc)Variable Arguments Input.
  2339. * vfwprintf: (libc)Variable Arguments Output.
  2340. * vfwscanf: (libc)Variable Arguments Input.
  2341. * vlimit: (libc)Limits on Resources.
  2342. * vprintf: (libc)Variable Arguments Output.
  2343. * vscanf: (libc)Variable Arguments Input.
  2344. * vsnprintf: (libc)Variable Arguments Output.
  2345. * vsprintf: (libc)Variable Arguments Output.
  2346. * vsscanf: (libc)Variable Arguments Input.
  2347. * vswprintf: (libc)Variable Arguments Output.
  2348. * vswscanf: (libc)Variable Arguments Input.
  2349. * vsyslog: (libc)syslog; vsyslog.
  2350. * vwarn: (libc)Error Messages.
  2351. * vwarnx: (libc)Error Messages.
  2352. * vwprintf: (libc)Variable Arguments Output.
  2353. * vwscanf: (libc)Variable Arguments Input.
  2354. * wait3: (libc)BSD Wait Functions.
  2355. * wait4: (libc)Process Completion.
  2356. * wait: (libc)Process Completion.
  2357. * waitpid: (libc)Process Completion.
  2358. * warn: (libc)Error Messages.
  2359. * warnx: (libc)Error Messages.
  2360. * wcpcpy: (libc)Copying Strings and Arrays.
  2361. * wcpncpy: (libc)Truncating Strings.
  2362. * wcrtomb: (libc)Converting a Character.
  2363. * wcscasecmp: (libc)String/Array Comparison.
  2364. * wcscat: (libc)Concatenating Strings.
  2365. * wcschr: (libc)Search Functions.
  2366. * wcschrnul: (libc)Search Functions.
  2367. * wcscmp: (libc)String/Array Comparison.
  2368. * wcscoll: (libc)Collation Functions.
  2369. * wcscpy: (libc)Copying Strings and Arrays.
  2370. * wcscspn: (libc)Search Functions.
  2371. * wcsdup: (libc)Copying Strings and Arrays.
  2372. * wcsftime: (libc)Formatting Calendar Time.
  2373. * wcslcat: (libc)Truncating Strings.
  2374. * wcslcpy: (libc)Truncating Strings.
  2375. * wcslen: (libc)String Length.
  2376. * wcsncasecmp: (libc)String/Array Comparison.
  2377. * wcsncat: (libc)Truncating Strings.
  2378. * wcsncmp: (libc)String/Array Comparison.
  2379. * wcsncpy: (libc)Truncating Strings.
  2380. * wcsnlen: (libc)String Length.
  2381. * wcsnrtombs: (libc)Converting Strings.
  2382. * wcspbrk: (libc)Search Functions.
  2383. * wcsrchr: (libc)Search Functions.
  2384. * wcsrtombs: (libc)Converting Strings.
  2385. * wcsspn: (libc)Search Functions.
  2386. * wcsstr: (libc)Search Functions.
  2387. * wcstod: (libc)Parsing of Floats.
  2388. * wcstof: (libc)Parsing of Floats.
  2389. * wcstofN: (libc)Parsing of Floats.
  2390. * wcstofNx: (libc)Parsing of Floats.
  2391. * wcstoimax: (libc)Parsing of Integers.
  2392. * wcstok: (libc)Finding Tokens in a String.
  2393. * wcstol: (libc)Parsing of Integers.
  2394. * wcstold: (libc)Parsing of Floats.
  2395. * wcstoll: (libc)Parsing of Integers.
  2396. * wcstombs: (libc)Non-reentrant String Conversion.
  2397. * wcstoq: (libc)Parsing of Integers.
  2398. * wcstoul: (libc)Parsing of Integers.
  2399. * wcstoull: (libc)Parsing of Integers.
  2400. * wcstoumax: (libc)Parsing of Integers.
  2401. * wcstouq: (libc)Parsing of Integers.
  2402. * wcswcs: (libc)Search Functions.
  2403. * wcsxfrm: (libc)Collation Functions.
  2404. * wctob: (libc)Converting a Character.
  2405. * wctomb: (libc)Non-reentrant Character Conversion.
  2406. * wctrans: (libc)Wide Character Case Conversion.
  2407. * wctype: (libc)Classification of Wide Characters.
  2408. * wmemchr: (libc)Search Functions.
  2409. * wmemcmp: (libc)String/Array Comparison.
  2410. * wmemcpy: (libc)Copying Strings and Arrays.
  2411. * wmemmove: (libc)Copying Strings and Arrays.
  2412. * wmempcpy: (libc)Copying Strings and Arrays.
  2413. * wmemset: (libc)Copying Strings and Arrays.
  2414. * wordexp: (libc)Calling Wordexp.
  2415. * wordfree: (libc)Calling Wordexp.
  2416. * wprintf: (libc)Formatted Output Functions.
  2417. * write: (libc)I/O Primitives.
  2418. * writev: (libc)Scatter-Gather.
  2419. * wscanf: (libc)Formatted Input Functions.
  2420. * y0: (libc)Special Functions.
  2421. * y0f: (libc)Special Functions.
  2422. * y0fN: (libc)Special Functions.
  2423. * y0fNx: (libc)Special Functions.
  2424. * y0l: (libc)Special Functions.
  2425. * y1: (libc)Special Functions.
  2426. * y1f: (libc)Special Functions.
  2427. * y1fN: (libc)Special Functions.
  2428. * y1fNx: (libc)Special Functions.
  2429. * y1l: (libc)Special Functions.
  2430. * yn: (libc)Special Functions.
  2431. * ynf: (libc)Special Functions.
  2432. * ynfN: (libc)Special Functions.
  2433. * ynfNx: (libc)Special Functions.
  2434. * ynl: (libc)Special Functions.
  2435. END-INFO-DIR-ENTRY
  2436. 
  2437. File: libc.info, Node: Synchronizing AIO Operations, Next: Cancel AIO Operations, Prev: Status of AIO Operations, Up: Asynchronous I/O
  2438. 13.11.3 Getting into a Consistent State
  2439. ---------------------------------------
  2440. When dealing with asynchronous operations it is sometimes necessary to
  2441. get into a consistent state. This would mean for AIO that one wants to
  2442. know whether a certain request or a group of requests were processed.
  2443. This could be done by waiting for the notification sent by the system
  2444. after the operation terminated, but this sometimes would mean wasting
  2445. resources (mainly computation time). Instead POSIX.1b defines two
  2446. functions which will help with most kinds of consistency.
  2447. The ‘aio_fsync’ and ‘aio_fsync64’ functions are only available if the
  2448. symbol ‘_POSIX_SYNCHRONIZED_IO’ is defined in ‘unistd.h’.
  2449. -- Function: int aio_fsync (int OP, struct aiocb *AIOCBP)
  2450. Preliminary: | MT-Safe | AS-Unsafe lock heap | AC-Unsafe lock mem |
  2451. *Note POSIX Safety Concepts::.
  2452. Calling this function forces all I/O operations queued at the time
  2453. of the function call operating on the file descriptor
  2454. ‘aiocbp->aio_fildes’ into the synchronized I/O completion state
  2455. (*note Synchronizing I/O::). The ‘aio_fsync’ function returns
  2456. immediately but the notification through the method described in
  2457. ‘aiocbp->aio_sigevent’ will happen only after all requests for this
  2458. file descriptor have terminated and the file is synchronized. This
  2459. also means that requests for this very same file descriptor which
  2460. are queued after the synchronization request are not affected.
  2461. If OP is ‘O_DSYNC’ the synchronization happens as with a call to
  2462. ‘fdatasync’. Otherwise OP should be ‘O_SYNC’ and the
  2463. synchronization happens as with ‘fsync’.
  2464. As long as the synchronization has not happened, a call to
  2465. ‘aio_error’ with the reference to the object pointed to by AIOCBP
  2466. returns ‘EINPROGRESS’. Once the synchronization is done
  2467. ‘aio_error’ return 0 if the synchronization was not successful.
  2468. Otherwise the value returned is the value to which the ‘fsync’ or
  2469. ‘fdatasync’ function would have set the ‘errno’ variable. In this
  2470. case nothing can be assumed about the consistency of the data
  2471. written to this file descriptor.
  2472. The return value of this function is 0 if the request was
  2473. successfully enqueued. Otherwise the return value is -1 and
  2474. ‘errno’ is set to one of the following values:
  2475. ‘EAGAIN’
  2476. The request could not be enqueued due to temporary lack of
  2477. resources.
  2478. ‘EBADF’
  2479. The file descriptor ‘AIOCBP->aio_fildes’ is not valid.
  2480. ‘EINVAL’
  2481. The implementation does not support I/O synchronization or the
  2482. OP parameter is other than ‘O_DSYNC’ and ‘O_SYNC’.
  2483. ‘ENOSYS’
  2484. This function is not implemented.
  2485. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  2486. function is in fact ‘aio_fsync64’ since the LFS interface
  2487. transparently replaces the normal implementation.
  2488. -- Function: int aio_fsync64 (int OP, struct aiocb64 *AIOCBP)
  2489. Preliminary: | MT-Safe | AS-Unsafe lock heap | AC-Unsafe lock mem |
  2490. *Note POSIX Safety Concepts::.
  2491. This function is similar to ‘aio_fsync’ with the only difference
  2492. that the argument is a reference to a variable of type ‘struct
  2493. aiocb64’.
  2494. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  2495. function is available under the name ‘aio_fsync’ and so
  2496. transparently replaces the interface for small files on 32 bit
  2497. machines.
  2498. Another method of synchronization is to wait until one or more
  2499. requests of a specific set terminated. This could be achieved by the
  2500. ‘aio_*’ functions to notify the initiating process about the termination
  2501. but in some situations this is not the ideal solution. In a program
  2502. which constantly updates clients somehow connected to the server it is
  2503. not always the best solution to go round robin since some connections
  2504. might be slow. On the other hand letting the ‘aio_*’ functions notify
  2505. the caller might also be not the best solution since whenever the
  2506. process works on preparing data for a client it makes no sense to be
  2507. interrupted by a notification since the new client will not be handled
  2508. before the current client is served. For situations like this
  2509. ‘aio_suspend’ should be used.
  2510. -- Function: int aio_suspend (const struct aiocb *const LIST[], int
  2511. NENT, const struct timespec *TIMEOUT)
  2512. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  2513. POSIX Safety Concepts::.
  2514. When calling this function, the calling thread is suspended until
  2515. at least one of the requests pointed to by the NENT elements of the
  2516. array LIST has completed. If any of the requests has already
  2517. completed at the time ‘aio_suspend’ is called, the function returns
  2518. immediately. Whether a request has terminated or not is determined
  2519. by comparing the error status of the request with ‘EINPROGRESS’.
  2520. If an element of LIST is ‘NULL’, the entry is simply ignored.
  2521. If no request has finished, the calling process is suspended. If
  2522. TIMEOUT is ‘NULL’, the process is not woken until a request has
  2523. finished. If TIMEOUT is not ‘NULL’, the process remains suspended
  2524. at least as long as specified in TIMEOUT. In this case,
  2525. ‘aio_suspend’ returns with an error.
  2526. The return value of the function is 0 if one or more requests from
  2527. the LIST have terminated. Otherwise the function returns -1 and
  2528. ‘errno’ is set to one of the following values:
  2529. ‘EAGAIN’
  2530. None of the requests from the LIST completed in the time
  2531. specified by TIMEOUT.
  2532. ‘EINTR’
  2533. A signal interrupted the ‘aio_suspend’ function. This signal
  2534. might also be sent by the AIO implementation while signalling
  2535. the termination of one of the requests.
  2536. ‘ENOSYS’
  2537. The ‘aio_suspend’ function is not implemented.
  2538. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  2539. function is in fact ‘aio_suspend64’ since the LFS interface
  2540. transparently replaces the normal implementation.
  2541. -- Function: int aio_suspend64 (const struct aiocb64 *const LIST[], int
  2542. NENT, const struct timespec *TIMEOUT)
  2543. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  2544. POSIX Safety Concepts::.
  2545. This function is similar to ‘aio_suspend’ with the only difference
  2546. that the argument is a reference to a variable of type ‘struct
  2547. aiocb64’.
  2548. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  2549. function is available under the name ‘aio_suspend’ and so
  2550. transparently replaces the interface for small files on 32 bit
  2551. machines.
  2552. 
  2553. File: libc.info, Node: Cancel AIO Operations, Next: Configuration of AIO, Prev: Synchronizing AIO Operations, Up: Asynchronous I/O
  2554. 13.11.4 Cancellation of AIO Operations
  2555. --------------------------------------
  2556. When one or more requests are asynchronously processed, it might be
  2557. useful in some situations to cancel a selected operation, e.g., if it
  2558. becomes obvious that the written data is no longer accurate and would
  2559. have to be overwritten soon. As an example, assume an application,
  2560. which writes data in files in a situation where new incoming data would
  2561. have to be written in a file which will be updated by an enqueued
  2562. request. The POSIX AIO implementation provides such a function, but
  2563. this function is not capable of forcing the cancellation of the request.
  2564. It is up to the implementation to decide whether it is possible to
  2565. cancel the operation or not. Therefore using this function is merely a
  2566. hint.
  2567. -- Function: int aio_cancel (int FILDES, struct aiocb *AIOCBP)
  2568. Preliminary: | MT-Safe | AS-Unsafe lock heap | AC-Unsafe lock mem |
  2569. *Note POSIX Safety Concepts::.
  2570. The ‘aio_cancel’ function can be used to cancel one or more
  2571. outstanding requests. If the AIOCBP parameter is ‘NULL’, the
  2572. function tries to cancel all of the outstanding requests which
  2573. would process the file descriptor FILDES (i.e., whose ‘aio_fildes’
  2574. member is FILDES). If AIOCBP is not ‘NULL’, ‘aio_cancel’ attempts
  2575. to cancel the specific request pointed to by AIOCBP.
  2576. For requests which were successfully canceled, the normal
  2577. notification about the termination of the request should take
  2578. place. I.e., depending on the ‘struct sigevent’ object which
  2579. controls this, nothing happens, a signal is sent or a thread is
  2580. started. If the request cannot be canceled, it terminates the
  2581. usual way after performing the operation.
  2582. After a request is successfully canceled, a call to ‘aio_error’
  2583. with a reference to this request as the parameter will return
  2584. ‘ECANCELED’ and a call to ‘aio_return’ will return -1. If the
  2585. request wasn't canceled and is still running the error status is
  2586. still ‘EINPROGRESS’.
  2587. The return value of the function is ‘AIO_CANCELED’ if there were
  2588. requests which haven't terminated and which were successfully
  2589. canceled. If there is one or more requests left which couldn't be
  2590. canceled, the return value is ‘AIO_NOTCANCELED’. In this case
  2591. ‘aio_error’ must be used to find out which of the, perhaps
  2592. multiple, requests (if AIOCBP is ‘NULL’) weren't successfully
  2593. canceled. If all requests already terminated at the time
  2594. ‘aio_cancel’ is called the return value is ‘AIO_ALLDONE’.
  2595. If an error occurred during the execution of ‘aio_cancel’ the
  2596. function returns -1 and sets ‘errno’ to one of the following
  2597. values.
  2598. ‘EBADF’
  2599. The file descriptor FILDES is not valid.
  2600. ‘ENOSYS’
  2601. ‘aio_cancel’ is not implemented.
  2602. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’, this
  2603. function is in fact ‘aio_cancel64’ since the LFS interface
  2604. transparently replaces the normal implementation.
  2605. -- Function: int aio_cancel64 (int FILDES, struct aiocb64 *AIOCBP)
  2606. Preliminary: | MT-Safe | AS-Unsafe lock heap | AC-Unsafe lock mem |
  2607. *Note POSIX Safety Concepts::.
  2608. This function is similar to ‘aio_cancel’ with the only difference
  2609. that the argument is a reference to a variable of type ‘struct
  2610. aiocb64’.
  2611. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’, this
  2612. function is available under the name ‘aio_cancel’ and so
  2613. transparently replaces the interface for small files on 32 bit
  2614. machines.
  2615. 
  2616. File: libc.info, Node: Configuration of AIO, Prev: Cancel AIO Operations, Up: Asynchronous I/O
  2617. 13.11.5 How to optimize the AIO implementation
  2618. ----------------------------------------------
  2619. The POSIX standard does not specify how the AIO functions are
  2620. implemented. They could be system calls, but it is also possible to
  2621. emulate them at userlevel.
  2622. At the time of writing, the available implementation is a user-level
  2623. implementation which uses threads for handling the enqueued requests.
  2624. While this implementation requires making some decisions about
  2625. limitations, hard limitations are something best avoided in the GNU C
  2626. Library. Therefore, the GNU C Library provides a means for tuning the
  2627. AIO implementation according to the individual use.
  2628. -- Data Type: struct aioinit
  2629. This data type is used to pass the configuration or tunable
  2630. parameters to the implementation. The program has to initialize
  2631. the members of this struct and pass it to the implementation using
  2632. the ‘aio_init’ function.
  2633. ‘int aio_threads’
  2634. This member specifies the maximal number of threads which may
  2635. be used at any one time.
  2636. ‘int aio_num’
  2637. This number provides an estimate on the maximal number of
  2638. simultaneously enqueued requests.
  2639. ‘int aio_locks’
  2640. Unused.
  2641. ‘int aio_usedba’
  2642. Unused.
  2643. ‘int aio_debug’
  2644. Unused.
  2645. ‘int aio_numusers’
  2646. Unused.
  2647. ‘int aio_reserved[2]’
  2648. Unused.
  2649. -- Function: void aio_init (const struct aioinit *INIT)
  2650. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  2651. POSIX Safety Concepts::.
  2652. This function must be called before any other AIO function.
  2653. Calling it is completely voluntary, as it is only meant to help the
  2654. AIO implementation perform better.
  2655. Before calling ‘aio_init’, the members of a variable of type
  2656. ‘struct aioinit’ must be initialized. Then a reference to this
  2657. variable is passed as the parameter to ‘aio_init’ which itself may
  2658. or may not pay attention to the hints.
  2659. The function has no return value and no error cases are defined.
  2660. It is an extension which follows a proposal from the SGI
  2661. implementation in Irix 6. It is not covered by POSIX.1b or Unix98.
  2662. 
  2663. File: libc.info, Node: Control Operations, Next: Duplicating Descriptors, Prev: Asynchronous I/O, Up: Low-Level I/O
  2664. 13.12 Control Operations on Files
  2665. =================================
  2666. This section describes how you can perform various other operations on
  2667. file descriptors, such as inquiring about or setting flags describing
  2668. the status of the file descriptor, manipulating record locks, and the
  2669. like. All of these operations are performed by the function ‘fcntl’.
  2670. The second argument to the ‘fcntl’ function is a command that
  2671. specifies which operation to perform. The function and macros that name
  2672. various flags that are used with it are declared in the header file
  2673. ‘fcntl.h’. Many of these flags are also used by the ‘open’ function;
  2674. see *note Opening and Closing Files::.
  2675. -- Function: int fcntl (int FILEDES, int COMMAND, ...)
  2676. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2677. Concepts::.
  2678. The ‘fcntl’ function performs the operation specified by COMMAND on
  2679. the file descriptor FILEDES. Some commands require additional
  2680. arguments to be supplied. These additional arguments and the
  2681. return value and error conditions are given in the detailed
  2682. descriptions of the individual commands.
  2683. Briefly, here is a list of what the various commands are. For an
  2684. exhaustive list of kernel-specific options, please see *Note System
  2685. Calls::.
  2686. ‘F_DUPFD’
  2687. Duplicate the file descriptor (return another file descriptor
  2688. pointing to the same open file). *Note Duplicating
  2689. Descriptors::.
  2690. ‘F_GETFD’
  2691. Get flags associated with the file descriptor. *Note
  2692. Descriptor Flags::.
  2693. ‘F_SETFD’
  2694. Set flags associated with the file descriptor. *Note
  2695. Descriptor Flags::.
  2696. ‘F_GETFL’
  2697. Get flags associated with the open file. *Note File Status
  2698. Flags::.
  2699. ‘F_SETFL’
  2700. Set flags associated with the open file. *Note File Status
  2701. Flags::.
  2702. ‘F_GETLK’
  2703. Test a file lock. *Note File Locks::.
  2704. ‘F_SETLK’
  2705. Set or clear a file lock. *Note File Locks::.
  2706. ‘F_SETLKW’
  2707. Like ‘F_SETLK’, but wait for completion. *Note File Locks::.
  2708. ‘F_OFD_GETLK’
  2709. Test an open file description lock. *Note Open File
  2710. Description Locks::. Specific to Linux.
  2711. ‘F_OFD_SETLK’
  2712. Set or clear an open file description lock. *Note Open File
  2713. Description Locks::. Specific to Linux.
  2714. ‘F_OFD_SETLKW’
  2715. Like ‘F_OFD_SETLK’, but block until lock is acquired. *Note
  2716. Open File Description Locks::. Specific to Linux.
  2717. ‘F_GETOWN’
  2718. Get process or process group ID to receive ‘SIGIO’ signals.
  2719. *Note Interrupt Input::.
  2720. ‘F_SETOWN’
  2721. Set process or process group ID to receive ‘SIGIO’ signals.
  2722. *Note Interrupt Input::.
  2723. This function is a cancellation point in multi-threaded programs
  2724. for the commands ‘F_SETLKW’ (and the LFS analogous ‘F_SETLKW64’)
  2725. and ‘F_OFD_SETLKW’. This is a problem if the thread allocates some
  2726. resources (like memory, file descriptors, semaphores or whatever)
  2727. at the time ‘fcntl’ is called. If the thread gets canceled these
  2728. resources stay allocated until the program ends. To avoid this
  2729. calls to ‘fcntl’ should be protected using cancellation handlers.
  2730. 
  2731. File: libc.info, Node: Duplicating Descriptors, Next: Descriptor Flags, Prev: Control Operations, Up: Low-Level I/O
  2732. 13.13 Duplicating Descriptors
  2733. =============================
  2734. You can “duplicate” a file descriptor, or allocate another file
  2735. descriptor that refers to the same open file as the original. Duplicate
  2736. descriptors share one file position and one set of file status flags
  2737. (*note File Status Flags::), but each has its own set of file descriptor
  2738. flags (*note Descriptor Flags::).
  2739. The major use of duplicating a file descriptor is to implement
  2740. “redirection” of input or output: that is, to change the file or pipe
  2741. that a particular file descriptor corresponds to.
  2742. You can perform this operation using the ‘fcntl’ function with the
  2743. ‘F_DUPFD’ command, but there are also convenient functions ‘dup’ and
  2744. ‘dup2’ for duplicating descriptors.
  2745. The ‘fcntl’ function and flags are declared in ‘fcntl.h’, while
  2746. prototypes for ‘dup’ and ‘dup2’ are in the header file ‘unistd.h’.
  2747. -- Function: int dup (int OLD)
  2748. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2749. Concepts::.
  2750. This function copies descriptor OLD to the first available
  2751. descriptor number (the first number not currently open). It is
  2752. equivalent to ‘fcntl (OLD, F_DUPFD, 0)’.
  2753. -- Function: int dup2 (int OLD, int NEW)
  2754. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2755. Concepts::.
  2756. This function copies the descriptor OLD to descriptor number NEW.
  2757. If OLD is an invalid descriptor, then ‘dup2’ does nothing; it does
  2758. not close NEW. Otherwise, the new duplicate of OLD replaces any
  2759. previous meaning of descriptor NEW, as if NEW were closed first.
  2760. If OLD and NEW are different numbers, and OLD is a valid descriptor
  2761. number, then ‘dup2’ is equivalent to:
  2762. close (NEW);
  2763. fcntl (OLD, F_DUPFD, NEW)
  2764. However, ‘dup2’ does this atomically; there is no instant in the
  2765. middle of calling ‘dup2’ at which NEW is closed and not yet a
  2766. duplicate of OLD.
  2767. -- Function: int dup3 (int OLD, int NEW, int FLAGS)
  2768. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2769. Concepts::.
  2770. This function is the same as ‘dup2’ but creates the new descriptor
  2771. as if it had been opened with flags FLAGS. The only allowed flag
  2772. is ‘O_CLOEXEC’.
  2773. This function was originally a Linux extension, but was added in
  2774. POSIX.1-2024.
  2775. -- Macro: int F_DUPFD
  2776. This macro is used as the COMMAND argument to ‘fcntl’, to copy the
  2777. file descriptor given as the first argument.
  2778. The form of the call in this case is:
  2779. fcntl (OLD, F_DUPFD, NEXT-FILEDES)
  2780. The NEXT-FILEDES argument is of type ‘int’ and specifies that the
  2781. file descriptor returned should be the next available one greater
  2782. than or equal to this value.
  2783. The return value from ‘fcntl’ with this command is normally the
  2784. value of the new file descriptor. A return value of -1 indicates
  2785. an error. The following ‘errno’ error conditions are defined for
  2786. this command:
  2787. ‘EBADF’
  2788. The OLD argument is invalid.
  2789. ‘EINVAL’
  2790. The NEXT-FILEDES argument is invalid.
  2791. ‘EMFILE’
  2792. There are no more file descriptors available--your program is
  2793. already using the maximum. In BSD and GNU, the maximum is
  2794. controlled by a resource limit that can be changed; *note
  2795. Limits on Resources::, for more information about the
  2796. ‘RLIMIT_NOFILE’ limit.
  2797. ‘ENFILE’ is not a possible error code for ‘dup2’ because ‘dup2’
  2798. does not create a new opening of a file; duplicate descriptors do
  2799. not count toward the limit which ‘ENFILE’ indicates. ‘EMFILE’ is
  2800. possible because it refers to the limit on distinct descriptor
  2801. numbers in use in one process.
  2802. Here is an example showing how to use ‘dup2’ to do redirection.
  2803. Typically, redirection of the standard streams (like ‘stdin’) is done by
  2804. a shell or shell-like program before calling one of the ‘exec’ functions
  2805. (*note Executing a File::) to execute a new program in a child process.
  2806. When the new program is executed, it creates and initializes the
  2807. standard streams to point to the corresponding file descriptors, before
  2808. its ‘main’ function is invoked.
  2809. So, to redirect standard input to a file, the shell could do
  2810. something like:
  2811. pid = fork ();
  2812. if (pid == 0)
  2813. {
  2814. char *filename;
  2815. char *program;
  2816. int file;
  2817. ...
  2818. file = TEMP_FAILURE_RETRY (open (filename, O_RDONLY));
  2819. dup2 (file, STDIN_FILENO);
  2820. TEMP_FAILURE_RETRY (close (file));
  2821. execv (program, NULL);
  2822. }
  2823. There is also a more detailed example showing how to implement
  2824. redirection in the context of a pipeline of processes in *note Launching
  2825. Jobs::.
  2826. 
  2827. File: libc.info, Node: Descriptor Flags, Next: File Status Flags, Prev: Duplicating Descriptors, Up: Low-Level I/O
  2828. 13.14 File Descriptor Flags
  2829. ===========================
  2830. “File descriptor flags” are miscellaneous attributes of a file
  2831. descriptor. These flags are associated with particular file
  2832. descriptors, so that if you have created duplicate file descriptors from
  2833. a single opening of a file, each descriptor has its own set of flags.
  2834. Currently there is just one file descriptor flag: ‘FD_CLOEXEC’, which
  2835. causes the descriptor to be closed if you use any of the ‘exec...’
  2836. functions (*note Executing a File::).
  2837. The symbols in this section are defined in the header file ‘fcntl.h’.
  2838. -- Macro: int F_GETFD
  2839. This macro is used as the COMMAND argument to ‘fcntl’, to specify
  2840. that it should return the file descriptor flags associated with the
  2841. FILEDES argument.
  2842. The normal return value from ‘fcntl’ with this command is a
  2843. nonnegative number which can be interpreted as the bitwise OR of
  2844. the individual flags (except that currently there is only one flag
  2845. to use).
  2846. In case of an error, ‘fcntl’ returns -1. The following ‘errno’
  2847. error conditions are defined for this command:
  2848. ‘EBADF’
  2849. The FILEDES argument is invalid.
  2850. -- Macro: int F_SETFD
  2851. This macro is used as the COMMAND argument to ‘fcntl’, to specify
  2852. that it should set the file descriptor flags associated with the
  2853. FILEDES argument. This requires a third ‘int’ argument to specify
  2854. the new flags, so the form of the call is:
  2855. fcntl (FILEDES, F_SETFD, NEW-FLAGS)
  2856. The normal return value from ‘fcntl’ with this command is an
  2857. unspecified value other than -1, which indicates an error. The
  2858. flags and error conditions are the same as for the ‘F_GETFD’
  2859. command.
  2860. The following macro is defined for use as a file descriptor flag with
  2861. the ‘fcntl’ function. The value is an integer constant usable as a bit
  2862. mask value.
  2863. -- Macro: int FD_CLOEXEC
  2864. This flag specifies that the file descriptor should be closed when
  2865. an ‘exec’ function is invoked; see *note Executing a File::. When
  2866. a file descriptor is allocated (as with ‘open’ or ‘dup’), this bit
  2867. is initially cleared on the new file descriptor, meaning that
  2868. descriptor will survive into the new program after ‘exec’.
  2869. If you want to modify the file descriptor flags, you should get the
  2870. current flags with ‘F_GETFD’ and modify the value. Don't assume that
  2871. the flags listed here are the only ones that are implemented; your
  2872. program may be run years from now and more flags may exist then. For
  2873. example, here is a function to set or clear the flag ‘FD_CLOEXEC’
  2874. without altering any other flags:
  2875. /* Set the ‘FD_CLOEXEC’ flag of DESC if VALUE is nonzero,
  2876. or clear the flag if VALUE is 0.
  2877. Return 0 on success, or -1 on error with ‘errno’ set. */
  2878. int
  2879. set_cloexec_flag (int desc, int value)
  2880. {
  2881. int oldflags = fcntl (desc, F_GETFD, 0);
  2882. /* If reading the flags failed, return error indication now. */
  2883. if (oldflags < 0)
  2884. return oldflags;
  2885. /* Set just the flag we want to set. */
  2886. if (value != 0)
  2887. oldflags |= FD_CLOEXEC;
  2888. else
  2889. oldflags &= ~FD_CLOEXEC;
  2890. /* Store modified flag word in the descriptor. */
  2891. return fcntl (desc, F_SETFD, oldflags);
  2892. }
  2893. 
  2894. File: libc.info, Node: File Status Flags, Next: File Locks, Prev: Descriptor Flags, Up: Low-Level I/O
  2895. 13.15 File Status Flags
  2896. =======================
  2897. “File status flags” are used to specify attributes of the opening of a
  2898. file. Unlike the file descriptor flags discussed in *note Descriptor
  2899. Flags::, the file status flags are shared by duplicated file descriptors
  2900. resulting from a single opening of the file. The file status flags are
  2901. specified with the FLAGS argument to ‘open’; *note Opening and Closing
  2902. Files::.
  2903. File status flags fall into three categories, which are described in
  2904. the following sections.
  2905. • *note Access Modes::, specify what type of access is allowed to the
  2906. file: reading, writing, or both. They are set by ‘open’ and are
  2907. returned by ‘fcntl’, but cannot be changed.
  2908. • *note Open-time Flags::, control details of what ‘open’ will do.
  2909. These flags are not preserved after the ‘open’ call.
  2910. • *note Operating Modes::, affect how operations such as ‘read’ and
  2911. ‘write’ are done. They are set by ‘open’, and can be fetched or
  2912. changed with ‘fcntl’.
  2913. The symbols in this section are defined in the header file ‘fcntl.h’.
  2914. * Menu:
  2915. * Access Modes:: Whether the descriptor can read or write.
  2916. * Open-time Flags:: Details of ‘open’.
  2917. * Operating Modes:: Special modes to control I/O operations.
  2918. * Getting File Status Flags:: Fetching and changing these flags.
  2919. 
  2920. File: libc.info, Node: Access Modes, Next: Open-time Flags, Up: File Status Flags
  2921. 13.15.1 File Access Modes
  2922. -------------------------
  2923. The file access mode allows a file descriptor to be used for reading,
  2924. writing, both, or neither. The access mode is determined when the file
  2925. is opened, and never change.
  2926. -- Macro: int O_RDONLY
  2927. Open the file for read access.
  2928. -- Macro: int O_WRONLY
  2929. Open the file for write access.
  2930. -- Macro: int O_RDWR
  2931. Open the file for both reading and writing.
  2932. -- Macro: int O_PATH
  2933. Obtain a file descriptor for the file, but do not open the file for
  2934. reading or writing. Permission checks for the file itself are
  2935. skipped when the file is opened (but permission to access the
  2936. directory that contains it is still needed), and permissions are
  2937. checked when the descriptor is used later on.
  2938. For example, such descriptors can be used with the ‘fexecve’
  2939. function (*note Executing a File::). Other applications involve
  2940. the ‘*at’ function variants, along with the ‘AT_EMPTY_PATH’ flag.
  2941. *Note Descriptor-Relative Access::.
  2942. This access mode is specific to Linux. On GNU/Hurd systems, it is
  2943. possible to use ‘O_EXEC’ explicitly, or specify no access modes at
  2944. all (see below).
  2945. The portable file access modes ‘O_RDONLY’, ‘O_WRONLY’, and ‘O_RDWR’
  2946. may not correspond to individual bits. To determine the file access
  2947. mode with ‘fcntl’, you must extract the access mode bits from the
  2948. retrieved file status flags, using the ‘O_ACCMODE’ mask.
  2949. -- Macro: int O_ACCMODE
  2950. This macro is a mask that can be bitwise-ANDed with the file status
  2951. flag value to recover the file access mode, assuming that a
  2952. standard file access mode is in use.
  2953. If a non-standard file access mode is used (such as ‘O_PATH’ or
  2954. ‘O_EXEC’), masking with ‘O_ACCMODE’ may give incorrect results. These
  2955. non-standard access modes are identified by individual bits and have to
  2956. be checked directly (without masking with ‘O_ACCMODE’ first).
  2957. On GNU/Hurd systems (but not on other systems), ‘O_RDONLY’ and
  2958. ‘O_WRONLY’ are independent bits that can be bitwise-ORed together, and
  2959. it is valid for either bit to be set or clear. This means that ‘O_RDWR’
  2960. is the same as ‘O_RDONLY|O_WRONLY’. A file access mode of zero is
  2961. permissible; it allows no operations that do input or output to the
  2962. file, but does allow other operations such as ‘fchmod’. On GNU/Hurd
  2963. systems, since "read-only" or "write-only" is a misnomer, ‘fcntl.h’
  2964. defines additional names for the file access modes.
  2965. -- Macro: int O_READ
  2966. Open the file for reading. Same as ‘O_RDONLY’; only defined on
  2967. GNU/Hurd.
  2968. -- Macro: int O_WRITE
  2969. Open the file for writing. Same as ‘O_WRONLY’; only defined on
  2970. GNU/Hurd.
  2971. -- Macro: int O_EXEC
  2972. Open the file for executing. Only defined on GNU/Hurd.
  2973. 
  2974. File: libc.info, Node: Open-time Flags, Next: Operating Modes, Prev: Access Modes, Up: File Status Flags
  2975. 13.15.2 Open-time Flags
  2976. -----------------------
  2977. The open-time flags specify options affecting how ‘open’ will behave.
  2978. These options are not preserved once the file is open. The exception to
  2979. this is ‘O_NONBLOCK’, which is also an I/O operating mode and so it _is_
  2980. saved. *Note Opening and Closing Files::, for how to call ‘open’.
  2981. There are two sorts of options specified by open-time flags.
  2982. • “File name translation flags” affect how ‘open’ looks up the file
  2983. name to locate the file, and whether the file can be created.
  2984. • “Open-time action flags” specify extra operations that ‘open’ will
  2985. perform on the file once it is open.
  2986. Here are the file name translation flags.
  2987. -- Macro: int O_CREAT
  2988. If set, the file will be created if it doesn't already exist.
  2989. -- Macro: int O_EXCL
  2990. If both ‘O_CREAT’ and ‘O_EXCL’ are set, then ‘open’ fails if the
  2991. specified file already exists. This is guaranteed to never clobber
  2992. an existing file.
  2993. The ‘O_EXCL’ flag has a special meaning in combination with
  2994. ‘O_TMPFILE’; see below.
  2995. -- Macro: int O_DIRECTORY
  2996. If set, the open operation fails if the given name is not the name
  2997. of a directory. The ‘errno’ variable is set to ‘ENOTDIR’ for this
  2998. error condition.
  2999. -- Macro: int O_NOFOLLOW
  3000. If set, the open operation fails if the final component of the file
  3001. name refers to a symbolic link. The ‘errno’ variable is set to
  3002. ‘ELOOP’ for this error condition.
  3003. -- Macro: int O_TMPFILE
  3004. If this flag is specified, functions in the ‘open’ family create an
  3005. unnamed temporary file. In this case, the pathname argument to the
  3006. ‘open’ family of functions (*note Opening and Closing Files::) is
  3007. interpreted as the directory in which the temporary file is created
  3008. (thus determining the file system which provides the storage for
  3009. the file). The ‘O_TMPFILE’ flag must be combined with ‘O_WRONLY’
  3010. or ‘O_RDWR’, and the MODE argument is required.
  3011. The temporary file can later be given a name using ‘linkat’,
  3012. turning it into a regular file. This allows the atomic creation of
  3013. a file with the specific file attributes (mode and extended
  3014. attributes) and file contents. If, for security reasons, it is not
  3015. desirable that a name can be given to the file, the ‘O_EXCL’ flag
  3016. can be specified along with ‘O_TMPFILE’.
  3017. Not all kernels support this open flag. If this flag is
  3018. unsupported, an attempt to create an unnamed temporary file fails
  3019. with an error of ‘EINVAL’. If the underlying file system does not
  3020. support the ‘O_TMPFILE’ flag, an ‘EOPNOTSUPP’ error is the result.
  3021. The ‘O_TMPFILE’ flag is a GNU extension.
  3022. -- Macro: int O_NONBLOCK
  3023. This prevents ‘open’ from blocking for a "long time" to open the
  3024. file. This is only meaningful for some kinds of files, usually
  3025. devices such as serial ports; when it is not meaningful, it is
  3026. harmless and ignored. Often, opening a port to a modem blocks
  3027. until the modem reports carrier detection; if ‘O_NONBLOCK’ is
  3028. specified, ‘open’ will return immediately without a carrier.
  3029. Note that the ‘O_NONBLOCK’ flag is overloaded as both an I/O
  3030. operating mode and a file name translation flag. This means that
  3031. specifying ‘O_NONBLOCK’ in ‘open’ also sets nonblocking I/O mode;
  3032. *note Operating Modes::. To open the file without blocking but do
  3033. normal I/O that blocks, you must call ‘open’ with ‘O_NONBLOCK’ set
  3034. and then call ‘fcntl’ to turn the bit off.
  3035. -- Macro: int O_NOCTTY
  3036. If the named file is a terminal device, don't make it the
  3037. controlling terminal for the process. *Note Job Control::, for
  3038. information about what it means to be the controlling terminal.
  3039. On GNU/Hurd systems and 4.4 BSD, opening a file never makes it the
  3040. controlling terminal and ‘O_NOCTTY’ is zero. However, GNU/Linux
  3041. systems and some other systems use a nonzero value for ‘O_NOCTTY’
  3042. and set the controlling terminal when you open a file that is a
  3043. terminal device; so to be portable, use ‘O_NOCTTY’ when it is
  3044. important to avoid this.
  3045. The following three file name translation flags exist only on
  3046. GNU/Hurd systems.
  3047. -- Macro: int O_IGNORE_CTTY
  3048. Do not recognize the named file as the controlling terminal, even
  3049. if it refers to the process's existing controlling terminal device.
  3050. Operations on the new file descriptor will never induce job control
  3051. signals. *Note Job Control::.
  3052. -- Macro: int O_NOLINK
  3053. If the named file is a symbolic link, open the link itself instead
  3054. of the file it refers to. (‘fstat’ on the new file descriptor will
  3055. return the information returned by ‘lstat’ on the link's name.)
  3056. -- Macro: int O_NOTRANS
  3057. If the named file is specially translated, do not invoke the
  3058. translator. Open the bare file the translator itself sees.
  3059. The open-time action flags tell ‘open’ to do additional operations
  3060. which are not really related to opening the file. The reason to do them
  3061. as part of ‘open’ instead of in separate calls is that ‘open’ can do
  3062. them atomically.
  3063. -- Macro: int O_TRUNC
  3064. Truncate the file to zero length. This option is only useful for
  3065. regular files, not special files such as directories or FIFOs.
  3066. POSIX.1 requires that you open the file for writing to use
  3067. ‘O_TRUNC’. In BSD and GNU you must have permission to write the
  3068. file to truncate it, but you need not open for write access.
  3069. This is the only open-time action flag specified by POSIX.1. There
  3070. is no good reason for truncation to be done by ‘open’, instead of
  3071. by calling ‘ftruncate’ afterwards. The ‘O_TRUNC’ flag existed in
  3072. Unix before ‘ftruncate’ was invented, and is retained for backward
  3073. compatibility.
  3074. The remaining operating modes are BSD extensions. They exist only on
  3075. some systems. On other systems, these macros are not defined.
  3076. -- Macro: int O_SHLOCK
  3077. Acquire a shared lock on the file, as with ‘flock’. *Note File
  3078. Locks::.
  3079. If ‘O_CREAT’ is specified, the locking is done atomically when
  3080. creating the file. You are guaranteed that no other process will
  3081. get the lock on the new file first.
  3082. -- Macro: int O_EXLOCK
  3083. Acquire an exclusive lock on the file, as with ‘flock’. *Note File
  3084. Locks::. This is atomic like ‘O_SHLOCK’.
  3085. 
  3086. File: libc.info, Node: Operating Modes, Next: Getting File Status Flags, Prev: Open-time Flags, Up: File Status Flags
  3087. 13.15.3 I/O Operating Modes
  3088. ---------------------------
  3089. The operating modes affect how input and output operations using a file
  3090. descriptor work. These flags are set by ‘open’ and can be fetched and
  3091. changed with ‘fcntl’.
  3092. -- Macro: int O_APPEND
  3093. The bit that enables append mode for the file. If set, then all
  3094. ‘write’ operations write the data at the end of the file, extending
  3095. it, regardless of the current file position. This is the only
  3096. reliable way to append to a file. In append mode, you are
  3097. guaranteed that the data you write will always go to the current
  3098. end of the file, regardless of other processes writing to the file.
  3099. Conversely, if you simply set the file position to the end of file
  3100. and write, then another process can extend the file after you set
  3101. the file position but before you write, resulting in your data
  3102. appearing someplace before the real end of file.
  3103. -- Macro: int O_NONBLOCK
  3104. The bit that enables nonblocking mode for the file. If this bit is
  3105. set, ‘read’ requests on the file can return immediately with a
  3106. failure status if there is no input immediately available, instead
  3107. of blocking. Likewise, ‘write’ requests can also return
  3108. immediately with a failure status if the output can't be written
  3109. immediately.
  3110. Note that the ‘O_NONBLOCK’ flag is overloaded as both an I/O
  3111. operating mode and a file name translation flag; *note Open-time
  3112. Flags::.
  3113. -- Macro: int O_NDELAY
  3114. This is an obsolete name for ‘O_NONBLOCK’, provided for
  3115. compatibility with BSD. It is not defined by the POSIX.1 standard.
  3116. The remaining operating modes are BSD and GNU extensions. They exist
  3117. only on some systems. On other systems, these macros are not defined.
  3118. -- Macro: int O_ASYNC
  3119. The bit that enables asynchronous input mode. If set, then ‘SIGIO’
  3120. signals will be generated when input is available. *Note Interrupt
  3121. Input::.
  3122. Asynchronous input mode is a BSD feature.
  3123. -- Macro: int O_FSYNC
  3124. The bit that enables synchronous writing for the file. If set,
  3125. each ‘write’ call will make sure the data is reliably stored on
  3126. disk before returning.
  3127. Synchronous writing is a BSD feature.
  3128. -- Macro: int O_SYNC
  3129. This is another name for ‘O_FSYNC’. They have the same value.
  3130. -- Macro: int O_NOATIME
  3131. If this bit is set, ‘read’ will not update the access time of the
  3132. file. *Note File Times::. This is used by programs that do
  3133. backups, so that backing a file up does not count as reading it.
  3134. Only the owner of the file or the superuser may use this bit.
  3135. This is a GNU extension.
  3136. 
  3137. File: libc.info, Node: Getting File Status Flags, Prev: Operating Modes, Up: File Status Flags
  3138. 13.15.4 Getting and Setting File Status Flags
  3139. ---------------------------------------------
  3140. The ‘fcntl’ function can fetch or change file status flags.
  3141. -- Macro: int F_GETFL
  3142. This macro is used as the COMMAND argument to ‘fcntl’, to read the
  3143. file status flags for the open file with descriptor FILEDES.
  3144. The normal return value from ‘fcntl’ with this command is a
  3145. nonnegative number which can be interpreted as the bitwise OR of
  3146. the individual flags. Since the file access modes are not
  3147. single-bit values, you can mask off other bits in the returned
  3148. flags with ‘O_ACCMODE’ to compare them.
  3149. In case of an error, ‘fcntl’ returns -1. The following ‘errno’
  3150. error conditions are defined for this command:
  3151. ‘EBADF’
  3152. The FILEDES argument is invalid.
  3153. -- Macro: int F_SETFL
  3154. This macro is used as the COMMAND argument to ‘fcntl’, to set the
  3155. file status flags for the open file corresponding to the FILEDES
  3156. argument. This command requires a third ‘int’ argument to specify
  3157. the new flags, so the call looks like this:
  3158. fcntl (FILEDES, F_SETFL, NEW-FLAGS)
  3159. You can't change the access mode for the file in this way; that is,
  3160. whether the file descriptor was opened for reading or writing.
  3161. The normal return value from ‘fcntl’ with this command is an
  3162. unspecified value other than -1, which indicates an error. The
  3163. error conditions are the same as for the ‘F_GETFL’ command.
  3164. If you want to modify the file status flags, you should get the
  3165. current flags with ‘F_GETFL’ and modify the value. Don't assume that
  3166. the flags listed here are the only ones that are implemented; your
  3167. program may be run years from now and more flags may exist then. For
  3168. example, here is a function to set or clear the flag ‘O_NONBLOCK’
  3169. without altering any other flags:
  3170. /* Set the ‘O_NONBLOCK’ flag of DESC if VALUE is nonzero,
  3171. or clear the flag if VALUE is 0.
  3172. Return 0 on success, or -1 on error with ‘errno’ set. */
  3173. int
  3174. set_nonblock_flag (int desc, int value)
  3175. {
  3176. int oldflags = fcntl (desc, F_GETFL, 0);
  3177. /* If reading the flags failed, return error indication now. */
  3178. if (oldflags == -1)
  3179. return -1;
  3180. /* Set just the flag we want to set. */
  3181. if (value != 0)
  3182. oldflags |= O_NONBLOCK;
  3183. else
  3184. oldflags &= ~O_NONBLOCK;
  3185. /* Store modified flag word in the descriptor. */
  3186. return fcntl (desc, F_SETFL, oldflags);
  3187. }
  3188. 
  3189. File: libc.info, Node: File Locks, Next: Open File Description Locks, Prev: File Status Flags, Up: Low-Level I/O
  3190. 13.16 File Locks
  3191. ================
  3192. This section describes record locks that are associated with the
  3193. process. There is also a different type of record lock that is
  3194. associated with the open file description instead of the process. *Note
  3195. Open File Description Locks::.
  3196. The remaining ‘fcntl’ commands are used to support “record locking”,
  3197. which permits multiple cooperating programs to prevent each other from
  3198. simultaneously accessing parts of a file in error-prone ways.
  3199. An “exclusive” or “write” lock gives a process exclusive access for
  3200. writing to the specified part of the file. While a write lock is in
  3201. place, no other process can lock that part of the file.
  3202. A “shared” or “read” lock prohibits any other process from requesting
  3203. a write lock on the specified part of the file. However, other
  3204. processes can request read locks.
  3205. The ‘read’ and ‘write’ functions do not actually check to see whether
  3206. there are any locks in place. If you want to implement a locking
  3207. protocol for a file shared by multiple processes, your application must
  3208. do explicit ‘fcntl’ calls to request and clear locks at the appropriate
  3209. points.
  3210. Locks are associated with processes. A process can only have one
  3211. kind of lock set for each byte of a given file. When any file
  3212. descriptor for that file is closed by the process, all of the locks that
  3213. process holds on that file are released, even if the locks were made
  3214. using other descriptors that remain open. Likewise, locks are released
  3215. when a process exits, and are not inherited by child processes created
  3216. using ‘fork’ (*note Creating a Process::).
  3217. When making a lock, use a ‘struct flock’ to specify what kind of lock
  3218. and where. This data type and the associated macros for the ‘fcntl’
  3219. function are declared in the header file ‘fcntl.h’.
  3220. -- Data Type: struct flock
  3221. This structure is used with the ‘fcntl’ function to describe a file
  3222. lock. It has these members:
  3223. ‘short int l_type’
  3224. Specifies the type of the lock; one of ‘F_RDLCK’, ‘F_WRLCK’,
  3225. or ‘F_UNLCK’.
  3226. ‘short int l_whence’
  3227. This corresponds to the WHENCE argument to ‘fseek’ or ‘lseek’,
  3228. and specifies what the offset is relative to. Its value can
  3229. be one of ‘SEEK_SET’, ‘SEEK_CUR’, or ‘SEEK_END’.
  3230. ‘off_t l_start’
  3231. This specifies the offset of the start of the region to which
  3232. the lock applies, and is given in bytes relative to the point
  3233. specified by the ‘l_whence’ member.
  3234. ‘off_t l_len’
  3235. This specifies the length of the region to be locked. A value
  3236. of ‘0’ is treated specially; it means the region extends to
  3237. the end of the file.
  3238. ‘pid_t l_pid’
  3239. This field is the process ID (*note Process Creation
  3240. Concepts::) of the process holding the lock. It is filled in
  3241. by calling ‘fcntl’ with the ‘F_GETLK’ command, but is ignored
  3242. when making a lock. If the conflicting lock is an open file
  3243. description lock (*note Open File Description Locks::), then
  3244. this field will be set to -1.
  3245. -- Macro: int F_GETLK
  3246. This macro is used as the COMMAND argument to ‘fcntl’, to specify
  3247. that it should get information about a lock. This command requires
  3248. a third argument of type ‘struct flock *’ to be passed to ‘fcntl’,
  3249. so that the form of the call is:
  3250. fcntl (FILEDES, F_GETLK, LOCKP)
  3251. If there is a lock already in place that would block the lock
  3252. described by the LOCKP argument, information about that lock
  3253. overwrites ‘*LOCKP’. Existing locks are not reported if they are
  3254. compatible with making a new lock as specified. Thus, you should
  3255. specify a lock type of ‘F_WRLCK’ if you want to find out about both
  3256. read and write locks, or ‘F_RDLCK’ if you want to find out about
  3257. write locks only.
  3258. There might be more than one lock affecting the region specified by
  3259. the LOCKP argument, but ‘fcntl’ only returns information about one
  3260. of them. The ‘l_whence’ member of the LOCKP structure is set to
  3261. ‘SEEK_SET’ and the ‘l_start’ and ‘l_len’ fields set to identify the
  3262. locked region.
  3263. If no lock applies, the only change to the LOCKP structure is to
  3264. update the ‘l_type’ to a value of ‘F_UNLCK’.
  3265. The normal return value from ‘fcntl’ with this command is an
  3266. unspecified value other than -1, which is reserved to indicate an
  3267. error. The following ‘errno’ error conditions are defined for this
  3268. command:
  3269. ‘EBADF’
  3270. The FILEDES argument is invalid.
  3271. ‘EINVAL’
  3272. Either the LOCKP argument doesn't specify valid lock
  3273. information, or the file associated with FILEDES doesn't
  3274. support locks.
  3275. -- Macro: int F_SETLK
  3276. This macro is used as the COMMAND argument to ‘fcntl’, to specify
  3277. that it should set or clear a lock. This command requires a third
  3278. argument of type ‘struct flock *’ to be passed to ‘fcntl’, so that
  3279. the form of the call is:
  3280. fcntl (FILEDES, F_SETLK, LOCKP)
  3281. If the process already has a lock on any part of the region, the
  3282. old lock on that part is replaced with the new lock. You can
  3283. remove a lock by specifying a lock type of ‘F_UNLCK’.
  3284. If the lock cannot be set, ‘fcntl’ returns immediately with a value
  3285. of -1. This function does not block while waiting for other
  3286. processes to release locks. If ‘fcntl’ succeeds, it returns a
  3287. value other than -1.
  3288. The following ‘errno’ error conditions are defined for this
  3289. function:
  3290. ‘EAGAIN’
  3291. ‘EACCES’
  3292. The lock cannot be set because it is blocked by an existing
  3293. lock on the file. Some systems use ‘EAGAIN’ in this case, and
  3294. other systems use ‘EACCES’; your program should treat them
  3295. alike, after ‘F_SETLK’. (GNU/Linux and GNU/Hurd systems
  3296. always use ‘EAGAIN’.)
  3297. ‘EBADF’
  3298. Either: the FILEDES argument is invalid; you requested a read
  3299. lock but the FILEDES is not open for read access; or, you
  3300. requested a write lock but the FILEDES is not open for write
  3301. access.
  3302. ‘EINVAL’
  3303. Either the LOCKP argument doesn't specify valid lock
  3304. information, or the file associated with FILEDES doesn't
  3305. support locks.
  3306. ‘ENOLCK’
  3307. The system has run out of file lock resources; there are
  3308. already too many file locks in place.
  3309. Well-designed file systems never report this error, because
  3310. they have no limitation on the number of locks. However, you
  3311. must still take account of the possibility of this error, as
  3312. it could result from network access to a file system on
  3313. another machine.
  3314. -- Macro: int F_SETLKW
  3315. This macro is used as the COMMAND argument to ‘fcntl’, to specify
  3316. that it should set or clear a lock. It is just like the ‘F_SETLK’
  3317. command, but causes the process to block (or wait) until the
  3318. request can be specified.
  3319. This command requires a third argument of type ‘struct flock *’, as
  3320. for the ‘F_SETLK’ command.
  3321. The ‘fcntl’ return values and errors are the same as for the
  3322. ‘F_SETLK’ command, but these additional ‘errno’ error conditions
  3323. are defined for this command:
  3324. ‘EINTR’
  3325. The function was interrupted by a signal while it was waiting.
  3326. *Note Interrupted Primitives::.
  3327. ‘EDEADLK’
  3328. The specified region is being locked by another process. But
  3329. that process is waiting to lock a region which the current
  3330. process has locked, so waiting for the lock would result in
  3331. deadlock. The system does not guarantee that it will detect
  3332. all such conditions, but it lets you know if it notices one.
  3333. The following macros are defined for use as values for the ‘l_type’
  3334. member of the ‘flock’ structure. The values are integer constants.
  3335. ‘F_RDLCK’
  3336. This macro is used to specify a read (or shared) lock.
  3337. ‘F_WRLCK’
  3338. This macro is used to specify a write (or exclusive) lock.
  3339. ‘F_UNLCK’
  3340. This macro is used to specify that the region is unlocked.
  3341. As an example of a situation where file locking is useful, consider a
  3342. program that can be run simultaneously by several different users, that
  3343. logs status information to a common file. One example of such a program
  3344. might be a game that uses a file to keep track of high scores. Another
  3345. example might be a program that records usage or accounting information
  3346. for billing purposes.
  3347. Having multiple copies of the program simultaneously writing to the
  3348. file could cause the contents of the file to become mixed up. But you
  3349. can prevent this kind of problem by setting a write lock on the file
  3350. before actually writing to the file.
  3351. If the program also needs to read the file and wants to make sure
  3352. that the contents of the file are in a consistent state, then it can
  3353. also use a read lock. While the read lock is set, no other process can
  3354. lock that part of the file for writing.
  3355. Remember that file locks are only an _advisory_ protocol for
  3356. controlling access to a file. There is still potential for access to
  3357. the file by programs that don't use the lock protocol.
  3358. 
  3359. File: libc.info, Node: Open File Description Locks, Next: Open File Description Locks Example, Prev: File Locks, Up: Low-Level I/O
  3360. 13.17 Open File Description Locks
  3361. =================================
  3362. In contrast to process-associated record locks (*note File Locks::),
  3363. open file description record locks are associated with an open file
  3364. description rather than a process.
  3365. Using ‘fcntl’ to apply an open file description lock on a region that
  3366. already has an existing open file description lock that was created via
  3367. the same file descriptor will never cause a lock conflict.
  3368. Open file description locks are also inherited by child processes
  3369. across ‘fork’, or ‘clone’ with ‘CLONE_FILES’ set (*note Creating a
  3370. Process::), along with the file descriptor.
  3371. It is important to distinguish between the open file _description_
  3372. (an instance of an open file, usually created by a call to ‘open’) and
  3373. an open file _descriptor_, which is a numeric value that refers to the
  3374. open file description. The locks described here are associated with the
  3375. open file _description_ and not the open file _descriptor_.
  3376. Using ‘dup’ (*note Duplicating Descriptors::) to copy a file
  3377. descriptor does not give you a new open file description, but rather
  3378. copies a reference to an existing open file description and assigns it
  3379. to a new file descriptor. Thus, open file description locks set on a
  3380. file descriptor cloned by ‘dup’ will never conflict with open file
  3381. description locks set on the original descriptor since they refer to the
  3382. same open file description. Depending on the range and type of lock
  3383. involved, the original lock may be modified by a ‘F_OFD_SETLK’ or
  3384. ‘F_OFD_SETLKW’ command in this situation however.
  3385. Open file description locks always conflict with process-associated
  3386. locks, even if acquired by the same process or on the same open file
  3387. descriptor.
  3388. Open file description locks use the same ‘struct flock’ as
  3389. process-associated locks as an argument (*note File Locks::) and the
  3390. macros for the ‘command’ values are also declared in the header file
  3391. ‘fcntl.h’. To use them, the macro ‘_GNU_SOURCE’ must be defined prior
  3392. to including any header file.
  3393. In contrast to process-associated locks, any ‘struct flock’ used as
  3394. an argument to open file description lock commands must have the ‘l_pid’
  3395. value set to 0. Also, when returning information about an open file
  3396. description lock in a ‘F_GETLK’ or ‘F_OFD_GETLK’ request, the ‘l_pid’
  3397. field in ‘struct flock’ will be set to -1 to indicate that the lock is
  3398. not associated with a process.
  3399. When the same ‘struct flock’ is reused as an argument to a
  3400. ‘F_OFD_SETLK’ or ‘F_OFD_SETLKW’ request after being used for an
  3401. ‘F_OFD_GETLK’ request, it is necessary to inspect and reset the ‘l_pid’
  3402. field to 0.
  3403. -- Macro: int F_OFD_GETLK
  3404. This macro is used as the COMMAND argument to ‘fcntl’, to specify
  3405. that it should get information about a lock. This command requires
  3406. a third argument of type ‘struct flock *’ to be passed to ‘fcntl’,
  3407. so that the form of the call is:
  3408. fcntl (FILEDES, F_OFD_GETLK, LOCKP)
  3409. If there is a lock already in place that would block the lock
  3410. described by the LOCKP argument, information about that lock is
  3411. written to ‘*LOCKP’. Existing locks are not reported if they are
  3412. compatible with making a new lock as specified. Thus, you should
  3413. specify a lock type of ‘F_WRLCK’ if you want to find out about both
  3414. read and write locks, or ‘F_RDLCK’ if you want to find out about
  3415. write locks only.
  3416. There might be more than one lock affecting the region specified by
  3417. the LOCKP argument, but ‘fcntl’ only returns information about one
  3418. of them. Which lock is returned in this situation is undefined.
  3419. The ‘l_whence’ member of the LOCKP structure are set to ‘SEEK_SET’
  3420. and the ‘l_start’ and ‘l_len’ fields are set to identify the locked
  3421. region.
  3422. If no conflicting lock exists, the only change to the LOCKP
  3423. structure is to update the ‘l_type’ field to the value ‘F_UNLCK’.
  3424. The normal return value from ‘fcntl’ with this command is either 0
  3425. on success or -1, which indicates an error. The following ‘errno’
  3426. error conditions are defined for this command:
  3427. ‘EBADF’
  3428. The FILEDES argument is invalid.
  3429. ‘EINVAL’
  3430. Either the LOCKP argument doesn't specify valid lock
  3431. information, the operating system kernel doesn't support open
  3432. file description locks, or the file associated with FILEDES
  3433. doesn't support locks.
  3434. -- Macro: int F_OFD_SETLK
  3435. This macro is used as the COMMAND argument to ‘fcntl’, to specify
  3436. that it should set or clear a lock. This command requires a third
  3437. argument of type ‘struct flock *’ to be passed to ‘fcntl’, so that
  3438. the form of the call is:
  3439. fcntl (FILEDES, F_OFD_SETLK, LOCKP)
  3440. If the open file already has a lock on any part of the region, the
  3441. old lock on that part is replaced with the new lock. You can
  3442. remove a lock by specifying a lock type of ‘F_UNLCK’.
  3443. If the lock cannot be set, ‘fcntl’ returns immediately with a value
  3444. of -1. This command does not wait for other tasks to release
  3445. locks. If ‘fcntl’ succeeds, it returns 0.
  3446. The following ‘errno’ error conditions are defined for this
  3447. command:
  3448. ‘EAGAIN’
  3449. The lock cannot be set because it is blocked by an existing
  3450. lock on the file.
  3451. ‘EBADF’
  3452. Either: the FILEDES argument is invalid; you requested a read
  3453. lock but the FILEDES is not open for read access; or, you
  3454. requested a write lock but the FILEDES is not open for write
  3455. access.
  3456. ‘EINVAL’
  3457. Either the LOCKP argument doesn't specify valid lock
  3458. information, the operating system kernel doesn't support open
  3459. file description locks, or the file associated with FILEDES
  3460. doesn't support locks.
  3461. ‘ENOLCK’
  3462. The system has run out of file lock resources; there are
  3463. already too many file locks in place.
  3464. Well-designed file systems never report this error, because
  3465. they have no limitation on the number of locks. However, you
  3466. must still take account of the possibility of this error, as
  3467. it could result from network access to a file system on
  3468. another machine.
  3469. -- Macro: int F_OFD_SETLKW
  3470. This macro is used as the COMMAND argument to ‘fcntl’, to specify
  3471. that it should set or clear a lock. It is just like the
  3472. ‘F_OFD_SETLK’ command, but causes the process to wait until the
  3473. request can be completed.
  3474. This command requires a third argument of type ‘struct flock *’, as
  3475. for the ‘F_OFD_SETLK’ command.
  3476. The ‘fcntl’ return values and errors are the same as for the
  3477. ‘F_OFD_SETLK’ command, but these additional ‘errno’ error
  3478. conditions are defined for this command:
  3479. ‘EINTR’
  3480. The function was interrupted by a signal while it was waiting.
  3481. *Note Interrupted Primitives::.
  3482. Open file description locks are useful in the same sorts of
  3483. situations as process-associated locks. They can also be used to
  3484. synchronize file access between threads within the same process by
  3485. having each thread perform its own ‘open’ of the file, to obtain its own
  3486. open file description.
  3487. Because open file description locks are automatically freed only upon
  3488. closing the last file descriptor that refers to the open file
  3489. description, this locking mechanism avoids the possibility that locks
  3490. are inadvertently released due to a library routine opening and closing
  3491. a file without the application being aware.
  3492. As with process-associated locks, open file description locks are
  3493. advisory.
  3494. 
  3495. File: libc.info, Node: Open File Description Locks Example, Next: Interrupt Input, Prev: Open File Description Locks, Up: Low-Level I/O
  3496. 13.18 Open File Description Locks Example
  3497. =========================================
  3498. Here is an example of using open file description locks in a threaded
  3499. program. If this program used process-associated locks, then it would
  3500. be subject to data corruption because process-associated locks are
  3501. shared by the threads inside a process, and thus cannot be used by one
  3502. thread to lock out another thread in the same process.
  3503. Proper error handling has been omitted in the following program for
  3504. brevity.
  3505. #define _GNU_SOURCE
  3506. #include <stdio.h>
  3507. #include <sys/types.h>
  3508. #include <sys/stat.h>
  3509. #include <unistd.h>
  3510. #include <fcntl.h>
  3511. #include <pthread.h>
  3512. #define FILENAME "/tmp/foo"
  3513. #define NUM_THREADS 3
  3514. #define ITERATIONS 5
  3515. void *
  3516. thread_start (void *arg)
  3517. {
  3518. int i, fd, len;
  3519. long tid = (long) arg;
  3520. char buf[256];
  3521. struct flock lck = {
  3522. .l_whence = SEEK_SET,
  3523. .l_start = 0,
  3524. .l_len = 1,
  3525. };
  3526. fd = open ("/tmp/foo", O_RDWR | O_CREAT, 0666);
  3527. for (i = 0; i < ITERATIONS; i++)
  3528. {
  3529. lck.l_type = F_WRLCK;
  3530. fcntl (fd, F_OFD_SETLKW, &lck);
  3531. len = sprintf (buf, "%d: tid=%ld fd=%d\n", i, tid, fd);
  3532. lseek (fd, 0, SEEK_END);
  3533. write (fd, buf, len);
  3534. fsync (fd);
  3535. lck.l_type = F_UNLCK;
  3536. fcntl (fd, F_OFD_SETLK, &lck);
  3537. /* sleep to ensure lock is yielded to another thread */
  3538. usleep (1);
  3539. }
  3540. pthread_exit (NULL);
  3541. }
  3542. int
  3543. main (int argc, char **argv)
  3544. {
  3545. long i;
  3546. pthread_t threads[NUM_THREADS];
  3547. truncate (FILENAME, 0);
  3548. for (i = 0; i < NUM_THREADS; i++)
  3549. pthread_create (&threads[i], NULL, thread_start, (void *) i);
  3550. pthread_exit (NULL);
  3551. return 0;
  3552. }
  3553. This example creates three threads each of which loops five times,
  3554. appending to the file. Access to the file is serialized via open file
  3555. description locks. If we compile and run the above program, we'll end
  3556. up with /tmp/foo that has 15 lines in it.
  3557. If we, however, were to replace the ‘F_OFD_SETLK’ and ‘F_OFD_SETLKW’
  3558. commands with their process-associated lock equivalents, the locking
  3559. essentially becomes a noop since it is all done within the context of
  3560. the same process. That leads to data corruption (typically manifested
  3561. as missing lines) as some threads race in and overwrite the data written
  3562. by others.
  3563. 
  3564. File: libc.info, Node: Interrupt Input, Next: IOCTLs, Prev: Open File Description Locks Example, Up: Low-Level I/O
  3565. 13.19 Interrupt-Driven Input
  3566. ============================
  3567. If you set the ‘O_ASYNC’ status flag on a file descriptor (*note File
  3568. Status Flags::), a ‘SIGIO’ signal is sent whenever input or output
  3569. becomes possible on that file descriptor. The process or process group
  3570. to receive the signal can be selected by using the ‘F_SETOWN’ command to
  3571. the ‘fcntl’ function. If the file descriptor is a socket, this also
  3572. selects the recipient of ‘SIGURG’ signals that are delivered when
  3573. out-of-band data arrives on that socket; see *note Out-of-Band Data::.
  3574. (‘SIGURG’ is sent in any situation where ‘select’ would report the
  3575. socket as having an "exceptional condition". *Note Waiting for I/O::.)
  3576. If the file descriptor corresponds to a terminal device, then ‘SIGIO’
  3577. signals are sent to the foreground process group of the terminal. *Note
  3578. Job Control::.
  3579. The symbols in this section are defined in the header file ‘fcntl.h’.
  3580. -- Macro: int F_GETOWN
  3581. This macro is used as the COMMAND argument to ‘fcntl’, to specify
  3582. that it should get information about the process or process group
  3583. to which ‘SIGIO’ signals are sent. (For a terminal, this is
  3584. actually the foreground process group ID, which you can get using
  3585. ‘tcgetpgrp’; see *note Terminal Access Functions::.)
  3586. The return value is interpreted as a process ID; if negative, its
  3587. absolute value is the process group ID.
  3588. The following ‘errno’ error condition is defined for this command:
  3589. ‘EBADF’
  3590. The FILEDES argument is invalid.
  3591. -- Macro: int F_SETOWN
  3592. This macro is used as the COMMAND argument to ‘fcntl’, to specify
  3593. that it should set the process or process group to which ‘SIGIO’
  3594. signals are sent. This command requires a third argument of type
  3595. ‘pid_t’ to be passed to ‘fcntl’, so that the form of the call is:
  3596. fcntl (FILEDES, F_SETOWN, PID)
  3597. The PID argument should be a process ID. You can also pass a
  3598. negative number whose absolute value is a process group ID.
  3599. The return value from ‘fcntl’ with this command is -1 in case of
  3600. error and some other value if successful. The following ‘errno’
  3601. error conditions are defined for this command:
  3602. ‘EBADF’
  3603. The FILEDES argument is invalid.
  3604. ‘ESRCH’
  3605. There is no process or process group corresponding to PID.
  3606. 
  3607. File: libc.info, Node: IOCTLs, Next: Other Low-Level I/O APIs, Prev: Interrupt Input, Up: Low-Level I/O
  3608. 13.20 Generic I/O Control operations
  3609. ====================================
  3610. GNU systems can handle most input/output operations on many different
  3611. devices and objects in terms of a few file primitives - ‘read’, ‘write’
  3612. and ‘lseek’. However, most devices also have a few peculiar operations
  3613. which do not fit into this model. Such as:
  3614. • Changing the character font used on a terminal.
  3615. • Telling a magnetic tape system to rewind or fast forward. (Since
  3616. they cannot move in byte increments, ‘lseek’ is inapplicable).
  3617. • Ejecting a disk from a drive.
  3618. • Playing an audio track from a CD-ROM drive.
  3619. • Maintaining routing tables for a network.
  3620. Although some such objects such as sockets and terminals (1) have
  3621. special functions of their own, it would not be practical to create
  3622. functions for all these cases.
  3623. Instead these minor operations, known as “IOCTL”s, are assigned code
  3624. numbers and multiplexed through the ‘ioctl’ function, defined in
  3625. ‘sys/ioctl.h’. The code numbers themselves are defined in many
  3626. different headers.
  3627. -- Function: int ioctl (int FILEDES, int COMMAND, ...)
  3628. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3629. Concepts::.
  3630. The ‘ioctl’ function performs the generic I/O operation COMMAND on
  3631. FILEDES.
  3632. A third argument is usually present, either a single number or a
  3633. pointer to a structure. The meaning of this argument, the returned
  3634. value, and any error codes depends upon the command used. Often -1
  3635. is returned for a failure.
  3636. On some systems, IOCTLs used by different devices share the same
  3637. numbers. Thus, although use of an inappropriate IOCTL _usually_ only
  3638. produces an error, you should not attempt to use device-specific IOCTLs
  3639. on an unknown device.
  3640. Most IOCTLs are OS-specific and/or only used in special system
  3641. utilities, and are thus beyond the scope of this document. For an
  3642. example of the use of an IOCTL, see *note Out-of-Band Data::.
  3643. ---------- Footnotes ----------
  3644. (1) Actually, the terminal-specific functions are implemented with
  3645. IOCTLs on many platforms.
  3646. 
  3647. File: libc.info, Node: Other Low-Level I/O APIs, Prev: IOCTLs, Up: Low-Level I/O
  3648. 13.21 Other low-level-I/O-related functions
  3649. ===========================================
  3650. -- Data Type: struct pollfd
  3651. -- Data Type: struct epoll_event
  3652. -- Function: int poll (struct pollfd *FDS, nfds_t NFDS, int TIMEOUT)
  3653. This documentation is a stub. For additional information on this
  3654. function, consult the manual page poll(2) (Latest, online:
  3655. <https://man7.org/linux/man-pages/man2/poll.2.html>) *Note Linux
  3656. Kernel::.
  3657. -- Function: int epoll_create (int SIZE)
  3658. This documentation is a stub. For additional information on this
  3659. function, consult the manual page epoll_create(2) (Latest, online:
  3660. <https://man7.org/linux/man-pages/man2/epoll_create.2.html>) *Note
  3661. Linux Kernel::.
  3662. -- Function: int epoll_wait (int EPFD, struct epoll_event *EVENTS, int
  3663. MAXEVENTS, int TIMEOUT)
  3664. This documentation is a stub. For additional information on this
  3665. function, consult the manual page epoll_wait(2) (Latest, online:
  3666. <https://man7.org/linux/man-pages/man2/epoll_wait.2.html>) *Note
  3667. Linux Kernel::.
  3668. 
  3669. File: libc.info, Node: File System Interface, Next: Pipes and FIFOs, Prev: Low-Level I/O, Up: Top
  3670. 14 File System Interface
  3671. ************************
  3672. This chapter describes the GNU C Library's functions for manipulating
  3673. files. Unlike the input and output functions (*note I/O on Streams::;
  3674. *note Low-Level I/O::), these functions are concerned with operating on
  3675. the files themselves rather than on their contents.
  3676. Among the facilities described in this chapter are functions for
  3677. examining or modifying directories, functions for renaming and deleting
  3678. files, and functions for examining and setting file attributes such as
  3679. access permissions and modification times.
  3680. * Menu:
  3681. * Working Directory:: This is used to resolve relative
  3682. file names.
  3683. * Descriptor-Relative Access:: Ways to control file name lookup.
  3684. * Accessing Directories:: Finding out what files a directory
  3685. contains.
  3686. * Working with Directory Trees:: Apply actions to all files or a selectable
  3687. subset of a directory hierarchy.
  3688. * Hard Links:: Adding alternate names to a file.
  3689. * Symbolic Links:: A file that "points to" a file name.
  3690. * Deleting Files:: How to delete a file, and what that means.
  3691. * Renaming Files:: Changing a file's name.
  3692. * Creating Directories:: A system call just for creating a directory.
  3693. * File Attributes:: Attributes of individual files.
  3694. * Making Special Files:: How to create special files.
  3695. * Temporary Files:: Naming and creating temporary files.
  3696. 
  3697. File: libc.info, Node: Working Directory, Next: Descriptor-Relative Access, Up: File System Interface
  3698. 14.1 Working Directory
  3699. ======================
  3700. Each process has associated with it a directory, called its “current
  3701. working directory” or simply “working directory”, that is used in the
  3702. resolution of relative file names (*note File Name Resolution::).
  3703. When you log in and begin a new session, your working directory is
  3704. initially set to the home directory associated with your login account
  3705. in the system user database. You can find any user's home directory
  3706. using the ‘getpwuid’ or ‘getpwnam’ functions; see *note User Database::.
  3707. Users can change the working directory using shell commands like
  3708. ‘cd’. The functions described in this section are the primitives used
  3709. by those commands and by other programs for examining and changing the
  3710. working directory.
  3711. Prototypes for these functions are declared in the header file
  3712. ‘unistd.h’.
  3713. -- Function: char * getcwd (char *BUFFER, size_t SIZE)
  3714. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
  3715. POSIX Safety Concepts::.
  3716. The ‘getcwd’ function returns an absolute file name representing
  3717. the current working directory, storing it in the character array
  3718. BUFFER that you provide. The SIZE argument is how you tell the
  3719. system the allocation size of BUFFER.
  3720. The GNU C Library version of this function also permits you to
  3721. specify a null pointer for the BUFFER argument. Then ‘getcwd’
  3722. allocates a buffer automatically, as with ‘malloc’ (*note
  3723. Unconstrained Allocation::). If the SIZE is greater than zero,
  3724. then the buffer is that large; otherwise, the buffer is as large as
  3725. necessary to hold the result.
  3726. The return value is BUFFER on success and a null pointer on
  3727. failure. The following ‘errno’ error conditions are defined for
  3728. this function:
  3729. ‘EINVAL’
  3730. The SIZE argument is zero and BUFFER is not a null pointer.
  3731. ‘ERANGE’
  3732. The SIZE argument is less than the length of the working
  3733. directory name. You need to allocate a bigger array and try
  3734. again.
  3735. ‘EACCES’
  3736. Permission to read or search a component of the file name was
  3737. denied.
  3738. You could implement the behavior of GNU's ‘getcwd (NULL, 0)’ using
  3739. only the standard behavior of ‘getcwd’:
  3740. char *
  3741. gnu_getcwd ()
  3742. {
  3743. size_t size = 100;
  3744. while (1)
  3745. {
  3746. char *buffer = (char *) xmalloc (size);
  3747. if (getcwd (buffer, size) == buffer)
  3748. return buffer;
  3749. free (buffer);
  3750. if (errno != ERANGE)
  3751. return 0;
  3752. size *= 2;
  3753. }
  3754. }
  3755. *Note Malloc Examples::, for information about ‘xmalloc’, which is not a
  3756. library function but is a customary name used in most GNU software.
  3757. -- Deprecated Function: char * getwd (char *BUFFER)
  3758. Preliminary: | MT-Safe | AS-Unsafe heap i18n | AC-Unsafe mem fd |
  3759. *Note POSIX Safety Concepts::.
  3760. This is similar to ‘getcwd’, but has no way to specify the size of
  3761. the buffer. The GNU C Library provides ‘getwd’ only for backwards
  3762. compatibility with BSD.
  3763. The BUFFER argument should be a pointer to an array at least
  3764. ‘PATH_MAX’ bytes long (*note Limits for Files::). On GNU/Hurd
  3765. systems there is no limit to the size of a file name, so this is
  3766. not necessarily enough space to contain the directory name. That
  3767. is why this function is deprecated.
  3768. -- Function: char * get_current_dir_name (void)
  3769. Preliminary: | MT-Safe env | AS-Unsafe heap | AC-Unsafe mem fd |
  3770. *Note POSIX Safety Concepts::.
  3771. The ‘get_current_dir_name’ function is basically equivalent to
  3772. ‘getcwd (NULL, 0)’, except the value of the ‘PWD’ environment
  3773. variable is first examined, and if it does in fact correspond to
  3774. the current directory, that value is returned. This is a subtle
  3775. difference which is visible if the path described by the value in
  3776. ‘PWD’ is using one or more symbolic links, in which case the value
  3777. returned by ‘getcwd’ would resolve the symbolic links and therefore
  3778. yield a different result.
  3779. This function is a GNU extension.
  3780. -- Function: int chdir (const char *FILENAME)
  3781. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3782. Concepts::.
  3783. This function is used to set the process's working directory to
  3784. FILENAME.
  3785. The normal, successful return value from ‘chdir’ is ‘0’. A value
  3786. of ‘-1’ is returned to indicate an error. The ‘errno’ error
  3787. conditions defined for this function are the usual file name syntax
  3788. errors (*note File Name Errors::), plus ‘ENOTDIR’ if the file
  3789. FILENAME is not a directory.
  3790. -- Function: int fchdir (int FILEDES)
  3791. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3792. Concepts::.
  3793. This function is used to set the process's working directory to
  3794. directory associated with the file descriptor FILEDES.
  3795. The normal, successful return value from ‘fchdir’ is ‘0’. A value
  3796. of ‘-1’ is returned to indicate an error. The following ‘errno’
  3797. error conditions are defined for this function:
  3798. ‘EACCES’
  3799. Read permission is denied for the directory named by
  3800. ‘dirname’.
  3801. ‘EBADF’
  3802. The FILEDES argument is not a valid file descriptor.
  3803. ‘ENOTDIR’
  3804. The file descriptor FILEDES is not associated with a
  3805. directory.
  3806. ‘EINTR’
  3807. The function call was interrupt by a signal.
  3808. ‘EIO’
  3809. An I/O error occurred.
  3810. 
  3811. File: libc.info, Node: Descriptor-Relative Access, Next: Accessing Directories, Prev: Working Directory, Up: File System Interface
  3812. 14.2 Descriptor-Relative Access
  3813. ===============================
  3814. Many functions that accept file names have ‘...at’ variants which accept
  3815. a file descriptor and a file name argument instead of just a file name
  3816. argument. For example, ‘fstatat’ is the descriptor-based variant of the
  3817. ‘fstat’ function. Most such functions also accept an additional flags
  3818. argument which changes the behavior of the file name lookup based on the
  3819. passed ‘AT_...’ flags.
  3820. There are several reasons to use descriptor-relative access:
  3821. • The working directory is a process-wide resource, so individual
  3822. threads cannot change it without affecting other threads in the
  3823. process. Explicitly specifying the directory against which
  3824. relative paths are resolved can be a thread-safe alternative to
  3825. changing the working directory.
  3826. • If a program wishes to access a directory tree which is being
  3827. modified concurrently, perhaps even by a different user on the
  3828. system, the program must avoid looking up file names with multiple
  3829. components, in order to detect symbolic links, using the
  3830. ‘O_NOFOLLOW’ flag (*note Open-time Flags::) or the
  3831. ‘AT_SYMLINK_FOLLOW’ flag (described below). Without
  3832. directory-relative access, it is necessary to use the ‘fchdir’
  3833. function to change the working directory (*note Working
  3834. Directory::), which is not thread-safe.
  3835. • Listing directory contents using the ‘readdir’ or ‘readdir64’
  3836. functions (*note Reading/Closing Directory::) does not provide full
  3837. file name paths. Using ‘...at’ functions, it is possible to use
  3838. the file names directly, without having to construct such full
  3839. paths.
  3840. • Additional flags available with some of the ‘...at’ functions
  3841. provide access to functionality which is not available otherwise.
  3842. The file descriptor used by these ‘...at’ functions has the following
  3843. uses:
  3844. • It can be a file descriptor referring to a directory. Such a
  3845. descriptor can be created explicitly using the ‘open’ function and
  3846. the ‘O_RDONLY’ file access mode, with or without the ‘O_DIRECTORY’
  3847. flag. *Note Opening and Closing Files::. Or it can be created
  3848. implicitly by ‘opendir’ and retrieved using the ‘dirfd’ function.
  3849. *Note Opening a Directory::.
  3850. If a directory descriptor is used with one of the ‘...at’
  3851. functions, a relative file name argument is resolved relative to
  3852. directory referred to by the file descriptor, just as if that
  3853. directory were the current working directory. Absolute file name
  3854. arguments (starting with ‘/’) are resolved against the file system
  3855. root, and the descriptor argument is effectively ignored.
  3856. This means that file name lookup is not constrained to the
  3857. directory of the descriptor. For example, it is possible to access
  3858. a file ‘example’ in the descriptor's parent directory using a file
  3859. name argument ‘"../example"’, or in the root directory using
  3860. ‘"/example"’.
  3861. If the file descriptor refers to a directory, the empty string ‘""’
  3862. is not a valid file name argument. It is possible to use ‘"."’ to
  3863. refer to the directory itself. Also see ‘AT_EMPTY_PATH’ below.
  3864. • The special value ‘AT_FDCWD’. This means that the current working
  3865. directory is used for the lookup if the file name is a relative.
  3866. For ‘...at’ functions with an ‘AT_...’ flags argument, this
  3867. provides a shortcut to use those flags with regular (not
  3868. descriptor-based) file name lookups.
  3869. If ‘AT_FDCWD’ is used, the empty string ‘""’ is not a valid file
  3870. name argument.
  3871. • An arbitrary file descriptor, along with an empty string ‘""’ as
  3872. the file name argument, and the ‘AT_EMPTY_PATH’ flag. In this
  3873. case, the operation uses the file descriptor directly, without
  3874. further file name resolution. On Linux, this allows operations on
  3875. descriptors opened with the ‘O_PATH’ flag. For regular descriptors
  3876. (opened without ‘O_PATH’), the same functionality is also available
  3877. through the plain descriptor-based functions (for example, ‘fstat’
  3878. instead of ‘fstatat’).
  3879. This is a GNU extension.
  3880. The flags argument in ‘...at’ functions can be a combination of the
  3881. following flags, defined in ‘fcntl.h’. Not all such functions support
  3882. all flags, and some (such as ‘openat’) do not accept a flags argument at
  3883. all. Although the flags specific to each function have distinct values
  3884. from each other, some flags (relevant to different functions) might
  3885. share the same value and therefore are not guaranteed to have unique
  3886. values.
  3887. A non-exhaustive list of common flags and their descriptions follows.
  3888. Flags specific to a function are described alongside the function
  3889. itself. In these flag descriptions, the “effective final path
  3890. component” refers to the final component (basename) of the full path
  3891. constructed from the descriptor and file name arguments, using file name
  3892. lookup, as described above.
  3893. ‘AT_EMPTY_PATH’
  3894. This flag is used with an empty file name ‘""’ and a descriptor
  3895. which does not necessarily refer to a directory. It is most useful
  3896. with ‘O_PATH’ descriptors, as described above. This flag is a GNU
  3897. extension.
  3898. ‘AT_NO_AUTOMOUNT’
  3899. If the effective final path component refers to a potential file
  3900. system mount point controlled by an auto-mounting service, the
  3901. operation does not trigger auto-mounting and refers to the
  3902. unmounted mount point instead. *Note Mount-Unmount-Remount::. If
  3903. a file system has already been mounted at the effective final path
  3904. component, the operation applies to the file or directory in the
  3905. mounted file system, not the underlying file system that was
  3906. mounted over. This flag is a GNU extension.
  3907. ‘AT_SYMLINK_FOLLOW’
  3908. If the effective final path component is a symbolic link, the
  3909. operation follows the symbolic link and operates on its target.
  3910. (For most functions, this is the default behavior.)
  3911. ‘AT_SYMLINK_NOFOLLOW’
  3912. If the effective final path component is a symbolic link, the
  3913. operation operates on the symbolic link, without following it. The
  3914. difference in behavior enabled by this flag is similar to the
  3915. difference between the ‘lstat’ and ‘stat’ functions, or the
  3916. behavior activated by the ‘O_NOFOLLOW’ argument to the ‘open’
  3917. function. Even with the ‘AT_SYMLINK_NOFOLLOW’ flag present,
  3918. symbolic links in a non-final component of the file name are still
  3919. followed.
  3920. *Note:* There is no relationship between these flags and the type
  3921. argument to the ‘getauxval’ function (with ‘AT_...’ constants defined in
  3922. ‘elf.h’). *Note Auxiliary Vector::.
  3923. The ‘...at’ functions have some common error conditions due to the
  3924. nature of descriptor-relative access. A list of common errors and their
  3925. descriptions follows. Errors specific to a function are described
  3926. alongside the function itself.
  3927. ‘EBADF’
  3928. The file name argument is a relative path but the descriptor
  3929. argument is neither ‘AT_FDCWD’ nor a valid file descriptor.
  3930. ‘EINVAL’
  3931. If the function accepts a FLAGS argument, the flag combination
  3932. passed is not valid for the function.
  3933. ‘ENOTDIR’
  3934. The file name argument is a relative file name but the descriptor
  3935. argument is associated with a file that is not a directory.
  3936. 
  3937. File: libc.info, Node: Accessing Directories, Next: Working with Directory Trees, Prev: Descriptor-Relative Access, Up: File System Interface
  3938. 14.3 Accessing Directories
  3939. ==========================
  3940. The facilities described in this section let you read the contents of a
  3941. directory file. This is useful if you want your program to list all the
  3942. files in a directory, perhaps as part of a menu.
  3943. The ‘opendir’ function opens a “directory stream” whose elements are
  3944. directory entries. Alternatively ‘fdopendir’ can be used which can have
  3945. advantages if the program needs to have more control over the way the
  3946. directory is opened for reading. This allows, for instance, to pass the
  3947. ‘O_NOATIME’ flag to ‘open’.
  3948. You use the ‘readdir’ function on the directory stream to retrieve
  3949. these entries, represented as ‘struct dirent’ objects. The name of the
  3950. file for each entry is stored in the ‘d_name’ member of this structure.
  3951. There are obvious parallels here to the stream facilities for ordinary
  3952. files, described in *note I/O on Streams::.
  3953. * Menu:
  3954. * Directory Entries:: Format of one directory entry.
  3955. * Opening a Directory:: How to open a directory stream.
  3956. * Reading/Closing Directory:: How to read directory entries from the stream.
  3957. * Simple Directory Lister:: A very simple directory listing program.
  3958. * Random Access Directory:: Rereading part of the directory
  3959. already read with the same stream.
  3960. * Scanning Directory Content:: Get entries for user selected subset of
  3961. contents in given directory.
  3962. * Simple Directory Lister Mark II:: Revised version of the program.
  3963. * Low-level Directory Access:: AS-Safe functions for directory access.
  3964. 
  3965. File: libc.info, Node: Directory Entries, Next: Opening a Directory, Up: Accessing Directories
  3966. 14.3.1 Format of a Directory Entry
  3967. ----------------------------------
  3968. This section describes what you find in a single directory entry, as you
  3969. might obtain it from a directory stream. All the symbols are declared
  3970. in the header file ‘dirent.h’.
  3971. -- Data Type: struct dirent
  3972. This is a structure type used to return information about directory
  3973. entries. It contains the following fields:
  3974. ‘char d_name[]’
  3975. This is the null-terminated file name component. This is the
  3976. only field you can count on in all POSIX systems.
  3977. While this field is defined with a specified length, functions
  3978. such as ‘readdir’ may return a pointer to a ‘struct dirent’
  3979. where the ‘d_name’ extends beyond the end of the struct.
  3980. ‘ino_t d_fileno’
  3981. This is the file serial number. For BSD compatibility, you
  3982. can also refer to this member as ‘d_ino’. On GNU/Linux and
  3983. GNU/Hurd systems and most POSIX systems, for most files this
  3984. the same as the ‘st_ino’ member that ‘stat’ will return for
  3985. the file. *Note File Attributes::.
  3986. ‘off_t d_off’
  3987. This value contains the offset of the next directory entry
  3988. (after this entry) in the directory stream. The value may not
  3989. be compatible with ‘lseek’ or ‘seekdir’, especially if the
  3990. width of ‘d_off’ is less than 64 bits. Directory entries are
  3991. not ordered by offset, and the ‘d_off’ and ‘d_reclen’ values
  3992. are unrelated. Seeking on directory streams is not
  3993. recommended. The symbol ‘_DIRENT_HAVE_D_OFF’ is defined if
  3994. the ‘d_ino’ member is available.
  3995. ‘unsigned char d_namlen’
  3996. This is the length of the file name, not including the
  3997. terminating null character. Its type is ‘unsigned char’
  3998. because that is the integer type of the appropriate size.
  3999. This member is a BSD extension. The symbol
  4000. ‘_DIRENT_HAVE_D_NAMLEN’ is defined if this member is
  4001. available. (It is not available on Linux.)
  4002. ‘unsigned short int d_reclen’
  4003. This is the length of the entire directory record. When
  4004. iterating through a buffer filled by ‘getdents64’ (*note
  4005. Low-level Directory Access::), this value needs to be added to
  4006. the offset of the current directory entry to obtain the offset
  4007. of the next entry. When using ‘readdir’ and related
  4008. functions, the value of ‘d_reclen’ is undefined and should not
  4009. be accessed. The symbol ‘_DIRENT_HAVE_D_RECLEN’ is defined if
  4010. this member is available.
  4011. ‘unsigned char d_type’
  4012. This is the type of the file, possibly unknown. The following
  4013. constants are defined for its value:
  4014. ‘DT_UNKNOWN’
  4015. The type is unknown. Only some filesystems have full
  4016. support to return the type of the file, others might
  4017. always return this value.
  4018. ‘DT_REG’
  4019. A regular file.
  4020. ‘DT_DIR’
  4021. A directory.
  4022. ‘DT_FIFO’
  4023. A named pipe, or FIFO. *Note FIFO Special Files::.
  4024. ‘DT_SOCK’
  4025. A local-domain socket.
  4026. ‘DT_CHR’
  4027. A character device.
  4028. ‘DT_BLK’
  4029. A block device.
  4030. ‘DT_LNK’
  4031. A symbolic link.
  4032. This member is a BSD extension. The symbol
  4033. ‘_DIRENT_HAVE_D_TYPE’ is defined if this member is available.
  4034. On systems where it is used, it corresponds to the file type
  4035. bits in the ‘st_mode’ member of ‘struct stat’. If the value
  4036. cannot be determined the member value is ‘DT_UNKNOWN’. These
  4037. two macros convert between ‘d_type’ values and ‘st_mode’
  4038. values:
  4039. -- Function: int IFTODT (mode_t MODE)
  4040. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX
  4041. Safety Concepts::.
  4042. This returns the ‘d_type’ value corresponding to MODE.
  4043. -- Function: mode_t DTTOIF (int DTYPE)
  4044. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX
  4045. Safety Concepts::.
  4046. This returns the ‘st_mode’ value corresponding to DTYPE.
  4047. This structure may contain additional members in the future. Their
  4048. availability is always announced in the compilation environment by
  4049. a macro named ‘_DIRENT_HAVE_D_XXX’ where XXX is replaced by the
  4050. name of the new member. For instance, the member ‘d_reclen’
  4051. available on some systems is announced through the macro
  4052. ‘_DIRENT_HAVE_D_RECLEN’.
  4053. When a file has multiple names, each name has its own directory
  4054. entry. The only way you can tell that the directory entries belong
  4055. to a single file is that they have the same value for the
  4056. ‘d_fileno’ field.
  4057. File attributes such as size, modification times etc., are part of
  4058. the file itself, not of any particular directory entry. *Note File
  4059. Attributes::.
  4060. 
  4061. File: libc.info, Node: Opening a Directory, Next: Reading/Closing Directory, Prev: Directory Entries, Up: Accessing Directories
  4062. 14.3.2 Opening a Directory Stream
  4063. ---------------------------------
  4064. This section describes how to open a directory stream. All the symbols
  4065. are declared in the header file ‘dirent.h’.
  4066. -- Data Type: DIR
  4067. The ‘DIR’ data type represents a directory stream.
  4068. You shouldn't ever allocate objects of the ‘struct dirent’ or ‘DIR’
  4069. data types, since the directory access functions do that for you.
  4070. Instead, you refer to these objects using the pointers returned by the
  4071. following functions.
  4072. Directory streams are a high-level interface. On Linux, alternative
  4073. interfaces for accessing directories using file descriptors are
  4074. available. *Note Low-level Directory Access::.
  4075. -- Function: DIR * opendir (const char *DIRNAME)
  4076. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
  4077. POSIX Safety Concepts::.
  4078. The ‘opendir’ function opens and returns a directory stream for
  4079. reading the directory whose file name is DIRNAME. The stream has
  4080. type ‘DIR *’.
  4081. If unsuccessful, ‘opendir’ returns a null pointer. In addition to
  4082. the usual file name errors (*note File Name Errors::), the
  4083. following ‘errno’ error conditions are defined for this function:
  4084. ‘EACCES’
  4085. Read permission is denied for the directory named by
  4086. ‘dirname’.
  4087. ‘EMFILE’
  4088. The process has too many files open.
  4089. ‘ENFILE’
  4090. The entire system, or perhaps the file system which contains
  4091. the directory, cannot support any additional open files at the
  4092. moment. (This problem cannot happen on GNU/Hurd systems.)
  4093. ‘ENOMEM’
  4094. Not enough memory available.
  4095. The ‘DIR’ type is typically implemented using a file descriptor,
  4096. and the ‘opendir’ function in terms of the ‘open’ function. *Note
  4097. Low-Level I/O::. Directory streams and the underlying file
  4098. descriptors are closed on ‘exec’ (*note Executing a File::).
  4099. The directory which is opened for reading by ‘opendir’ is identified
  4100. by the name. In some situations this is not sufficient. Or the way
  4101. ‘opendir’ implicitly creates a file descriptor for the directory is not
  4102. the way a program might want it. In these cases an alternative
  4103. interface can be used.
  4104. -- Function: DIR * fdopendir (int FD)
  4105. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
  4106. POSIX Safety Concepts::.
  4107. The ‘fdopendir’ function works just like ‘opendir’ but instead of
  4108. taking a file name and opening a file descriptor for the directory
  4109. the caller is required to provide a file descriptor. This file
  4110. descriptor is then used in subsequent uses of the returned
  4111. directory stream object.
  4112. The caller must make sure the file descriptor is associated with a
  4113. directory and it allows reading.
  4114. If the ‘fdopendir’ call returns successfully the file descriptor is
  4115. now under the control of the system. It can be used in the same
  4116. way the descriptor implicitly created by ‘opendir’ can be used but
  4117. the program must not close the descriptor.
  4118. In case the function is unsuccessful it returns a null pointer and
  4119. the file descriptor remains to be usable by the program. The
  4120. following ‘errno’ error conditions are defined for this function:
  4121. ‘EBADF’
  4122. The file descriptor is not valid.
  4123. ‘ENOTDIR’
  4124. The file descriptor is not associated with a directory.
  4125. ‘EINVAL’
  4126. The descriptor does not allow reading the directory content.
  4127. ‘ENOMEM’
  4128. Not enough memory available.
  4129. In some situations it can be desirable to get hold of the file
  4130. descriptor which is created by the ‘opendir’ call. For instance, to
  4131. switch the current working directory to the directory just read the
  4132. ‘fchdir’ function could be used. Historically the ‘DIR’ type was
  4133. exposed and programs could access the fields. This does not happen in
  4134. the GNU C Library. Instead a separate function is provided to allow
  4135. access.
  4136. -- Function: int dirfd (DIR *DIRSTREAM)
  4137. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4138. Concepts::.
  4139. The function ‘dirfd’ returns the file descriptor associated with
  4140. the directory stream DIRSTREAM. This descriptor can be used until
  4141. the directory is closed with ‘closedir’. If the directory stream
  4142. implementation is not using file descriptors the return value is
  4143. ‘-1’.
  4144. 
  4145. File: libc.info, Node: Reading/Closing Directory, Next: Simple Directory Lister, Prev: Opening a Directory, Up: Accessing Directories
  4146. 14.3.3 Reading and Closing a Directory Stream
  4147. ---------------------------------------------
  4148. This section describes how to read directory entries from a directory
  4149. stream, and how to close the stream when you are done with it. All the
  4150. symbols are declared in the header file ‘dirent.h’.
  4151. -- Function: struct dirent * readdir (DIR *DIRSTREAM)
  4152. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  4153. POSIX Safety Concepts::.
  4154. This function reads the next entry from the directory. It normally
  4155. returns a pointer to a structure containing information about the
  4156. file. This structure is associated with the DIRSTREAM handle and
  4157. can be rewritten by a subsequent call.
  4158. *Portability Note:* On some systems ‘readdir’ may not return
  4159. entries for ‘.’ and ‘..’, even though these are always valid file
  4160. names in any directory. *Note File Name Resolution::.
  4161. If a directory is modified between a call to ‘readdir’ and after
  4162. the directory stream was created or ‘rewinddir’ was last called on
  4163. it, it is unspecified according to POSIX whether newly created or
  4164. removed entries appear among the entries returned by repeated
  4165. ‘readdir’ calls before the end of the directory is reached.
  4166. However, due to practical implementation constraints, it is
  4167. possible that entries (including unrelated, unmodified entries)
  4168. appear multiple times or do not appear at all if the directory is
  4169. modified while listing it. If the application intends to create
  4170. files in the directory, it may be necessary to complete the
  4171. iteration first and create a copy of the information obtained
  4172. before creating any new files. (See below for instructions
  4173. regarding copying of ‘d_name’.) The iteration can be restarted
  4174. using ‘rewinddir’. *Note Random Access Directory::.
  4175. If there are no more entries in the directory or an error is
  4176. detected, ‘readdir’ returns a null pointer. The following ‘errno’
  4177. error conditions are defined for this function:
  4178. ‘EBADF’
  4179. The DIRSTREAM argument is not valid.
  4180. To distinguish between an end-of-directory condition or an error,
  4181. you must set ‘errno’ to zero before calling ‘readdir’. To avoid
  4182. entering an infinite loop, you should stop reading from the
  4183. directory after the first error.
  4184. *Caution:* The pointer returned by ‘readdir’ points to a buffer
  4185. within the ‘DIR’ object. The data in that buffer will be
  4186. overwritten by the next call to ‘readdir’. You must take care, for
  4187. instance, to copy the ‘d_name’ string if you need it later.
  4188. Because of this, it is not safe to share a ‘DIR’ object among
  4189. multiple threads, unless you use your own locking to ensure that no
  4190. thread calls ‘readdir’ while another thread is still using the data
  4191. from the previous call. In the GNU C Library, it is safe to call
  4192. ‘readdir’ from multiple threads as long as each thread uses its own
  4193. ‘DIR’ object. POSIX.1-2008 does not require this to be safe, but
  4194. we are not aware of any operating systems where it does not work.
  4195. ‘readdir_r’ allows you to provide your own buffer for the ‘struct
  4196. dirent’, but it is less portable than ‘readdir’, and has problems
  4197. with very long filenames (see below). We recommend you use
  4198. ‘readdir’, but do not share ‘DIR’ objects.
  4199. -- Function: int readdir_r (DIR *DIRSTREAM, struct dirent *ENTRY,
  4200. struct dirent **RESULT)
  4201. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  4202. POSIX Safety Concepts::.
  4203. This function is a version of ‘readdir’ which performs internal
  4204. locking. Like ‘readdir’ it returns the next entry from the
  4205. directory. To prevent conflicts between simultaneously running
  4206. threads the result is stored inside the ENTRY object.
  4207. *Portability Note:* ‘readdir_r’ is deprecated. It is recommended
  4208. to use ‘readdir’ instead of ‘readdir_r’ for the following reasons:
  4209. • On systems which do not define ‘NAME_MAX’, it may not be
  4210. possible to use ‘readdir_r’ safely because the caller does not
  4211. specify the length of the buffer for the directory entry.
  4212. • On some systems, ‘readdir_r’ cannot read directory entries
  4213. with very long names. If such a name is encountered, the GNU
  4214. C Library implementation of ‘readdir_r’ returns with an error
  4215. code of ‘ENAMETOOLONG’ after the final directory entry has
  4216. been read. On other systems, ‘readdir_r’ may return
  4217. successfully, but the ‘d_name’ member may not be
  4218. NUL-terminated or may be truncated.
  4219. • POSIX-1.2008 does not guarantee that ‘readdir’ is thread-safe,
  4220. even when access to the same DIRSTREAM is serialized. But in
  4221. current implementations (including the GNU C Library), it is
  4222. safe to call ‘readdir’ concurrently on different DIRSTREAMs,
  4223. so there is no need to use ‘readdir_r’ in most multi-threaded
  4224. programs. In the rare case that multiple threads need to read
  4225. from the same DIRSTREAM, it is still better to use ‘readdir’
  4226. and external synchronization.
  4227. • It is expected that future versions of POSIX will obsolete
  4228. ‘readdir_r’ and mandate the level of thread safety for
  4229. ‘readdir’ which is provided by the GNU C Library and other
  4230. implementations today.
  4231. Normally ‘readdir_r’ returns zero and sets ‘*RESULT’ to ENTRY. If
  4232. there are no more entries in the directory or an error is detected,
  4233. ‘readdir_r’ sets ‘*RESULT’ to a null pointer and returns a nonzero
  4234. error code, also stored in ‘errno’, as described for ‘readdir’.
  4235. It is also important to look at the definition of the ‘struct
  4236. dirent’ type. Simply passing a pointer to an object of this type
  4237. for the second parameter of ‘readdir_r’ might not be enough. Some
  4238. systems don't define the ‘d_name’ element sufficiently long. In
  4239. this case the user has to provide additional space. There must be
  4240. room for at least ‘NAME_MAX + 1’ characters in the ‘d_name’ array.
  4241. Code to call ‘readdir_r’ could look like this:
  4242. union
  4243. {
  4244. struct dirent d;
  4245. char b[offsetof (struct dirent, d_name) + NAME_MAX + 1];
  4246. } u;
  4247. if (readdir_r (dir, &u.d, &res) == 0)
  4248. ...
  4249. To support large filesystems on 32-bit machines there are LFS
  4250. variants of the last two functions.
  4251. -- Function: struct dirent64 * readdir64 (DIR *DIRSTREAM)
  4252. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  4253. POSIX Safety Concepts::.
  4254. The ‘readdir64’ function is just like the ‘readdir’ function except
  4255. that it returns a pointer to a record of type ‘struct dirent64’.
  4256. Some of the members of this data type (notably ‘d_ino’) might have
  4257. a different size to allow large filesystems.
  4258. In all other aspects this function is equivalent to ‘readdir’.
  4259. -- Function: int readdir64_r (DIR *DIRSTREAM, struct dirent64 *ENTRY,
  4260. struct dirent64 **RESULT)
  4261. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  4262. POSIX Safety Concepts::.
  4263. The deprecated ‘readdir64_r’ function is equivalent to the
  4264. ‘readdir_r’ function except that it takes parameters of base type
  4265. ‘struct dirent64’ instead of ‘struct dirent’ in the second and
  4266. third position. The same precautions mentioned in the
  4267. documentation of ‘readdir_r’ also apply here.
  4268. -- Function: int closedir (DIR *DIRSTREAM)
  4269. Preliminary: | MT-Safe | AS-Unsafe heap lock/hurd | AC-Unsafe mem
  4270. fd lock/hurd | *Note POSIX Safety Concepts::.
  4271. This function closes the directory stream DIRSTREAM. It returns
  4272. ‘0’ on success and ‘-1’ on failure.
  4273. The following ‘errno’ error conditions are defined for this
  4274. function:
  4275. ‘EBADF’
  4276. The DIRSTREAM argument is not valid.
  4277. 
  4278. File: libc.info, Node: Simple Directory Lister, Next: Random Access Directory, Prev: Reading/Closing Directory, Up: Accessing Directories
  4279. 14.3.4 Simple Program to List a Directory
  4280. -----------------------------------------
  4281. Here's a simple program that prints the names of the files in the
  4282. current working directory:
  4283. #include <stdio.h>
  4284. #include <sys/types.h>
  4285. #include <dirent.h>
  4286. int
  4287. main (void)
  4288. {
  4289. DIR *dp;
  4290. struct dirent *ep;
  4291. dp = opendir ("./");
  4292. if (dp != NULL)
  4293. {
  4294. while (ep = readdir (dp))
  4295. puts (ep->d_name);
  4296. (void) closedir (dp);
  4297. }
  4298. else
  4299. perror ("Couldn't open the directory");
  4300. return 0;
  4301. }
  4302. The order in which files appear in a directory tends to be fairly
  4303. random. A more useful program would sort the entries (perhaps by
  4304. alphabetizing them) before printing them; see *note Scanning Directory
  4305. Content::, and *note Array Sort Function::.
  4306. 
  4307. File: libc.info, Node: Random Access Directory, Next: Scanning Directory Content, Prev: Simple Directory Lister, Up: Accessing Directories
  4308. 14.3.5 Random Access in a Directory Stream
  4309. ------------------------------------------
  4310. This section describes how to reread parts of a directory that you have
  4311. already read from an open directory stream. All the symbols are
  4312. declared in the header file ‘dirent.h’.
  4313. -- Function: void rewinddir (DIR *DIRSTREAM)
  4314. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  4315. POSIX Safety Concepts::.
  4316. The ‘rewinddir’ function is used to reinitialize the directory
  4317. stream DIRSTREAM, so that if you call ‘readdir’ it returns
  4318. information about the first entry in the directory again. This
  4319. function also notices if files have been added or removed to the
  4320. directory since it was opened with ‘opendir’. (Entries for these
  4321. files might or might not be returned by ‘readdir’ if they were
  4322. added or removed since you last called ‘opendir’ or ‘rewinddir’.)
  4323. For example, it is recommended to call ‘rewinddir’ followed by
  4324. ‘readdir’ to check if a directory is empty after listing it with
  4325. ‘readdir’ and deleting all encountered files from it.
  4326. -- Function: long int telldir (DIR *DIRSTREAM)
  4327. Preliminary: | MT-Safe | AS-Unsafe heap/bsd lock/bsd | AC-Unsafe
  4328. mem/bsd lock/bsd | *Note POSIX Safety Concepts::.
  4329. The ‘telldir’ function returns the file position of the directory
  4330. stream DIRSTREAM. You can use this value with ‘seekdir’ to restore
  4331. the directory stream to that position.
  4332. Using the the ‘telldir’ function is not recommended.
  4333. The value returned by ‘telldir’ may not be compatible with the
  4334. ‘d_off’ field in ‘struct dirent’, and cannot be used with the
  4335. ‘lseek’ function. The returned value may not unambiguously
  4336. identify the position in the directory stream.
  4337. -- Function: void seekdir (DIR *DIRSTREAM, long int POS)
  4338. Preliminary: | MT-Safe | AS-Unsafe heap/bsd lock/bsd | AC-Unsafe
  4339. mem/bsd lock/bsd | *Note POSIX Safety Concepts::.
  4340. The ‘seekdir’ function sets the file position of the directory
  4341. stream DIRSTREAM to POS. The value POS must be the result of a
  4342. previous call to ‘telldir’ on this particular stream; closing and
  4343. reopening the directory can invalidate values returned by
  4344. ‘telldir’.
  4345. Using the the ‘seekdir’ function is not recommended. To seek to
  4346. the beginning of the directory stream, use ‘rewinddir’.
  4347. 
  4348. File: libc.info, Node: Scanning Directory Content, Next: Simple Directory Lister Mark II, Prev: Random Access Directory, Up: Accessing Directories
  4349. 14.3.6 Scanning the Content of a Directory
  4350. ------------------------------------------
  4351. A higher-level interface to the directory handling functions is the
  4352. ‘scandir’ function. With its help one can select a subset of the
  4353. entries in a directory, possibly sort them and get a list of names as
  4354. the result.
  4355. -- Function: int scandir (const char *DIR, struct dirent ***NAMELIST,
  4356. int (*SELECTOR) (const struct dirent *), int (*CMP) (const
  4357. struct dirent **, const struct dirent **))
  4358. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
  4359. POSIX Safety Concepts::.
  4360. The ‘scandir’ function scans the contents of the directory selected
  4361. by DIR. The result in *NAMELIST is an array of pointers to
  4362. structures of type ‘struct dirent’ which describe all selected
  4363. directory entries and which is allocated using ‘malloc’. Instead
  4364. of always getting all directory entries returned, the user supplied
  4365. function SELECTOR can be used to decide which entries are in the
  4366. result. Only the entries for which SELECTOR returns a non-zero
  4367. value are selected.
  4368. Finally the entries in *NAMELIST are sorted using the user-supplied
  4369. function CMP. The arguments passed to the CMP function are of type
  4370. ‘struct dirent **’, therefore one cannot directly use the ‘strcmp’
  4371. or ‘strcoll’ functions; instead see the functions ‘alphasort’ and
  4372. ‘versionsort’ below.
  4373. The return value of the function is the number of entries placed in
  4374. *NAMELIST. If it is ‘-1’ an error occurred (either the directory
  4375. could not be opened for reading or memory allocation failed) and
  4376. the global variable ‘errno’ contains more information on the error.
  4377. As described above, the fourth argument to the ‘scandir’ function
  4378. must be a pointer to a sorting function. For the convenience of the
  4379. programmer the GNU C Library contains implementations of functions which
  4380. are very helpful for this purpose.
  4381. -- Function: int alphasort (const struct dirent **A, const struct
  4382. dirent **B)
  4383. Preliminary: | MT-Safe locale | AS-Unsafe heap | AC-Unsafe mem |
  4384. *Note POSIX Safety Concepts::.
  4385. The ‘alphasort’ function behaves like the ‘strcoll’ function (*note
  4386. String/Array Comparison::). The difference is that the arguments
  4387. are not string pointers but instead they are of type ‘struct dirent
  4388. **’.
  4389. The return value of ‘alphasort’ is less than, equal to, or greater
  4390. than zero depending on the order of the two entries A and B.
  4391. -- Function: int versionsort (const struct dirent **A, const struct
  4392. dirent **B)
  4393. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4394. Safety Concepts::.
  4395. The ‘versionsort’ function is like ‘alphasort’ except that it uses
  4396. the ‘strverscmp’ function internally.
  4397. If the filesystem supports large files we cannot use the ‘scandir’
  4398. anymore since the ‘dirent’ structure might not able to contain all the
  4399. information. The LFS provides the new type ‘struct dirent64’. To use
  4400. this we need a new function.
  4401. -- Function: int scandir64 (const char *DIR, struct dirent64
  4402. ***NAMELIST, int (*SELECTOR) (const struct dirent64 *), int
  4403. (*CMP) (const struct dirent64 **, const struct dirent64 **))
  4404. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
  4405. POSIX Safety Concepts::.
  4406. The ‘scandir64’ function works like the ‘scandir’ function except
  4407. that the directory entries it returns are described by elements of
  4408. type ‘struct dirent64’. The function pointed to by SELECTOR is
  4409. again used to select the desired entries, except that SELECTOR now
  4410. must point to a function which takes a ‘struct dirent64 *’
  4411. parameter.
  4412. Similarly the CMP function should expect its two arguments to be of
  4413. type ‘struct dirent64 **’.
  4414. As CMP is now a function of a different type, the functions
  4415. ‘alphasort’ and ‘versionsort’ cannot be supplied for that argument.
  4416. Instead we provide the two replacement functions below.
  4417. -- Function: int alphasort64 (const struct dirent64 **A, const struct
  4418. dirent **B)
  4419. Preliminary: | MT-Safe locale | AS-Unsafe heap | AC-Unsafe mem |
  4420. *Note POSIX Safety Concepts::.
  4421. The ‘alphasort64’ function behaves like the ‘strcoll’ function
  4422. (*note String/Array Comparison::). The difference is that the
  4423. arguments are not string pointers but instead they are of type
  4424. ‘struct dirent64 **’.
  4425. Return value of ‘alphasort64’ is less than, equal to, or greater
  4426. than zero depending on the order of the two entries A and B.
  4427. -- Function: int versionsort64 (const struct dirent64 **A, const struct
  4428. dirent64 **B)
  4429. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4430. Safety Concepts::.
  4431. The ‘versionsort64’ function is like ‘alphasort64’, excepted that
  4432. it uses the ‘strverscmp’ function internally.
  4433. It is important not to mix the use of ‘scandir’ and the 64-bit
  4434. comparison functions or vice versa. There are systems on which this
  4435. works but on others it will fail miserably.
  4436. 
  4437. File: libc.info, Node: Simple Directory Lister Mark II, Next: Low-level Directory Access, Prev: Scanning Directory Content, Up: Accessing Directories
  4438. 14.3.7 Simple Program to List a Directory, Mark II
  4439. --------------------------------------------------
  4440. Here is a revised version of the directory lister found above (*note
  4441. Simple Directory Lister::). Using the ‘scandir’ function we can avoid
  4442. the functions which work directly with the directory contents. After
  4443. the call the returned entries are available for direct use.
  4444. #include <stdio.h>
  4445. #include <dirent.h>
  4446. static int
  4447. one (const struct dirent *unused)
  4448. {
  4449. return 1;
  4450. }
  4451. int
  4452. main (void)
  4453. {
  4454. struct dirent **eps;
  4455. int n;
  4456. n = scandir ("./", &eps, one, alphasort);
  4457. if (n >= 0)
  4458. {
  4459. int cnt;
  4460. for (cnt = 0; cnt < n; ++cnt)
  4461. puts (eps[cnt]->d_name);
  4462. }
  4463. else
  4464. perror ("Couldn't open the directory");
  4465. return 0;
  4466. }
  4467. Note the simple selector function in this example. Since we want to
  4468. see all directory entries we always return ‘1’.
  4469. 
  4470. File: libc.info, Node: Low-level Directory Access, Prev: Simple Directory Lister Mark II, Up: Accessing Directories
  4471. 14.3.8 Low-level Directory Access
  4472. ---------------------------------
  4473. The stream-based directory functions are not AS-Safe and cannot be used
  4474. after ‘vfork’. *Note POSIX Safety Concepts::. The functions below
  4475. provide an alternative that can be used in these contexts.
  4476. Directory data is obtained from a file descriptor, as created by the
  4477. ‘open’ function, with or without the ‘O_DIRECTORY’ flag. *Note Opening
  4478. and Closing Files::.
  4479. -- Function: ssize_t getdents64 (int FD, void *BUFFER, size_t LENGTH)
  4480. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4481. Concepts::.
  4482. The ‘getdents64’ function reads at most LENGTH bytes of directory
  4483. entry data from the file descriptor FD and stores it into the byte
  4484. array starting at BUFFER.
  4485. On success, the function returns the number of bytes written to the
  4486. buffer. This number is zero if FD is already at the end of the
  4487. directory stream. On error, the function returns ‘-1’ and sets
  4488. ‘errno’ to the appropriate error code.
  4489. The data is stored as a sequence of ‘struct dirent64’ records,
  4490. which can be traversed using the ‘d_reclen’ member. The buffer
  4491. should be large enough to hold the largest possible directory
  4492. entry. Note that some file systems support file names longer than
  4493. ‘NAME_MAX’ bytes (e.g., because they support up to 255 Unicode
  4494. characters), so a buffer size of at least 1024 is recommended.
  4495. If the directory has been modified since the first call to
  4496. ‘getdents64’ on the directory (opening the descriptor or seeking to
  4497. offset zero), it is possible that the buffer contains entries that
  4498. have been encountered before. Likewise, it is possible that files
  4499. that are still present are not reported before the end of the
  4500. directory is encountered (and ‘getdents64’ returns zero).
  4501. This function is specific to Linux.
  4502. Systems that support ‘getdents64’ support seeking on directory
  4503. streams. *Note File Position Primitive::. However, the only offset
  4504. that works reliably is offset zero, indicating that reading the
  4505. directory should start from the beginning.
  4506. 
  4507. File: libc.info, Node: Working with Directory Trees, Next: Hard Links, Prev: Accessing Directories, Up: File System Interface
  4508. 14.4 Working with Directory Trees
  4509. =================================
  4510. The functions described so far for handling the files in a directory
  4511. have allowed you to either retrieve the information bit by bit, or to
  4512. process all the files as a group (see ‘scandir’). Sometimes it is
  4513. useful to process whole hierarchies of directories and their contained
  4514. files. The X/Open specification defines two functions to do this. The
  4515. simpler form is derived from an early definition in System V systems and
  4516. therefore this function is available on SVID-derived systems. The
  4517. prototypes and required definitions can be found in the ‘ftw.h’ header.
  4518. There are four functions in this family: ‘ftw’, ‘nftw’ and their
  4519. 64-bit counterparts ‘ftw64’ and ‘nftw64’. These functions take as one
  4520. of their arguments a pointer to a callback function of the appropriate
  4521. type.
  4522. -- Data Type: __ftw_func_t
  4523. int (*) (const char *, const struct stat *, int)
  4524. The type of callback functions given to the ‘ftw’ function. The
  4525. first parameter points to the file name, the second parameter to an
  4526. object of type ‘struct stat’ which is filled in for the file named
  4527. in the first parameter.
  4528. The last parameter is a flag giving more information about the
  4529. current file. It can have the following values:
  4530. ‘FTW_F’
  4531. The item is either a normal file or a file which does not fit
  4532. into one of the following categories. This could be special
  4533. files, sockets etc.
  4534. ‘FTW_D’
  4535. The item is a directory.
  4536. ‘FTW_NS’
  4537. The ‘stat’ call failed and so the information pointed to by
  4538. the second parameter is invalid.
  4539. ‘FTW_DNR’
  4540. The item is a directory which cannot be read.
  4541. ‘FTW_SL’
  4542. The item is a symbolic link. Since symbolic links are
  4543. normally followed seeing this value in a ‘ftw’ callback
  4544. function means the referenced file does not exist. The
  4545. situation for ‘nftw’ is different.
  4546. This value is only available if the program is compiled with
  4547. ‘_XOPEN_EXTENDED’ defined before including the first header.
  4548. The original SVID systems do not have symbolic links.
  4549. If the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  4550. type is in fact ‘__ftw64_func_t’ since this mode changes ‘struct
  4551. stat’ to be ‘struct stat64’.
  4552. For the LFS interface and for use in the function ‘ftw64’, the header
  4553. ‘ftw.h’ defines another function type.
  4554. -- Data Type: __ftw64_func_t
  4555. int (*) (const char *, const struct stat64 *, int)
  4556. This type is used just like ‘__ftw_func_t’ for the callback
  4557. function, but this time is called from ‘ftw64’. The second
  4558. parameter to the function is a pointer to a variable of type
  4559. ‘struct stat64’ which is able to represent the larger values.
  4560. -- Data Type: __nftw_func_t
  4561. int (*) (const char *, const struct stat *, int, struct FTW *)
  4562. The first three arguments are the same as for the ‘__ftw_func_t’
  4563. type. However for the third argument some additional values are
  4564. defined to allow finer differentiation:
  4565. ‘FTW_DP’
  4566. The current item is a directory and all subdirectories have
  4567. already been visited and reported. This flag is returned
  4568. instead of ‘FTW_D’ if the ‘FTW_DEPTH’ flag is passed to ‘nftw’
  4569. (see below).
  4570. ‘FTW_SLN’
  4571. The current item is a stale symbolic link. The file it points
  4572. to does not exist.
  4573. The last parameter of the callback function is a pointer to a
  4574. structure with some extra information as described below.
  4575. If the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  4576. type is in fact ‘__nftw64_func_t’ since this mode changes ‘struct
  4577. stat’ to be ‘struct stat64’.
  4578. For the LFS interface there is also a variant of this data type
  4579. available which has to be used with the ‘nftw64’ function.
  4580. -- Data Type: __nftw64_func_t
  4581. int (*) (const char *, const struct stat64 *, int, struct FTW *)
  4582. This type is used just like ‘__nftw_func_t’ for the callback
  4583. function, but this time is called from ‘nftw64’. The second
  4584. parameter to the function is this time a pointer to a variable of
  4585. type ‘struct stat64’ which is able to represent the larger values.
  4586. -- Data Type: struct FTW
  4587. The information contained in this structure helps in interpreting
  4588. the name parameter and gives some information about the current
  4589. state of the traversal of the directory hierarchy.
  4590. ‘int base’
  4591. The value is the offset into the string passed in the first
  4592. parameter to the callback function of the beginning of the
  4593. file name. The rest of the string is the path of the file.
  4594. This information is especially important if the ‘FTW_CHDIR’
  4595. flag was set in calling ‘nftw’ since then the current
  4596. directory is the one the current item is found in.
  4597. ‘int level’
  4598. Whilst processing, the code tracks how many directories down
  4599. it has gone to find the current file. This nesting level
  4600. starts at 0 for files in the initial directory (or is zero for
  4601. the initial file if a file was passed).
  4602. -- Function: int ftw (const char *FILENAME, __ftw_func_t FUNC, int
  4603. DESCRIPTORS)
  4604. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
  4605. POSIX Safety Concepts::.
  4606. The ‘ftw’ function calls the callback function given in the
  4607. parameter FUNC for every item which is found in the directory
  4608. specified by FILENAME and all directories below. The function
  4609. follows symbolic links if necessary but does not process an item
  4610. twice. If FILENAME is not a directory then it itself is the only
  4611. object returned to the callback function.
  4612. The file name passed to the callback function is constructed by
  4613. taking the FILENAME parameter and appending the names of all passed
  4614. directories and then the local file name. So the callback function
  4615. can use this parameter to access the file. ‘ftw’ also calls ‘stat’
  4616. for the file and passes that information on to the callback
  4617. function. If this ‘stat’ call is not successful the failure is
  4618. indicated by setting the third argument of the callback function to
  4619. ‘FTW_NS’. Otherwise it is set according to the description given
  4620. in the account of ‘__ftw_func_t’ above.
  4621. The callback function is expected to return 0 to indicate that no
  4622. error occurred and that processing should continue. If an error
  4623. occurred in the callback function or it wants ‘ftw’ to return
  4624. immediately, the callback function can return a value other than 0.
  4625. This is the only correct way to stop the function. The program
  4626. must not use ‘setjmp’ or similar techniques to continue from
  4627. another place. This would leave resources allocated by the ‘ftw’
  4628. function unfreed.
  4629. The DESCRIPTORS parameter to ‘ftw’ specifies how many file
  4630. descriptors it is allowed to consume. The function runs faster the
  4631. more descriptors it can use. For each level in the directory
  4632. hierarchy at most one descriptor is used, but for very deep ones
  4633. any limit on open file descriptors for the process or the system
  4634. may be exceeded. Moreover, file descriptor limits in a
  4635. multi-threaded program apply to all the threads as a group, and
  4636. therefore it is a good idea to supply a reasonable limit to the
  4637. number of open descriptors.
  4638. The return value of the ‘ftw’ function is 0 if all callback
  4639. function calls returned 0 and all actions performed by the ‘ftw’
  4640. succeeded. If a function call failed (other than calling ‘stat’ on
  4641. an item) the function returns -1. If a callback function returns a
  4642. value other than 0 this value is returned as the return value of
  4643. ‘ftw’.
  4644. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ on a
  4645. 32-bit system this function is in fact ‘ftw64’, i.e., the LFS
  4646. interface transparently replaces the old interface.
  4647. -- Function: int ftw64 (const char *FILENAME, __ftw64_func_t FUNC, int
  4648. DESCRIPTORS)
  4649. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
  4650. POSIX Safety Concepts::.
  4651. This function is similar to ‘ftw’ but it can work on filesystems
  4652. with large files. File information is reported using a variable of
  4653. type ‘struct stat64’ which is passed by reference to the callback
  4654. function.
  4655. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ on a
  4656. 32-bit system this function is available under the name ‘ftw’ and
  4657. transparently replaces the old implementation.
  4658. -- Function: int nftw (const char *FILENAME, __nftw_func_t FUNC, int
  4659. DESCRIPTORS, int FLAG)
  4660. Preliminary: | MT-Safe cwd | AS-Unsafe heap | AC-Unsafe mem fd cwd
  4661. | *Note POSIX Safety Concepts::.
  4662. The ‘nftw’ function works like the ‘ftw’ functions. They call the
  4663. callback function FUNC for all items found in the directory
  4664. FILENAME and below. At most DESCRIPTORS file descriptors are
  4665. consumed during the ‘nftw’ call.
  4666. One difference is that the callback function is of a different
  4667. type. It is of type ‘struct FTW *’ and provides the callback
  4668. function with the extra information described above.
  4669. A second difference is that ‘nftw’ takes a fourth argument, which
  4670. is 0 or a bitwise-OR combination of any of the following values.
  4671. ‘FTW_PHYS’
  4672. While traversing the directory symbolic links are not
  4673. followed. Instead symbolic links are reported using the
  4674. ‘FTW_SL’ value for the type parameter to the callback
  4675. function. If the file referenced by a symbolic link does not
  4676. exist ‘FTW_SLN’ is returned instead.
  4677. ‘FTW_MOUNT’
  4678. The callback function is only called for items which are on
  4679. the same mounted filesystem as the directory given by the
  4680. FILENAME parameter to ‘nftw’.
  4681. ‘FTW_CHDIR’
  4682. If this flag is given the current working directory is changed
  4683. to the directory of the reported object before the callback
  4684. function is called. When ‘ntfw’ finally returns the current
  4685. directory is restored to its original value.
  4686. ‘FTW_DEPTH’
  4687. If this option is specified then all subdirectories and files
  4688. within them are processed before processing the top directory
  4689. itself (depth-first processing). This also means the type
  4690. flag given to the callback function is ‘FTW_DP’ and not
  4691. ‘FTW_D’.
  4692. ‘FTW_ACTIONRETVAL’
  4693. If this option is specified then return values from callbacks
  4694. are handled differently. If the callback returns
  4695. ‘FTW_CONTINUE’, walking continues normally. ‘FTW_STOP’ means
  4696. walking stops and ‘FTW_STOP’ is returned to the caller. If
  4697. ‘FTW_SKIP_SUBTREE’ is returned by the callback with ‘FTW_D’
  4698. argument, the subtree is skipped and walking continues with
  4699. next sibling of the directory. If ‘FTW_SKIP_SIBLINGS’ is
  4700. returned by the callback, all siblings of the current entry
  4701. are skipped and walking continues in its parent. No other
  4702. return values should be returned from the callbacks if this
  4703. option is set. This option is a GNU extension.
  4704. The return value is computed in the same way as for ‘ftw’. ‘nftw’
  4705. returns 0 if no failures occurred and all callback functions
  4706. returned 0. In case of internal errors, such as memory problems,
  4707. the return value is -1 and ‘errno’ is set accordingly. If the
  4708. return value of a callback invocation was non-zero then that value
  4709. is returned.
  4710. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ on a
  4711. 32-bit system this function is in fact ‘nftw64’, i.e., the LFS
  4712. interface transparently replaces the old interface.
  4713. -- Function: int nftw64 (const char *FILENAME, __nftw64_func_t FUNC,
  4714. int DESCRIPTORS, int FLAG)
  4715. Preliminary: | MT-Safe cwd | AS-Unsafe heap | AC-Unsafe mem fd cwd
  4716. | *Note POSIX Safety Concepts::.
  4717. This function is similar to ‘nftw’ but it can work on filesystems
  4718. with large files. File information is reported using a variable of
  4719. type ‘struct stat64’ which is passed by reference to the callback
  4720. function.
  4721. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ on a
  4722. 32-bit system this function is available under the name ‘nftw’ and
  4723. transparently replaces the old implementation.
  4724. 
  4725. File: libc.info, Node: Hard Links, Next: Symbolic Links, Prev: Working with Directory Trees, Up: File System Interface
  4726. 14.5 Hard Links
  4727. ===============
  4728. In POSIX systems, one file can have many names at the same time. All of
  4729. the names are equally real, and no one of them is preferred to the
  4730. others.
  4731. To add a name to a file, use the ‘link’ function. (The new name is
  4732. also called a “hard link” to the file.) Creating a new link to a file
  4733. does not copy the contents of the file; it simply makes a new name by
  4734. which the file can be known, in addition to the file's existing name or
  4735. names.
  4736. One file can have names in several directories, so the organization
  4737. of the file system is not a strict hierarchy or tree.
  4738. In most implementations, it is not possible to have hard links to the
  4739. same file in multiple file systems. ‘link’ reports an error if you try
  4740. to make a hard link to the file from another file system when this
  4741. cannot be done.
  4742. The prototype for the ‘link’ function is declared in the header file
  4743. ‘unistd.h’.
  4744. -- Function: int link (const char *OLDNAME, const char *NEWNAME)
  4745. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4746. Concepts::.
  4747. The ‘link’ function makes a new link to the existing file named by
  4748. OLDNAME, under the new name NEWNAME.
  4749. This function returns a value of ‘0’ if it is successful and ‘-1’
  4750. on failure. In addition to the usual file name errors (*note File
  4751. Name Errors::) for both OLDNAME and NEWNAME, the following ‘errno’
  4752. error conditions are defined for this function:
  4753. ‘EACCES’
  4754. You are not allowed to write to the directory in which the new
  4755. link is to be written.
  4756. ‘EEXIST’
  4757. There is already a file named NEWNAME. If you want to replace
  4758. this link with a new link, you must remove the old link
  4759. explicitly first.
  4760. ‘EMLINK’
  4761. There are already too many links to the file named by OLDNAME.
  4762. (The maximum number of links to a file is ‘LINK_MAX’; see
  4763. *note Limits for Files::.)
  4764. ‘ENOENT’
  4765. The file named by OLDNAME doesn't exist. You can't make a
  4766. link to a file that doesn't exist.
  4767. ‘ENOSPC’
  4768. The directory or file system that would contain the new link
  4769. is full and cannot be extended.
  4770. ‘EPERM’
  4771. On GNU/Linux and GNU/Hurd systems and some others, you cannot
  4772. make links to directories. Many systems allow only privileged
  4773. users to do so. This error is used to report the problem.
  4774. ‘EROFS’
  4775. The directory containing the new link can't be modified
  4776. because it's on a read-only file system.
  4777. ‘EXDEV’
  4778. The directory specified in NEWNAME is on a different file
  4779. system than the existing file.
  4780. ‘EIO’
  4781. A hardware error occurred while trying to read or write the to
  4782. filesystem.
  4783. -- Function: int linkat (int oldfd, const char *OLDNAME, int newfd,
  4784. const char *NEWNAME, int flags)
  4785. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4786. Concepts::.
  4787. The ‘linkat’ function is analogous to the ‘link’ function, except
  4788. that it identifies its source and target using a combination of a
  4789. file descriptor (referring to a directory) and a file name. *Note
  4790. Descriptor-Relative Access::. For ‘linkat’, if a file name is not
  4791. absolute, it is resolved relative to the corresponding file
  4792. descriptor. As usual, the special value ‘AT_FDCWD’ denotes the
  4793. current directory.
  4794. The FLAGS argument is a combination of the following flags:
  4795. ‘AT_SYMLINK_FOLLOW’
  4796. If the source path identified by OLDFD and OLDNAME is a
  4797. symbolic link, ‘linkat’ follows the symbolic link and creates
  4798. a link to its target. If the flag is not set, a link for the
  4799. symbolic link itself is created; this is not supported by all
  4800. file systems and ‘linkat’ can fail in this case.
  4801. ‘AT_EMPTY_PATH’
  4802. If this flag is specified, OLDNAME can be an empty string. In
  4803. this case, a new link to the file denoted by the descriptor
  4804. OLDFD is created, which may have been opened with ‘O_PATH’ or
  4805. ‘O_TMPFILE’. This flag is a GNU extension.
  4806. 
  4807. File: libc.info, Node: Symbolic Links, Next: Deleting Files, Prev: Hard Links, Up: File System Interface
  4808. 14.6 Symbolic Links
  4809. ===================
  4810. GNU systems support “soft links” or “symbolic links”. This is a kind of
  4811. "file" that is essentially a pointer to another file name. Unlike hard
  4812. links, symbolic links can be made to directories or across file systems
  4813. with no restrictions. You can also make a symbolic link to a name which
  4814. is not the name of any file. (Opening this link will fail until a file
  4815. by that name is created.) Likewise, if the symbolic link points to an
  4816. existing file which is later deleted, the symbolic link continues to
  4817. point to the same file name even though the name no longer names any
  4818. file.
  4819. The reason symbolic links work the way they do is that special things
  4820. happen when you try to open the link. The ‘open’ function realizes you
  4821. have specified the name of a link, reads the file name contained in the
  4822. link, and opens that file name instead. The ‘stat’ function likewise
  4823. operates on the file that the symbolic link points to, instead of on the
  4824. link itself.
  4825. By contrast, other operations such as deleting or renaming the file
  4826. operate on the link itself. The functions ‘readlink’ and ‘lstat’ also
  4827. refrain from following symbolic links, because their purpose is to
  4828. obtain information about the link. ‘link’, the function that makes a
  4829. hard link, does too. It makes a hard link to the symbolic link, which
  4830. one rarely wants.
  4831. Some systems have, for some functions operating on files, a limit on
  4832. how many symbolic links are followed when resolving a path name. The
  4833. limit if it exists is published in the ‘sys/param.h’ header file.
  4834. -- Macro: int MAXSYMLINKS
  4835. The macro ‘MAXSYMLINKS’ specifies how many symlinks some function
  4836. will follow before returning ‘ELOOP’. Not all functions behave the
  4837. same and this value is not the same as that returned for
  4838. ‘_SC_SYMLOOP’ by ‘sysconf’. In fact, the ‘sysconf’ result can
  4839. indicate that there is no fixed limit although ‘MAXSYMLINKS’ exists
  4840. and has a finite value.
  4841. Prototypes for most of the functions listed in this section are in
  4842. ‘unistd.h’.
  4843. -- Function: int symlink (const char *OLDNAME, const char *NEWNAME)
  4844. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4845. Concepts::.
  4846. The ‘symlink’ function makes a symbolic link to OLDNAME named
  4847. NEWNAME.
  4848. The normal return value from ‘symlink’ is ‘0’. A return value of
  4849. ‘-1’ indicates an error. In addition to the usual file name syntax
  4850. errors (*note File Name Errors::), the following ‘errno’ error
  4851. conditions are defined for this function:
  4852. ‘EEXIST’
  4853. There is already an existing file named NEWNAME.
  4854. ‘EROFS’
  4855. The file NEWNAME would exist on a read-only file system.
  4856. ‘ENOSPC’
  4857. The directory or file system cannot be extended to make the
  4858. new link.
  4859. ‘EIO’
  4860. A hardware error occurred while reading or writing data on the
  4861. disk.
  4862. -- Function: ssize_t readlink (const char *FILENAME, char *BUFFER,
  4863. size_t SIZE)
  4864. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4865. Concepts::.
  4866. The ‘readlink’ function gets the value of the symbolic link
  4867. FILENAME. The file name that the link points to is copied into
  4868. BUFFER. This file name string is _not_ null-terminated; ‘readlink’
  4869. normally returns the number of characters copied. The SIZE
  4870. argument specifies the maximum number of characters to copy,
  4871. usually the allocation size of BUFFER.
  4872. If the return value equals SIZE, you cannot tell whether or not
  4873. there was room to return the entire name. So make a bigger buffer
  4874. and call ‘readlink’ again. Here is an example:
  4875. char *
  4876. readlink_malloc (const char *filename)
  4877. {
  4878. size_t size = 50;
  4879. char *buffer = NULL;
  4880. while (1)
  4881. {
  4882. buffer = xreallocarray (buffer, size, 2);
  4883. size *= 2;
  4884. ssize_t nchars = readlink (filename, buffer, size);
  4885. if (nchars < 0)
  4886. {
  4887. free (buffer);
  4888. return NULL;
  4889. }
  4890. if (nchars < size)
  4891. return buffer;
  4892. }
  4893. }
  4894. A value of ‘-1’ is returned in case of error. In addition to the
  4895. usual file name errors (*note File Name Errors::), the following
  4896. ‘errno’ error conditions are defined for this function:
  4897. ‘EINVAL’
  4898. The named file is not a symbolic link.
  4899. ‘EIO’
  4900. A hardware error occurred while reading or writing data on the
  4901. disk.
  4902. In some situations it is desirable to resolve all the symbolic links
  4903. to get the real name of a file where no prefix names a symbolic link
  4904. which is followed and no filename in the path is ‘.’ or ‘..’. This is
  4905. for instance desirable if files have to be compared in which case
  4906. different names can refer to the same inode.
  4907. -- Function: char * canonicalize_file_name (const char *NAME)
  4908. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
  4909. POSIX Safety Concepts::.
  4910. The ‘canonicalize_file_name’ function returns the absolute name of
  4911. the file named by NAME which contains no ‘.’, ‘..’ components nor
  4912. any repeated path separators (‘/’) or symlinks. The result is
  4913. passed back as the return value of the function in a block of
  4914. memory allocated with ‘malloc’. If the result is not used anymore
  4915. the memory should be freed with a call to ‘free’.
  4916. If any of the path components are missing the function returns a
  4917. NULL pointer. This is also what is returned if the length of the
  4918. path reaches or exceeds ‘PATH_MAX’ characters. In any case ‘errno’
  4919. is set accordingly.
  4920. ‘ENAMETOOLONG’
  4921. The resulting path is too long. This error only occurs on
  4922. systems which have a limit on the file name length.
  4923. ‘EACCES’
  4924. At least one of the path components is not readable.
  4925. ‘ENOENT’
  4926. The input file name is empty.
  4927. ‘ENOENT’
  4928. At least one of the path components does not exist.
  4929. ‘ELOOP’
  4930. More than ‘MAXSYMLINKS’ many symlinks have been followed.
  4931. This function is a GNU extension and is declared in ‘stdlib.h’.
  4932. The Unix standard includes a similar function which differs from
  4933. ‘canonicalize_file_name’ in that the user has to provide the buffer
  4934. where the result is placed in.
  4935. -- Function: char * realpath (const char *restrict NAME, char *restrict
  4936. RESOLVED)
  4937. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
  4938. POSIX Safety Concepts::.
  4939. A call to ‘realpath’ where the RESOLVED parameter is ‘NULL’ behaves
  4940. exactly like ‘canonicalize_file_name’. The function allocates a
  4941. buffer for the file name and returns a pointer to it. If RESOLVED
  4942. is not ‘NULL’ it points to a buffer into which the result is
  4943. copied. It is the callers responsibility to allocate a buffer
  4944. which is large enough. On systems which define ‘PATH_MAX’ this
  4945. means the buffer must be large enough for a pathname of this size.
  4946. For systems without limitations on the pathname length the
  4947. requirement cannot be met and programs should not call ‘realpath’
  4948. with anything but ‘NULL’ for the second parameter.
  4949. One other difference is that the buffer RESOLVED (if nonzero) will
  4950. contain the part of the path component which does not exist or is
  4951. not readable if the function returns ‘NULL’ and ‘errno’ is set to
  4952. ‘EACCES’ or ‘ENOENT’.
  4953. This function is declared in ‘stdlib.h’.
  4954. The advantage of using this function is that it is more widely
  4955. available. The drawback is that it reports failures for long paths on
  4956. systems which have no limits on the file name length.
  4957. 
  4958. File: libc.info, Node: Deleting Files, Next: Renaming Files, Prev: Symbolic Links, Up: File System Interface
  4959. 14.7 Deleting Files
  4960. ===================
  4961. You can delete a file with ‘unlink’ or ‘remove’.
  4962. Deletion actually deletes a file name. If this is the file's only
  4963. name, then the file is deleted as well. If the file has other remaining
  4964. names (*note Hard Links::), it remains accessible under those names.
  4965. -- Function: int unlink (const char *FILENAME)
  4966. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4967. Concepts::.
  4968. The ‘unlink’ function deletes the file name FILENAME. If this is a
  4969. file's sole name, the file itself is also deleted. (Actually, if
  4970. any process has the file open when this happens, deletion is
  4971. postponed until all processes have closed the file.)
  4972. The function ‘unlink’ is declared in the header file ‘unistd.h’.
  4973. This function returns ‘0’ on successful completion, and ‘-1’ on
  4974. error. In addition to the usual file name errors (*note File Name
  4975. Errors::), the following ‘errno’ error conditions are defined for
  4976. this function:
  4977. ‘EACCES’
  4978. Write permission is denied for the directory from which the
  4979. file is to be removed, or the directory has the sticky bit set
  4980. and you do not own the file.
  4981. ‘EBUSY’
  4982. This error indicates that the file is being used by the system
  4983. in such a way that it can't be unlinked. For example, you
  4984. might see this error if the file name specifies the root
  4985. directory or a mount point for a file system.
  4986. ‘ENOENT’
  4987. The file name to be deleted doesn't exist.
  4988. ‘EPERM’
  4989. On some systems ‘unlink’ cannot be used to delete the name of
  4990. a directory, or at least can only be used this way by a
  4991. privileged user. To avoid such problems, use ‘rmdir’ to
  4992. delete directories. (On GNU/Linux and GNU/Hurd systems
  4993. ‘unlink’ can never delete the name of a directory.)
  4994. ‘EROFS’
  4995. The directory containing the file name to be deleted is on a
  4996. read-only file system and can't be modified.
  4997. -- Function: int unlinkat (int FILEDES, const char *FILENAME, int
  4998. FLAGS)
  4999. | MT-Safe | AS-Unsafe corrupt | AC-Unsafe corrupt | *Note POSIX
  5000. Safety Concepts::.
  5001. This function is a descriptor-relative version of the ‘unlink’
  5002. function above. *Note Descriptor-Relative Access::. The FLAGS
  5003. argument may either be ‘0’ or contain the flag ‘AT_REMOVEDIR’:
  5004. ‘AT_REMOVEDIR’
  5005. This flag causes ‘unlinkat’ to perform an ‘rmdir’ operation on
  5006. ‘filename’ instead of performing the equivalent of ‘unlink’.
  5007. Compared to ‘unlink’, some additional error conditions can occur
  5008. due to descriptor-relative access. *Note Descriptor-Relative
  5009. Access::. In addition to this, the following other errors can also
  5010. occur:
  5011. ‘EISDIR’
  5012. The effective final path derived from FILENAME and FILEDES is
  5013. a directory but ‘AT_REMOVEDIR’ was not passed in ‘flags’.
  5014. -- Function: int rmdir (const char *FILENAME)
  5015. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5016. Concepts::.
  5017. The ‘rmdir’ function deletes a directory. The directory must be
  5018. empty before it can be removed; in other words, it can only contain
  5019. entries for ‘.’ and ‘..’.
  5020. In most other respects, ‘rmdir’ behaves like ‘unlink’. There are
  5021. two additional ‘errno’ error conditions defined for ‘rmdir’:
  5022. ‘ENOTEMPTY’
  5023. ‘EEXIST’
  5024. The directory to be deleted is not empty.
  5025. These two error codes are synonymous; some systems use one, and
  5026. some use the other. GNU/Linux and GNU/Hurd systems always use
  5027. ‘ENOTEMPTY’.
  5028. The prototype for this function is declared in the header file
  5029. ‘unistd.h’.
  5030. -- Function: int remove (const char *FILENAME)
  5031. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5032. Concepts::.
  5033. This is the ISO C function to remove a file. It works like
  5034. ‘unlink’ for files and like ‘rmdir’ for directories. ‘remove’ is
  5035. declared in ‘stdio.h’.
  5036. 
  5037. File: libc.info, Node: Renaming Files, Next: Creating Directories, Prev: Deleting Files, Up: File System Interface
  5038. 14.8 Renaming Files
  5039. ===================
  5040. The ‘rename’ function is used to change a file's name.
  5041. -- Function: int rename (const char *OLDNAME, const char *NEWNAME)
  5042. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5043. Concepts::.
  5044. The ‘rename’ function renames the file OLDNAME to NEWNAME. The
  5045. file formerly accessible under the name OLDNAME is afterwards
  5046. accessible as NEWNAME instead. (If the file had any other names
  5047. aside from OLDNAME, it continues to have those names.)
  5048. The directory containing the name NEWNAME must be on the same file
  5049. system as the directory containing the name OLDNAME.
  5050. One special case for ‘rename’ is when OLDNAME and NEWNAME are two
  5051. names for the same file. The consistent way to handle this case is
  5052. to delete OLDNAME. However, in this case POSIX requires that
  5053. ‘rename’ do nothing and report success--which is inconsistent. We
  5054. don't know what your operating system will do.
  5055. If OLDNAME is not a directory, then any existing file named NEWNAME
  5056. is removed during the renaming operation. However, if NEWNAME is
  5057. the name of a directory, ‘rename’ fails in this case.
  5058. If OLDNAME is a directory, then either NEWNAME must not exist or it
  5059. must name a directory that is empty. In the latter case, the
  5060. existing directory named NEWNAME is deleted first. The name
  5061. NEWNAME must not specify a subdirectory of the directory ‘oldname’
  5062. which is being renamed.
  5063. One useful feature of ‘rename’ is that the meaning of NEWNAME
  5064. changes "atomically" from any previously existing file by that name
  5065. to its new meaning (i.e., the file that was called OLDNAME). There
  5066. is no instant at which NEWNAME is non-existent "in between" the old
  5067. meaning and the new meaning. If there is a system crash during the
  5068. operation, it is possible for both names to still exist; but
  5069. NEWNAME will always be intact if it exists at all.
  5070. If ‘rename’ fails, it returns ‘-1’. In addition to the usual file
  5071. name errors (*note File Name Errors::), the following ‘errno’ error
  5072. conditions are defined for this function:
  5073. ‘EACCES’
  5074. One of the directories containing NEWNAME or OLDNAME refuses
  5075. write permission; or NEWNAME and OLDNAME are directories and
  5076. write permission is refused for one of them.
  5077. ‘EBUSY’
  5078. A directory named by OLDNAME or NEWNAME is being used by the
  5079. system in a way that prevents the renaming from working. This
  5080. includes directories that are mount points for filesystems,
  5081. and directories that are the current working directories of
  5082. processes.
  5083. ‘ENOTEMPTY’
  5084. ‘EEXIST’
  5085. The directory NEWNAME isn't empty. GNU/Linux and GNU/Hurd
  5086. systems always return ‘ENOTEMPTY’ for this, but some other
  5087. systems return ‘EEXIST’.
  5088. ‘EINVAL’
  5089. OLDNAME is a directory that contains NEWNAME.
  5090. ‘EISDIR’
  5091. NEWNAME is a directory but the OLDNAME isn't.
  5092. ‘EMLINK’
  5093. The parent directory of NEWNAME would have too many links
  5094. (entries).
  5095. ‘ENOENT’
  5096. The file OLDNAME doesn't exist.
  5097. ‘ENOSPC’
  5098. The directory that would contain NEWNAME has no room for
  5099. another entry, and there is no space left in the file system
  5100. to expand it.
  5101. ‘EROFS’
  5102. The operation would involve writing to a directory on a
  5103. read-only file system.
  5104. ‘EXDEV’
  5105. The two file names NEWNAME and OLDNAME are on different file
  5106. systems.
  5107. -- Function: int renameat (int OLDFILEDES, const char *OLDNAME, int
  5108. NEWFILEDES, const char *NEWNAME)
  5109. | MT-Safe | AS-Unsafe corrupt | AC-Unsafe corrupt | *Note POSIX
  5110. Safety Concepts::.
  5111. This function is a descriptor-relative version of the ‘rename’
  5112. function above. *Note Descriptor-Relative Access::. If OLDNAME or
  5113. NEWNAME is a relative path, it is interpreted relative to the
  5114. directory associated with OLDFILEDES or NEWFILEDES, respectively.
  5115. Absolute paths are interpreted in the usual way.
  5116. Compared to ‘rename’, some additional error conditions can occur.
  5117. *Note Descriptor-Relative Access::.
  5118. 
  5119. File: libc.info, Node: Creating Directories, Next: File Attributes, Prev: Renaming Files, Up: File System Interface
  5120. 14.9 Creating Directories
  5121. =========================
  5122. Directories are created with the ‘mkdir’ function. (There is also a
  5123. shell command ‘mkdir’ which does the same thing.)
  5124. -- Function: int mkdir (const char *FILENAME, mode_t MODE)
  5125. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5126. Concepts::.
  5127. The ‘mkdir’ function creates a new, empty directory with name
  5128. FILENAME.
  5129. The argument MODE specifies the file permissions for the new
  5130. directory file. *Note Permission Bits::, for more information
  5131. about this.
  5132. A return value of ‘0’ indicates successful completion, and ‘-1’
  5133. indicates failure. In addition to the usual file name syntax
  5134. errors (*note File Name Errors::), the following ‘errno’ error
  5135. conditions are defined for this function:
  5136. ‘EACCES’
  5137. Write permission is denied for the parent directory in which
  5138. the new directory is to be added.
  5139. ‘EEXIST’
  5140. A file named FILENAME already exists.
  5141. ‘EMLINK’
  5142. The parent directory has too many links (entries).
  5143. Well-designed file systems never report this error, because
  5144. they permit more links than your disk could possibly hold.
  5145. However, you must still take account of the possibility of
  5146. this error, as it could result from network access to a file
  5147. system on another machine.
  5148. ‘ENOSPC’
  5149. The file system doesn't have enough room to create the new
  5150. directory.
  5151. ‘EROFS’
  5152. The parent directory of the directory being created is on a
  5153. read-only file system and cannot be modified.
  5154. To use this function, your program should include the header file
  5155. ‘sys/stat.h’.
  5156. -- Function: int mkdirat (int FILEDES, const char *FILENAME, mode_t
  5157. MODE)
  5158. | MT-Safe | AS-Unsafe corrupt | AC-Unsafe corrupt | *Note POSIX
  5159. Safety Concepts::.
  5160. This function is a descriptor-relative version of the ‘mkdir’
  5161. function above. *Note Descriptor-Relative Access::.
  5162. Compared to ‘mkdir’, some additional error conditions can occur.
  5163. *Note Descriptor-Relative Access::.
  5164. 
  5165. File: libc.info, Node: File Attributes, Next: Making Special Files, Prev: Creating Directories, Up: File System Interface
  5166. 14.10 File Attributes
  5167. =====================
  5168. When you issue an ‘ls -l’ shell command on a file, it gives you
  5169. information about the size of the file, who owns it, when it was last
  5170. modified, etc. These are called the “file attributes”, and are
  5171. associated with the file itself and not a particular one of its names.
  5172. This section contains information about how you can inquire about and
  5173. modify the attributes of a file.
  5174. * Menu:
  5175. * Attribute Meanings:: The names of the file attributes,
  5176. and what their values mean.
  5177. * Reading Attributes:: How to read the attributes of a file.
  5178. * Testing File Type:: Distinguishing ordinary files,
  5179. directories, links...
  5180. * File Owner:: How ownership for new files is determined,
  5181. and how to change it.
  5182. * Permission Bits:: How information about a file's access
  5183. mode is stored.
  5184. * Access Permission:: How the system decides who can access a file.
  5185. * Setting Permissions:: How permissions for new files are assigned,
  5186. and how to change them.
  5187. * Testing File Access:: How to find out if your process can
  5188. access a file.
  5189. * File Times:: About the time attributes of a file.
  5190. * File Size:: Manually changing the size of a file.
  5191. * Storage Allocation:: Allocate backing storage for files.
  5192. 
  5193. File: libc.info, Node: Attribute Meanings, Next: Reading Attributes, Up: File Attributes
  5194. 14.10.1 The meaning of the File Attributes
  5195. ------------------------------------------
  5196. When you read the attributes of a file, they come back in a structure
  5197. called ‘struct stat’. This section describes the names of the
  5198. attributes, their data types, and what they mean. For the functions to
  5199. read the attributes of a file, see *note Reading Attributes::.
  5200. The header file ‘sys/stat.h’ declares all the symbols defined in this
  5201. section.
  5202. -- Data Type: struct stat
  5203. The ‘stat’ structure type is used to return information about the
  5204. attributes of a file. It contains at least the following members:
  5205. ‘mode_t st_mode’
  5206. Specifies the mode of the file. This includes file type
  5207. information (*note Testing File Type::) and the file
  5208. permission bits (*note Permission Bits::).
  5209. ‘ino_t st_ino’
  5210. The file serial number, which distinguishes this file from all
  5211. other files on the same device.
  5212. ‘dev_t st_dev’
  5213. Identifies the device containing the file. The ‘st_ino’ and
  5214. ‘st_dev’, taken together, uniquely identify the file. The
  5215. ‘st_dev’ value is not necessarily consistent across reboots or
  5216. system crashes, however.
  5217. ‘nlink_t st_nlink’
  5218. The number of hard links to the file. This count keeps track
  5219. of how many directories have entries for this file. If the
  5220. count is ever decremented to zero, then the file itself is
  5221. discarded as soon as no process still holds it open. Symbolic
  5222. links are not counted in the total.
  5223. ‘uid_t st_uid’
  5224. The user ID of the file's owner. *Note File Owner::.
  5225. ‘gid_t st_gid’
  5226. The group ID of the file. *Note File Owner::.
  5227. ‘off_t st_size’
  5228. This specifies the size of a regular file in bytes. For files
  5229. that are really devices this field isn't usually meaningful.
  5230. For symbolic links this specifies the length of the file name
  5231. the link refers to.
  5232. ‘time_t st_atime’
  5233. This is the last access time for the file. *Note File
  5234. Times::.
  5235. ‘unsigned long int st_atime_usec’
  5236. This is the fractional part of the last access time for the
  5237. file. *Note File Times::.
  5238. ‘time_t st_mtime’
  5239. This is the time of the last modification to the contents of
  5240. the file. *Note File Times::.
  5241. ‘unsigned long int st_mtime_usec’
  5242. This is the fractional part of the time of the last
  5243. modification to the contents of the file. *Note File Times::.
  5244. ‘time_t st_ctime’
  5245. This is the time of the last modification to the attributes of
  5246. the file. *Note File Times::.
  5247. ‘unsigned long int st_ctime_usec’
  5248. This is the fractional part of the time of the last
  5249. modification to the attributes of the file. *Note File
  5250. Times::.
  5251. ‘blkcnt_t st_blocks’
  5252. This is the amount of disk space that the file occupies,
  5253. measured in units of 512-byte blocks.
  5254. The number of disk blocks is not strictly proportional to the
  5255. size of the file, for two reasons: the file system may use
  5256. some blocks for internal record keeping; and the file may be
  5257. sparse--it may have "holes" which contain zeros but do not
  5258. actually take up space on the disk.
  5259. You can tell (approximately) whether a file is sparse by
  5260. comparing this value with ‘st_size’, like this:
  5261. (st.st_blocks * 512 < st.st_size)
  5262. This test is not perfect because a file that is just slightly
  5263. sparse might not be detected as sparse at all. For practical
  5264. applications, this is not a problem.
  5265. ‘unsigned int st_blksize’
  5266. The optimal block size for reading or writing this file, in
  5267. bytes. You might use this size for allocating the buffer
  5268. space for reading or writing the file. (This is unrelated to
  5269. ‘st_blocks’.)
  5270. The extensions for the Large File Support (LFS) require, even on
  5271. 32-bit machines, types which can handle file sizes up to 2^63.
  5272. Therefore a new definition of ‘struct stat’ is necessary.
  5273. -- Data Type: struct stat64
  5274. The members of this type are the same and have the same names as
  5275. those in ‘struct stat’. The only difference is that the members
  5276. ‘st_ino’, ‘st_size’, and ‘st_blocks’ have a different type to
  5277. support larger values.
  5278. ‘mode_t st_mode’
  5279. Specifies the mode of the file. This includes file type
  5280. information (*note Testing File Type::) and the file
  5281. permission bits (*note Permission Bits::).
  5282. ‘ino64_t st_ino’
  5283. The file serial number, which distinguishes this file from all
  5284. other files on the same device.
  5285. ‘dev_t st_dev’
  5286. Identifies the device containing the file. The ‘st_ino’ and
  5287. ‘st_dev’, taken together, uniquely identify the file. The
  5288. ‘st_dev’ value is not necessarily consistent across reboots or
  5289. system crashes, however.
  5290. ‘nlink_t st_nlink’
  5291. The number of hard links to the file. This count keeps track
  5292. of how many directories have entries for this file. If the
  5293. count is ever decremented to zero, then the file itself is
  5294. discarded as soon as no process still holds it open. Symbolic
  5295. links are not counted in the total.
  5296. ‘uid_t st_uid’
  5297. The user ID of the file's owner. *Note File Owner::.
  5298. ‘gid_t st_gid’
  5299. The group ID of the file. *Note File Owner::.
  5300. ‘off64_t st_size’
  5301. This specifies the size of a regular file in bytes. For files
  5302. that are really devices this field isn't usually meaningful.
  5303. For symbolic links this specifies the length of the file name
  5304. the link refers to.
  5305. ‘time_t st_atime’
  5306. This is the last access time for the file. *Note File
  5307. Times::.
  5308. ‘unsigned long int st_atime_usec’
  5309. This is the fractional part of the last access time for the
  5310. file. *Note File Times::.
  5311. ‘time_t st_mtime’
  5312. This is the time of the last modification to the contents of
  5313. the file. *Note File Times::.
  5314. ‘unsigned long int st_mtime_usec’
  5315. This is the fractional part of the time of the last
  5316. modification to the contents of the file. *Note File Times::.
  5317. ‘time_t st_ctime’
  5318. This is the time of the last modification to the attributes of
  5319. the file. *Note File Times::.
  5320. ‘unsigned long int st_ctime_usec’
  5321. This is the fractional part of the time of the last
  5322. modification to the attributes of the file. *Note File
  5323. Times::.
  5324. ‘blkcnt64_t st_blocks’
  5325. This is the amount of disk space that the file occupies,
  5326. measured in units of 512-byte blocks.
  5327. ‘unsigned int st_blksize’
  5328. The optimal block size for reading of writing this file, in
  5329. bytes. You might use this size for allocating the buffer
  5330. space for reading of writing the file. (This is unrelated to
  5331. ‘st_blocks’.)
  5332. Some of the file attributes have special data type names which exist
  5333. specifically for those attributes. (They are all aliases for well-known
  5334. integer types that you know and love.) These typedef names are defined
  5335. in the header file ‘sys/types.h’ as well as in ‘sys/stat.h’. Here is a
  5336. list of them.
  5337. -- Data Type: mode_t
  5338. This is an integer data type used to represent file modes. In the
  5339. GNU C Library, this is an unsigned type no narrower than ‘unsigned
  5340. int’.
  5341. -- Data Type: ino_t
  5342. This is an unsigned integer type used to represent file serial
  5343. numbers. (In Unix jargon, these are sometimes called “inode
  5344. numbers”.) In the GNU C Library, this type is no narrower than
  5345. ‘unsigned int’.
  5346. If the source is compiled with ‘_FILE_OFFSET_BITS == 64’ this type
  5347. is transparently replaced by ‘ino64_t’.
  5348. -- Data Type: ino64_t
  5349. This is an unsigned integer type used to represent file serial
  5350. numbers for the use in LFS. In the GNU C Library, this type is no
  5351. narrower than ‘unsigned int’.
  5352. When compiling with ‘_FILE_OFFSET_BITS == 64’ this type is
  5353. available under the name ‘ino_t’.
  5354. -- Data Type: dev_t
  5355. This is an arithmetic data type used to represent file device
  5356. numbers. In the GNU C Library, this is an integer type no narrower
  5357. than ‘int’.
  5358. -- Data Type: nlink_t
  5359. This is an integer type used to represent file link counts.
  5360. -- Data Type: blkcnt_t
  5361. This is a signed integer type used to represent block counts. In
  5362. the GNU C Library, this type is no narrower than ‘int’.
  5363. If the source is compiled with ‘_FILE_OFFSET_BITS == 64’ this type
  5364. is transparently replaced by ‘blkcnt64_t’.
  5365. -- Data Type: blkcnt64_t
  5366. This is a signed integer type used to represent block counts for
  5367. the use in LFS. In the GNU C Library, this type is no narrower than
  5368. ‘int’.
  5369. When compiling with ‘_FILE_OFFSET_BITS == 64’ this type is
  5370. available under the name ‘blkcnt_t’.
  5371. 
  5372. File: libc.info, Node: Reading Attributes, Next: Testing File Type, Prev: Attribute Meanings, Up: File Attributes
  5373. 14.10.2 Reading the Attributes of a File
  5374. ----------------------------------------
  5375. To examine the attributes of files, use the functions ‘stat’, ‘fstat’
  5376. and ‘lstat’. They return the attribute information in a ‘struct stat’
  5377. object. All three functions are declared in the header file
  5378. ‘sys/stat.h’.
  5379. -- Function: int stat (const char *FILENAME, struct stat *BUF)
  5380. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5381. Concepts::.
  5382. The ‘stat’ function returns information about the attributes of the
  5383. file named by FILENAME in the structure pointed to by BUF.
  5384. If FILENAME is the name of a symbolic link, the attributes you get
  5385. describe the file that the link points to. If the link points to a
  5386. nonexistent file name, then ‘stat’ fails reporting a nonexistent
  5387. file.
  5388. The return value is ‘0’ if the operation is successful, or ‘-1’ on
  5389. failure. In addition to the usual file name errors (*note File
  5390. Name Errors::, the following ‘errno’ error conditions are defined
  5391. for this function:
  5392. ‘ENOENT’
  5393. The file named by FILENAME doesn't exist.
  5394. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  5395. function is in fact ‘stat64’ since the LFS interface transparently
  5396. replaces the normal implementation.
  5397. -- Function: int stat64 (const char *FILENAME, struct stat64 *BUF)
  5398. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5399. Concepts::.
  5400. This function is similar to ‘stat’ but it is also able to work on
  5401. files larger than 2^31 bytes on 32-bit systems. To be able to do
  5402. this the result is stored in a variable of type ‘struct stat64’ to
  5403. which BUF must point.
  5404. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  5405. function is available under the name ‘stat’ and so transparently
  5406. replaces the interface for small files on 32-bit machines.
  5407. -- Function: int fstat (int FILEDES, struct stat *BUF)
  5408. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5409. Concepts::.
  5410. The ‘fstat’ function is like ‘stat’, except that it takes an open
  5411. file descriptor as an argument instead of a file name. *Note
  5412. Low-Level I/O::.
  5413. Like ‘stat’, ‘fstat’ returns ‘0’ on success and ‘-1’ on failure.
  5414. The following ‘errno’ error conditions are defined for ‘fstat’:
  5415. ‘EBADF’
  5416. The FILEDES argument is not a valid file descriptor.
  5417. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  5418. function is in fact ‘fstat64’ since the LFS interface transparently
  5419. replaces the normal implementation.
  5420. -- Function: int fstat64 (int FILEDES, struct stat64 *BUF)
  5421. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5422. Concepts::.
  5423. This function is similar to ‘fstat’ but is able to work on large
  5424. files on 32-bit platforms. For large files the file descriptor
  5425. FILEDES should be obtained by ‘open64’ or ‘creat64’. The BUF
  5426. pointer points to a variable of type ‘struct stat64’ which is able
  5427. to represent the larger values.
  5428. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  5429. function is available under the name ‘fstat’ and so transparently
  5430. replaces the interface for small files on 32-bit machines.
  5431. -- Function: int fstatat (int FILEDES, const char *FILENAME, struct
  5432. stat *BUF, int FLAGS)
  5433. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5434. Concepts::.
  5435. This function is a descriptor-relative version of the ‘fstat’
  5436. function above. *Note Descriptor-Relative Access::. The FLAGS
  5437. argument can contain a combination of the flags ‘AT_EMPTY_PATH’,
  5438. ‘AT_NO_AUTOMOUNT’, ‘AT_SYMLINK_NOFOLLOW’.
  5439. Compared to ‘fstat’, the following additional error conditions can
  5440. occur:
  5441. ‘EBADF’
  5442. The FILEDES argument is not a valid file descriptor.
  5443. ‘EINVAL’
  5444. The FLAGS argument is not valid for this function.
  5445. ‘ENOTDIR’
  5446. The descriptor FILEDES is not associated with a directory, and
  5447. FILENAME is a relative file name.
  5448. ‘ENOENT’
  5449. The file named by FILENAME does not exist, it's a dangling
  5450. symbolic link and FLAGS does not contain
  5451. ‘AT_SYMLINK_NOFOLLOW’, or FILENAME is an empty string and
  5452. FLAGS does not contain ‘AT_EMPTY_PATH’.
  5453. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  5454. function is in fact ‘fstatat64’ since the LFS interface
  5455. transparently replaces the normal implementation.
  5456. -- Function: int fstatat64 (int FILEDES, const char *FILENAME, struct
  5457. stat64 *BUF, int FLAGS)
  5458. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5459. Concepts::.
  5460. This function is the large-file variant of ‘fstatat’, similar to
  5461. how ‘fstat64’ is the variant of ‘fstat’.
  5462. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  5463. function is available under the name ‘fstatat’ and so transparently
  5464. replaces the interface for small files on 32-bit machines.
  5465. -- Function: int lstat (const char *FILENAME, struct stat *BUF)
  5466. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5467. Concepts::.
  5468. The ‘lstat’ function is like ‘stat’, except that it does not follow
  5469. symbolic links. If FILENAME is the name of a symbolic link,
  5470. ‘lstat’ returns information about the link itself; otherwise
  5471. ‘lstat’ works like ‘stat’. *Note Symbolic Links::.
  5472. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  5473. function is in fact ‘lstat64’ since the LFS interface transparently
  5474. replaces the normal implementation.
  5475. -- Function: int lstat64 (const char *FILENAME, struct stat64 *BUF)
  5476. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5477. Concepts::.
  5478. This function is similar to ‘lstat’ but it is also able to work on
  5479. files larger than 2^31 bytes on 32-bit systems. To be able to do
  5480. this the result is stored in a variable of type ‘struct stat64’ to
  5481. which BUF must point.
  5482. When the sources are compiled with ‘_FILE_OFFSET_BITS == 64’ this
  5483. function is available under the name ‘lstat’ and so transparently
  5484. replaces the interface for small files on 32-bit machines.
  5485. 
  5486. File: libc.info, Node: Testing File Type, Next: File Owner, Prev: Reading Attributes, Up: File Attributes
  5487. 14.10.3 Testing the Type of a File
  5488. ----------------------------------
  5489. The “file mode”, stored in the ‘st_mode’ field of the file attributes,
  5490. contains two kinds of information: the file type code, and the access
  5491. permission bits. This section discusses only the type code, which you
  5492. can use to tell whether the file is a directory, socket, symbolic link,
  5493. and so on. For details about access permissions see *note Permission
  5494. Bits::.
  5495. There are two ways you can access the file type information in a file
  5496. mode. Firstly, for each file type there is a “predicate macro” which
  5497. examines a given file mode and returns whether it is of that type or
  5498. not. Secondly, you can mask out the rest of the file mode to leave just
  5499. the file type code, and compare this against constants for each of the
  5500. supported file types.
  5501. All of the symbols listed in this section are defined in the header
  5502. file ‘sys/stat.h’.
  5503. The following predicate macros test the type of a file, given the
  5504. value M which is the ‘st_mode’ field returned by ‘stat’ on that file:
  5505. -- Macro: int S_ISDIR (mode_t M)
  5506. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5507. Concepts::.
  5508. This macro returns non-zero if the file is a directory.
  5509. -- Macro: int S_ISCHR (mode_t M)
  5510. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5511. Concepts::.
  5512. This macro returns non-zero if the file is a character special file
  5513. (a device like a terminal).
  5514. -- Macro: int S_ISBLK (mode_t M)
  5515. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5516. Concepts::.
  5517. This macro returns non-zero if the file is a block special file (a
  5518. device like a disk).
  5519. -- Macro: int S_ISREG (mode_t M)
  5520. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5521. Concepts::.
  5522. This macro returns non-zero if the file is a regular file.
  5523. -- Macro: int S_ISFIFO (mode_t M)
  5524. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5525. Concepts::.
  5526. This macro returns non-zero if the file is a FIFO special file, or
  5527. a pipe. *Note Pipes and FIFOs::.
  5528. -- Macro: int S_ISLNK (mode_t M)
  5529. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5530. Concepts::.
  5531. This macro returns non-zero if the file is a symbolic link. *Note
  5532. Symbolic Links::.
  5533. -- Macro: int S_ISSOCK (mode_t M)
  5534. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5535. Concepts::.
  5536. This macro returns non-zero if the file is a socket. *Note
  5537. Sockets::.
  5538. An alternate non-POSIX method of testing the file type is supported
  5539. for compatibility with BSD. The mode can be bitwise AND-ed with ‘S_IFMT’
  5540. to extract the file type code, and compared to the appropriate constant.
  5541. For example,
  5542. S_ISCHR (MODE)
  5543. is equivalent to:
  5544. ((MODE & S_IFMT) == S_IFCHR)
  5545. -- Macro: int S_IFMT
  5546. This is a bit mask used to extract the file type code from a mode
  5547. value.
  5548. These are the symbolic names for the different file type codes:
  5549. ‘S_IFDIR’
  5550. This is the file type constant of a directory file.
  5551. ‘S_IFCHR’
  5552. This is the file type constant of a character-oriented device file.
  5553. ‘S_IFBLK’
  5554. This is the file type constant of a block-oriented device file.
  5555. ‘S_IFREG’
  5556. This is the file type constant of a regular file.
  5557. ‘S_IFLNK’
  5558. This is the file type constant of a symbolic link.
  5559. ‘S_IFSOCK’
  5560. This is the file type constant of a socket.
  5561. ‘S_IFIFO’
  5562. This is the file type constant of a FIFO or pipe.
  5563. The POSIX.1b standard introduced a few more objects which possibly
  5564. can be implemented as objects in the filesystem. These are message
  5565. queues, semaphores, and shared memory objects. To allow differentiating
  5566. these objects from other files the POSIX standard introduced three new
  5567. test macros. But unlike the other macros they do not take the value of
  5568. the ‘st_mode’ field as the parameter. Instead they expect a pointer to
  5569. the whole ‘struct stat’ structure.
  5570. -- Macro: int S_TYPEISMQ (struct stat *S)
  5571. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5572. Concepts::.
  5573. If the system implements POSIX message queues as distinct objects
  5574. and the file is a message queue object, this macro returns a
  5575. non-zero value. In all other cases the result is zero.
  5576. -- Macro: int S_TYPEISSEM (struct stat *S)
  5577. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5578. Concepts::.
  5579. If the system implements POSIX semaphores as distinct objects and
  5580. the file is a semaphore object, this macro returns a non-zero
  5581. value. In all other cases the result is zero.
  5582. -- Macro: int S_TYPEISSHM (struct stat *S)
  5583. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5584. Concepts::.
  5585. If the system implements POSIX shared memory objects as distinct
  5586. objects and the file is a shared memory object, this macro returns
  5587. a non-zero value. In all other cases the result is zero.
  5588. 
  5589. File: libc.info, Node: File Owner, Next: Permission Bits, Prev: Testing File Type, Up: File Attributes
  5590. 14.10.4 File Owner
  5591. ------------------
  5592. Every file has an “owner” which is one of the registered user names
  5593. defined on the system. Each file also has a “group” which is one of the
  5594. defined groups. The file owner can often be useful for showing you who
  5595. edited the file (especially when you edit with GNU Emacs), but its main
  5596. purpose is for access control.
  5597. The file owner and group play a role in determining access because
  5598. the file has one set of access permission bits for the owner, another
  5599. set that applies to users who belong to the file's group, and a third
  5600. set of bits that applies to everyone else. *Note Access Permission::,
  5601. for the details of how access is decided based on this data.
  5602. When a file is created, its owner is set to the effective user ID of
  5603. the process that creates it (*note Process Persona::). The file's group
  5604. ID may be set to either the effective group ID of the process, or the
  5605. group ID of the directory that contains the file, depending on the
  5606. system where the file is stored. When you access a remote file system,
  5607. it behaves according to its own rules, not according to the system your
  5608. program is running on. Thus, your program must be prepared to encounter
  5609. either kind of behavior no matter what kind of system you run it on.
  5610. You can change the owner and/or group owner of an existing file using
  5611. the ‘chown’ function. This is the primitive for the ‘chown’ and ‘chgrp’
  5612. shell commands.
  5613. The prototype for this function is declared in ‘unistd.h’.
  5614. -- Function: int chown (const char *FILENAME, uid_t OWNER, gid_t GROUP)
  5615. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5616. Concepts::.
  5617. The ‘chown’ function changes the owner of the file FILENAME to
  5618. OWNER, and its group owner to GROUP.
  5619. Changing the owner of the file on certain systems clears the
  5620. set-user-ID and set-group-ID permission bits. (This is because
  5621. those bits may not be appropriate for the new owner.) Other file
  5622. permission bits are not changed.
  5623. The return value is ‘0’ on success and ‘-1’ on failure. In
  5624. addition to the usual file name errors (*note File Name Errors::),
  5625. the following ‘errno’ error conditions are defined for this
  5626. function:
  5627. ‘EPERM’
  5628. This process lacks permission to make the requested change.
  5629. Only privileged users or the file's owner can change the
  5630. file's group. On most file systems, only privileged users can
  5631. change the file owner; some file systems allow you to change
  5632. the owner if you are currently the owner. When you access a
  5633. remote file system, the behavior you encounter is determined
  5634. by the system that actually holds the file, not by the system
  5635. your program is running on.
  5636. *Note Options for Files::, for information about the
  5637. ‘_POSIX_CHOWN_RESTRICTED’ macro.
  5638. ‘EROFS’
  5639. The file is on a read-only file system.
  5640. -- Function: int fchown (int FILEDES, uid_t OWNER, gid_t GROUP)
  5641. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5642. Concepts::.
  5643. This is like ‘chown’, except that it changes the owner of the open
  5644. file with descriptor FILEDES.
  5645. The return value from ‘fchown’ is ‘0’ on success and ‘-1’ on
  5646. failure. The following ‘errno’ error codes are defined for this
  5647. function:
  5648. ‘EBADF’
  5649. The FILEDES argument is not a valid file descriptor.
  5650. ‘EINVAL’
  5651. The FILEDES argument corresponds to a pipe or socket, not an
  5652. ordinary file.
  5653. ‘EPERM’
  5654. This process lacks permission to make the requested change.
  5655. For details see ‘chmod’ above.
  5656. ‘EROFS’
  5657. The file resides on a read-only file system.
  5658. 
  5659. File: libc.info, Node: Permission Bits, Next: Access Permission, Prev: File Owner, Up: File Attributes
  5660. 14.10.5 The Mode Bits for Access Permission
  5661. -------------------------------------------
  5662. The “file mode”, stored in the ‘st_mode’ field of the file attributes,
  5663. contains two kinds of information: the file type code, and the access
  5664. permission bits. This section discusses only the access permission
  5665. bits, which control who can read or write the file. *Note Testing File
  5666. Type::, for information about the file type code.
  5667. All of the symbols listed in this section are defined in the header
  5668. file ‘sys/stat.h’.
  5669. These symbolic constants are defined for the file mode bits that
  5670. control access permission for the file:
  5671. ‘S_IRUSR’
  5672. ‘S_IREAD’
  5673. Read permission bit for the owner of the file. On many systems
  5674. this bit is 0400. ‘S_IREAD’ is an obsolete synonym provided for
  5675. BSD compatibility.
  5676. ‘S_IWUSR’
  5677. ‘S_IWRITE’
  5678. Write permission bit for the owner of the file. Usually 0200.
  5679. ‘S_IWRITE’ is an obsolete synonym provided for BSD compatibility.
  5680. ‘S_IXUSR’
  5681. ‘S_IEXEC’
  5682. Execute (for ordinary files) or search (for directories) permission
  5683. bit for the owner of the file. Usually 0100. ‘S_IEXEC’ is an
  5684. obsolete synonym provided for BSD compatibility.
  5685. ‘S_IRWXU’
  5686. This is equivalent to ‘(S_IRUSR | S_IWUSR | S_IXUSR)’.
  5687. ‘S_IRGRP’
  5688. Read permission bit for the group owner of the file. Usually 040.
  5689. ‘S_IWGRP’
  5690. Write permission bit for the group owner of the file. Usually 020.
  5691. ‘S_IXGRP’
  5692. Execute or search permission bit for the group owner of the file.
  5693. Usually 010.
  5694. ‘S_IRWXG’
  5695. This is equivalent to ‘(S_IRGRP | S_IWGRP | S_IXGRP)’.
  5696. ‘S_IROTH’
  5697. Read permission bit for other users. Usually 04.
  5698. ‘S_IWOTH’
  5699. Write permission bit for other users. Usually 02.
  5700. ‘S_IXOTH’
  5701. Execute or search permission bit for other users. Usually 01.
  5702. ‘S_IRWXO’
  5703. This is equivalent to ‘(S_IROTH | S_IWOTH | S_IXOTH)’.
  5704. ‘S_ISUID’
  5705. This is the set-user-ID on execute bit, usually 04000. *Note How
  5706. Change Persona::.
  5707. ‘S_ISGID’
  5708. This is the set-group-ID on execute bit, usually 02000. *Note How
  5709. Change Persona::.
  5710. ‘S_ISVTX’
  5711. This is the “sticky” bit, usually 01000.
  5712. For a directory it gives permission to delete a file in that
  5713. directory only if you own that file. Ordinarily, a user can either
  5714. delete all the files in a directory or cannot delete any of them
  5715. (based on whether the user has write permission for the directory).
  5716. The same restriction applies--you must have both write permission
  5717. for the directory and own the file you want to delete. The one
  5718. exception is that the owner of the directory can delete any file in
  5719. the directory, no matter who owns it (provided the owner has given
  5720. himself write permission for the directory). This is commonly used
  5721. for the ‘/tmp’ directory, where anyone may create files but not
  5722. delete files created by other users.
  5723. Originally the sticky bit on an executable file modified the
  5724. swapping policies of the system. Normally, when a program
  5725. terminated, its pages in core were immediately freed and reused.
  5726. If the sticky bit was set on the executable file, the system kept
  5727. the pages in core for a while as if the program were still running.
  5728. This was advantageous for a program likely to be run many times in
  5729. succession. This usage is obsolete in modern systems. When a
  5730. program terminates, its pages always remain in core as long as
  5731. there is no shortage of memory in the system. When the program is
  5732. next run, its pages will still be in core if no shortage arose
  5733. since the last run.
  5734. On some modern systems where the sticky bit has no useful meaning
  5735. for an executable file, you cannot set the bit at all for a
  5736. non-directory. If you try, ‘chmod’ fails with ‘EFTYPE’; *note
  5737. Setting Permissions::.
  5738. Some systems (particularly SunOS) have yet another use for the
  5739. sticky bit. If the sticky bit is set on a file that is _not_
  5740. executable, it means the opposite: never cache the pages of this
  5741. file at all. The main use of this is for the files on an NFS
  5742. server machine which are used as the swap area of diskless client
  5743. machines. The idea is that the pages of the file will be cached in
  5744. the client's memory, so it is a waste of the server's memory to
  5745. cache them a second time. With this usage the sticky bit also
  5746. implies that the filesystem may fail to record the file's
  5747. modification time onto disk reliably (the idea being that no-one
  5748. cares for a swap file).
  5749. This bit is only available on BSD systems (and those derived from
  5750. them). Therefore one has to use the ‘_GNU_SOURCE’ feature select
  5751. macro, or not define any feature test macros, to get the definition
  5752. (*note Feature Test Macros::).
  5753. The actual bit values of the symbols are listed in the table above so
  5754. you can decode file mode values when debugging your programs. These bit
  5755. values are correct for most systems, but they are not guaranteed.
  5756. *Warning:* Writing explicit numbers for file permissions is bad
  5757. practice. Not only is it not portable, it also requires everyone who
  5758. reads your program to remember what the bits mean. To make your program
  5759. clean use the symbolic names.
  5760. 
  5761. File: libc.info, Node: Access Permission, Next: Setting Permissions, Prev: Permission Bits, Up: File Attributes
  5762. 14.10.6 How Your Access to a File is Decided
  5763. --------------------------------------------
  5764. Recall that the operating system normally decides access permission for
  5765. a file based on the effective user and group IDs of the process and its
  5766. supplementary group IDs, together with the file's owner, group and
  5767. permission bits. These concepts are discussed in detail in *note
  5768. Process Persona::.
  5769. If the effective user ID of the process matches the owner user ID of
  5770. the file, then permissions for read, write, and execute/search are
  5771. controlled by the corresponding "user" (or "owner") bits. Likewise, if
  5772. any of the effective group ID or supplementary group IDs of the process
  5773. matches the group owner ID of the file, then permissions are controlled
  5774. by the "group" bits. Otherwise, permissions are controlled by the
  5775. "other" bits.
  5776. Privileged users, like ‘root’, can access any file regardless of its
  5777. permission bits. As a special case, for a file to be executable even by
  5778. a privileged user, at least one of its execute bits must be set.
  5779. 
  5780. File: libc.info, Node: Setting Permissions, Next: Testing File Access, Prev: Access Permission, Up: File Attributes
  5781. 14.10.7 Assigning File Permissions
  5782. ----------------------------------
  5783. The primitive functions for creating files (for example, ‘open’ or
  5784. ‘mkdir’) take a MODE argument, which specifies the file permissions to
  5785. give the newly created file. This mode is modified by the process's
  5786. “file creation mask”, or “umask”, before it is used.
  5787. The bits that are set in the file creation mask identify permissions
  5788. that are always to be disabled for newly created files. For example, if
  5789. you set all the "other" access bits in the mask, then newly created
  5790. files are not accessible at all to processes in the "other" category,
  5791. even if the MODE argument passed to the create function would permit
  5792. such access. In other words, the file creation mask is the complement
  5793. of the ordinary access permissions you want to grant.
  5794. Programs that create files typically specify a MODE argument that
  5795. includes all the permissions that make sense for the particular file.
  5796. For an ordinary file, this is typically read and write permission for
  5797. all classes of users. These permissions are then restricted as
  5798. specified by the individual user's own file creation mask.
  5799. To change the permission of an existing file given its name, call
  5800. ‘chmod’. This function uses the specified permission bits and ignores
  5801. the file creation mask.
  5802. In normal use, the file creation mask is initialized by the user's
  5803. login shell (using the ‘umask’ shell command), and inherited by all
  5804. subprocesses. Application programs normally don't need to worry about
  5805. the file creation mask. It will automatically do what it is supposed to
  5806. do.
  5807. When your program needs to create a file and bypass the umask for its
  5808. access permissions, the easiest way to do this is to use ‘fchmod’ after
  5809. opening the file, rather than changing the umask. In fact, changing the
  5810. umask is usually done only by shells. They use the ‘umask’ function.
  5811. The functions in this section are declared in ‘sys/stat.h’.
  5812. -- Function: mode_t umask (mode_t MASK)
  5813. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5814. Concepts::.
  5815. The ‘umask’ function sets the file creation mask of the current
  5816. process to MASK, and returns the previous value of the file
  5817. creation mask.
  5818. Here is an example showing how to read the mask with ‘umask’
  5819. without changing it permanently:
  5820. mode_t
  5821. read_umask (void)
  5822. {
  5823. mode_t mask = umask (0);
  5824. umask (mask);
  5825. return mask;
  5826. }
  5827. However, on GNU/Hurd systems it is better to use ‘getumask’ if you
  5828. just want to read the mask value, because it is reentrant.
  5829. -- Function: mode_t getumask (void)
  5830. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5831. Concepts::.
  5832. Return the current value of the file creation mask for the current
  5833. process. This function is a GNU extension and is only available on
  5834. GNU/Hurd systems.
  5835. -- Function: int chmod (const char *FILENAME, mode_t MODE)
  5836. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5837. Concepts::.
  5838. The ‘chmod’ function sets the access permission bits for the file
  5839. named by FILENAME to MODE.
  5840. If FILENAME is a symbolic link, ‘chmod’ changes the permissions of
  5841. the file pointed to by the link, not those of the link itself.
  5842. This function returns ‘0’ if successful and ‘-1’ if not. In
  5843. addition to the usual file name errors (*note File Name Errors::),
  5844. the following ‘errno’ error conditions are defined for this
  5845. function:
  5846. ‘ENOENT’
  5847. The named file doesn't exist.
  5848. ‘EPERM’
  5849. This process does not have permission to change the access
  5850. permissions of this file. Only the file's owner (as judged by
  5851. the effective user ID of the process) or a privileged user can
  5852. change them.
  5853. ‘EROFS’
  5854. The file resides on a read-only file system.
  5855. ‘EFTYPE’
  5856. MODE has the ‘S_ISVTX’ bit (the "sticky bit") set, and the
  5857. named file is not a directory. Some systems do not allow
  5858. setting the sticky bit on non-directory files, and some do
  5859. (and only some of those assign a useful meaning to the bit for
  5860. non-directory files).
  5861. You only get ‘EFTYPE’ on systems where the sticky bit has no
  5862. useful meaning for non-directory files, so it is always safe
  5863. to just clear the bit in MODE and call ‘chmod’ again. *Note
  5864. Permission Bits::, for full details on the sticky bit.
  5865. -- Function: int fchmod (int FILEDES, mode_t MODE)
  5866. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5867. Concepts::.
  5868. This is like ‘chmod’, except that it changes the permissions of the
  5869. currently open file given by FILEDES.
  5870. The return value from ‘fchmod’ is ‘0’ on success and ‘-1’ on
  5871. failure. The following ‘errno’ error codes are defined for this
  5872. function:
  5873. ‘EBADF’
  5874. The FILEDES argument is not a valid file descriptor.
  5875. ‘EINVAL’
  5876. The FILEDES argument corresponds to a pipe or socket, or
  5877. something else that doesn't really have access permissions.
  5878. ‘EPERM’
  5879. This process does not have permission to change the access
  5880. permissions of this file. Only the file's owner (as judged by
  5881. the effective user ID of the process) or a privileged user can
  5882. change them.
  5883. ‘EROFS’
  5884. The file resides on a read-only file system.
  5885. 
  5886. File: libc.info, Node: Testing File Access, Next: File Times, Prev: Setting Permissions, Up: File Attributes
  5887. 14.10.8 Testing Permission to Access a File
  5888. -------------------------------------------
  5889. In some situations it is desirable to allow programs to access files or
  5890. devices even if this is not possible with the permissions granted to the
  5891. user. One possible solution is to set the setuid-bit of the program
  5892. file. If such a program is started the _effective_ user ID of the
  5893. process is changed to that of the owner of the program file. So to
  5894. allow write access to files like ‘/etc/passwd’, which normally can be
  5895. written only by the super-user, the modifying program will have to be
  5896. owned by ‘root’ and the setuid-bit must be set.
  5897. But besides the files the program is intended to change the user
  5898. should not be allowed to access any file to which s/he would not have
  5899. access anyway. The program therefore must explicitly check whether _the
  5900. user_ would have the necessary access to a file, before it reads or
  5901. writes the file.
  5902. To do this, use the function ‘access’, which checks for access
  5903. permission based on the process's _real_ user ID rather than the
  5904. effective user ID. (The setuid feature does not alter the real user ID,
  5905. so it reflects the user who actually ran the program.)
  5906. There is another way you could check this access, which is easy to
  5907. describe, but very hard to use. This is to examine the file mode bits
  5908. and mimic the system's own access computation. This method is
  5909. undesirable because many systems have additional access control
  5910. features; your program cannot portably mimic them, and you would not
  5911. want to try to keep track of the diverse features that different systems
  5912. have. Using ‘access’ is simple and automatically does whatever is
  5913. appropriate for the system you are using.
  5914. ‘access’ is _only_ appropriate to use in setuid programs. A
  5915. non-setuid program will always use the effective ID rather than the real
  5916. ID.
  5917. The symbols in this section are declared in ‘unistd.h’.
  5918. -- Function: int access (const char *FILENAME, int HOW)
  5919. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5920. Concepts::.
  5921. The ‘access’ function checks to see whether the file named by
  5922. FILENAME can be accessed in the way specified by the HOW argument.
  5923. The HOW argument either can be the bitwise OR of the flags ‘R_OK’,
  5924. ‘W_OK’, ‘X_OK’, or the existence test ‘F_OK’.
  5925. This function uses the _real_ user and group IDs of the calling
  5926. process, rather than the _effective_ IDs, to check for access
  5927. permission. As a result, if you use the function from a ‘setuid’
  5928. or ‘setgid’ program (*note How Change Persona::), it gives
  5929. information relative to the user who actually ran the program.
  5930. The return value is ‘0’ if the access is permitted, and ‘-1’
  5931. otherwise. (In other words, treated as a predicate function,
  5932. ‘access’ returns true if the requested access is _denied_.)
  5933. In addition to the usual file name errors (*note File Name
  5934. Errors::), the following ‘errno’ error conditions are defined for
  5935. this function:
  5936. ‘EACCES’
  5937. The access specified by HOW is denied.
  5938. ‘ENOENT’
  5939. The file doesn't exist.
  5940. ‘EROFS’
  5941. Write permission was requested for a file on a read-only file
  5942. system.
  5943. These macros are defined in the header file ‘unistd.h’ for use as the
  5944. HOW argument to the ‘access’ function. The values are integer
  5945. constants.
  5946. -- Macro: int R_OK
  5947. Flag meaning test for read permission.
  5948. -- Macro: int W_OK
  5949. Flag meaning test for write permission.
  5950. -- Macro: int X_OK
  5951. Flag meaning test for execute/search permission.
  5952. -- Macro: int F_OK
  5953. Flag meaning test for existence of the file.
  5954. -- Function: int faccessat (int FILEDES, const char *FILENAME, int HOW,
  5955. int FLAGS)
  5956. | MT-Safe | AS-Unsafe corrupt | AC-Unsafe corrupt | *Note POSIX
  5957. Safety Concepts::.
  5958. This function is a descriptor-relative version of the ‘access’
  5959. function above. *Note Descriptor-Relative Access::. The FLAGS
  5960. argument can contain a combination of the flags ‘AT_EACCESS’
  5961. described below, ‘AT_EMPTY_PATH’, and ‘AT_SYMLINK_NOFOLLOW’.
  5962. ‘AT_EACCESS’
  5963. This flag when passed to the ‘faccessat’ function causes it to
  5964. perform access checks using effective user and group IDs
  5965. instead of real IDs, which is the default and matches the
  5966. ‘access’ function.
  5967. Compared to ‘access’, some additional error conditions can occur.
  5968. *Note Descriptor-Relative Access::.
  5969. This function may not work correctly on older kernels missing the
  5970. ‘faccessat2’ system call.
  5971. 
  5972. File: libc.info, Node: File Times, Next: File Size, Prev: Testing File Access, Up: File Attributes
  5973. 14.10.9 File Times
  5974. ------------------
  5975. Each file has three time stamps associated with it: its access time, its
  5976. modification time, and its attribute modification time. These
  5977. correspond to the ‘st_atime’, ‘st_mtime’, and ‘st_ctime’ members of the
  5978. ‘stat’ structure; see *note File Attributes::.
  5979. All of these times are represented in calendar time format, as
  5980. ‘time_t’ objects. This data type is defined in ‘time.h’. For more
  5981. information about representation and manipulation of time values, see
  5982. *note Calendar Time::.
  5983. Reading from a file updates its access time attribute, and writing
  5984. updates its modification time. When a file is created, all three time
  5985. stamps for that file are set to the current time. In addition, the
  5986. attribute change time and modification time fields of the directory that
  5987. contains the new entry are updated.
  5988. Adding a new name for a file with the ‘link’ function updates the
  5989. attribute change time field of the file being linked, and both the
  5990. attribute change time and modification time fields of the directory
  5991. containing the new name. These same fields are affected if a file name
  5992. is deleted with ‘unlink’, ‘remove’ or ‘rmdir’. Renaming a file with
  5993. ‘rename’ affects only the attribute change time and modification time
  5994. fields of the two parent directories involved, and not the times for the
  5995. file being renamed.
  5996. Changing the attributes of a file (for example, with ‘chmod’) updates
  5997. its attribute change time field.
  5998. You can also change some of the time stamps of a file explicitly
  5999. using the ‘utime’ function--all except the attribute change time. You
  6000. need to include the header file ‘utime.h’ to use this facility.
  6001. -- Data Type: struct utimbuf
  6002. The ‘utimbuf’ structure is used with the ‘utime’ function to
  6003. specify new access and modification times for a file. It contains
  6004. the following members:
  6005. ‘time_t actime’
  6006. This is the access time for the file.
  6007. ‘time_t modtime’
  6008. This is the modification time for the file.
  6009. -- Function: int utime (const char *FILENAME, const struct utimbuf
  6010. *TIMES)
  6011. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  6012. Concepts::.
  6013. This function is used to modify the file times associated with the
  6014. file named FILENAME.
  6015. If TIMES is a null pointer, then the access and modification times
  6016. of the file are set to the current time. Otherwise, they are set
  6017. to the values from the ‘actime’ and ‘modtime’ members
  6018. (respectively) of the ‘utimbuf’ structure pointed to by TIMES.
  6019. The attribute modification time for the file is set to the current
  6020. time in either case (since changing the time stamps is itself a
  6021. modification of the file attributes).
  6022. The ‘utime’ function returns ‘0’ if successful and ‘-1’ on failure.
  6023. In addition to the usual file name errors (*note File Name
  6024. Errors::), the following ‘errno’ error conditions are defined for
  6025. this function:
  6026. ‘EACCES’
  6027. There is a permission problem in the case where a null pointer
  6028. was passed as the TIMES argument. In order to update the time
  6029. stamp on the file, you must either be the owner of the file,
  6030. have write permission for the file, or be a privileged user.
  6031. ‘ENOENT’
  6032. The file doesn't exist.
  6033. ‘EPERM’
  6034. If the TIMES argument is not a null pointer, you must either
  6035. be the owner of the file or be a privileged user.
  6036. ‘EROFS’
  6037. The file lives on a read-only file system.
  6038. Each of the three time stamps has a corresponding microsecond part,
  6039. which extends its resolution. These fields are called ‘st_atime_usec’,
  6040. ‘st_mtime_usec’, and ‘st_ctime_usec’; each has a value between 0 and
  6041. 999,999, which indicates the time in microseconds. They correspond to
  6042. the ‘tv_usec’ field of a ‘timeval’ structure; see *note Time Types::.
  6043. The ‘utimes’ function is like ‘utime’, but also lets you specify the
  6044. fractional part of the file times. The prototype for this function is
  6045. in the header file ‘sys/time.h’.
  6046. -- Function: int utimes (const char *FILENAME, const struct timeval
  6047. TVP[2])
  6048. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  6049. Concepts::.
  6050. This function sets the file access and modification times of the
  6051. file FILENAME. The new file access time is specified by ‘TVP[0]’,
  6052. and the new modification time by ‘TVP[1]’. Similar to ‘utime’, if
  6053. TVP is a null pointer then the access and modification times of the
  6054. file are set to the current time. This function comes from BSD.
  6055. The return values and error conditions are the same as for the
  6056. ‘utime’ function.
  6057. -- Function: int lutimes (const char *FILENAME, const struct timeval
  6058. TVP[2])
  6059. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  6060. Concepts::.
  6061. This function is like ‘utimes’, except that it does not follow
  6062. symbolic links. If FILENAME is the name of a symbolic link,
  6063. ‘lutimes’ sets the file access and modification times of the
  6064. symbolic link special file itself (as seen by ‘lstat’; *note
  6065. Symbolic Links::) while ‘utimes’ sets the file access and
  6066. modification times of the file the symbolic link refers to. This
  6067. function comes from FreeBSD, and is not available on all platforms
  6068. (if not available, it will fail with ‘ENOSYS’).
  6069. The return values and error conditions are the same as for the
  6070. ‘utime’ function.
  6071. -- Function: int futimes (int FD, const struct timeval TVP[2])
  6072. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  6073. Concepts::.
  6074. This function is like ‘utimes’, except that it takes an open file
  6075. descriptor as an argument instead of a file name. *Note Low-Level
  6076. I/O::. This function comes from FreeBSD, and is not available on
  6077. all platforms (if not available, it will fail with ‘ENOSYS’).
  6078. Like ‘utimes’, ‘futimes’ returns ‘0’ on success and ‘-1’ on
  6079. failure. The following ‘errno’ error conditions are defined for
  6080. ‘futimes’:
  6081. ‘EACCES’
  6082. There is a permission problem in the case where a null pointer
  6083. was passed as the TIMES argument. In order to update the time
  6084. stamp on the file, you must either be the owner of the file,
  6085. have write permission for the file, or be a privileged user.
  6086. ‘EBADF’
  6087. The FILEDES argument is not a valid file descriptor.
  6088. ‘EINVAL’
  6089. At least one of the fields in the ‘tvp’ array passed has an
  6090. invalid value.
  6091. ‘EPERM’
  6092. If the TIMES argument is not a null pointer, you must either
  6093. be the owner of the file or be a privileged user.
  6094. ‘EROFS’
  6095. The file lives on a read-only file system.
  6096. -- Function: int futimens (int FILEDES, const struct timespec TSP[2])
  6097. | MT-Safe | AS-Unsafe corrupt | AC-Unsafe corrupt | *Note POSIX
  6098. Safety Concepts::.
  6099. This function is like ‘futimes’, except that it sets the file
  6100. access and modification timestamps with nanosecond precision. The
  6101. argument ‘tsp’ is used similarly to ‘futimes’' ‘tvp’, but has a
  6102. ‘const struct timespec’ type that can express calendar time with
  6103. nanosecond precision. *Note Time Types::.
  6104. -- Function: int utimensat (int FILEDES, const char *FILENAME, const
  6105. struct timespec TSP[2], int FLAGS)
  6106. | MT-Safe | AS-Unsafe corrupt | AC-Unsafe corrupt | *Note POSIX
  6107. Safety Concepts::.
  6108. This function is a descriptor-relative version of the ‘futimens’
  6109. function above. *Note Descriptor-Relative Access::. The FLAGS
  6110. argument can contain a combination of the flags ‘AT_EMPTY_PATH’,
  6111. and ‘AT_SYMLINK_NOFOLLOW’. The call:
  6112. futimens (FILEDES, TSP)
  6113. is equivalent to:
  6114. utimensat (FILEDES, NULL, TSP, 0)
  6115. Compared to ‘futimens’, some additional error conditions can occur
  6116. due to descriptor-relative access. *Note Descriptor-Relative
  6117. Access::. In addition to this, the following other errors can also
  6118. occur:
  6119. ‘EINVAL’
  6120. The FILENAME argument is NULL, FILEDES is not ‘AT_FDCWD’, and
  6121. FLAGS is not ‘0’.
  6122. ‘ELOOP’
  6123. There are too many levels of indirection. This can be the
  6124. result of circular symbolic links to directories.
  6125. ‘ENAMETOOLONG’
  6126. The resulting path is too long. This error only occurs on
  6127. systems which have a limit on the file name length.
  6128. ‘ENOENT’
  6129. The FILENAME argument is an empty string and FLAGS does not
  6130. contain ‘AT_EMPTY_PATH’, or FILENAME does not refer to an
  6131. existing file.
  6132. ‘ESRCH’
  6133. Search permission was denied for one of the prefix components
  6134. of the the FILENAME argument.