libc.info-9 264 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647
  1. This is libc.info, produced by makeinfo version 6.5 from libc.texinfo.
  2. This is ‘The GNU C Library Reference Manual’, for version 2.33 (GNU).
  3. Copyright © 1993–2021 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. * BC_BASE_MAX: (libc)Utility Limits.
  25. * BC_DIM_MAX: (libc)Utility Limits.
  26. * BC_SCALE_MAX: (libc)Utility Limits.
  27. * BC_STRING_MAX: (libc)Utility Limits.
  28. * BRKINT: (libc)Input Modes.
  29. * BUFSIZ: (libc)Controlling Buffering.
  30. * CCTS_OFLOW: (libc)Control Modes.
  31. * CHAR_BIT: (libc)Width of Type.
  32. * CHILD_MAX: (libc)General Limits.
  33. * CIGNORE: (libc)Control Modes.
  34. * CLK_TCK: (libc)Processor Time.
  35. * CLOCAL: (libc)Control Modes.
  36. * CLOCKS_PER_SEC: (libc)CPU Time.
  37. * CLOCK_MONOTONIC: (libc)Getting the Time.
  38. * CLOCK_REALTIME: (libc)Getting the Time.
  39. * COLL_WEIGHTS_MAX: (libc)Utility Limits.
  40. * CPU_CLR: (libc)CPU Affinity.
  41. * CPU_FEATURE_USABLE: (libc)X86.
  42. * CPU_ISSET: (libc)CPU Affinity.
  43. * CPU_SET: (libc)CPU Affinity.
  44. * CPU_SETSIZE: (libc)CPU Affinity.
  45. * CPU_ZERO: (libc)CPU Affinity.
  46. * CREAD: (libc)Control Modes.
  47. * CRTS_IFLOW: (libc)Control Modes.
  48. * CS5: (libc)Control Modes.
  49. * CS6: (libc)Control Modes.
  50. * CS7: (libc)Control Modes.
  51. * CS8: (libc)Control Modes.
  52. * CSIZE: (libc)Control Modes.
  53. * CSTOPB: (libc)Control Modes.
  54. * DTTOIF: (libc)Directory Entries.
  55. * E2BIG: (libc)Error Codes.
  56. * EACCES: (libc)Error Codes.
  57. * EADDRINUSE: (libc)Error Codes.
  58. * EADDRNOTAVAIL: (libc)Error Codes.
  59. * EADV: (libc)Error Codes.
  60. * EAFNOSUPPORT: (libc)Error Codes.
  61. * EAGAIN: (libc)Error Codes.
  62. * EALREADY: (libc)Error Codes.
  63. * EAUTH: (libc)Error Codes.
  64. * EBACKGROUND: (libc)Error Codes.
  65. * EBADE: (libc)Error Codes.
  66. * EBADF: (libc)Error Codes.
  67. * EBADFD: (libc)Error Codes.
  68. * EBADMSG: (libc)Error Codes.
  69. * EBADR: (libc)Error Codes.
  70. * EBADRPC: (libc)Error Codes.
  71. * EBADRQC: (libc)Error Codes.
  72. * EBADSLT: (libc)Error Codes.
  73. * EBFONT: (libc)Error Codes.
  74. * EBUSY: (libc)Error Codes.
  75. * ECANCELED: (libc)Error Codes.
  76. * ECHILD: (libc)Error Codes.
  77. * ECHO: (libc)Local Modes.
  78. * ECHOCTL: (libc)Local Modes.
  79. * ECHOE: (libc)Local Modes.
  80. * ECHOK: (libc)Local Modes.
  81. * ECHOKE: (libc)Local Modes.
  82. * ECHONL: (libc)Local Modes.
  83. * ECHOPRT: (libc)Local Modes.
  84. * ECHRNG: (libc)Error Codes.
  85. * ECOMM: (libc)Error Codes.
  86. * ECONNABORTED: (libc)Error Codes.
  87. * ECONNREFUSED: (libc)Error Codes.
  88. * ECONNRESET: (libc)Error Codes.
  89. * ED: (libc)Error Codes.
  90. * EDEADLK: (libc)Error Codes.
  91. * EDEADLOCK: (libc)Error Codes.
  92. * EDESTADDRREQ: (libc)Error Codes.
  93. * EDIED: (libc)Error Codes.
  94. * EDOM: (libc)Error Codes.
  95. * EDOTDOT: (libc)Error Codes.
  96. * EDQUOT: (libc)Error Codes.
  97. * EEXIST: (libc)Error Codes.
  98. * EFAULT: (libc)Error Codes.
  99. * EFBIG: (libc)Error Codes.
  100. * EFTYPE: (libc)Error Codes.
  101. * EGRATUITOUS: (libc)Error Codes.
  102. * EGREGIOUS: (libc)Error Codes.
  103. * EHOSTDOWN: (libc)Error Codes.
  104. * EHOSTUNREACH: (libc)Error Codes.
  105. * EHWPOISON: (libc)Error Codes.
  106. * EIDRM: (libc)Error Codes.
  107. * EIEIO: (libc)Error Codes.
  108. * EILSEQ: (libc)Error Codes.
  109. * EINPROGRESS: (libc)Error Codes.
  110. * EINTR: (libc)Error Codes.
  111. * EINVAL: (libc)Error Codes.
  112. * EIO: (libc)Error Codes.
  113. * EISCONN: (libc)Error Codes.
  114. * EISDIR: (libc)Error Codes.
  115. * EISNAM: (libc)Error Codes.
  116. * EKEYEXPIRED: (libc)Error Codes.
  117. * EKEYREJECTED: (libc)Error Codes.
  118. * EKEYREVOKED: (libc)Error Codes.
  119. * EL2HLT: (libc)Error Codes.
  120. * EL2NSYNC: (libc)Error Codes.
  121. * EL3HLT: (libc)Error Codes.
  122. * EL3RST: (libc)Error Codes.
  123. * ELIBACC: (libc)Error Codes.
  124. * ELIBBAD: (libc)Error Codes.
  125. * ELIBEXEC: (libc)Error Codes.
  126. * ELIBMAX: (libc)Error Codes.
  127. * ELIBSCN: (libc)Error Codes.
  128. * ELNRNG: (libc)Error Codes.
  129. * ELOOP: (libc)Error Codes.
  130. * EMEDIUMTYPE: (libc)Error Codes.
  131. * EMFILE: (libc)Error Codes.
  132. * EMLINK: (libc)Error Codes.
  133. * EMSGSIZE: (libc)Error Codes.
  134. * EMULTIHOP: (libc)Error Codes.
  135. * ENAMETOOLONG: (libc)Error Codes.
  136. * ENAVAIL: (libc)Error Codes.
  137. * ENEEDAUTH: (libc)Error Codes.
  138. * ENETDOWN: (libc)Error Codes.
  139. * ENETRESET: (libc)Error Codes.
  140. * ENETUNREACH: (libc)Error Codes.
  141. * ENFILE: (libc)Error Codes.
  142. * ENOANO: (libc)Error Codes.
  143. * ENOBUFS: (libc)Error Codes.
  144. * ENOCSI: (libc)Error Codes.
  145. * ENODATA: (libc)Error Codes.
  146. * ENODEV: (libc)Error Codes.
  147. * ENOENT: (libc)Error Codes.
  148. * ENOEXEC: (libc)Error Codes.
  149. * ENOKEY: (libc)Error Codes.
  150. * ENOLCK: (libc)Error Codes.
  151. * ENOLINK: (libc)Error Codes.
  152. * ENOMEDIUM: (libc)Error Codes.
  153. * ENOMEM: (libc)Error Codes.
  154. * ENOMSG: (libc)Error Codes.
  155. * ENONET: (libc)Error Codes.
  156. * ENOPKG: (libc)Error Codes.
  157. * ENOPROTOOPT: (libc)Error Codes.
  158. * ENOSPC: (libc)Error Codes.
  159. * ENOSR: (libc)Error Codes.
  160. * ENOSTR: (libc)Error Codes.
  161. * ENOSYS: (libc)Error Codes.
  162. * ENOTBLK: (libc)Error Codes.
  163. * ENOTCONN: (libc)Error Codes.
  164. * ENOTDIR: (libc)Error Codes.
  165. * ENOTEMPTY: (libc)Error Codes.
  166. * ENOTNAM: (libc)Error Codes.
  167. * ENOTRECOVERABLE: (libc)Error Codes.
  168. * ENOTSOCK: (libc)Error Codes.
  169. * ENOTSUP: (libc)Error Codes.
  170. * ENOTTY: (libc)Error Codes.
  171. * ENOTUNIQ: (libc)Error Codes.
  172. * ENXIO: (libc)Error Codes.
  173. * EOF: (libc)EOF and Errors.
  174. * EOPNOTSUPP: (libc)Error Codes.
  175. * EOVERFLOW: (libc)Error Codes.
  176. * EOWNERDEAD: (libc)Error Codes.
  177. * EPERM: (libc)Error Codes.
  178. * EPFNOSUPPORT: (libc)Error Codes.
  179. * EPIPE: (libc)Error Codes.
  180. * EPROCLIM: (libc)Error Codes.
  181. * EPROCUNAVAIL: (libc)Error Codes.
  182. * EPROGMISMATCH: (libc)Error Codes.
  183. * EPROGUNAVAIL: (libc)Error Codes.
  184. * EPROTO: (libc)Error Codes.
  185. * EPROTONOSUPPORT: (libc)Error Codes.
  186. * EPROTOTYPE: (libc)Error Codes.
  187. * EQUIV_CLASS_MAX: (libc)Utility Limits.
  188. * ERANGE: (libc)Error Codes.
  189. * EREMCHG: (libc)Error Codes.
  190. * EREMOTE: (libc)Error Codes.
  191. * EREMOTEIO: (libc)Error Codes.
  192. * ERESTART: (libc)Error Codes.
  193. * ERFKILL: (libc)Error Codes.
  194. * EROFS: (libc)Error Codes.
  195. * ERPCMISMATCH: (libc)Error Codes.
  196. * ESHUTDOWN: (libc)Error Codes.
  197. * ESOCKTNOSUPPORT: (libc)Error Codes.
  198. * ESPIPE: (libc)Error Codes.
  199. * ESRCH: (libc)Error Codes.
  200. * ESRMNT: (libc)Error Codes.
  201. * ESTALE: (libc)Error Codes.
  202. * ESTRPIPE: (libc)Error Codes.
  203. * ETIME: (libc)Error Codes.
  204. * ETIMEDOUT: (libc)Error Codes.
  205. * ETOOMANYREFS: (libc)Error Codes.
  206. * ETXTBSY: (libc)Error Codes.
  207. * EUCLEAN: (libc)Error Codes.
  208. * EUNATCH: (libc)Error Codes.
  209. * EUSERS: (libc)Error Codes.
  210. * EWOULDBLOCK: (libc)Error Codes.
  211. * EXDEV: (libc)Error Codes.
  212. * EXFULL: (libc)Error Codes.
  213. * EXIT_FAILURE: (libc)Exit Status.
  214. * EXIT_SUCCESS: (libc)Exit Status.
  215. * EXPR_NEST_MAX: (libc)Utility Limits.
  216. * FD_CLOEXEC: (libc)Descriptor Flags.
  217. * FD_CLR: (libc)Waiting for I/O.
  218. * FD_ISSET: (libc)Waiting for I/O.
  219. * FD_SET: (libc)Waiting for I/O.
  220. * FD_SETSIZE: (libc)Waiting for I/O.
  221. * FD_ZERO: (libc)Waiting for I/O.
  222. * FE_SNANS_ALWAYS_SIGNAL: (libc)Infinity and NaN.
  223. * FILENAME_MAX: (libc)Limits for Files.
  224. * FLUSHO: (libc)Local Modes.
  225. * FOPEN_MAX: (libc)Opening Streams.
  226. * FP_ILOGB0: (libc)Exponents and Logarithms.
  227. * FP_ILOGBNAN: (libc)Exponents and Logarithms.
  228. * FP_LLOGB0: (libc)Exponents and Logarithms.
  229. * FP_LLOGBNAN: (libc)Exponents and Logarithms.
  230. * F_DUPFD: (libc)Duplicating Descriptors.
  231. * F_GETFD: (libc)Descriptor Flags.
  232. * F_GETFL: (libc)Getting File Status Flags.
  233. * F_GETLK: (libc)File Locks.
  234. * F_GETOWN: (libc)Interrupt Input.
  235. * F_OFD_GETLK: (libc)Open File Description Locks.
  236. * F_OFD_SETLK: (libc)Open File Description Locks.
  237. * F_OFD_SETLKW: (libc)Open File Description Locks.
  238. * F_OK: (libc)Testing File Access.
  239. * F_SETFD: (libc)Descriptor Flags.
  240. * F_SETFL: (libc)Getting File Status Flags.
  241. * F_SETLK: (libc)File Locks.
  242. * F_SETLKW: (libc)File Locks.
  243. * F_SETOWN: (libc)Interrupt Input.
  244. * HAS_CPU_FEATURE: (libc)X86.
  245. * HUGE_VAL: (libc)Math Error Reporting.
  246. * HUGE_VALF: (libc)Math Error Reporting.
  247. * HUGE_VALL: (libc)Math Error Reporting.
  248. * HUGE_VAL_FN: (libc)Math Error Reporting.
  249. * HUGE_VAL_FNx: (libc)Math Error Reporting.
  250. * HUPCL: (libc)Control Modes.
  251. * I: (libc)Complex Numbers.
  252. * ICANON: (libc)Local Modes.
  253. * ICRNL: (libc)Input Modes.
  254. * IEXTEN: (libc)Local Modes.
  255. * IFNAMSIZ: (libc)Interface Naming.
  256. * IFTODT: (libc)Directory Entries.
  257. * IGNBRK: (libc)Input Modes.
  258. * IGNCR: (libc)Input Modes.
  259. * IGNPAR: (libc)Input Modes.
  260. * IMAXBEL: (libc)Input Modes.
  261. * INADDR_ANY: (libc)Host Address Data Type.
  262. * INADDR_BROADCAST: (libc)Host Address Data Type.
  263. * INADDR_LOOPBACK: (libc)Host Address Data Type.
  264. * INADDR_NONE: (libc)Host Address Data Type.
  265. * INFINITY: (libc)Infinity and NaN.
  266. * INLCR: (libc)Input Modes.
  267. * INPCK: (libc)Input Modes.
  268. * IPPORT_RESERVED: (libc)Ports.
  269. * IPPORT_USERRESERVED: (libc)Ports.
  270. * ISIG: (libc)Local Modes.
  271. * ISTRIP: (libc)Input Modes.
  272. * IXANY: (libc)Input Modes.
  273. * IXOFF: (libc)Input Modes.
  274. * IXON: (libc)Input Modes.
  275. * LINE_MAX: (libc)Utility Limits.
  276. * LINK_MAX: (libc)Limits for Files.
  277. * L_ctermid: (libc)Identifying the Terminal.
  278. * L_cuserid: (libc)Who Logged In.
  279. * L_tmpnam: (libc)Temporary Files.
  280. * MAXNAMLEN: (libc)Limits for Files.
  281. * MAXSYMLINKS: (libc)Symbolic Links.
  282. * MAX_CANON: (libc)Limits for Files.
  283. * MAX_INPUT: (libc)Limits for Files.
  284. * MB_CUR_MAX: (libc)Selecting the Conversion.
  285. * MB_LEN_MAX: (libc)Selecting the Conversion.
  286. * MDMBUF: (libc)Control Modes.
  287. * MSG_DONTROUTE: (libc)Socket Data Options.
  288. * MSG_OOB: (libc)Socket Data Options.
  289. * MSG_PEEK: (libc)Socket Data Options.
  290. * NAME_MAX: (libc)Limits for Files.
  291. * NAN: (libc)Infinity and NaN.
  292. * NCCS: (libc)Mode Data Types.
  293. * NGROUPS_MAX: (libc)General Limits.
  294. * NOFLSH: (libc)Local Modes.
  295. * NOKERNINFO: (libc)Local Modes.
  296. * NSIG: (libc)Standard Signals.
  297. * NULL: (libc)Null Pointer Constant.
  298. * ONLCR: (libc)Output Modes.
  299. * ONOEOT: (libc)Output Modes.
  300. * OPEN_MAX: (libc)General Limits.
  301. * OPOST: (libc)Output Modes.
  302. * OXTABS: (libc)Output Modes.
  303. * O_ACCMODE: (libc)Access Modes.
  304. * O_APPEND: (libc)Operating Modes.
  305. * O_ASYNC: (libc)Operating Modes.
  306. * O_CREAT: (libc)Open-time Flags.
  307. * O_DIRECTORY: (libc)Open-time Flags.
  308. * O_EXCL: (libc)Open-time Flags.
  309. * O_EXEC: (libc)Access Modes.
  310. * O_EXLOCK: (libc)Open-time Flags.
  311. * O_FSYNC: (libc)Operating Modes.
  312. * O_IGNORE_CTTY: (libc)Open-time Flags.
  313. * O_NDELAY: (libc)Operating Modes.
  314. * O_NOATIME: (libc)Operating Modes.
  315. * O_NOCTTY: (libc)Open-time Flags.
  316. * O_NOFOLLOW: (libc)Open-time Flags.
  317. * O_NOLINK: (libc)Open-time Flags.
  318. * O_NONBLOCK: (libc)Open-time Flags.
  319. * O_NONBLOCK: (libc)Operating Modes.
  320. * O_NOTRANS: (libc)Open-time Flags.
  321. * O_PATH: (libc)Access Modes.
  322. * O_RDONLY: (libc)Access Modes.
  323. * O_RDWR: (libc)Access Modes.
  324. * O_READ: (libc)Access Modes.
  325. * O_SHLOCK: (libc)Open-time Flags.
  326. * O_SYNC: (libc)Operating Modes.
  327. * O_TMPFILE: (libc)Open-time Flags.
  328. * O_TRUNC: (libc)Open-time Flags.
  329. * O_WRITE: (libc)Access Modes.
  330. * O_WRONLY: (libc)Access Modes.
  331. * PARENB: (libc)Control Modes.
  332. * PARMRK: (libc)Input Modes.
  333. * PARODD: (libc)Control Modes.
  334. * PATH_MAX: (libc)Limits for Files.
  335. * PA_FLAG_MASK: (libc)Parsing a Template String.
  336. * PENDIN: (libc)Local Modes.
  337. * PF_FILE: (libc)Local Namespace Details.
  338. * PF_INET6: (libc)Internet Namespace.
  339. * PF_INET: (libc)Internet Namespace.
  340. * PF_LOCAL: (libc)Local Namespace Details.
  341. * PF_UNIX: (libc)Local Namespace Details.
  342. * PIPE_BUF: (libc)Limits for Files.
  343. * PTHREAD_ATTR_NO_SIGMASK_NP: (libc)Initial Thread Signal Mask.
  344. * P_tmpdir: (libc)Temporary Files.
  345. * RAND_MAX: (libc)ISO Random.
  346. * RE_DUP_MAX: (libc)General Limits.
  347. * RLIM_INFINITY: (libc)Limits on Resources.
  348. * R_OK: (libc)Testing File Access.
  349. * SA_NOCLDSTOP: (libc)Flags for Sigaction.
  350. * SA_ONSTACK: (libc)Flags for Sigaction.
  351. * SA_RESTART: (libc)Flags for Sigaction.
  352. * SEEK_CUR: (libc)File Positioning.
  353. * SEEK_END: (libc)File Positioning.
  354. * SEEK_SET: (libc)File Positioning.
  355. * SIGABRT: (libc)Program Error Signals.
  356. * SIGALRM: (libc)Alarm Signals.
  357. * SIGBUS: (libc)Program Error Signals.
  358. * SIGCHLD: (libc)Job Control Signals.
  359. * SIGCLD: (libc)Job Control Signals.
  360. * SIGCONT: (libc)Job Control Signals.
  361. * SIGEMT: (libc)Program Error Signals.
  362. * SIGFPE: (libc)Program Error Signals.
  363. * SIGHUP: (libc)Termination Signals.
  364. * SIGILL: (libc)Program Error Signals.
  365. * SIGINFO: (libc)Miscellaneous Signals.
  366. * SIGINT: (libc)Termination Signals.
  367. * SIGIO: (libc)Asynchronous I/O Signals.
  368. * SIGIOT: (libc)Program Error Signals.
  369. * SIGKILL: (libc)Termination Signals.
  370. * SIGLOST: (libc)Operation Error Signals.
  371. * SIGPIPE: (libc)Operation Error Signals.
  372. * SIGPOLL: (libc)Asynchronous I/O Signals.
  373. * SIGPROF: (libc)Alarm Signals.
  374. * SIGQUIT: (libc)Termination Signals.
  375. * SIGSEGV: (libc)Program Error Signals.
  376. * SIGSTOP: (libc)Job Control Signals.
  377. * SIGSYS: (libc)Program Error Signals.
  378. * SIGTERM: (libc)Termination Signals.
  379. * SIGTRAP: (libc)Program Error Signals.
  380. * SIGTSTP: (libc)Job Control Signals.
  381. * SIGTTIN: (libc)Job Control Signals.
  382. * SIGTTOU: (libc)Job Control Signals.
  383. * SIGURG: (libc)Asynchronous I/O Signals.
  384. * SIGUSR1: (libc)Miscellaneous Signals.
  385. * SIGUSR2: (libc)Miscellaneous Signals.
  386. * SIGVTALRM: (libc)Alarm Signals.
  387. * SIGWINCH: (libc)Miscellaneous Signals.
  388. * SIGXCPU: (libc)Operation Error Signals.
  389. * SIGXFSZ: (libc)Operation Error Signals.
  390. * SIG_ERR: (libc)Basic Signal Handling.
  391. * SNAN: (libc)Infinity and NaN.
  392. * SNANF: (libc)Infinity and NaN.
  393. * SNANFN: (libc)Infinity and NaN.
  394. * SNANFNx: (libc)Infinity and NaN.
  395. * SNANL: (libc)Infinity and NaN.
  396. * SOCK_DGRAM: (libc)Communication Styles.
  397. * SOCK_RAW: (libc)Communication Styles.
  398. * SOCK_RDM: (libc)Communication Styles.
  399. * SOCK_SEQPACKET: (libc)Communication Styles.
  400. * SOCK_STREAM: (libc)Communication Styles.
  401. * SOL_SOCKET: (libc)Socket-Level Options.
  402. * SSIZE_MAX: (libc)General Limits.
  403. * STREAM_MAX: (libc)General Limits.
  404. * SUN_LEN: (libc)Local Namespace Details.
  405. * S_IFMT: (libc)Testing File Type.
  406. * S_ISBLK: (libc)Testing File Type.
  407. * S_ISCHR: (libc)Testing File Type.
  408. * S_ISDIR: (libc)Testing File Type.
  409. * S_ISFIFO: (libc)Testing File Type.
  410. * S_ISLNK: (libc)Testing File Type.
  411. * S_ISREG: (libc)Testing File Type.
  412. * S_ISSOCK: (libc)Testing File Type.
  413. * S_TYPEISMQ: (libc)Testing File Type.
  414. * S_TYPEISSEM: (libc)Testing File Type.
  415. * S_TYPEISSHM: (libc)Testing File Type.
  416. * TMP_MAX: (libc)Temporary Files.
  417. * TOSTOP: (libc)Local Modes.
  418. * TZNAME_MAX: (libc)General Limits.
  419. * VDISCARD: (libc)Other Special.
  420. * VDSUSP: (libc)Signal Characters.
  421. * VEOF: (libc)Editing Characters.
  422. * VEOL2: (libc)Editing Characters.
  423. * VEOL: (libc)Editing Characters.
  424. * VERASE: (libc)Editing Characters.
  425. * VINTR: (libc)Signal Characters.
  426. * VKILL: (libc)Editing Characters.
  427. * VLNEXT: (libc)Other Special.
  428. * VMIN: (libc)Noncanonical Input.
  429. * VQUIT: (libc)Signal Characters.
  430. * VREPRINT: (libc)Editing Characters.
  431. * VSTART: (libc)Start/Stop Characters.
  432. * VSTATUS: (libc)Other Special.
  433. * VSTOP: (libc)Start/Stop Characters.
  434. * VSUSP: (libc)Signal Characters.
  435. * VTIME: (libc)Noncanonical Input.
  436. * VWERASE: (libc)Editing Characters.
  437. * WCHAR_MAX: (libc)Extended Char Intro.
  438. * WCHAR_MIN: (libc)Extended Char Intro.
  439. * WCOREDUMP: (libc)Process Completion Status.
  440. * WEOF: (libc)EOF and Errors.
  441. * WEOF: (libc)Extended Char Intro.
  442. * WEXITSTATUS: (libc)Process Completion Status.
  443. * WIFEXITED: (libc)Process Completion Status.
  444. * WIFSIGNALED: (libc)Process Completion Status.
  445. * WIFSTOPPED: (libc)Process Completion Status.
  446. * WSTOPSIG: (libc)Process Completion Status.
  447. * WTERMSIG: (libc)Process Completion Status.
  448. * W_OK: (libc)Testing File Access.
  449. * X_OK: (libc)Testing File Access.
  450. * _Complex_I: (libc)Complex Numbers.
  451. * _Exit: (libc)Termination Internals.
  452. * _IOFBF: (libc)Controlling Buffering.
  453. * _IOLBF: (libc)Controlling Buffering.
  454. * _IONBF: (libc)Controlling Buffering.
  455. * _Imaginary_I: (libc)Complex Numbers.
  456. * _PATH_UTMP: (libc)Manipulating the Database.
  457. * _PATH_WTMP: (libc)Manipulating the Database.
  458. * _POSIX2_C_DEV: (libc)System Options.
  459. * _POSIX2_C_VERSION: (libc)Version Supported.
  460. * _POSIX2_FORT_DEV: (libc)System Options.
  461. * _POSIX2_FORT_RUN: (libc)System Options.
  462. * _POSIX2_LOCALEDEF: (libc)System Options.
  463. * _POSIX2_SW_DEV: (libc)System Options.
  464. * _POSIX_CHOWN_RESTRICTED: (libc)Options for Files.
  465. * _POSIX_JOB_CONTROL: (libc)System Options.
  466. * _POSIX_NO_TRUNC: (libc)Options for Files.
  467. * _POSIX_SAVED_IDS: (libc)System Options.
  468. * _POSIX_VDISABLE: (libc)Options for Files.
  469. * _POSIX_VERSION: (libc)Version Supported.
  470. * __fbufsize: (libc)Controlling Buffering.
  471. * __flbf: (libc)Controlling Buffering.
  472. * __fpending: (libc)Controlling Buffering.
  473. * __fpurge: (libc)Flushing Buffers.
  474. * __freadable: (libc)Opening Streams.
  475. * __freading: (libc)Opening Streams.
  476. * __fsetlocking: (libc)Streams and Threads.
  477. * __fwritable: (libc)Opening Streams.
  478. * __fwriting: (libc)Opening Streams.
  479. * __gconv_end_fct: (libc)glibc iconv Implementation.
  480. * __gconv_fct: (libc)glibc iconv Implementation.
  481. * __gconv_init_fct: (libc)glibc iconv Implementation.
  482. * __ppc_get_timebase: (libc)PowerPC.
  483. * __ppc_get_timebase_freq: (libc)PowerPC.
  484. * __ppc_mdoio: (libc)PowerPC.
  485. * __ppc_mdoom: (libc)PowerPC.
  486. * __ppc_set_ppr_low: (libc)PowerPC.
  487. * __ppc_set_ppr_med: (libc)PowerPC.
  488. * __ppc_set_ppr_med_high: (libc)PowerPC.
  489. * __ppc_set_ppr_med_low: (libc)PowerPC.
  490. * __ppc_set_ppr_very_low: (libc)PowerPC.
  491. * __ppc_yield: (libc)PowerPC.
  492. * __riscv_flush_icache: (libc)RISC-V.
  493. * __va_copy: (libc)Argument Macros.
  494. * __x86_get_cpuid_feature_leaf: (libc)X86.
  495. * _exit: (libc)Termination Internals.
  496. * _flushlbf: (libc)Flushing Buffers.
  497. * _tolower: (libc)Case Conversion.
  498. * _toupper: (libc)Case Conversion.
  499. * a64l: (libc)Encode Binary Data.
  500. * abort: (libc)Aborting a Program.
  501. * abs: (libc)Absolute Value.
  502. * accept: (libc)Accepting Connections.
  503. * access: (libc)Testing File Access.
  504. * acos: (libc)Inverse Trig Functions.
  505. * acosf: (libc)Inverse Trig Functions.
  506. * acosfN: (libc)Inverse Trig Functions.
  507. * acosfNx: (libc)Inverse Trig Functions.
  508. * acosh: (libc)Hyperbolic Functions.
  509. * acoshf: (libc)Hyperbolic Functions.
  510. * acoshfN: (libc)Hyperbolic Functions.
  511. * acoshfNx: (libc)Hyperbolic Functions.
  512. * acoshl: (libc)Hyperbolic Functions.
  513. * acosl: (libc)Inverse Trig Functions.
  514. * addmntent: (libc)mtab.
  515. * addseverity: (libc)Adding Severity Classes.
  516. * adjtime: (libc)Setting and Adjusting the Time.
  517. * adjtimex: (libc)Setting and Adjusting the Time.
  518. * aio_cancel64: (libc)Cancel AIO Operations.
  519. * aio_cancel: (libc)Cancel AIO Operations.
  520. * aio_error64: (libc)Status of AIO Operations.
  521. * aio_error: (libc)Status of AIO Operations.
  522. * aio_fsync64: (libc)Synchronizing AIO Operations.
  523. * aio_fsync: (libc)Synchronizing AIO Operations.
  524. * aio_init: (libc)Configuration of AIO.
  525. * aio_read64: (libc)Asynchronous Reads/Writes.
  526. * aio_read: (libc)Asynchronous Reads/Writes.
  527. * aio_return64: (libc)Status of AIO Operations.
  528. * aio_return: (libc)Status of AIO Operations.
  529. * aio_suspend64: (libc)Synchronizing AIO Operations.
  530. * aio_suspend: (libc)Synchronizing AIO Operations.
  531. * aio_write64: (libc)Asynchronous Reads/Writes.
  532. * aio_write: (libc)Asynchronous Reads/Writes.
  533. * alarm: (libc)Setting an Alarm.
  534. * aligned_alloc: (libc)Aligned Memory Blocks.
  535. * alloca: (libc)Variable Size Automatic.
  536. * alphasort64: (libc)Scanning Directory Content.
  537. * alphasort: (libc)Scanning Directory Content.
  538. * argp_error: (libc)Argp Helper Functions.
  539. * argp_failure: (libc)Argp Helper Functions.
  540. * argp_help: (libc)Argp Help.
  541. * argp_parse: (libc)Argp.
  542. * argp_state_help: (libc)Argp Helper Functions.
  543. * argp_usage: (libc)Argp Helper Functions.
  544. * argz_add: (libc)Argz Functions.
  545. * argz_add_sep: (libc)Argz Functions.
  546. * argz_append: (libc)Argz Functions.
  547. * argz_count: (libc)Argz Functions.
  548. * argz_create: (libc)Argz Functions.
  549. * argz_create_sep: (libc)Argz Functions.
  550. * argz_delete: (libc)Argz Functions.
  551. * argz_extract: (libc)Argz Functions.
  552. * argz_insert: (libc)Argz Functions.
  553. * argz_next: (libc)Argz Functions.
  554. * argz_replace: (libc)Argz Functions.
  555. * argz_stringify: (libc)Argz Functions.
  556. * asctime: (libc)Formatting Calendar Time.
  557. * asctime_r: (libc)Formatting Calendar Time.
  558. * asin: (libc)Inverse Trig Functions.
  559. * asinf: (libc)Inverse Trig Functions.
  560. * asinfN: (libc)Inverse Trig Functions.
  561. * asinfNx: (libc)Inverse Trig Functions.
  562. * asinh: (libc)Hyperbolic Functions.
  563. * asinhf: (libc)Hyperbolic Functions.
  564. * asinhfN: (libc)Hyperbolic Functions.
  565. * asinhfNx: (libc)Hyperbolic Functions.
  566. * asinhl: (libc)Hyperbolic Functions.
  567. * asinl: (libc)Inverse Trig Functions.
  568. * asprintf: (libc)Dynamic Output.
  569. * assert: (libc)Consistency Checking.
  570. * assert_perror: (libc)Consistency Checking.
  571. * atan2: (libc)Inverse Trig Functions.
  572. * atan2f: (libc)Inverse Trig Functions.
  573. * atan2fN: (libc)Inverse Trig Functions.
  574. * atan2fNx: (libc)Inverse Trig Functions.
  575. * atan2l: (libc)Inverse Trig Functions.
  576. * atan: (libc)Inverse Trig Functions.
  577. * atanf: (libc)Inverse Trig Functions.
  578. * atanfN: (libc)Inverse Trig Functions.
  579. * atanfNx: (libc)Inverse Trig Functions.
  580. * atanh: (libc)Hyperbolic Functions.
  581. * atanhf: (libc)Hyperbolic Functions.
  582. * atanhfN: (libc)Hyperbolic Functions.
  583. * atanhfNx: (libc)Hyperbolic Functions.
  584. * atanhl: (libc)Hyperbolic Functions.
  585. * atanl: (libc)Inverse Trig Functions.
  586. * atexit: (libc)Cleanups on Exit.
  587. * atof: (libc)Parsing of Floats.
  588. * atoi: (libc)Parsing of Integers.
  589. * atol: (libc)Parsing of Integers.
  590. * atoll: (libc)Parsing of Integers.
  591. * backtrace: (libc)Backtraces.
  592. * backtrace_symbols: (libc)Backtraces.
  593. * backtrace_symbols_fd: (libc)Backtraces.
  594. * basename: (libc)Finding Tokens in a String.
  595. * basename: (libc)Finding Tokens in a String.
  596. * bcmp: (libc)String/Array Comparison.
  597. * bcopy: (libc)Copying Strings and Arrays.
  598. * bind: (libc)Setting Address.
  599. * bind_textdomain_codeset: (libc)Charset conversion in gettext.
  600. * bindtextdomain: (libc)Locating gettext catalog.
  601. * brk: (libc)Resizing the Data Segment.
  602. * bsearch: (libc)Array Search Function.
  603. * btowc: (libc)Converting a Character.
  604. * bzero: (libc)Copying Strings and Arrays.
  605. * cabs: (libc)Absolute Value.
  606. * cabsf: (libc)Absolute Value.
  607. * cabsfN: (libc)Absolute Value.
  608. * cabsfNx: (libc)Absolute Value.
  609. * cabsl: (libc)Absolute Value.
  610. * cacos: (libc)Inverse Trig Functions.
  611. * cacosf: (libc)Inverse Trig Functions.
  612. * cacosfN: (libc)Inverse Trig Functions.
  613. * cacosfNx: (libc)Inverse Trig Functions.
  614. * cacosh: (libc)Hyperbolic Functions.
  615. * cacoshf: (libc)Hyperbolic Functions.
  616. * cacoshfN: (libc)Hyperbolic Functions.
  617. * cacoshfNx: (libc)Hyperbolic Functions.
  618. * cacoshl: (libc)Hyperbolic Functions.
  619. * cacosl: (libc)Inverse Trig Functions.
  620. * call_once: (libc)Call Once.
  621. * calloc: (libc)Allocating Cleared Space.
  622. * canonicalize: (libc)FP Bit Twiddling.
  623. * canonicalize_file_name: (libc)Symbolic Links.
  624. * canonicalizef: (libc)FP Bit Twiddling.
  625. * canonicalizefN: (libc)FP Bit Twiddling.
  626. * canonicalizefNx: (libc)FP Bit Twiddling.
  627. * canonicalizel: (libc)FP Bit Twiddling.
  628. * carg: (libc)Operations on Complex.
  629. * cargf: (libc)Operations on Complex.
  630. * cargfN: (libc)Operations on Complex.
  631. * cargfNx: (libc)Operations on Complex.
  632. * cargl: (libc)Operations on Complex.
  633. * casin: (libc)Inverse Trig Functions.
  634. * casinf: (libc)Inverse Trig Functions.
  635. * casinfN: (libc)Inverse Trig Functions.
  636. * casinfNx: (libc)Inverse Trig Functions.
  637. * casinh: (libc)Hyperbolic Functions.
  638. * casinhf: (libc)Hyperbolic Functions.
  639. * casinhfN: (libc)Hyperbolic Functions.
  640. * casinhfNx: (libc)Hyperbolic Functions.
  641. * casinhl: (libc)Hyperbolic Functions.
  642. * casinl: (libc)Inverse Trig Functions.
  643. * catan: (libc)Inverse Trig Functions.
  644. * catanf: (libc)Inverse Trig Functions.
  645. * catanfN: (libc)Inverse Trig Functions.
  646. * catanfNx: (libc)Inverse Trig Functions.
  647. * catanh: (libc)Hyperbolic Functions.
  648. * catanhf: (libc)Hyperbolic Functions.
  649. * catanhfN: (libc)Hyperbolic Functions.
  650. * catanhfNx: (libc)Hyperbolic Functions.
  651. * catanhl: (libc)Hyperbolic Functions.
  652. * catanl: (libc)Inverse Trig Functions.
  653. * catclose: (libc)The catgets Functions.
  654. * catgets: (libc)The catgets Functions.
  655. * catopen: (libc)The catgets Functions.
  656. * cbrt: (libc)Exponents and Logarithms.
  657. * cbrtf: (libc)Exponents and Logarithms.
  658. * cbrtfN: (libc)Exponents and Logarithms.
  659. * cbrtfNx: (libc)Exponents and Logarithms.
  660. * cbrtl: (libc)Exponents and Logarithms.
  661. * ccos: (libc)Trig Functions.
  662. * ccosf: (libc)Trig Functions.
  663. * ccosfN: (libc)Trig Functions.
  664. * ccosfNx: (libc)Trig Functions.
  665. * ccosh: (libc)Hyperbolic Functions.
  666. * ccoshf: (libc)Hyperbolic Functions.
  667. * ccoshfN: (libc)Hyperbolic Functions.
  668. * ccoshfNx: (libc)Hyperbolic Functions.
  669. * ccoshl: (libc)Hyperbolic Functions.
  670. * ccosl: (libc)Trig Functions.
  671. * ceil: (libc)Rounding Functions.
  672. * ceilf: (libc)Rounding Functions.
  673. * ceilfN: (libc)Rounding Functions.
  674. * ceilfNx: (libc)Rounding Functions.
  675. * ceill: (libc)Rounding Functions.
  676. * cexp: (libc)Exponents and Logarithms.
  677. * cexpf: (libc)Exponents and Logarithms.
  678. * cexpfN: (libc)Exponents and Logarithms.
  679. * cexpfNx: (libc)Exponents and Logarithms.
  680. * cexpl: (libc)Exponents and Logarithms.
  681. * cfgetispeed: (libc)Line Speed.
  682. * cfgetospeed: (libc)Line Speed.
  683. * cfmakeraw: (libc)Noncanonical Input.
  684. * cfsetispeed: (libc)Line Speed.
  685. * cfsetospeed: (libc)Line Speed.
  686. * cfsetspeed: (libc)Line Speed.
  687. * chdir: (libc)Working Directory.
  688. * chmod: (libc)Setting Permissions.
  689. * chown: (libc)File Owner.
  690. * cimag: (libc)Operations on Complex.
  691. * cimagf: (libc)Operations on Complex.
  692. * cimagfN: (libc)Operations on Complex.
  693. * cimagfNx: (libc)Operations on Complex.
  694. * cimagl: (libc)Operations on Complex.
  695. * clearenv: (libc)Environment Access.
  696. * clearerr: (libc)Error Recovery.
  697. * clearerr_unlocked: (libc)Error Recovery.
  698. * clock: (libc)CPU Time.
  699. * clock_getres: (libc)Getting the Time.
  700. * clock_gettime: (libc)Getting the Time.
  701. * clock_settime: (libc)Setting and Adjusting the Time.
  702. * clog10: (libc)Exponents and Logarithms.
  703. * clog10f: (libc)Exponents and Logarithms.
  704. * clog10fN: (libc)Exponents and Logarithms.
  705. * clog10fNx: (libc)Exponents and Logarithms.
  706. * clog10l: (libc)Exponents and Logarithms.
  707. * clog: (libc)Exponents and Logarithms.
  708. * clogf: (libc)Exponents and Logarithms.
  709. * clogfN: (libc)Exponents and Logarithms.
  710. * clogfNx: (libc)Exponents and Logarithms.
  711. * clogl: (libc)Exponents and Logarithms.
  712. * close: (libc)Opening and Closing Files.
  713. * closedir: (libc)Reading/Closing Directory.
  714. * closelog: (libc)closelog.
  715. * cnd_broadcast: (libc)ISO C Condition Variables.
  716. * cnd_destroy: (libc)ISO C Condition Variables.
  717. * cnd_init: (libc)ISO C Condition Variables.
  718. * cnd_signal: (libc)ISO C Condition Variables.
  719. * cnd_timedwait: (libc)ISO C Condition Variables.
  720. * cnd_wait: (libc)ISO C Condition Variables.
  721. * confstr: (libc)String Parameters.
  722. * conj: (libc)Operations on Complex.
  723. * conjf: (libc)Operations on Complex.
  724. * conjfN: (libc)Operations on Complex.
  725. * conjfNx: (libc)Operations on Complex.
  726. * conjl: (libc)Operations on Complex.
  727. * connect: (libc)Connecting.
  728. * copy_file_range: (libc)Copying File Data.
  729. * copysign: (libc)FP Bit Twiddling.
  730. * copysignf: (libc)FP Bit Twiddling.
  731. * copysignfN: (libc)FP Bit Twiddling.
  732. * copysignfNx: (libc)FP Bit Twiddling.
  733. * copysignl: (libc)FP Bit Twiddling.
  734. * cos: (libc)Trig Functions.
  735. * cosf: (libc)Trig Functions.
  736. * cosfN: (libc)Trig Functions.
  737. * cosfNx: (libc)Trig Functions.
  738. * cosh: (libc)Hyperbolic Functions.
  739. * coshf: (libc)Hyperbolic Functions.
  740. * coshfN: (libc)Hyperbolic Functions.
  741. * coshfNx: (libc)Hyperbolic Functions.
  742. * coshl: (libc)Hyperbolic Functions.
  743. * cosl: (libc)Trig Functions.
  744. * cpow: (libc)Exponents and Logarithms.
  745. * cpowf: (libc)Exponents and Logarithms.
  746. * cpowfN: (libc)Exponents and Logarithms.
  747. * cpowfNx: (libc)Exponents and Logarithms.
  748. * cpowl: (libc)Exponents and Logarithms.
  749. * cproj: (libc)Operations on Complex.
  750. * cprojf: (libc)Operations on Complex.
  751. * cprojfN: (libc)Operations on Complex.
  752. * cprojfNx: (libc)Operations on Complex.
  753. * cprojl: (libc)Operations on Complex.
  754. * creal: (libc)Operations on Complex.
  755. * crealf: (libc)Operations on Complex.
  756. * crealfN: (libc)Operations on Complex.
  757. * crealfNx: (libc)Operations on Complex.
  758. * creall: (libc)Operations on Complex.
  759. * creat64: (libc)Opening and Closing Files.
  760. * creat: (libc)Opening and Closing Files.
  761. * crypt: (libc)Passphrase Storage.
  762. * crypt_r: (libc)Passphrase Storage.
  763. * csin: (libc)Trig Functions.
  764. * csinf: (libc)Trig Functions.
  765. * csinfN: (libc)Trig Functions.
  766. * csinfNx: (libc)Trig Functions.
  767. * csinh: (libc)Hyperbolic Functions.
  768. * csinhf: (libc)Hyperbolic Functions.
  769. * csinhfN: (libc)Hyperbolic Functions.
  770. * csinhfNx: (libc)Hyperbolic Functions.
  771. * csinhl: (libc)Hyperbolic Functions.
  772. * csinl: (libc)Trig Functions.
  773. * csqrt: (libc)Exponents and Logarithms.
  774. * csqrtf: (libc)Exponents and Logarithms.
  775. * csqrtfN: (libc)Exponents and Logarithms.
  776. * csqrtfNx: (libc)Exponents and Logarithms.
  777. * csqrtl: (libc)Exponents and Logarithms.
  778. * ctan: (libc)Trig Functions.
  779. * ctanf: (libc)Trig Functions.
  780. * ctanfN: (libc)Trig Functions.
  781. * ctanfNx: (libc)Trig Functions.
  782. * ctanh: (libc)Hyperbolic Functions.
  783. * ctanhf: (libc)Hyperbolic Functions.
  784. * ctanhfN: (libc)Hyperbolic Functions.
  785. * ctanhfNx: (libc)Hyperbolic Functions.
  786. * ctanhl: (libc)Hyperbolic Functions.
  787. * ctanl: (libc)Trig Functions.
  788. * ctermid: (libc)Identifying the Terminal.
  789. * ctime: (libc)Formatting Calendar Time.
  790. * ctime_r: (libc)Formatting Calendar Time.
  791. * cuserid: (libc)Who Logged In.
  792. * daddl: (libc)Misc FP Arithmetic.
  793. * dcgettext: (libc)Translation with gettext.
  794. * dcngettext: (libc)Advanced gettext functions.
  795. * ddivl: (libc)Misc FP Arithmetic.
  796. * dgettext: (libc)Translation with gettext.
  797. * difftime: (libc)Calculating Elapsed Time.
  798. * dirfd: (libc)Opening a Directory.
  799. * dirname: (libc)Finding Tokens in a String.
  800. * div: (libc)Integer Division.
  801. * dmull: (libc)Misc FP Arithmetic.
  802. * dngettext: (libc)Advanced gettext functions.
  803. * drand48: (libc)SVID Random.
  804. * drand48_r: (libc)SVID Random.
  805. * drem: (libc)Remainder Functions.
  806. * dremf: (libc)Remainder Functions.
  807. * dreml: (libc)Remainder Functions.
  808. * dsubl: (libc)Misc FP Arithmetic.
  809. * dup2: (libc)Duplicating Descriptors.
  810. * dup: (libc)Duplicating Descriptors.
  811. * ecvt: (libc)System V Number Conversion.
  812. * ecvt_r: (libc)System V Number Conversion.
  813. * endfsent: (libc)fstab.
  814. * endgrent: (libc)Scanning All Groups.
  815. * endhostent: (libc)Host Names.
  816. * endmntent: (libc)mtab.
  817. * endnetent: (libc)Networks Database.
  818. * endnetgrent: (libc)Lookup Netgroup.
  819. * endprotoent: (libc)Protocols Database.
  820. * endpwent: (libc)Scanning All Users.
  821. * endservent: (libc)Services Database.
  822. * endutent: (libc)Manipulating the Database.
  823. * endutxent: (libc)XPG Functions.
  824. * envz_add: (libc)Envz Functions.
  825. * envz_entry: (libc)Envz Functions.
  826. * envz_get: (libc)Envz Functions.
  827. * envz_merge: (libc)Envz Functions.
  828. * envz_remove: (libc)Envz Functions.
  829. * envz_strip: (libc)Envz Functions.
  830. * erand48: (libc)SVID Random.
  831. * erand48_r: (libc)SVID Random.
  832. * erf: (libc)Special Functions.
  833. * erfc: (libc)Special Functions.
  834. * erfcf: (libc)Special Functions.
  835. * erfcfN: (libc)Special Functions.
  836. * erfcfNx: (libc)Special Functions.
  837. * erfcl: (libc)Special Functions.
  838. * erff: (libc)Special Functions.
  839. * erffN: (libc)Special Functions.
  840. * erffNx: (libc)Special Functions.
  841. * erfl: (libc)Special Functions.
  842. * err: (libc)Error Messages.
  843. * errno: (libc)Checking for Errors.
  844. * error: (libc)Error Messages.
  845. * error_at_line: (libc)Error Messages.
  846. * errx: (libc)Error Messages.
  847. * execl: (libc)Executing a File.
  848. * execle: (libc)Executing a File.
  849. * execlp: (libc)Executing a File.
  850. * execv: (libc)Executing a File.
  851. * execve: (libc)Executing a File.
  852. * execvp: (libc)Executing a File.
  853. * exit: (libc)Normal Termination.
  854. * exp10: (libc)Exponents and Logarithms.
  855. * exp10f: (libc)Exponents and Logarithms.
  856. * exp10fN: (libc)Exponents and Logarithms.
  857. * exp10fNx: (libc)Exponents and Logarithms.
  858. * exp10l: (libc)Exponents and Logarithms.
  859. * exp2: (libc)Exponents and Logarithms.
  860. * exp2f: (libc)Exponents and Logarithms.
  861. * exp2fN: (libc)Exponents and Logarithms.
  862. * exp2fNx: (libc)Exponents and Logarithms.
  863. * exp2l: (libc)Exponents and Logarithms.
  864. * exp: (libc)Exponents and Logarithms.
  865. * expf: (libc)Exponents and Logarithms.
  866. * expfN: (libc)Exponents and Logarithms.
  867. * expfNx: (libc)Exponents and Logarithms.
  868. * expl: (libc)Exponents and Logarithms.
  869. * explicit_bzero: (libc)Erasing Sensitive Data.
  870. * expm1: (libc)Exponents and Logarithms.
  871. * expm1f: (libc)Exponents and Logarithms.
  872. * expm1fN: (libc)Exponents and Logarithms.
  873. * expm1fNx: (libc)Exponents and Logarithms.
  874. * expm1l: (libc)Exponents and Logarithms.
  875. * fMaddfN: (libc)Misc FP Arithmetic.
  876. * fMaddfNx: (libc)Misc FP Arithmetic.
  877. * fMdivfN: (libc)Misc FP Arithmetic.
  878. * fMdivfNx: (libc)Misc FP Arithmetic.
  879. * fMmulfN: (libc)Misc FP Arithmetic.
  880. * fMmulfNx: (libc)Misc FP Arithmetic.
  881. * fMsubfN: (libc)Misc FP Arithmetic.
  882. * fMsubfNx: (libc)Misc FP Arithmetic.
  883. * fMxaddfN: (libc)Misc FP Arithmetic.
  884. * fMxaddfNx: (libc)Misc FP Arithmetic.
  885. * fMxdivfN: (libc)Misc FP Arithmetic.
  886. * fMxdivfNx: (libc)Misc FP Arithmetic.
  887. * fMxmulfN: (libc)Misc FP Arithmetic.
  888. * fMxmulfNx: (libc)Misc FP Arithmetic.
  889. * fMxsubfN: (libc)Misc FP Arithmetic.
  890. * fMxsubfNx: (libc)Misc FP Arithmetic.
  891. * fabs: (libc)Absolute Value.
  892. * fabsf: (libc)Absolute Value.
  893. * fabsfN: (libc)Absolute Value.
  894. * fabsfNx: (libc)Absolute Value.
  895. * fabsl: (libc)Absolute Value.
  896. * fadd: (libc)Misc FP Arithmetic.
  897. * faddl: (libc)Misc FP Arithmetic.
  898. * fchdir: (libc)Working Directory.
  899. * fchmod: (libc)Setting Permissions.
  900. * fchown: (libc)File Owner.
  901. * fclose: (libc)Closing Streams.
  902. * fcloseall: (libc)Closing Streams.
  903. * fcntl: (libc)Control Operations.
  904. * fcvt: (libc)System V Number Conversion.
  905. * fcvt_r: (libc)System V Number Conversion.
  906. * fdatasync: (libc)Synchronizing I/O.
  907. * fdim: (libc)Misc FP Arithmetic.
  908. * fdimf: (libc)Misc FP Arithmetic.
  909. * fdimfN: (libc)Misc FP Arithmetic.
  910. * fdimfNx: (libc)Misc FP Arithmetic.
  911. * fdiml: (libc)Misc FP Arithmetic.
  912. * fdiv: (libc)Misc FP Arithmetic.
  913. * fdivl: (libc)Misc FP Arithmetic.
  914. * fdopen: (libc)Descriptors and Streams.
  915. * fdopendir: (libc)Opening a Directory.
  916. * feclearexcept: (libc)Status bit operations.
  917. * fedisableexcept: (libc)Control Functions.
  918. * feenableexcept: (libc)Control Functions.
  919. * fegetenv: (libc)Control Functions.
  920. * fegetexcept: (libc)Control Functions.
  921. * fegetexceptflag: (libc)Status bit operations.
  922. * fegetmode: (libc)Control Functions.
  923. * fegetround: (libc)Rounding.
  924. * feholdexcept: (libc)Control Functions.
  925. * feof: (libc)EOF and Errors.
  926. * feof_unlocked: (libc)EOF and Errors.
  927. * feraiseexcept: (libc)Status bit operations.
  928. * ferror: (libc)EOF and Errors.
  929. * ferror_unlocked: (libc)EOF and Errors.
  930. * fesetenv: (libc)Control Functions.
  931. * fesetexcept: (libc)Status bit operations.
  932. * fesetexceptflag: (libc)Status bit operations.
  933. * fesetmode: (libc)Control Functions.
  934. * fesetround: (libc)Rounding.
  935. * fetestexcept: (libc)Status bit operations.
  936. * fetestexceptflag: (libc)Status bit operations.
  937. * feupdateenv: (libc)Control Functions.
  938. * fexecve: (libc)Executing a File.
  939. * fflush: (libc)Flushing Buffers.
  940. * fflush_unlocked: (libc)Flushing Buffers.
  941. * fgetc: (libc)Character Input.
  942. * fgetc_unlocked: (libc)Character Input.
  943. * fgetgrent: (libc)Scanning All Groups.
  944. * fgetgrent_r: (libc)Scanning All Groups.
  945. * fgetpos64: (libc)Portable Positioning.
  946. * fgetpos: (libc)Portable Positioning.
  947. * fgetpwent: (libc)Scanning All Users.
  948. * fgetpwent_r: (libc)Scanning All Users.
  949. * fgets: (libc)Line Input.
  950. * fgets_unlocked: (libc)Line Input.
  951. * fgetwc: (libc)Character Input.
  952. * fgetwc_unlocked: (libc)Character Input.
  953. * fgetws: (libc)Line Input.
  954. * fgetws_unlocked: (libc)Line Input.
  955. * fileno: (libc)Descriptors and Streams.
  956. * fileno_unlocked: (libc)Descriptors and Streams.
  957. * finite: (libc)Floating Point Classes.
  958. * finitef: (libc)Floating Point Classes.
  959. * finitel: (libc)Floating Point Classes.
  960. * flockfile: (libc)Streams and Threads.
  961. * floor: (libc)Rounding Functions.
  962. * floorf: (libc)Rounding Functions.
  963. * floorfN: (libc)Rounding Functions.
  964. * floorfNx: (libc)Rounding Functions.
  965. * floorl: (libc)Rounding Functions.
  966. * fma: (libc)Misc FP Arithmetic.
  967. * fmaf: (libc)Misc FP Arithmetic.
  968. * fmafN: (libc)Misc FP Arithmetic.
  969. * fmafNx: (libc)Misc FP Arithmetic.
  970. * fmal: (libc)Misc FP Arithmetic.
  971. * fmax: (libc)Misc FP Arithmetic.
  972. * fmaxf: (libc)Misc FP Arithmetic.
  973. * fmaxfN: (libc)Misc FP Arithmetic.
  974. * fmaxfNx: (libc)Misc FP Arithmetic.
  975. * fmaxl: (libc)Misc FP Arithmetic.
  976. * fmaxmag: (libc)Misc FP Arithmetic.
  977. * fmaxmagf: (libc)Misc FP Arithmetic.
  978. * fmaxmagfN: (libc)Misc FP Arithmetic.
  979. * fmaxmagfNx: (libc)Misc FP Arithmetic.
  980. * fmaxmagl: (libc)Misc FP Arithmetic.
  981. * fmemopen: (libc)String Streams.
  982. * fmin: (libc)Misc FP Arithmetic.
  983. * fminf: (libc)Misc FP Arithmetic.
  984. * fminfN: (libc)Misc FP Arithmetic.
  985. * fminfNx: (libc)Misc FP Arithmetic.
  986. * fminl: (libc)Misc FP Arithmetic.
  987. * fminmag: (libc)Misc FP Arithmetic.
  988. * fminmagf: (libc)Misc FP Arithmetic.
  989. * fminmagfN: (libc)Misc FP Arithmetic.
  990. * fminmagfNx: (libc)Misc FP Arithmetic.
  991. * fminmagl: (libc)Misc FP Arithmetic.
  992. * fmod: (libc)Remainder Functions.
  993. * fmodf: (libc)Remainder Functions.
  994. * fmodfN: (libc)Remainder Functions.
  995. * fmodfNx: (libc)Remainder Functions.
  996. * fmodl: (libc)Remainder Functions.
  997. * fmtmsg: (libc)Printing Formatted Messages.
  998. * fmul: (libc)Misc FP Arithmetic.
  999. * fmull: (libc)Misc FP Arithmetic.
  1000. * fnmatch: (libc)Wildcard Matching.
  1001. * fopen64: (libc)Opening Streams.
  1002. * fopen: (libc)Opening Streams.
  1003. * fopencookie: (libc)Streams and Cookies.
  1004. * fork: (libc)Creating a Process.
  1005. * forkpty: (libc)Pseudo-Terminal Pairs.
  1006. * fpathconf: (libc)Pathconf.
  1007. * fpclassify: (libc)Floating Point Classes.
  1008. * fprintf: (libc)Formatted Output Functions.
  1009. * fputc: (libc)Simple Output.
  1010. * fputc_unlocked: (libc)Simple Output.
  1011. * fputs: (libc)Simple Output.
  1012. * fputs_unlocked: (libc)Simple Output.
  1013. * fputwc: (libc)Simple Output.
  1014. * fputwc_unlocked: (libc)Simple Output.
  1015. * fputws: (libc)Simple Output.
  1016. * fputws_unlocked: (libc)Simple Output.
  1017. * fread: (libc)Block Input/Output.
  1018. * fread_unlocked: (libc)Block Input/Output.
  1019. * free: (libc)Freeing after Malloc.
  1020. * freopen64: (libc)Opening Streams.
  1021. * freopen: (libc)Opening Streams.
  1022. * frexp: (libc)Normalization Functions.
  1023. * frexpf: (libc)Normalization Functions.
  1024. * frexpfN: (libc)Normalization Functions.
  1025. * frexpfNx: (libc)Normalization Functions.
  1026. * frexpl: (libc)Normalization Functions.
  1027. * fromfp: (libc)Rounding Functions.
  1028. * fromfpf: (libc)Rounding Functions.
  1029. * fromfpfN: (libc)Rounding Functions.
  1030. * fromfpfNx: (libc)Rounding Functions.
  1031. * fromfpl: (libc)Rounding Functions.
  1032. * fromfpx: (libc)Rounding Functions.
  1033. * fromfpxf: (libc)Rounding Functions.
  1034. * fromfpxfN: (libc)Rounding Functions.
  1035. * fromfpxfNx: (libc)Rounding Functions.
  1036. * fromfpxl: (libc)Rounding Functions.
  1037. * fscanf: (libc)Formatted Input Functions.
  1038. * fseek: (libc)File Positioning.
  1039. * fseeko64: (libc)File Positioning.
  1040. * fseeko: (libc)File Positioning.
  1041. * fsetpos64: (libc)Portable Positioning.
  1042. * fsetpos: (libc)Portable Positioning.
  1043. * fstat64: (libc)Reading Attributes.
  1044. * fstat: (libc)Reading Attributes.
  1045. * fsub: (libc)Misc FP Arithmetic.
  1046. * fsubl: (libc)Misc FP Arithmetic.
  1047. * fsync: (libc)Synchronizing I/O.
  1048. * ftell: (libc)File Positioning.
  1049. * ftello64: (libc)File Positioning.
  1050. * ftello: (libc)File Positioning.
  1051. * ftruncate64: (libc)File Size.
  1052. * ftruncate: (libc)File Size.
  1053. * ftrylockfile: (libc)Streams and Threads.
  1054. * ftw64: (libc)Working with Directory Trees.
  1055. * ftw: (libc)Working with Directory Trees.
  1056. * funlockfile: (libc)Streams and Threads.
  1057. * futimes: (libc)File Times.
  1058. * fwide: (libc)Streams and I18N.
  1059. * fwprintf: (libc)Formatted Output Functions.
  1060. * fwrite: (libc)Block Input/Output.
  1061. * fwrite_unlocked: (libc)Block Input/Output.
  1062. * fwscanf: (libc)Formatted Input Functions.
  1063. * gamma: (libc)Special Functions.
  1064. * gammaf: (libc)Special Functions.
  1065. * gammal: (libc)Special Functions.
  1066. * gcvt: (libc)System V Number Conversion.
  1067. * get_avphys_pages: (libc)Query Memory Parameters.
  1068. * get_current_dir_name: (libc)Working Directory.
  1069. * get_nprocs: (libc)Processor Resources.
  1070. * get_nprocs_conf: (libc)Processor Resources.
  1071. * get_phys_pages: (libc)Query Memory Parameters.
  1072. * getauxval: (libc)Auxiliary Vector.
  1073. * getc: (libc)Character Input.
  1074. * getc_unlocked: (libc)Character Input.
  1075. * getchar: (libc)Character Input.
  1076. * getchar_unlocked: (libc)Character Input.
  1077. * getcontext: (libc)System V contexts.
  1078. * getcpu: (libc)CPU Affinity.
  1079. * getcwd: (libc)Working Directory.
  1080. * getdate: (libc)General Time String Parsing.
  1081. * getdate_r: (libc)General Time String Parsing.
  1082. * getdelim: (libc)Line Input.
  1083. * getdents64: (libc)Low-level Directory Access.
  1084. * getdomainnname: (libc)Host Identification.
  1085. * getegid: (libc)Reading Persona.
  1086. * getentropy: (libc)Unpredictable Bytes.
  1087. * getenv: (libc)Environment Access.
  1088. * geteuid: (libc)Reading Persona.
  1089. * getfsent: (libc)fstab.
  1090. * getfsfile: (libc)fstab.
  1091. * getfsspec: (libc)fstab.
  1092. * getgid: (libc)Reading Persona.
  1093. * getgrent: (libc)Scanning All Groups.
  1094. * getgrent_r: (libc)Scanning All Groups.
  1095. * getgrgid: (libc)Lookup Group.
  1096. * getgrgid_r: (libc)Lookup Group.
  1097. * getgrnam: (libc)Lookup Group.
  1098. * getgrnam_r: (libc)Lookup Group.
  1099. * getgrouplist: (libc)Setting Groups.
  1100. * getgroups: (libc)Reading Persona.
  1101. * gethostbyaddr: (libc)Host Names.
  1102. * gethostbyaddr_r: (libc)Host Names.
  1103. * gethostbyname2: (libc)Host Names.
  1104. * gethostbyname2_r: (libc)Host Names.
  1105. * gethostbyname: (libc)Host Names.
  1106. * gethostbyname_r: (libc)Host Names.
  1107. * gethostent: (libc)Host Names.
  1108. * gethostid: (libc)Host Identification.
  1109. * gethostname: (libc)Host Identification.
  1110. * getitimer: (libc)Setting an Alarm.
  1111. * getline: (libc)Line Input.
  1112. * getloadavg: (libc)Processor Resources.
  1113. * getlogin: (libc)Who Logged In.
  1114. * getmntent: (libc)mtab.
  1115. * getmntent_r: (libc)mtab.
  1116. * getnetbyaddr: (libc)Networks Database.
  1117. * getnetbyname: (libc)Networks Database.
  1118. * getnetent: (libc)Networks Database.
  1119. * getnetgrent: (libc)Lookup Netgroup.
  1120. * getnetgrent_r: (libc)Lookup Netgroup.
  1121. * getopt: (libc)Using Getopt.
  1122. * getopt_long: (libc)Getopt Long Options.
  1123. * getopt_long_only: (libc)Getopt Long Options.
  1124. * getpagesize: (libc)Query Memory Parameters.
  1125. * getpass: (libc)getpass.
  1126. * getpayload: (libc)FP Bit Twiddling.
  1127. * getpayloadf: (libc)FP Bit Twiddling.
  1128. * getpayloadfN: (libc)FP Bit Twiddling.
  1129. * getpayloadfNx: (libc)FP Bit Twiddling.
  1130. * getpayloadl: (libc)FP Bit Twiddling.
  1131. * getpeername: (libc)Who is Connected.
  1132. * getpgid: (libc)Process Group Functions.
  1133. * getpgrp: (libc)Process Group Functions.
  1134. * getpid: (libc)Process Identification.
  1135. * getppid: (libc)Process Identification.
  1136. * getpriority: (libc)Traditional Scheduling Functions.
  1137. * getprotobyname: (libc)Protocols Database.
  1138. * getprotobynumber: (libc)Protocols Database.
  1139. * getprotoent: (libc)Protocols Database.
  1140. * getpt: (libc)Allocation.
  1141. * getpwent: (libc)Scanning All Users.
  1142. * getpwent_r: (libc)Scanning All Users.
  1143. * getpwnam: (libc)Lookup User.
  1144. * getpwnam_r: (libc)Lookup User.
  1145. * getpwuid: (libc)Lookup User.
  1146. * getpwuid_r: (libc)Lookup User.
  1147. * getrandom: (libc)Unpredictable Bytes.
  1148. * getrlimit64: (libc)Limits on Resources.
  1149. * getrlimit: (libc)Limits on Resources.
  1150. * getrusage: (libc)Resource Usage.
  1151. * gets: (libc)Line Input.
  1152. * getservbyname: (libc)Services Database.
  1153. * getservbyport: (libc)Services Database.
  1154. * getservent: (libc)Services Database.
  1155. * getsid: (libc)Process Group Functions.
  1156. * getsockname: (libc)Reading Address.
  1157. * getsockopt: (libc)Socket Option Functions.
  1158. * getsubopt: (libc)Suboptions.
  1159. * gettext: (libc)Translation with gettext.
  1160. * gettid: (libc)Process Identification.
  1161. * gettimeofday: (libc)Getting the Time.
  1162. * getuid: (libc)Reading Persona.
  1163. * getumask: (libc)Setting Permissions.
  1164. * getutent: (libc)Manipulating the Database.
  1165. * getutent_r: (libc)Manipulating the Database.
  1166. * getutid: (libc)Manipulating the Database.
  1167. * getutid_r: (libc)Manipulating the Database.
  1168. * getutline: (libc)Manipulating the Database.
  1169. * getutline_r: (libc)Manipulating the Database.
  1170. * getutmp: (libc)XPG Functions.
  1171. * getutmpx: (libc)XPG Functions.
  1172. * getutxent: (libc)XPG Functions.
  1173. * getutxid: (libc)XPG Functions.
  1174. * getutxline: (libc)XPG Functions.
  1175. * getw: (libc)Character Input.
  1176. * getwc: (libc)Character Input.
  1177. * getwc_unlocked: (libc)Character Input.
  1178. * getwchar: (libc)Character Input.
  1179. * getwchar_unlocked: (libc)Character Input.
  1180. * getwd: (libc)Working Directory.
  1181. * glob64: (libc)Calling Glob.
  1182. * glob: (libc)Calling Glob.
  1183. * globfree64: (libc)More Flags for Globbing.
  1184. * globfree: (libc)More Flags for Globbing.
  1185. * gmtime: (libc)Broken-down Time.
  1186. * gmtime_r: (libc)Broken-down Time.
  1187. * grantpt: (libc)Allocation.
  1188. * gsignal: (libc)Signaling Yourself.
  1189. * gtty: (libc)BSD Terminal Modes.
  1190. * hasmntopt: (libc)mtab.
  1191. * hcreate: (libc)Hash Search Function.
  1192. * hcreate_r: (libc)Hash Search Function.
  1193. * hdestroy: (libc)Hash Search Function.
  1194. * hdestroy_r: (libc)Hash Search Function.
  1195. * hsearch: (libc)Hash Search Function.
  1196. * hsearch_r: (libc)Hash Search Function.
  1197. * htonl: (libc)Byte Order.
  1198. * htons: (libc)Byte Order.
  1199. * hypot: (libc)Exponents and Logarithms.
  1200. * hypotf: (libc)Exponents and Logarithms.
  1201. * hypotfN: (libc)Exponents and Logarithms.
  1202. * hypotfNx: (libc)Exponents and Logarithms.
  1203. * hypotl: (libc)Exponents and Logarithms.
  1204. * iconv: (libc)Generic Conversion Interface.
  1205. * iconv_close: (libc)Generic Conversion Interface.
  1206. * iconv_open: (libc)Generic Conversion Interface.
  1207. * if_freenameindex: (libc)Interface Naming.
  1208. * if_indextoname: (libc)Interface Naming.
  1209. * if_nameindex: (libc)Interface Naming.
  1210. * if_nametoindex: (libc)Interface Naming.
  1211. * ilogb: (libc)Exponents and Logarithms.
  1212. * ilogbf: (libc)Exponents and Logarithms.
  1213. * ilogbfN: (libc)Exponents and Logarithms.
  1214. * ilogbfNx: (libc)Exponents and Logarithms.
  1215. * ilogbl: (libc)Exponents and Logarithms.
  1216. * imaxabs: (libc)Absolute Value.
  1217. * imaxdiv: (libc)Integer Division.
  1218. * in6addr_any: (libc)Host Address Data Type.
  1219. * in6addr_loopback: (libc)Host Address Data Type.
  1220. * index: (libc)Search Functions.
  1221. * inet_addr: (libc)Host Address Functions.
  1222. * inet_aton: (libc)Host Address Functions.
  1223. * inet_lnaof: (libc)Host Address Functions.
  1224. * inet_makeaddr: (libc)Host Address Functions.
  1225. * inet_netof: (libc)Host Address Functions.
  1226. * inet_network: (libc)Host Address Functions.
  1227. * inet_ntoa: (libc)Host Address Functions.
  1228. * inet_ntop: (libc)Host Address Functions.
  1229. * inet_pton: (libc)Host Address Functions.
  1230. * initgroups: (libc)Setting Groups.
  1231. * initstate: (libc)BSD Random.
  1232. * initstate_r: (libc)BSD Random.
  1233. * innetgr: (libc)Netgroup Membership.
  1234. * ioctl: (libc)IOCTLs.
  1235. * isalnum: (libc)Classification of Characters.
  1236. * isalpha: (libc)Classification of Characters.
  1237. * isascii: (libc)Classification of Characters.
  1238. * isatty: (libc)Is It a Terminal.
  1239. * isblank: (libc)Classification of Characters.
  1240. * iscanonical: (libc)Floating Point Classes.
  1241. * iscntrl: (libc)Classification of Characters.
  1242. * isdigit: (libc)Classification of Characters.
  1243. * iseqsig: (libc)FP Comparison Functions.
  1244. * isfinite: (libc)Floating Point Classes.
  1245. * isgraph: (libc)Classification of Characters.
  1246. * isgreater: (libc)FP Comparison Functions.
  1247. * isgreaterequal: (libc)FP Comparison Functions.
  1248. * isinf: (libc)Floating Point Classes.
  1249. * isinff: (libc)Floating Point Classes.
  1250. * isinfl: (libc)Floating Point Classes.
  1251. * isless: (libc)FP Comparison Functions.
  1252. * islessequal: (libc)FP Comparison Functions.
  1253. * islessgreater: (libc)FP Comparison Functions.
  1254. * islower: (libc)Classification of Characters.
  1255. * isnan: (libc)Floating Point Classes.
  1256. * isnan: (libc)Floating Point Classes.
  1257. * isnanf: (libc)Floating Point Classes.
  1258. * isnanl: (libc)Floating Point Classes.
  1259. * isnormal: (libc)Floating Point Classes.
  1260. * isprint: (libc)Classification of Characters.
  1261. * ispunct: (libc)Classification of Characters.
  1262. * issignaling: (libc)Floating Point Classes.
  1263. * isspace: (libc)Classification of Characters.
  1264. * issubnormal: (libc)Floating Point Classes.
  1265. * isunordered: (libc)FP Comparison Functions.
  1266. * isupper: (libc)Classification of Characters.
  1267. * iswalnum: (libc)Classification of Wide Characters.
  1268. * iswalpha: (libc)Classification of Wide Characters.
  1269. * iswblank: (libc)Classification of Wide Characters.
  1270. * iswcntrl: (libc)Classification of Wide Characters.
  1271. * iswctype: (libc)Classification of Wide Characters.
  1272. * iswdigit: (libc)Classification of Wide Characters.
  1273. * iswgraph: (libc)Classification of Wide Characters.
  1274. * iswlower: (libc)Classification of Wide Characters.
  1275. * iswprint: (libc)Classification of Wide Characters.
  1276. * iswpunct: (libc)Classification of Wide Characters.
  1277. * iswspace: (libc)Classification of Wide Characters.
  1278. * iswupper: (libc)Classification of Wide Characters.
  1279. * iswxdigit: (libc)Classification of Wide Characters.
  1280. * isxdigit: (libc)Classification of Characters.
  1281. * iszero: (libc)Floating Point Classes.
  1282. * j0: (libc)Special Functions.
  1283. * j0f: (libc)Special Functions.
  1284. * j0fN: (libc)Special Functions.
  1285. * j0fNx: (libc)Special Functions.
  1286. * j0l: (libc)Special Functions.
  1287. * j1: (libc)Special Functions.
  1288. * j1f: (libc)Special Functions.
  1289. * j1fN: (libc)Special Functions.
  1290. * j1fNx: (libc)Special Functions.
  1291. * j1l: (libc)Special Functions.
  1292. * jn: (libc)Special Functions.
  1293. * jnf: (libc)Special Functions.
  1294. * jnfN: (libc)Special Functions.
  1295. * jnfNx: (libc)Special Functions.
  1296. * jnl: (libc)Special Functions.
  1297. * jrand48: (libc)SVID Random.
  1298. * jrand48_r: (libc)SVID Random.
  1299. * kill: (libc)Signaling Another Process.
  1300. * killpg: (libc)Signaling Another Process.
  1301. * l64a: (libc)Encode Binary Data.
  1302. * labs: (libc)Absolute Value.
  1303. * lcong48: (libc)SVID Random.
  1304. * lcong48_r: (libc)SVID Random.
  1305. * ldexp: (libc)Normalization Functions.
  1306. * ldexpf: (libc)Normalization Functions.
  1307. * ldexpfN: (libc)Normalization Functions.
  1308. * ldexpfNx: (libc)Normalization Functions.
  1309. * ldexpl: (libc)Normalization Functions.
  1310. * ldiv: (libc)Integer Division.
  1311. * lfind: (libc)Array Search Function.
  1312. * lgamma: (libc)Special Functions.
  1313. * lgamma_r: (libc)Special Functions.
  1314. * lgammaf: (libc)Special Functions.
  1315. * lgammafN: (libc)Special Functions.
  1316. * lgammafN_r: (libc)Special Functions.
  1317. * lgammafNx: (libc)Special Functions.
  1318. * lgammafNx_r: (libc)Special Functions.
  1319. * lgammaf_r: (libc)Special Functions.
  1320. * lgammal: (libc)Special Functions.
  1321. * lgammal_r: (libc)Special Functions.
  1322. * link: (libc)Hard Links.
  1323. * linkat: (libc)Hard Links.
  1324. * lio_listio64: (libc)Asynchronous Reads/Writes.
  1325. * lio_listio: (libc)Asynchronous Reads/Writes.
  1326. * listen: (libc)Listening.
  1327. * llabs: (libc)Absolute Value.
  1328. * lldiv: (libc)Integer Division.
  1329. * llogb: (libc)Exponents and Logarithms.
  1330. * llogbf: (libc)Exponents and Logarithms.
  1331. * llogbfN: (libc)Exponents and Logarithms.
  1332. * llogbfNx: (libc)Exponents and Logarithms.
  1333. * llogbl: (libc)Exponents and Logarithms.
  1334. * llrint: (libc)Rounding Functions.
  1335. * llrintf: (libc)Rounding Functions.
  1336. * llrintfN: (libc)Rounding Functions.
  1337. * llrintfNx: (libc)Rounding Functions.
  1338. * llrintl: (libc)Rounding Functions.
  1339. * llround: (libc)Rounding Functions.
  1340. * llroundf: (libc)Rounding Functions.
  1341. * llroundfN: (libc)Rounding Functions.
  1342. * llroundfNx: (libc)Rounding Functions.
  1343. * llroundl: (libc)Rounding Functions.
  1344. * localeconv: (libc)The Lame Way to Locale Data.
  1345. * localtime: (libc)Broken-down Time.
  1346. * localtime_r: (libc)Broken-down Time.
  1347. * log10: (libc)Exponents and Logarithms.
  1348. * log10f: (libc)Exponents and Logarithms.
  1349. * log10fN: (libc)Exponents and Logarithms.
  1350. * log10fNx: (libc)Exponents and Logarithms.
  1351. * log10l: (libc)Exponents and Logarithms.
  1352. * log1p: (libc)Exponents and Logarithms.
  1353. * log1pf: (libc)Exponents and Logarithms.
  1354. * log1pfN: (libc)Exponents and Logarithms.
  1355. * log1pfNx: (libc)Exponents and Logarithms.
  1356. * log1pl: (libc)Exponents and Logarithms.
  1357. * log2: (libc)Exponents and Logarithms.
  1358. * log2f: (libc)Exponents and Logarithms.
  1359. * log2fN: (libc)Exponents and Logarithms.
  1360. * log2fNx: (libc)Exponents and Logarithms.
  1361. * log2l: (libc)Exponents and Logarithms.
  1362. * log: (libc)Exponents and Logarithms.
  1363. * logb: (libc)Exponents and Logarithms.
  1364. * logbf: (libc)Exponents and Logarithms.
  1365. * logbfN: (libc)Exponents and Logarithms.
  1366. * logbfNx: (libc)Exponents and Logarithms.
  1367. * logbl: (libc)Exponents and Logarithms.
  1368. * logf: (libc)Exponents and Logarithms.
  1369. * logfN: (libc)Exponents and Logarithms.
  1370. * logfNx: (libc)Exponents and Logarithms.
  1371. * login: (libc)Logging In and Out.
  1372. * login_tty: (libc)Logging In and Out.
  1373. * logl: (libc)Exponents and Logarithms.
  1374. * logout: (libc)Logging In and Out.
  1375. * logwtmp: (libc)Logging In and Out.
  1376. * longjmp: (libc)Non-Local Details.
  1377. * lrand48: (libc)SVID Random.
  1378. * lrand48_r: (libc)SVID Random.
  1379. * lrint: (libc)Rounding Functions.
  1380. * lrintf: (libc)Rounding Functions.
  1381. * lrintfN: (libc)Rounding Functions.
  1382. * lrintfNx: (libc)Rounding Functions.
  1383. * lrintl: (libc)Rounding Functions.
  1384. * lround: (libc)Rounding Functions.
  1385. * lroundf: (libc)Rounding Functions.
  1386. * lroundfN: (libc)Rounding Functions.
  1387. * lroundfNx: (libc)Rounding Functions.
  1388. * lroundl: (libc)Rounding Functions.
  1389. * lsearch: (libc)Array Search Function.
  1390. * lseek64: (libc)File Position Primitive.
  1391. * lseek: (libc)File Position Primitive.
  1392. * lstat64: (libc)Reading Attributes.
  1393. * lstat: (libc)Reading Attributes.
  1394. * lutimes: (libc)File Times.
  1395. * madvise: (libc)Memory-mapped I/O.
  1396. * makecontext: (libc)System V contexts.
  1397. * mallinfo2: (libc)Statistics of Malloc.
  1398. * malloc: (libc)Basic Allocation.
  1399. * mallopt: (libc)Malloc Tunable Parameters.
  1400. * mblen: (libc)Non-reentrant Character Conversion.
  1401. * mbrlen: (libc)Converting a Character.
  1402. * mbrtowc: (libc)Converting a Character.
  1403. * mbsinit: (libc)Keeping the state.
  1404. * mbsnrtowcs: (libc)Converting Strings.
  1405. * mbsrtowcs: (libc)Converting Strings.
  1406. * mbstowcs: (libc)Non-reentrant String Conversion.
  1407. * mbtowc: (libc)Non-reentrant Character Conversion.
  1408. * mcheck: (libc)Heap Consistency Checking.
  1409. * memalign: (libc)Aligned Memory Blocks.
  1410. * memccpy: (libc)Copying Strings and Arrays.
  1411. * memchr: (libc)Search Functions.
  1412. * memcmp: (libc)String/Array Comparison.
  1413. * memcpy: (libc)Copying Strings and Arrays.
  1414. * memfd_create: (libc)Memory-mapped I/O.
  1415. * memfrob: (libc)Obfuscating Data.
  1416. * memmem: (libc)Search Functions.
  1417. * memmove: (libc)Copying Strings and Arrays.
  1418. * mempcpy: (libc)Copying Strings and Arrays.
  1419. * memrchr: (libc)Search Functions.
  1420. * memset: (libc)Copying Strings and Arrays.
  1421. * mkdir: (libc)Creating Directories.
  1422. * mkdtemp: (libc)Temporary Files.
  1423. * mkfifo: (libc)FIFO Special Files.
  1424. * mknod: (libc)Making Special Files.
  1425. * mkstemp: (libc)Temporary Files.
  1426. * mktemp: (libc)Temporary Files.
  1427. * mktime: (libc)Broken-down Time.
  1428. * mlock2: (libc)Page Lock Functions.
  1429. * mlock: (libc)Page Lock Functions.
  1430. * mlockall: (libc)Page Lock Functions.
  1431. * mmap64: (libc)Memory-mapped I/O.
  1432. * mmap: (libc)Memory-mapped I/O.
  1433. * modf: (libc)Rounding Functions.
  1434. * modff: (libc)Rounding Functions.
  1435. * modffN: (libc)Rounding Functions.
  1436. * modffNx: (libc)Rounding Functions.
  1437. * modfl: (libc)Rounding Functions.
  1438. * mount: (libc)Mount-Unmount-Remount.
  1439. * mprobe: (libc)Heap Consistency Checking.
  1440. * mprotect: (libc)Memory Protection.
  1441. * mrand48: (libc)SVID Random.
  1442. * mrand48_r: (libc)SVID Random.
  1443. * mremap: (libc)Memory-mapped I/O.
  1444. * msync: (libc)Memory-mapped I/O.
  1445. * mtrace: (libc)Tracing malloc.
  1446. * mtx_destroy: (libc)ISO C Mutexes.
  1447. * mtx_init: (libc)ISO C Mutexes.
  1448. * mtx_lock: (libc)ISO C Mutexes.
  1449. * mtx_timedlock: (libc)ISO C Mutexes.
  1450. * mtx_trylock: (libc)ISO C Mutexes.
  1451. * mtx_unlock: (libc)ISO C Mutexes.
  1452. * munlock: (libc)Page Lock Functions.
  1453. * munlockall: (libc)Page Lock Functions.
  1454. * munmap: (libc)Memory-mapped I/O.
  1455. * muntrace: (libc)Tracing malloc.
  1456. * nan: (libc)FP Bit Twiddling.
  1457. * nanf: (libc)FP Bit Twiddling.
  1458. * nanfN: (libc)FP Bit Twiddling.
  1459. * nanfNx: (libc)FP Bit Twiddling.
  1460. * nanl: (libc)FP Bit Twiddling.
  1461. * nanosleep: (libc)Sleeping.
  1462. * nearbyint: (libc)Rounding Functions.
  1463. * nearbyintf: (libc)Rounding Functions.
  1464. * nearbyintfN: (libc)Rounding Functions.
  1465. * nearbyintfNx: (libc)Rounding Functions.
  1466. * nearbyintl: (libc)Rounding Functions.
  1467. * nextafter: (libc)FP Bit Twiddling.
  1468. * nextafterf: (libc)FP Bit Twiddling.
  1469. * nextafterfN: (libc)FP Bit Twiddling.
  1470. * nextafterfNx: (libc)FP Bit Twiddling.
  1471. * nextafterl: (libc)FP Bit Twiddling.
  1472. * nextdown: (libc)FP Bit Twiddling.
  1473. * nextdownf: (libc)FP Bit Twiddling.
  1474. * nextdownfN: (libc)FP Bit Twiddling.
  1475. * nextdownfNx: (libc)FP Bit Twiddling.
  1476. * nextdownl: (libc)FP Bit Twiddling.
  1477. * nexttoward: (libc)FP Bit Twiddling.
  1478. * nexttowardf: (libc)FP Bit Twiddling.
  1479. * nexttowardl: (libc)FP Bit Twiddling.
  1480. * nextup: (libc)FP Bit Twiddling.
  1481. * nextupf: (libc)FP Bit Twiddling.
  1482. * nextupfN: (libc)FP Bit Twiddling.
  1483. * nextupfNx: (libc)FP Bit Twiddling.
  1484. * nextupl: (libc)FP Bit Twiddling.
  1485. * nftw64: (libc)Working with Directory Trees.
  1486. * nftw: (libc)Working with Directory Trees.
  1487. * ngettext: (libc)Advanced gettext functions.
  1488. * nice: (libc)Traditional Scheduling Functions.
  1489. * nl_langinfo: (libc)The Elegant and Fast Way.
  1490. * nrand48: (libc)SVID Random.
  1491. * nrand48_r: (libc)SVID Random.
  1492. * ntohl: (libc)Byte Order.
  1493. * ntohs: (libc)Byte Order.
  1494. * ntp_adjtime: (libc)Setting and Adjusting the Time.
  1495. * ntp_gettime: (libc)Setting and Adjusting the Time.
  1496. * obstack_1grow: (libc)Growing Objects.
  1497. * obstack_1grow_fast: (libc)Extra Fast Growing.
  1498. * obstack_alignment_mask: (libc)Obstacks Data Alignment.
  1499. * obstack_alloc: (libc)Allocation in an Obstack.
  1500. * obstack_base: (libc)Status of an Obstack.
  1501. * obstack_blank: (libc)Growing Objects.
  1502. * obstack_blank_fast: (libc)Extra Fast Growing.
  1503. * obstack_chunk_size: (libc)Obstack Chunks.
  1504. * obstack_copy0: (libc)Allocation in an Obstack.
  1505. * obstack_copy: (libc)Allocation in an Obstack.
  1506. * obstack_finish: (libc)Growing Objects.
  1507. * obstack_free: (libc)Freeing Obstack Objects.
  1508. * obstack_grow0: (libc)Growing Objects.
  1509. * obstack_grow: (libc)Growing Objects.
  1510. * obstack_init: (libc)Preparing for Obstacks.
  1511. * obstack_int_grow: (libc)Growing Objects.
  1512. * obstack_int_grow_fast: (libc)Extra Fast Growing.
  1513. * obstack_next_free: (libc)Status of an Obstack.
  1514. * obstack_object_size: (libc)Growing Objects.
  1515. * obstack_object_size: (libc)Status of an Obstack.
  1516. * obstack_printf: (libc)Dynamic Output.
  1517. * obstack_ptr_grow: (libc)Growing Objects.
  1518. * obstack_ptr_grow_fast: (libc)Extra Fast Growing.
  1519. * obstack_room: (libc)Extra Fast Growing.
  1520. * obstack_vprintf: (libc)Variable Arguments Output.
  1521. * offsetof: (libc)Structure Measurement.
  1522. * on_exit: (libc)Cleanups on Exit.
  1523. * open64: (libc)Opening and Closing Files.
  1524. * open: (libc)Opening and Closing Files.
  1525. * open_memstream: (libc)String Streams.
  1526. * opendir: (libc)Opening a Directory.
  1527. * openlog: (libc)openlog.
  1528. * openpty: (libc)Pseudo-Terminal Pairs.
  1529. * parse_printf_format: (libc)Parsing a Template String.
  1530. * pathconf: (libc)Pathconf.
  1531. * pause: (libc)Using Pause.
  1532. * pclose: (libc)Pipe to a Subprocess.
  1533. * perror: (libc)Error Messages.
  1534. * pipe: (libc)Creating a Pipe.
  1535. * pkey_alloc: (libc)Memory Protection.
  1536. * pkey_free: (libc)Memory Protection.
  1537. * pkey_get: (libc)Memory Protection.
  1538. * pkey_mprotect: (libc)Memory Protection.
  1539. * pkey_set: (libc)Memory Protection.
  1540. * popen: (libc)Pipe to a Subprocess.
  1541. * posix_fallocate64: (libc)Storage Allocation.
  1542. * posix_fallocate: (libc)Storage Allocation.
  1543. * posix_memalign: (libc)Aligned Memory Blocks.
  1544. * pow: (libc)Exponents and Logarithms.
  1545. * powf: (libc)Exponents and Logarithms.
  1546. * powfN: (libc)Exponents and Logarithms.
  1547. * powfNx: (libc)Exponents and Logarithms.
  1548. * powl: (libc)Exponents and Logarithms.
  1549. * pread64: (libc)I/O Primitives.
  1550. * pread: (libc)I/O Primitives.
  1551. * preadv2: (libc)Scatter-Gather.
  1552. * preadv64: (libc)Scatter-Gather.
  1553. * preadv64v2: (libc)Scatter-Gather.
  1554. * preadv: (libc)Scatter-Gather.
  1555. * printf: (libc)Formatted Output Functions.
  1556. * printf_size: (libc)Predefined Printf Handlers.
  1557. * printf_size_info: (libc)Predefined Printf Handlers.
  1558. * psignal: (libc)Signal Messages.
  1559. * pthread_attr_getsigmask_np: (libc)Initial Thread Signal Mask.
  1560. * pthread_attr_setsigmask_np: (libc)Initial Thread Signal Mask.
  1561. * pthread_clockjoin_np: (libc)Waiting with Explicit Clocks.
  1562. * pthread_cond_clockwait: (libc)Waiting with Explicit Clocks.
  1563. * pthread_getattr_default_np: (libc)Default Thread Attributes.
  1564. * pthread_getspecific: (libc)Thread-specific Data.
  1565. * pthread_key_create: (libc)Thread-specific Data.
  1566. * pthread_key_delete: (libc)Thread-specific Data.
  1567. * pthread_rwlock_clockrdlock: (libc)Waiting with Explicit Clocks.
  1568. * pthread_rwlock_clockwrlock: (libc)Waiting with Explicit Clocks.
  1569. * pthread_setattr_default_np: (libc)Default Thread Attributes.
  1570. * pthread_setspecific: (libc)Thread-specific Data.
  1571. * pthread_timedjoin_np: (libc)Waiting with Explicit Clocks.
  1572. * pthread_tryjoin_np: (libc)Waiting with Explicit Clocks.
  1573. * ptsname: (libc)Allocation.
  1574. * ptsname_r: (libc)Allocation.
  1575. * putc: (libc)Simple Output.
  1576. * putc_unlocked: (libc)Simple Output.
  1577. * putchar: (libc)Simple Output.
  1578. * putchar_unlocked: (libc)Simple Output.
  1579. * putenv: (libc)Environment Access.
  1580. * putpwent: (libc)Writing a User Entry.
  1581. * puts: (libc)Simple Output.
  1582. * pututline: (libc)Manipulating the Database.
  1583. * pututxline: (libc)XPG Functions.
  1584. * putw: (libc)Simple Output.
  1585. * putwc: (libc)Simple Output.
  1586. * putwc_unlocked: (libc)Simple Output.
  1587. * putwchar: (libc)Simple Output.
  1588. * putwchar_unlocked: (libc)Simple Output.
  1589. * pwrite64: (libc)I/O Primitives.
  1590. * pwrite: (libc)I/O Primitives.
  1591. * pwritev2: (libc)Scatter-Gather.
  1592. * pwritev64: (libc)Scatter-Gather.
  1593. * pwritev64v2: (libc)Scatter-Gather.
  1594. * pwritev: (libc)Scatter-Gather.
  1595. * qecvt: (libc)System V Number Conversion.
  1596. * qecvt_r: (libc)System V Number Conversion.
  1597. * qfcvt: (libc)System V Number Conversion.
  1598. * qfcvt_r: (libc)System V Number Conversion.
  1599. * qgcvt: (libc)System V Number Conversion.
  1600. * qsort: (libc)Array Sort Function.
  1601. * raise: (libc)Signaling Yourself.
  1602. * rand: (libc)ISO Random.
  1603. * rand_r: (libc)ISO Random.
  1604. * random: (libc)BSD Random.
  1605. * random_r: (libc)BSD Random.
  1606. * rawmemchr: (libc)Search Functions.
  1607. * read: (libc)I/O Primitives.
  1608. * readdir64: (libc)Reading/Closing Directory.
  1609. * readdir64_r: (libc)Reading/Closing Directory.
  1610. * readdir: (libc)Reading/Closing Directory.
  1611. * readdir_r: (libc)Reading/Closing Directory.
  1612. * readlink: (libc)Symbolic Links.
  1613. * readv: (libc)Scatter-Gather.
  1614. * realloc: (libc)Changing Block Size.
  1615. * reallocarray: (libc)Changing Block Size.
  1616. * realpath: (libc)Symbolic Links.
  1617. * recv: (libc)Receiving Data.
  1618. * recvfrom: (libc)Receiving Datagrams.
  1619. * recvmsg: (libc)Receiving Datagrams.
  1620. * regcomp: (libc)POSIX Regexp Compilation.
  1621. * regerror: (libc)Regexp Cleanup.
  1622. * regexec: (libc)Matching POSIX Regexps.
  1623. * regfree: (libc)Regexp Cleanup.
  1624. * register_printf_function: (libc)Registering New Conversions.
  1625. * remainder: (libc)Remainder Functions.
  1626. * remainderf: (libc)Remainder Functions.
  1627. * remainderfN: (libc)Remainder Functions.
  1628. * remainderfNx: (libc)Remainder Functions.
  1629. * remainderl: (libc)Remainder Functions.
  1630. * remove: (libc)Deleting Files.
  1631. * rename: (libc)Renaming Files.
  1632. * rewind: (libc)File Positioning.
  1633. * rewinddir: (libc)Random Access Directory.
  1634. * rindex: (libc)Search Functions.
  1635. * rint: (libc)Rounding Functions.
  1636. * rintf: (libc)Rounding Functions.
  1637. * rintfN: (libc)Rounding Functions.
  1638. * rintfNx: (libc)Rounding Functions.
  1639. * rintl: (libc)Rounding Functions.
  1640. * rmdir: (libc)Deleting Files.
  1641. * round: (libc)Rounding Functions.
  1642. * roundeven: (libc)Rounding Functions.
  1643. * roundevenf: (libc)Rounding Functions.
  1644. * roundevenfN: (libc)Rounding Functions.
  1645. * roundevenfNx: (libc)Rounding Functions.
  1646. * roundevenl: (libc)Rounding Functions.
  1647. * roundf: (libc)Rounding Functions.
  1648. * roundfN: (libc)Rounding Functions.
  1649. * roundfNx: (libc)Rounding Functions.
  1650. * roundl: (libc)Rounding Functions.
  1651. * rpmatch: (libc)Yes-or-No Questions.
  1652. * sbrk: (libc)Resizing the Data Segment.
  1653. * scalb: (libc)Normalization Functions.
  1654. * scalbf: (libc)Normalization Functions.
  1655. * scalbl: (libc)Normalization Functions.
  1656. * scalbln: (libc)Normalization Functions.
  1657. * scalblnf: (libc)Normalization Functions.
  1658. * scalblnfN: (libc)Normalization Functions.
  1659. * scalblnfNx: (libc)Normalization Functions.
  1660. * scalblnl: (libc)Normalization Functions.
  1661. * scalbn: (libc)Normalization Functions.
  1662. * scalbnf: (libc)Normalization Functions.
  1663. * scalbnfN: (libc)Normalization Functions.
  1664. * scalbnfNx: (libc)Normalization Functions.
  1665. * scalbnl: (libc)Normalization Functions.
  1666. * scandir64: (libc)Scanning Directory Content.
  1667. * scandir: (libc)Scanning Directory Content.
  1668. * scanf: (libc)Formatted Input Functions.
  1669. * sched_get_priority_max: (libc)Basic Scheduling Functions.
  1670. * sched_get_priority_min: (libc)Basic Scheduling Functions.
  1671. * sched_getaffinity: (libc)CPU Affinity.
  1672. * sched_getparam: (libc)Basic Scheduling Functions.
  1673. * sched_getscheduler: (libc)Basic Scheduling Functions.
  1674. * sched_rr_get_interval: (libc)Basic Scheduling Functions.
  1675. * sched_setaffinity: (libc)CPU Affinity.
  1676. * sched_setparam: (libc)Basic Scheduling Functions.
  1677. * sched_setscheduler: (libc)Basic Scheduling Functions.
  1678. * sched_yield: (libc)Basic Scheduling Functions.
  1679. * secure_getenv: (libc)Environment Access.
  1680. * seed48: (libc)SVID Random.
  1681. * seed48_r: (libc)SVID Random.
  1682. * seekdir: (libc)Random Access Directory.
  1683. * select: (libc)Waiting for I/O.
  1684. * sem_clockwait: (libc)Waiting with Explicit Clocks.
  1685. * sem_close: (libc)Semaphores.
  1686. * sem_destroy: (libc)Semaphores.
  1687. * sem_getvalue: (libc)Semaphores.
  1688. * sem_init: (libc)Semaphores.
  1689. * sem_open: (libc)Semaphores.
  1690. * sem_post: (libc)Semaphores.
  1691. * sem_timedwait: (libc)Semaphores.
  1692. * sem_trywait: (libc)Semaphores.
  1693. * sem_unlink: (libc)Semaphores.
  1694. * sem_wait: (libc)Semaphores.
  1695. * semctl: (libc)Semaphores.
  1696. * semget: (libc)Semaphores.
  1697. * semop: (libc)Semaphores.
  1698. * semtimedop: (libc)Semaphores.
  1699. * send: (libc)Sending Data.
  1700. * sendmsg: (libc)Receiving Datagrams.
  1701. * sendto: (libc)Sending Datagrams.
  1702. * setbuf: (libc)Controlling Buffering.
  1703. * setbuffer: (libc)Controlling Buffering.
  1704. * setcontext: (libc)System V contexts.
  1705. * setdomainname: (libc)Host Identification.
  1706. * setegid: (libc)Setting Groups.
  1707. * setenv: (libc)Environment Access.
  1708. * seteuid: (libc)Setting User ID.
  1709. * setfsent: (libc)fstab.
  1710. * setgid: (libc)Setting Groups.
  1711. * setgrent: (libc)Scanning All Groups.
  1712. * setgroups: (libc)Setting Groups.
  1713. * sethostent: (libc)Host Names.
  1714. * sethostid: (libc)Host Identification.
  1715. * sethostname: (libc)Host Identification.
  1716. * setitimer: (libc)Setting an Alarm.
  1717. * setjmp: (libc)Non-Local Details.
  1718. * setlinebuf: (libc)Controlling Buffering.
  1719. * setlocale: (libc)Setting the Locale.
  1720. * setlogmask: (libc)setlogmask.
  1721. * setmntent: (libc)mtab.
  1722. * setnetent: (libc)Networks Database.
  1723. * setnetgrent: (libc)Lookup Netgroup.
  1724. * setpayload: (libc)FP Bit Twiddling.
  1725. * setpayloadf: (libc)FP Bit Twiddling.
  1726. * setpayloadfN: (libc)FP Bit Twiddling.
  1727. * setpayloadfNx: (libc)FP Bit Twiddling.
  1728. * setpayloadl: (libc)FP Bit Twiddling.
  1729. * setpayloadsig: (libc)FP Bit Twiddling.
  1730. * setpayloadsigf: (libc)FP Bit Twiddling.
  1731. * setpayloadsigfN: (libc)FP Bit Twiddling.
  1732. * setpayloadsigfNx: (libc)FP Bit Twiddling.
  1733. * setpayloadsigl: (libc)FP Bit Twiddling.
  1734. * setpgid: (libc)Process Group Functions.
  1735. * setpgrp: (libc)Process Group Functions.
  1736. * setpriority: (libc)Traditional Scheduling Functions.
  1737. * setprotoent: (libc)Protocols Database.
  1738. * setpwent: (libc)Scanning All Users.
  1739. * setregid: (libc)Setting Groups.
  1740. * setreuid: (libc)Setting User ID.
  1741. * setrlimit64: (libc)Limits on Resources.
  1742. * setrlimit: (libc)Limits on Resources.
  1743. * setservent: (libc)Services Database.
  1744. * setsid: (libc)Process Group Functions.
  1745. * setsockopt: (libc)Socket Option Functions.
  1746. * setstate: (libc)BSD Random.
  1747. * setstate_r: (libc)BSD Random.
  1748. * settimeofday: (libc)Setting and Adjusting the Time.
  1749. * setuid: (libc)Setting User ID.
  1750. * setutent: (libc)Manipulating the Database.
  1751. * setutxent: (libc)XPG Functions.
  1752. * setvbuf: (libc)Controlling Buffering.
  1753. * shm_open: (libc)Memory-mapped I/O.
  1754. * shm_unlink: (libc)Memory-mapped I/O.
  1755. * shutdown: (libc)Closing a Socket.
  1756. * sigabbrev_np: (libc)Signal Messages.
  1757. * sigaction: (libc)Advanced Signal Handling.
  1758. * sigaddset: (libc)Signal Sets.
  1759. * sigaltstack: (libc)Signal Stack.
  1760. * sigblock: (libc)BSD Signal Handling.
  1761. * sigdelset: (libc)Signal Sets.
  1762. * sigdescr_np: (libc)Signal Messages.
  1763. * sigemptyset: (libc)Signal Sets.
  1764. * sigfillset: (libc)Signal Sets.
  1765. * siginterrupt: (libc)BSD Signal Handling.
  1766. * sigismember: (libc)Signal Sets.
  1767. * siglongjmp: (libc)Non-Local Exits and Signals.
  1768. * sigmask: (libc)BSD Signal Handling.
  1769. * signal: (libc)Basic Signal Handling.
  1770. * signbit: (libc)FP Bit Twiddling.
  1771. * significand: (libc)Normalization Functions.
  1772. * significandf: (libc)Normalization Functions.
  1773. * significandl: (libc)Normalization Functions.
  1774. * sigpause: (libc)BSD Signal Handling.
  1775. * sigpending: (libc)Checking for Pending Signals.
  1776. * sigprocmask: (libc)Process Signal Mask.
  1777. * sigsetjmp: (libc)Non-Local Exits and Signals.
  1778. * sigsetmask: (libc)BSD Signal Handling.
  1779. * sigstack: (libc)Signal Stack.
  1780. * sigsuspend: (libc)Sigsuspend.
  1781. * sin: (libc)Trig Functions.
  1782. * sincos: (libc)Trig Functions.
  1783. * sincosf: (libc)Trig Functions.
  1784. * sincosfN: (libc)Trig Functions.
  1785. * sincosfNx: (libc)Trig Functions.
  1786. * sincosl: (libc)Trig Functions.
  1787. * sinf: (libc)Trig Functions.
  1788. * sinfN: (libc)Trig Functions.
  1789. * sinfNx: (libc)Trig Functions.
  1790. * sinh: (libc)Hyperbolic Functions.
  1791. * sinhf: (libc)Hyperbolic Functions.
  1792. * sinhfN: (libc)Hyperbolic Functions.
  1793. * sinhfNx: (libc)Hyperbolic Functions.
  1794. * sinhl: (libc)Hyperbolic Functions.
  1795. * sinl: (libc)Trig Functions.
  1796. * sleep: (libc)Sleeping.
  1797. * snprintf: (libc)Formatted Output Functions.
  1798. * socket: (libc)Creating a Socket.
  1799. * socketpair: (libc)Socket Pairs.
  1800. * sprintf: (libc)Formatted Output Functions.
  1801. * sqrt: (libc)Exponents and Logarithms.
  1802. * sqrtf: (libc)Exponents and Logarithms.
  1803. * sqrtfN: (libc)Exponents and Logarithms.
  1804. * sqrtfNx: (libc)Exponents and Logarithms.
  1805. * sqrtl: (libc)Exponents and Logarithms.
  1806. * srand48: (libc)SVID Random.
  1807. * srand48_r: (libc)SVID Random.
  1808. * srand: (libc)ISO Random.
  1809. * srandom: (libc)BSD Random.
  1810. * srandom_r: (libc)BSD Random.
  1811. * sscanf: (libc)Formatted Input Functions.
  1812. * ssignal: (libc)Basic Signal Handling.
  1813. * stat64: (libc)Reading Attributes.
  1814. * stat: (libc)Reading Attributes.
  1815. * stime: (libc)Setting and Adjusting the Time.
  1816. * stpcpy: (libc)Copying Strings and Arrays.
  1817. * stpncpy: (libc)Truncating Strings.
  1818. * strcasecmp: (libc)String/Array Comparison.
  1819. * strcasestr: (libc)Search Functions.
  1820. * strcat: (libc)Concatenating Strings.
  1821. * strchr: (libc)Search Functions.
  1822. * strchrnul: (libc)Search Functions.
  1823. * strcmp: (libc)String/Array Comparison.
  1824. * strcoll: (libc)Collation Functions.
  1825. * strcpy: (libc)Copying Strings and Arrays.
  1826. * strcspn: (libc)Search Functions.
  1827. * strdup: (libc)Copying Strings and Arrays.
  1828. * strdupa: (libc)Copying Strings and Arrays.
  1829. * strerror: (libc)Error Messages.
  1830. * strerror_r: (libc)Error Messages.
  1831. * strerrordesc_np: (libc)Error Messages.
  1832. * strerrorname_np: (libc)Error Messages.
  1833. * strfmon: (libc)Formatting Numbers.
  1834. * strfromd: (libc)Printing of Floats.
  1835. * strfromf: (libc)Printing of Floats.
  1836. * strfromfN: (libc)Printing of Floats.
  1837. * strfromfNx: (libc)Printing of Floats.
  1838. * strfroml: (libc)Printing of Floats.
  1839. * strfry: (libc)Shuffling Bytes.
  1840. * strftime: (libc)Formatting Calendar Time.
  1841. * strlen: (libc)String Length.
  1842. * strncasecmp: (libc)String/Array Comparison.
  1843. * strncat: (libc)Truncating Strings.
  1844. * strncmp: (libc)String/Array Comparison.
  1845. * strncpy: (libc)Truncating Strings.
  1846. * strndup: (libc)Truncating Strings.
  1847. * strndupa: (libc)Truncating Strings.
  1848. * strnlen: (libc)String Length.
  1849. * strpbrk: (libc)Search Functions.
  1850. * strptime: (libc)Low-Level Time String Parsing.
  1851. * strrchr: (libc)Search Functions.
  1852. * strsep: (libc)Finding Tokens in a String.
  1853. * strsignal: (libc)Signal Messages.
  1854. * strspn: (libc)Search Functions.
  1855. * strstr: (libc)Search Functions.
  1856. * strtod: (libc)Parsing of Floats.
  1857. * strtof: (libc)Parsing of Floats.
  1858. * strtofN: (libc)Parsing of Floats.
  1859. * strtofNx: (libc)Parsing of Floats.
  1860. * strtoimax: (libc)Parsing of Integers.
  1861. * strtok: (libc)Finding Tokens in a String.
  1862. * strtok_r: (libc)Finding Tokens in a String.
  1863. * strtol: (libc)Parsing of Integers.
  1864. * strtold: (libc)Parsing of Floats.
  1865. * strtoll: (libc)Parsing of Integers.
  1866. * strtoq: (libc)Parsing of Integers.
  1867. * strtoul: (libc)Parsing of Integers.
  1868. * strtoull: (libc)Parsing of Integers.
  1869. * strtoumax: (libc)Parsing of Integers.
  1870. * strtouq: (libc)Parsing of Integers.
  1871. * strverscmp: (libc)String/Array Comparison.
  1872. * strxfrm: (libc)Collation Functions.
  1873. * stty: (libc)BSD Terminal Modes.
  1874. * swapcontext: (libc)System V contexts.
  1875. * swprintf: (libc)Formatted Output Functions.
  1876. * swscanf: (libc)Formatted Input Functions.
  1877. * symlink: (libc)Symbolic Links.
  1878. * sync: (libc)Synchronizing I/O.
  1879. * syscall: (libc)System Calls.
  1880. * sysconf: (libc)Sysconf Definition.
  1881. * syslog: (libc)syslog; vsyslog.
  1882. * system: (libc)Running a Command.
  1883. * sysv_signal: (libc)Basic Signal Handling.
  1884. * tan: (libc)Trig Functions.
  1885. * tanf: (libc)Trig Functions.
  1886. * tanfN: (libc)Trig Functions.
  1887. * tanfNx: (libc)Trig Functions.
  1888. * tanh: (libc)Hyperbolic Functions.
  1889. * tanhf: (libc)Hyperbolic Functions.
  1890. * tanhfN: (libc)Hyperbolic Functions.
  1891. * tanhfNx: (libc)Hyperbolic Functions.
  1892. * tanhl: (libc)Hyperbolic Functions.
  1893. * tanl: (libc)Trig Functions.
  1894. * tcdrain: (libc)Line Control.
  1895. * tcflow: (libc)Line Control.
  1896. * tcflush: (libc)Line Control.
  1897. * tcgetattr: (libc)Mode Functions.
  1898. * tcgetpgrp: (libc)Terminal Access Functions.
  1899. * tcgetsid: (libc)Terminal Access Functions.
  1900. * tcsendbreak: (libc)Line Control.
  1901. * tcsetattr: (libc)Mode Functions.
  1902. * tcsetpgrp: (libc)Terminal Access Functions.
  1903. * tdelete: (libc)Tree Search Function.
  1904. * tdestroy: (libc)Tree Search Function.
  1905. * telldir: (libc)Random Access Directory.
  1906. * tempnam: (libc)Temporary Files.
  1907. * textdomain: (libc)Locating gettext catalog.
  1908. * tfind: (libc)Tree Search Function.
  1909. * tgamma: (libc)Special Functions.
  1910. * tgammaf: (libc)Special Functions.
  1911. * tgammafN: (libc)Special Functions.
  1912. * tgammafNx: (libc)Special Functions.
  1913. * tgammal: (libc)Special Functions.
  1914. * tgkill: (libc)Signaling Another Process.
  1915. * thrd_create: (libc)ISO C Thread Management.
  1916. * thrd_current: (libc)ISO C Thread Management.
  1917. * thrd_detach: (libc)ISO C Thread Management.
  1918. * thrd_equal: (libc)ISO C Thread Management.
  1919. * thrd_exit: (libc)ISO C Thread Management.
  1920. * thrd_join: (libc)ISO C Thread Management.
  1921. * thrd_sleep: (libc)ISO C Thread Management.
  1922. * thrd_yield: (libc)ISO C Thread Management.
  1923. * time: (libc)Getting the Time.
  1924. * timegm: (libc)Broken-down Time.
  1925. * timelocal: (libc)Broken-down Time.
  1926. * times: (libc)Processor Time.
  1927. * tmpfile64: (libc)Temporary Files.
  1928. * tmpfile: (libc)Temporary Files.
  1929. * tmpnam: (libc)Temporary Files.
  1930. * tmpnam_r: (libc)Temporary Files.
  1931. * toascii: (libc)Case Conversion.
  1932. * tolower: (libc)Case Conversion.
  1933. * totalorder: (libc)FP Comparison Functions.
  1934. * totalorderf: (libc)FP Comparison Functions.
  1935. * totalorderfN: (libc)FP Comparison Functions.
  1936. * totalorderfNx: (libc)FP Comparison Functions.
  1937. * totalorderl: (libc)FP Comparison Functions.
  1938. * totalordermag: (libc)FP Comparison Functions.
  1939. * totalordermagf: (libc)FP Comparison Functions.
  1940. * totalordermagfN: (libc)FP Comparison Functions.
  1941. * totalordermagfNx: (libc)FP Comparison Functions.
  1942. * totalordermagl: (libc)FP Comparison Functions.
  1943. * toupper: (libc)Case Conversion.
  1944. * towctrans: (libc)Wide Character Case Conversion.
  1945. * towlower: (libc)Wide Character Case Conversion.
  1946. * towupper: (libc)Wide Character Case Conversion.
  1947. * trunc: (libc)Rounding Functions.
  1948. * truncate64: (libc)File Size.
  1949. * truncate: (libc)File Size.
  1950. * truncf: (libc)Rounding Functions.
  1951. * truncfN: (libc)Rounding Functions.
  1952. * truncfNx: (libc)Rounding Functions.
  1953. * truncl: (libc)Rounding Functions.
  1954. * tsearch: (libc)Tree Search Function.
  1955. * tss_create: (libc)ISO C Thread-local Storage.
  1956. * tss_delete: (libc)ISO C Thread-local Storage.
  1957. * tss_get: (libc)ISO C Thread-local Storage.
  1958. * tss_set: (libc)ISO C Thread-local Storage.
  1959. * ttyname: (libc)Is It a Terminal.
  1960. * ttyname_r: (libc)Is It a Terminal.
  1961. * twalk: (libc)Tree Search Function.
  1962. * twalk_r: (libc)Tree Search Function.
  1963. * tzset: (libc)Time Zone Functions.
  1964. * ufromfp: (libc)Rounding Functions.
  1965. * ufromfpf: (libc)Rounding Functions.
  1966. * ufromfpfN: (libc)Rounding Functions.
  1967. * ufromfpfNx: (libc)Rounding Functions.
  1968. * ufromfpl: (libc)Rounding Functions.
  1969. * ufromfpx: (libc)Rounding Functions.
  1970. * ufromfpxf: (libc)Rounding Functions.
  1971. * ufromfpxfN: (libc)Rounding Functions.
  1972. * ufromfpxfNx: (libc)Rounding Functions.
  1973. * ufromfpxl: (libc)Rounding Functions.
  1974. * ulimit: (libc)Limits on Resources.
  1975. * umask: (libc)Setting Permissions.
  1976. * umount2: (libc)Mount-Unmount-Remount.
  1977. * umount: (libc)Mount-Unmount-Remount.
  1978. * uname: (libc)Platform Type.
  1979. * ungetc: (libc)How Unread.
  1980. * ungetwc: (libc)How Unread.
  1981. * unlink: (libc)Deleting Files.
  1982. * unlockpt: (libc)Allocation.
  1983. * unsetenv: (libc)Environment Access.
  1984. * updwtmp: (libc)Manipulating the Database.
  1985. * utime: (libc)File Times.
  1986. * utimes: (libc)File Times.
  1987. * utmpname: (libc)Manipulating the Database.
  1988. * utmpxname: (libc)XPG Functions.
  1989. * va_arg: (libc)Argument Macros.
  1990. * va_copy: (libc)Argument Macros.
  1991. * va_end: (libc)Argument Macros.
  1992. * va_start: (libc)Argument Macros.
  1993. * valloc: (libc)Aligned Memory Blocks.
  1994. * vasprintf: (libc)Variable Arguments Output.
  1995. * verr: (libc)Error Messages.
  1996. * verrx: (libc)Error Messages.
  1997. * versionsort64: (libc)Scanning Directory Content.
  1998. * versionsort: (libc)Scanning Directory Content.
  1999. * vfork: (libc)Creating a Process.
  2000. * vfprintf: (libc)Variable Arguments Output.
  2001. * vfscanf: (libc)Variable Arguments Input.
  2002. * vfwprintf: (libc)Variable Arguments Output.
  2003. * vfwscanf: (libc)Variable Arguments Input.
  2004. * vlimit: (libc)Limits on Resources.
  2005. * vprintf: (libc)Variable Arguments Output.
  2006. * vscanf: (libc)Variable Arguments Input.
  2007. * vsnprintf: (libc)Variable Arguments Output.
  2008. * vsprintf: (libc)Variable Arguments Output.
  2009. * vsscanf: (libc)Variable Arguments Input.
  2010. * vswprintf: (libc)Variable Arguments Output.
  2011. * vswscanf: (libc)Variable Arguments Input.
  2012. * vsyslog: (libc)syslog; vsyslog.
  2013. * vwarn: (libc)Error Messages.
  2014. * vwarnx: (libc)Error Messages.
  2015. * vwprintf: (libc)Variable Arguments Output.
  2016. * vwscanf: (libc)Variable Arguments Input.
  2017. * wait3: (libc)BSD Wait Functions.
  2018. * wait4: (libc)Process Completion.
  2019. * wait: (libc)Process Completion.
  2020. * waitpid: (libc)Process Completion.
  2021. * warn: (libc)Error Messages.
  2022. * warnx: (libc)Error Messages.
  2023. * wcpcpy: (libc)Copying Strings and Arrays.
  2024. * wcpncpy: (libc)Truncating Strings.
  2025. * wcrtomb: (libc)Converting a Character.
  2026. * wcscasecmp: (libc)String/Array Comparison.
  2027. * wcscat: (libc)Concatenating Strings.
  2028. * wcschr: (libc)Search Functions.
  2029. * wcschrnul: (libc)Search Functions.
  2030. * wcscmp: (libc)String/Array Comparison.
  2031. * wcscoll: (libc)Collation Functions.
  2032. * wcscpy: (libc)Copying Strings and Arrays.
  2033. * wcscspn: (libc)Search Functions.
  2034. * wcsdup: (libc)Copying Strings and Arrays.
  2035. * wcsftime: (libc)Formatting Calendar Time.
  2036. * wcslen: (libc)String Length.
  2037. * wcsncasecmp: (libc)String/Array Comparison.
  2038. * wcsncat: (libc)Truncating Strings.
  2039. * wcsncmp: (libc)String/Array Comparison.
  2040. * wcsncpy: (libc)Truncating Strings.
  2041. * wcsnlen: (libc)String Length.
  2042. * wcsnrtombs: (libc)Converting Strings.
  2043. * wcspbrk: (libc)Search Functions.
  2044. * wcsrchr: (libc)Search Functions.
  2045. * wcsrtombs: (libc)Converting Strings.
  2046. * wcsspn: (libc)Search Functions.
  2047. * wcsstr: (libc)Search Functions.
  2048. * wcstod: (libc)Parsing of Floats.
  2049. * wcstof: (libc)Parsing of Floats.
  2050. * wcstofN: (libc)Parsing of Floats.
  2051. * wcstofNx: (libc)Parsing of Floats.
  2052. * wcstoimax: (libc)Parsing of Integers.
  2053. * wcstok: (libc)Finding Tokens in a String.
  2054. * wcstol: (libc)Parsing of Integers.
  2055. * wcstold: (libc)Parsing of Floats.
  2056. * wcstoll: (libc)Parsing of Integers.
  2057. * wcstombs: (libc)Non-reentrant String Conversion.
  2058. * wcstoq: (libc)Parsing of Integers.
  2059. * wcstoul: (libc)Parsing of Integers.
  2060. * wcstoull: (libc)Parsing of Integers.
  2061. * wcstoumax: (libc)Parsing of Integers.
  2062. * wcstouq: (libc)Parsing of Integers.
  2063. * wcswcs: (libc)Search Functions.
  2064. * wcsxfrm: (libc)Collation Functions.
  2065. * wctob: (libc)Converting a Character.
  2066. * wctomb: (libc)Non-reentrant Character Conversion.
  2067. * wctrans: (libc)Wide Character Case Conversion.
  2068. * wctype: (libc)Classification of Wide Characters.
  2069. * wmemchr: (libc)Search Functions.
  2070. * wmemcmp: (libc)String/Array Comparison.
  2071. * wmemcpy: (libc)Copying Strings and Arrays.
  2072. * wmemmove: (libc)Copying Strings and Arrays.
  2073. * wmempcpy: (libc)Copying Strings and Arrays.
  2074. * wmemset: (libc)Copying Strings and Arrays.
  2075. * wordexp: (libc)Calling Wordexp.
  2076. * wordfree: (libc)Calling Wordexp.
  2077. * wprintf: (libc)Formatted Output Functions.
  2078. * write: (libc)I/O Primitives.
  2079. * writev: (libc)Scatter-Gather.
  2080. * wscanf: (libc)Formatted Input Functions.
  2081. * y0: (libc)Special Functions.
  2082. * y0f: (libc)Special Functions.
  2083. * y0fN: (libc)Special Functions.
  2084. * y0fNx: (libc)Special Functions.
  2085. * y0l: (libc)Special Functions.
  2086. * y1: (libc)Special Functions.
  2087. * y1f: (libc)Special Functions.
  2088. * y1fN: (libc)Special Functions.
  2089. * y1fNx: (libc)Special Functions.
  2090. * y1l: (libc)Special Functions.
  2091. * yn: (libc)Special Functions.
  2092. * ynf: (libc)Special Functions.
  2093. * ynfN: (libc)Special Functions.
  2094. * ynfNx: (libc)Special Functions.
  2095. * ynl: (libc)Special Functions.
  2096. END-INFO-DIR-ENTRY
  2097. 
  2098. File: libc.info, Node: Pseudo-Random Numbers, Next: FP Function Optimizations, Prev: Errors in Math Functions, Up: Mathematics
  2099. 19.8 Pseudo-Random Numbers
  2100. ==========================
  2101. This section describes the GNU facilities for generating a series of
  2102. pseudo-random numbers. The numbers generated are not truly random;
  2103. typically, they form a sequence that repeats periodically, with a period
  2104. so large that you can ignore it for ordinary purposes. The random
  2105. number generator works by remembering a “seed” value which it uses to
  2106. compute the next random number and also to compute a new seed.
  2107. Although the generated numbers look unpredictable within one run of a
  2108. program, the sequence of numbers is _exactly the same_ from one run to
  2109. the next. This is because the initial seed is always the same. This is
  2110. convenient when you are debugging a program, but it is unhelpful if you
  2111. want the program to behave unpredictably. If you want a different
  2112. pseudo-random series each time your program runs, you must specify a
  2113. different seed each time. For ordinary purposes, basing the seed on the
  2114. current time works well. For random numbers in cryptography, *note
  2115. Unpredictable Bytes::.
  2116. You can obtain repeatable sequences of numbers on a particular
  2117. machine type by specifying the same initial seed value for the random
  2118. number generator. There is no standard meaning for a particular seed
  2119. value; the same seed, used in different C libraries or on different CPU
  2120. types, will give you different random numbers.
  2121. The GNU C Library supports the standard ISO C random number functions
  2122. plus two other sets derived from BSD and SVID. The BSD and ISO C
  2123. functions provide identical, somewhat limited functionality. If only a
  2124. small number of random bits are required, we recommend you use the ISO C
  2125. interface, ‘rand’ and ‘srand’. The SVID functions provide a more
  2126. flexible interface, which allows better random number generator
  2127. algorithms, provides more random bits (up to 48) per call, and can
  2128. provide random floating-point numbers. These functions are required by
  2129. the XPG standard and therefore will be present in all modern Unix
  2130. systems.
  2131. * Menu:
  2132. * ISO Random:: ‘rand’ and friends.
  2133. * BSD Random:: ‘random’ and friends.
  2134. * SVID Random:: ‘drand48’ and friends.
  2135. 
  2136. File: libc.info, Node: ISO Random, Next: BSD Random, Up: Pseudo-Random Numbers
  2137. 19.8.1 ISO C Random Number Functions
  2138. ------------------------------------
  2139. This section describes the random number functions that are part of the
  2140. ISO C standard.
  2141. To use these facilities, you should include the header file
  2142. ‘stdlib.h’ in your program.
  2143. -- Macro: int RAND_MAX
  2144. The value of this macro is an integer constant representing the
  2145. largest value the ‘rand’ function can return. In the GNU C
  2146. Library, it is ‘2147483647’, which is the largest signed integer
  2147. representable in 32 bits. In other libraries, it may be as low as
  2148. ‘32767’.
  2149. -- Function: int rand (void)
  2150. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  2151. POSIX Safety Concepts::.
  2152. The ‘rand’ function returns the next pseudo-random number in the
  2153. series. The value ranges from ‘0’ to ‘RAND_MAX’.
  2154. -- Function: void srand (unsigned int SEED)
  2155. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  2156. POSIX Safety Concepts::.
  2157. This function establishes SEED as the seed for a new series of
  2158. pseudo-random numbers. If you call ‘rand’ before a seed has been
  2159. established with ‘srand’, it uses the value ‘1’ as a default seed.
  2160. To produce a different pseudo-random series each time your program
  2161. is run, do ‘srand (time (0))’.
  2162. POSIX.1 extended the C standard functions to support reproducible
  2163. random numbers in multi-threaded programs. However, the extension is
  2164. badly designed and unsuitable for serious work.
  2165. -- Function: int rand_r (unsigned int *SEED)
  2166. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2167. Concepts::.
  2168. This function returns a random number in the range 0 to ‘RAND_MAX’
  2169. just as ‘rand’ does. However, all its state is stored in the SEED
  2170. argument. This means the RNG’s state can only have as many bits as
  2171. the type ‘unsigned int’ has. This is far too few to provide a good
  2172. RNG.
  2173. If your program requires a reentrant RNG, we recommend you use the
  2174. reentrant GNU extensions to the SVID random number generator. The
  2175. POSIX.1 interface should only be used when the GNU extensions are
  2176. not available.
  2177. 
  2178. File: libc.info, Node: BSD Random, Next: SVID Random, Prev: ISO Random, Up: Pseudo-Random Numbers
  2179. 19.8.2 BSD Random Number Functions
  2180. ----------------------------------
  2181. This section describes a set of random number generation functions that
  2182. are derived from BSD. There is no advantage to using these functions
  2183. with the GNU C Library; we support them for BSD compatibility only.
  2184. The prototypes for these functions are in ‘stdlib.h’.
  2185. -- Function: long int random (void)
  2186. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  2187. POSIX Safety Concepts::.
  2188. This function returns the next pseudo-random number in the
  2189. sequence. The value returned ranges from ‘0’ to ‘2147483647’.
  2190. *NB:* Temporarily this function was defined to return a ‘int32_t’
  2191. value to indicate that the return value always contains 32 bits
  2192. even if ‘long int’ is wider. The standard demands it differently.
  2193. Users must always be aware of the 32-bit limitation, though.
  2194. -- Function: void srandom (unsigned int SEED)
  2195. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  2196. POSIX Safety Concepts::.
  2197. The ‘srandom’ function sets the state of the random number
  2198. generator based on the integer SEED. If you supply a SEED value of
  2199. ‘1’, this will cause ‘random’ to reproduce the default set of
  2200. random numbers.
  2201. To produce a different set of pseudo-random numbers each time your
  2202. program runs, do ‘srandom (time (0))’.
  2203. -- Function: char * initstate (unsigned int SEED, char *STATE, size_t
  2204. SIZE)
  2205. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  2206. POSIX Safety Concepts::.
  2207. The ‘initstate’ function is used to initialize the random number
  2208. generator state. The argument STATE is an array of SIZE bytes,
  2209. used to hold the state information. It is initialized based on
  2210. SEED. The size must be between 8 and 256 bytes, and should be a
  2211. power of two. The bigger the STATE array, the better.
  2212. The return value is the previous value of the state information
  2213. array. You can use this value later as an argument to ‘setstate’
  2214. to restore that state.
  2215. -- Function: char * setstate (char *STATE)
  2216. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | *Note
  2217. POSIX Safety Concepts::.
  2218. The ‘setstate’ function restores the random number state
  2219. information STATE. The argument must have been the result of a
  2220. previous call to INITSTATE or SETSTATE.
  2221. The return value is the previous value of the state information
  2222. array. You can use this value later as an argument to ‘setstate’
  2223. to restore that state.
  2224. If the function fails the return value is ‘NULL’.
  2225. The four functions described so far in this section all work on a
  2226. state which is shared by all threads. The state is not directly
  2227. accessible to the user and can only be modified by these functions.
  2228. This makes it hard to deal with situations where each thread should have
  2229. its own pseudo-random number generator.
  2230. The GNU C Library contains four additional functions which contain
  2231. the state as an explicit parameter and therefore make it possible to
  2232. handle thread-local PRNGs. Besides this there is no difference. In
  2233. fact, the four functions already discussed are implemented internally
  2234. using the following interfaces.
  2235. The ‘stdlib.h’ header contains a definition of the following type:
  2236. -- Data Type: struct random_data
  2237. Objects of type ‘struct random_data’ contain the information
  2238. necessary to represent the state of the PRNG. Although a complete
  2239. definition of the type is present the type should be treated as
  2240. opaque.
  2241. The functions modifying the state follow exactly the already
  2242. described functions.
  2243. -- Function: int random_r (struct random_data *restrict BUF, int32_t
  2244. *restrict RESULT)
  2245. Preliminary: | MT-Safe race:buf | AS-Safe | AC-Unsafe corrupt |
  2246. *Note POSIX Safety Concepts::.
  2247. The ‘random_r’ function behaves exactly like the ‘random’ function
  2248. except that it uses and modifies the state in the object pointed to
  2249. by the first parameter instead of the global state.
  2250. -- Function: int srandom_r (unsigned int SEED, struct random_data *BUF)
  2251. Preliminary: | MT-Safe race:buf | AS-Safe | AC-Unsafe corrupt |
  2252. *Note POSIX Safety Concepts::.
  2253. The ‘srandom_r’ function behaves exactly like the ‘srandom’
  2254. function except that it uses and modifies the state in the object
  2255. pointed to by the second parameter instead of the global state.
  2256. -- Function: int initstate_r (unsigned int SEED, char *restrict
  2257. STATEBUF, size_t STATELEN, struct random_data *restrict BUF)
  2258. Preliminary: | MT-Safe race:buf | AS-Safe | AC-Unsafe corrupt |
  2259. *Note POSIX Safety Concepts::.
  2260. The ‘initstate_r’ function behaves exactly like the ‘initstate’
  2261. function except that it uses and modifies the state in the object
  2262. pointed to by the fourth parameter instead of the global state.
  2263. -- Function: int setstate_r (char *restrict STATEBUF, struct
  2264. random_data *restrict BUF)
  2265. Preliminary: | MT-Safe race:buf | AS-Safe | AC-Unsafe corrupt |
  2266. *Note POSIX Safety Concepts::.
  2267. The ‘setstate_r’ function behaves exactly like the ‘setstate’
  2268. function except that it uses and modifies the state in the object
  2269. pointed to by the first parameter instead of the global state.
  2270. 
  2271. File: libc.info, Node: SVID Random, Prev: BSD Random, Up: Pseudo-Random Numbers
  2272. 19.8.3 SVID Random Number Function
  2273. ----------------------------------
  2274. The C library on SVID systems contains yet another kind of random number
  2275. generator functions. They use a state of 48 bits of data. The user can
  2276. choose among a collection of functions which return the random bits in
  2277. different forms.
  2278. Generally there are two kinds of function. The first uses a state of
  2279. the random number generator which is shared among several functions and
  2280. by all threads of the process. The second requires the user to handle
  2281. the state.
  2282. All functions have in common that they use the same congruential
  2283. formula with the same constants. The formula is
  2284. Y = (a * X + c) mod m
  2285. where X is the state of the generator at the beginning and Y the state
  2286. at the end. ‘a’ and ‘c’ are constants determining the way the generator
  2287. works. By default they are
  2288. a = 0x5DEECE66D = 25214903917
  2289. c = 0xb = 11
  2290. but they can also be changed by the user. ‘m’ is of course 2^48 since
  2291. the state consists of a 48-bit array.
  2292. The prototypes for these functions are in ‘stdlib.h’.
  2293. -- Function: double drand48 (void)
  2294. Preliminary: | MT-Unsafe race:drand48 | AS-Unsafe | AC-Unsafe
  2295. corrupt | *Note POSIX Safety Concepts::.
  2296. This function returns a ‘double’ value in the range of ‘0.0’ to
  2297. ‘1.0’ (exclusive). The random bits are determined by the global
  2298. state of the random number generator in the C library.
  2299. Since the ‘double’ type according to IEEE 754 has a 52-bit mantissa
  2300. this means 4 bits are not initialized by the random number
  2301. generator. These are (of course) chosen to be the least
  2302. significant bits and they are initialized to ‘0’.
  2303. -- Function: double erand48 (unsigned short int XSUBI[3])
  2304. Preliminary: | MT-Unsafe race:drand48 | AS-Unsafe | AC-Unsafe
  2305. corrupt | *Note POSIX Safety Concepts::.
  2306. This function returns a ‘double’ value in the range of ‘0.0’ to
  2307. ‘1.0’ (exclusive), similarly to ‘drand48’. The argument is an
  2308. array describing the state of the random number generator.
  2309. This function can be called subsequently since it updates the array
  2310. to guarantee random numbers. The array should have been
  2311. initialized before initial use to obtain reproducible results.
  2312. -- Function: long int lrand48 (void)
  2313. Preliminary: | MT-Unsafe race:drand48 | AS-Unsafe | AC-Unsafe
  2314. corrupt | *Note POSIX Safety Concepts::.
  2315. The ‘lrand48’ function returns an integer value in the range of ‘0’
  2316. to ‘2^31’ (exclusive). Even if the size of the ‘long int’ type can
  2317. take more than 32 bits, no higher numbers are returned. The random
  2318. bits are determined by the global state of the random number
  2319. generator in the C library.
  2320. -- Function: long int nrand48 (unsigned short int XSUBI[3])
  2321. Preliminary: | MT-Unsafe race:drand48 | AS-Unsafe | AC-Unsafe
  2322. corrupt | *Note POSIX Safety Concepts::.
  2323. This function is similar to the ‘lrand48’ function in that it
  2324. returns a number in the range of ‘0’ to ‘2^31’ (exclusive) but the
  2325. state of the random number generator used to produce the random
  2326. bits is determined by the array provided as the parameter to the
  2327. function.
  2328. The numbers in the array are updated afterwards so that subsequent
  2329. calls to this function yield different results (as is expected of a
  2330. random number generator). The array should have been initialized
  2331. before the first call to obtain reproducible results.
  2332. -- Function: long int mrand48 (void)
  2333. Preliminary: | MT-Unsafe race:drand48 | AS-Unsafe | AC-Unsafe
  2334. corrupt | *Note POSIX Safety Concepts::.
  2335. The ‘mrand48’ function is similar to ‘lrand48’. The only
  2336. difference is that the numbers returned are in the range ‘-2^31’ to
  2337. ‘2^31’ (exclusive).
  2338. -- Function: long int jrand48 (unsigned short int XSUBI[3])
  2339. Preliminary: | MT-Unsafe race:drand48 | AS-Unsafe | AC-Unsafe
  2340. corrupt | *Note POSIX Safety Concepts::.
  2341. The ‘jrand48’ function is similar to ‘nrand48’. The only
  2342. difference is that the numbers returned are in the range ‘-2^31’ to
  2343. ‘2^31’ (exclusive). For the ‘xsubi’ parameter the same
  2344. requirements are necessary.
  2345. The internal state of the random number generator can be initialized
  2346. in several ways. The methods differ in the completeness of the
  2347. information provided.
  2348. -- Function: void srand48 (long int SEEDVAL)
  2349. Preliminary: | MT-Unsafe race:drand48 | AS-Unsafe | AC-Unsafe
  2350. corrupt | *Note POSIX Safety Concepts::.
  2351. The ‘srand48’ function sets the most significant 32 bits of the
  2352. internal state of the random number generator to the least
  2353. significant 32 bits of the SEEDVAL parameter. The lower 16 bits
  2354. are initialized to the value ‘0x330E’. Even if the ‘long int’ type
  2355. contains more than 32 bits only the lower 32 bits are used.
  2356. Owing to this limitation, initialization of the state of this
  2357. function is not very useful. But it makes it easy to use a
  2358. construct like ‘srand48 (time (0))’.
  2359. A side-effect of this function is that the values ‘a’ and ‘c’ from
  2360. the internal state, which are used in the congruential formula, are
  2361. reset to the default values given above. This is of importance
  2362. once the user has called the ‘lcong48’ function (see below).
  2363. -- Function: unsigned short int * seed48 (unsigned short int
  2364. SEED16V[3])
  2365. Preliminary: | MT-Unsafe race:drand48 | AS-Unsafe | AC-Unsafe
  2366. corrupt | *Note POSIX Safety Concepts::.
  2367. The ‘seed48’ function initializes all 48 bits of the state of the
  2368. internal random number generator from the contents of the parameter
  2369. SEED16V. Here the lower 16 bits of the first element of SEED16V
  2370. initialize the least significant 16 bits of the internal state, the
  2371. lower 16 bits of ‘SEED16V[1]’ initialize the mid-order 16 bits of
  2372. the state and the 16 lower bits of ‘SEED16V[2]’ initialize the most
  2373. significant 16 bits of the state.
  2374. Unlike ‘srand48’ this function lets the user initialize all 48 bits
  2375. of the state.
  2376. The value returned by ‘seed48’ is a pointer to an array containing
  2377. the values of the internal state before the change. This might be
  2378. useful to restart the random number generator at a certain state.
  2379. Otherwise the value can simply be ignored.
  2380. As for ‘srand48’, the values ‘a’ and ‘c’ from the congruential
  2381. formula are reset to the default values.
  2382. There is one more function to initialize the random number generator
  2383. which enables you to specify even more information by allowing you to
  2384. change the parameters in the congruential formula.
  2385. -- Function: void lcong48 (unsigned short int PARAM[7])
  2386. Preliminary: | MT-Unsafe race:drand48 | AS-Unsafe | AC-Unsafe
  2387. corrupt | *Note POSIX Safety Concepts::.
  2388. The ‘lcong48’ function allows the user to change the complete state
  2389. of the random number generator. Unlike ‘srand48’ and ‘seed48’,
  2390. this function also changes the constants in the congruential
  2391. formula.
  2392. From the seven elements in the array PARAM the least significant 16
  2393. bits of the entries ‘PARAM[0]’ to ‘PARAM[2]’ determine the initial
  2394. state, the least significant 16 bits of ‘PARAM[3]’ to ‘PARAM[5]’
  2395. determine the 48 bit constant ‘a’ and ‘PARAM[6]’ determines the
  2396. 16-bit value ‘c’.
  2397. All the above functions have in common that they use the global
  2398. parameters for the congruential formula. In multi-threaded programs it
  2399. might sometimes be useful to have different parameters in different
  2400. threads. For this reason all the above functions have a counterpart
  2401. which works on a description of the random number generator in the
  2402. user-supplied buffer instead of the global state.
  2403. Please note that it is no problem if several threads use the global
  2404. state if all threads use the functions which take a pointer to an array
  2405. containing the state. The random numbers are computed following the
  2406. same loop but if the state in the array is different all threads will
  2407. obtain an individual random number generator.
  2408. The user-supplied buffer must be of type ‘struct drand48_data’. This
  2409. type should be regarded as opaque and not manipulated directly.
  2410. -- Function: int drand48_r (struct drand48_data *BUFFER, double
  2411. *RESULT)
  2412. Preliminary: | MT-Safe race:buffer | AS-Safe | AC-Unsafe corrupt |
  2413. *Note POSIX Safety Concepts::.
  2414. This function is equivalent to the ‘drand48’ function with the
  2415. difference that it does not modify the global random number
  2416. generator parameters but instead the parameters in the buffer
  2417. supplied through the pointer BUFFER. The random number is returned
  2418. in the variable pointed to by RESULT.
  2419. The return value of the function indicates whether the call
  2420. succeeded. If the value is less than ‘0’ an error occurred and
  2421. ‘errno’ is set to indicate the problem.
  2422. This function is a GNU extension and should not be used in portable
  2423. programs.
  2424. -- Function: int erand48_r (unsigned short int XSUBI[3], struct
  2425. drand48_data *BUFFER, double *RESULT)
  2426. Preliminary: | MT-Safe race:buffer | AS-Safe | AC-Unsafe corrupt |
  2427. *Note POSIX Safety Concepts::.
  2428. The ‘erand48_r’ function works like ‘erand48’, but in addition it
  2429. takes an argument BUFFER which describes the random number
  2430. generator. The state of the random number generator is taken from
  2431. the ‘xsubi’ array, the parameters for the congruential formula from
  2432. the global random number generator data. The random number is
  2433. returned in the variable pointed to by RESULT.
  2434. The return value is non-negative if the call succeeded.
  2435. This function is a GNU extension and should not be used in portable
  2436. programs.
  2437. -- Function: int lrand48_r (struct drand48_data *BUFFER, long int
  2438. *RESULT)
  2439. Preliminary: | MT-Safe race:buffer | AS-Safe | AC-Unsafe corrupt |
  2440. *Note POSIX Safety Concepts::.
  2441. This function is similar to ‘lrand48’, but in addition it takes a
  2442. pointer to a buffer describing the state of the random number
  2443. generator just like ‘drand48’.
  2444. If the return value of the function is non-negative the variable
  2445. pointed to by RESULT contains the result. Otherwise an error
  2446. occurred.
  2447. This function is a GNU extension and should not be used in portable
  2448. programs.
  2449. -- Function: int nrand48_r (unsigned short int XSUBI[3], struct
  2450. drand48_data *BUFFER, long int *RESULT)
  2451. Preliminary: | MT-Safe race:buffer | AS-Safe | AC-Unsafe corrupt |
  2452. *Note POSIX Safety Concepts::.
  2453. The ‘nrand48_r’ function works like ‘nrand48’ in that it produces a
  2454. random number in the range ‘0’ to ‘2^31’. But instead of using the
  2455. global parameters for the congruential formula it uses the
  2456. information from the buffer pointed to by BUFFER. The state is
  2457. described by the values in XSUBI.
  2458. If the return value is non-negative the variable pointed to by
  2459. RESULT contains the result.
  2460. This function is a GNU extension and should not be used in portable
  2461. programs.
  2462. -- Function: int mrand48_r (struct drand48_data *BUFFER, long int
  2463. *RESULT)
  2464. Preliminary: | MT-Safe race:buffer | AS-Safe | AC-Unsafe corrupt |
  2465. *Note POSIX Safety Concepts::.
  2466. This function is similar to ‘mrand48’ but like the other reentrant
  2467. functions it uses the random number generator described by the
  2468. value in the buffer pointed to by BUFFER.
  2469. If the return value is non-negative the variable pointed to by
  2470. RESULT contains the result.
  2471. This function is a GNU extension and should not be used in portable
  2472. programs.
  2473. -- Function: int jrand48_r (unsigned short int XSUBI[3], struct
  2474. drand48_data *BUFFER, long int *RESULT)
  2475. Preliminary: | MT-Safe race:buffer | AS-Safe | AC-Unsafe corrupt |
  2476. *Note POSIX Safety Concepts::.
  2477. The ‘jrand48_r’ function is similar to ‘jrand48’. Like the other
  2478. reentrant functions of this function family it uses the
  2479. congruential formula parameters from the buffer pointed to by
  2480. BUFFER.
  2481. If the return value is non-negative the variable pointed to by
  2482. RESULT contains the result.
  2483. This function is a GNU extension and should not be used in portable
  2484. programs.
  2485. Before any of the above functions are used the buffer of type ‘struct
  2486. drand48_data’ should be initialized. The easiest way to do this is to
  2487. fill the whole buffer with null bytes, e.g. by
  2488. memset (buffer, '\0', sizeof (struct drand48_data));
  2489. Using any of the reentrant functions of this family now will
  2490. automatically initialize the random number generator to the default
  2491. values for the state and the parameters of the congruential formula.
  2492. The other possibility is to use any of the functions which explicitly
  2493. initialize the buffer. Though it might be obvious how to initialize the
  2494. buffer from looking at the parameter to the function, it is highly
  2495. recommended to use these functions since the result might not always be
  2496. what you expect.
  2497. -- Function: int srand48_r (long int SEEDVAL, struct drand48_data
  2498. *BUFFER)
  2499. Preliminary: | MT-Safe race:buffer | AS-Safe | AC-Unsafe corrupt |
  2500. *Note POSIX Safety Concepts::.
  2501. The description of the random number generator represented by the
  2502. information in BUFFER is initialized similarly to what the function
  2503. ‘srand48’ does. The state is initialized from the parameter
  2504. SEEDVAL and the parameters for the congruential formula are
  2505. initialized to their default values.
  2506. If the return value is non-negative the function call succeeded.
  2507. This function is a GNU extension and should not be used in portable
  2508. programs.
  2509. -- Function: int seed48_r (unsigned short int SEED16V[3], struct
  2510. drand48_data *BUFFER)
  2511. Preliminary: | MT-Safe race:buffer | AS-Safe | AC-Unsafe corrupt |
  2512. *Note POSIX Safety Concepts::.
  2513. This function is similar to ‘srand48_r’ but like ‘seed48’ it
  2514. initializes all 48 bits of the state from the parameter SEED16V.
  2515. If the return value is non-negative the function call succeeded.
  2516. It does not return a pointer to the previous state of the random
  2517. number generator like the ‘seed48’ function does. If the user
  2518. wants to preserve the state for a later re-run s/he can copy the
  2519. whole buffer pointed to by BUFFER.
  2520. This function is a GNU extension and should not be used in portable
  2521. programs.
  2522. -- Function: int lcong48_r (unsigned short int PARAM[7], struct
  2523. drand48_data *BUFFER)
  2524. Preliminary: | MT-Safe race:buffer | AS-Safe | AC-Unsafe corrupt |
  2525. *Note POSIX Safety Concepts::.
  2526. This function initializes all aspects of the random number
  2527. generator described in BUFFER with the data in PARAM. Here it is
  2528. especially true that the function does more than just copying the
  2529. contents of PARAM and BUFFER. More work is required and therefore
  2530. it is important to use this function rather than initializing the
  2531. random number generator directly.
  2532. If the return value is non-negative the function call succeeded.
  2533. This function is a GNU extension and should not be used in portable
  2534. programs.
  2535. 
  2536. File: libc.info, Node: FP Function Optimizations, Prev: Pseudo-Random Numbers, Up: Mathematics
  2537. 19.9 Is Fast Code or Small Code preferred?
  2538. ==========================================
  2539. If an application uses many floating point functions it is often the
  2540. case that the cost of the function calls themselves is not negligible.
  2541. Modern processors can often execute the operations themselves very fast,
  2542. but the function call disrupts the instruction pipeline.
  2543. For this reason the GNU C Library provides optimizations for many of
  2544. the frequently-used math functions. When GNU CC is used and the user
  2545. activates the optimizer, several new inline functions and macros are
  2546. defined. These new functions and macros have the same names as the
  2547. library functions and so are used instead of the latter. In the case of
  2548. inline functions the compiler will decide whether it is reasonable to
  2549. use them, and this decision is usually correct.
  2550. This means that no calls to the library functions may be necessary,
  2551. and can increase the speed of generated code significantly. The
  2552. drawback is that code size will increase, and the increase is not always
  2553. negligible.
  2554. There are two kinds of inline functions: those that give the same
  2555. result as the library functions and others that might not set ‘errno’
  2556. and might have a reduced precision and/or argument range in comparison
  2557. with the library functions. The latter inline functions are only
  2558. available if the flag ‘-ffast-math’ is given to GNU CC.
  2559. Not all hardware implements the entire IEEE 754 standard, and even if
  2560. it does there may be a substantial performance penalty for using some of
  2561. its features. For example, enabling traps on some processors forces the
  2562. FPU to run un-pipelined, which can more than double calculation time.
  2563. 
  2564. File: libc.info, Node: Arithmetic, Next: Date and Time, Prev: Mathematics, Up: Top
  2565. 20 Arithmetic Functions
  2566. ***********************
  2567. This chapter contains information about functions for doing basic
  2568. arithmetic operations, such as splitting a float into its integer and
  2569. fractional parts or retrieving the imaginary part of a complex value.
  2570. These functions are declared in the header files ‘math.h’ and
  2571. ‘complex.h’.
  2572. * Menu:
  2573. * Integers:: Basic integer types and concepts
  2574. * Integer Division:: Integer division with guaranteed rounding.
  2575. * Floating Point Numbers:: Basic concepts. IEEE 754.
  2576. * Floating Point Classes:: The five kinds of floating-point number.
  2577. * Floating Point Errors:: When something goes wrong in a calculation.
  2578. * Rounding:: Controlling how results are rounded.
  2579. * Control Functions:: Saving and restoring the FPU’s state.
  2580. * Arithmetic Functions:: Fundamental operations provided by the library.
  2581. * Complex Numbers:: The types. Writing complex constants.
  2582. * Operations on Complex:: Projection, conjugation, decomposition.
  2583. * Parsing of Numbers:: Converting strings to numbers.
  2584. * Printing of Floats:: Converting floating-point numbers to strings.
  2585. * System V Number Conversion:: An archaic way to convert numbers to strings.
  2586. 
  2587. File: libc.info, Node: Integers, Next: Integer Division, Up: Arithmetic
  2588. 20.1 Integers
  2589. =============
  2590. The C language defines several integer data types: integer, short
  2591. integer, long integer, and character, all in both signed and unsigned
  2592. varieties. The GNU C compiler extends the language to contain long long
  2593. integers as well.
  2594. The C integer types were intended to allow code to be portable among
  2595. machines with different inherent data sizes (word sizes), so each type
  2596. may have different ranges on different machines. The problem with this
  2597. is that a program often needs to be written for a particular range of
  2598. integers, and sometimes must be written for a particular size of
  2599. storage, regardless of what machine the program runs on.
  2600. To address this problem, the GNU C Library contains C type
  2601. definitions you can use to declare integers that meet your exact needs.
  2602. Because the GNU C Library header files are customized to a specific
  2603. machine, your program source code doesn’t have to be.
  2604. These ‘typedef’s are in ‘stdint.h’.
  2605. If you require that an integer be represented in exactly N bits, use
  2606. one of the following types, with the obvious mapping to bit size and
  2607. signedness:
  2608. • int8_t
  2609. • int16_t
  2610. • int32_t
  2611. • int64_t
  2612. • uint8_t
  2613. • uint16_t
  2614. • uint32_t
  2615. • uint64_t
  2616. If your C compiler and target machine do not allow integers of a
  2617. certain size, the corresponding above type does not exist.
  2618. If you don’t need a specific storage size, but want the smallest data
  2619. structure with _at least_ N bits, use one of these:
  2620. • int_least8_t
  2621. • int_least16_t
  2622. • int_least32_t
  2623. • int_least64_t
  2624. • uint_least8_t
  2625. • uint_least16_t
  2626. • uint_least32_t
  2627. • uint_least64_t
  2628. If you don’t need a specific storage size, but want the data
  2629. structure that allows the fastest access while having at least N bits
  2630. (and among data structures with the same access speed, the smallest
  2631. one), use one of these:
  2632. • int_fast8_t
  2633. • int_fast16_t
  2634. • int_fast32_t
  2635. • int_fast64_t
  2636. • uint_fast8_t
  2637. • uint_fast16_t
  2638. • uint_fast32_t
  2639. • uint_fast64_t
  2640. If you want an integer with the widest range possible on the platform
  2641. on which it is being used, use one of the following. If you use these,
  2642. you should write code that takes into account the variable size and
  2643. range of the integer.
  2644. • intmax_t
  2645. • uintmax_t
  2646. The GNU C Library also provides macros that tell you the maximum and
  2647. minimum possible values for each integer data type. The macro names
  2648. follow these examples: ‘INT32_MAX’, ‘UINT8_MAX’, ‘INT_FAST32_MIN’,
  2649. ‘INT_LEAST64_MIN’, ‘UINTMAX_MAX’, ‘INTMAX_MAX’, ‘INTMAX_MIN’. Note that
  2650. there are no macros for unsigned integer minima. These are always zero.
  2651. Similiarly, there are macros such as ‘INTMAX_WIDTH’ for the width of
  2652. these types. Those macros for integer type widths come from TS
  2653. 18661-1:2014.
  2654. There are similar macros for use with C’s built in integer types
  2655. which should come with your C compiler. These are described in *note
  2656. Data Type Measurements::.
  2657. Don’t forget you can use the C ‘sizeof’ function with any of these
  2658. data types to get the number of bytes of storage each uses.
  2659. 
  2660. File: libc.info, Node: Integer Division, Next: Floating Point Numbers, Prev: Integers, Up: Arithmetic
  2661. 20.2 Integer Division
  2662. =====================
  2663. This section describes functions for performing integer division. These
  2664. functions are redundant when GNU CC is used, because in GNU C the ‘/’
  2665. operator always rounds towards zero. But in other C implementations,
  2666. ‘/’ may round differently with negative arguments. ‘div’ and ‘ldiv’ are
  2667. useful because they specify how to round the quotient: towards zero.
  2668. The remainder has the same sign as the numerator.
  2669. These functions are specified to return a result R such that the
  2670. value ‘R.quot*DENOMINATOR + R.rem’ equals NUMERATOR.
  2671. To use these facilities, you should include the header file
  2672. ‘stdlib.h’ in your program.
  2673. -- Data Type: div_t
  2674. This is a structure type used to hold the result returned by the
  2675. ‘div’ function. It has the following members:
  2676. ‘int quot’
  2677. The quotient from the division.
  2678. ‘int rem’
  2679. The remainder from the division.
  2680. -- Function: div_t div (int NUMERATOR, int DENOMINATOR)
  2681. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2682. Concepts::.
  2683. The function ‘div’ computes the quotient and remainder from the
  2684. division of NUMERATOR by DENOMINATOR, returning the result in a
  2685. structure of type ‘div_t’.
  2686. If the result cannot be represented (as in a division by zero), the
  2687. behavior is undefined.
  2688. Here is an example, albeit not a very useful one.
  2689. div_t result;
  2690. result = div (20, -6);
  2691. Now ‘result.quot’ is ‘-3’ and ‘result.rem’ is ‘2’.
  2692. -- Data Type: ldiv_t
  2693. This is a structure type used to hold the result returned by the
  2694. ‘ldiv’ function. It has the following members:
  2695. ‘long int quot’
  2696. The quotient from the division.
  2697. ‘long int rem’
  2698. The remainder from the division.
  2699. (This is identical to ‘div_t’ except that the components are of
  2700. type ‘long int’ rather than ‘int’.)
  2701. -- Function: ldiv_t ldiv (long int NUMERATOR, long int DENOMINATOR)
  2702. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2703. Concepts::.
  2704. The ‘ldiv’ function is similar to ‘div’, except that the arguments
  2705. are of type ‘long int’ and the result is returned as a structure of
  2706. type ‘ldiv_t’.
  2707. -- Data Type: lldiv_t
  2708. This is a structure type used to hold the result returned by the
  2709. ‘lldiv’ function. It has the following members:
  2710. ‘long long int quot’
  2711. The quotient from the division.
  2712. ‘long long int rem’
  2713. The remainder from the division.
  2714. (This is identical to ‘div_t’ except that the components are of
  2715. type ‘long long int’ rather than ‘int’.)
  2716. -- Function: lldiv_t lldiv (long long int NUMERATOR, long long int
  2717. DENOMINATOR)
  2718. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2719. Concepts::.
  2720. The ‘lldiv’ function is like the ‘div’ function, but the arguments
  2721. are of type ‘long long int’ and the result is returned as a
  2722. structure of type ‘lldiv_t’.
  2723. The ‘lldiv’ function was added in ISO C99.
  2724. -- Data Type: imaxdiv_t
  2725. This is a structure type used to hold the result returned by the
  2726. ‘imaxdiv’ function. It has the following members:
  2727. ‘intmax_t quot’
  2728. The quotient from the division.
  2729. ‘intmax_t rem’
  2730. The remainder from the division.
  2731. (This is identical to ‘div_t’ except that the components are of
  2732. type ‘intmax_t’ rather than ‘int’.)
  2733. See *note Integers:: for a description of the ‘intmax_t’ type.
  2734. -- Function: imaxdiv_t imaxdiv (intmax_t NUMERATOR, intmax_t
  2735. DENOMINATOR)
  2736. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2737. Concepts::.
  2738. The ‘imaxdiv’ function is like the ‘div’ function, but the
  2739. arguments are of type ‘intmax_t’ and the result is returned as a
  2740. structure of type ‘imaxdiv_t’.
  2741. See *note Integers:: for a description of the ‘intmax_t’ type.
  2742. The ‘imaxdiv’ function was added in ISO C99.
  2743. 
  2744. File: libc.info, Node: Floating Point Numbers, Next: Floating Point Classes, Prev: Integer Division, Up: Arithmetic
  2745. 20.3 Floating Point Numbers
  2746. ===========================
  2747. Most computer hardware has support for two different kinds of numbers:
  2748. integers (...-3, -2, -1, 0, 1, 2, 3...) and floating-point numbers.
  2749. Floating-point numbers have three parts: the “mantissa”, the “exponent”,
  2750. and the “sign bit”. The real number represented by a floating-point
  2751. value is given by (s ? -1 : 1) * 2^e * M where s is the sign bit, e the
  2752. exponent, and M the mantissa. *Note Floating Point Concepts::, for
  2753. details. (It is possible to have a different “base” for the exponent,
  2754. but all modern hardware uses 2.)
  2755. Floating-point numbers can represent a finite subset of the real
  2756. numbers. While this subset is large enough for most purposes, it is
  2757. important to remember that the only reals that can be represented
  2758. exactly are rational numbers that have a terminating binary expansion
  2759. shorter than the width of the mantissa. Even simple fractions such as
  2760. 1/5 can only be approximated by floating point.
  2761. Mathematical operations and functions frequently need to produce
  2762. values that are not representable. Often these values can be
  2763. approximated closely enough for practical purposes, but sometimes they
  2764. can’t. Historically there was no way to tell when the results of a
  2765. calculation were inaccurate. Modern computers implement the IEEE 754
  2766. standard for numerical computations, which defines a framework for
  2767. indicating to the program when the results of calculation are not
  2768. trustworthy. This framework consists of a set of “exceptions” that
  2769. indicate why a result could not be represented, and the special values
  2770. “infinity” and “not a number” (NaN).
  2771. 
  2772. File: libc.info, Node: Floating Point Classes, Next: Floating Point Errors, Prev: Floating Point Numbers, Up: Arithmetic
  2773. 20.4 Floating-Point Number Classification Functions
  2774. ===================================================
  2775. ISO C99 defines macros that let you determine what sort of
  2776. floating-point number a variable holds.
  2777. -- Macro: int fpclassify (_float-type_ X)
  2778. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2779. Concepts::.
  2780. This is a generic macro which works on all floating-point types and
  2781. which returns a value of type ‘int’. The possible values are:
  2782. ‘FP_NAN’
  2783. The floating-point number X is “Not a Number” (*note Infinity
  2784. and NaN::)
  2785. ‘FP_INFINITE’
  2786. The value of X is either plus or minus infinity (*note
  2787. Infinity and NaN::)
  2788. ‘FP_ZERO’
  2789. The value of X is zero. In floating-point formats like
  2790. IEEE 754, where zero can be signed, this value is also
  2791. returned if X is negative zero.
  2792. ‘FP_SUBNORMAL’
  2793. Numbers whose absolute value is too small to be represented in
  2794. the normal format are represented in an alternate,
  2795. “denormalized” format (*note Floating Point Concepts::). This
  2796. format is less precise but can represent values closer to
  2797. zero. ‘fpclassify’ returns this value for values of X in this
  2798. alternate format.
  2799. ‘FP_NORMAL’
  2800. This value is returned for all other values of X. It
  2801. indicates that there is nothing special about the number.
  2802. ‘fpclassify’ is most useful if more than one property of a number
  2803. must be tested. There are more specific macros which only test one
  2804. property at a time. Generally these macros execute faster than
  2805. ‘fpclassify’, since there is special hardware support for them. You
  2806. should therefore use the specific macros whenever possible.
  2807. -- Macro: int iscanonical (_float-type_ X)
  2808. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2809. Concepts::.
  2810. In some floating-point formats, some values have canonical
  2811. (preferred) and noncanonical encodings (for IEEE interchange binary
  2812. formats, all encodings are canonical). This macro returns a
  2813. nonzero value if X has a canonical encoding. It is from TS
  2814. 18661-1:2014.
  2815. Note that some formats have multiple encodings of a value which are
  2816. all equally canonical; ‘iscanonical’ returns a nonzero value for
  2817. all such encodings. Also, formats may have encodings that do not
  2818. correspond to any valid value of the type. In ISO C terms these
  2819. are “trap representations”; in the GNU C Library, ‘iscanonical’
  2820. returns zero for such encodings.
  2821. -- Macro: int isfinite (_float-type_ X)
  2822. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2823. Concepts::.
  2824. This macro returns a nonzero value if X is finite: not plus or
  2825. minus infinity, and not NaN. It is equivalent to
  2826. (fpclassify (x) != FP_NAN && fpclassify (x) != FP_INFINITE)
  2827. ‘isfinite’ is implemented as a macro which accepts any
  2828. floating-point type.
  2829. -- Macro: int isnormal (_float-type_ X)
  2830. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2831. Concepts::.
  2832. This macro returns a nonzero value if X is finite and normalized.
  2833. It is equivalent to
  2834. (fpclassify (x) == FP_NORMAL)
  2835. -- Macro: int isnan (_float-type_ X)
  2836. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2837. Concepts::.
  2838. This macro returns a nonzero value if X is NaN. It is equivalent to
  2839. (fpclassify (x) == FP_NAN)
  2840. -- Macro: int issignaling (_float-type_ X)
  2841. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2842. Concepts::.
  2843. This macro returns a nonzero value if X is a signaling NaN (sNaN).
  2844. It is from TS 18661-1:2014.
  2845. -- Macro: int issubnormal (_float-type_ X)
  2846. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2847. Concepts::.
  2848. This macro returns a nonzero value if X is subnormal. It is from
  2849. TS 18661-1:2014.
  2850. -- Macro: int iszero (_float-type_ X)
  2851. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2852. Concepts::.
  2853. This macro returns a nonzero value if X is zero. It is from TS
  2854. 18661-1:2014.
  2855. Another set of floating-point classification functions was provided
  2856. by BSD. The GNU C Library also supports these functions; however, we
  2857. recommend that you use the ISO C99 macros in new code. Those are
  2858. standard and will be available more widely. Also, since they are
  2859. macros, you do not have to worry about the type of their argument.
  2860. -- Function: int isinf (double X)
  2861. -- Function: int isinff (float X)
  2862. -- Function: int isinfl (long double X)
  2863. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2864. Concepts::.
  2865. This function returns ‘-1’ if X represents negative infinity, ‘1’
  2866. if X represents positive infinity, and ‘0’ otherwise.
  2867. -- Function: int isnan (double X)
  2868. -- Function: int isnanf (float X)
  2869. -- Function: int isnanl (long double X)
  2870. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2871. Concepts::.
  2872. This function returns a nonzero value if X is a “not a number”
  2873. value, and zero otherwise.
  2874. *NB:* The ‘isnan’ macro defined by ISO C99 overrides the BSD
  2875. function. This is normally not a problem, because the two routines
  2876. behave identically. However, if you really need to get the BSD
  2877. function for some reason, you can write
  2878. (isnan) (x)
  2879. -- Function: int finite (double X)
  2880. -- Function: int finitef (float X)
  2881. -- Function: int finitel (long double X)
  2882. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2883. Concepts::.
  2884. This function returns a nonzero value if X is neither infinite nor
  2885. a “not a number” value, and zero otherwise.
  2886. *Portability Note:* The functions listed in this section are BSD
  2887. extensions.
  2888. 
  2889. File: libc.info, Node: Floating Point Errors, Next: Rounding, Prev: Floating Point Classes, Up: Arithmetic
  2890. 20.5 Errors in Floating-Point Calculations
  2891. ==========================================
  2892. * Menu:
  2893. * FP Exceptions:: IEEE 754 math exceptions and how to detect them.
  2894. * Infinity and NaN:: Special values returned by calculations.
  2895. * Status bit operations:: Checking for exceptions after the fact.
  2896. * Math Error Reporting:: How the math functions report errors.
  2897. 
  2898. File: libc.info, Node: FP Exceptions, Next: Infinity and NaN, Up: Floating Point Errors
  2899. 20.5.1 FP Exceptions
  2900. --------------------
  2901. The IEEE 754 standard defines five “exceptions” that can occur during a
  2902. calculation. Each corresponds to a particular sort of error, such as
  2903. overflow.
  2904. When exceptions occur (when exceptions are “raised”, in the language
  2905. of the standard), one of two things can happen. By default the
  2906. exception is simply noted in the floating-point “status word”, and the
  2907. program continues as if nothing had happened. The operation produces a
  2908. default value, which depends on the exception (see the table below).
  2909. Your program can check the status word to find out which exceptions
  2910. happened.
  2911. Alternatively, you can enable “traps” for exceptions. In that case,
  2912. when an exception is raised, your program will receive the ‘SIGFPE’
  2913. signal. The default action for this signal is to terminate the program.
  2914. *Note Signal Handling::, for how you can change the effect of the
  2915. signal.
  2916. The exceptions defined in IEEE 754 are:
  2917. ‘Invalid Operation’
  2918. This exception is raised if the given operands are invalid for the
  2919. operation to be performed. Examples are (see IEEE 754, section 7):
  2920. 1. Addition or subtraction: oo - oo. (But oo + oo = oo).
  2921. 2. Multiplication: 0 * oo.
  2922. 3. Division: 0/0 or oo/oo.
  2923. 4. Remainder: x REM y, where y is zero or x is infinite.
  2924. 5. Square root if the operand is less than zero. More generally,
  2925. any mathematical function evaluated outside its domain
  2926. produces this exception.
  2927. 6. Conversion of a floating-point number to an integer or decimal
  2928. string, when the number cannot be represented in the target
  2929. format (due to overflow, infinity, or NaN).
  2930. 7. Conversion of an unrecognizable input string.
  2931. 8. Comparison via predicates involving < or >, when one or other
  2932. of the operands is NaN. You can prevent this exception by
  2933. using the unordered comparison functions instead; see *note FP
  2934. Comparison Functions::.
  2935. If the exception does not trap, the result of the operation is NaN.
  2936. ‘Division by Zero’
  2937. This exception is raised when a finite nonzero number is divided by
  2938. zero. If no trap occurs the result is either +oo or -oo, depending
  2939. on the signs of the operands.
  2940. ‘Overflow’
  2941. This exception is raised whenever the result cannot be represented
  2942. as a finite value in the precision format of the destination. If
  2943. no trap occurs the result depends on the sign of the intermediate
  2944. result and the current rounding mode (IEEE 754, section 7.3):
  2945. 1. Round to nearest carries all overflows to oo with the sign of
  2946. the intermediate result.
  2947. 2. Round toward 0 carries all overflows to the largest
  2948. representable finite number with the sign of the intermediate
  2949. result.
  2950. 3. Round toward -oo carries positive overflows to the largest
  2951. representable finite number and negative overflows to -oo.
  2952. 4. Round toward oo carries negative overflows to the most
  2953. negative representable finite number and positive overflows to
  2954. oo.
  2955. Whenever the overflow exception is raised, the inexact exception is
  2956. also raised.
  2957. ‘Underflow’
  2958. The underflow exception is raised when an intermediate result is
  2959. too small to be calculated accurately, or if the operation’s result
  2960. rounded to the destination precision is too small to be normalized.
  2961. When no trap is installed for the underflow exception, underflow is
  2962. signaled (via the underflow flag) only when both tininess and loss
  2963. of accuracy have been detected. If no trap handler is installed
  2964. the operation continues with an imprecise small value, or zero if
  2965. the destination precision cannot hold the small exact result.
  2966. ‘Inexact’
  2967. This exception is signalled if a rounded result is not exact (such
  2968. as when calculating the square root of two) or a result overflows
  2969. without an overflow trap.
  2970. 
  2971. File: libc.info, Node: Infinity and NaN, Next: Status bit operations, Prev: FP Exceptions, Up: Floating Point Errors
  2972. 20.5.2 Infinity and NaN
  2973. -----------------------
  2974. IEEE 754 floating point numbers can represent positive or negative
  2975. infinity, and “NaN” (not a number). These three values arise from
  2976. calculations whose result is undefined or cannot be represented
  2977. accurately. You can also deliberately set a floating-point variable to
  2978. any of them, which is sometimes useful. Some examples of calculations
  2979. that produce infinity or NaN:
  2980. 1/0 = oo
  2981. log (0) = -oo
  2982. sqrt (-1) = NaN
  2983. When a calculation produces any of these values, an exception also
  2984. occurs; see *note FP Exceptions::.
  2985. The basic operations and math functions all accept infinity and NaN
  2986. and produce sensible output. Infinities propagate through calculations
  2987. as one would expect: for example, 2 + oo = oo, 4/oo = 0, atan (oo) =
  2988. pi/2. NaN, on the other hand, infects any calculation that involves it.
  2989. Unless the calculation would produce the same result no matter what real
  2990. value replaced NaN, the result is NaN.
  2991. In comparison operations, positive infinity is larger than all values
  2992. except itself and NaN, and negative infinity is smaller than all values
  2993. except itself and NaN. NaN is “unordered”: it is not equal to, greater
  2994. than, or less than anything, _including itself_. ‘x == x’ is false if
  2995. the value of ‘x’ is NaN. You can use this to test whether a value is NaN
  2996. or not, but the recommended way to test for NaN is with the ‘isnan’
  2997. function (*note Floating Point Classes::). In addition, ‘<’, ‘>’, ‘<=’,
  2998. and ‘>=’ will raise an exception when applied to NaNs.
  2999. ‘math.h’ defines macros that allow you to explicitly set a variable
  3000. to infinity or NaN.
  3001. -- Macro: float INFINITY
  3002. An expression representing positive infinity. It is equal to the
  3003. value produced by mathematical operations like ‘1.0 / 0.0’.
  3004. ‘-INFINITY’ represents negative infinity.
  3005. You can test whether a floating-point value is infinite by
  3006. comparing it to this macro. However, this is not recommended; you
  3007. should use the ‘isfinite’ macro instead. *Note Floating Point
  3008. Classes::.
  3009. This macro was introduced in the ISO C99 standard.
  3010. -- Macro: float NAN
  3011. An expression representing a value which is “not a number”. This
  3012. macro is a GNU extension, available only on machines that support
  3013. the “not a number” value—that is to say, on all machines that
  3014. support IEEE floating point.
  3015. You can use ‘#ifdef NAN’ to test whether the machine supports NaN.
  3016. (Of course, you must arrange for GNU extensions to be visible, such
  3017. as by defining ‘_GNU_SOURCE’, and then you must include ‘math.h’.)
  3018. -- Macro: float SNANF
  3019. -- Macro: double SNAN
  3020. -- Macro: long double SNANL
  3021. -- Macro: _FloatN SNANFN
  3022. -- Macro: _FloatNx SNANFNx
  3023. These macros, defined by TS 18661-1:2014 and TS 18661-3:2015, are
  3024. constant expressions for signaling NaNs.
  3025. -- Macro: int FE_SNANS_ALWAYS_SIGNAL
  3026. This macro, defined by TS 18661-1:2014, is defined to ‘1’ in
  3027. ‘fenv.h’ to indicate that functions and operations with signaling
  3028. NaN inputs and floating-point results always raise the invalid
  3029. exception and return a quiet NaN, even in cases (such as ‘fmax’,
  3030. ‘hypot’ and ‘pow’) where a quiet NaN input can produce a non-NaN
  3031. result. Because some compiler optimizations may not handle
  3032. signaling NaNs correctly, this macro is only defined if compiler
  3033. support for signaling NaNs is enabled. That support can be enabled
  3034. with the GCC option ‘-fsignaling-nans’.
  3035. IEEE 754 also allows for another unusual value: negative zero. This
  3036. value is produced when you divide a positive number by negative
  3037. infinity, or when a negative result is smaller than the limits of
  3038. representation.
  3039. 
  3040. File: libc.info, Node: Status bit operations, Next: Math Error Reporting, Prev: Infinity and NaN, Up: Floating Point Errors
  3041. 20.5.3 Examining the FPU status word
  3042. ------------------------------------
  3043. ISO C99 defines functions to query and manipulate the floating-point
  3044. status word. You can use these functions to check for untrapped
  3045. exceptions when it’s convenient, rather than worrying about them in the
  3046. middle of a calculation.
  3047. These constants represent the various IEEE 754 exceptions. Not all
  3048. FPUs report all the different exceptions. Each constant is defined if
  3049. and only if the FPU you are compiling for supports that exception, so
  3050. you can test for FPU support with ‘#ifdef’. They are defined in
  3051. ‘fenv.h’.
  3052. ‘FE_INEXACT’
  3053. The inexact exception.
  3054. ‘FE_DIVBYZERO’
  3055. The divide by zero exception.
  3056. ‘FE_UNDERFLOW’
  3057. The underflow exception.
  3058. ‘FE_OVERFLOW’
  3059. The overflow exception.
  3060. ‘FE_INVALID’
  3061. The invalid exception.
  3062. The macro ‘FE_ALL_EXCEPT’ is the bitwise OR of all exception macros
  3063. which are supported by the FP implementation.
  3064. These functions allow you to clear exception flags, test for
  3065. exceptions, and save and restore the set of exceptions flagged.
  3066. -- Function: int feclearexcept (int EXCEPTS)
  3067. Preliminary: | MT-Safe | AS-Safe !posix | AC-Safe !posix | *Note
  3068. POSIX Safety Concepts::.
  3069. This function clears all of the supported exception flags indicated
  3070. by EXCEPTS.
  3071. The function returns zero in case the operation was successful, a
  3072. non-zero value otherwise.
  3073. -- Function: int feraiseexcept (int EXCEPTS)
  3074. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3075. Concepts::.
  3076. This function raises the supported exceptions indicated by EXCEPTS.
  3077. If more than one exception bit in EXCEPTS is set the order in which
  3078. the exceptions are raised is undefined except that overflow
  3079. (‘FE_OVERFLOW’) or underflow (‘FE_UNDERFLOW’) are raised before
  3080. inexact (‘FE_INEXACT’). Whether for overflow or underflow the
  3081. inexact exception is also raised is also implementation dependent.
  3082. The function returns zero in case the operation was successful, a
  3083. non-zero value otherwise.
  3084. -- Function: int fesetexcept (int EXCEPTS)
  3085. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3086. Concepts::.
  3087. This function sets the supported exception flags indicated by
  3088. EXCEPTS, like ‘feraiseexcept’, but without causing enabled traps to
  3089. be taken. ‘fesetexcept’ is from TS 18661-1:2014.
  3090. The function returns zero in case the operation was successful, a
  3091. non-zero value otherwise.
  3092. -- Function: int fetestexcept (int EXCEPTS)
  3093. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3094. Concepts::.
  3095. Test whether the exception flags indicated by the parameter EXCEPT
  3096. are currently set. If any of them are, a nonzero value is returned
  3097. which specifies which exceptions are set. Otherwise the result is
  3098. zero.
  3099. To understand these functions, imagine that the status word is an
  3100. integer variable named STATUS. ‘feclearexcept’ is then equivalent to
  3101. ‘status &= ~excepts’ and ‘fetestexcept’ is equivalent to ‘(status &
  3102. excepts)’. The actual implementation may be very different, of course.
  3103. Exception flags are only cleared when the program explicitly requests
  3104. it, by calling ‘feclearexcept’. If you want to check for exceptions
  3105. from a set of calculations, you should clear all the flags first. Here
  3106. is a simple example of the way to use ‘fetestexcept’:
  3107. {
  3108. double f;
  3109. int raised;
  3110. feclearexcept (FE_ALL_EXCEPT);
  3111. f = compute ();
  3112. raised = fetestexcept (FE_OVERFLOW | FE_INVALID);
  3113. if (raised & FE_OVERFLOW) { /* ... */ }
  3114. if (raised & FE_INVALID) { /* ... */ }
  3115. /* ... */
  3116. }
  3117. You cannot explicitly set bits in the status word. You can, however,
  3118. save the entire status word and restore it later. This is done with the
  3119. following functions:
  3120. -- Function: int fegetexceptflag (fexcept_t *FLAGP, int EXCEPTS)
  3121. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3122. Concepts::.
  3123. This function stores in the variable pointed to by FLAGP an
  3124. implementation-defined value representing the current setting of
  3125. the exception flags indicated by EXCEPTS.
  3126. The function returns zero in case the operation was successful, a
  3127. non-zero value otherwise.
  3128. -- Function: int fesetexceptflag (const fexcept_t *FLAGP, int EXCEPTS)
  3129. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3130. Concepts::.
  3131. This function restores the flags for the exceptions indicated by
  3132. EXCEPTS to the values stored in the variable pointed to by FLAGP.
  3133. The function returns zero in case the operation was successful, a
  3134. non-zero value otherwise.
  3135. Note that the value stored in ‘fexcept_t’ bears no resemblance to the
  3136. bit mask returned by ‘fetestexcept’. The type may not even be an
  3137. integer. Do not attempt to modify an ‘fexcept_t’ variable.
  3138. -- Function: int fetestexceptflag (const fexcept_t *FLAGP, int EXCEPTS)
  3139. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3140. Concepts::.
  3141. Test whether the exception flags indicated by the parameter EXCEPTS
  3142. are set in the variable pointed to by FLAGP. If any of them are, a
  3143. nonzero value is returned which specifies which exceptions are set.
  3144. Otherwise the result is zero. ‘fetestexceptflag’ is from TS
  3145. 18661-1:2014.
  3146. 
  3147. File: libc.info, Node: Math Error Reporting, Prev: Status bit operations, Up: Floating Point Errors
  3148. 20.5.4 Error Reporting by Mathematical Functions
  3149. ------------------------------------------------
  3150. Many of the math functions are defined only over a subset of the real or
  3151. complex numbers. Even if they are mathematically defined, their result
  3152. may be larger or smaller than the range representable by their return
  3153. type without loss of accuracy. These are known as “domain errors”,
  3154. “overflows”, and “underflows”, respectively. Math functions do several
  3155. things when one of these errors occurs. In this manual we will refer to
  3156. the complete response as “signalling” a domain error, overflow, or
  3157. underflow.
  3158. When a math function suffers a domain error, it raises the invalid
  3159. exception and returns NaN. It also sets ‘errno’ to ‘EDOM’; this is for
  3160. compatibility with old systems that do not support IEEE 754 exception
  3161. handling. Likewise, when overflow occurs, math functions raise the
  3162. overflow exception and, in the default rounding mode, return oo or -oo
  3163. as appropriate (in other rounding modes, the largest finite value of the
  3164. appropriate sign is returned when appropriate for that rounding mode).
  3165. They also set ‘errno’ to ‘ERANGE’ if returning oo or -oo; ‘errno’ may or
  3166. may not be set to ‘ERANGE’ when a finite value is returned on overflow.
  3167. When underflow occurs, the underflow exception is raised, and zero
  3168. (appropriately signed) or a subnormal value, as appropriate for the
  3169. mathematical result of the function and the rounding mode, is returned.
  3170. ‘errno’ may be set to ‘ERANGE’, but this is not guaranteed; it is
  3171. intended that the GNU C Library should set it when the underflow is to
  3172. an appropriately signed zero, but not necessarily for other underflows.
  3173. When a math function has an argument that is a signaling NaN, the GNU
  3174. C Library does not consider this a domain error, so ‘errno’ is
  3175. unchanged, but the invalid exception is still raised (except for a few
  3176. functions that are specified to handle signaling NaNs differently).
  3177. Some of the math functions are defined mathematically to result in a
  3178. complex value over parts of their domains. The most familiar example of
  3179. this is taking the square root of a negative number. The complex math
  3180. functions, such as ‘csqrt’, will return the appropriate complex value in
  3181. this case. The real-valued functions, such as ‘sqrt’, will signal a
  3182. domain error.
  3183. Some older hardware does not support infinities. On that hardware,
  3184. overflows instead return a particular very large number (usually the
  3185. largest representable number). ‘math.h’ defines macros you can use to
  3186. test for overflow on both old and new hardware.
  3187. -- Macro: double HUGE_VAL
  3188. -- Macro: float HUGE_VALF
  3189. -- Macro: long double HUGE_VALL
  3190. -- Macro: _FloatN HUGE_VAL_FN
  3191. -- Macro: _FloatNx HUGE_VAL_FNx
  3192. An expression representing a particular very large number. On
  3193. machines that use IEEE 754 floating point format, ‘HUGE_VAL’ is
  3194. infinity. On other machines, it’s typically the largest positive
  3195. number that can be represented.
  3196. Mathematical functions return the appropriately typed version of
  3197. ‘HUGE_VAL’ or ‘−HUGE_VAL’ when the result is too large to be
  3198. represented.
  3199. 
  3200. File: libc.info, Node: Rounding, Next: Control Functions, Prev: Floating Point Errors, Up: Arithmetic
  3201. 20.6 Rounding Modes
  3202. ===================
  3203. Floating-point calculations are carried out internally with extra
  3204. precision, and then rounded to fit into the destination type. This
  3205. ensures that results are as precise as the input data. IEEE 754 defines
  3206. four possible rounding modes:
  3207. Round to nearest.
  3208. This is the default mode. It should be used unless there is a
  3209. specific need for one of the others. In this mode results are
  3210. rounded to the nearest representable value. If the result is
  3211. midway between two representable values, the even representable is
  3212. chosen. “Even” here means the lowest-order bit is zero. This
  3213. rounding mode prevents statistical bias and guarantees numeric
  3214. stability: round-off errors in a lengthy calculation will remain
  3215. smaller than half of ‘FLT_EPSILON’.
  3216. Round toward plus Infinity.
  3217. All results are rounded to the smallest representable value which
  3218. is greater than the result.
  3219. Round toward minus Infinity.
  3220. All results are rounded to the largest representable value which is
  3221. less than the result.
  3222. Round toward zero.
  3223. All results are rounded to the largest representable value whose
  3224. magnitude is less than that of the result. In other words, if the
  3225. result is negative it is rounded up; if it is positive, it is
  3226. rounded down.
  3227. ‘fenv.h’ defines constants which you can use to refer to the various
  3228. rounding modes. Each one will be defined if and only if the FPU
  3229. supports the corresponding rounding mode.
  3230. ‘FE_TONEAREST’
  3231. Round to nearest.
  3232. ‘FE_UPWARD’
  3233. Round toward +oo.
  3234. ‘FE_DOWNWARD’
  3235. Round toward -oo.
  3236. ‘FE_TOWARDZERO’
  3237. Round toward zero.
  3238. Underflow is an unusual case. Normally, IEEE 754 floating point
  3239. numbers are always normalized (*note Floating Point Concepts::).
  3240. Numbers smaller than 2^r (where r is the minimum exponent,
  3241. ‘FLT_MIN_RADIX-1’ for FLOAT) cannot be represented as normalized
  3242. numbers. Rounding all such numbers to zero or 2^r would cause some
  3243. algorithms to fail at 0. Therefore, they are left in denormalized form.
  3244. That produces loss of precision, since some bits of the mantissa are
  3245. stolen to indicate the decimal point.
  3246. If a result is too small to be represented as a denormalized number,
  3247. it is rounded to zero. However, the sign of the result is preserved; if
  3248. the calculation was negative, the result is “negative zero”. Negative
  3249. zero can also result from some operations on infinity, such as 4/-oo.
  3250. At any time, one of the above four rounding modes is selected. You
  3251. can find out which one with this function:
  3252. -- Function: int fegetround (void)
  3253. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3254. Concepts::.
  3255. Returns the currently selected rounding mode, represented by one of
  3256. the values of the defined rounding mode macros.
  3257. To change the rounding mode, use this function:
  3258. -- Function: int fesetround (int ROUND)
  3259. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3260. Concepts::.
  3261. Changes the currently selected rounding mode to ROUND. If ROUND
  3262. does not correspond to one of the supported rounding modes nothing
  3263. is changed. ‘fesetround’ returns zero if it changed the rounding
  3264. mode, or a nonzero value if the mode is not supported.
  3265. You should avoid changing the rounding mode if possible. It can be
  3266. an expensive operation; also, some hardware requires you to compile your
  3267. program differently for it to work. The resulting code may run slower.
  3268. See your compiler documentation for details.
  3269. 
  3270. File: libc.info, Node: Control Functions, Next: Arithmetic Functions, Prev: Rounding, Up: Arithmetic
  3271. 20.7 Floating-Point Control Functions
  3272. =====================================
  3273. IEEE 754 floating-point implementations allow the programmer to decide
  3274. whether traps will occur for each of the exceptions, by setting bits in
  3275. the “control word”. In C, traps result in the program receiving the
  3276. ‘SIGFPE’ signal; see *note Signal Handling::.
  3277. *NB:* IEEE 754 says that trap handlers are given details of the
  3278. exceptional situation, and can set the result value. C signals do not
  3279. provide any mechanism to pass this information back and forth. Trapping
  3280. exceptions in C is therefore not very useful.
  3281. It is sometimes necessary to save the state of the floating-point
  3282. unit while you perform some calculation. The library provides functions
  3283. which save and restore the exception flags, the set of exceptions that
  3284. generate traps, and the rounding mode. This information is known as the
  3285. “floating-point environment”.
  3286. The functions to save and restore the floating-point environment all
  3287. use a variable of type ‘fenv_t’ to store information. This type is
  3288. defined in ‘fenv.h’. Its size and contents are implementation-defined.
  3289. You should not attempt to manipulate a variable of this type directly.
  3290. To save the state of the FPU, use one of these functions:
  3291. -- Function: int fegetenv (fenv_t *ENVP)
  3292. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3293. Concepts::.
  3294. Store the floating-point environment in the variable pointed to by
  3295. ENVP.
  3296. The function returns zero in case the operation was successful, a
  3297. non-zero value otherwise.
  3298. -- Function: int feholdexcept (fenv_t *ENVP)
  3299. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3300. Concepts::.
  3301. Store the current floating-point environment in the object pointed
  3302. to by ENVP. Then clear all exception flags, and set the FPU to
  3303. trap no exceptions. Not all FPUs support trapping no exceptions;
  3304. if ‘feholdexcept’ cannot set this mode, it returns nonzero value.
  3305. If it succeeds, it returns zero.
  3306. The functions which restore the floating-point environment can take
  3307. these kinds of arguments:
  3308. • Pointers to ‘fenv_t’ objects, which were initialized previously by
  3309. a call to ‘fegetenv’ or ‘feholdexcept’.
  3310. • The special macro ‘FE_DFL_ENV’ which represents the floating-point
  3311. environment as it was available at program start.
  3312. • Implementation defined macros with names starting with ‘FE_’ and
  3313. having type ‘fenv_t *’.
  3314. If possible, the GNU C Library defines a macro ‘FE_NOMASK_ENV’
  3315. which represents an environment where every exception raised causes
  3316. a trap to occur. You can test for this macro using ‘#ifdef’. It
  3317. is only defined if ‘_GNU_SOURCE’ is defined.
  3318. Some platforms might define other predefined environments.
  3319. To set the floating-point environment, you can use either of these
  3320. functions:
  3321. -- Function: int fesetenv (const fenv_t *ENVP)
  3322. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3323. Concepts::.
  3324. Set the floating-point environment to that described by ENVP.
  3325. The function returns zero in case the operation was successful, a
  3326. non-zero value otherwise.
  3327. -- Function: int feupdateenv (const fenv_t *ENVP)
  3328. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3329. Concepts::.
  3330. Like ‘fesetenv’, this function sets the floating-point environment
  3331. to that described by ENVP. However, if any exceptions were flagged
  3332. in the status word before ‘feupdateenv’ was called, they remain
  3333. flagged after the call. In other words, after ‘feupdateenv’ is
  3334. called, the status word is the bitwise OR of the previous status
  3335. word and the one saved in ENVP.
  3336. The function returns zero in case the operation was successful, a
  3337. non-zero value otherwise.
  3338. TS 18661-1:2014 defines additional functions to save and restore
  3339. floating-point control modes (such as the rounding mode and whether
  3340. traps are enabled) while leaving other status (such as raised flags)
  3341. unchanged.
  3342. The special macro ‘FE_DFL_MODE’ may be passed to ‘fesetmode’. It
  3343. represents the floating-point control modes at program start.
  3344. -- Function: int fegetmode (femode_t *MODEP)
  3345. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3346. Concepts::.
  3347. Store the floating-point control modes in the variable pointed to
  3348. by MODEP.
  3349. The function returns zero in case the operation was successful, a
  3350. non-zero value otherwise.
  3351. -- Function: int fesetmode (const femode_t *MODEP)
  3352. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3353. Concepts::.
  3354. Set the floating-point control modes to those described by MODEP.
  3355. The function returns zero in case the operation was successful, a
  3356. non-zero value otherwise.
  3357. To control for individual exceptions if raising them causes a trap to
  3358. occur, you can use the following two functions.
  3359. *Portability Note:* These functions are all GNU extensions.
  3360. -- Function: int feenableexcept (int EXCEPTS)
  3361. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3362. Concepts::.
  3363. This function enables traps for each of the exceptions as indicated
  3364. by the parameter EXCEPTS. The individual exceptions are described
  3365. in *note Status bit operations::. Only the specified exceptions
  3366. are enabled, the status of the other exceptions is not changed.
  3367. The function returns the previous enabled exceptions in case the
  3368. operation was successful, ‘-1’ otherwise.
  3369. -- Function: int fedisableexcept (int EXCEPTS)
  3370. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3371. Concepts::.
  3372. This function disables traps for each of the exceptions as
  3373. indicated by the parameter EXCEPTS. The individual exceptions are
  3374. described in *note Status bit operations::. Only the specified
  3375. exceptions are disabled, the status of the other exceptions is not
  3376. changed.
  3377. The function returns the previous enabled exceptions in case the
  3378. operation was successful, ‘-1’ otherwise.
  3379. -- Function: int fegetexcept (void)
  3380. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3381. Concepts::.
  3382. The function returns a bitmask of all currently enabled exceptions.
  3383. It returns ‘-1’ in case of failure.
  3384. 
  3385. File: libc.info, Node: Arithmetic Functions, Next: Complex Numbers, Prev: Control Functions, Up: Arithmetic
  3386. 20.8 Arithmetic Functions
  3387. =========================
  3388. The C library provides functions to do basic operations on
  3389. floating-point numbers. These include absolute value, maximum and
  3390. minimum, normalization, bit twiddling, rounding, and a few others.
  3391. * Menu:
  3392. * Absolute Value:: Absolute values of integers and floats.
  3393. * Normalization Functions:: Extracting exponents and putting them back.
  3394. * Rounding Functions:: Rounding floats to integers.
  3395. * Remainder Functions:: Remainders on division, precisely defined.
  3396. * FP Bit Twiddling:: Sign bit adjustment. Adding epsilon.
  3397. * FP Comparison Functions:: Comparisons without risk of exceptions.
  3398. * Misc FP Arithmetic:: Max, min, positive difference, multiply-add.
  3399. 
  3400. File: libc.info, Node: Absolute Value, Next: Normalization Functions, Up: Arithmetic Functions
  3401. 20.8.1 Absolute Value
  3402. ---------------------
  3403. These functions are provided for obtaining the “absolute value” (or
  3404. “magnitude”) of a number. The absolute value of a real number X is X if
  3405. X is positive, −X if X is negative. For a complex number Z, whose real
  3406. part is X and whose imaginary part is Y, the absolute value is
  3407. ‘sqrt (X*X + Y*Y)’.
  3408. Prototypes for ‘abs’, ‘labs’ and ‘llabs’ are in ‘stdlib.h’; ‘imaxabs’
  3409. is declared in ‘inttypes.h’; the ‘fabs’ functions are declared in
  3410. ‘math.h’; the ‘cabs’ functions are declared in ‘complex.h’.
  3411. -- Function: int abs (int NUMBER)
  3412. -- Function: long int labs (long int NUMBER)
  3413. -- Function: long long int llabs (long long int NUMBER)
  3414. -- Function: intmax_t imaxabs (intmax_t NUMBER)
  3415. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3416. Concepts::.
  3417. These functions return the absolute value of NUMBER.
  3418. Most computers use a two’s complement integer representation, in
  3419. which the absolute value of ‘INT_MIN’ (the smallest possible ‘int’)
  3420. cannot be represented; thus, ‘abs (INT_MIN)’ is not defined.
  3421. ‘llabs’ and ‘imaxdiv’ are new to ISO C99.
  3422. See *note Integers:: for a description of the ‘intmax_t’ type.
  3423. -- Function: double fabs (double NUMBER)
  3424. -- Function: float fabsf (float NUMBER)
  3425. -- Function: long double fabsl (long double NUMBER)
  3426. -- Function: _FloatN fabsfN (_FloatN NUMBER)
  3427. -- Function: _FloatNx fabsfNx (_FloatNx NUMBER)
  3428. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3429. Concepts::.
  3430. This function returns the absolute value of the floating-point
  3431. number NUMBER.
  3432. -- Function: double cabs (complex double Z)
  3433. -- Function: float cabsf (complex float Z)
  3434. -- Function: long double cabsl (complex long double Z)
  3435. -- Function: _FloatN cabsfN (complex _FloatN Z)
  3436. -- Function: _FloatNx cabsfNx (complex _FloatNx Z)
  3437. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3438. Concepts::.
  3439. These functions return the absolute value of the complex number Z
  3440. (*note Complex Numbers::). The absolute value of a complex number
  3441. is:
  3442. sqrt (creal (Z) * creal (Z) + cimag (Z) * cimag (Z))
  3443. This function should always be used instead of the direct formula
  3444. because it takes special care to avoid losing precision. It may
  3445. also take advantage of hardware support for this operation. See
  3446. ‘hypot’ in *note Exponents and Logarithms::.
  3447. 
  3448. File: libc.info, Node: Normalization Functions, Next: Rounding Functions, Prev: Absolute Value, Up: Arithmetic Functions
  3449. 20.8.2 Normalization Functions
  3450. ------------------------------
  3451. The functions described in this section are primarily provided as a way
  3452. to efficiently perform certain low-level manipulations on floating point
  3453. numbers that are represented internally using a binary radix; see *note
  3454. Floating Point Concepts::. These functions are required to have
  3455. equivalent behavior even if the representation does not use a radix of
  3456. 2, but of course they are unlikely to be particularly efficient in those
  3457. cases.
  3458. All these functions are declared in ‘math.h’.
  3459. -- Function: double frexp (double VALUE, int *EXPONENT)
  3460. -- Function: float frexpf (float VALUE, int *EXPONENT)
  3461. -- Function: long double frexpl (long double VALUE, int *EXPONENT)
  3462. -- Function: _FloatN frexpfN (_FloatN VALUE, int *EXPONENT)
  3463. -- Function: _FloatNx frexpfNx (_FloatNx VALUE, int *EXPONENT)
  3464. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3465. Concepts::.
  3466. These functions are used to split the number VALUE into a
  3467. normalized fraction and an exponent.
  3468. If the argument VALUE is not zero, the return value is VALUE times
  3469. a power of two, and its magnitude is always in the range 1/2
  3470. (inclusive) to 1 (exclusive). The corresponding exponent is stored
  3471. in ‘*EXPONENT’; the return value multiplied by 2 raised to this
  3472. exponent equals the original number VALUE.
  3473. For example, ‘frexp (12.8, &exponent)’ returns ‘0.8’ and stores ‘4’
  3474. in ‘exponent’.
  3475. If VALUE is zero, then the return value is zero and zero is stored
  3476. in ‘*EXPONENT’.
  3477. -- Function: double ldexp (double VALUE, int EXPONENT)
  3478. -- Function: float ldexpf (float VALUE, int EXPONENT)
  3479. -- Function: long double ldexpl (long double VALUE, int EXPONENT)
  3480. -- Function: _FloatN ldexpfN (_FloatN VALUE, int EXPONENT)
  3481. -- Function: _FloatNx ldexpfNx (_FloatNx VALUE, int EXPONENT)
  3482. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3483. Concepts::.
  3484. These functions return the result of multiplying the floating-point
  3485. number VALUE by 2 raised to the power EXPONENT. (It can be used to
  3486. reassemble floating-point numbers that were taken apart by
  3487. ‘frexp’.)
  3488. For example, ‘ldexp (0.8, 4)’ returns ‘12.8’.
  3489. The following functions, which come from BSD, provide facilities
  3490. equivalent to those of ‘ldexp’ and ‘frexp’. See also the ISO C function
  3491. ‘logb’ which originally also appeared in BSD. The ‘_FloatN’ and
  3492. ‘_FloatN’ variants of the following functions come from TS 18661-3:2015.
  3493. -- Function: double scalb (double VALUE, double EXPONENT)
  3494. -- Function: float scalbf (float VALUE, float EXPONENT)
  3495. -- Function: long double scalbl (long double VALUE, long double
  3496. EXPONENT)
  3497. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3498. Concepts::.
  3499. The ‘scalb’ function is the BSD name for ‘ldexp’.
  3500. -- Function: double scalbn (double X, int N)
  3501. -- Function: float scalbnf (float X, int N)
  3502. -- Function: long double scalbnl (long double X, int N)
  3503. -- Function: _FloatN scalbnfN (_FloatN X, int N)
  3504. -- Function: _FloatNx scalbnfNx (_FloatNx X, int N)
  3505. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3506. Concepts::.
  3507. ‘scalbn’ is identical to ‘scalb’, except that the exponent N is an
  3508. ‘int’ instead of a floating-point number.
  3509. -- Function: double scalbln (double X, long int N)
  3510. -- Function: float scalblnf (float X, long int N)
  3511. -- Function: long double scalblnl (long double X, long int N)
  3512. -- Function: _FloatN scalblnfN (_FloatN X, long int N)
  3513. -- Function: _FloatNx scalblnfNx (_FloatNx X, long int N)
  3514. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3515. Concepts::.
  3516. ‘scalbln’ is identical to ‘scalb’, except that the exponent N is a
  3517. ‘long int’ instead of a floating-point number.
  3518. -- Function: double significand (double X)
  3519. -- Function: float significandf (float X)
  3520. -- Function: long double significandl (long double X)
  3521. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3522. Concepts::.
  3523. ‘significand’ returns the mantissa of X scaled to the range [1, 2).
  3524. It is equivalent to ‘scalb (X, (double) -ilogb (X))’.
  3525. This function exists mainly for use in certain standardized tests
  3526. of IEEE 754 conformance.
  3527. 
  3528. File: libc.info, Node: Rounding Functions, Next: Remainder Functions, Prev: Normalization Functions, Up: Arithmetic Functions
  3529. 20.8.3 Rounding Functions
  3530. -------------------------
  3531. The functions listed here perform operations such as rounding and
  3532. truncation of floating-point values. Some of these functions convert
  3533. floating point numbers to integer values. They are all declared in
  3534. ‘math.h’.
  3535. You can also convert floating-point numbers to integers simply by
  3536. casting them to ‘int’. This discards the fractional part, effectively
  3537. rounding towards zero. However, this only works if the result can
  3538. actually be represented as an ‘int’—for very large numbers, this is
  3539. impossible. The functions listed here return the result as a ‘double’
  3540. instead to get around this problem.
  3541. The ‘fromfp’ functions use the following macros, from TS
  3542. 18661-1:2014, to specify the direction of rounding. These correspond to
  3543. the rounding directions defined in IEEE 754-2008.
  3544. ‘FP_INT_UPWARD’
  3545. Round toward +oo.
  3546. ‘FP_INT_DOWNWARD’
  3547. Round toward -oo.
  3548. ‘FP_INT_TOWARDZERO’
  3549. Round toward zero.
  3550. ‘FP_INT_TONEARESTFROMZERO’
  3551. Round to nearest, ties round away from zero.
  3552. ‘FP_INT_TONEAREST’
  3553. Round to nearest, ties round to even.
  3554. -- Function: double ceil (double X)
  3555. -- Function: float ceilf (float X)
  3556. -- Function: long double ceill (long double X)
  3557. -- Function: _FloatN ceilfN (_FloatN X)
  3558. -- Function: _FloatNx ceilfNx (_FloatNx X)
  3559. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3560. Concepts::.
  3561. These functions round X upwards to the nearest integer, returning
  3562. that value as a ‘double’. Thus, ‘ceil (1.5)’ is ‘2.0’.
  3563. -- Function: double floor (double X)
  3564. -- Function: float floorf (float X)
  3565. -- Function: long double floorl (long double X)
  3566. -- Function: _FloatN floorfN (_FloatN X)
  3567. -- Function: _FloatNx floorfNx (_FloatNx X)
  3568. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3569. Concepts::.
  3570. These functions round X downwards to the nearest integer, returning
  3571. that value as a ‘double’. Thus, ‘floor (1.5)’ is ‘1.0’ and ‘floor
  3572. (-1.5)’ is ‘-2.0’.
  3573. -- Function: double trunc (double X)
  3574. -- Function: float truncf (float X)
  3575. -- Function: long double truncl (long double X)
  3576. -- Function: _FloatN truncfN (_FloatN X)
  3577. -- Function: _FloatNx truncfNx (_FloatNx X)
  3578. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3579. Concepts::.
  3580. The ‘trunc’ functions round X towards zero to the nearest integer
  3581. (returned in floating-point format). Thus, ‘trunc (1.5)’ is ‘1.0’
  3582. and ‘trunc (-1.5)’ is ‘-1.0’.
  3583. -- Function: double rint (double X)
  3584. -- Function: float rintf (float X)
  3585. -- Function: long double rintl (long double X)
  3586. -- Function: _FloatN rintfN (_FloatN X)
  3587. -- Function: _FloatNx rintfNx (_FloatNx X)
  3588. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3589. Concepts::.
  3590. These functions round X to an integer value according to the
  3591. current rounding mode. *Note Floating Point Parameters::, for
  3592. information about the various rounding modes. The default rounding
  3593. mode is to round to the nearest integer; some machines support
  3594. other modes, but round-to-nearest is always used unless you
  3595. explicitly select another.
  3596. If X was not initially an integer, these functions raise the
  3597. inexact exception.
  3598. -- Function: double nearbyint (double X)
  3599. -- Function: float nearbyintf (float X)
  3600. -- Function: long double nearbyintl (long double X)
  3601. -- Function: _FloatN nearbyintfN (_FloatN X)
  3602. -- Function: _FloatNx nearbyintfNx (_FloatNx X)
  3603. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3604. Concepts::.
  3605. These functions return the same value as the ‘rint’ functions, but
  3606. do not raise the inexact exception if X is not an integer.
  3607. -- Function: double round (double X)
  3608. -- Function: float roundf (float X)
  3609. -- Function: long double roundl (long double X)
  3610. -- Function: _FloatN roundfN (_FloatN X)
  3611. -- Function: _FloatNx roundfNx (_FloatNx X)
  3612. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3613. Concepts::.
  3614. These functions are similar to ‘rint’, but they round halfway cases
  3615. away from zero instead of to the nearest integer (or other current
  3616. rounding mode).
  3617. -- Function: double roundeven (double X)
  3618. -- Function: float roundevenf (float X)
  3619. -- Function: long double roundevenl (long double X)
  3620. -- Function: _FloatN roundevenfN (_FloatN X)
  3621. -- Function: _FloatNx roundevenfNx (_FloatNx X)
  3622. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3623. Concepts::.
  3624. These functions, from TS 18661-1:2014 and TS 18661-3:2015, are
  3625. similar to ‘round’, but they round halfway cases to even instead of
  3626. away from zero.
  3627. -- Function: long int lrint (double X)
  3628. -- Function: long int lrintf (float X)
  3629. -- Function: long int lrintl (long double X)
  3630. -- Function: long int lrintfN (_FloatN X)
  3631. -- Function: long int lrintfNx (_FloatNx X)
  3632. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3633. Concepts::.
  3634. These functions are just like ‘rint’, but they return a ‘long int’
  3635. instead of a floating-point number.
  3636. -- Function: long long int llrint (double X)
  3637. -- Function: long long int llrintf (float X)
  3638. -- Function: long long int llrintl (long double X)
  3639. -- Function: long long int llrintfN (_FloatN X)
  3640. -- Function: long long int llrintfNx (_FloatNx X)
  3641. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3642. Concepts::.
  3643. These functions are just like ‘rint’, but they return a ‘long long
  3644. int’ instead of a floating-point number.
  3645. -- Function: long int lround (double X)
  3646. -- Function: long int lroundf (float X)
  3647. -- Function: long int lroundl (long double X)
  3648. -- Function: long int lroundfN (_FloatN X)
  3649. -- Function: long int lroundfNx (_FloatNx X)
  3650. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3651. Concepts::.
  3652. These functions are just like ‘round’, but they return a ‘long int’
  3653. instead of a floating-point number.
  3654. -- Function: long long int llround (double X)
  3655. -- Function: long long int llroundf (float X)
  3656. -- Function: long long int llroundl (long double X)
  3657. -- Function: long long int llroundfN (_FloatN X)
  3658. -- Function: long long int llroundfNx (_FloatNx X)
  3659. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3660. Concepts::.
  3661. These functions are just like ‘round’, but they return a ‘long long
  3662. int’ instead of a floating-point number.
  3663. -- Function: intmax_t fromfp (double X, int ROUND, unsigned int WIDTH)
  3664. -- Function: intmax_t fromfpf (float X, int ROUND, unsigned int WIDTH)
  3665. -- Function: intmax_t fromfpl (long double X, int ROUND, unsigned int
  3666. WIDTH)
  3667. -- Function: intmax_t fromfpfN (_FloatN X, int ROUND, unsigned int
  3668. WIDTH)
  3669. -- Function: intmax_t fromfpfNx (_FloatNx X, int ROUND, unsigned int
  3670. WIDTH)
  3671. -- Function: uintmax_t ufromfp (double X, int ROUND, unsigned int
  3672. WIDTH)
  3673. -- Function: uintmax_t ufromfpf (float X, int ROUND, unsigned int
  3674. WIDTH)
  3675. -- Function: uintmax_t ufromfpl (long double X, int ROUND, unsigned int
  3676. WIDTH)
  3677. -- Function: uintmax_t ufromfpfN (_FloatN X, int ROUND, unsigned int
  3678. WIDTH)
  3679. -- Function: uintmax_t ufromfpfNx (_FloatNx X, int ROUND, unsigned int
  3680. WIDTH)
  3681. -- Function: intmax_t fromfpx (double X, int ROUND, unsigned int WIDTH)
  3682. -- Function: intmax_t fromfpxf (float X, int ROUND, unsigned int WIDTH)
  3683. -- Function: intmax_t fromfpxl (long double X, int ROUND, unsigned int
  3684. WIDTH)
  3685. -- Function: intmax_t fromfpxfN (_FloatN X, int ROUND, unsigned int
  3686. WIDTH)
  3687. -- Function: intmax_t fromfpxfNx (_FloatNx X, int ROUND, unsigned int
  3688. WIDTH)
  3689. -- Function: uintmax_t ufromfpx (double X, int ROUND, unsigned int
  3690. WIDTH)
  3691. -- Function: uintmax_t ufromfpxf (float X, int ROUND, unsigned int
  3692. WIDTH)
  3693. -- Function: uintmax_t ufromfpxl (long double X, int ROUND, unsigned
  3694. int WIDTH)
  3695. -- Function: uintmax_t ufromfpxfN (_FloatN X, int ROUND, unsigned int
  3696. WIDTH)
  3697. -- Function: uintmax_t ufromfpxfNx (_FloatNx X, int ROUND, unsigned int
  3698. WIDTH)
  3699. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3700. Concepts::.
  3701. These functions, from TS 18661-1:2014 and TS 18661-3:2015, convert
  3702. a floating-point number to an integer according to the rounding
  3703. direction ROUND (one of the ‘FP_INT_*’ macros). If the integer is
  3704. outside the range of a signed or unsigned (depending on the return
  3705. type of the function) type of width WIDTH bits (or outside the
  3706. range of the return type, if WIDTH is larger), or if X is infinite
  3707. or NaN, or if WIDTH is zero, a domain error occurs and an
  3708. unspecified value is returned. The functions with an ‘x’ in their
  3709. names raise the inexact exception when a domain error does not
  3710. occur and the argument is not an integer; the other functions do
  3711. not raise the inexact exception.
  3712. -- Function: double modf (double VALUE, double *INTEGER-PART)
  3713. -- Function: float modff (float VALUE, float *INTEGER-PART)
  3714. -- Function: long double modfl (long double VALUE, long double
  3715. *INTEGER-PART)
  3716. -- Function: _FloatN modffN (_FloatN VALUE, _FloatN *INTEGER-PART)
  3717. -- Function: _FloatNx modffNx (_FloatNx VALUE, _FloatNx *INTEGER-PART)
  3718. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3719. Concepts::.
  3720. These functions break the argument VALUE into an integer part and a
  3721. fractional part (between ‘-1’ and ‘1’, exclusive). Their sum
  3722. equals VALUE. Each of the parts has the same sign as VALUE, and
  3723. the integer part is always rounded toward zero.
  3724. ‘modf’ stores the integer part in ‘*INTEGER-PART’, and returns the
  3725. fractional part. For example, ‘modf (2.5, &intpart)’ returns ‘0.5’
  3726. and stores ‘2.0’ into ‘intpart’.
  3727. 
  3728. File: libc.info, Node: Remainder Functions, Next: FP Bit Twiddling, Prev: Rounding Functions, Up: Arithmetic Functions
  3729. 20.8.4 Remainder Functions
  3730. --------------------------
  3731. The functions in this section compute the remainder on division of two
  3732. floating-point numbers. Each is a little different; pick the one that
  3733. suits your problem.
  3734. -- Function: double fmod (double NUMERATOR, double DENOMINATOR)
  3735. -- Function: float fmodf (float NUMERATOR, float DENOMINATOR)
  3736. -- Function: long double fmodl (long double NUMERATOR, long double
  3737. DENOMINATOR)
  3738. -- Function: _FloatN fmodfN (_FloatN NUMERATOR, _FloatN DENOMINATOR)
  3739. -- Function: _FloatNx fmodfNx (_FloatNx NUMERATOR, _FloatNx
  3740. DENOMINATOR)
  3741. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3742. Concepts::.
  3743. These functions compute the remainder from the division of
  3744. NUMERATOR by DENOMINATOR. Specifically, the return value is
  3745. ‘NUMERATOR - N * DENOMINATOR’, where N is the quotient of NUMERATOR
  3746. divided by DENOMINATOR, rounded towards zero to an integer. Thus,
  3747. ‘fmod (6.5, 2.3)’ returns ‘1.9’, which is ‘6.5’ minus ‘4.6’.
  3748. The result has the same sign as the NUMERATOR and has magnitude
  3749. less than the magnitude of the DENOMINATOR.
  3750. If DENOMINATOR is zero, ‘fmod’ signals a domain error.
  3751. -- Function: double remainder (double NUMERATOR, double DENOMINATOR)
  3752. -- Function: float remainderf (float NUMERATOR, float DENOMINATOR)
  3753. -- Function: long double remainderl (long double NUMERATOR, long double
  3754. DENOMINATOR)
  3755. -- Function: _FloatN remainderfN (_FloatN NUMERATOR, _FloatN
  3756. DENOMINATOR)
  3757. -- Function: _FloatNx remainderfNx (_FloatNx NUMERATOR, _FloatNx
  3758. DENOMINATOR)
  3759. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3760. Concepts::.
  3761. These functions are like ‘fmod’ except that they round the internal
  3762. quotient N to the nearest integer instead of towards zero to an
  3763. integer. For example, ‘remainder (6.5, 2.3)’ returns ‘-0.4’, which
  3764. is ‘6.5’ minus ‘6.9’.
  3765. The absolute value of the result is less than or equal to half the
  3766. absolute value of the DENOMINATOR. The difference between ‘fmod
  3767. (NUMERATOR, DENOMINATOR)’ and ‘remainder (NUMERATOR, DENOMINATOR)’
  3768. is always either DENOMINATOR, minus DENOMINATOR, or zero.
  3769. If DENOMINATOR is zero, ‘remainder’ signals a domain error.
  3770. -- Function: double drem (double NUMERATOR, double DENOMINATOR)
  3771. -- Function: float dremf (float NUMERATOR, float DENOMINATOR)
  3772. -- Function: long double dreml (long double NUMERATOR, long double
  3773. DENOMINATOR)
  3774. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3775. Concepts::.
  3776. This function is another name for ‘remainder’.
  3777. 
  3778. File: libc.info, Node: FP Bit Twiddling, Next: FP Comparison Functions, Prev: Remainder Functions, Up: Arithmetic Functions
  3779. 20.8.5 Setting and modifying single bits of FP values
  3780. -----------------------------------------------------
  3781. There are some operations that are too complicated or expensive to
  3782. perform by hand on floating-point numbers. ISO C99 defines functions to
  3783. do these operations, which mostly involve changing single bits.
  3784. -- Function: double copysign (double X, double Y)
  3785. -- Function: float copysignf (float X, float Y)
  3786. -- Function: long double copysignl (long double X, long double Y)
  3787. -- Function: _FloatN copysignfN (_FloatN X, _FloatN Y)
  3788. -- Function: _FloatNx copysignfNx (_FloatNx X, _FloatNx Y)
  3789. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3790. Concepts::.
  3791. These functions return X but with the sign of Y. They work even if
  3792. X or Y are NaN or zero. Both of these can carry a sign (although
  3793. not all implementations support it) and this is one of the few
  3794. operations that can tell the difference.
  3795. ‘copysign’ never raises an exception.
  3796. This function is defined in IEC 559 (and the appendix with
  3797. recommended functions in IEEE 754/IEEE 854).
  3798. -- Function: int signbit (_float-type_ X)
  3799. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3800. Concepts::.
  3801. ‘signbit’ is a generic macro which can work on all floating-point
  3802. types. It returns a nonzero value if the value of X has its sign
  3803. bit set.
  3804. This is not the same as ‘x < 0.0’, because IEEE 754 floating point
  3805. allows zero to be signed. The comparison ‘-0.0 < 0.0’ is false,
  3806. but ‘signbit (-0.0)’ will return a nonzero value.
  3807. -- Function: double nextafter (double X, double Y)
  3808. -- Function: float nextafterf (float X, float Y)
  3809. -- Function: long double nextafterl (long double X, long double Y)
  3810. -- Function: _FloatN nextafterfN (_FloatN X, _FloatN Y)
  3811. -- Function: _FloatNx nextafterfNx (_FloatNx X, _FloatNx Y)
  3812. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3813. Concepts::.
  3814. The ‘nextafter’ function returns the next representable neighbor of
  3815. X in the direction towards Y. The size of the step between X and
  3816. the result depends on the type of the result. If X = Y the
  3817. function simply returns Y. If either value is ‘NaN’, ‘NaN’ is
  3818. returned. Otherwise a value corresponding to the value of the
  3819. least significant bit in the mantissa is added or subtracted,
  3820. depending on the direction. ‘nextafter’ will signal overflow or
  3821. underflow if the result goes outside of the range of normalized
  3822. numbers.
  3823. This function is defined in IEC 559 (and the appendix with
  3824. recommended functions in IEEE 754/IEEE 854).
  3825. -- Function: double nexttoward (double X, long double Y)
  3826. -- Function: float nexttowardf (float X, long double Y)
  3827. -- Function: long double nexttowardl (long double X, long double Y)
  3828. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3829. Concepts::.
  3830. These functions are identical to the corresponding versions of
  3831. ‘nextafter’ except that their second argument is a ‘long double’.
  3832. -- Function: double nextup (double X)
  3833. -- Function: float nextupf (float X)
  3834. -- Function: long double nextupl (long double X)
  3835. -- Function: _FloatN nextupfN (_FloatN X)
  3836. -- Function: _FloatNx nextupfNx (_FloatNx X)
  3837. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3838. Concepts::.
  3839. The ‘nextup’ function returns the next representable neighbor of X
  3840. in the direction of positive infinity. If X is the smallest
  3841. negative subnormal number in the type of X the function returns
  3842. ‘-0’. If X = ‘0’ the function returns the smallest positive
  3843. subnormal number in the type of X. If X is NaN, NaN is returned.
  3844. If X is +oo, +oo is returned. ‘nextup’ is from TS 18661-1:2014 and
  3845. TS 18661-3:2015. ‘nextup’ never raises an exception except for
  3846. signaling NaNs.
  3847. -- Function: double nextdown (double X)
  3848. -- Function: float nextdownf (float X)
  3849. -- Function: long double nextdownl (long double X)
  3850. -- Function: _FloatN nextdownfN (_FloatN X)
  3851. -- Function: _FloatNx nextdownfNx (_FloatNx X)
  3852. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3853. Concepts::.
  3854. The ‘nextdown’ function returns the next representable neighbor of
  3855. X in the direction of negative infinity. If X is the smallest
  3856. positive subnormal number in the type of X the function returns
  3857. ‘+0’. If X = ‘0’ the function returns the smallest negative
  3858. subnormal number in the type of X. If X is NaN, NaN is returned.
  3859. If X is -oo, -oo is returned. ‘nextdown’ is from TS 18661-1:2014
  3860. and TS 18661-3:2015. ‘nextdown’ never raises an exception except
  3861. for signaling NaNs.
  3862. -- Function: double nan (const char *TAGP)
  3863. -- Function: float nanf (const char *TAGP)
  3864. -- Function: long double nanl (const char *TAGP)
  3865. -- Function: _FloatN nanfN (const char *TAGP)
  3866. -- Function: _FloatNx nanfNx (const char *TAGP)
  3867. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  3868. Safety Concepts::.
  3869. The ‘nan’ function returns a representation of NaN, provided that
  3870. NaN is supported by the target platform. ‘nan ("N-CHAR-SEQUENCE")’
  3871. is equivalent to ‘strtod ("NAN(N-CHAR-SEQUENCE)")’.
  3872. The argument TAGP is used in an unspecified manner. On IEEE 754
  3873. systems, there are many representations of NaN, and TAGP selects
  3874. one. On other systems it may do nothing.
  3875. -- Function: int canonicalize (double *CX, const double *X)
  3876. -- Function: int canonicalizef (float *CX, const float *X)
  3877. -- Function: int canonicalizel (long double *CX, const long double *X)
  3878. -- Function: int canonicalizefN (_FloatN *CX, const _FloatN *X)
  3879. -- Function: int canonicalizefNx (_FloatNx *CX, const _FloatNx *X)
  3880. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3881. Concepts::.
  3882. In some floating-point formats, some values have canonical
  3883. (preferred) and noncanonical encodings (for IEEE interchange binary
  3884. formats, all encodings are canonical). These functions, defined by
  3885. TS 18661-1:2014 and TS 18661-3:2015, attempt to produce a canonical
  3886. version of the floating-point value pointed to by X; if that value
  3887. is a signaling NaN, they raise the invalid exception and produce a
  3888. quiet NaN. If a canonical value is produced, it is stored in the
  3889. object pointed to by CX, and these functions return zero.
  3890. Otherwise (if a canonical value could not be produced because the
  3891. object pointed to by X is not a valid representation of any
  3892. floating-point value), the object pointed to by CX is unchanged and
  3893. a nonzero value is returned.
  3894. Note that some formats have multiple encodings of a value which are
  3895. all equally canonical; when such an encoding is used as an input to
  3896. this function, any such encoding of the same value (or of the
  3897. corresponding quiet NaN, if that value is a signaling NaN) may be
  3898. produced as output.
  3899. -- Function: double getpayload (const double *X)
  3900. -- Function: float getpayloadf (const float *X)
  3901. -- Function: long double getpayloadl (const long double *X)
  3902. -- Function: _FloatN getpayloadfN (const _FloatN *X)
  3903. -- Function: _FloatNx getpayloadfNx (const _FloatNx *X)
  3904. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3905. Concepts::.
  3906. IEEE 754 defines the “payload” of a NaN to be an integer value
  3907. encoded in the representation of the NaN. Payloads are typically
  3908. propagated from NaN inputs to the result of a floating-point
  3909. operation. These functions, defined by TS 18661-1:2014 and TS
  3910. 18661-3:2015, return the payload of the NaN pointed to by X
  3911. (returned as a positive integer, or positive zero, represented as a
  3912. floating-point number); if X is not a NaN, they return −1. They
  3913. raise no floating-point exceptions even for signaling NaNs. (The
  3914. return value of −1 for an argument that is not a NaN is specified
  3915. in C2x; the value was unspecified in TS 18661.)
  3916. -- Function: int setpayload (double *X, double PAYLOAD)
  3917. -- Function: int setpayloadf (float *X, float PAYLOAD)
  3918. -- Function: int setpayloadl (long double *X, long double PAYLOAD)
  3919. -- Function: int setpayloadfN (_FloatN *X, _FloatN PAYLOAD)
  3920. -- Function: int setpayloadfNx (_FloatNx *X, _FloatNx PAYLOAD)
  3921. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3922. Concepts::.
  3923. These functions, defined by TS 18661-1:2014 and TS 18661-3:2015,
  3924. set the object pointed to by X to a quiet NaN with payload PAYLOAD
  3925. and a zero sign bit and return zero. If PAYLOAD is not a
  3926. positive-signed integer that is a valid payload for a quiet NaN of
  3927. the given type, the object pointed to by X is set to positive zero
  3928. and a nonzero value is returned. They raise no floating-point
  3929. exceptions.
  3930. -- Function: int setpayloadsig (double *X, double PAYLOAD)
  3931. -- Function: int setpayloadsigf (float *X, float PAYLOAD)
  3932. -- Function: int setpayloadsigl (long double *X, long double PAYLOAD)
  3933. -- Function: int setpayloadsigfN (_FloatN *X, _FloatN PAYLOAD)
  3934. -- Function: int setpayloadsigfNx (_FloatNx *X, _FloatNx PAYLOAD)
  3935. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3936. Concepts::.
  3937. These functions, defined by TS 18661-1:2014 and TS 18661-3:2015,
  3938. set the object pointed to by X to a signaling NaN with payload
  3939. PAYLOAD and a zero sign bit and return zero. If PAYLOAD is not a
  3940. positive-signed integer that is a valid payload for a signaling NaN
  3941. of the given type, the object pointed to by X is set to positive
  3942. zero and a nonzero value is returned. They raise no floating-point
  3943. exceptions.
  3944. 
  3945. File: libc.info, Node: FP Comparison Functions, Next: Misc FP Arithmetic, Prev: FP Bit Twiddling, Up: Arithmetic Functions
  3946. 20.8.6 Floating-Point Comparison Functions
  3947. ------------------------------------------
  3948. The standard C comparison operators provoke exceptions when one or other
  3949. of the operands is NaN. For example,
  3950. int v = a < 1.0;
  3951. will raise an exception if A is NaN. (This does _not_ happen with ‘==’
  3952. and ‘!=’; those merely return false and true, respectively, when NaN is
  3953. examined.) Frequently this exception is undesirable. ISO C99 therefore
  3954. defines comparison functions that do not raise exceptions when NaN is
  3955. examined. All of the functions are implemented as macros which allow
  3956. their arguments to be of any floating-point type. The macros are
  3957. guaranteed to evaluate their arguments only once. TS 18661-1:2014 adds
  3958. such a macro for an equality comparison that _does_ raise an exception
  3959. for a NaN argument; it also adds functions that provide a total ordering
  3960. on all floating-point values, including NaNs, without raising any
  3961. exceptions even for signaling NaNs.
  3962. -- Macro: int isgreater (_real-floating_ X, _real-floating_ Y)
  3963. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3964. Concepts::.
  3965. This macro determines whether the argument X is greater than Y. It
  3966. is equivalent to ‘(X) > (Y)’, but no exception is raised if X or Y
  3967. are NaN.
  3968. -- Macro: int isgreaterequal (_real-floating_ X, _real-floating_ Y)
  3969. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3970. Concepts::.
  3971. This macro determines whether the argument X is greater than or
  3972. equal to Y. It is equivalent to ‘(X) >= (Y)’, but no exception is
  3973. raised if X or Y are NaN.
  3974. -- Macro: int isless (_real-floating_ X, _real-floating_ Y)
  3975. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3976. Concepts::.
  3977. This macro determines whether the argument X is less than Y. It is
  3978. equivalent to ‘(X) < (Y)’, but no exception is raised if X or Y are
  3979. NaN.
  3980. -- Macro: int islessequal (_real-floating_ X, _real-floating_ Y)
  3981. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3982. Concepts::.
  3983. This macro determines whether the argument X is less than or equal
  3984. to Y. It is equivalent to ‘(X) <= (Y)’, but no exception is raised
  3985. if X or Y are NaN.
  3986. -- Macro: int islessgreater (_real-floating_ X, _real-floating_ Y)
  3987. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3988. Concepts::.
  3989. This macro determines whether the argument X is less or greater
  3990. than Y. It is equivalent to ‘(X) < (Y) || (X) > (Y)’ (although it
  3991. only evaluates X and Y once), but no exception is raised if X or Y
  3992. are NaN.
  3993. This macro is not equivalent to ‘X != Y’, because that expression
  3994. is true if X or Y are NaN.
  3995. -- Macro: int isunordered (_real-floating_ X, _real-floating_ Y)
  3996. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3997. Concepts::.
  3998. This macro determines whether its arguments are unordered. In
  3999. other words, it is true if X or Y are NaN, and false otherwise.
  4000. -- Macro: int iseqsig (_real-floating_ X, _real-floating_ Y)
  4001. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4002. Concepts::.
  4003. This macro determines whether its arguments are equal. It is
  4004. equivalent to ‘(X) == (Y)’, but it raises the invalid exception and
  4005. sets ‘errno’ to ‘EDOM’ if either argument is a NaN.
  4006. -- Function: int totalorder (const double *X, const double *Y)
  4007. -- Function: int totalorderf (const float *X, const float *Y)
  4008. -- Function: int totalorderl (const long double *X, const long double
  4009. *Y)
  4010. -- Function: int totalorderfN (const _FloatN *X, const _FloatN *Y)
  4011. -- Function: int totalorderfNx (const _FloatNx *X, const _FloatNx *Y)
  4012. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4013. Concepts::.
  4014. These functions determine whether the total order relationship,
  4015. defined in IEEE 754-2008, is true for ‘*X’ and ‘*Y’, returning
  4016. nonzero if it is true and zero if it is false. No exceptions are
  4017. raised even for signaling NaNs. The relationship is true if they
  4018. are the same floating-point value (including sign for zero and
  4019. NaNs, and payload for NaNs), or if ‘*X’ comes before ‘*Y’ in the
  4020. following order: negative quiet NaNs, in order of decreasing
  4021. payload; negative signaling NaNs, in order of decreasing payload;
  4022. negative infinity; finite numbers, in ascending order, with
  4023. negative zero before positive zero; positive infinity; positive
  4024. signaling NaNs, in order of increasing payload; positive quiet
  4025. NaNs, in order of increasing payload.
  4026. -- Function: int totalordermag (const double *X, const double *Y)
  4027. -- Function: int totalordermagf (const float *X, const float *Y)
  4028. -- Function: int totalordermagl (const long double *X, const long
  4029. double *Y)
  4030. -- Function: int totalordermagfN (const _FloatN *X, const _FloatN *Y)
  4031. -- Function: int totalordermagfNx (const _FloatNx *X, const _FloatNx
  4032. *Y)
  4033. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4034. Concepts::.
  4035. These functions determine whether the total order relationship,
  4036. defined in IEEE 754-2008, is true for the absolute values of ‘*X’
  4037. and ‘*Y’, returning nonzero if it is true and zero if it is false.
  4038. No exceptions are raised even for signaling NaNs.
  4039. Not all machines provide hardware support for these operations. On
  4040. machines that don’t, the macros can be very slow. Therefore, you should
  4041. not use these functions when NaN is not a concern.
  4042. *NB:* There are no macros ‘isequal’ or ‘isunequal’. They are
  4043. unnecessary, because the ‘==’ and ‘!=’ operators do _not_ throw an
  4044. exception if one or both of the operands are NaN.
  4045. 
  4046. File: libc.info, Node: Misc FP Arithmetic, Prev: FP Comparison Functions, Up: Arithmetic Functions
  4047. 20.8.7 Miscellaneous FP arithmetic functions
  4048. --------------------------------------------
  4049. The functions in this section perform miscellaneous but common
  4050. operations that are awkward to express with C operators. On some
  4051. processors these functions can use special machine instructions to
  4052. perform these operations faster than the equivalent C code.
  4053. -- Function: double fmin (double X, double Y)
  4054. -- Function: float fminf (float X, float Y)
  4055. -- Function: long double fminl (long double X, long double Y)
  4056. -- Function: _FloatN fminfN (_FloatN X, _FloatN Y)
  4057. -- Function: _FloatNx fminfNx (_FloatNx X, _FloatNx Y)
  4058. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4059. Concepts::.
  4060. The ‘fmin’ function returns the lesser of the two values X and Y.
  4061. It is similar to the expression
  4062. ((x) < (y) ? (x) : (y))
  4063. except that X and Y are only evaluated once.
  4064. If an argument is NaN, the other argument is returned. If both
  4065. arguments are NaN, NaN is returned.
  4066. -- Function: double fmax (double X, double Y)
  4067. -- Function: float fmaxf (float X, float Y)
  4068. -- Function: long double fmaxl (long double X, long double Y)
  4069. -- Function: _FloatN fmaxfN (_FloatN X, _FloatN Y)
  4070. -- Function: _FloatNx fmaxfNx (_FloatNx X, _FloatNx Y)
  4071. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4072. Concepts::.
  4073. The ‘fmax’ function returns the greater of the two values X and Y.
  4074. If an argument is NaN, the other argument is returned. If both
  4075. arguments are NaN, NaN is returned.
  4076. -- Function: double fminmag (double X, double Y)
  4077. -- Function: float fminmagf (float X, float Y)
  4078. -- Function: long double fminmagl (long double X, long double Y)
  4079. -- Function: _FloatN fminmagfN (_FloatN X, _FloatN Y)
  4080. -- Function: _FloatNx fminmagfNx (_FloatNx X, _FloatNx Y)
  4081. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4082. Concepts::.
  4083. These functions, from TS 18661-1:2014 and TS 18661-3:2015, return
  4084. whichever of the two values X and Y has the smaller absolute value.
  4085. If both have the same absolute value, or either is NaN, they behave
  4086. the same as the ‘fmin’ functions.
  4087. -- Function: double fmaxmag (double X, double Y)
  4088. -- Function: float fmaxmagf (float X, float Y)
  4089. -- Function: long double fmaxmagl (long double X, long double Y)
  4090. -- Function: _FloatN fmaxmagfN (_FloatN X, _FloatN Y)
  4091. -- Function: _FloatNx fmaxmagfNx (_FloatNx X, _FloatNx Y)
  4092. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4093. Concepts::.
  4094. These functions, from TS 18661-1:2014, return whichever of the two
  4095. values X and Y has the greater absolute value. If both have the
  4096. same absolute value, or either is NaN, they behave the same as the
  4097. ‘fmax’ functions.
  4098. -- Function: double fdim (double X, double Y)
  4099. -- Function: float fdimf (float X, float Y)
  4100. -- Function: long double fdiml (long double X, long double Y)
  4101. -- Function: _FloatN fdimfN (_FloatN X, _FloatN Y)
  4102. -- Function: _FloatNx fdimfNx (_FloatNx X, _FloatNx Y)
  4103. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4104. Concepts::.
  4105. The ‘fdim’ function returns the positive difference between X and
  4106. Y. The positive difference is X - Y if X is greater than Y, and 0
  4107. otherwise.
  4108. If X, Y, or both are NaN, NaN is returned.
  4109. -- Function: double fma (double X, double Y, double Z)
  4110. -- Function: float fmaf (float X, float Y, float Z)
  4111. -- Function: long double fmal (long double X, long double Y, long
  4112. double Z)
  4113. -- Function: _FloatN fmafN (_FloatN X, _FloatN Y, _FloatN Z)
  4114. -- Function: _FloatNx fmafNx (_FloatNx X, _FloatNx Y, _FloatNx Z)
  4115. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4116. Concepts::.
  4117. The ‘fma’ function performs floating-point multiply-add. This is
  4118. the operation (X * Y) + Z, but the intermediate result is not
  4119. rounded to the destination type. This can sometimes improve the
  4120. precision of a calculation.
  4121. This function was introduced because some processors have a special
  4122. instruction to perform multiply-add. The C compiler cannot use it
  4123. directly, because the expression ‘x*y + z’ is defined to round the
  4124. intermediate result. ‘fma’ lets you choose when you want to round
  4125. only once.
  4126. On processors which do not implement multiply-add in hardware,
  4127. ‘fma’ can be very slow since it must avoid intermediate rounding.
  4128. ‘math.h’ defines the symbols ‘FP_FAST_FMA’, ‘FP_FAST_FMAF’, and
  4129. ‘FP_FAST_FMAL’ when the corresponding version of ‘fma’ is no slower
  4130. than the expression ‘x*y + z’. In the GNU C Library, this always
  4131. means the operation is implemented in hardware.
  4132. -- Function: float fadd (double X, double Y)
  4133. -- Function: float faddl (long double X, long double Y)
  4134. -- Function: double daddl (long double X, long double Y)
  4135. -- Function: _FloatM fMaddfN (_FloatN X, _FloatN Y)
  4136. -- Function: _FloatM fMaddfNx (_FloatNx X, _FloatNx Y)
  4137. -- Function: _FloatMx fMxaddfN (_FloatN X, _FloatN Y)
  4138. -- Function: _FloatMx fMxaddfNx (_FloatNx X, _FloatNx Y)
  4139. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4140. Concepts::.
  4141. These functions, from TS 18661-1:2014 and TS 18661-3:2015, return X
  4142. + Y, rounded once to the return type of the function without any
  4143. intermediate rounding to the type of the arguments.
  4144. -- Function: float fsub (double X, double Y)
  4145. -- Function: float fsubl (long double X, long double Y)
  4146. -- Function: double dsubl (long double X, long double Y)
  4147. -- Function: _FloatM fMsubfN (_FloatN X, _FloatN Y)
  4148. -- Function: _FloatM fMsubfNx (_FloatNx X, _FloatNx Y)
  4149. -- Function: _FloatMx fMxsubfN (_FloatN X, _FloatN Y)
  4150. -- Function: _FloatMx fMxsubfNx (_FloatNx X, _FloatNx Y)
  4151. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4152. Concepts::.
  4153. These functions, from TS 18661-1:2014 and TS 18661-3:2015, return X
  4154. - Y, rounded once to the return type of the function without any
  4155. intermediate rounding to the type of the arguments.
  4156. -- Function: float fmul (double X, double Y)
  4157. -- Function: float fmull (long double X, long double Y)
  4158. -- Function: double dmull (long double X, long double Y)
  4159. -- Function: _FloatM fMmulfN (_FloatN X, _FloatN Y)
  4160. -- Function: _FloatM fMmulfNx (_FloatNx X, _FloatNx Y)
  4161. -- Function: _FloatMx fMxmulfN (_FloatN X, _FloatN Y)
  4162. -- Function: _FloatMx fMxmulfNx (_FloatNx X, _FloatNx Y)
  4163. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4164. Concepts::.
  4165. These functions, from TS 18661-1:2014 and TS 18661-3:2015, return X
  4166. * Y, rounded once to the return type of the function without any
  4167. intermediate rounding to the type of the arguments.
  4168. -- Function: float fdiv (double X, double Y)
  4169. -- Function: float fdivl (long double X, long double Y)
  4170. -- Function: double ddivl (long double X, long double Y)
  4171. -- Function: _FloatM fMdivfN (_FloatN X, _FloatN Y)
  4172. -- Function: _FloatM fMdivfNx (_FloatNx X, _FloatNx Y)
  4173. -- Function: _FloatMx fMxdivfN (_FloatN X, _FloatN Y)
  4174. -- Function: _FloatMx fMxdivfNx (_FloatNx X, _FloatNx Y)
  4175. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4176. Concepts::.
  4177. These functions, from TS 18661-1:2014 and TS 18661-3:2015, return X
  4178. / Y, rounded once to the return type of the function without any
  4179. intermediate rounding to the type of the arguments.
  4180. 
  4181. File: libc.info, Node: Complex Numbers, Next: Operations on Complex, Prev: Arithmetic Functions, Up: Arithmetic
  4182. 20.9 Complex Numbers
  4183. ====================
  4184. ISO C99 introduces support for complex numbers in C. This is done with a
  4185. new type qualifier, ‘complex’. It is a keyword if and only if
  4186. ‘complex.h’ has been included. There are three complex types,
  4187. corresponding to the three real types: ‘float complex’, ‘double
  4188. complex’, and ‘long double complex’.
  4189. Likewise, on machines that have support for ‘_FloatN’ or ‘_FloatNx’
  4190. enabled, the complex types ‘_FloatN complex’ and ‘_FloatNx complex’ are
  4191. also available if ‘complex.h’ has been included; *note Mathematics::.
  4192. To construct complex numbers you need a way to indicate the imaginary
  4193. part of a number. There is no standard notation for an imaginary
  4194. floating point constant. Instead, ‘complex.h’ defines two macros that
  4195. can be used to create complex numbers.
  4196. -- Macro: const float complex _Complex_I
  4197. This macro is a representation of the complex number “0+1i”.
  4198. Multiplying a real floating-point value by ‘_Complex_I’ gives a
  4199. complex number whose value is purely imaginary. You can use this
  4200. to construct complex constants:
  4201. 3.0 + 4.0i = 3.0 + 4.0 * _Complex_I
  4202. Note that ‘_Complex_I * _Complex_I’ has the value ‘-1’, but the
  4203. type of that value is ‘complex’.
  4204. ‘_Complex_I’ is a bit of a mouthful. ‘complex.h’ also defines a shorter
  4205. name for the same constant.
  4206. -- Macro: const float complex I
  4207. This macro has exactly the same value as ‘_Complex_I’. Most of the
  4208. time it is preferable. However, it causes problems if you want to
  4209. use the identifier ‘I’ for something else. You can safely write
  4210. #include <complex.h>
  4211. #undef I
  4212. if you need ‘I’ for your own purposes. (In that case we recommend
  4213. you also define some other short name for ‘_Complex_I’, such as
  4214. ‘J’.)
  4215. 
  4216. File: libc.info, Node: Operations on Complex, Next: Parsing of Numbers, Prev: Complex Numbers, Up: Arithmetic
  4217. 20.10 Projections, Conjugates, and Decomposing of Complex Numbers
  4218. =================================================================
  4219. ISO C99 also defines functions that perform basic operations on complex
  4220. numbers, such as decomposition and conjugation. The prototypes for all
  4221. these functions are in ‘complex.h’. All functions are available in
  4222. three variants, one for each of the three complex types.
  4223. -- Function: double creal (complex double Z)
  4224. -- Function: float crealf (complex float Z)
  4225. -- Function: long double creall (complex long double Z)
  4226. -- Function: _FloatN crealfN (complex _FloatN Z)
  4227. -- Function: _FloatNx crealfNx (complex _FloatNx Z)
  4228. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4229. Concepts::.
  4230. These functions return the real part of the complex number Z.
  4231. -- Function: double cimag (complex double Z)
  4232. -- Function: float cimagf (complex float Z)
  4233. -- Function: long double cimagl (complex long double Z)
  4234. -- Function: _FloatN cimagfN (complex _FloatN Z)
  4235. -- Function: _FloatNx cimagfNx (complex _FloatNx Z)
  4236. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4237. Concepts::.
  4238. These functions return the imaginary part of the complex number Z.
  4239. -- Function: complex double conj (complex double Z)
  4240. -- Function: complex float conjf (complex float Z)
  4241. -- Function: complex long double conjl (complex long double Z)
  4242. -- Function: complex _FloatN conjfN (complex _FloatN Z)
  4243. -- Function: complex _FloatNx conjfNx (complex _FloatNx Z)
  4244. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4245. Concepts::.
  4246. These functions return the conjugate value of the complex number Z.
  4247. The conjugate of a complex number has the same real part and a
  4248. negated imaginary part. In other words, ‘conj(a + bi) = a + -bi’.
  4249. -- Function: double carg (complex double Z)
  4250. -- Function: float cargf (complex float Z)
  4251. -- Function: long double cargl (complex long double Z)
  4252. -- Function: _FloatN cargfN (complex _FloatN Z)
  4253. -- Function: _FloatNx cargfNx (complex _FloatNx Z)
  4254. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4255. Concepts::.
  4256. These functions return the argument of the complex number Z. The
  4257. argument of a complex number is the angle in the complex plane
  4258. between the positive real axis and a line passing through zero and
  4259. the number. This angle is measured in the usual fashion and ranges
  4260. from -pi to pi.
  4261. ‘carg’ has a branch cut along the negative real axis.
  4262. -- Function: complex double cproj (complex double Z)
  4263. -- Function: complex float cprojf (complex float Z)
  4264. -- Function: complex long double cprojl (complex long double Z)
  4265. -- Function: complex _FloatN cprojfN (complex _FloatN Z)
  4266. -- Function: complex _FloatNx cprojfNx (complex _FloatNx Z)
  4267. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4268. Concepts::.
  4269. These functions return the projection of the complex value Z onto
  4270. the Riemann sphere. Values with an infinite imaginary part are
  4271. projected to positive infinity on the real axis, even if the real
  4272. part is NaN. If the real part is infinite, the result is equivalent
  4273. to
  4274. INFINITY + I * copysign (0.0, cimag (z))
  4275. 
  4276. File: libc.info, Node: Parsing of Numbers, Next: Printing of Floats, Prev: Operations on Complex, Up: Arithmetic
  4277. 20.11 Parsing of Numbers
  4278. ========================
  4279. This section describes functions for “reading” integer and
  4280. floating-point numbers from a string. It may be more convenient in some
  4281. cases to use ‘sscanf’ or one of the related functions; see *note
  4282. Formatted Input::. But often you can make a program more robust by
  4283. finding the tokens in the string by hand, then converting the numbers
  4284. one by one.
  4285. * Menu:
  4286. * Parsing of Integers:: Functions for conversion of integer values.
  4287. * Parsing of Floats:: Functions for conversion of floating-point
  4288. values.
  4289. 
  4290. File: libc.info, Node: Parsing of Integers, Next: Parsing of Floats, Up: Parsing of Numbers
  4291. 20.11.1 Parsing of Integers
  4292. ---------------------------
  4293. The ‘str’ functions are declared in ‘stdlib.h’ and those beginning with
  4294. ‘wcs’ are declared in ‘wchar.h’. One might wonder about the use of
  4295. ‘restrict’ in the prototypes of the functions in this section. It is
  4296. seemingly useless but the ISO C standard uses it (for the functions
  4297. defined there) so we have to do it as well.
  4298. -- Function: long int strtol (const char *restrict STRING, char
  4299. **restrict TAILPTR, int BASE)
  4300. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4301. Safety Concepts::.
  4302. The ‘strtol’ (“string-to-long”) function converts the initial part
  4303. of STRING to a signed integer, which is returned as a value of type
  4304. ‘long int’.
  4305. This function attempts to decompose STRING as follows:
  4306. • A (possibly empty) sequence of whitespace characters. Which
  4307. characters are whitespace is determined by the ‘isspace’
  4308. function (*note Classification of Characters::). These are
  4309. discarded.
  4310. • An optional plus or minus sign (‘+’ or ‘-’).
  4311. • A nonempty sequence of digits in the radix specified by BASE.
  4312. If BASE is zero, decimal radix is assumed unless the series of
  4313. digits begins with ‘0’ (specifying octal radix), or ‘0x’ or
  4314. ‘0X’ (specifying hexadecimal radix); in other words, the same
  4315. syntax used for integer constants in C.
  4316. Otherwise BASE must have a value between ‘2’ and ‘36’. If
  4317. BASE is ‘16’, the digits may optionally be preceded by ‘0x’ or
  4318. ‘0X’. If base has no legal value the value returned is ‘0l’
  4319. and the global variable ‘errno’ is set to ‘EINVAL’.
  4320. • Any remaining characters in the string. If TAILPTR is not a
  4321. null pointer, ‘strtol’ stores a pointer to this tail in
  4322. ‘*TAILPTR’.
  4323. If the string is empty, contains only whitespace, or does not
  4324. contain an initial substring that has the expected syntax for an
  4325. integer in the specified BASE, no conversion is performed. In this
  4326. case, ‘strtol’ returns a value of zero and the value stored in
  4327. ‘*TAILPTR’ is the value of STRING.
  4328. In a locale other than the standard ‘"C"’ locale, this function may
  4329. recognize additional implementation-dependent syntax.
  4330. If the string has valid syntax for an integer but the value is not
  4331. representable because of overflow, ‘strtol’ returns either
  4332. ‘LONG_MAX’ or ‘LONG_MIN’ (*note Range of Type::), as appropriate
  4333. for the sign of the value. It also sets ‘errno’ to ‘ERANGE’ to
  4334. indicate there was overflow.
  4335. You should not check for errors by examining the return value of
  4336. ‘strtol’, because the string might be a valid representation of
  4337. ‘0l’, ‘LONG_MAX’, or ‘LONG_MIN’. Instead, check whether TAILPTR
  4338. points to what you expect after the number (e.g. ‘'\0'’ if the
  4339. string should end after the number). You also need to clear
  4340. ‘errno’ before the call and check it afterward, in case there was
  4341. overflow.
  4342. There is an example at the end of this section.
  4343. -- Function: long int wcstol (const wchar_t *restrict STRING, wchar_t
  4344. **restrict TAILPTR, int BASE)
  4345. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4346. Safety Concepts::.
  4347. The ‘wcstol’ function is equivalent to the ‘strtol’ function in
  4348. nearly all aspects but handles wide character strings.
  4349. The ‘wcstol’ function was introduced in Amendment 1 of ISO C90.
  4350. -- Function: unsigned long int strtoul (const char *restrict STRING,
  4351. char **restrict TAILPTR, int BASE)
  4352. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4353. Safety Concepts::.
  4354. The ‘strtoul’ (“string-to-unsigned-long”) function is like ‘strtol’
  4355. except it converts to an ‘unsigned long int’ value. The syntax is
  4356. the same as described above for ‘strtol’. The value returned on
  4357. overflow is ‘ULONG_MAX’ (*note Range of Type::).
  4358. If STRING depicts a negative number, ‘strtoul’ acts the same as
  4359. STRTOL but casts the result to an unsigned integer. That means for
  4360. example that ‘strtoul’ on ‘"-1"’ returns ‘ULONG_MAX’ and an input
  4361. more negative than ‘LONG_MIN’ returns (‘ULONG_MAX’ + 1) / 2.
  4362. ‘strtoul’ sets ‘errno’ to ‘EINVAL’ if BASE is out of range, or
  4363. ‘ERANGE’ on overflow.
  4364. -- Function: unsigned long int wcstoul (const wchar_t *restrict STRING,
  4365. wchar_t **restrict TAILPTR, int BASE)
  4366. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4367. Safety Concepts::.
  4368. The ‘wcstoul’ function is equivalent to the ‘strtoul’ function in
  4369. nearly all aspects but handles wide character strings.
  4370. The ‘wcstoul’ function was introduced in Amendment 1 of ISO C90.
  4371. -- Function: long long int strtoll (const char *restrict STRING, char
  4372. **restrict TAILPTR, int BASE)
  4373. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4374. Safety Concepts::.
  4375. The ‘strtoll’ function is like ‘strtol’ except that it returns a
  4376. ‘long long int’ value, and accepts numbers with a correspondingly
  4377. larger range.
  4378. If the string has valid syntax for an integer but the value is not
  4379. representable because of overflow, ‘strtoll’ returns either
  4380. ‘LLONG_MAX’ or ‘LLONG_MIN’ (*note Range of Type::), as appropriate
  4381. for the sign of the value. It also sets ‘errno’ to ‘ERANGE’ to
  4382. indicate there was overflow.
  4383. The ‘strtoll’ function was introduced in ISO C99.
  4384. -- Function: long long int wcstoll (const wchar_t *restrict STRING,
  4385. wchar_t **restrict TAILPTR, int BASE)
  4386. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4387. Safety Concepts::.
  4388. The ‘wcstoll’ function is equivalent to the ‘strtoll’ function in
  4389. nearly all aspects but handles wide character strings.
  4390. The ‘wcstoll’ function was introduced in Amendment 1 of ISO C90.
  4391. -- Function: long long int strtoq (const char *restrict STRING, char
  4392. **restrict TAILPTR, int BASE)
  4393. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4394. Safety Concepts::.
  4395. ‘strtoq’ (“string-to-quad-word”) is the BSD name for ‘strtoll’.
  4396. -- Function: long long int wcstoq (const wchar_t *restrict STRING,
  4397. wchar_t **restrict TAILPTR, int BASE)
  4398. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4399. Safety Concepts::.
  4400. The ‘wcstoq’ function is equivalent to the ‘strtoq’ function in
  4401. nearly all aspects but handles wide character strings.
  4402. The ‘wcstoq’ function is a GNU extension.
  4403. -- Function: unsigned long long int strtoull (const char *restrict
  4404. STRING, char **restrict TAILPTR, int BASE)
  4405. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4406. Safety Concepts::.
  4407. The ‘strtoull’ function is related to ‘strtoll’ the same way
  4408. ‘strtoul’ is related to ‘strtol’.
  4409. The ‘strtoull’ function was introduced in ISO C99.
  4410. -- Function: unsigned long long int wcstoull (const wchar_t *restrict
  4411. STRING, wchar_t **restrict TAILPTR, int BASE)
  4412. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4413. Safety Concepts::.
  4414. The ‘wcstoull’ function is equivalent to the ‘strtoull’ function in
  4415. nearly all aspects but handles wide character strings.
  4416. The ‘wcstoull’ function was introduced in Amendment 1 of ISO C90.
  4417. -- Function: unsigned long long int strtouq (const char *restrict
  4418. STRING, char **restrict TAILPTR, int BASE)
  4419. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4420. Safety Concepts::.
  4421. ‘strtouq’ is the BSD name for ‘strtoull’.
  4422. -- Function: unsigned long long int wcstouq (const wchar_t *restrict
  4423. STRING, wchar_t **restrict TAILPTR, int BASE)
  4424. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4425. Safety Concepts::.
  4426. The ‘wcstouq’ function is equivalent to the ‘strtouq’ function in
  4427. nearly all aspects but handles wide character strings.
  4428. The ‘wcstouq’ function is a GNU extension.
  4429. -- Function: intmax_t strtoimax (const char *restrict STRING, char
  4430. **restrict TAILPTR, int BASE)
  4431. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4432. Safety Concepts::.
  4433. The ‘strtoimax’ function is like ‘strtol’ except that it returns a
  4434. ‘intmax_t’ value, and accepts numbers of a corresponding range.
  4435. If the string has valid syntax for an integer but the value is not
  4436. representable because of overflow, ‘strtoimax’ returns either
  4437. ‘INTMAX_MAX’ or ‘INTMAX_MIN’ (*note Integers::), as appropriate for
  4438. the sign of the value. It also sets ‘errno’ to ‘ERANGE’ to
  4439. indicate there was overflow.
  4440. See *note Integers:: for a description of the ‘intmax_t’ type. The
  4441. ‘strtoimax’ function was introduced in ISO C99.
  4442. -- Function: intmax_t wcstoimax (const wchar_t *restrict STRING,
  4443. wchar_t **restrict TAILPTR, int BASE)
  4444. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4445. Safety Concepts::.
  4446. The ‘wcstoimax’ function is equivalent to the ‘strtoimax’ function
  4447. in nearly all aspects but handles wide character strings.
  4448. The ‘wcstoimax’ function was introduced in ISO C99.
  4449. -- Function: uintmax_t strtoumax (const char *restrict STRING, char
  4450. **restrict TAILPTR, int BASE)
  4451. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4452. Safety Concepts::.
  4453. The ‘strtoumax’ function is related to ‘strtoimax’ the same way
  4454. that ‘strtoul’ is related to ‘strtol’.
  4455. See *note Integers:: for a description of the ‘intmax_t’ type. The
  4456. ‘strtoumax’ function was introduced in ISO C99.
  4457. -- Function: uintmax_t wcstoumax (const wchar_t *restrict STRING,
  4458. wchar_t **restrict TAILPTR, int BASE)
  4459. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4460. Safety Concepts::.
  4461. The ‘wcstoumax’ function is equivalent to the ‘strtoumax’ function
  4462. in nearly all aspects but handles wide character strings.
  4463. The ‘wcstoumax’ function was introduced in ISO C99.
  4464. -- Function: long int atol (const char *STRING)
  4465. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4466. Safety Concepts::.
  4467. This function is similar to the ‘strtol’ function with a BASE
  4468. argument of ‘10’, except that it need not detect overflow errors.
  4469. The ‘atol’ function is provided mostly for compatibility with
  4470. existing code; using ‘strtol’ is more robust.
  4471. -- Function: int atoi (const char *STRING)
  4472. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4473. Safety Concepts::.
  4474. This function is like ‘atol’, except that it returns an ‘int’. The
  4475. ‘atoi’ function is also considered obsolete; use ‘strtol’ instead.
  4476. -- Function: long long int atoll (const char *STRING)
  4477. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4478. Safety Concepts::.
  4479. This function is similar to ‘atol’, except it returns a ‘long long
  4480. int’.
  4481. The ‘atoll’ function was introduced in ISO C99. It too is obsolete
  4482. (despite having just been added); use ‘strtoll’ instead.
  4483. All the functions mentioned in this section so far do not handle
  4484. alternative representations of characters as described in the locale
  4485. data. Some locales specify thousands separator and the way they have to
  4486. be used which can help to make large numbers more readable. To read
  4487. such numbers one has to use the ‘scanf’ functions with the ‘'’ flag.
  4488. Here is a function which parses a string as a sequence of integers
  4489. and returns the sum of them:
  4490. int
  4491. sum_ints_from_string (char *string)
  4492. {
  4493. int sum = 0;
  4494. while (1) {
  4495. char *tail;
  4496. int next;
  4497. /* Skip whitespace by hand, to detect the end. */
  4498. while (isspace (*string)) string++;
  4499. if (*string == 0)
  4500. break;
  4501. /* There is more nonwhitespace, */
  4502. /* so it ought to be another number. */
  4503. errno = 0;
  4504. /* Parse it. */
  4505. next = strtol (string, &tail, 0);
  4506. /* Add it in, if not overflow. */
  4507. if (errno)
  4508. printf ("Overflow\n");
  4509. else
  4510. sum += next;
  4511. /* Advance past it. */
  4512. string = tail;
  4513. }
  4514. return sum;
  4515. }
  4516. 
  4517. File: libc.info, Node: Parsing of Floats, Prev: Parsing of Integers, Up: Parsing of Numbers
  4518. 20.11.2 Parsing of Floats
  4519. -------------------------
  4520. The ‘str’ functions are declared in ‘stdlib.h’ and those beginning with
  4521. ‘wcs’ are declared in ‘wchar.h’. One might wonder about the use of
  4522. ‘restrict’ in the prototypes of the functions in this section. It is
  4523. seemingly useless but the ISO C standard uses it (for the functions
  4524. defined there) so we have to do it as well.
  4525. -- Function: double strtod (const char *restrict STRING, char
  4526. **restrict TAILPTR)
  4527. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4528. Safety Concepts::.
  4529. The ‘strtod’ (“string-to-double”) function converts the initial
  4530. part of STRING to a floating-point number, which is returned as a
  4531. value of type ‘double’.
  4532. This function attempts to decompose STRING as follows:
  4533. • A (possibly empty) sequence of whitespace characters. Which
  4534. characters are whitespace is determined by the ‘isspace’
  4535. function (*note Classification of Characters::). These are
  4536. discarded.
  4537. • An optional plus or minus sign (‘+’ or ‘-’).
  4538. • A floating point number in decimal or hexadecimal format. The
  4539. decimal format is:
  4540. − A nonempty sequence of digits optionally containing a
  4541. decimal-point character—normally ‘.’, but it depends on
  4542. the locale (*note General Numeric::).
  4543. − An optional exponent part, consisting of a character ‘e’
  4544. or ‘E’, an optional sign, and a sequence of digits.
  4545. The hexadecimal format is as follows:
  4546. − A 0x or 0X followed by a nonempty sequence of hexadecimal
  4547. digits optionally containing a decimal-point
  4548. character—normally ‘.’, but it depends on the locale
  4549. (*note General Numeric::).
  4550. − An optional binary-exponent part, consisting of a
  4551. character ‘p’ or ‘P’, an optional sign, and a sequence of
  4552. digits.
  4553. • Any remaining characters in the string. If TAILPTR is not a
  4554. null pointer, a pointer to this tail of the string is stored
  4555. in ‘*TAILPTR’.
  4556. If the string is empty, contains only whitespace, or does not
  4557. contain an initial substring that has the expected syntax for a
  4558. floating-point number, no conversion is performed. In this case,
  4559. ‘strtod’ returns a value of zero and the value returned in
  4560. ‘*TAILPTR’ is the value of STRING.
  4561. In a locale other than the standard ‘"C"’ or ‘"POSIX"’ locales,
  4562. this function may recognize additional locale-dependent syntax.
  4563. If the string has valid syntax for a floating-point number but the
  4564. value is outside the range of a ‘double’, ‘strtod’ will signal
  4565. overflow or underflow as described in *note Math Error Reporting::.
  4566. ‘strtod’ recognizes four special input strings. The strings
  4567. ‘"inf"’ and ‘"infinity"’ are converted to oo, or to the largest
  4568. representable value if the floating-point format doesn’t support
  4569. infinities. You can prepend a ‘"+"’ or ‘"-"’ to specify the sign.
  4570. Case is ignored when scanning these strings.
  4571. The strings ‘"nan"’ and ‘"nan(CHARS...)"’ are converted to NaN.
  4572. Again, case is ignored. If CHARS... are provided, they are used in
  4573. some unspecified fashion to select a particular representation of
  4574. NaN (there can be several).
  4575. Since zero is a valid result as well as the value returned on
  4576. error, you should check for errors in the same way as for ‘strtol’,
  4577. by examining ‘errno’ and TAILPTR.
  4578. -- Function: float strtof (const char *STRING, char **TAILPTR)
  4579. -- Function: long double strtold (const char *STRING, char **TAILPTR)
  4580. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4581. Safety Concepts::.
  4582. These functions are analogous to ‘strtod’, but return ‘float’ and
  4583. ‘long double’ values respectively. They report errors in the same
  4584. way as ‘strtod’. ‘strtof’ can be substantially faster than
  4585. ‘strtod’, but has less precision; conversely, ‘strtold’ can be much
  4586. slower but has more precision (on systems where ‘long double’ is a
  4587. separate type).
  4588. These functions have been GNU extensions and are new to ISO C99.
  4589. -- Function: _FloatN strtofN (const char *STRING, char **TAILPTR)
  4590. -- Function: _FloatNx strtofNx (const char *STRING, char **TAILPTR)
  4591. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4592. Safety Concepts::.
  4593. These functions are like ‘strtod’, except for the return type.
  4594. They were introduced in ISO/IEC TS 18661-3 and are available on
  4595. machines that support the related types; *note Mathematics::.
  4596. -- Function: double wcstod (const wchar_t *restrict STRING, wchar_t
  4597. **restrict TAILPTR)
  4598. -- Function: float wcstof (const wchar_t *STRING, wchar_t **TAILPTR)
  4599. -- Function: long double wcstold (const wchar_t *STRING, wchar_t
  4600. **TAILPTR)
  4601. -- Function: _FloatN wcstofN (const wchar_t *STRING, wchar_t **TAILPTR)
  4602. -- Function: _FloatNx wcstofNx (const wchar_t *STRING, wchar_t
  4603. **TAILPTR)
  4604. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4605. Safety Concepts::.
  4606. The ‘wcstod’, ‘wcstof’, ‘wcstol’, ‘wcstofN’, and ‘wcstofNx’
  4607. functions are equivalent in nearly all aspects to the ‘strtod’,
  4608. ‘strtof’, ‘strtold’, ‘strtofN’, and ‘strtofNx’ functions, but they
  4609. handle wide character strings.
  4610. The ‘wcstod’ function was introduced in Amendment 1 of ISO C90.
  4611. The ‘wcstof’ and ‘wcstold’ functions were introduced in ISO C99.
  4612. The ‘wcstofN’ and ‘wcstofNx’ functions are not in any standard, but
  4613. are added to provide completeness for the non-deprecated interface
  4614. of wide character string to floating-point conversion functions.
  4615. They are only available on machines that support the related types;
  4616. *note Mathematics::.
  4617. -- Function: double atof (const char *STRING)
  4618. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  4619. Safety Concepts::.
  4620. This function is similar to the ‘strtod’ function, except that it
  4621. need not detect overflow and underflow errors. The ‘atof’ function
  4622. is provided mostly for compatibility with existing code; using
  4623. ‘strtod’ is more robust.
  4624. The GNU C Library also provides ‘_l’ versions of these functions,
  4625. which take an additional argument, the locale to use in conversion.
  4626. See also *note Parsing of Integers::.
  4627. 
  4628. File: libc.info, Node: Printing of Floats, Next: System V Number Conversion, Prev: Parsing of Numbers, Up: Arithmetic
  4629. 20.12 Printing of Floats
  4630. ========================
  4631. The ‘strfrom’ functions are declared in ‘stdlib.h’.
  4632. -- Function: int strfromd (char *restrict STRING, size_t SIZE, const
  4633. char *restrict FORMAT, double VALUE)
  4634. -- Function: int strfromf (char *restrict STRING, size_t SIZE, const
  4635. char *restrict FORMAT, float VALUE)
  4636. -- Function: int strfroml (char *restrict STRING, size_t SIZE, const
  4637. char *restrict FORMAT, long double VALUE)
  4638. Preliminary: | MT-Safe locale | AS-Unsafe heap | AC-Unsafe mem |
  4639. *Note POSIX Safety Concepts::.
  4640. The functions ‘strfromd’ (“string-from-double”), ‘strfromf’
  4641. (“string-from-float”), and ‘strfroml’ (“string-from-long-double”)
  4642. convert the floating-point number VALUE to a string of characters
  4643. and stores them into the area pointed to by STRING. The conversion
  4644. writes at most SIZE characters and respects the format specified by
  4645. FORMAT.
  4646. The format string must start with the character ‘%’. An optional
  4647. precision follows, which starts with a period, ‘.’, and may be
  4648. followed by a decimal integer, representing the precision. If a
  4649. decimal integer is not specified after the period, the precision is
  4650. taken to be zero. The character ‘*’ is not allowed. Finally, the
  4651. format string ends with one of the following conversion specifiers:
  4652. ‘a’, ‘A’, ‘e’, ‘E’, ‘f’, ‘F’, ‘g’ or ‘G’ (*note Table of Output
  4653. Conversions::). Invalid format strings result in undefined
  4654. behavior.
  4655. These functions return the number of characters that would have
  4656. been written to STRING had SIZE been sufficiently large, not
  4657. counting the terminating null character. Thus, the null-terminated
  4658. output has been completely written if and only if the returned
  4659. value is less than SIZE.
  4660. These functions were introduced by ISO/IEC TS 18661-1.
  4661. -- Function: int strfromfN (char *restrict STRING, size_t SIZE, const
  4662. char *restrict FORMAT, _FloatN VALUE)
  4663. -- Function: int strfromfNx (char *restrict STRING, size_t SIZE, const
  4664. char *restrict FORMAT, _FloatNx VALUE)
  4665. Preliminary: | MT-Safe locale | AS-Unsafe heap | AC-Unsafe mem |
  4666. *Note POSIX Safety Concepts::.
  4667. These functions are like ‘strfromd’, except for the type of
  4668. ‘value’.
  4669. They were introduced in ISO/IEC TS 18661-3 and are available on
  4670. machines that support the related types; *note Mathematics::.
  4671. 
  4672. File: libc.info, Node: System V Number Conversion, Prev: Printing of Floats, Up: Arithmetic
  4673. 20.13 Old-fashioned System V number-to-string functions
  4674. =======================================================
  4675. The old System V C library provided three functions to convert numbers
  4676. to strings, with unusual and hard-to-use semantics. The GNU C Library
  4677. also provides these functions and some natural extensions.
  4678. These functions are only available in the GNU C Library and on
  4679. systems descended from AT&T Unix. Therefore, unless these functions do
  4680. precisely what you need, it is better to use ‘sprintf’, which is
  4681. standard.
  4682. All these functions are defined in ‘stdlib.h’.
  4683. -- Function: char * ecvt (double VALUE, int NDIGIT, int *DECPT, int
  4684. *NEG)
  4685. Preliminary: | MT-Unsafe race:ecvt | AS-Unsafe | AC-Safe | *Note
  4686. POSIX Safety Concepts::.
  4687. The function ‘ecvt’ converts the floating-point number VALUE to a
  4688. string with at most NDIGIT decimal digits. The returned string
  4689. contains no decimal point or sign. The first digit of the string
  4690. is non-zero (unless VALUE is actually zero) and the last digit is
  4691. rounded to nearest. ‘*DECPT’ is set to the index in the string of
  4692. the first digit after the decimal point. ‘*NEG’ is set to a
  4693. nonzero value if VALUE is negative, zero otherwise.
  4694. If NDIGIT decimal digits would exceed the precision of a ‘double’
  4695. it is reduced to a system-specific value.
  4696. The returned string is statically allocated and overwritten by each
  4697. call to ‘ecvt’.
  4698. If VALUE is zero, it is implementation defined whether ‘*DECPT’ is
  4699. ‘0’ or ‘1’.
  4700. For example: ‘ecvt (12.3, 5, &d, &n)’ returns ‘"12300"’ and sets D
  4701. to ‘2’ and N to ‘0’.
  4702. -- Function: char * fcvt (double VALUE, int NDIGIT, int *DECPT, int
  4703. *NEG)
  4704. Preliminary: | MT-Unsafe race:fcvt | AS-Unsafe heap | AC-Unsafe mem
  4705. | *Note POSIX Safety Concepts::.
  4706. The function ‘fcvt’ is like ‘ecvt’, but NDIGIT specifies the number
  4707. of digits after the decimal point. If NDIGIT is less than zero,
  4708. VALUE is rounded to the NDIGIT+1’th place to the left of the
  4709. decimal point. For example, if NDIGIT is ‘-1’, VALUE will be
  4710. rounded to the nearest 10. If NDIGIT is negative and larger than
  4711. the number of digits to the left of the decimal point in VALUE,
  4712. VALUE will be rounded to one significant digit.
  4713. If NDIGIT decimal digits would exceed the precision of a ‘double’
  4714. it is reduced to a system-specific value.
  4715. The returned string is statically allocated and overwritten by each
  4716. call to ‘fcvt’.
  4717. -- Function: char * gcvt (double VALUE, int NDIGIT, char *BUF)
  4718. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4719. Concepts::.
  4720. ‘gcvt’ is functionally equivalent to ‘sprintf(buf, "%*g", ndigit,
  4721. value)’. It is provided only for compatibility’s sake. It returns
  4722. BUF.
  4723. If NDIGIT decimal digits would exceed the precision of a ‘double’
  4724. it is reduced to a system-specific value.
  4725. As extensions, the GNU C Library provides versions of these three
  4726. functions that take ‘long double’ arguments.
  4727. -- Function: char * qecvt (long double VALUE, int NDIGIT, int *DECPT,
  4728. int *NEG)
  4729. Preliminary: | MT-Unsafe race:qecvt | AS-Unsafe | AC-Safe | *Note
  4730. POSIX Safety Concepts::.
  4731. This function is equivalent to ‘ecvt’ except that it takes a ‘long
  4732. double’ for the first parameter and that NDIGIT is restricted by
  4733. the precision of a ‘long double’.
  4734. -- Function: char * qfcvt (long double VALUE, int NDIGIT, int *DECPT,
  4735. int *NEG)
  4736. Preliminary: | MT-Unsafe race:qfcvt | AS-Unsafe heap | AC-Unsafe
  4737. mem | *Note POSIX Safety Concepts::.
  4738. This function is equivalent to ‘fcvt’ except that it takes a ‘long
  4739. double’ for the first parameter and that NDIGIT is restricted by
  4740. the precision of a ‘long double’.
  4741. -- Function: char * qgcvt (long double VALUE, int NDIGIT, char *BUF)
  4742. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4743. Concepts::.
  4744. This function is equivalent to ‘gcvt’ except that it takes a ‘long
  4745. double’ for the first parameter and that NDIGIT is restricted by
  4746. the precision of a ‘long double’.
  4747. The ‘ecvt’ and ‘fcvt’ functions, and their ‘long double’ equivalents,
  4748. all return a string located in a static buffer which is overwritten by
  4749. the next call to the function. The GNU C Library provides another set
  4750. of extended functions which write the converted string into a
  4751. user-supplied buffer. These have the conventional ‘_r’ suffix.
  4752. ‘gcvt_r’ is not necessary, because ‘gcvt’ already uses a
  4753. user-supplied buffer.
  4754. -- Function: int ecvt_r (double VALUE, int NDIGIT, int *DECPT, int
  4755. *NEG, char *BUF, size_t LEN)
  4756. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4757. Concepts::.
  4758. The ‘ecvt_r’ function is the same as ‘ecvt’, except that it places
  4759. its result into the user-specified buffer pointed to by BUF, with
  4760. length LEN. The return value is ‘-1’ in case of an error and zero
  4761. otherwise.
  4762. This function is a GNU extension.
  4763. -- Function: int fcvt_r (double VALUE, int NDIGIT, int *DECPT, int
  4764. *NEG, char *BUF, size_t LEN)
  4765. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4766. Concepts::.
  4767. The ‘fcvt_r’ function is the same as ‘fcvt’, except that it places
  4768. its result into the user-specified buffer pointed to by BUF, with
  4769. length LEN. The return value is ‘-1’ in case of an error and zero
  4770. otherwise.
  4771. This function is a GNU extension.
  4772. -- Function: int qecvt_r (long double VALUE, int NDIGIT, int *DECPT,
  4773. int *NEG, char *BUF, size_t LEN)
  4774. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4775. Concepts::.
  4776. The ‘qecvt_r’ function is the same as ‘qecvt’, except that it
  4777. places its result into the user-specified buffer pointed to by BUF,
  4778. with length LEN. The return value is ‘-1’ in case of an error and
  4779. zero otherwise.
  4780. This function is a GNU extension.
  4781. -- Function: int qfcvt_r (long double VALUE, int NDIGIT, int *DECPT,
  4782. int *NEG, char *BUF, size_t LEN)
  4783. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4784. Concepts::.
  4785. The ‘qfcvt_r’ function is the same as ‘qfcvt’, except that it
  4786. places its result into the user-specified buffer pointed to by BUF,
  4787. with length LEN. The return value is ‘-1’ in case of an error and
  4788. zero otherwise.
  4789. This function is a GNU extension.
  4790. 
  4791. File: libc.info, Node: Date and Time, Next: Resource Usage And Limitation, Prev: Arithmetic, Up: Top
  4792. 21 Date and Time
  4793. ****************
  4794. This chapter describes functions for manipulating dates and times,
  4795. including functions for determining what time it is and conversion
  4796. between different time representations.
  4797. * Menu:
  4798. * Time Basics:: Concepts and definitions.
  4799. * Time Types:: Data types to represent time.
  4800. * Calculating Elapsed Time:: How to calculate the length of an interval.
  4801. * Processor And CPU Time:: Time a program has spent executing.
  4802. * Calendar Time:: Manipulation of “real” dates and times.
  4803. * Setting an Alarm:: Sending a signal after a specified time.
  4804. * Sleeping:: Waiting for a period of time.
  4805. 
  4806. File: libc.info, Node: Time Basics, Next: Time Types, Up: Date and Time
  4807. 21.1 Time Basics
  4808. ================
  4809. Discussing time in a technical manual can be difficult because the word
  4810. “time” in English refers to lots of different things. In this manual,
  4811. we use a rigorous terminology to avoid confusion, and the only thing we
  4812. use the simple word “time” for is to talk about the abstract concept.
  4813. A “calendar time” is a point in the time continuum, for example
  4814. November 4, 1990, at 18:02.5 UTC. Sometimes this is called “absolute
  4815. time”.
  4816. We don’t speak of a “date”, because that is inherent in a calendar
  4817. time.
  4818. An “interval” is a contiguous part of the time continuum between two
  4819. calendar times, for example the hour between 9:00 and 10:00 on July 4,
  4820. 1980.
  4821. An “elapsed time” is the length of an interval, for example, 35
  4822. minutes. People sometimes sloppily use the word “interval” to refer to
  4823. the elapsed time of some interval.
  4824. An “amount of time” is a sum of elapsed times, which need not be of
  4825. any specific intervals. For example, the amount of time it takes to
  4826. read a book might be 9 hours, independently of when and in how many
  4827. sittings it is read.
  4828. A “period” is the elapsed time of an interval between two events,
  4829. especially when they are part of a sequence of regularly repeating
  4830. events.
  4831. A “simple calendar time” is a calendar time represented as an elapsed
  4832. time since a fixed, implementation-specific calendar time called the
  4833. “epoch”. This representation is convenient for doing calculations on
  4834. calendar times, such as finding the elapsed time between two calendar
  4835. times. Simple calendar times are independent of time zone; they
  4836. represent the same instant in time regardless of where on the globe the
  4837. computer is.
  4838. POSIX says that simple calendar times do not include leap seconds,
  4839. but some (otherwise POSIX-conformant) systems can be configured to
  4840. include leap seconds in simple calendar times.
  4841. A “broken-down time” is a calendar time represented by its components
  4842. in the Gregorian calendar: year, month, day, hour, minute, and second.
  4843. A broken-down time value is relative to a specific time zone, and so it
  4844. is also sometimes called a “local time”. Broken-down times are most
  4845. useful for input and output, as they are easier for people to
  4846. understand, but more difficult to calculate with.
  4847. “CPU time” measures the amount of time that a single process has
  4848. actively used a CPU to perform computations. It does not include the
  4849. time that process has spent waiting for external events. The system
  4850. tracks the CPU time used by each process separately.
  4851. “Processor time” measures the amount of time _any_ CPU has been in
  4852. use by _any_ process. It is a basic system resource, since there’s a
  4853. limit to how much can exist in any given interval (the elapsed time of
  4854. the interval times the number of CPUs in the computer)
  4855. People often call this CPU time, but we reserve the latter term in
  4856. this manual for the definition above.
  4857. 
  4858. File: libc.info, Node: Time Types, Next: Calculating Elapsed Time, Prev: Time Basics, Up: Date and Time
  4859. 21.2 Time Types
  4860. ===============
  4861. ISO C and POSIX define several data types for representing elapsed
  4862. times, simple calendar times, and broken-down times.
  4863. -- Data Type: clock_t
  4864. ‘clock_t’ is used to measure processor and CPU time. It may be an
  4865. integer or a floating-point type. Its values are counts of “clock
  4866. ticks” since some arbitrary event in the past. The number of clock
  4867. ticks per second is system-specific. *Note Processor And CPU
  4868. Time::, for further detail.
  4869. -- Data Type: time_t
  4870. ‘time_t’ is the simplest data type used to represent simple
  4871. calendar time.
  4872. In ISO C, ‘time_t’ can be either an integer or a floating-point
  4873. type, and the meaning of ‘time_t’ values is not specified. The
  4874. only things a strictly conforming program can do with ‘time_t’
  4875. values are: pass them to ‘difftime’ to get the elapsed time between
  4876. two simple calendar times (*note Calculating Elapsed Time::), and
  4877. pass them to the functions that convert them to broken-down time
  4878. (*note Broken-down Time::).
  4879. On POSIX-conformant systems, ‘time_t’ is an integer type and its
  4880. values represent the number of seconds elapsed since the “epoch”,
  4881. which is 00:00:00 on January 1, 1970, Coordinated Universal Time.
  4882. The GNU C Library additionally guarantees that ‘time_t’ is a signed
  4883. type, and that all of its functions operate correctly on negative
  4884. ‘time_t’ values, which are interpreted as times before the epoch.
  4885. -- Data Type: struct timespec
  4886. ‘struct timespec’ represents a simple calendar time, or an elapsed
  4887. time, with sub-second resolution. It is declared in ‘time.h’ and
  4888. has the following members:
  4889. ‘time_t tv_sec’
  4890. The number of whole seconds elapsed since the epoch (for a
  4891. simple calendar time) or since some other starting point (for
  4892. an elapsed time).
  4893. ‘long int tv_nsec’
  4894. The number of nanoseconds elapsed since the time given by the
  4895. ‘tv_sec’ member.
  4896. When ‘struct timespec’ values are produced by GNU C Library
  4897. functions, the value in this field will always be greater than
  4898. or equal to zero, and less than 1,000,000,000. When ‘struct
  4899. timespec’ values are supplied to GNU C Library functions, the
  4900. value in this field must be in the same range.
  4901. -- Data Type: struct timeval
  4902. ‘struct timeval’ is an older type for representing a simple
  4903. calendar time, or an elapsed time, with sub-second resolution. It
  4904. is almost the same as ‘struct timespec’, but provides only
  4905. microsecond resolution. It is declared in ‘sys/time.h’ and has the
  4906. following members:
  4907. ‘time_t tv_sec’
  4908. The number of whole seconds elapsed since the epoch (for a
  4909. simple calendar time) or since some other starting point (for
  4910. an elapsed time).
  4911. ‘long int tv_usec’
  4912. The number of microseconds elapsed since the time given by the
  4913. ‘tv_sec’ member.
  4914. When ‘struct timeval’ values are produced by GNU C Library
  4915. functions, the value in this field will always be greater than
  4916. or equal to zero, and less than 1,000,000. When ‘struct
  4917. timeval’ values are supplied to GNU C Library functions, the
  4918. value in this field must be in the same range.
  4919. -- Data Type: struct tm
  4920. This is the data type used to represent a broken-down time. It has
  4921. separate fields for year, month, day, and so on. *Note Broken-down
  4922. Time::, for further details.
  4923. 
  4924. File: libc.info, Node: Calculating Elapsed Time, Next: Processor And CPU Time, Prev: Time Types, Up: Date and Time
  4925. 21.3 Calculating Elapsed Time
  4926. =============================
  4927. Often, one wishes to calculate an elapsed time as the difference between
  4928. two simple calendar times. The GNU C Library provides only one function
  4929. for this purpose.
  4930. -- Function: double difftime (time_t END, time_t BEGIN)
  4931. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4932. Concepts::.
  4933. The ‘difftime’ function returns the number of seconds of elapsed
  4934. time from calendar time BEGIN to calendar time END, as a value of
  4935. type ‘double’.
  4936. On POSIX-conformant systems, the advantage of using ‘difftime (END,
  4937. BEGIN)’ over ‘END - BEGIN’ is that it will produce the
  4938. mathematically correct result even if END and BEGIN are so far
  4939. apart that a simple subtraction would overflow. However, if they
  4940. are so far apart that a ‘double’ cannot exactly represent the
  4941. difference, the result will be inexact.
  4942. On other systems, ‘time_t’ values might be encoded in a way that
  4943. prevents subtraction from working directly, and then ‘difftime’
  4944. would be the only way to compute their difference.
  4945. The GNU C Library does not provide any functions for computing the
  4946. difference between two values of type ‘struct timeval’ or
  4947. ‘struct timespec’. Here is the recommended way to do this calculation
  4948. by hand. It works even on some peculiar operating systems where the
  4949. ‘tv_sec’ member has an unsigned type.
  4950. /* Subtract the ‘struct timeval’ values X and Y,
  4951. storing the result in RESULT.
  4952. Return 1 if the difference is negative, otherwise 0. */
  4953. int
  4954. timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y)
  4955. {
  4956. /* Perform the carry for the later subtraction by updating Y. */
  4957. if (x->tv_usec < y->tv_usec) {
  4958. int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
  4959. y->tv_usec -= 1000000 * nsec;
  4960. y->tv_sec += nsec;
  4961. }
  4962. if (x->tv_usec - y->tv_usec > 1000000) {
  4963. int nsec = (x->tv_usec - y->tv_usec) / 1000000;
  4964. y->tv_usec += 1000000 * nsec;
  4965. y->tv_sec -= nsec;
  4966. }
  4967. /* Compute the time remaining to wait.
  4968. ‘tv_usec’ is certainly positive. */
  4969. result->tv_sec = x->tv_sec - y->tv_sec;
  4970. result->tv_usec = x->tv_usec - y->tv_usec;
  4971. /* Return 1 if result is negative. */
  4972. return x->tv_sec < y->tv_sec;
  4973. }
  4974. 
  4975. File: libc.info, Node: Processor And CPU Time, Next: Calendar Time, Prev: Calculating Elapsed Time, Up: Date and Time
  4976. 21.4 Processor And CPU Time
  4977. ===========================
  4978. If you’re trying to optimize your program or measure its efficiency,
  4979. it’s very useful to know how much processor time it uses. For that,
  4980. calendar time and elapsed times are useless because a process may spend
  4981. time waiting for I/O or for other processes to use the CPU. However, you
  4982. can get the information with the functions in this section.
  4983. CPU time (*note Time Basics::) is represented by the data type
  4984. ‘clock_t’, which is a number of “clock ticks”. It gives the total
  4985. amount of time a process has actively used a CPU since some arbitrary
  4986. event. On GNU systems, that event is the creation of the process.
  4987. While arbitrary in general, the event is always the same event for any
  4988. particular process, so you can always measure how much time on the CPU a
  4989. particular computation takes by examining the process’ CPU time before
  4990. and after the computation.
  4991. On GNU/Linux and GNU/Hurd systems, ‘clock_t’ is equivalent to ‘long
  4992. int’ and ‘CLOCKS_PER_SEC’ is an integer value. But in other systems,
  4993. both ‘clock_t’ and the macro ‘CLOCKS_PER_SEC’ can be either integer or
  4994. floating-point types. Casting CPU time values to ‘double’, as in the
  4995. example above, makes sure that operations such as arithmetic and
  4996. printing work properly and consistently no matter what the underlying
  4997. representation is.
  4998. Note that the clock can wrap around. On a 32bit system with
  4999. ‘CLOCKS_PER_SEC’ set to one million this function will return the same
  5000. value approximately every 72 minutes.
  5001. For additional functions to examine a process’ use of processor time,
  5002. and to control it, see *note Resource Usage And Limitation::.
  5003. * Menu:
  5004. * CPU Time:: The ‘clock’ function.
  5005. * Processor Time:: The ‘times’ function.
  5006. 
  5007. File: libc.info, Node: CPU Time, Next: Processor Time, Up: Processor And CPU Time
  5008. 21.4.1 CPU Time Inquiry
  5009. -----------------------
  5010. To get a process’ CPU time, you can use the ‘clock’ function. This
  5011. facility is declared in the header file ‘time.h’.
  5012. In typical usage, you call the ‘clock’ function at the beginning and
  5013. end of the interval you want to time, subtract the values, and then
  5014. divide by ‘CLOCKS_PER_SEC’ (the number of clock ticks per second) to get
  5015. processor time, like this:
  5016. #include <time.h>
  5017. clock_t start, end;
  5018. double cpu_time_used;
  5019. start = clock();
  5020. ... /* Do the work. */
  5021. end = clock();
  5022. cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
  5023. Do not use a single CPU time as an amount of time; it doesn’t work
  5024. that way. Either do a subtraction as shown above or query processor
  5025. time directly. *Note Processor Time::.
  5026. Different computers and operating systems vary wildly in how they
  5027. keep track of CPU time. It’s common for the internal processor clock to
  5028. have a resolution somewhere between a hundredth and millionth of a
  5029. second.
  5030. -- Macro: int CLOCKS_PER_SEC
  5031. The value of this macro is the number of clock ticks per second
  5032. measured by the ‘clock’ function. POSIX requires that this value
  5033. be one million independent of the actual resolution.
  5034. -- Function: clock_t clock (void)
  5035. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5036. Concepts::.
  5037. This function returns the calling process’ current CPU time. If
  5038. the CPU time is not available or cannot be represented, ‘clock’
  5039. returns the value ‘(clock_t)(-1)’.
  5040. 
  5041. File: libc.info, Node: Processor Time, Prev: CPU Time, Up: Processor And CPU Time
  5042. 21.4.2 Processor Time Inquiry
  5043. -----------------------------
  5044. The ‘times’ function returns information about a process’ consumption of
  5045. processor time in a ‘struct tms’ object, in addition to the process’ CPU
  5046. time. *Note Time Basics::. You should include the header file
  5047. ‘sys/times.h’ to use this facility.
  5048. -- Data Type: struct tms
  5049. The ‘tms’ structure is used to return information about process
  5050. times. It contains at least the following members:
  5051. ‘clock_t tms_utime’
  5052. This is the total processor time the calling process has used
  5053. in executing the instructions of its program.
  5054. ‘clock_t tms_stime’
  5055. This is the processor time the system has used on behalf of
  5056. the calling process.
  5057. ‘clock_t tms_cutime’
  5058. This is the sum of the ‘tms_utime’ values and the ‘tms_cutime’
  5059. values of all terminated child processes of the calling
  5060. process, whose status has been reported to the parent process
  5061. by ‘wait’ or ‘waitpid’; see *note Process Completion::. In
  5062. other words, it represents the total processor time used in
  5063. executing the instructions of all the terminated child
  5064. processes of the calling process, excluding child processes
  5065. which have not yet been reported by ‘wait’ or ‘waitpid’.
  5066. ‘clock_t tms_cstime’
  5067. This is similar to ‘tms_cutime’, but represents the total
  5068. processor time the system has used on behalf of all the
  5069. terminated child processes of the calling process.
  5070. All of the times are given in numbers of clock ticks. Unlike CPU
  5071. time, these are the actual amounts of time; not relative to any
  5072. event. *Note Creating a Process::.
  5073. -- Macro: int CLK_TCK
  5074. This is an obsolete name for the number of clock ticks per second.
  5075. Use ‘sysconf (_SC_CLK_TCK)’ instead.
  5076. -- Function: clock_t times (struct tms *BUFFER)
  5077. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5078. Concepts::.
  5079. The ‘times’ function stores the processor time information for the
  5080. calling process in BUFFER.
  5081. The return value is the number of clock ticks since an arbitrary
  5082. point in the past, e.g. since system start-up. ‘times’ returns
  5083. ‘(clock_t)(-1)’ to indicate failure.
  5084. *Portability Note:* The ‘clock’ function described in *note CPU
  5085. Time:: is specified by the ISO C standard. The ‘times’ function is a
  5086. feature of POSIX.1. On GNU systems, the CPU time is defined to be
  5087. equivalent to the sum of the ‘tms_utime’ and ‘tms_stime’ fields returned
  5088. by ‘times’.
  5089. 
  5090. File: libc.info, Node: Calendar Time, Next: Setting an Alarm, Prev: Processor And CPU Time, Up: Date and Time
  5091. 21.5 Calendar Time
  5092. ==================
  5093. This section describes the functions for getting, setting, and
  5094. manipulating calendar times.
  5095. * Menu:
  5096. * Getting the Time:: Functions for finding out what time it is.
  5097. * Setting and Adjusting the Time::
  5098. Functions for setting and adjusting
  5099. the system clock.
  5100. * Broken-down Time:: Facilities for manipulating local time.
  5101. * Formatting Calendar Time:: Converting times to strings.
  5102. * Parsing Date and Time:: Convert textual time and date information back
  5103. into broken-down time values.
  5104. * TZ Variable:: How users specify the time zone.
  5105. * Time Zone Functions:: Functions to examine or specify the time zone.
  5106. * Time Functions Example:: An example program showing use of some of
  5107. the time functions.
  5108. 
  5109. File: libc.info, Node: Getting the Time, Next: Setting and Adjusting the Time, Up: Calendar Time
  5110. 21.5.1 Getting the Time
  5111. -----------------------
  5112. The GNU C Library provides several functions for getting the current
  5113. calendar time, with different levels of resolution.
  5114. -- Function: time_t time (time_t *RESULT)
  5115. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5116. Concepts::.
  5117. This is the simplest function for getting the current calendar
  5118. time. It returns the calendar time as a value of type ‘time_t’; on
  5119. POSIX systems, that means it has a resolution of one second. It
  5120. uses the same clock as ‘clock_gettime (CLOCK_REALTIME_COARSE)’,
  5121. when the clock is available or ‘clock_gettime (CLOCK_REALTIME)’
  5122. otherwise.
  5123. If the argument RESULT is not a null pointer, the calendar time
  5124. value is also stored in ‘*RESULT’.
  5125. This function cannot fail.
  5126. Some applications need more precise timekeeping than is possible with
  5127. a ‘time_t’ alone. Some applications also need more control over what is
  5128. meant by “the current time.” For these applications, POSIX provides a
  5129. function ‘clock_gettime’ that can retrieve the time with up to
  5130. nanosecond precision, from a variety of different clocks. Clocks can be
  5131. system-wide, measuring time the same for all processes; or they can be
  5132. per-process or per-thread, measuring CPU time consumed by a particular
  5133. process, or some other similar resource. Each clock has its own
  5134. resolution and epoch. You can find the resolution of a clock with the
  5135. function ‘clock_getres’. There is no function to get the epoch for a
  5136. clock; either it is fixed and documented, or the clock is not meant to
  5137. be used to measure absolute times.
  5138. -- Data Type: clockid_t
  5139. The type ‘clockid_t’ is used for constants that indicate which of
  5140. several system clocks one wishes to use.
  5141. All systems that support this family of functions will define at
  5142. least this clock constant:
  5143. -- Macro: clockid_t CLOCK_REALTIME
  5144. This clock uses the POSIX epoch, 00:00:00 on January 1, 1970,
  5145. Coordinated Universal Time. It is close to, but not necessarily in
  5146. lock-step with, the clocks of ‘time’ (above) and of ‘gettimeofday’
  5147. (below).
  5148. A second clock constant which is not universal, but still very
  5149. common, is for a clock measuring “monotonic time”. Monotonic time is
  5150. useful for measuring elapsed times, because it guarantees that those
  5151. measurements are not affected by changes to the system clock.
  5152. -- Macro: clockid_t CLOCK_MONOTONIC
  5153. System-wide clock that continuously measures the advancement of
  5154. calendar time, ignoring discontinuous changes to the system’s
  5155. setting for absolute calendar time.
  5156. The epoch for this clock is an unspecified point in the past. The
  5157. epoch may change if the system is rebooted or suspended.
  5158. Therefore, ‘CLOCK_MONOTONIC’ cannot be used to measure absolute
  5159. time, only elapsed time.
  5160. Systems may support more than just these two clocks.
  5161. -- Function: int clock_gettime (clockid_t CLOCK, struct timespec *TS)
  5162. Get the current time accoding to the clock identified by CLOCK,
  5163. storing it as seconds and nanoseconds in ‘*TS’. *Note Time
  5164. Types::, for a description of ‘struct timespec’.
  5165. The return value is ‘0’ on success and ‘-1’ on failure. The
  5166. following ‘errno’ error condition is defined for this function:
  5167. ‘EINVAL’
  5168. The clock identified by CLOCK is not supported.
  5169. ‘clock_gettime’ reports the time scaled to seconds and nanoseconds,
  5170. but the actual resolution of each clock may not be as fine as one
  5171. nanosecond, and may not be the same for all clocks. POSIX also provides
  5172. a function for finding out the actual resolution of a clock:
  5173. -- Function: int clock_getres (clockid_t CLOCK, struct timespec *RES)
  5174. Get the actual resolution of the clock identified by CLOCK, storing
  5175. it in ‘*TS’.
  5176. For instance, if the clock hardware for ‘CLOCK_REALTIME’ uses a
  5177. quartz crystal that oscillates at 32.768 kHz, then its resolution
  5178. would be 30.518 microseconds, and
  5179. ‘clock_getres (CLOCK_REALTIME, &r)’ would set ‘r.tv_sec’ to 0 and
  5180. ‘r.tv_nsec’ to 30518.
  5181. The return value is ‘0’ on success and ‘-1’ on failure. The
  5182. following ‘errno’ error condition is defined for this function:
  5183. ‘EINVAL’
  5184. The clock identified by CLOCK is not supported.
  5185. These functions, and the constants that identify particular clocks,
  5186. are declared in ‘time.h’.
  5187. *Portability Note:* On some systems, including systems that use older
  5188. versions of the GNU C Library, programs that use ‘clock_gettime’ or
  5189. ‘clock_setres’ must be linked with the ‘-lrt’ library. This has not
  5190. been necessary with the GNU C Library since version 2.17.
  5191. The GNU C Library also provides an older, but still widely used,
  5192. function for getting the current time with a resolution of microseconds.
  5193. This function is declared in ‘sys/time.h’.
  5194. -- Function: int gettimeofday (struct timeval *TP, void *TZP)
  5195. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5196. Concepts::.
  5197. Get the current calendar time, storing it as seconds and
  5198. microseconds in ‘*TP’. *Note Time Types::, for a description of
  5199. ‘struct timeval’. The clock of ‘gettimeofday’ is close to, but not
  5200. necessarily in lock-step with, the clocks of ‘time’ and of
  5201. ‘clock_gettime (CLOCK_REALTIME)’ (see above).
  5202. On some historic systems, if TZP was not a null pointer,
  5203. information about a system-wide time zone would be written to
  5204. ‘*TZP’. This feature is obsolete and not supported on GNU systems.
  5205. You should always supply a null pointer for this argument.
  5206. Instead, use the facilities described in *note Time Zone
  5207. Functions:: and in *note Broken-down Time:: for working with time
  5208. zones.
  5209. This function cannot fail, and its return value is always ‘0’.
  5210. *Portability Note:* As of the 2008 revision of POSIX, this function
  5211. is considered obsolete. The GNU C Library will continue to provide
  5212. this function indefinitely, but new programs should use
  5213. ‘clock_gettime’ instead.
  5214. 
  5215. File: libc.info, Node: Setting and Adjusting the Time, Next: Broken-down Time, Prev: Getting the Time, Up: Calendar Time
  5216. 21.5.2 Setting and Adjusting the Time
  5217. -------------------------------------
  5218. The clock hardware inside a modern computer is quite reliable, but it
  5219. can still be wrong. The functions in this section allow one to set the
  5220. system’s idea of the current calendar time, and to adjust the rate at
  5221. which the system counts seconds, so that the calendar time will both be
  5222. accurate, and remain accurate.
  5223. The functions in this section require special privileges to use.
  5224. *Note Users and Groups::.
  5225. -- Function: int clock_settime (clockid_t CLOCK, const struct timespec
  5226. *TS)
  5227. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5228. Concepts::.
  5229. Change the current calendar time, according to the clock identified
  5230. by CLOCK, to be the simple calendar time in ‘*TS’.
  5231. Not all of the system’s clocks can be changed. For instance, the
  5232. ‘CLOCK_REALTIME’ clock can be changed (with the appropriate
  5233. privileges), but the ‘CLOCK_MONOTONIC’ clock cannot.
  5234. Because simple calendar times are independent of time zone, this
  5235. function should not be used when the time zone changes (e.g. if the
  5236. computer is physically moved from one zone to another). Instead,
  5237. use the facilities described in *note Time Zone Functions::.
  5238. ‘clock_settime’ causes the clock to jump forwards or backwards,
  5239. which can cause a variety of problems. Changing the
  5240. ‘CLOCK_REALTIME’ clock with ‘clock_settime’ does not affect when
  5241. timers expire (*note Setting an Alarm::) or when sleeping processes
  5242. wake up (*note Sleeping::), which avoids some of the problems.
  5243. Still, for small changes made while the system is running, it is
  5244. better to use ‘ntp_adjtime’ (below) to make a smooth transition
  5245. from one time to another.
  5246. The return value is ‘0’ on success and ‘-1’ on failure. The
  5247. following ‘errno’ error conditions are defined for this function:
  5248. ‘EINVAL’
  5249. The clock identified by CLOCK is not supported or cannot be
  5250. set at all, or the simple calendar time in ‘*TS’ is invalid
  5251. (for instance, ‘ts->tv_nsec’ is negative or greater than
  5252. 999,999,999).
  5253. ‘EPERM’
  5254. This process does not have the privileges required to set the
  5255. clock identified by CLOCK.
  5256. *Portability Note*: On some systems, including systems that use
  5257. older versions of the GNU C Library, programs that use
  5258. ‘clock_settime’ must be linked with the ‘-lrt’ library. This has
  5259. not been necessary with the GNU C Library since version 2.17.
  5260. For systems that remain up and running for long periods, it is not
  5261. enough to set the time once; one should also “discipline” the clock so
  5262. that it does not drift away from the true calendar time.
  5263. The ‘ntp_gettime’ and ‘ntp_adjtime’ functions provide an interface to
  5264. monitor and discipline the system clock. For example, you can fine-tune
  5265. the rate at which the clock “ticks,” and make small adjustments to the
  5266. current reported calendar time smoothly, by temporarily speeding up or
  5267. slowing down the clock.
  5268. These functions’ names begin with ‘ntp_’ because they were designed
  5269. for use by programs implementing the Network Time Protocol to
  5270. synchronize a system’s clock with other systems’ clocks and/or with
  5271. external high-precision clock hardware.
  5272. These functions, and the constants and structures they use, are
  5273. declared in ‘sys/timex.h’.
  5274. -- Data Type: struct ntptimeval
  5275. This structure is used to report information about the system
  5276. clock. It contains the following members:
  5277. ‘struct timeval time’
  5278. The current calendar time, as if retrieved by ‘gettimeofday’.
  5279. The ‘struct timeval’ data type is described in *note Time
  5280. Types::.
  5281. ‘long int maxerror’
  5282. This is the maximum error, measured in microseconds. Unless
  5283. updated via ‘ntp_adjtime’ periodically, this value will reach
  5284. some platform-specific maximum value.
  5285. ‘long int esterror’
  5286. This is the estimated error, measured in microseconds. This
  5287. value can be set by ‘ntp_adjtime’ to indicate the estimated
  5288. offset of the system clock from the true calendar time.
  5289. -- Function: int ntp_gettime (struct ntptimeval *TPTR)
  5290. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5291. Concepts::.
  5292. The ‘ntp_gettime’ function sets the structure pointed to by TPTR to
  5293. current values. The elements of the structure afterwards contain
  5294. the values the timer implementation in the kernel assumes. They
  5295. might or might not be correct. If they are not, an ‘ntp_adjtime’
  5296. call is necessary.
  5297. The return value is ‘0’ on success and other values on failure.
  5298. The following ‘errno’ error conditions are defined for this
  5299. function:
  5300. ‘TIME_ERROR’
  5301. The precision clock model is not properly set up at the
  5302. moment, thus the clock must be considered unsynchronized, and
  5303. the values should be treated with care.
  5304. -- Data Type: struct timex
  5305. This structure is used to control and monitor the system clock. It
  5306. contains the following members:
  5307. ‘unsigned int modes’
  5308. This variable controls whether and which values are set.
  5309. Several symbolic constants have to be combined with _binary
  5310. or_ to specify the effective mode. These constants start with
  5311. ‘MOD_’.
  5312. ‘long int offset’
  5313. This value indicates the current offset of the system clock
  5314. from the true calendar time. The value is given in
  5315. microseconds. If bit ‘MOD_OFFSET’ is set in ‘modes’, the
  5316. offset (and possibly other dependent values) can be set. The
  5317. offset’s absolute value must not exceed ‘MAXPHASE’.
  5318. ‘long int frequency’
  5319. This value indicates the difference in frequency between the
  5320. true calendar time and the system clock. The value is
  5321. expressed as scaled PPM (parts per million, 0.0001%). The
  5322. scaling is ‘1 << SHIFT_USEC’. The value can be set with bit
  5323. ‘MOD_FREQUENCY’, but the absolute value must not exceed
  5324. ‘MAXFREQ’.
  5325. ‘long int maxerror’
  5326. This is the maximum error, measured in microseconds. A new
  5327. value can be set using bit ‘MOD_MAXERROR’. Unless updated via
  5328. ‘ntp_adjtime’ periodically, this value will increase steadily
  5329. and reach some platform-specific maximum value.
  5330. ‘long int esterror’
  5331. This is the estimated error, measured in microseconds. This
  5332. value can be set using bit ‘MOD_ESTERROR’.
  5333. ‘int status’
  5334. This variable reflects the various states of the clock
  5335. machinery. There are symbolic constants for the significant
  5336. bits, starting with ‘STA_’. Some of these flags can be
  5337. updated using the ‘MOD_STATUS’ bit.
  5338. ‘long int constant’
  5339. This value represents the bandwidth or stiffness of the PLL
  5340. (phase locked loop) implemented in the kernel. The value can
  5341. be changed using bit ‘MOD_TIMECONST’.
  5342. ‘long int precision’
  5343. This value represents the accuracy or the maximum error when
  5344. reading the system clock. The value is expressed in
  5345. microseconds.
  5346. ‘long int tolerance’
  5347. This value represents the maximum frequency error of the
  5348. system clock in scaled PPM. This value is used to increase the
  5349. ‘maxerror’ every second.
  5350. ‘struct timeval time’
  5351. The current calendar time.
  5352. ‘long int tick’
  5353. The elapsed time between clock ticks in microseconds. A clock
  5354. tick is a periodic timer interrupt on which the system clock
  5355. is based.
  5356. ‘long int ppsfreq’
  5357. This is the first of a few optional variables that are present
  5358. only if the system clock can use a PPS (pulse per second)
  5359. signal to discipline the system clock. The value is expressed
  5360. in scaled PPM and it denotes the difference in frequency
  5361. between the system clock and the PPS signal.
  5362. ‘long int jitter’
  5363. This value expresses a median filtered average of the PPS
  5364. signal’s dispersion in microseconds.
  5365. ‘int shift’
  5366. This value is a binary exponent for the duration of the PPS
  5367. calibration interval, ranging from ‘PPS_SHIFT’ to
  5368. ‘PPS_SHIFTMAX’.
  5369. ‘long int stabil’
  5370. This value represents the median filtered dispersion of the
  5371. PPS frequency in scaled PPM.
  5372. ‘long int jitcnt’
  5373. This counter represents the number of pulses where the jitter
  5374. exceeded the allowed maximum ‘MAXTIME’.
  5375. ‘long int calcnt’
  5376. This counter reflects the number of successful calibration
  5377. intervals.
  5378. ‘long int errcnt’
  5379. This counter represents the number of calibration errors
  5380. (caused by large offsets or jitter).
  5381. ‘long int stbcnt’
  5382. This counter denotes the number of calibrations where the
  5383. stability exceeded the threshold.
  5384. -- Function: int ntp_adjtime (struct timex *TPTR)
  5385. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5386. Concepts::.
  5387. The ‘ntp_adjtime’ function sets the structure specified by TPTR to
  5388. current values.
  5389. In addition, ‘ntp_adjtime’ updates some settings to match what you
  5390. pass to it in ‘*TPTR’. Use the ‘modes’ element of ‘*TPTR’ to
  5391. select what settings to update. You can set ‘offset’, ‘freq’,
  5392. ‘maxerror’, ‘esterror’, ‘status’, ‘constant’, and ‘tick’.
  5393. ‘modes’ = zero means set nothing.
  5394. Only the superuser can update settings.
  5395. The return value is ‘0’ on success and other values on failure.
  5396. The following ‘errno’ error conditions are defined for this
  5397. function:
  5398. ‘TIME_ERROR’
  5399. The high accuracy clock model is not properly set up at the
  5400. moment, thus the clock must be considered unsynchronized, and
  5401. the values should be treated with care. Another reason could
  5402. be that the specified new values are not allowed.
  5403. ‘EPERM’
  5404. The process specified a settings update, but is not superuser.
  5405. For more details see RFC1305 (Network Time Protocol, Version 3) and
  5406. related documents.
  5407. *Portability note:* Early versions of the GNU C Library did not
  5408. have this function, but did have the synonymous ‘adjtimex’.
  5409. -- Function: int adjtime (const struct timeval *DELTA, struct timeval
  5410. *OLDDELTA)
  5411. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5412. Concepts::.
  5413. This simpler version of ‘ntp_adjtime’ speeds up or slows down the
  5414. system clock for a short time, in order to correct it by a small
  5415. amount. This avoids a discontinuous change in the calendar time
  5416. reported by the ‘CLOCK_REALTIME’ clock, at the price of having to
  5417. wait longer for the time to become correct.
  5418. The DELTA argument specifies a relative adjustment to be made to
  5419. the clock time. If negative, the system clock is slowed down for a
  5420. while until it has lost this much elapsed time. If positive, the
  5421. system clock is speeded up for a while.
  5422. If the OLDDELTA argument is not a null pointer, the ‘adjtime’
  5423. function returns information about any previous time adjustment
  5424. that has not yet completed.
  5425. The return value is ‘0’ on success and ‘-1’ on failure. The
  5426. following ‘errno’ error condition is defined for this function:
  5427. ‘EPERM’
  5428. This process does not have the privileges required to adjust
  5429. the ‘CLOCK_REALTIME’ clock.
  5430. For compatibility, the GNU C Library also provides several older
  5431. functions for controlling the system time. New programs should prefer
  5432. to use the functions above.
  5433. -- Function: int stime (const time_t *NEWTIME)
  5434. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5435. Concepts::.
  5436. Change the ‘CLOCK_REALTIME’ calendar time to be the simple calendar
  5437. time in ‘*NEWTIME’. Calling this function is exactly the same as
  5438. calling ‘clock_settime (CLOCK_REALTIME)’, except that the new time
  5439. can only be set to a precision of one second.
  5440. This function is no longer available on GNU systems, but it may be
  5441. the _only_ way to set the time on very old Unix systems, so we
  5442. continue to document it. If it is available, it is declared in
  5443. ‘time.h’.
  5444. The return value is ‘0’ on success and ‘-1’ on failure. The
  5445. following ‘errno’ error condition is defined for this function:
  5446. ‘EPERM’
  5447. This process does not have the privileges required to adjust
  5448. the ‘CLOCK_REALTIME’ clock.
  5449. -- Function: int adjtimex (struct timex *TIMEX)
  5450. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5451. Concepts::.
  5452. ‘adjtimex’ is an older name for ‘ntp_adjtime’. This function is
  5453. only available on GNU/Linux systems. It is declared in
  5454. ‘sys/timex.h’.
  5455. -- Function: int settimeofday (const struct timeval *TP, const void
  5456. *TZP)
  5457. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5458. Concepts::.
  5459. Change the ‘CLOCK_REALTIME’ calendar time to be the simple calendar
  5460. time in ‘*NEWTIME’. This function is declared in ‘sys/time.h’.
  5461. When TZP is a null pointer, calling this function is exactly the
  5462. same as calling ‘clock_settime (CLOCK_REALTIME)’, except that the
  5463. new time can only be set to a precision of one microsecond.
  5464. When TZP is not a null pointer, the data it points to _may_ be used
  5465. to set a system-wide idea of the current timezone. This feature is
  5466. obsolete and not supported on GNU systems. Instead, use the
  5467. facilities described in *note Time Zone Functions:: and in *note
  5468. Broken-down Time:: for working with time zones.
  5469. The return value is ‘0’ on success and ‘-1’ on failure. The
  5470. following ‘errno’ error conditions are defined for this function:
  5471. ‘EPERM’
  5472. This process does not have the privileges required to set the
  5473. ‘CLOCK_REALTIME’ clock.
  5474. ‘EINVAL’
  5475. Neither TP nor TZP is a null pointer. (For historical
  5476. reasons, it is not possible to set the current time and the
  5477. current time zone in the same call.)
  5478. ‘ENOSYS’
  5479. The operating system does not support setting time zone
  5480. information, and TZP is not a null pointer.