libc.info-7 367 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245
  1. This is libc.info, produced by makeinfo version 5.2 from libc.texinfo.
  2. This file documents the GNU C Library.
  3. This is ‘The GNU C Library Reference Manual’, for version 2.25.
  4. Copyright © 1993–2017 Free Software Foundation, Inc.
  5. Permission is granted to copy, distribute and/or modify this document
  6. under the terms of the GNU Free Documentation License, Version 1.3 or
  7. any later version published by the Free Software Foundation; with the
  8. Invariant Sections being “Free Software Needs Free Documentation” and
  9. “GNU Lesser General Public License”, the Front-Cover texts being “A GNU
  10. Manual”, and with the Back-Cover Texts as in (a) below. A copy of the
  11. license is included in the section entitled "GNU Free Documentation
  12. License".
  13. (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
  14. modify this GNU manual. Buying copies from the FSF supports it in
  15. developing GNU and promoting software freedom.”
  16. INFO-DIR-SECTION Software libraries
  17. START-INFO-DIR-ENTRY
  18. * Libc: (libc). C library.
  19. END-INFO-DIR-ENTRY
  20. INFO-DIR-SECTION GNU C library functions and macros
  21. START-INFO-DIR-ENTRY
  22. * a64l: (libc)Encode Binary Data.
  23. * abort: (libc)Aborting a Program.
  24. * abs: (libc)Absolute Value.
  25. * accept: (libc)Accepting Connections.
  26. * access: (libc)Testing File Access.
  27. * acosf: (libc)Inverse Trig Functions.
  28. * acoshf: (libc)Hyperbolic Functions.
  29. * acosh: (libc)Hyperbolic Functions.
  30. * acoshl: (libc)Hyperbolic Functions.
  31. * acos: (libc)Inverse Trig Functions.
  32. * acosl: (libc)Inverse Trig Functions.
  33. * addmntent: (libc)mtab.
  34. * addseverity: (libc)Adding Severity Classes.
  35. * adjtime: (libc)High-Resolution Calendar.
  36. * adjtimex: (libc)High-Resolution Calendar.
  37. * aio_cancel64: (libc)Cancel AIO Operations.
  38. * aio_cancel: (libc)Cancel AIO Operations.
  39. * aio_error64: (libc)Status of AIO Operations.
  40. * aio_error: (libc)Status of AIO Operations.
  41. * aio_fsync64: (libc)Synchronizing AIO Operations.
  42. * aio_fsync: (libc)Synchronizing AIO Operations.
  43. * aio_init: (libc)Configuration of AIO.
  44. * aio_read64: (libc)Asynchronous Reads/Writes.
  45. * aio_read: (libc)Asynchronous Reads/Writes.
  46. * aio_return64: (libc)Status of AIO Operations.
  47. * aio_return: (libc)Status of AIO Operations.
  48. * aio_suspend64: (libc)Synchronizing AIO Operations.
  49. * aio_suspend: (libc)Synchronizing AIO Operations.
  50. * aio_write64: (libc)Asynchronous Reads/Writes.
  51. * aio_write: (libc)Asynchronous Reads/Writes.
  52. * alarm: (libc)Setting an Alarm.
  53. * aligned_alloc: (libc)Aligned Memory Blocks.
  54. * alloca: (libc)Variable Size Automatic.
  55. * alphasort64: (libc)Scanning Directory Content.
  56. * alphasort: (libc)Scanning Directory Content.
  57. * ALTWERASE: (libc)Local Modes.
  58. * ARG_MAX: (libc)General Limits.
  59. * argp_error: (libc)Argp Helper Functions.
  60. * ARGP_ERR_UNKNOWN: (libc)Argp Parser Functions.
  61. * argp_failure: (libc)Argp Helper Functions.
  62. * argp_help: (libc)Argp Help.
  63. * argp_parse: (libc)Argp.
  64. * argp_state_help: (libc)Argp Helper Functions.
  65. * argp_usage: (libc)Argp Helper Functions.
  66. * argz_add: (libc)Argz Functions.
  67. * argz_add_sep: (libc)Argz Functions.
  68. * argz_append: (libc)Argz Functions.
  69. * argz_count: (libc)Argz Functions.
  70. * argz_create: (libc)Argz Functions.
  71. * argz_create_sep: (libc)Argz Functions.
  72. * argz_delete: (libc)Argz Functions.
  73. * argz_extract: (libc)Argz Functions.
  74. * argz_insert: (libc)Argz Functions.
  75. * argz_next: (libc)Argz Functions.
  76. * argz_replace: (libc)Argz Functions.
  77. * argz_stringify: (libc)Argz Functions.
  78. * asctime: (libc)Formatting Calendar Time.
  79. * asctime_r: (libc)Formatting Calendar Time.
  80. * asinf: (libc)Inverse Trig Functions.
  81. * asinhf: (libc)Hyperbolic Functions.
  82. * asinh: (libc)Hyperbolic Functions.
  83. * asinhl: (libc)Hyperbolic Functions.
  84. * asin: (libc)Inverse Trig Functions.
  85. * asinl: (libc)Inverse Trig Functions.
  86. * asprintf: (libc)Dynamic Output.
  87. * assert: (libc)Consistency Checking.
  88. * assert_perror: (libc)Consistency Checking.
  89. * atan2f: (libc)Inverse Trig Functions.
  90. * atan2: (libc)Inverse Trig Functions.
  91. * atan2l: (libc)Inverse Trig Functions.
  92. * atanf: (libc)Inverse Trig Functions.
  93. * atanhf: (libc)Hyperbolic Functions.
  94. * atanh: (libc)Hyperbolic Functions.
  95. * atanhl: (libc)Hyperbolic Functions.
  96. * atan: (libc)Inverse Trig Functions.
  97. * atanl: (libc)Inverse Trig Functions.
  98. * atexit: (libc)Cleanups on Exit.
  99. * atof: (libc)Parsing of Floats.
  100. * atoi: (libc)Parsing of Integers.
  101. * atol: (libc)Parsing of Integers.
  102. * atoll: (libc)Parsing of Integers.
  103. * backtrace: (libc)Backtraces.
  104. * backtrace_symbols_fd: (libc)Backtraces.
  105. * backtrace_symbols: (libc)Backtraces.
  106. * basename: (libc)Finding Tokens in a String.
  107. * basename: (libc)Finding Tokens in a String.
  108. * BC_BASE_MAX: (libc)Utility Limits.
  109. * BC_DIM_MAX: (libc)Utility Limits.
  110. * bcmp: (libc)String/Array Comparison.
  111. * bcopy: (libc)Copying Strings and Arrays.
  112. * BC_SCALE_MAX: (libc)Utility Limits.
  113. * BC_STRING_MAX: (libc)Utility Limits.
  114. * bind: (libc)Setting Address.
  115. * bind_textdomain_codeset: (libc)Charset conversion in gettext.
  116. * bindtextdomain: (libc)Locating gettext catalog.
  117. * BRKINT: (libc)Input Modes.
  118. * brk: (libc)Resizing the Data Segment.
  119. * bsearch: (libc)Array Search Function.
  120. * btowc: (libc)Converting a Character.
  121. * BUFSIZ: (libc)Controlling Buffering.
  122. * bzero: (libc)Copying Strings and Arrays.
  123. * cabsf: (libc)Absolute Value.
  124. * cabs: (libc)Absolute Value.
  125. * cabsl: (libc)Absolute Value.
  126. * cacosf: (libc)Inverse Trig Functions.
  127. * cacoshf: (libc)Hyperbolic Functions.
  128. * cacosh: (libc)Hyperbolic Functions.
  129. * cacoshl: (libc)Hyperbolic Functions.
  130. * cacos: (libc)Inverse Trig Functions.
  131. * cacosl: (libc)Inverse Trig Functions.
  132. * calloc: (libc)Allocating Cleared Space.
  133. * canonicalize_file_name: (libc)Symbolic Links.
  134. * canonicalizef: (libc)FP Bit Twiddling.
  135. * canonicalize: (libc)FP Bit Twiddling.
  136. * canonicalizel: (libc)FP Bit Twiddling.
  137. * cargf: (libc)Operations on Complex.
  138. * carg: (libc)Operations on Complex.
  139. * cargl: (libc)Operations on Complex.
  140. * casinf: (libc)Inverse Trig Functions.
  141. * casinhf: (libc)Hyperbolic Functions.
  142. * casinh: (libc)Hyperbolic Functions.
  143. * casinhl: (libc)Hyperbolic Functions.
  144. * casin: (libc)Inverse Trig Functions.
  145. * casinl: (libc)Inverse Trig Functions.
  146. * catanf: (libc)Inverse Trig Functions.
  147. * catanhf: (libc)Hyperbolic Functions.
  148. * catanh: (libc)Hyperbolic Functions.
  149. * catanhl: (libc)Hyperbolic Functions.
  150. * catan: (libc)Inverse Trig Functions.
  151. * catanl: (libc)Inverse Trig Functions.
  152. * catclose: (libc)The catgets Functions.
  153. * catgets: (libc)The catgets Functions.
  154. * catopen: (libc)The catgets Functions.
  155. * cbc_crypt: (libc)DES Encryption.
  156. * cbrtf: (libc)Exponents and Logarithms.
  157. * cbrt: (libc)Exponents and Logarithms.
  158. * cbrtl: (libc)Exponents and Logarithms.
  159. * ccosf: (libc)Trig Functions.
  160. * ccoshf: (libc)Hyperbolic Functions.
  161. * ccosh: (libc)Hyperbolic Functions.
  162. * ccoshl: (libc)Hyperbolic Functions.
  163. * ccos: (libc)Trig Functions.
  164. * ccosl: (libc)Trig Functions.
  165. * CCTS_OFLOW: (libc)Control Modes.
  166. * ceilf: (libc)Rounding Functions.
  167. * ceil: (libc)Rounding Functions.
  168. * ceill: (libc)Rounding Functions.
  169. * cexpf: (libc)Exponents and Logarithms.
  170. * cexp: (libc)Exponents and Logarithms.
  171. * cexpl: (libc)Exponents and Logarithms.
  172. * cfgetispeed: (libc)Line Speed.
  173. * cfgetospeed: (libc)Line Speed.
  174. * cfmakeraw: (libc)Noncanonical Input.
  175. * cfree: (libc)Freeing after Malloc.
  176. * cfsetispeed: (libc)Line Speed.
  177. * cfsetospeed: (libc)Line Speed.
  178. * cfsetspeed: (libc)Line Speed.
  179. * chdir: (libc)Working Directory.
  180. * CHILD_MAX: (libc)General Limits.
  181. * chmod: (libc)Setting Permissions.
  182. * chown: (libc)File Owner.
  183. * CIGNORE: (libc)Control Modes.
  184. * cimagf: (libc)Operations on Complex.
  185. * cimag: (libc)Operations on Complex.
  186. * cimagl: (libc)Operations on Complex.
  187. * clearenv: (libc)Environment Access.
  188. * clearerr: (libc)Error Recovery.
  189. * clearerr_unlocked: (libc)Error Recovery.
  190. * CLK_TCK: (libc)Processor Time.
  191. * CLOCAL: (libc)Control Modes.
  192. * clock: (libc)CPU Time.
  193. * CLOCKS_PER_SEC: (libc)CPU Time.
  194. * clog10f: (libc)Exponents and Logarithms.
  195. * clog10: (libc)Exponents and Logarithms.
  196. * clog10l: (libc)Exponents and Logarithms.
  197. * clogf: (libc)Exponents and Logarithms.
  198. * clog: (libc)Exponents and Logarithms.
  199. * clogl: (libc)Exponents and Logarithms.
  200. * closedir: (libc)Reading/Closing Directory.
  201. * close: (libc)Opening and Closing Files.
  202. * closelog: (libc)closelog.
  203. * COLL_WEIGHTS_MAX: (libc)Utility Limits.
  204. * _Complex_I: (libc)Complex Numbers.
  205. * confstr: (libc)String Parameters.
  206. * conjf: (libc)Operations on Complex.
  207. * conj: (libc)Operations on Complex.
  208. * conjl: (libc)Operations on Complex.
  209. * connect: (libc)Connecting.
  210. * copysignf: (libc)FP Bit Twiddling.
  211. * copysign: (libc)FP Bit Twiddling.
  212. * copysignl: (libc)FP Bit Twiddling.
  213. * cosf: (libc)Trig Functions.
  214. * coshf: (libc)Hyperbolic Functions.
  215. * cosh: (libc)Hyperbolic Functions.
  216. * coshl: (libc)Hyperbolic Functions.
  217. * cos: (libc)Trig Functions.
  218. * cosl: (libc)Trig Functions.
  219. * cpowf: (libc)Exponents and Logarithms.
  220. * cpow: (libc)Exponents and Logarithms.
  221. * cpowl: (libc)Exponents and Logarithms.
  222. * cprojf: (libc)Operations on Complex.
  223. * cproj: (libc)Operations on Complex.
  224. * cprojl: (libc)Operations on Complex.
  225. * CPU_CLR: (libc)CPU Affinity.
  226. * CPU_ISSET: (libc)CPU Affinity.
  227. * CPU_SET: (libc)CPU Affinity.
  228. * CPU_SETSIZE: (libc)CPU Affinity.
  229. * CPU_ZERO: (libc)CPU Affinity.
  230. * CREAD: (libc)Control Modes.
  231. * crealf: (libc)Operations on Complex.
  232. * creal: (libc)Operations on Complex.
  233. * creall: (libc)Operations on Complex.
  234. * creat64: (libc)Opening and Closing Files.
  235. * creat: (libc)Opening and Closing Files.
  236. * CRTS_IFLOW: (libc)Control Modes.
  237. * crypt: (libc)crypt.
  238. * crypt_r: (libc)crypt.
  239. * CS5: (libc)Control Modes.
  240. * CS6: (libc)Control Modes.
  241. * CS7: (libc)Control Modes.
  242. * CS8: (libc)Control Modes.
  243. * csinf: (libc)Trig Functions.
  244. * csinhf: (libc)Hyperbolic Functions.
  245. * csinh: (libc)Hyperbolic Functions.
  246. * csinhl: (libc)Hyperbolic Functions.
  247. * csin: (libc)Trig Functions.
  248. * csinl: (libc)Trig Functions.
  249. * CSIZE: (libc)Control Modes.
  250. * csqrtf: (libc)Exponents and Logarithms.
  251. * csqrt: (libc)Exponents and Logarithms.
  252. * csqrtl: (libc)Exponents and Logarithms.
  253. * CSTOPB: (libc)Control Modes.
  254. * ctanf: (libc)Trig Functions.
  255. * ctanhf: (libc)Hyperbolic Functions.
  256. * ctanh: (libc)Hyperbolic Functions.
  257. * ctanhl: (libc)Hyperbolic Functions.
  258. * ctan: (libc)Trig Functions.
  259. * ctanl: (libc)Trig Functions.
  260. * ctermid: (libc)Identifying the Terminal.
  261. * ctime: (libc)Formatting Calendar Time.
  262. * ctime_r: (libc)Formatting Calendar Time.
  263. * cuserid: (libc)Who Logged In.
  264. * dcgettext: (libc)Translation with gettext.
  265. * dcngettext: (libc)Advanced gettext functions.
  266. * DES_FAILED: (libc)DES Encryption.
  267. * des_setparity: (libc)DES Encryption.
  268. * dgettext: (libc)Translation with gettext.
  269. * difftime: (libc)Elapsed Time.
  270. * dirfd: (libc)Opening a Directory.
  271. * dirname: (libc)Finding Tokens in a String.
  272. * div: (libc)Integer Division.
  273. * dngettext: (libc)Advanced gettext functions.
  274. * drand48: (libc)SVID Random.
  275. * drand48_r: (libc)SVID Random.
  276. * dremf: (libc)Remainder Functions.
  277. * drem: (libc)Remainder Functions.
  278. * dreml: (libc)Remainder Functions.
  279. * DTTOIF: (libc)Directory Entries.
  280. * dup2: (libc)Duplicating Descriptors.
  281. * dup: (libc)Duplicating Descriptors.
  282. * E2BIG: (libc)Error Codes.
  283. * EACCES: (libc)Error Codes.
  284. * EADDRINUSE: (libc)Error Codes.
  285. * EADDRNOTAVAIL: (libc)Error Codes.
  286. * EADV: (libc)Error Codes.
  287. * EAFNOSUPPORT: (libc)Error Codes.
  288. * EAGAIN: (libc)Error Codes.
  289. * EALREADY: (libc)Error Codes.
  290. * EAUTH: (libc)Error Codes.
  291. * EBACKGROUND: (libc)Error Codes.
  292. * EBADE: (libc)Error Codes.
  293. * EBADFD: (libc)Error Codes.
  294. * EBADF: (libc)Error Codes.
  295. * EBADMSG: (libc)Error Codes.
  296. * EBADR: (libc)Error Codes.
  297. * EBADRPC: (libc)Error Codes.
  298. * EBADRQC: (libc)Error Codes.
  299. * EBADSLT: (libc)Error Codes.
  300. * EBFONT: (libc)Error Codes.
  301. * EBUSY: (libc)Error Codes.
  302. * ECANCELED: (libc)Error Codes.
  303. * ecb_crypt: (libc)DES Encryption.
  304. * ECHILD: (libc)Error Codes.
  305. * ECHOCTL: (libc)Local Modes.
  306. * ECHOE: (libc)Local Modes.
  307. * ECHOKE: (libc)Local Modes.
  308. * ECHOK: (libc)Local Modes.
  309. * ECHO: (libc)Local Modes.
  310. * ECHONL: (libc)Local Modes.
  311. * ECHOPRT: (libc)Local Modes.
  312. * ECHRNG: (libc)Error Codes.
  313. * ECOMM: (libc)Error Codes.
  314. * ECONNABORTED: (libc)Error Codes.
  315. * ECONNREFUSED: (libc)Error Codes.
  316. * ECONNRESET: (libc)Error Codes.
  317. * ecvt: (libc)System V Number Conversion.
  318. * ecvt_r: (libc)System V Number Conversion.
  319. * EDEADLK: (libc)Error Codes.
  320. * EDEADLOCK: (libc)Error Codes.
  321. * EDESTADDRREQ: (libc)Error Codes.
  322. * EDIED: (libc)Error Codes.
  323. * ED: (libc)Error Codes.
  324. * EDOM: (libc)Error Codes.
  325. * EDOTDOT: (libc)Error Codes.
  326. * EDQUOT: (libc)Error Codes.
  327. * EEXIST: (libc)Error Codes.
  328. * EFAULT: (libc)Error Codes.
  329. * EFBIG: (libc)Error Codes.
  330. * EFTYPE: (libc)Error Codes.
  331. * EGRATUITOUS: (libc)Error Codes.
  332. * EGREGIOUS: (libc)Error Codes.
  333. * EHOSTDOWN: (libc)Error Codes.
  334. * EHOSTUNREACH: (libc)Error Codes.
  335. * EHWPOISON: (libc)Error Codes.
  336. * EIDRM: (libc)Error Codes.
  337. * EIEIO: (libc)Error Codes.
  338. * EILSEQ: (libc)Error Codes.
  339. * EINPROGRESS: (libc)Error Codes.
  340. * EINTR: (libc)Error Codes.
  341. * EINVAL: (libc)Error Codes.
  342. * EIO: (libc)Error Codes.
  343. * EISCONN: (libc)Error Codes.
  344. * EISDIR: (libc)Error Codes.
  345. * EISNAM: (libc)Error Codes.
  346. * EKEYEXPIRED: (libc)Error Codes.
  347. * EKEYREJECTED: (libc)Error Codes.
  348. * EKEYREVOKED: (libc)Error Codes.
  349. * EL2HLT: (libc)Error Codes.
  350. * EL2NSYNC: (libc)Error Codes.
  351. * EL3HLT: (libc)Error Codes.
  352. * EL3RST: (libc)Error Codes.
  353. * ELIBACC: (libc)Error Codes.
  354. * ELIBBAD: (libc)Error Codes.
  355. * ELIBEXEC: (libc)Error Codes.
  356. * ELIBMAX: (libc)Error Codes.
  357. * ELIBSCN: (libc)Error Codes.
  358. * ELNRNG: (libc)Error Codes.
  359. * ELOOP: (libc)Error Codes.
  360. * EMEDIUMTYPE: (libc)Error Codes.
  361. * EMFILE: (libc)Error Codes.
  362. * EMLINK: (libc)Error Codes.
  363. * EMSGSIZE: (libc)Error Codes.
  364. * EMULTIHOP: (libc)Error Codes.
  365. * ENAMETOOLONG: (libc)Error Codes.
  366. * ENAVAIL: (libc)Error Codes.
  367. * encrypt: (libc)DES Encryption.
  368. * encrypt_r: (libc)DES Encryption.
  369. * endfsent: (libc)fstab.
  370. * endgrent: (libc)Scanning All Groups.
  371. * endhostent: (libc)Host Names.
  372. * endmntent: (libc)mtab.
  373. * endnetent: (libc)Networks Database.
  374. * endnetgrent: (libc)Lookup Netgroup.
  375. * endprotoent: (libc)Protocols Database.
  376. * endpwent: (libc)Scanning All Users.
  377. * endservent: (libc)Services Database.
  378. * endutent: (libc)Manipulating the Database.
  379. * endutxent: (libc)XPG Functions.
  380. * ENEEDAUTH: (libc)Error Codes.
  381. * ENETDOWN: (libc)Error Codes.
  382. * ENETRESET: (libc)Error Codes.
  383. * ENETUNREACH: (libc)Error Codes.
  384. * ENFILE: (libc)Error Codes.
  385. * ENOANO: (libc)Error Codes.
  386. * ENOBUFS: (libc)Error Codes.
  387. * ENOCSI: (libc)Error Codes.
  388. * ENODATA: (libc)Error Codes.
  389. * ENODEV: (libc)Error Codes.
  390. * ENOENT: (libc)Error Codes.
  391. * ENOEXEC: (libc)Error Codes.
  392. * ENOKEY: (libc)Error Codes.
  393. * ENOLCK: (libc)Error Codes.
  394. * ENOLINK: (libc)Error Codes.
  395. * ENOMEDIUM: (libc)Error Codes.
  396. * ENOMEM: (libc)Error Codes.
  397. * ENOMSG: (libc)Error Codes.
  398. * ENONET: (libc)Error Codes.
  399. * ENOPKG: (libc)Error Codes.
  400. * ENOPROTOOPT: (libc)Error Codes.
  401. * ENOSPC: (libc)Error Codes.
  402. * ENOSR: (libc)Error Codes.
  403. * ENOSTR: (libc)Error Codes.
  404. * ENOSYS: (libc)Error Codes.
  405. * ENOTBLK: (libc)Error Codes.
  406. * ENOTCONN: (libc)Error Codes.
  407. * ENOTDIR: (libc)Error Codes.
  408. * ENOTEMPTY: (libc)Error Codes.
  409. * ENOTNAM: (libc)Error Codes.
  410. * ENOTRECOVERABLE: (libc)Error Codes.
  411. * ENOTSOCK: (libc)Error Codes.
  412. * ENOTSUP: (libc)Error Codes.
  413. * ENOTTY: (libc)Error Codes.
  414. * ENOTUNIQ: (libc)Error Codes.
  415. * envz_add: (libc)Envz Functions.
  416. * envz_entry: (libc)Envz Functions.
  417. * envz_get: (libc)Envz Functions.
  418. * envz_merge: (libc)Envz Functions.
  419. * envz_remove: (libc)Envz Functions.
  420. * envz_strip: (libc)Envz Functions.
  421. * ENXIO: (libc)Error Codes.
  422. * EOF: (libc)EOF and Errors.
  423. * EOPNOTSUPP: (libc)Error Codes.
  424. * EOVERFLOW: (libc)Error Codes.
  425. * EOWNERDEAD: (libc)Error Codes.
  426. * EPERM: (libc)Error Codes.
  427. * EPFNOSUPPORT: (libc)Error Codes.
  428. * EPIPE: (libc)Error Codes.
  429. * EPROCLIM: (libc)Error Codes.
  430. * EPROCUNAVAIL: (libc)Error Codes.
  431. * EPROGMISMATCH: (libc)Error Codes.
  432. * EPROGUNAVAIL: (libc)Error Codes.
  433. * EPROTO: (libc)Error Codes.
  434. * EPROTONOSUPPORT: (libc)Error Codes.
  435. * EPROTOTYPE: (libc)Error Codes.
  436. * EQUIV_CLASS_MAX: (libc)Utility Limits.
  437. * erand48: (libc)SVID Random.
  438. * erand48_r: (libc)SVID Random.
  439. * ERANGE: (libc)Error Codes.
  440. * EREMCHG: (libc)Error Codes.
  441. * EREMOTEIO: (libc)Error Codes.
  442. * EREMOTE: (libc)Error Codes.
  443. * ERESTART: (libc)Error Codes.
  444. * erfcf: (libc)Special Functions.
  445. * erfc: (libc)Special Functions.
  446. * erfcl: (libc)Special Functions.
  447. * erff: (libc)Special Functions.
  448. * ERFKILL: (libc)Error Codes.
  449. * erf: (libc)Special Functions.
  450. * erfl: (libc)Special Functions.
  451. * EROFS: (libc)Error Codes.
  452. * ERPCMISMATCH: (libc)Error Codes.
  453. * err: (libc)Error Messages.
  454. * errno: (libc)Checking for Errors.
  455. * error_at_line: (libc)Error Messages.
  456. * error: (libc)Error Messages.
  457. * errx: (libc)Error Messages.
  458. * ESHUTDOWN: (libc)Error Codes.
  459. * ESOCKTNOSUPPORT: (libc)Error Codes.
  460. * ESPIPE: (libc)Error Codes.
  461. * ESRCH: (libc)Error Codes.
  462. * ESRMNT: (libc)Error Codes.
  463. * ESTALE: (libc)Error Codes.
  464. * ESTRPIPE: (libc)Error Codes.
  465. * ETIMEDOUT: (libc)Error Codes.
  466. * ETIME: (libc)Error Codes.
  467. * ETOOMANYREFS: (libc)Error Codes.
  468. * ETXTBSY: (libc)Error Codes.
  469. * EUCLEAN: (libc)Error Codes.
  470. * EUNATCH: (libc)Error Codes.
  471. * EUSERS: (libc)Error Codes.
  472. * EWOULDBLOCK: (libc)Error Codes.
  473. * EXDEV: (libc)Error Codes.
  474. * execle: (libc)Executing a File.
  475. * execl: (libc)Executing a File.
  476. * execlp: (libc)Executing a File.
  477. * execve: (libc)Executing a File.
  478. * execv: (libc)Executing a File.
  479. * execvp: (libc)Executing a File.
  480. * EXFULL: (libc)Error Codes.
  481. * EXIT_FAILURE: (libc)Exit Status.
  482. * exit: (libc)Normal Termination.
  483. * _exit: (libc)Termination Internals.
  484. * _Exit: (libc)Termination Internals.
  485. * EXIT_SUCCESS: (libc)Exit Status.
  486. * exp10f: (libc)Exponents and Logarithms.
  487. * exp10: (libc)Exponents and Logarithms.
  488. * exp10l: (libc)Exponents and Logarithms.
  489. * exp2f: (libc)Exponents and Logarithms.
  490. * exp2: (libc)Exponents and Logarithms.
  491. * exp2l: (libc)Exponents and Logarithms.
  492. * expf: (libc)Exponents and Logarithms.
  493. * exp: (libc)Exponents and Logarithms.
  494. * explicit_bzero: (libc)Erasing Sensitive Data.
  495. * expl: (libc)Exponents and Logarithms.
  496. * expm1f: (libc)Exponents and Logarithms.
  497. * expm1: (libc)Exponents and Logarithms.
  498. * expm1l: (libc)Exponents and Logarithms.
  499. * EXPR_NEST_MAX: (libc)Utility Limits.
  500. * fabsf: (libc)Absolute Value.
  501. * fabs: (libc)Absolute Value.
  502. * fabsl: (libc)Absolute Value.
  503. * __fbufsize: (libc)Controlling Buffering.
  504. * fchdir: (libc)Working Directory.
  505. * fchmod: (libc)Setting Permissions.
  506. * fchown: (libc)File Owner.
  507. * fcloseall: (libc)Closing Streams.
  508. * fclose: (libc)Closing Streams.
  509. * fcntl: (libc)Control Operations.
  510. * fcvt: (libc)System V Number Conversion.
  511. * fcvt_r: (libc)System V Number Conversion.
  512. * fdatasync: (libc)Synchronizing I/O.
  513. * FD_CLOEXEC: (libc)Descriptor Flags.
  514. * FD_CLR: (libc)Waiting for I/O.
  515. * fdimf: (libc)Misc FP Arithmetic.
  516. * fdim: (libc)Misc FP Arithmetic.
  517. * fdiml: (libc)Misc FP Arithmetic.
  518. * FD_ISSET: (libc)Waiting for I/O.
  519. * fdopendir: (libc)Opening a Directory.
  520. * fdopen: (libc)Descriptors and Streams.
  521. * FD_SET: (libc)Waiting for I/O.
  522. * FD_SETSIZE: (libc)Waiting for I/O.
  523. * F_DUPFD: (libc)Duplicating Descriptors.
  524. * FD_ZERO: (libc)Waiting for I/O.
  525. * feclearexcept: (libc)Status bit operations.
  526. * fedisableexcept: (libc)Control Functions.
  527. * feenableexcept: (libc)Control Functions.
  528. * fegetenv: (libc)Control Functions.
  529. * fegetexceptflag: (libc)Status bit operations.
  530. * fegetexcept: (libc)Control Functions.
  531. * fegetmode: (libc)Control Functions.
  532. * fegetround: (libc)Rounding.
  533. * feholdexcept: (libc)Control Functions.
  534. * feof: (libc)EOF and Errors.
  535. * feof_unlocked: (libc)EOF and Errors.
  536. * feraiseexcept: (libc)Status bit operations.
  537. * ferror: (libc)EOF and Errors.
  538. * ferror_unlocked: (libc)EOF and Errors.
  539. * fesetenv: (libc)Control Functions.
  540. * fesetexceptflag: (libc)Status bit operations.
  541. * fesetexcept: (libc)Status bit operations.
  542. * fesetmode: (libc)Control Functions.
  543. * fesetround: (libc)Rounding.
  544. * FE_SNANS_ALWAYS_SIGNAL: (libc)Infinity and NaN.
  545. * fetestexceptflag: (libc)Status bit operations.
  546. * fetestexcept: (libc)Status bit operations.
  547. * feupdateenv: (libc)Control Functions.
  548. * fflush: (libc)Flushing Buffers.
  549. * fflush_unlocked: (libc)Flushing Buffers.
  550. * fgetc: (libc)Character Input.
  551. * fgetc_unlocked: (libc)Character Input.
  552. * F_GETFD: (libc)Descriptor Flags.
  553. * F_GETFL: (libc)Getting File Status Flags.
  554. * fgetgrent: (libc)Scanning All Groups.
  555. * fgetgrent_r: (libc)Scanning All Groups.
  556. * F_GETLK: (libc)File Locks.
  557. * F_GETOWN: (libc)Interrupt Input.
  558. * fgetpos64: (libc)Portable Positioning.
  559. * fgetpos: (libc)Portable Positioning.
  560. * fgetpwent: (libc)Scanning All Users.
  561. * fgetpwent_r: (libc)Scanning All Users.
  562. * fgets: (libc)Line Input.
  563. * fgets_unlocked: (libc)Line Input.
  564. * fgetwc: (libc)Character Input.
  565. * fgetwc_unlocked: (libc)Character Input.
  566. * fgetws: (libc)Line Input.
  567. * fgetws_unlocked: (libc)Line Input.
  568. * FILENAME_MAX: (libc)Limits for Files.
  569. * fileno: (libc)Descriptors and Streams.
  570. * fileno_unlocked: (libc)Descriptors and Streams.
  571. * finitef: (libc)Floating Point Classes.
  572. * finite: (libc)Floating Point Classes.
  573. * finitel: (libc)Floating Point Classes.
  574. * __flbf: (libc)Controlling Buffering.
  575. * flockfile: (libc)Streams and Threads.
  576. * floorf: (libc)Rounding Functions.
  577. * floor: (libc)Rounding Functions.
  578. * floorl: (libc)Rounding Functions.
  579. * _flushlbf: (libc)Flushing Buffers.
  580. * FLUSHO: (libc)Local Modes.
  581. * fmaf: (libc)Misc FP Arithmetic.
  582. * fma: (libc)Misc FP Arithmetic.
  583. * fmal: (libc)Misc FP Arithmetic.
  584. * fmaxf: (libc)Misc FP Arithmetic.
  585. * fmax: (libc)Misc FP Arithmetic.
  586. * fmaxl: (libc)Misc FP Arithmetic.
  587. * fmaxmagf: (libc)Misc FP Arithmetic.
  588. * fmaxmag: (libc)Misc FP Arithmetic.
  589. * fmaxmagl: (libc)Misc FP Arithmetic.
  590. * fmemopen: (libc)String Streams.
  591. * fminf: (libc)Misc FP Arithmetic.
  592. * fmin: (libc)Misc FP Arithmetic.
  593. * fminl: (libc)Misc FP Arithmetic.
  594. * fminmagf: (libc)Misc FP Arithmetic.
  595. * fminmag: (libc)Misc FP Arithmetic.
  596. * fminmagl: (libc)Misc FP Arithmetic.
  597. * fmodf: (libc)Remainder Functions.
  598. * fmod: (libc)Remainder Functions.
  599. * fmodl: (libc)Remainder Functions.
  600. * fmtmsg: (libc)Printing Formatted Messages.
  601. * fnmatch: (libc)Wildcard Matching.
  602. * F_OFD_GETLK: (libc)Open File Description Locks.
  603. * F_OFD_SETLK: (libc)Open File Description Locks.
  604. * F_OFD_SETLKW: (libc)Open File Description Locks.
  605. * F_OK: (libc)Testing File Access.
  606. * fopen64: (libc)Opening Streams.
  607. * fopencookie: (libc)Streams and Cookies.
  608. * fopen: (libc)Opening Streams.
  609. * FOPEN_MAX: (libc)Opening Streams.
  610. * fork: (libc)Creating a Process.
  611. * forkpty: (libc)Pseudo-Terminal Pairs.
  612. * fpathconf: (libc)Pathconf.
  613. * fpclassify: (libc)Floating Point Classes.
  614. * __fpending: (libc)Controlling Buffering.
  615. * FP_ILOGB0: (libc)Exponents and Logarithms.
  616. * FP_ILOGBNAN: (libc)Exponents and Logarithms.
  617. * FP_LLOGB0: (libc)Exponents and Logarithms.
  618. * FP_LLOGBNAN: (libc)Exponents and Logarithms.
  619. * fprintf: (libc)Formatted Output Functions.
  620. * __fpurge: (libc)Flushing Buffers.
  621. * fputc: (libc)Simple Output.
  622. * fputc_unlocked: (libc)Simple Output.
  623. * fputs: (libc)Simple Output.
  624. * fputs_unlocked: (libc)Simple Output.
  625. * fputwc: (libc)Simple Output.
  626. * fputwc_unlocked: (libc)Simple Output.
  627. * fputws: (libc)Simple Output.
  628. * fputws_unlocked: (libc)Simple Output.
  629. * __freadable: (libc)Opening Streams.
  630. * __freading: (libc)Opening Streams.
  631. * fread: (libc)Block Input/Output.
  632. * fread_unlocked: (libc)Block Input/Output.
  633. * free: (libc)Freeing after Malloc.
  634. * freopen64: (libc)Opening Streams.
  635. * freopen: (libc)Opening Streams.
  636. * frexpf: (libc)Normalization Functions.
  637. * frexp: (libc)Normalization Functions.
  638. * frexpl: (libc)Normalization Functions.
  639. * fromfpf: (libc)Rounding Functions.
  640. * fromfp: (libc)Rounding Functions.
  641. * fromfpl: (libc)Rounding Functions.
  642. * fromfpxf: (libc)Rounding Functions.
  643. * fromfpx: (libc)Rounding Functions.
  644. * fromfpxl: (libc)Rounding Functions.
  645. * fscanf: (libc)Formatted Input Functions.
  646. * fseek: (libc)File Positioning.
  647. * fseeko64: (libc)File Positioning.
  648. * fseeko: (libc)File Positioning.
  649. * F_SETFD: (libc)Descriptor Flags.
  650. * F_SETFL: (libc)Getting File Status Flags.
  651. * F_SETLK: (libc)File Locks.
  652. * F_SETLKW: (libc)File Locks.
  653. * __fsetlocking: (libc)Streams and Threads.
  654. * F_SETOWN: (libc)Interrupt Input.
  655. * fsetpos64: (libc)Portable Positioning.
  656. * fsetpos: (libc)Portable Positioning.
  657. * fstat64: (libc)Reading Attributes.
  658. * fstat: (libc)Reading Attributes.
  659. * fsync: (libc)Synchronizing I/O.
  660. * ftell: (libc)File Positioning.
  661. * ftello64: (libc)File Positioning.
  662. * ftello: (libc)File Positioning.
  663. * ftruncate64: (libc)File Size.
  664. * ftruncate: (libc)File Size.
  665. * ftrylockfile: (libc)Streams and Threads.
  666. * ftw64: (libc)Working with Directory Trees.
  667. * ftw: (libc)Working with Directory Trees.
  668. * funlockfile: (libc)Streams and Threads.
  669. * futimes: (libc)File Times.
  670. * fwide: (libc)Streams and I18N.
  671. * fwprintf: (libc)Formatted Output Functions.
  672. * __fwritable: (libc)Opening Streams.
  673. * fwrite: (libc)Block Input/Output.
  674. * fwrite_unlocked: (libc)Block Input/Output.
  675. * __fwriting: (libc)Opening Streams.
  676. * fwscanf: (libc)Formatted Input Functions.
  677. * gammaf: (libc)Special Functions.
  678. * gamma: (libc)Special Functions.
  679. * gammal: (libc)Special Functions.
  680. * __gconv_end_fct: (libc)glibc iconv Implementation.
  681. * __gconv_fct: (libc)glibc iconv Implementation.
  682. * __gconv_init_fct: (libc)glibc iconv Implementation.
  683. * gcvt: (libc)System V Number Conversion.
  684. * getauxval: (libc)Auxiliary Vector.
  685. * get_avphys_pages: (libc)Query Memory Parameters.
  686. * getchar: (libc)Character Input.
  687. * getchar_unlocked: (libc)Character Input.
  688. * getc: (libc)Character Input.
  689. * getcontext: (libc)System V contexts.
  690. * getc_unlocked: (libc)Character Input.
  691. * get_current_dir_name: (libc)Working Directory.
  692. * getcwd: (libc)Working Directory.
  693. * getdate: (libc)General Time String Parsing.
  694. * getdate_r: (libc)General Time String Parsing.
  695. * getdelim: (libc)Line Input.
  696. * getdomainnname: (libc)Host Identification.
  697. * getegid: (libc)Reading Persona.
  698. * getentropy: (libc)Unpredictable Bytes.
  699. * getenv: (libc)Environment Access.
  700. * geteuid: (libc)Reading Persona.
  701. * getfsent: (libc)fstab.
  702. * getfsfile: (libc)fstab.
  703. * getfsspec: (libc)fstab.
  704. * getgid: (libc)Reading Persona.
  705. * getgrent: (libc)Scanning All Groups.
  706. * getgrent_r: (libc)Scanning All Groups.
  707. * getgrgid: (libc)Lookup Group.
  708. * getgrgid_r: (libc)Lookup Group.
  709. * getgrnam: (libc)Lookup Group.
  710. * getgrnam_r: (libc)Lookup Group.
  711. * getgrouplist: (libc)Setting Groups.
  712. * getgroups: (libc)Reading Persona.
  713. * gethostbyaddr: (libc)Host Names.
  714. * gethostbyaddr_r: (libc)Host Names.
  715. * gethostbyname2: (libc)Host Names.
  716. * gethostbyname2_r: (libc)Host Names.
  717. * gethostbyname: (libc)Host Names.
  718. * gethostbyname_r: (libc)Host Names.
  719. * gethostent: (libc)Host Names.
  720. * gethostid: (libc)Host Identification.
  721. * gethostname: (libc)Host Identification.
  722. * getitimer: (libc)Setting an Alarm.
  723. * getline: (libc)Line Input.
  724. * getloadavg: (libc)Processor Resources.
  725. * getlogin: (libc)Who Logged In.
  726. * getmntent: (libc)mtab.
  727. * getmntent_r: (libc)mtab.
  728. * getnetbyaddr: (libc)Networks Database.
  729. * getnetbyname: (libc)Networks Database.
  730. * getnetent: (libc)Networks Database.
  731. * getnetgrent: (libc)Lookup Netgroup.
  732. * getnetgrent_r: (libc)Lookup Netgroup.
  733. * get_nprocs_conf: (libc)Processor Resources.
  734. * get_nprocs: (libc)Processor Resources.
  735. * getopt: (libc)Using Getopt.
  736. * getopt_long: (libc)Getopt Long Options.
  737. * getopt_long_only: (libc)Getopt Long Options.
  738. * getpagesize: (libc)Query Memory Parameters.
  739. * getpass: (libc)getpass.
  740. * getpayloadf: (libc)FP Bit Twiddling.
  741. * getpayload: (libc)FP Bit Twiddling.
  742. * getpayloadl: (libc)FP Bit Twiddling.
  743. * getpeername: (libc)Who is Connected.
  744. * getpgid: (libc)Process Group Functions.
  745. * getpgrp: (libc)Process Group Functions.
  746. * get_phys_pages: (libc)Query Memory Parameters.
  747. * getpid: (libc)Process Identification.
  748. * getppid: (libc)Process Identification.
  749. * getpriority: (libc)Traditional Scheduling Functions.
  750. * getprotobyname: (libc)Protocols Database.
  751. * getprotobynumber: (libc)Protocols Database.
  752. * getprotoent: (libc)Protocols Database.
  753. * getpt: (libc)Allocation.
  754. * getpwent: (libc)Scanning All Users.
  755. * getpwent_r: (libc)Scanning All Users.
  756. * getpwnam: (libc)Lookup User.
  757. * getpwnam_r: (libc)Lookup User.
  758. * getpwuid: (libc)Lookup User.
  759. * getpwuid_r: (libc)Lookup User.
  760. * getrandom: (libc)Unpredictable Bytes.
  761. * getrlimit64: (libc)Limits on Resources.
  762. * getrlimit: (libc)Limits on Resources.
  763. * getrusage: (libc)Resource Usage.
  764. * getservbyname: (libc)Services Database.
  765. * getservbyport: (libc)Services Database.
  766. * getservent: (libc)Services Database.
  767. * getsid: (libc)Process Group Functions.
  768. * gets: (libc)Line Input.
  769. * getsockname: (libc)Reading Address.
  770. * getsockopt: (libc)Socket Option Functions.
  771. * getsubopt: (libc)Suboptions.
  772. * gettext: (libc)Translation with gettext.
  773. * gettimeofday: (libc)High-Resolution Calendar.
  774. * getuid: (libc)Reading Persona.
  775. * getumask: (libc)Setting Permissions.
  776. * getutent: (libc)Manipulating the Database.
  777. * getutent_r: (libc)Manipulating the Database.
  778. * getutid: (libc)Manipulating the Database.
  779. * getutid_r: (libc)Manipulating the Database.
  780. * getutline: (libc)Manipulating the Database.
  781. * getutline_r: (libc)Manipulating the Database.
  782. * getutmp: (libc)XPG Functions.
  783. * getutmpx: (libc)XPG Functions.
  784. * getutxent: (libc)XPG Functions.
  785. * getutxid: (libc)XPG Functions.
  786. * getutxline: (libc)XPG Functions.
  787. * getwchar: (libc)Character Input.
  788. * getwchar_unlocked: (libc)Character Input.
  789. * getwc: (libc)Character Input.
  790. * getwc_unlocked: (libc)Character Input.
  791. * getwd: (libc)Working Directory.
  792. * getw: (libc)Character Input.
  793. * glob64: (libc)Calling Glob.
  794. * globfree64: (libc)More Flags for Globbing.
  795. * globfree: (libc)More Flags for Globbing.
  796. * glob: (libc)Calling Glob.
  797. * gmtime: (libc)Broken-down Time.
  798. * gmtime_r: (libc)Broken-down Time.
  799. * grantpt: (libc)Allocation.
  800. * gsignal: (libc)Signaling Yourself.
  801. * gtty: (libc)BSD Terminal Modes.
  802. * hasmntopt: (libc)mtab.
  803. * hcreate: (libc)Hash Search Function.
  804. * hcreate_r: (libc)Hash Search Function.
  805. * hdestroy: (libc)Hash Search Function.
  806. * hdestroy_r: (libc)Hash Search Function.
  807. * hsearch: (libc)Hash Search Function.
  808. * hsearch_r: (libc)Hash Search Function.
  809. * htonl: (libc)Byte Order.
  810. * htons: (libc)Byte Order.
  811. * HUGE_VALF: (libc)Math Error Reporting.
  812. * HUGE_VAL: (libc)Math Error Reporting.
  813. * HUGE_VALL: (libc)Math Error Reporting.
  814. * HUPCL: (libc)Control Modes.
  815. * hypotf: (libc)Exponents and Logarithms.
  816. * hypot: (libc)Exponents and Logarithms.
  817. * hypotl: (libc)Exponents and Logarithms.
  818. * ICANON: (libc)Local Modes.
  819. * iconv_close: (libc)Generic Conversion Interface.
  820. * iconv: (libc)Generic Conversion Interface.
  821. * iconv_open: (libc)Generic Conversion Interface.
  822. * ICRNL: (libc)Input Modes.
  823. * IEXTEN: (libc)Local Modes.
  824. * if_freenameindex: (libc)Interface Naming.
  825. * if_indextoname: (libc)Interface Naming.
  826. * if_nameindex: (libc)Interface Naming.
  827. * if_nametoindex: (libc)Interface Naming.
  828. * IFNAMSIZ: (libc)Interface Naming.
  829. * IFTODT: (libc)Directory Entries.
  830. * IGNBRK: (libc)Input Modes.
  831. * IGNCR: (libc)Input Modes.
  832. * IGNPAR: (libc)Input Modes.
  833. * I: (libc)Complex Numbers.
  834. * ilogbf: (libc)Exponents and Logarithms.
  835. * ilogb: (libc)Exponents and Logarithms.
  836. * ilogbl: (libc)Exponents and Logarithms.
  837. * _Imaginary_I: (libc)Complex Numbers.
  838. * imaxabs: (libc)Absolute Value.
  839. * IMAXBEL: (libc)Input Modes.
  840. * imaxdiv: (libc)Integer Division.
  841. * in6addr_any: (libc)Host Address Data Type.
  842. * in6addr_loopback: (libc)Host Address Data Type.
  843. * INADDR_ANY: (libc)Host Address Data Type.
  844. * INADDR_BROADCAST: (libc)Host Address Data Type.
  845. * INADDR_LOOPBACK: (libc)Host Address Data Type.
  846. * INADDR_NONE: (libc)Host Address Data Type.
  847. * index: (libc)Search Functions.
  848. * inet_addr: (libc)Host Address Functions.
  849. * inet_aton: (libc)Host Address Functions.
  850. * inet_lnaof: (libc)Host Address Functions.
  851. * inet_makeaddr: (libc)Host Address Functions.
  852. * inet_netof: (libc)Host Address Functions.
  853. * inet_network: (libc)Host Address Functions.
  854. * inet_ntoa: (libc)Host Address Functions.
  855. * inet_ntop: (libc)Host Address Functions.
  856. * inet_pton: (libc)Host Address Functions.
  857. * INFINITY: (libc)Infinity and NaN.
  858. * initgroups: (libc)Setting Groups.
  859. * initstate: (libc)BSD Random.
  860. * initstate_r: (libc)BSD Random.
  861. * INLCR: (libc)Input Modes.
  862. * innetgr: (libc)Netgroup Membership.
  863. * INPCK: (libc)Input Modes.
  864. * ioctl: (libc)IOCTLs.
  865. * _IOFBF: (libc)Controlling Buffering.
  866. * _IOLBF: (libc)Controlling Buffering.
  867. * _IONBF: (libc)Controlling Buffering.
  868. * IPPORT_RESERVED: (libc)Ports.
  869. * IPPORT_USERRESERVED: (libc)Ports.
  870. * isalnum: (libc)Classification of Characters.
  871. * isalpha: (libc)Classification of Characters.
  872. * isascii: (libc)Classification of Characters.
  873. * isatty: (libc)Is It a Terminal.
  874. * isblank: (libc)Classification of Characters.
  875. * iscanonical: (libc)Floating Point Classes.
  876. * iscntrl: (libc)Classification of Characters.
  877. * isdigit: (libc)Classification of Characters.
  878. * iseqsig: (libc)FP Comparison Functions.
  879. * isfinite: (libc)Floating Point Classes.
  880. * isgraph: (libc)Classification of Characters.
  881. * isgreaterequal: (libc)FP Comparison Functions.
  882. * isgreater: (libc)FP Comparison Functions.
  883. * ISIG: (libc)Local Modes.
  884. * isinff: (libc)Floating Point Classes.
  885. * isinf: (libc)Floating Point Classes.
  886. * isinfl: (libc)Floating Point Classes.
  887. * islessequal: (libc)FP Comparison Functions.
  888. * islessgreater: (libc)FP Comparison Functions.
  889. * isless: (libc)FP Comparison Functions.
  890. * islower: (libc)Classification of Characters.
  891. * isnanf: (libc)Floating Point Classes.
  892. * isnan: (libc)Floating Point Classes.
  893. * isnan: (libc)Floating Point Classes.
  894. * isnanl: (libc)Floating Point Classes.
  895. * isnormal: (libc)Floating Point Classes.
  896. * isprint: (libc)Classification of Characters.
  897. * ispunct: (libc)Classification of Characters.
  898. * issignaling: (libc)Floating Point Classes.
  899. * isspace: (libc)Classification of Characters.
  900. * issubnormal: (libc)Floating Point Classes.
  901. * ISTRIP: (libc)Input Modes.
  902. * isunordered: (libc)FP Comparison Functions.
  903. * isupper: (libc)Classification of Characters.
  904. * iswalnum: (libc)Classification of Wide Characters.
  905. * iswalpha: (libc)Classification of Wide Characters.
  906. * iswblank: (libc)Classification of Wide Characters.
  907. * iswcntrl: (libc)Classification of Wide Characters.
  908. * iswctype: (libc)Classification of Wide Characters.
  909. * iswdigit: (libc)Classification of Wide Characters.
  910. * iswgraph: (libc)Classification of Wide Characters.
  911. * iswlower: (libc)Classification of Wide Characters.
  912. * iswprint: (libc)Classification of Wide Characters.
  913. * iswpunct: (libc)Classification of Wide Characters.
  914. * iswspace: (libc)Classification of Wide Characters.
  915. * iswupper: (libc)Classification of Wide Characters.
  916. * iswxdigit: (libc)Classification of Wide Characters.
  917. * isxdigit: (libc)Classification of Characters.
  918. * iszero: (libc)Floating Point Classes.
  919. * IXANY: (libc)Input Modes.
  920. * IXOFF: (libc)Input Modes.
  921. * IXON: (libc)Input Modes.
  922. * j0f: (libc)Special Functions.
  923. * j0: (libc)Special Functions.
  924. * j0l: (libc)Special Functions.
  925. * j1f: (libc)Special Functions.
  926. * j1: (libc)Special Functions.
  927. * j1l: (libc)Special Functions.
  928. * jnf: (libc)Special Functions.
  929. * jn: (libc)Special Functions.
  930. * jnl: (libc)Special Functions.
  931. * jrand48: (libc)SVID Random.
  932. * jrand48_r: (libc)SVID Random.
  933. * kill: (libc)Signaling Another Process.
  934. * killpg: (libc)Signaling Another Process.
  935. * l64a: (libc)Encode Binary Data.
  936. * labs: (libc)Absolute Value.
  937. * lcong48: (libc)SVID Random.
  938. * lcong48_r: (libc)SVID Random.
  939. * L_ctermid: (libc)Identifying the Terminal.
  940. * L_cuserid: (libc)Who Logged In.
  941. * ldexpf: (libc)Normalization Functions.
  942. * ldexp: (libc)Normalization Functions.
  943. * ldexpl: (libc)Normalization Functions.
  944. * ldiv: (libc)Integer Division.
  945. * lfind: (libc)Array Search Function.
  946. * lgammaf: (libc)Special Functions.
  947. * lgammaf_r: (libc)Special Functions.
  948. * lgamma: (libc)Special Functions.
  949. * lgammal: (libc)Special Functions.
  950. * lgammal_r: (libc)Special Functions.
  951. * lgamma_r: (libc)Special Functions.
  952. * LINE_MAX: (libc)Utility Limits.
  953. * link: (libc)Hard Links.
  954. * LINK_MAX: (libc)Limits for Files.
  955. * lio_listio64: (libc)Asynchronous Reads/Writes.
  956. * lio_listio: (libc)Asynchronous Reads/Writes.
  957. * listen: (libc)Listening.
  958. * llabs: (libc)Absolute Value.
  959. * lldiv: (libc)Integer Division.
  960. * llogbf: (libc)Exponents and Logarithms.
  961. * llogb: (libc)Exponents and Logarithms.
  962. * llogbl: (libc)Exponents and Logarithms.
  963. * llrintf: (libc)Rounding Functions.
  964. * llrint: (libc)Rounding Functions.
  965. * llrintl: (libc)Rounding Functions.
  966. * llroundf: (libc)Rounding Functions.
  967. * llround: (libc)Rounding Functions.
  968. * llroundl: (libc)Rounding Functions.
  969. * localeconv: (libc)The Lame Way to Locale Data.
  970. * localtime: (libc)Broken-down Time.
  971. * localtime_r: (libc)Broken-down Time.
  972. * log10f: (libc)Exponents and Logarithms.
  973. * log10: (libc)Exponents and Logarithms.
  974. * log10l: (libc)Exponents and Logarithms.
  975. * log1pf: (libc)Exponents and Logarithms.
  976. * log1p: (libc)Exponents and Logarithms.
  977. * log1pl: (libc)Exponents and Logarithms.
  978. * log2f: (libc)Exponents and Logarithms.
  979. * log2: (libc)Exponents and Logarithms.
  980. * log2l: (libc)Exponents and Logarithms.
  981. * logbf: (libc)Exponents and Logarithms.
  982. * logb: (libc)Exponents and Logarithms.
  983. * logbl: (libc)Exponents and Logarithms.
  984. * logf: (libc)Exponents and Logarithms.
  985. * login: (libc)Logging In and Out.
  986. * login_tty: (libc)Logging In and Out.
  987. * log: (libc)Exponents and Logarithms.
  988. * logl: (libc)Exponents and Logarithms.
  989. * logout: (libc)Logging In and Out.
  990. * logwtmp: (libc)Logging In and Out.
  991. * longjmp: (libc)Non-Local Details.
  992. * lrand48: (libc)SVID Random.
  993. * lrand48_r: (libc)SVID Random.
  994. * lrintf: (libc)Rounding Functions.
  995. * lrint: (libc)Rounding Functions.
  996. * lrintl: (libc)Rounding Functions.
  997. * lroundf: (libc)Rounding Functions.
  998. * lround: (libc)Rounding Functions.
  999. * lroundl: (libc)Rounding Functions.
  1000. * lsearch: (libc)Array Search Function.
  1001. * lseek64: (libc)File Position Primitive.
  1002. * lseek: (libc)File Position Primitive.
  1003. * lstat64: (libc)Reading Attributes.
  1004. * lstat: (libc)Reading Attributes.
  1005. * L_tmpnam: (libc)Temporary Files.
  1006. * lutimes: (libc)File Times.
  1007. * madvise: (libc)Memory-mapped I/O.
  1008. * makecontext: (libc)System V contexts.
  1009. * mallinfo: (libc)Statistics of Malloc.
  1010. * malloc: (libc)Basic Allocation.
  1011. * mallopt: (libc)Malloc Tunable Parameters.
  1012. * MAX_CANON: (libc)Limits for Files.
  1013. * MAX_INPUT: (libc)Limits for Files.
  1014. * MAXNAMLEN: (libc)Limits for Files.
  1015. * MAXSYMLINKS: (libc)Symbolic Links.
  1016. * MB_CUR_MAX: (libc)Selecting the Conversion.
  1017. * mblen: (libc)Non-reentrant Character Conversion.
  1018. * MB_LEN_MAX: (libc)Selecting the Conversion.
  1019. * mbrlen: (libc)Converting a Character.
  1020. * mbrtowc: (libc)Converting a Character.
  1021. * mbsinit: (libc)Keeping the state.
  1022. * mbsnrtowcs: (libc)Converting Strings.
  1023. * mbsrtowcs: (libc)Converting Strings.
  1024. * mbstowcs: (libc)Non-reentrant String Conversion.
  1025. * mbtowc: (libc)Non-reentrant Character Conversion.
  1026. * mcheck: (libc)Heap Consistency Checking.
  1027. * MDMBUF: (libc)Control Modes.
  1028. * memalign: (libc)Aligned Memory Blocks.
  1029. * memccpy: (libc)Copying Strings and Arrays.
  1030. * memchr: (libc)Search Functions.
  1031. * memcmp: (libc)String/Array Comparison.
  1032. * memcpy: (libc)Copying Strings and Arrays.
  1033. * memfrob: (libc)Trivial Encryption.
  1034. * memmem: (libc)Search Functions.
  1035. * memmove: (libc)Copying Strings and Arrays.
  1036. * mempcpy: (libc)Copying Strings and Arrays.
  1037. * memrchr: (libc)Search Functions.
  1038. * memset: (libc)Copying Strings and Arrays.
  1039. * mkdir: (libc)Creating Directories.
  1040. * mkdtemp: (libc)Temporary Files.
  1041. * mkfifo: (libc)FIFO Special Files.
  1042. * mknod: (libc)Making Special Files.
  1043. * mkstemp: (libc)Temporary Files.
  1044. * mktemp: (libc)Temporary Files.
  1045. * mktime: (libc)Broken-down Time.
  1046. * mlockall: (libc)Page Lock Functions.
  1047. * mlock: (libc)Page Lock Functions.
  1048. * mmap64: (libc)Memory-mapped I/O.
  1049. * mmap: (libc)Memory-mapped I/O.
  1050. * modff: (libc)Rounding Functions.
  1051. * modf: (libc)Rounding Functions.
  1052. * modfl: (libc)Rounding Functions.
  1053. * mount: (libc)Mount-Unmount-Remount.
  1054. * mprobe: (libc)Heap Consistency Checking.
  1055. * mrand48: (libc)SVID Random.
  1056. * mrand48_r: (libc)SVID Random.
  1057. * mremap: (libc)Memory-mapped I/O.
  1058. * MSG_DONTROUTE: (libc)Socket Data Options.
  1059. * MSG_OOB: (libc)Socket Data Options.
  1060. * MSG_PEEK: (libc)Socket Data Options.
  1061. * msync: (libc)Memory-mapped I/O.
  1062. * mtrace: (libc)Tracing malloc.
  1063. * munlockall: (libc)Page Lock Functions.
  1064. * munlock: (libc)Page Lock Functions.
  1065. * munmap: (libc)Memory-mapped I/O.
  1066. * muntrace: (libc)Tracing malloc.
  1067. * NAME_MAX: (libc)Limits for Files.
  1068. * nanf: (libc)FP Bit Twiddling.
  1069. * nan: (libc)FP Bit Twiddling.
  1070. * NAN: (libc)Infinity and NaN.
  1071. * nanl: (libc)FP Bit Twiddling.
  1072. * nanosleep: (libc)Sleeping.
  1073. * NCCS: (libc)Mode Data Types.
  1074. * nearbyintf: (libc)Rounding Functions.
  1075. * nearbyint: (libc)Rounding Functions.
  1076. * nearbyintl: (libc)Rounding Functions.
  1077. * nextafterf: (libc)FP Bit Twiddling.
  1078. * nextafter: (libc)FP Bit Twiddling.
  1079. * nextafterl: (libc)FP Bit Twiddling.
  1080. * nextdownf: (libc)FP Bit Twiddling.
  1081. * nextdown: (libc)FP Bit Twiddling.
  1082. * nextdownl: (libc)FP Bit Twiddling.
  1083. * nexttowardf: (libc)FP Bit Twiddling.
  1084. * nexttoward: (libc)FP Bit Twiddling.
  1085. * nexttowardl: (libc)FP Bit Twiddling.
  1086. * nextupf: (libc)FP Bit Twiddling.
  1087. * nextup: (libc)FP Bit Twiddling.
  1088. * nextupl: (libc)FP Bit Twiddling.
  1089. * nftw64: (libc)Working with Directory Trees.
  1090. * nftw: (libc)Working with Directory Trees.
  1091. * ngettext: (libc)Advanced gettext functions.
  1092. * NGROUPS_MAX: (libc)General Limits.
  1093. * nice: (libc)Traditional Scheduling Functions.
  1094. * nl_langinfo: (libc)The Elegant and Fast Way.
  1095. * NOFLSH: (libc)Local Modes.
  1096. * NOKERNINFO: (libc)Local Modes.
  1097. * nrand48: (libc)SVID Random.
  1098. * nrand48_r: (libc)SVID Random.
  1099. * NSIG: (libc)Standard Signals.
  1100. * ntohl: (libc)Byte Order.
  1101. * ntohs: (libc)Byte Order.
  1102. * ntp_adjtime: (libc)High Accuracy Clock.
  1103. * ntp_gettime: (libc)High Accuracy Clock.
  1104. * NULL: (libc)Null Pointer Constant.
  1105. * O_ACCMODE: (libc)Access Modes.
  1106. * O_APPEND: (libc)Operating Modes.
  1107. * O_ASYNC: (libc)Operating Modes.
  1108. * obstack_1grow_fast: (libc)Extra Fast Growing.
  1109. * obstack_1grow: (libc)Growing Objects.
  1110. * obstack_alignment_mask: (libc)Obstacks Data Alignment.
  1111. * obstack_alloc: (libc)Allocation in an Obstack.
  1112. * obstack_base: (libc)Status of an Obstack.
  1113. * obstack_blank_fast: (libc)Extra Fast Growing.
  1114. * obstack_blank: (libc)Growing Objects.
  1115. * obstack_chunk_size: (libc)Obstack Chunks.
  1116. * obstack_copy0: (libc)Allocation in an Obstack.
  1117. * obstack_copy: (libc)Allocation in an Obstack.
  1118. * obstack_finish: (libc)Growing Objects.
  1119. * obstack_free: (libc)Freeing Obstack Objects.
  1120. * obstack_grow0: (libc)Growing Objects.
  1121. * obstack_grow: (libc)Growing Objects.
  1122. * obstack_init: (libc)Preparing for Obstacks.
  1123. * obstack_int_grow_fast: (libc)Extra Fast Growing.
  1124. * obstack_int_grow: (libc)Growing Objects.
  1125. * obstack_next_free: (libc)Status of an Obstack.
  1126. * obstack_object_size: (libc)Growing Objects.
  1127. * obstack_object_size: (libc)Status of an Obstack.
  1128. * obstack_printf: (libc)Dynamic Output.
  1129. * obstack_ptr_grow_fast: (libc)Extra Fast Growing.
  1130. * obstack_ptr_grow: (libc)Growing Objects.
  1131. * obstack_room: (libc)Extra Fast Growing.
  1132. * obstack_vprintf: (libc)Variable Arguments Output.
  1133. * O_CREAT: (libc)Open-time Flags.
  1134. * O_EXCL: (libc)Open-time Flags.
  1135. * O_EXEC: (libc)Access Modes.
  1136. * O_EXLOCK: (libc)Open-time Flags.
  1137. * offsetof: (libc)Structure Measurement.
  1138. * O_FSYNC: (libc)Operating Modes.
  1139. * O_IGNORE_CTTY: (libc)Open-time Flags.
  1140. * O_NDELAY: (libc)Operating Modes.
  1141. * on_exit: (libc)Cleanups on Exit.
  1142. * ONLCR: (libc)Output Modes.
  1143. * O_NOATIME: (libc)Operating Modes.
  1144. * O_NOCTTY: (libc)Open-time Flags.
  1145. * ONOEOT: (libc)Output Modes.
  1146. * O_NOLINK: (libc)Open-time Flags.
  1147. * O_NONBLOCK: (libc)Open-time Flags.
  1148. * O_NONBLOCK: (libc)Operating Modes.
  1149. * O_NOTRANS: (libc)Open-time Flags.
  1150. * open64: (libc)Opening and Closing Files.
  1151. * opendir: (libc)Opening a Directory.
  1152. * open: (libc)Opening and Closing Files.
  1153. * openlog: (libc)openlog.
  1154. * OPEN_MAX: (libc)General Limits.
  1155. * open_memstream: (libc)String Streams.
  1156. * openpty: (libc)Pseudo-Terminal Pairs.
  1157. * OPOST: (libc)Output Modes.
  1158. * O_RDONLY: (libc)Access Modes.
  1159. * O_RDWR: (libc)Access Modes.
  1160. * O_READ: (libc)Access Modes.
  1161. * O_SHLOCK: (libc)Open-time Flags.
  1162. * O_SYNC: (libc)Operating Modes.
  1163. * O_TRUNC: (libc)Open-time Flags.
  1164. * O_WRITE: (libc)Access Modes.
  1165. * O_WRONLY: (libc)Access Modes.
  1166. * OXTABS: (libc)Output Modes.
  1167. * PA_FLAG_MASK: (libc)Parsing a Template String.
  1168. * PARENB: (libc)Control Modes.
  1169. * PARMRK: (libc)Input Modes.
  1170. * PARODD: (libc)Control Modes.
  1171. * parse_printf_format: (libc)Parsing a Template String.
  1172. * pathconf: (libc)Pathconf.
  1173. * PATH_MAX: (libc)Limits for Files.
  1174. * _PATH_UTMP: (libc)Manipulating the Database.
  1175. * _PATH_WTMP: (libc)Manipulating the Database.
  1176. * pause: (libc)Using Pause.
  1177. * pclose: (libc)Pipe to a Subprocess.
  1178. * PENDIN: (libc)Local Modes.
  1179. * perror: (libc)Error Messages.
  1180. * PF_FILE: (libc)Local Namespace Details.
  1181. * PF_INET6: (libc)Internet Namespace.
  1182. * PF_INET: (libc)Internet Namespace.
  1183. * PF_LOCAL: (libc)Local Namespace Details.
  1184. * PF_UNIX: (libc)Local Namespace Details.
  1185. * PIPE_BUF: (libc)Limits for Files.
  1186. * pipe: (libc)Creating a Pipe.
  1187. * popen: (libc)Pipe to a Subprocess.
  1188. * _POSIX2_C_DEV: (libc)System Options.
  1189. * _POSIX2_C_VERSION: (libc)Version Supported.
  1190. * _POSIX2_FORT_DEV: (libc)System Options.
  1191. * _POSIX2_FORT_RUN: (libc)System Options.
  1192. * _POSIX2_LOCALEDEF: (libc)System Options.
  1193. * _POSIX2_SW_DEV: (libc)System Options.
  1194. * _POSIX_CHOWN_RESTRICTED: (libc)Options for Files.
  1195. * posix_fallocate64: (libc)Storage Allocation.
  1196. * posix_fallocate: (libc)Storage Allocation.
  1197. * _POSIX_JOB_CONTROL: (libc)System Options.
  1198. * posix_memalign: (libc)Aligned Memory Blocks.
  1199. * _POSIX_NO_TRUNC: (libc)Options for Files.
  1200. * _POSIX_SAVED_IDS: (libc)System Options.
  1201. * _POSIX_VDISABLE: (libc)Options for Files.
  1202. * _POSIX_VERSION: (libc)Version Supported.
  1203. * pow10f: (libc)Exponents and Logarithms.
  1204. * pow10: (libc)Exponents and Logarithms.
  1205. * pow10l: (libc)Exponents and Logarithms.
  1206. * powf: (libc)Exponents and Logarithms.
  1207. * pow: (libc)Exponents and Logarithms.
  1208. * powl: (libc)Exponents and Logarithms.
  1209. * __ppc_get_timebase_freq: (libc)PowerPC.
  1210. * __ppc_get_timebase: (libc)PowerPC.
  1211. * __ppc_mdoio: (libc)PowerPC.
  1212. * __ppc_mdoom: (libc)PowerPC.
  1213. * __ppc_set_ppr_low: (libc)PowerPC.
  1214. * __ppc_set_ppr_med_high: (libc)PowerPC.
  1215. * __ppc_set_ppr_med: (libc)PowerPC.
  1216. * __ppc_set_ppr_med_low: (libc)PowerPC.
  1217. * __ppc_set_ppr_very_low: (libc)PowerPC.
  1218. * __ppc_yield: (libc)PowerPC.
  1219. * pread64: (libc)I/O Primitives.
  1220. * pread: (libc)I/O Primitives.
  1221. * printf: (libc)Formatted Output Functions.
  1222. * printf_size_info: (libc)Predefined Printf Handlers.
  1223. * printf_size: (libc)Predefined Printf Handlers.
  1224. * psignal: (libc)Signal Messages.
  1225. * pthread_getattr_default_np: (libc)Default Thread Attributes.
  1226. * pthread_getspecific: (libc)Thread-specific Data.
  1227. * pthread_key_create: (libc)Thread-specific Data.
  1228. * pthread_key_delete: (libc)Thread-specific Data.
  1229. * pthread_setattr_default_np: (libc)Default Thread Attributes.
  1230. * pthread_setspecific: (libc)Thread-specific Data.
  1231. * P_tmpdir: (libc)Temporary Files.
  1232. * ptsname: (libc)Allocation.
  1233. * ptsname_r: (libc)Allocation.
  1234. * putchar: (libc)Simple Output.
  1235. * putchar_unlocked: (libc)Simple Output.
  1236. * putc: (libc)Simple Output.
  1237. * putc_unlocked: (libc)Simple Output.
  1238. * putenv: (libc)Environment Access.
  1239. * putpwent: (libc)Writing a User Entry.
  1240. * puts: (libc)Simple Output.
  1241. * pututline: (libc)Manipulating the Database.
  1242. * pututxline: (libc)XPG Functions.
  1243. * putwchar: (libc)Simple Output.
  1244. * putwchar_unlocked: (libc)Simple Output.
  1245. * putwc: (libc)Simple Output.
  1246. * putwc_unlocked: (libc)Simple Output.
  1247. * putw: (libc)Simple Output.
  1248. * pwrite64: (libc)I/O Primitives.
  1249. * pwrite: (libc)I/O Primitives.
  1250. * qecvt: (libc)System V Number Conversion.
  1251. * qecvt_r: (libc)System V Number Conversion.
  1252. * qfcvt: (libc)System V Number Conversion.
  1253. * qfcvt_r: (libc)System V Number Conversion.
  1254. * qgcvt: (libc)System V Number Conversion.
  1255. * qsort: (libc)Array Sort Function.
  1256. * raise: (libc)Signaling Yourself.
  1257. * rand: (libc)ISO Random.
  1258. * RAND_MAX: (libc)ISO Random.
  1259. * random: (libc)BSD Random.
  1260. * random_r: (libc)BSD Random.
  1261. * rand_r: (libc)ISO Random.
  1262. * rawmemchr: (libc)Search Functions.
  1263. * readdir64: (libc)Reading/Closing Directory.
  1264. * readdir64_r: (libc)Reading/Closing Directory.
  1265. * readdir: (libc)Reading/Closing Directory.
  1266. * readdir_r: (libc)Reading/Closing Directory.
  1267. * read: (libc)I/O Primitives.
  1268. * readlink: (libc)Symbolic Links.
  1269. * readv: (libc)Scatter-Gather.
  1270. * realloc: (libc)Changing Block Size.
  1271. * realpath: (libc)Symbolic Links.
  1272. * recvfrom: (libc)Receiving Datagrams.
  1273. * recv: (libc)Receiving Data.
  1274. * recvmsg: (libc)Receiving Datagrams.
  1275. * RE_DUP_MAX: (libc)General Limits.
  1276. * regcomp: (libc)POSIX Regexp Compilation.
  1277. * regerror: (libc)Regexp Cleanup.
  1278. * regexec: (libc)Matching POSIX Regexps.
  1279. * regfree: (libc)Regexp Cleanup.
  1280. * register_printf_function: (libc)Registering New Conversions.
  1281. * remainderf: (libc)Remainder Functions.
  1282. * remainder: (libc)Remainder Functions.
  1283. * remainderl: (libc)Remainder Functions.
  1284. * remove: (libc)Deleting Files.
  1285. * rename: (libc)Renaming Files.
  1286. * rewinddir: (libc)Random Access Directory.
  1287. * rewind: (libc)File Positioning.
  1288. * rindex: (libc)Search Functions.
  1289. * rintf: (libc)Rounding Functions.
  1290. * rint: (libc)Rounding Functions.
  1291. * rintl: (libc)Rounding Functions.
  1292. * RLIM_INFINITY: (libc)Limits on Resources.
  1293. * rmdir: (libc)Deleting Files.
  1294. * R_OK: (libc)Testing File Access.
  1295. * roundevenf: (libc)Rounding Functions.
  1296. * roundeven: (libc)Rounding Functions.
  1297. * roundevenl: (libc)Rounding Functions.
  1298. * roundf: (libc)Rounding Functions.
  1299. * round: (libc)Rounding Functions.
  1300. * roundl: (libc)Rounding Functions.
  1301. * rpmatch: (libc)Yes-or-No Questions.
  1302. * SA_NOCLDSTOP: (libc)Flags for Sigaction.
  1303. * SA_ONSTACK: (libc)Flags for Sigaction.
  1304. * SA_RESTART: (libc)Flags for Sigaction.
  1305. * sbrk: (libc)Resizing the Data Segment.
  1306. * scalbf: (libc)Normalization Functions.
  1307. * scalb: (libc)Normalization Functions.
  1308. * scalbl: (libc)Normalization Functions.
  1309. * scalblnf: (libc)Normalization Functions.
  1310. * scalbln: (libc)Normalization Functions.
  1311. * scalblnl: (libc)Normalization Functions.
  1312. * scalbnf: (libc)Normalization Functions.
  1313. * scalbn: (libc)Normalization Functions.
  1314. * scalbnl: (libc)Normalization Functions.
  1315. * scandir64: (libc)Scanning Directory Content.
  1316. * scandir: (libc)Scanning Directory Content.
  1317. * scanf: (libc)Formatted Input Functions.
  1318. * sched_getaffinity: (libc)CPU Affinity.
  1319. * sched_getparam: (libc)Basic Scheduling Functions.
  1320. * sched_get_priority_max: (libc)Basic Scheduling Functions.
  1321. * sched_get_priority_min: (libc)Basic Scheduling Functions.
  1322. * sched_getscheduler: (libc)Basic Scheduling Functions.
  1323. * sched_rr_get_interval: (libc)Basic Scheduling Functions.
  1324. * sched_setaffinity: (libc)CPU Affinity.
  1325. * sched_setparam: (libc)Basic Scheduling Functions.
  1326. * sched_setscheduler: (libc)Basic Scheduling Functions.
  1327. * sched_yield: (libc)Basic Scheduling Functions.
  1328. * secure_getenv: (libc)Environment Access.
  1329. * seed48: (libc)SVID Random.
  1330. * seed48_r: (libc)SVID Random.
  1331. * SEEK_CUR: (libc)File Positioning.
  1332. * seekdir: (libc)Random Access Directory.
  1333. * SEEK_END: (libc)File Positioning.
  1334. * SEEK_SET: (libc)File Positioning.
  1335. * select: (libc)Waiting for I/O.
  1336. * sem_close: (libc)Semaphores.
  1337. * semctl: (libc)Semaphores.
  1338. * sem_destroy: (libc)Semaphores.
  1339. * semget: (libc)Semaphores.
  1340. * sem_getvalue: (libc)Semaphores.
  1341. * sem_init: (libc)Semaphores.
  1342. * sem_open: (libc)Semaphores.
  1343. * semop: (libc)Semaphores.
  1344. * sem_post: (libc)Semaphores.
  1345. * semtimedop: (libc)Semaphores.
  1346. * sem_timedwait: (libc)Semaphores.
  1347. * sem_trywait: (libc)Semaphores.
  1348. * sem_unlink: (libc)Semaphores.
  1349. * sem_wait: (libc)Semaphores.
  1350. * send: (libc)Sending Data.
  1351. * sendmsg: (libc)Receiving Datagrams.
  1352. * sendto: (libc)Sending Datagrams.
  1353. * setbuffer: (libc)Controlling Buffering.
  1354. * setbuf: (libc)Controlling Buffering.
  1355. * setcontext: (libc)System V contexts.
  1356. * setdomainname: (libc)Host Identification.
  1357. * setegid: (libc)Setting Groups.
  1358. * setenv: (libc)Environment Access.
  1359. * seteuid: (libc)Setting User ID.
  1360. * setfsent: (libc)fstab.
  1361. * setgid: (libc)Setting Groups.
  1362. * setgrent: (libc)Scanning All Groups.
  1363. * setgroups: (libc)Setting Groups.
  1364. * sethostent: (libc)Host Names.
  1365. * sethostid: (libc)Host Identification.
  1366. * sethostname: (libc)Host Identification.
  1367. * setitimer: (libc)Setting an Alarm.
  1368. * setjmp: (libc)Non-Local Details.
  1369. * setkey: (libc)DES Encryption.
  1370. * setkey_r: (libc)DES Encryption.
  1371. * setlinebuf: (libc)Controlling Buffering.
  1372. * setlocale: (libc)Setting the Locale.
  1373. * setlogmask: (libc)setlogmask.
  1374. * setmntent: (libc)mtab.
  1375. * setnetent: (libc)Networks Database.
  1376. * setnetgrent: (libc)Lookup Netgroup.
  1377. * setpayloadf: (libc)FP Bit Twiddling.
  1378. * setpayload: (libc)FP Bit Twiddling.
  1379. * setpayloadl: (libc)FP Bit Twiddling.
  1380. * setpayloadsigf: (libc)FP Bit Twiddling.
  1381. * setpayloadsig: (libc)FP Bit Twiddling.
  1382. * setpayloadsigl: (libc)FP Bit Twiddling.
  1383. * setpgid: (libc)Process Group Functions.
  1384. * setpgrp: (libc)Process Group Functions.
  1385. * setpriority: (libc)Traditional Scheduling Functions.
  1386. * setprotoent: (libc)Protocols Database.
  1387. * setpwent: (libc)Scanning All Users.
  1388. * setregid: (libc)Setting Groups.
  1389. * setreuid: (libc)Setting User ID.
  1390. * setrlimit64: (libc)Limits on Resources.
  1391. * setrlimit: (libc)Limits on Resources.
  1392. * setservent: (libc)Services Database.
  1393. * setsid: (libc)Process Group Functions.
  1394. * setsockopt: (libc)Socket Option Functions.
  1395. * setstate: (libc)BSD Random.
  1396. * setstate_r: (libc)BSD Random.
  1397. * settimeofday: (libc)High-Resolution Calendar.
  1398. * setuid: (libc)Setting User ID.
  1399. * setutent: (libc)Manipulating the Database.
  1400. * setutxent: (libc)XPG Functions.
  1401. * setvbuf: (libc)Controlling Buffering.
  1402. * shm_open: (libc)Memory-mapped I/O.
  1403. * shm_unlink: (libc)Memory-mapped I/O.
  1404. * shutdown: (libc)Closing a Socket.
  1405. * S_IFMT: (libc)Testing File Type.
  1406. * SIGABRT: (libc)Program Error Signals.
  1407. * sigaction: (libc)Advanced Signal Handling.
  1408. * sigaddset: (libc)Signal Sets.
  1409. * SIGALRM: (libc)Alarm Signals.
  1410. * sigaltstack: (libc)Signal Stack.
  1411. * sigblock: (libc)BSD Signal Handling.
  1412. * SIGBUS: (libc)Program Error Signals.
  1413. * SIGCHLD: (libc)Job Control Signals.
  1414. * SIGCLD: (libc)Job Control Signals.
  1415. * SIGCONT: (libc)Job Control Signals.
  1416. * sigdelset: (libc)Signal Sets.
  1417. * sigemptyset: (libc)Signal Sets.
  1418. * SIGEMT: (libc)Program Error Signals.
  1419. * SIG_ERR: (libc)Basic Signal Handling.
  1420. * sigfillset: (libc)Signal Sets.
  1421. * SIGFPE: (libc)Program Error Signals.
  1422. * SIGHUP: (libc)Termination Signals.
  1423. * SIGILL: (libc)Program Error Signals.
  1424. * SIGINFO: (libc)Miscellaneous Signals.
  1425. * siginterrupt: (libc)BSD Signal Handling.
  1426. * SIGINT: (libc)Termination Signals.
  1427. * SIGIO: (libc)Asynchronous I/O Signals.
  1428. * SIGIOT: (libc)Program Error Signals.
  1429. * sigismember: (libc)Signal Sets.
  1430. * SIGKILL: (libc)Termination Signals.
  1431. * siglongjmp: (libc)Non-Local Exits and Signals.
  1432. * SIGLOST: (libc)Operation Error Signals.
  1433. * sigmask: (libc)BSD Signal Handling.
  1434. * signal: (libc)Basic Signal Handling.
  1435. * signbit: (libc)FP Bit Twiddling.
  1436. * significandf: (libc)Normalization Functions.
  1437. * significand: (libc)Normalization Functions.
  1438. * significandl: (libc)Normalization Functions.
  1439. * sigpause: (libc)BSD Signal Handling.
  1440. * sigpending: (libc)Checking for Pending Signals.
  1441. * SIGPIPE: (libc)Operation Error Signals.
  1442. * SIGPOLL: (libc)Asynchronous I/O Signals.
  1443. * sigprocmask: (libc)Process Signal Mask.
  1444. * SIGPROF: (libc)Alarm Signals.
  1445. * SIGQUIT: (libc)Termination Signals.
  1446. * SIGSEGV: (libc)Program Error Signals.
  1447. * sigsetjmp: (libc)Non-Local Exits and Signals.
  1448. * sigsetmask: (libc)BSD Signal Handling.
  1449. * sigstack: (libc)Signal Stack.
  1450. * SIGSTOP: (libc)Job Control Signals.
  1451. * sigsuspend: (libc)Sigsuspend.
  1452. * SIGSYS: (libc)Program Error Signals.
  1453. * SIGTERM: (libc)Termination Signals.
  1454. * SIGTRAP: (libc)Program Error Signals.
  1455. * SIGTSTP: (libc)Job Control Signals.
  1456. * SIGTTIN: (libc)Job Control Signals.
  1457. * SIGTTOU: (libc)Job Control Signals.
  1458. * SIGURG: (libc)Asynchronous I/O Signals.
  1459. * SIGUSR1: (libc)Miscellaneous Signals.
  1460. * SIGUSR2: (libc)Miscellaneous Signals.
  1461. * SIGVTALRM: (libc)Alarm Signals.
  1462. * SIGWINCH: (libc)Miscellaneous Signals.
  1463. * SIGXCPU: (libc)Operation Error Signals.
  1464. * SIGXFSZ: (libc)Operation Error Signals.
  1465. * sincosf: (libc)Trig Functions.
  1466. * sincos: (libc)Trig Functions.
  1467. * sincosl: (libc)Trig Functions.
  1468. * sinf: (libc)Trig Functions.
  1469. * sinhf: (libc)Hyperbolic Functions.
  1470. * sinh: (libc)Hyperbolic Functions.
  1471. * sinhl: (libc)Hyperbolic Functions.
  1472. * sin: (libc)Trig Functions.
  1473. * sinl: (libc)Trig Functions.
  1474. * S_ISBLK: (libc)Testing File Type.
  1475. * S_ISCHR: (libc)Testing File Type.
  1476. * S_ISDIR: (libc)Testing File Type.
  1477. * S_ISFIFO: (libc)Testing File Type.
  1478. * S_ISLNK: (libc)Testing File Type.
  1479. * S_ISREG: (libc)Testing File Type.
  1480. * S_ISSOCK: (libc)Testing File Type.
  1481. * sleep: (libc)Sleeping.
  1482. * SNANF: (libc)Infinity and NaN.
  1483. * SNAN: (libc)Infinity and NaN.
  1484. * SNANL: (libc)Infinity and NaN.
  1485. * snprintf: (libc)Formatted Output Functions.
  1486. * SOCK_DGRAM: (libc)Communication Styles.
  1487. * socket: (libc)Creating a Socket.
  1488. * socketpair: (libc)Socket Pairs.
  1489. * SOCK_RAW: (libc)Communication Styles.
  1490. * SOCK_RDM: (libc)Communication Styles.
  1491. * SOCK_SEQPACKET: (libc)Communication Styles.
  1492. * SOCK_STREAM: (libc)Communication Styles.
  1493. * SOL_SOCKET: (libc)Socket-Level Options.
  1494. * sprintf: (libc)Formatted Output Functions.
  1495. * sqrtf: (libc)Exponents and Logarithms.
  1496. * sqrt: (libc)Exponents and Logarithms.
  1497. * sqrtl: (libc)Exponents and Logarithms.
  1498. * srand48: (libc)SVID Random.
  1499. * srand48_r: (libc)SVID Random.
  1500. * srand: (libc)ISO Random.
  1501. * srandom: (libc)BSD Random.
  1502. * srandom_r: (libc)BSD Random.
  1503. * sscanf: (libc)Formatted Input Functions.
  1504. * ssignal: (libc)Basic Signal Handling.
  1505. * SSIZE_MAX: (libc)General Limits.
  1506. * stat64: (libc)Reading Attributes.
  1507. * stat: (libc)Reading Attributes.
  1508. * stime: (libc)Simple Calendar Time.
  1509. * stpcpy: (libc)Copying Strings and Arrays.
  1510. * stpncpy: (libc)Truncating Strings.
  1511. * strcasecmp: (libc)String/Array Comparison.
  1512. * strcasestr: (libc)Search Functions.
  1513. * strcat: (libc)Concatenating Strings.
  1514. * strchr: (libc)Search Functions.
  1515. * strchrnul: (libc)Search Functions.
  1516. * strcmp: (libc)String/Array Comparison.
  1517. * strcoll: (libc)Collation Functions.
  1518. * strcpy: (libc)Copying Strings and Arrays.
  1519. * strcspn: (libc)Search Functions.
  1520. * strdupa: (libc)Copying Strings and Arrays.
  1521. * strdup: (libc)Copying Strings and Arrays.
  1522. * STREAM_MAX: (libc)General Limits.
  1523. * strerror: (libc)Error Messages.
  1524. * strerror_r: (libc)Error Messages.
  1525. * strfmon: (libc)Formatting Numbers.
  1526. * strfromd: (libc)Printing of Floats.
  1527. * strfromf: (libc)Printing of Floats.
  1528. * strfroml: (libc)Printing of Floats.
  1529. * strfry: (libc)strfry.
  1530. * strftime: (libc)Formatting Calendar Time.
  1531. * strlen: (libc)String Length.
  1532. * strncasecmp: (libc)String/Array Comparison.
  1533. * strncat: (libc)Truncating Strings.
  1534. * strncmp: (libc)String/Array Comparison.
  1535. * strncpy: (libc)Truncating Strings.
  1536. * strndupa: (libc)Truncating Strings.
  1537. * strndup: (libc)Truncating Strings.
  1538. * strnlen: (libc)String Length.
  1539. * strpbrk: (libc)Search Functions.
  1540. * strptime: (libc)Low-Level Time String Parsing.
  1541. * strrchr: (libc)Search Functions.
  1542. * strsep: (libc)Finding Tokens in a String.
  1543. * strsignal: (libc)Signal Messages.
  1544. * strspn: (libc)Search Functions.
  1545. * strstr: (libc)Search Functions.
  1546. * strtod: (libc)Parsing of Floats.
  1547. * strtof: (libc)Parsing of Floats.
  1548. * strtoimax: (libc)Parsing of Integers.
  1549. * strtok: (libc)Finding Tokens in a String.
  1550. * strtok_r: (libc)Finding Tokens in a String.
  1551. * strtold: (libc)Parsing of Floats.
  1552. * strtol: (libc)Parsing of Integers.
  1553. * strtoll: (libc)Parsing of Integers.
  1554. * strtoq: (libc)Parsing of Integers.
  1555. * strtoul: (libc)Parsing of Integers.
  1556. * strtoull: (libc)Parsing of Integers.
  1557. * strtoumax: (libc)Parsing of Integers.
  1558. * strtouq: (libc)Parsing of Integers.
  1559. * strverscmp: (libc)String/Array Comparison.
  1560. * strxfrm: (libc)Collation Functions.
  1561. * stty: (libc)BSD Terminal Modes.
  1562. * S_TYPEISMQ: (libc)Testing File Type.
  1563. * S_TYPEISSEM: (libc)Testing File Type.
  1564. * S_TYPEISSHM: (libc)Testing File Type.
  1565. * SUN_LEN: (libc)Local Namespace Details.
  1566. * swapcontext: (libc)System V contexts.
  1567. * swprintf: (libc)Formatted Output Functions.
  1568. * swscanf: (libc)Formatted Input Functions.
  1569. * symlink: (libc)Symbolic Links.
  1570. * sync: (libc)Synchronizing I/O.
  1571. * syscall: (libc)System Calls.
  1572. * sysconf: (libc)Sysconf Definition.
  1573. * sysctl: (libc)System Parameters.
  1574. * syslog: (libc)syslog; vsyslog.
  1575. * system: (libc)Running a Command.
  1576. * sysv_signal: (libc)Basic Signal Handling.
  1577. * tanf: (libc)Trig Functions.
  1578. * tanhf: (libc)Hyperbolic Functions.
  1579. * tanh: (libc)Hyperbolic Functions.
  1580. * tanhl: (libc)Hyperbolic Functions.
  1581. * tan: (libc)Trig Functions.
  1582. * tanl: (libc)Trig Functions.
  1583. * tcdrain: (libc)Line Control.
  1584. * tcflow: (libc)Line Control.
  1585. * tcflush: (libc)Line Control.
  1586. * tcgetattr: (libc)Mode Functions.
  1587. * tcgetpgrp: (libc)Terminal Access Functions.
  1588. * tcgetsid: (libc)Terminal Access Functions.
  1589. * tcsendbreak: (libc)Line Control.
  1590. * tcsetattr: (libc)Mode Functions.
  1591. * tcsetpgrp: (libc)Terminal Access Functions.
  1592. * tdelete: (libc)Tree Search Function.
  1593. * tdestroy: (libc)Tree Search Function.
  1594. * telldir: (libc)Random Access Directory.
  1595. * tempnam: (libc)Temporary Files.
  1596. * textdomain: (libc)Locating gettext catalog.
  1597. * tfind: (libc)Tree Search Function.
  1598. * tgammaf: (libc)Special Functions.
  1599. * tgamma: (libc)Special Functions.
  1600. * tgammal: (libc)Special Functions.
  1601. * timegm: (libc)Broken-down Time.
  1602. * time: (libc)Simple Calendar Time.
  1603. * timelocal: (libc)Broken-down Time.
  1604. * times: (libc)Processor Time.
  1605. * tmpfile64: (libc)Temporary Files.
  1606. * tmpfile: (libc)Temporary Files.
  1607. * TMP_MAX: (libc)Temporary Files.
  1608. * tmpnam: (libc)Temporary Files.
  1609. * tmpnam_r: (libc)Temporary Files.
  1610. * toascii: (libc)Case Conversion.
  1611. * _tolower: (libc)Case Conversion.
  1612. * tolower: (libc)Case Conversion.
  1613. * TOSTOP: (libc)Local Modes.
  1614. * totalorderf: (libc)FP Comparison Functions.
  1615. * totalorder: (libc)FP Comparison Functions.
  1616. * totalorderl: (libc)FP Comparison Functions.
  1617. * totalordermagf: (libc)FP Comparison Functions.
  1618. * totalordermag: (libc)FP Comparison Functions.
  1619. * totalordermagl: (libc)FP Comparison Functions.
  1620. * _toupper: (libc)Case Conversion.
  1621. * toupper: (libc)Case Conversion.
  1622. * towctrans: (libc)Wide Character Case Conversion.
  1623. * towlower: (libc)Wide Character Case Conversion.
  1624. * towupper: (libc)Wide Character Case Conversion.
  1625. * truncate64: (libc)File Size.
  1626. * truncate: (libc)File Size.
  1627. * truncf: (libc)Rounding Functions.
  1628. * trunc: (libc)Rounding Functions.
  1629. * truncl: (libc)Rounding Functions.
  1630. * tsearch: (libc)Tree Search Function.
  1631. * ttyname: (libc)Is It a Terminal.
  1632. * ttyname_r: (libc)Is It a Terminal.
  1633. * twalk: (libc)Tree Search Function.
  1634. * TZNAME_MAX: (libc)General Limits.
  1635. * tzset: (libc)Time Zone Functions.
  1636. * ufromfpf: (libc)Rounding Functions.
  1637. * ufromfp: (libc)Rounding Functions.
  1638. * ufromfpl: (libc)Rounding Functions.
  1639. * ufromfpxf: (libc)Rounding Functions.
  1640. * ufromfpx: (libc)Rounding Functions.
  1641. * ufromfpxl: (libc)Rounding Functions.
  1642. * ulimit: (libc)Limits on Resources.
  1643. * umask: (libc)Setting Permissions.
  1644. * umount2: (libc)Mount-Unmount-Remount.
  1645. * umount: (libc)Mount-Unmount-Remount.
  1646. * uname: (libc)Platform Type.
  1647. * ungetc: (libc)How Unread.
  1648. * ungetwc: (libc)How Unread.
  1649. * unlink: (libc)Deleting Files.
  1650. * unlockpt: (libc)Allocation.
  1651. * unsetenv: (libc)Environment Access.
  1652. * updwtmp: (libc)Manipulating the Database.
  1653. * utime: (libc)File Times.
  1654. * utimes: (libc)File Times.
  1655. * utmpname: (libc)Manipulating the Database.
  1656. * utmpxname: (libc)XPG Functions.
  1657. * va_arg: (libc)Argument Macros.
  1658. * __va_copy: (libc)Argument Macros.
  1659. * va_copy: (libc)Argument Macros.
  1660. * va_end: (libc)Argument Macros.
  1661. * valloc: (libc)Aligned Memory Blocks.
  1662. * vasprintf: (libc)Variable Arguments Output.
  1663. * va_start: (libc)Argument Macros.
  1664. * VDISCARD: (libc)Other Special.
  1665. * VDSUSP: (libc)Signal Characters.
  1666. * VEOF: (libc)Editing Characters.
  1667. * VEOL2: (libc)Editing Characters.
  1668. * VEOL: (libc)Editing Characters.
  1669. * VERASE: (libc)Editing Characters.
  1670. * verr: (libc)Error Messages.
  1671. * verrx: (libc)Error Messages.
  1672. * versionsort64: (libc)Scanning Directory Content.
  1673. * versionsort: (libc)Scanning Directory Content.
  1674. * vfork: (libc)Creating a Process.
  1675. * vfprintf: (libc)Variable Arguments Output.
  1676. * vfscanf: (libc)Variable Arguments Input.
  1677. * vfwprintf: (libc)Variable Arguments Output.
  1678. * vfwscanf: (libc)Variable Arguments Input.
  1679. * VINTR: (libc)Signal Characters.
  1680. * VKILL: (libc)Editing Characters.
  1681. * vlimit: (libc)Limits on Resources.
  1682. * VLNEXT: (libc)Other Special.
  1683. * VMIN: (libc)Noncanonical Input.
  1684. * vprintf: (libc)Variable Arguments Output.
  1685. * VQUIT: (libc)Signal Characters.
  1686. * VREPRINT: (libc)Editing Characters.
  1687. * vscanf: (libc)Variable Arguments Input.
  1688. * vsnprintf: (libc)Variable Arguments Output.
  1689. * vsprintf: (libc)Variable Arguments Output.
  1690. * vsscanf: (libc)Variable Arguments Input.
  1691. * VSTART: (libc)Start/Stop Characters.
  1692. * VSTATUS: (libc)Other Special.
  1693. * VSTOP: (libc)Start/Stop Characters.
  1694. * VSUSP: (libc)Signal Characters.
  1695. * vswprintf: (libc)Variable Arguments Output.
  1696. * vswscanf: (libc)Variable Arguments Input.
  1697. * vsyslog: (libc)syslog; vsyslog.
  1698. * VTIME: (libc)Noncanonical Input.
  1699. * vtimes: (libc)Resource Usage.
  1700. * vwarn: (libc)Error Messages.
  1701. * vwarnx: (libc)Error Messages.
  1702. * VWERASE: (libc)Editing Characters.
  1703. * vwprintf: (libc)Variable Arguments Output.
  1704. * vwscanf: (libc)Variable Arguments Input.
  1705. * wait3: (libc)BSD Wait Functions.
  1706. * wait4: (libc)Process Completion.
  1707. * wait: (libc)Process Completion.
  1708. * waitpid: (libc)Process Completion.
  1709. * warn: (libc)Error Messages.
  1710. * warnx: (libc)Error Messages.
  1711. * WCHAR_MAX: (libc)Extended Char Intro.
  1712. * WCHAR_MIN: (libc)Extended Char Intro.
  1713. * WCOREDUMP: (libc)Process Completion Status.
  1714. * wcpcpy: (libc)Copying Strings and Arrays.
  1715. * wcpncpy: (libc)Truncating Strings.
  1716. * wcrtomb: (libc)Converting a Character.
  1717. * wcscasecmp: (libc)String/Array Comparison.
  1718. * wcscat: (libc)Concatenating Strings.
  1719. * wcschr: (libc)Search Functions.
  1720. * wcschrnul: (libc)Search Functions.
  1721. * wcscmp: (libc)String/Array Comparison.
  1722. * wcscoll: (libc)Collation Functions.
  1723. * wcscpy: (libc)Copying Strings and Arrays.
  1724. * wcscspn: (libc)Search Functions.
  1725. * wcsdup: (libc)Copying Strings and Arrays.
  1726. * wcsftime: (libc)Formatting Calendar Time.
  1727. * wcslen: (libc)String Length.
  1728. * wcsncasecmp: (libc)String/Array Comparison.
  1729. * wcsncat: (libc)Truncating Strings.
  1730. * wcsncmp: (libc)String/Array Comparison.
  1731. * wcsncpy: (libc)Truncating Strings.
  1732. * wcsnlen: (libc)String Length.
  1733. * wcsnrtombs: (libc)Converting Strings.
  1734. * wcspbrk: (libc)Search Functions.
  1735. * wcsrchr: (libc)Search Functions.
  1736. * wcsrtombs: (libc)Converting Strings.
  1737. * wcsspn: (libc)Search Functions.
  1738. * wcsstr: (libc)Search Functions.
  1739. * wcstod: (libc)Parsing of Floats.
  1740. * wcstof: (libc)Parsing of Floats.
  1741. * wcstoimax: (libc)Parsing of Integers.
  1742. * wcstok: (libc)Finding Tokens in a String.
  1743. * wcstold: (libc)Parsing of Floats.
  1744. * wcstol: (libc)Parsing of Integers.
  1745. * wcstoll: (libc)Parsing of Integers.
  1746. * wcstombs: (libc)Non-reentrant String Conversion.
  1747. * wcstoq: (libc)Parsing of Integers.
  1748. * wcstoul: (libc)Parsing of Integers.
  1749. * wcstoull: (libc)Parsing of Integers.
  1750. * wcstoumax: (libc)Parsing of Integers.
  1751. * wcstouq: (libc)Parsing of Integers.
  1752. * wcswcs: (libc)Search Functions.
  1753. * wcsxfrm: (libc)Collation Functions.
  1754. * wctob: (libc)Converting a Character.
  1755. * wctomb: (libc)Non-reentrant Character Conversion.
  1756. * wctrans: (libc)Wide Character Case Conversion.
  1757. * wctype: (libc)Classification of Wide Characters.
  1758. * WEOF: (libc)EOF and Errors.
  1759. * WEOF: (libc)Extended Char Intro.
  1760. * WEXITSTATUS: (libc)Process Completion Status.
  1761. * WIFEXITED: (libc)Process Completion Status.
  1762. * WIFSIGNALED: (libc)Process Completion Status.
  1763. * WIFSTOPPED: (libc)Process Completion Status.
  1764. * wmemchr: (libc)Search Functions.
  1765. * wmemcmp: (libc)String/Array Comparison.
  1766. * wmemcpy: (libc)Copying Strings and Arrays.
  1767. * wmemmove: (libc)Copying Strings and Arrays.
  1768. * wmempcpy: (libc)Copying Strings and Arrays.
  1769. * wmemset: (libc)Copying Strings and Arrays.
  1770. * W_OK: (libc)Testing File Access.
  1771. * wordexp: (libc)Calling Wordexp.
  1772. * wordfree: (libc)Calling Wordexp.
  1773. * wprintf: (libc)Formatted Output Functions.
  1774. * write: (libc)I/O Primitives.
  1775. * writev: (libc)Scatter-Gather.
  1776. * wscanf: (libc)Formatted Input Functions.
  1777. * WSTOPSIG: (libc)Process Completion Status.
  1778. * WTERMSIG: (libc)Process Completion Status.
  1779. * X_OK: (libc)Testing File Access.
  1780. * y0f: (libc)Special Functions.
  1781. * y0: (libc)Special Functions.
  1782. * y0l: (libc)Special Functions.
  1783. * y1f: (libc)Special Functions.
  1784. * y1: (libc)Special Functions.
  1785. * y1l: (libc)Special Functions.
  1786. * ynf: (libc)Special Functions.
  1787. * yn: (libc)Special Functions.
  1788. * ynl: (libc)Special Functions.
  1789. END-INFO-DIR-ENTRY
  1790. 
  1791. File: libc.info, Node: Ports, Next: Services Database, Prev: Host Addresses, Up: Internet Namespace
  1792. 16.6.3 Internet Ports
  1793. ---------------------
  1794. A socket address in the Internet namespace consists of a machine’s
  1795. Internet address plus a "port number" which distinguishes the sockets on
  1796. a given machine (for a given protocol). Port numbers range from 0 to
  1797. 65,535.
  1798. Port numbers less than ‘IPPORT_RESERVED’ are reserved for standard
  1799. servers, such as ‘finger’ and ‘telnet’. There is a database that keeps
  1800. track of these, and you can use the ‘getservbyname’ function to map a
  1801. service name onto a port number; see *note Services Database::.
  1802. If you write a server that is not one of the standard ones defined in
  1803. the database, you must choose a port number for it. Use a number
  1804. greater than ‘IPPORT_USERRESERVED’; such numbers are reserved for
  1805. servers and won’t ever be generated automatically by the system.
  1806. Avoiding conflicts with servers being run by other users is up to you.
  1807. When you use a socket without specifying its address, the system
  1808. generates a port number for it. This number is between
  1809. ‘IPPORT_RESERVED’ and ‘IPPORT_USERRESERVED’.
  1810. On the Internet, it is actually legitimate to have two different
  1811. sockets with the same port number, as long as they never both try to
  1812. communicate with the same socket address (host address plus port
  1813. number). You shouldn’t duplicate a port number except in special
  1814. circumstances where a higher-level protocol requires it. Normally, the
  1815. system won’t let you do it; ‘bind’ normally insists on distinct port
  1816. numbers. To reuse a port number, you must set the socket option
  1817. ‘SO_REUSEADDR’. *Note Socket-Level Options::.
  1818. These macros are defined in the header file ‘netinet/in.h’.
  1819. -- Macro: int IPPORT_RESERVED
  1820. Port numbers less than ‘IPPORT_RESERVED’ are reserved for superuser
  1821. use.
  1822. -- Macro: int IPPORT_USERRESERVED
  1823. Port numbers greater than or equal to ‘IPPORT_USERRESERVED’ are
  1824. reserved for explicit use; they will never be allocated
  1825. automatically.
  1826. 
  1827. File: libc.info, Node: Services Database, Next: Byte Order, Prev: Ports, Up: Internet Namespace
  1828. 16.6.4 The Services Database
  1829. ----------------------------
  1830. The database that keeps track of “well-known” services is usually either
  1831. the file ‘/etc/services’ or an equivalent from a name server. You can
  1832. use these utilities, declared in ‘netdb.h’, to access the services
  1833. database.
  1834. -- Data Type: struct servent
  1835. This data type holds information about entries from the services
  1836. database. It has the following members:
  1837. ‘char *s_name’
  1838. This is the “official” name of the service.
  1839. ‘char **s_aliases’
  1840. These are alternate names for the service, represented as an
  1841. array of strings. A null pointer terminates the array.
  1842. ‘int s_port’
  1843. This is the port number for the service. Port numbers are
  1844. given in network byte order; see *note Byte Order::.
  1845. ‘char *s_proto’
  1846. This is the name of the protocol to use with this service.
  1847. *Note Protocols Database::.
  1848. To get information about a particular service, use the
  1849. ‘getservbyname’ or ‘getservbyport’ functions. The information is
  1850. returned in a statically-allocated structure; you must copy the
  1851. information if you need to save it across calls.
  1852. -- Function: struct servent * getservbyname (const char *NAME, const
  1853. char *PROTO)
  1854. Preliminary: | MT-Unsafe race:servbyname locale | AS-Unsafe dlopen
  1855. plugin heap lock | AC-Unsafe corrupt lock fd mem | *Note POSIX
  1856. Safety Concepts::.
  1857. The ‘getservbyname’ function returns information about the service
  1858. named NAME using protocol PROTO. If it can’t find such a service,
  1859. it returns a null pointer.
  1860. This function is useful for servers as well as for clients; servers
  1861. use it to determine which port they should listen on (*note
  1862. Listening::).
  1863. -- Function: struct servent * getservbyport (int PORT, const char
  1864. *PROTO)
  1865. Preliminary: | MT-Unsafe race:servbyport locale | AS-Unsafe dlopen
  1866. plugin heap lock | AC-Unsafe corrupt lock fd mem | *Note POSIX
  1867. Safety Concepts::.
  1868. The ‘getservbyport’ function returns information about the service
  1869. at port PORT using protocol PROTO. If it can’t find such a
  1870. service, it returns a null pointer.
  1871. You can also scan the services database using ‘setservent’, ‘getservent’
  1872. and ‘endservent’. Be careful when using these functions because they
  1873. are not reentrant.
  1874. -- Function: void setservent (int STAYOPEN)
  1875. Preliminary: | MT-Unsafe race:servent locale | AS-Unsafe dlopen
  1876. plugin heap lock | AC-Unsafe corrupt lock fd mem | *Note POSIX
  1877. Safety Concepts::.
  1878. This function opens the services database to begin scanning it.
  1879. If the STAYOPEN argument is nonzero, this sets a flag so that
  1880. subsequent calls to ‘getservbyname’ or ‘getservbyport’ will not
  1881. close the database (as they usually would). This makes for more
  1882. efficiency if you call those functions several times, by avoiding
  1883. reopening the database for each call.
  1884. -- Function: struct servent * getservent (void)
  1885. Preliminary: | MT-Unsafe race:servent race:serventbuf locale |
  1886. AS-Unsafe dlopen plugin heap lock | AC-Unsafe corrupt lock fd mem |
  1887. *Note POSIX Safety Concepts::.
  1888. This function returns the next entry in the services database. If
  1889. there are no more entries, it returns a null pointer.
  1890. -- Function: void endservent (void)
  1891. Preliminary: | MT-Unsafe race:servent locale | AS-Unsafe dlopen
  1892. plugin heap lock | AC-Unsafe corrupt lock fd mem | *Note POSIX
  1893. Safety Concepts::.
  1894. This function closes the services database.
  1895. 
  1896. File: libc.info, Node: Byte Order, Next: Protocols Database, Prev: Services Database, Up: Internet Namespace
  1897. 16.6.5 Byte Order Conversion
  1898. ----------------------------
  1899. Different kinds of computers use different conventions for the ordering
  1900. of bytes within a word. Some computers put the most significant byte
  1901. within a word first (this is called “big-endian” order), and others put
  1902. it last (“little-endian” order).
  1903. So that machines with different byte order conventions can
  1904. communicate, the Internet protocols specify a canonical byte order
  1905. convention for data transmitted over the network. This is known as
  1906. "network byte order".
  1907. When establishing an Internet socket connection, you must make sure
  1908. that the data in the ‘sin_port’ and ‘sin_addr’ members of the
  1909. ‘sockaddr_in’ structure are represented in network byte order. If you
  1910. are encoding integer data in the messages sent through the socket, you
  1911. should convert this to network byte order too. If you don’t do this,
  1912. your program may fail when running on or talking to other kinds of
  1913. machines.
  1914. If you use ‘getservbyname’ and ‘gethostbyname’ or ‘inet_addr’ to get
  1915. the port number and host address, the values are already in network byte
  1916. order, and you can copy them directly into the ‘sockaddr_in’ structure.
  1917. Otherwise, you have to convert the values explicitly. Use ‘htons’
  1918. and ‘ntohs’ to convert values for the ‘sin_port’ member. Use ‘htonl’
  1919. and ‘ntohl’ to convert IPv4 addresses for the ‘sin_addr’ member.
  1920. (Remember, ‘struct in_addr’ is equivalent to ‘uint32_t’.) These
  1921. functions are declared in ‘netinet/in.h’.
  1922. -- Function: uint16_t htons (uint16_t HOSTSHORT)
  1923. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  1924. Concepts::.
  1925. This function converts the ‘uint16_t’ integer HOSTSHORT from host
  1926. byte order to network byte order.
  1927. -- Function: uint16_t ntohs (uint16_t NETSHORT)
  1928. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  1929. Concepts::.
  1930. This function converts the ‘uint16_t’ integer NETSHORT from network
  1931. byte order to host byte order.
  1932. -- Function: uint32_t htonl (uint32_t HOSTLONG)
  1933. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  1934. Concepts::.
  1935. This function converts the ‘uint32_t’ integer HOSTLONG from host
  1936. byte order to network byte order.
  1937. This is used for IPv4 Internet addresses.
  1938. -- Function: uint32_t ntohl (uint32_t NETLONG)
  1939. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  1940. Concepts::.
  1941. This function converts the ‘uint32_t’ integer NETLONG from network
  1942. byte order to host byte order.
  1943. This is used for IPv4 Internet addresses.
  1944. 
  1945. File: libc.info, Node: Protocols Database, Next: Inet Example, Prev: Byte Order, Up: Internet Namespace
  1946. 16.6.6 Protocols Database
  1947. -------------------------
  1948. The communications protocol used with a socket controls low-level
  1949. details of how data are exchanged. For example, the protocol implements
  1950. things like checksums to detect errors in transmissions, and routing
  1951. instructions for messages. Normal user programs have little reason to
  1952. mess with these details directly.
  1953. The default communications protocol for the Internet namespace
  1954. depends on the communication style. For stream communication, the
  1955. default is TCP (“transmission control protocol”). For datagram
  1956. communication, the default is UDP (“user datagram protocol”). For
  1957. reliable datagram communication, the default is RDP (“reliable datagram
  1958. protocol”). You should nearly always use the default.
  1959. Internet protocols are generally specified by a name instead of a
  1960. number. The network protocols that a host knows about are stored in a
  1961. database. This is usually either derived from the file
  1962. ‘/etc/protocols’, or it may be an equivalent provided by a name server.
  1963. You look up the protocol number associated with a named protocol in the
  1964. database using the ‘getprotobyname’ function.
  1965. Here are detailed descriptions of the utilities for accessing the
  1966. protocols database. These are declared in ‘netdb.h’.
  1967. -- Data Type: struct protoent
  1968. This data type is used to represent entries in the network
  1969. protocols database. It has the following members:
  1970. ‘char *p_name’
  1971. This is the official name of the protocol.
  1972. ‘char **p_aliases’
  1973. These are alternate names for the protocol, specified as an
  1974. array of strings. The last element of the array is a null
  1975. pointer.
  1976. ‘int p_proto’
  1977. This is the protocol number (in host byte order); use this
  1978. member as the PROTOCOL argument to ‘socket’.
  1979. You can use ‘getprotobyname’ and ‘getprotobynumber’ to search the
  1980. protocols database for a specific protocol. The information is returned
  1981. in a statically-allocated structure; you must copy the information if
  1982. you need to save it across calls.
  1983. -- Function: struct protoent * getprotobyname (const char *NAME)
  1984. Preliminary: | MT-Unsafe race:protobyname locale | AS-Unsafe dlopen
  1985. plugin heap lock | AC-Unsafe corrupt lock fd mem | *Note POSIX
  1986. Safety Concepts::.
  1987. The ‘getprotobyname’ function returns information about the network
  1988. protocol named NAME. If there is no such protocol, it returns a
  1989. null pointer.
  1990. -- Function: struct protoent * getprotobynumber (int PROTOCOL)
  1991. Preliminary: | MT-Unsafe race:protobynumber locale | AS-Unsafe
  1992. dlopen plugin heap lock | AC-Unsafe corrupt lock fd mem | *Note
  1993. POSIX Safety Concepts::.
  1994. The ‘getprotobynumber’ function returns information about the
  1995. network protocol with number PROTOCOL. If there is no such
  1996. protocol, it returns a null pointer.
  1997. You can also scan the whole protocols database one protocol at a time
  1998. by using ‘setprotoent’, ‘getprotoent’ and ‘endprotoent’. Be careful
  1999. when using these functions because they are not reentrant.
  2000. -- Function: void setprotoent (int STAYOPEN)
  2001. Preliminary: | MT-Unsafe race:protoent locale | AS-Unsafe dlopen
  2002. plugin heap lock | AC-Unsafe corrupt lock fd mem | *Note POSIX
  2003. Safety Concepts::.
  2004. This function opens the protocols database to begin scanning it.
  2005. If the STAYOPEN argument is nonzero, this sets a flag so that
  2006. subsequent calls to ‘getprotobyname’ or ‘getprotobynumber’ will not
  2007. close the database (as they usually would). This makes for more
  2008. efficiency if you call those functions several times, by avoiding
  2009. reopening the database for each call.
  2010. -- Function: struct protoent * getprotoent (void)
  2011. Preliminary: | MT-Unsafe race:protoent race:protoentbuf locale |
  2012. AS-Unsafe dlopen plugin heap lock | AC-Unsafe corrupt lock fd mem |
  2013. *Note POSIX Safety Concepts::.
  2014. This function returns the next entry in the protocols database. It
  2015. returns a null pointer if there are no more entries.
  2016. -- Function: void endprotoent (void)
  2017. Preliminary: | MT-Unsafe race:protoent locale | AS-Unsafe dlopen
  2018. plugin heap lock | AC-Unsafe corrupt lock fd mem | *Note POSIX
  2019. Safety Concepts::.
  2020. This function closes the protocols database.
  2021. 
  2022. File: libc.info, Node: Inet Example, Prev: Protocols Database, Up: Internet Namespace
  2023. 16.6.7 Internet Socket Example
  2024. ------------------------------
  2025. Here is an example showing how to create and name a socket in the
  2026. Internet namespace. The newly created socket exists on the machine that
  2027. the program is running on. Rather than finding and using the machine’s
  2028. Internet address, this example specifies ‘INADDR_ANY’ as the host
  2029. address; the system replaces that with the machine’s actual address.
  2030. #include <stdio.h>
  2031. #include <stdlib.h>
  2032. #include <sys/socket.h>
  2033. #include <netinet/in.h>
  2034. int
  2035. make_socket (uint16_t port)
  2036. {
  2037. int sock;
  2038. struct sockaddr_in name;
  2039. /* Create the socket. */
  2040. sock = socket (PF_INET, SOCK_STREAM, 0);
  2041. if (sock < 0)
  2042. {
  2043. perror ("socket");
  2044. exit (EXIT_FAILURE);
  2045. }
  2046. /* Give the socket a name. */
  2047. name.sin_family = AF_INET;
  2048. name.sin_port = htons (port);
  2049. name.sin_addr.s_addr = htonl (INADDR_ANY);
  2050. if (bind (sock, (struct sockaddr *) &name, sizeof (name)) < 0)
  2051. {
  2052. perror ("bind");
  2053. exit (EXIT_FAILURE);
  2054. }
  2055. return sock;
  2056. }
  2057. Here is another example, showing how you can fill in a ‘sockaddr_in’
  2058. structure, given a host name string and a port number:
  2059. #include <stdio.h>
  2060. #include <stdlib.h>
  2061. #include <sys/socket.h>
  2062. #include <netinet/in.h>
  2063. #include <netdb.h>
  2064. void
  2065. init_sockaddr (struct sockaddr_in *name,
  2066. const char *hostname,
  2067. uint16_t port)
  2068. {
  2069. struct hostent *hostinfo;
  2070. name->sin_family = AF_INET;
  2071. name->sin_port = htons (port);
  2072. hostinfo = gethostbyname (hostname);
  2073. if (hostinfo == NULL)
  2074. {
  2075. fprintf (stderr, "Unknown host %s.\n", hostname);
  2076. exit (EXIT_FAILURE);
  2077. }
  2078. name->sin_addr = *(struct in_addr *) hostinfo->h_addr;
  2079. }
  2080. 
  2081. File: libc.info, Node: Misc Namespaces, Next: Open/Close Sockets, Prev: Internet Namespace, Up: Sockets
  2082. 16.7 Other Namespaces
  2083. =====================
  2084. Certain other namespaces and associated protocol families are supported
  2085. but not documented yet because they are not often used. ‘PF_NS’ refers
  2086. to the Xerox Network Software protocols. ‘PF_ISO’ stands for Open
  2087. Systems Interconnect. ‘PF_CCITT’ refers to protocols from CCITT.
  2088. ‘socket.h’ defines these symbols and others naming protocols not
  2089. actually implemented.
  2090. ‘PF_IMPLINK’ is used for communicating between hosts and Internet
  2091. Message Processors. For information on this and ‘PF_ROUTE’, an
  2092. occasionally-used local area routing protocol, see the GNU Hurd Manual
  2093. (to appear in the future).
  2094. 
  2095. File: libc.info, Node: Open/Close Sockets, Next: Connections, Prev: Misc Namespaces, Up: Sockets
  2096. 16.8 Opening and Closing Sockets
  2097. ================================
  2098. This section describes the actual library functions for opening and
  2099. closing sockets. The same functions work for all namespaces and
  2100. connection styles.
  2101. * Menu:
  2102. * Creating a Socket:: How to open a socket.
  2103. * Closing a Socket:: How to close a socket.
  2104. * Socket Pairs:: These are created like pipes.
  2105. 
  2106. File: libc.info, Node: Creating a Socket, Next: Closing a Socket, Up: Open/Close Sockets
  2107. 16.8.1 Creating a Socket
  2108. ------------------------
  2109. The primitive for creating a socket is the ‘socket’ function, declared
  2110. in ‘sys/socket.h’.
  2111. -- Function: int socket (int NAMESPACE, int STYLE, int PROTOCOL)
  2112. Preliminary: | MT-Safe | AS-Safe | AC-Safe fd | *Note POSIX Safety
  2113. Concepts::.
  2114. This function creates a socket and specifies communication style
  2115. STYLE, which should be one of the socket styles listed in *note
  2116. Communication Styles::. The NAMESPACE argument specifies the
  2117. namespace; it must be ‘PF_LOCAL’ (*note Local Namespace::) or
  2118. ‘PF_INET’ (*note Internet Namespace::). PROTOCOL designates the
  2119. specific protocol (*note Socket Concepts::); zero is usually right
  2120. for PROTOCOL.
  2121. The return value from ‘socket’ is the file descriptor for the new
  2122. socket, or ‘-1’ in case of error. The following ‘errno’ error
  2123. conditions are defined for this function:
  2124. ‘EPROTONOSUPPORT’
  2125. The PROTOCOL or STYLE is not supported by the NAMESPACE
  2126. specified.
  2127. ‘EMFILE’
  2128. The process already has too many file descriptors open.
  2129. ‘ENFILE’
  2130. The system already has too many file descriptors open.
  2131. ‘EACCES’
  2132. The process does not have the privilege to create a socket of
  2133. the specified STYLE or PROTOCOL.
  2134. ‘ENOBUFS’
  2135. The system ran out of internal buffer space.
  2136. The file descriptor returned by the ‘socket’ function supports both
  2137. read and write operations. However, like pipes, sockets do not
  2138. support file positioning operations.
  2139. For examples of how to call the ‘socket’ function, see *note Local
  2140. Socket Example::, or *note Inet Example::.
  2141. 
  2142. File: libc.info, Node: Closing a Socket, Next: Socket Pairs, Prev: Creating a Socket, Up: Open/Close Sockets
  2143. 16.8.2 Closing a Socket
  2144. -----------------------
  2145. When you have finished using a socket, you can simply close its file
  2146. descriptor with ‘close’; see *note Opening and Closing Files::. If
  2147. there is still data waiting to be transmitted over the connection,
  2148. normally ‘close’ tries to complete this transmission. You can control
  2149. this behavior using the ‘SO_LINGER’ socket option to specify a timeout
  2150. period; see *note Socket Options::.
  2151. You can also shut down only reception or transmission on a connection
  2152. by calling ‘shutdown’, which is declared in ‘sys/socket.h’.
  2153. -- Function: int shutdown (int SOCKET, int HOW)
  2154. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2155. Concepts::.
  2156. The ‘shutdown’ function shuts down the connection of socket SOCKET.
  2157. The argument HOW specifies what action to perform:
  2158. ‘0’
  2159. Stop receiving data for this socket. If further data arrives,
  2160. reject it.
  2161. ‘1’
  2162. Stop trying to transmit data from this socket. Discard any
  2163. data waiting to be sent. Stop looking for acknowledgement of
  2164. data already sent; don’t retransmit it if it is lost.
  2165. ‘2’
  2166. Stop both reception and transmission.
  2167. The return value is ‘0’ on success and ‘-1’ on failure. The
  2168. following ‘errno’ error conditions are defined for this function:
  2169. ‘EBADF’
  2170. SOCKET is not a valid file descriptor.
  2171. ‘ENOTSOCK’
  2172. SOCKET is not a socket.
  2173. ‘ENOTCONN’
  2174. SOCKET is not connected.
  2175. 
  2176. File: libc.info, Node: Socket Pairs, Prev: Closing a Socket, Up: Open/Close Sockets
  2177. 16.8.3 Socket Pairs
  2178. -------------------
  2179. A "socket pair" consists of a pair of connected (but unnamed) sockets.
  2180. It is very similar to a pipe and is used in much the same way. Socket
  2181. pairs are created with the ‘socketpair’ function, declared in
  2182. ‘sys/socket.h’. A socket pair is much like a pipe; the main difference
  2183. is that the socket pair is bidirectional, whereas the pipe has one
  2184. input-only end and one output-only end (*note Pipes and FIFOs::).
  2185. -- Function: int socketpair (int NAMESPACE, int STYLE, int PROTOCOL,
  2186. int FILEDES[2])
  2187. Preliminary: | MT-Safe | AS-Safe | AC-Safe fd | *Note POSIX Safety
  2188. Concepts::.
  2189. This function creates a socket pair, returning the file descriptors
  2190. in ‘FILEDES[0]’ and ‘FILEDES[1]’. The socket pair is a full-duplex
  2191. communications channel, so that both reading and writing may be
  2192. performed at either end.
  2193. The NAMESPACE, STYLE and PROTOCOL arguments are interpreted as for
  2194. the ‘socket’ function. STYLE should be one of the communication
  2195. styles listed in *note Communication Styles::. The NAMESPACE
  2196. argument specifies the namespace, which must be ‘AF_LOCAL’ (*note
  2197. Local Namespace::); PROTOCOL specifies the communications protocol,
  2198. but zero is the only meaningful value.
  2199. If STYLE specifies a connectionless communication style, then the
  2200. two sockets you get are not _connected_, strictly speaking, but
  2201. each of them knows the other as the default destination address, so
  2202. they can send packets to each other.
  2203. The ‘socketpair’ function returns ‘0’ on success and ‘-1’ on
  2204. failure. The following ‘errno’ error conditions are defined for
  2205. this function:
  2206. ‘EMFILE’
  2207. The process has too many file descriptors open.
  2208. ‘EAFNOSUPPORT’
  2209. The specified namespace is not supported.
  2210. ‘EPROTONOSUPPORT’
  2211. The specified protocol is not supported.
  2212. ‘EOPNOTSUPP’
  2213. The specified protocol does not support the creation of socket
  2214. pairs.
  2215. 
  2216. File: libc.info, Node: Connections, Next: Datagrams, Prev: Open/Close Sockets, Up: Sockets
  2217. 16.9 Using Sockets with Connections
  2218. ===================================
  2219. The most common communication styles involve making a connection to a
  2220. particular other socket, and then exchanging data with that socket over
  2221. and over. Making a connection is asymmetric; one side (the "client")
  2222. acts to request a connection, while the other side (the "server") makes
  2223. a socket and waits for the connection request.
  2224. * Menu:
  2225. * Connecting:: What the client program must do.
  2226. * Listening:: How a server program waits for requests.
  2227. * Accepting Connections:: What the server does when it gets a request.
  2228. * Who is Connected:: Getting the address of the
  2229. other side of a connection.
  2230. * Transferring Data:: How to send and receive data.
  2231. * Byte Stream Example:: An example program: a client for communicating
  2232. over a byte stream socket in the Internet namespace.
  2233. * Server Example:: A corresponding server program.
  2234. * Out-of-Band Data:: This is an advanced feature.
  2235. 
  2236. File: libc.info, Node: Connecting, Next: Listening, Up: Connections
  2237. 16.9.1 Making a Connection
  2238. --------------------------
  2239. In making a connection, the client makes a connection while the server
  2240. waits for and accepts the connection. Here we discuss what the client
  2241. program must do with the ‘connect’ function, which is declared in
  2242. ‘sys/socket.h’.
  2243. -- Function: int connect (int SOCKET, struct sockaddr *ADDR, socklen_t
  2244. LENGTH)
  2245. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2246. Concepts::.
  2247. The ‘connect’ function initiates a connection from the socket with
  2248. file descriptor SOCKET to the socket whose address is specified by
  2249. the ADDR and LENGTH arguments. (This socket is typically on
  2250. another machine, and it must be already set up as a server.) *Note
  2251. Socket Addresses::, for information about how these arguments are
  2252. interpreted.
  2253. Normally, ‘connect’ waits until the server responds to the request
  2254. before it returns. You can set nonblocking mode on the socket
  2255. SOCKET to make ‘connect’ return immediately without waiting for the
  2256. response. *Note File Status Flags::, for information about
  2257. nonblocking mode.
  2258. The normal return value from ‘connect’ is ‘0’. If an error occurs,
  2259. ‘connect’ returns ‘-1’. The following ‘errno’ error conditions are
  2260. defined for this function:
  2261. ‘EBADF’
  2262. The socket SOCKET is not a valid file descriptor.
  2263. ‘ENOTSOCK’
  2264. File descriptor SOCKET is not a socket.
  2265. ‘EADDRNOTAVAIL’
  2266. The specified address is not available on the remote machine.
  2267. ‘EAFNOSUPPORT’
  2268. The namespace of the ADDR is not supported by this socket.
  2269. ‘EISCONN’
  2270. The socket SOCKET is already connected.
  2271. ‘ETIMEDOUT’
  2272. The attempt to establish the connection timed out.
  2273. ‘ECONNREFUSED’
  2274. The server has actively refused to establish the connection.
  2275. ‘ENETUNREACH’
  2276. The network of the given ADDR isn’t reachable from this host.
  2277. ‘EADDRINUSE’
  2278. The socket address of the given ADDR is already in use.
  2279. ‘EINPROGRESS’
  2280. The socket SOCKET is non-blocking and the connection could not
  2281. be established immediately. You can determine when the
  2282. connection is completely established with ‘select’; *note
  2283. Waiting for I/O::. Another ‘connect’ call on the same socket,
  2284. before the connection is completely established, will fail
  2285. with ‘EALREADY’.
  2286. ‘EALREADY’
  2287. The socket SOCKET is non-blocking and already has a pending
  2288. connection in progress (see ‘EINPROGRESS’ above).
  2289. This function is defined as a cancellation point in multi-threaded
  2290. programs, so one has to be prepared for this and make sure that
  2291. allocated resources (like memory, file descriptors, semaphores or
  2292. whatever) are freed even if the thread is canceled.
  2293. 
  2294. File: libc.info, Node: Listening, Next: Accepting Connections, Prev: Connecting, Up: Connections
  2295. 16.9.2 Listening for Connections
  2296. --------------------------------
  2297. Now let us consider what the server process must do to accept
  2298. connections on a socket. First it must use the ‘listen’ function to
  2299. enable connection requests on the socket, and then accept each incoming
  2300. connection with a call to ‘accept’ (*note Accepting Connections::).
  2301. Once connection requests are enabled on a server socket, the ‘select’
  2302. function reports when the socket has a connection ready to be accepted
  2303. (*note Waiting for I/O::).
  2304. The ‘listen’ function is not allowed for sockets using connectionless
  2305. communication styles.
  2306. You can write a network server that does not even start running until
  2307. a connection to it is requested. *Note Inetd Servers::.
  2308. In the Internet namespace, there are no special protection mechanisms
  2309. for controlling access to a port; any process on any machine can make a
  2310. connection to your server. If you want to restrict access to your
  2311. server, make it examine the addresses associated with connection
  2312. requests or implement some other handshaking or identification protocol.
  2313. In the local namespace, the ordinary file protection bits control who
  2314. has access to connect to the socket.
  2315. -- Function: int listen (int SOCKET, int N)
  2316. Preliminary: | MT-Safe | AS-Safe | AC-Safe fd | *Note POSIX Safety
  2317. Concepts::.
  2318. The ‘listen’ function enables the socket SOCKET to accept
  2319. connections, thus making it a server socket.
  2320. The argument N specifies the length of the queue for pending
  2321. connections. When the queue fills, new clients attempting to
  2322. connect fail with ‘ECONNREFUSED’ until the server calls ‘accept’ to
  2323. accept a connection from the queue.
  2324. The ‘listen’ function returns ‘0’ on success and ‘-1’ on failure.
  2325. The following ‘errno’ error conditions are defined for this
  2326. function:
  2327. ‘EBADF’
  2328. The argument SOCKET is not a valid file descriptor.
  2329. ‘ENOTSOCK’
  2330. The argument SOCKET is not a socket.
  2331. ‘EOPNOTSUPP’
  2332. The socket SOCKET does not support this operation.
  2333. 
  2334. File: libc.info, Node: Accepting Connections, Next: Who is Connected, Prev: Listening, Up: Connections
  2335. 16.9.3 Accepting Connections
  2336. ----------------------------
  2337. When a server receives a connection request, it can complete the
  2338. connection by accepting the request. Use the function ‘accept’ to do
  2339. this.
  2340. A socket that has been established as a server can accept connection
  2341. requests from multiple clients. The server’s original socket _does not
  2342. become part of the connection_; instead, ‘accept’ makes a new socket
  2343. which participates in the connection. ‘accept’ returns the descriptor
  2344. for this socket. The server’s original socket remains available for
  2345. listening for further connection requests.
  2346. The number of pending connection requests on a server socket is
  2347. finite. If connection requests arrive from clients faster than the
  2348. server can act upon them, the queue can fill up and additional requests
  2349. are refused with an ‘ECONNREFUSED’ error. You can specify the maximum
  2350. length of this queue as an argument to the ‘listen’ function, although
  2351. the system may also impose its own internal limit on the length of this
  2352. queue.
  2353. -- Function: int accept (int SOCKET, struct sockaddr *ADDR, socklen_t
  2354. *LENGTH_PTR)
  2355. Preliminary: | MT-Safe | AS-Safe | AC-Safe fd | *Note POSIX Safety
  2356. Concepts::.
  2357. This function is used to accept a connection request on the server
  2358. socket SOCKET.
  2359. The ‘accept’ function waits if there are no connections pending,
  2360. unless the socket SOCKET has nonblocking mode set. (You can use
  2361. ‘select’ to wait for a pending connection, with a nonblocking
  2362. socket.) *Note File Status Flags::, for information about
  2363. nonblocking mode.
  2364. The ADDR and LENGTH-PTR arguments are used to return information
  2365. about the name of the client socket that initiated the connection.
  2366. *Note Socket Addresses::, for information about the format of the
  2367. information.
  2368. Accepting a connection does not make SOCKET part of the connection.
  2369. Instead, it creates a new socket which becomes connected. The
  2370. normal return value of ‘accept’ is the file descriptor for the new
  2371. socket.
  2372. After ‘accept’, the original socket SOCKET remains open and
  2373. unconnected, and continues listening until you close it. You can
  2374. accept further connections with SOCKET by calling ‘accept’ again.
  2375. If an error occurs, ‘accept’ returns ‘-1’. The following ‘errno’
  2376. error conditions are defined for this function:
  2377. ‘EBADF’
  2378. The SOCKET argument is not a valid file descriptor.
  2379. ‘ENOTSOCK’
  2380. The descriptor SOCKET argument is not a socket.
  2381. ‘EOPNOTSUPP’
  2382. The descriptor SOCKET does not support this operation.
  2383. ‘EWOULDBLOCK’
  2384. SOCKET has nonblocking mode set, and there are no pending
  2385. connections immediately available.
  2386. This function is defined as a cancellation point in multi-threaded
  2387. programs, so one has to be prepared for this and make sure that
  2388. allocated resources (like memory, file descriptors, semaphores or
  2389. whatever) are freed even if the thread is canceled.
  2390. The ‘accept’ function is not allowed for sockets using connectionless
  2391. communication styles.
  2392. 
  2393. File: libc.info, Node: Who is Connected, Next: Transferring Data, Prev: Accepting Connections, Up: Connections
  2394. 16.9.4 Who is Connected to Me?
  2395. ------------------------------
  2396. -- Function: int getpeername (int SOCKET, struct sockaddr *ADDR,
  2397. socklen_t *LENGTH-PTR)
  2398. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2399. Concepts::.
  2400. The ‘getpeername’ function returns the address of the socket that
  2401. SOCKET is connected to; it stores the address in the memory space
  2402. specified by ADDR and LENGTH-PTR. It stores the length of the
  2403. address in ‘*LENGTH-PTR’.
  2404. *Note Socket Addresses::, for information about the format of the
  2405. address. In some operating systems, ‘getpeername’ works only for
  2406. sockets in the Internet domain.
  2407. The return value is ‘0’ on success and ‘-1’ on error. The
  2408. following ‘errno’ error conditions are defined for this function:
  2409. ‘EBADF’
  2410. The argument SOCKET is not a valid file descriptor.
  2411. ‘ENOTSOCK’
  2412. The descriptor SOCKET is not a socket.
  2413. ‘ENOTCONN’
  2414. The socket SOCKET is not connected.
  2415. ‘ENOBUFS’
  2416. There are not enough internal buffers available.
  2417. 
  2418. File: libc.info, Node: Transferring Data, Next: Byte Stream Example, Prev: Who is Connected, Up: Connections
  2419. 16.9.5 Transferring Data
  2420. ------------------------
  2421. Once a socket has been connected to a peer, you can use the ordinary
  2422. ‘read’ and ‘write’ operations (*note I/O Primitives::) to transfer data.
  2423. A socket is a two-way communications channel, so read and write
  2424. operations can be performed at either end.
  2425. There are also some I/O modes that are specific to socket operations.
  2426. In order to specify these modes, you must use the ‘recv’ and ‘send’
  2427. functions instead of the more generic ‘read’ and ‘write’ functions. The
  2428. ‘recv’ and ‘send’ functions take an additional argument which you can
  2429. use to specify various flags to control special I/O modes. For example,
  2430. you can specify the ‘MSG_OOB’ flag to read or write out-of-band data,
  2431. the ‘MSG_PEEK’ flag to peek at input, or the ‘MSG_DONTROUTE’ flag to
  2432. control inclusion of routing information on output.
  2433. * Menu:
  2434. * Sending Data:: Sending data with ‘send’.
  2435. * Receiving Data:: Reading data with ‘recv’.
  2436. * Socket Data Options:: Using ‘send’ and ‘recv’.
  2437. 
  2438. File: libc.info, Node: Sending Data, Next: Receiving Data, Up: Transferring Data
  2439. 16.9.5.1 Sending Data
  2440. .....................
  2441. The ‘send’ function is declared in the header file ‘sys/socket.h’. If
  2442. your FLAGS argument is zero, you can just as well use ‘write’ instead of
  2443. ‘send’; see *note I/O Primitives::. If the socket was connected but the
  2444. connection has broken, you get a ‘SIGPIPE’ signal for any use of ‘send’
  2445. or ‘write’ (*note Miscellaneous Signals::).
  2446. -- Function: ssize_t send (int SOCKET, const void *BUFFER, size_t SIZE,
  2447. int FLAGS)
  2448. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2449. Concepts::.
  2450. The ‘send’ function is like ‘write’, but with the additional flags
  2451. FLAGS. The possible values of FLAGS are described in *note Socket
  2452. Data Options::.
  2453. This function returns the number of bytes transmitted, or ‘-1’ on
  2454. failure. If the socket is nonblocking, then ‘send’ (like ‘write’)
  2455. can return after sending just part of the data. *Note File Status
  2456. Flags::, for information about nonblocking mode.
  2457. Note, however, that a successful return value merely indicates that
  2458. the message has been sent without error, not necessarily that it
  2459. has been received without error.
  2460. The following ‘errno’ error conditions are defined for this
  2461. function:
  2462. ‘EBADF’
  2463. The SOCKET argument is not a valid file descriptor.
  2464. ‘EINTR’
  2465. The operation was interrupted by a signal before any data was
  2466. sent. *Note Interrupted Primitives::.
  2467. ‘ENOTSOCK’
  2468. The descriptor SOCKET is not a socket.
  2469. ‘EMSGSIZE’
  2470. The socket type requires that the message be sent atomically,
  2471. but the message is too large for this to be possible.
  2472. ‘EWOULDBLOCK’
  2473. Nonblocking mode has been set on the socket, and the write
  2474. operation would block. (Normally ‘send’ blocks until the
  2475. operation can be completed.)
  2476. ‘ENOBUFS’
  2477. There is not enough internal buffer space available.
  2478. ‘ENOTCONN’
  2479. You never connected this socket.
  2480. ‘EPIPE’
  2481. This socket was connected but the connection is now broken.
  2482. In this case, ‘send’ generates a ‘SIGPIPE’ signal first; if
  2483. that signal is ignored or blocked, or if its handler returns,
  2484. then ‘send’ fails with ‘EPIPE’.
  2485. This function is defined as a cancellation point in multi-threaded
  2486. programs, so one has to be prepared for this and make sure that
  2487. allocated resources (like memory, file descriptors, semaphores or
  2488. whatever) are freed even if the thread is canceled.
  2489. 
  2490. File: libc.info, Node: Receiving Data, Next: Socket Data Options, Prev: Sending Data, Up: Transferring Data
  2491. 16.9.5.2 Receiving Data
  2492. .......................
  2493. The ‘recv’ function is declared in the header file ‘sys/socket.h’. If
  2494. your FLAGS argument is zero, you can just as well use ‘read’ instead of
  2495. ‘recv’; see *note I/O Primitives::.
  2496. -- Function: ssize_t recv (int SOCKET, void *BUFFER, size_t SIZE, int
  2497. FLAGS)
  2498. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2499. Concepts::.
  2500. The ‘recv’ function is like ‘read’, but with the additional flags
  2501. FLAGS. The possible values of FLAGS are described in *note Socket
  2502. Data Options::.
  2503. If nonblocking mode is set for SOCKET, and no data are available to
  2504. be read, ‘recv’ fails immediately rather than waiting. *Note File
  2505. Status Flags::, for information about nonblocking mode.
  2506. This function returns the number of bytes received, or ‘-1’ on
  2507. failure. The following ‘errno’ error conditions are defined for
  2508. this function:
  2509. ‘EBADF’
  2510. The SOCKET argument is not a valid file descriptor.
  2511. ‘ENOTSOCK’
  2512. The descriptor SOCKET is not a socket.
  2513. ‘EWOULDBLOCK’
  2514. Nonblocking mode has been set on the socket, and the read
  2515. operation would block. (Normally, ‘recv’ blocks until there
  2516. is input available to be read.)
  2517. ‘EINTR’
  2518. The operation was interrupted by a signal before any data was
  2519. read. *Note Interrupted Primitives::.
  2520. ‘ENOTCONN’
  2521. You never connected this socket.
  2522. This function is defined as a cancellation point in multi-threaded
  2523. programs, so one has to be prepared for this and make sure that
  2524. allocated resources (like memory, file descriptors, semaphores or
  2525. whatever) are freed even if the thread is canceled.
  2526. 
  2527. File: libc.info, Node: Socket Data Options, Prev: Receiving Data, Up: Transferring Data
  2528. 16.9.5.3 Socket Data Options
  2529. ............................
  2530. The FLAGS argument to ‘send’ and ‘recv’ is a bit mask. You can
  2531. bitwise-OR the values of the following macros together to obtain a value
  2532. for this argument. All are defined in the header file ‘sys/socket.h’.
  2533. -- Macro: int MSG_OOB
  2534. Send or receive out-of-band data. *Note Out-of-Band Data::.
  2535. -- Macro: int MSG_PEEK
  2536. Look at the data but don’t remove it from the input queue. This is
  2537. only meaningful with input functions such as ‘recv’, not with
  2538. ‘send’.
  2539. -- Macro: int MSG_DONTROUTE
  2540. Don’t include routing information in the message. This is only
  2541. meaningful with output operations, and is usually only of interest
  2542. for diagnostic or routing programs. We don’t try to explain it
  2543. here.
  2544. 
  2545. File: libc.info, Node: Byte Stream Example, Next: Server Example, Prev: Transferring Data, Up: Connections
  2546. 16.9.6 Byte Stream Socket Example
  2547. ---------------------------------
  2548. Here is an example client program that makes a connection for a byte
  2549. stream socket in the Internet namespace. It doesn’t do anything
  2550. particularly interesting once it has connected to the server; it just
  2551. sends a text string to the server and exits.
  2552. This program uses ‘init_sockaddr’ to set up the socket address; see
  2553. *note Inet Example::.
  2554. #include <stdio.h>
  2555. #include <errno.h>
  2556. #include <stdlib.h>
  2557. #include <unistd.h>
  2558. #include <sys/types.h>
  2559. #include <sys/socket.h>
  2560. #include <netinet/in.h>
  2561. #include <netdb.h>
  2562. #define PORT 5555
  2563. #define MESSAGE "Yow!!! Are we having fun yet?!?"
  2564. #define SERVERHOST "www.gnu.org"
  2565. void
  2566. write_to_server (int filedes)
  2567. {
  2568. int nbytes;
  2569. nbytes = write (filedes, MESSAGE, strlen (MESSAGE) + 1);
  2570. if (nbytes < 0)
  2571. {
  2572. perror ("write");
  2573. exit (EXIT_FAILURE);
  2574. }
  2575. }
  2576. int
  2577. main (void)
  2578. {
  2579. extern void init_sockaddr (struct sockaddr_in *name,
  2580. const char *hostname,
  2581. uint16_t port);
  2582. int sock;
  2583. struct sockaddr_in servername;
  2584. /* Create the socket. */
  2585. sock = socket (PF_INET, SOCK_STREAM, 0);
  2586. if (sock < 0)
  2587. {
  2588. perror ("socket (client)");
  2589. exit (EXIT_FAILURE);
  2590. }
  2591. /* Connect to the server. */
  2592. init_sockaddr (&servername, SERVERHOST, PORT);
  2593. if (0 > connect (sock,
  2594. (struct sockaddr *) &servername,
  2595. sizeof (servername)))
  2596. {
  2597. perror ("connect (client)");
  2598. exit (EXIT_FAILURE);
  2599. }
  2600. /* Send data to the server. */
  2601. write_to_server (sock);
  2602. close (sock);
  2603. exit (EXIT_SUCCESS);
  2604. }
  2605. 
  2606. File: libc.info, Node: Server Example, Next: Out-of-Band Data, Prev: Byte Stream Example, Up: Connections
  2607. 16.9.7 Byte Stream Connection Server Example
  2608. --------------------------------------------
  2609. The server end is much more complicated. Since we want to allow
  2610. multiple clients to be connected to the server at the same time, it
  2611. would be incorrect to wait for input from a single client by simply
  2612. calling ‘read’ or ‘recv’. Instead, the right thing to do is to use
  2613. ‘select’ (*note Waiting for I/O::) to wait for input on all of the open
  2614. sockets. This also allows the server to deal with additional connection
  2615. requests.
  2616. This particular server doesn’t do anything interesting once it has
  2617. gotten a message from a client. It does close the socket for that
  2618. client when it detects an end-of-file condition (resulting from the
  2619. client shutting down its end of the connection).
  2620. This program uses ‘make_socket’ to set up the socket address; see
  2621. *note Inet Example::.
  2622. #include <stdio.h>
  2623. #include <errno.h>
  2624. #include <stdlib.h>
  2625. #include <unistd.h>
  2626. #include <sys/types.h>
  2627. #include <sys/socket.h>
  2628. #include <netinet/in.h>
  2629. #include <netdb.h>
  2630. #define PORT 5555
  2631. #define MAXMSG 512
  2632. int
  2633. read_from_client (int filedes)
  2634. {
  2635. char buffer[MAXMSG];
  2636. int nbytes;
  2637. nbytes = read (filedes, buffer, MAXMSG);
  2638. if (nbytes < 0)
  2639. {
  2640. /* Read error. */
  2641. perror ("read");
  2642. exit (EXIT_FAILURE);
  2643. }
  2644. else if (nbytes == 0)
  2645. /* End-of-file. */
  2646. return -1;
  2647. else
  2648. {
  2649. /* Data read. */
  2650. fprintf (stderr, "Server: got message: `%s'\n", buffer);
  2651. return 0;
  2652. }
  2653. }
  2654. int
  2655. main (void)
  2656. {
  2657. extern int make_socket (uint16_t port);
  2658. int sock;
  2659. fd_set active_fd_set, read_fd_set;
  2660. int i;
  2661. struct sockaddr_in clientname;
  2662. size_t size;
  2663. /* Create the socket and set it up to accept connections. */
  2664. sock = make_socket (PORT);
  2665. if (listen (sock, 1) < 0)
  2666. {
  2667. perror ("listen");
  2668. exit (EXIT_FAILURE);
  2669. }
  2670. /* Initialize the set of active sockets. */
  2671. FD_ZERO (&active_fd_set);
  2672. FD_SET (sock, &active_fd_set);
  2673. while (1)
  2674. {
  2675. /* Block until input arrives on one or more active sockets. */
  2676. read_fd_set = active_fd_set;
  2677. if (select (FD_SETSIZE, &read_fd_set, NULL, NULL, NULL) < 0)
  2678. {
  2679. perror ("select");
  2680. exit (EXIT_FAILURE);
  2681. }
  2682. /* Service all the sockets with input pending. */
  2683. for (i = 0; i < FD_SETSIZE; ++i)
  2684. if (FD_ISSET (i, &read_fd_set))
  2685. {
  2686. if (i == sock)
  2687. {
  2688. /* Connection request on original socket. */
  2689. int new;
  2690. size = sizeof (clientname);
  2691. new = accept (sock,
  2692. (struct sockaddr *) &clientname,
  2693. &size);
  2694. if (new < 0)
  2695. {
  2696. perror ("accept");
  2697. exit (EXIT_FAILURE);
  2698. }
  2699. fprintf (stderr,
  2700. "Server: connect from host %s, port %hd.\n",
  2701. inet_ntoa (clientname.sin_addr),
  2702. ntohs (clientname.sin_port));
  2703. FD_SET (new, &active_fd_set);
  2704. }
  2705. else
  2706. {
  2707. /* Data arriving on an already-connected socket. */
  2708. if (read_from_client (i) < 0)
  2709. {
  2710. close (i);
  2711. FD_CLR (i, &active_fd_set);
  2712. }
  2713. }
  2714. }
  2715. }
  2716. }
  2717. 
  2718. File: libc.info, Node: Out-of-Band Data, Prev: Server Example, Up: Connections
  2719. 16.9.8 Out-of-Band Data
  2720. -----------------------
  2721. Streams with connections permit "out-of-band" data that is delivered
  2722. with higher priority than ordinary data. Typically the reason for
  2723. sending out-of-band data is to send notice of an exceptional condition.
  2724. To send out-of-band data use ‘send’, specifying the flag ‘MSG_OOB’
  2725. (*note Sending Data::).
  2726. Out-of-band data are received with higher priority because the
  2727. receiving process need not read it in sequence; to read the next
  2728. available out-of-band data, use ‘recv’ with the ‘MSG_OOB’ flag (*note
  2729. Receiving Data::). Ordinary read operations do not read out-of-band
  2730. data; they read only ordinary data.
  2731. When a socket finds that out-of-band data are on their way, it sends
  2732. a ‘SIGURG’ signal to the owner process or process group of the socket.
  2733. You can specify the owner using the ‘F_SETOWN’ command to the ‘fcntl’
  2734. function; see *note Interrupt Input::. You must also establish a
  2735. handler for this signal, as described in *note Signal Handling::, in
  2736. order to take appropriate action such as reading the out-of-band data.
  2737. Alternatively, you can test for pending out-of-band data, or wait
  2738. until there is out-of-band data, using the ‘select’ function; it can
  2739. wait for an exceptional condition on the socket. *Note Waiting for
  2740. I/O::, for more information about ‘select’.
  2741. Notification of out-of-band data (whether with ‘SIGURG’ or with
  2742. ‘select’) indicates that out-of-band data are on the way; the data may
  2743. not actually arrive until later. If you try to read the out-of-band
  2744. data before it arrives, ‘recv’ fails with an ‘EWOULDBLOCK’ error.
  2745. Sending out-of-band data automatically places a “mark” in the stream
  2746. of ordinary data, showing where in the sequence the out-of-band data
  2747. “would have been”. This is useful when the meaning of out-of-band data
  2748. is “cancel everything sent so far”. Here is how you can test, in the
  2749. receiving process, whether any ordinary data was sent before the mark:
  2750. success = ioctl (socket, SIOCATMARK, &atmark);
  2751. The ‘integer’ variable ATMARK is set to a nonzero value if the
  2752. socket’s read pointer has reached the “mark”.
  2753. Here’s a function to discard any ordinary data preceding the
  2754. out-of-band mark:
  2755. int
  2756. discard_until_mark (int socket)
  2757. {
  2758. while (1)
  2759. {
  2760. /* This is not an arbitrary limit; any size will do. */
  2761. char buffer[1024];
  2762. int atmark, success;
  2763. /* If we have reached the mark, return. */
  2764. success = ioctl (socket, SIOCATMARK, &atmark);
  2765. if (success < 0)
  2766. perror ("ioctl");
  2767. if (result)
  2768. return;
  2769. /* Otherwise, read a bunch of ordinary data and discard it.
  2770. This is guaranteed not to read past the mark
  2771. if it starts before the mark. */
  2772. success = read (socket, buffer, sizeof buffer);
  2773. if (success < 0)
  2774. perror ("read");
  2775. }
  2776. }
  2777. If you don’t want to discard the ordinary data preceding the mark,
  2778. you may need to read some of it anyway, to make room in internal system
  2779. buffers for the out-of-band data. If you try to read out-of-band data
  2780. and get an ‘EWOULDBLOCK’ error, try reading some ordinary data (saving
  2781. it so that you can use it when you want it) and see if that makes room.
  2782. Here is an example:
  2783. struct buffer
  2784. {
  2785. char *buf;
  2786. int size;
  2787. struct buffer *next;
  2788. };
  2789. /* Read the out-of-band data from SOCKET and return it
  2790. as a ‘struct buffer’, which records the address of the data
  2791. and its size.
  2792. It may be necessary to read some ordinary data
  2793. in order to make room for the out-of-band data.
  2794. If so, the ordinary data are saved as a chain of buffers
  2795. found in the ‘next’ field of the value. */
  2796. struct buffer *
  2797. read_oob (int socket)
  2798. {
  2799. struct buffer *tail = 0;
  2800. struct buffer *list = 0;
  2801. while (1)
  2802. {
  2803. /* This is an arbitrary limit.
  2804. Does anyone know how to do this without a limit? */
  2805. #define BUF_SZ 1024
  2806. char *buf = (char *) xmalloc (BUF_SZ);
  2807. int success;
  2808. int atmark;
  2809. /* Try again to read the out-of-band data. */
  2810. success = recv (socket, buf, BUF_SZ, MSG_OOB);
  2811. if (success >= 0)
  2812. {
  2813. /* We got it, so return it. */
  2814. struct buffer *link
  2815. = (struct buffer *) xmalloc (sizeof (struct buffer));
  2816. link->buf = buf;
  2817. link->size = success;
  2818. link->next = list;
  2819. return link;
  2820. }
  2821. /* If we fail, see if we are at the mark. */
  2822. success = ioctl (socket, SIOCATMARK, &atmark);
  2823. if (success < 0)
  2824. perror ("ioctl");
  2825. if (atmark)
  2826. {
  2827. /* At the mark; skipping past more ordinary data cannot help.
  2828. So just wait a while. */
  2829. sleep (1);
  2830. continue;
  2831. }
  2832. /* Otherwise, read a bunch of ordinary data and save it.
  2833. This is guaranteed not to read past the mark
  2834. if it starts before the mark. */
  2835. success = read (socket, buf, BUF_SZ);
  2836. if (success < 0)
  2837. perror ("read");
  2838. /* Save this data in the buffer list. */
  2839. {
  2840. struct buffer *link
  2841. = (struct buffer *) xmalloc (sizeof (struct buffer));
  2842. link->buf = buf;
  2843. link->size = success;
  2844. /* Add the new link to the end of the list. */
  2845. if (tail)
  2846. tail->next = link;
  2847. else
  2848. list = link;
  2849. tail = link;
  2850. }
  2851. }
  2852. }
  2853. 
  2854. File: libc.info, Node: Datagrams, Next: Inetd, Prev: Connections, Up: Sockets
  2855. 16.10 Datagram Socket Operations
  2856. ================================
  2857. This section describes how to use communication styles that don’t use
  2858. connections (styles ‘SOCK_DGRAM’ and ‘SOCK_RDM’). Using these styles,
  2859. you group data into packets and each packet is an independent
  2860. communication. You specify the destination for each packet
  2861. individually.
  2862. Datagram packets are like letters: you send each one independently
  2863. with its own destination address, and they may arrive in the wrong order
  2864. or not at all.
  2865. The ‘listen’ and ‘accept’ functions are not allowed for sockets using
  2866. connectionless communication styles.
  2867. * Menu:
  2868. * Sending Datagrams:: Sending packets on a datagram socket.
  2869. * Receiving Datagrams:: Receiving packets on a datagram socket.
  2870. * Datagram Example:: An example program: packets sent over a
  2871. datagram socket in the local namespace.
  2872. * Example Receiver:: Another program, that receives those packets.
  2873. 
  2874. File: libc.info, Node: Sending Datagrams, Next: Receiving Datagrams, Up: Datagrams
  2875. 16.10.1 Sending Datagrams
  2876. -------------------------
  2877. The normal way of sending data on a datagram socket is by using the
  2878. ‘sendto’ function, declared in ‘sys/socket.h’.
  2879. You can call ‘connect’ on a datagram socket, but this only specifies
  2880. a default destination for further data transmission on the socket. When
  2881. a socket has a default destination you can use ‘send’ (*note Sending
  2882. Data::) or even ‘write’ (*note I/O Primitives::) to send a packet there.
  2883. You can cancel the default destination by calling ‘connect’ using an
  2884. address format of ‘AF_UNSPEC’ in the ADDR argument. *Note Connecting::,
  2885. for more information about the ‘connect’ function.
  2886. -- Function: ssize_t sendto (int SOCKET, const void *BUFFER, size_t
  2887. SIZE, int FLAGS, struct sockaddr *ADDR, socklen_t LENGTH)
  2888. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2889. Concepts::.
  2890. The ‘sendto’ function transmits the data in the BUFFER through the
  2891. socket SOCKET to the destination address specified by the ADDR and
  2892. LENGTH arguments. The SIZE argument specifies the number of bytes
  2893. to be transmitted.
  2894. The FLAGS are interpreted the same way as for ‘send’; see *note
  2895. Socket Data Options::.
  2896. The return value and error conditions are also the same as for
  2897. ‘send’, but you cannot rely on the system to detect errors and
  2898. report them; the most common error is that the packet is lost or
  2899. there is no-one at the specified address to receive it, and the
  2900. operating system on your machine usually does not know this.
  2901. It is also possible for one call to ‘sendto’ to report an error
  2902. owing to a problem related to a previous call.
  2903. This function is defined as a cancellation point in multi-threaded
  2904. programs, so one has to be prepared for this and make sure that
  2905. allocated resources (like memory, file descriptors, semaphores or
  2906. whatever) are freed even if the thread is canceled.
  2907. 
  2908. File: libc.info, Node: Receiving Datagrams, Next: Datagram Example, Prev: Sending Datagrams, Up: Datagrams
  2909. 16.10.2 Receiving Datagrams
  2910. ---------------------------
  2911. The ‘recvfrom’ function reads a packet from a datagram socket and also
  2912. tells you where it was sent from. This function is declared in
  2913. ‘sys/socket.h’.
  2914. -- Function: ssize_t recvfrom (int SOCKET, void *BUFFER, size_t SIZE,
  2915. int FLAGS, struct sockaddr *ADDR, socklen_t *LENGTH-PTR)
  2916. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  2917. Concepts::.
  2918. The ‘recvfrom’ function reads one packet from the socket SOCKET
  2919. into the buffer BUFFER. The SIZE argument specifies the maximum
  2920. number of bytes to be read.
  2921. If the packet is longer than SIZE bytes, then you get the first
  2922. SIZE bytes of the packet and the rest of the packet is lost.
  2923. There’s no way to read the rest of the packet. Thus, when you use
  2924. a packet protocol, you must always know how long a packet to
  2925. expect.
  2926. The ADDR and LENGTH-PTR arguments are used to return the address
  2927. where the packet came from. *Note Socket Addresses::. For a
  2928. socket in the local domain the address information won’t be
  2929. meaningful, since you can’t read the address of such a socket
  2930. (*note Local Namespace::). You can specify a null pointer as the
  2931. ADDR argument if you are not interested in this information.
  2932. The FLAGS are interpreted the same way as for ‘recv’ (*note Socket
  2933. Data Options::). The return value and error conditions are also
  2934. the same as for ‘recv’.
  2935. This function is defined as a cancellation point in multi-threaded
  2936. programs, so one has to be prepared for this and make sure that
  2937. allocated resources (like memory, file descriptors, semaphores or
  2938. whatever) are freed even if the thread is canceled.
  2939. You can use plain ‘recv’ (*note Receiving Data::) instead of
  2940. ‘recvfrom’ if you don’t need to find out who sent the packet (either
  2941. because you know where it should come from or because you treat all
  2942. possible senders alike). Even ‘read’ can be used if you don’t want to
  2943. specify FLAGS (*note I/O Primitives::).
  2944. 
  2945. File: libc.info, Node: Datagram Example, Next: Example Receiver, Prev: Receiving Datagrams, Up: Datagrams
  2946. 16.10.3 Datagram Socket Example
  2947. -------------------------------
  2948. Here is a set of example programs that send messages over a datagram
  2949. stream in the local namespace. Both the client and server programs use
  2950. the ‘make_named_socket’ function that was presented in *note Local
  2951. Socket Example::, to create and name their sockets.
  2952. First, here is the server program. It sits in a loop waiting for
  2953. messages to arrive, bouncing each message back to the sender. Obviously
  2954. this isn’t a particularly useful program, but it does show the general
  2955. ideas involved.
  2956. #include <stdio.h>
  2957. #include <errno.h>
  2958. #include <stdlib.h>
  2959. #include <sys/socket.h>
  2960. #include <sys/un.h>
  2961. #define SERVER "/tmp/serversocket"
  2962. #define MAXMSG 512
  2963. int
  2964. main (void)
  2965. {
  2966. int sock;
  2967. char message[MAXMSG];
  2968. struct sockaddr_un name;
  2969. size_t size;
  2970. int nbytes;
  2971. /* Remove the filename first, it’s ok if the call fails */
  2972. unlink (SERVER);
  2973. /* Make the socket, then loop endlessly. */
  2974. sock = make_named_socket (SERVER);
  2975. while (1)
  2976. {
  2977. /* Wait for a datagram. */
  2978. size = sizeof (name);
  2979. nbytes = recvfrom (sock, message, MAXMSG, 0,
  2980. (struct sockaddr *) & name, &size);
  2981. if (nbytes < 0)
  2982. {
  2983. perror ("recfrom (server)");
  2984. exit (EXIT_FAILURE);
  2985. }
  2986. /* Give a diagnostic message. */
  2987. fprintf (stderr, "Server: got message: %s\n", message);
  2988. /* Bounce the message back to the sender. */
  2989. nbytes = sendto (sock, message, nbytes, 0,
  2990. (struct sockaddr *) & name, size);
  2991. if (nbytes < 0)
  2992. {
  2993. perror ("sendto (server)");
  2994. exit (EXIT_FAILURE);
  2995. }
  2996. }
  2997. }
  2998. 
  2999. File: libc.info, Node: Example Receiver, Prev: Datagram Example, Up: Datagrams
  3000. 16.10.4 Example of Reading Datagrams
  3001. ------------------------------------
  3002. Here is the client program corresponding to the server above.
  3003. It sends a datagram to the server and then waits for a reply. Notice
  3004. that the socket for the client (as well as for the server) in this
  3005. example has to be given a name. This is so that the server can direct a
  3006. message back to the client. Since the socket has no associated
  3007. connection state, the only way the server can do this is by referencing
  3008. the name of the client.
  3009. #include <stdio.h>
  3010. #include <errno.h>
  3011. #include <unistd.h>
  3012. #include <stdlib.h>
  3013. #include <sys/socket.h>
  3014. #include <sys/un.h>
  3015. #define SERVER "/tmp/serversocket"
  3016. #define CLIENT "/tmp/mysocket"
  3017. #define MAXMSG 512
  3018. #define MESSAGE "Yow!!! Are we having fun yet?!?"
  3019. int
  3020. main (void)
  3021. {
  3022. extern int make_named_socket (const char *name);
  3023. int sock;
  3024. char message[MAXMSG];
  3025. struct sockaddr_un name;
  3026. size_t size;
  3027. int nbytes;
  3028. /* Make the socket. */
  3029. sock = make_named_socket (CLIENT);
  3030. /* Initialize the server socket address. */
  3031. name.sun_family = AF_LOCAL;
  3032. strcpy (name.sun_path, SERVER);
  3033. size = strlen (name.sun_path) + sizeof (name.sun_family);
  3034. /* Send the datagram. */
  3035. nbytes = sendto (sock, MESSAGE, strlen (MESSAGE) + 1, 0,
  3036. (struct sockaddr *) & name, size);
  3037. if (nbytes < 0)
  3038. {
  3039. perror ("sendto (client)");
  3040. exit (EXIT_FAILURE);
  3041. }
  3042. /* Wait for a reply. */
  3043. nbytes = recvfrom (sock, message, MAXMSG, 0, NULL, 0);
  3044. if (nbytes < 0)
  3045. {
  3046. perror ("recfrom (client)");
  3047. exit (EXIT_FAILURE);
  3048. }
  3049. /* Print a diagnostic message. */
  3050. fprintf (stderr, "Client: got message: %s\n", message);
  3051. /* Clean up. */
  3052. remove (CLIENT);
  3053. close (sock);
  3054. }
  3055. Keep in mind that datagram socket communications are unreliable. In
  3056. this example, the client program waits indefinitely if the message never
  3057. reaches the server or if the server’s response never comes back. It’s
  3058. up to the user running the program to kill and restart it if desired. A
  3059. more automatic solution could be to use ‘select’ (*note Waiting for
  3060. I/O::) to establish a timeout period for the reply, and in case of
  3061. timeout either re-send the message or shut down the socket and exit.
  3062. 
  3063. File: libc.info, Node: Inetd, Next: Socket Options, Prev: Datagrams, Up: Sockets
  3064. 16.11 The ‘inetd’ Daemon
  3065. ========================
  3066. We’ve explained above how to write a server program that does its own
  3067. listening. Such a server must already be running in order for anyone to
  3068. connect to it.
  3069. Another way to provide a service on an Internet port is to let the
  3070. daemon program ‘inetd’ do the listening. ‘inetd’ is a program that runs
  3071. all the time and waits (using ‘select’) for messages on a specified set
  3072. of ports. When it receives a message, it accepts the connection (if the
  3073. socket style calls for connections) and then forks a child process to
  3074. run the corresponding server program. You specify the ports and their
  3075. programs in the file ‘/etc/inetd.conf’.
  3076. * Menu:
  3077. * Inetd Servers::
  3078. * Configuring Inetd::
  3079. 
  3080. File: libc.info, Node: Inetd Servers, Next: Configuring Inetd, Up: Inetd
  3081. 16.11.1 ‘inetd’ Servers
  3082. -----------------------
  3083. Writing a server program to be run by ‘inetd’ is very simple. Each time
  3084. someone requests a connection to the appropriate port, a new server
  3085. process starts. The connection already exists at this time; the socket
  3086. is available as the standard input descriptor and as the standard output
  3087. descriptor (descriptors 0 and 1) in the server process. Thus the server
  3088. program can begin reading and writing data right away. Often the
  3089. program needs only the ordinary I/O facilities; in fact, a
  3090. general-purpose filter program that knows nothing about sockets can work
  3091. as a byte stream server run by ‘inetd’.
  3092. You can also use ‘inetd’ for servers that use connectionless
  3093. communication styles. For these servers, ‘inetd’ does not try to accept
  3094. a connection since no connection is possible. It just starts the server
  3095. program, which can read the incoming datagram packet from descriptor 0.
  3096. The server program can handle one request and then exit, or you can
  3097. choose to write it to keep reading more requests until no more arrive,
  3098. and then exit. You must specify which of these two techniques the
  3099. server uses when you configure ‘inetd’.
  3100. 
  3101. File: libc.info, Node: Configuring Inetd, Prev: Inetd Servers, Up: Inetd
  3102. 16.11.2 Configuring ‘inetd’
  3103. ---------------------------
  3104. The file ‘/etc/inetd.conf’ tells ‘inetd’ which ports to listen to and
  3105. what server programs to run for them. Normally each entry in the file
  3106. is one line, but you can split it onto multiple lines provided all but
  3107. the first line of the entry start with whitespace. Lines that start
  3108. with ‘#’ are comments.
  3109. Here are two standard entries in ‘/etc/inetd.conf’:
  3110. ftp stream tcp nowait root /libexec/ftpd ftpd
  3111. talk dgram udp wait root /libexec/talkd talkd
  3112. An entry has this format:
  3113. SERVICE STYLE PROTOCOL WAIT USERNAME PROGRAM ARGUMENTS
  3114. The SERVICE field says which service this program provides. It
  3115. should be the name of a service defined in ‘/etc/services’. ‘inetd’
  3116. uses SERVICE to decide which port to listen on for this entry.
  3117. The fields STYLE and PROTOCOL specify the communication style and the
  3118. protocol to use for the listening socket. The style should be the name
  3119. of a communication style, converted to lower case and with ‘SOCK_’
  3120. deleted—for example, ‘stream’ or ‘dgram’. PROTOCOL should be one of the
  3121. protocols listed in ‘/etc/protocols’. The typical protocol names are
  3122. ‘tcp’ for byte stream connections and ‘udp’ for unreliable datagrams.
  3123. The WAIT field should be either ‘wait’ or ‘nowait’. Use ‘wait’ if
  3124. STYLE is a connectionless style and the server, once started, handles
  3125. multiple requests as they come in. Use ‘nowait’ if ‘inetd’ should start
  3126. a new process for each message or request that comes in. If STYLE uses
  3127. connections, then WAIT *must* be ‘nowait’.
  3128. USER is the user name that the server should run as. ‘inetd’ runs as
  3129. root, so it can set the user ID of its children arbitrarily. It’s best
  3130. to avoid using ‘root’ for USER if you can; but some servers, such as
  3131. Telnet and FTP, read a username and password themselves. These servers
  3132. need to be root initially so they can log in as commanded by the data
  3133. coming over the network.
  3134. PROGRAM together with ARGUMENTS specifies the command to run to start
  3135. the server. PROGRAM should be an absolute file name specifying the
  3136. executable file to run. ARGUMENTS consists of any number of
  3137. whitespace-separated words, which become the command-line arguments of
  3138. PROGRAM. The first word in ARGUMENTS is argument zero, which should by
  3139. convention be the program name itself (sans directories).
  3140. If you edit ‘/etc/inetd.conf’, you can tell ‘inetd’ to reread the
  3141. file and obey its new contents by sending the ‘inetd’ process the
  3142. ‘SIGHUP’ signal. You’ll have to use ‘ps’ to determine the process ID of
  3143. the ‘inetd’ process as it is not fixed.
  3144. 
  3145. File: libc.info, Node: Socket Options, Next: Networks Database, Prev: Inetd, Up: Sockets
  3146. 16.12 Socket Options
  3147. ====================
  3148. This section describes how to read or set various options that modify
  3149. the behavior of sockets and their underlying communications protocols.
  3150. When you are manipulating a socket option, you must specify which
  3151. "level" the option pertains to. This describes whether the option
  3152. applies to the socket interface, or to a lower-level communications
  3153. protocol interface.
  3154. * Menu:
  3155. * Socket Option Functions:: The basic functions for setting and getting
  3156. socket options.
  3157. * Socket-Level Options:: Details of the options at the socket level.
  3158. 
  3159. File: libc.info, Node: Socket Option Functions, Next: Socket-Level Options, Up: Socket Options
  3160. 16.12.1 Socket Option Functions
  3161. -------------------------------
  3162. Here are the functions for examining and modifying socket options. They
  3163. are declared in ‘sys/socket.h’.
  3164. -- Function: int getsockopt (int SOCKET, int LEVEL, int OPTNAME, void
  3165. *OPTVAL, socklen_t *OPTLEN-PTR)
  3166. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3167. Concepts::.
  3168. The ‘getsockopt’ function gets information about the value of
  3169. option OPTNAME at level LEVEL for socket SOCKET.
  3170. The option value is stored in the buffer that OPTVAL points to.
  3171. Before the call, you should supply in ‘*OPTLEN-PTR’ the size of
  3172. this buffer; on return, it contains the number of bytes of
  3173. information actually stored in the buffer.
  3174. Most options interpret the OPTVAL buffer as a single ‘int’ value.
  3175. The actual return value of ‘getsockopt’ is ‘0’ on success and ‘-1’
  3176. on failure. The following ‘errno’ error conditions are defined:
  3177. ‘EBADF’
  3178. The SOCKET argument is not a valid file descriptor.
  3179. ‘ENOTSOCK’
  3180. The descriptor SOCKET is not a socket.
  3181. ‘ENOPROTOOPT’
  3182. The OPTNAME doesn’t make sense for the given LEVEL.
  3183. -- Function: int setsockopt (int SOCKET, int LEVEL, int OPTNAME, const
  3184. void *OPTVAL, socklen_t OPTLEN)
  3185. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3186. Concepts::.
  3187. This function is used to set the socket option OPTNAME at level
  3188. LEVEL for socket SOCKET. The value of the option is passed in the
  3189. buffer OPTVAL of size OPTLEN.
  3190. The return value and error codes for ‘setsockopt’ are the same as
  3191. for ‘getsockopt’.
  3192. 
  3193. File: libc.info, Node: Socket-Level Options, Prev: Socket Option Functions, Up: Socket Options
  3194. 16.12.2 Socket-Level Options
  3195. ----------------------------
  3196. -- Constant: int SOL_SOCKET
  3197. Use this constant as the LEVEL argument to ‘getsockopt’ or
  3198. ‘setsockopt’ to manipulate the socket-level options described in
  3199. this section.
  3200. Here is a table of socket-level option names; all are defined in the
  3201. header file ‘sys/socket.h’.
  3202. ‘SO_DEBUG’
  3203. This option toggles recording of debugging information in the
  3204. underlying protocol modules. The value has type ‘int’; a nonzero
  3205. value means “yes”.
  3206. ‘SO_REUSEADDR’
  3207. This option controls whether ‘bind’ (*note Setting Address::)
  3208. should permit reuse of local addresses for this socket. If you
  3209. enable this option, you can actually have two sockets with the same
  3210. Internet port number; but the system won’t allow you to use the two
  3211. identically-named sockets in a way that would confuse the Internet.
  3212. The reason for this option is that some higher-level Internet
  3213. protocols, including FTP, require you to keep reusing the same port
  3214. number.
  3215. The value has type ‘int’; a nonzero value means “yes”.
  3216. ‘SO_KEEPALIVE’
  3217. This option controls whether the underlying protocol should
  3218. periodically transmit messages on a connected socket. If the peer
  3219. fails to respond to these messages, the connection is considered
  3220. broken. The value has type ‘int’; a nonzero value means “yes”.
  3221. ‘SO_DONTROUTE’
  3222. This option controls whether outgoing messages bypass the normal
  3223. message routing facilities. If set, messages are sent directly to
  3224. the network interface instead. The value has type ‘int’; a nonzero
  3225. value means “yes”.
  3226. ‘SO_LINGER’
  3227. This option specifies what should happen when the socket of a type
  3228. that promises reliable delivery still has untransmitted messages
  3229. when it is closed; see *note Closing a Socket::. The value has
  3230. type ‘struct linger’.
  3231. -- Data Type: struct linger
  3232. This structure type has the following members:
  3233. ‘int l_onoff’
  3234. This field is interpreted as a boolean. If nonzero,
  3235. ‘close’ blocks until the data are transmitted or the
  3236. timeout period has expired.
  3237. ‘int l_linger’
  3238. This specifies the timeout period, in seconds.
  3239. ‘SO_BROADCAST’
  3240. This option controls whether datagrams may be broadcast from the
  3241. socket. The value has type ‘int’; a nonzero value means “yes”.
  3242. ‘SO_OOBINLINE’
  3243. If this option is set, out-of-band data received on the socket is
  3244. placed in the normal input queue. This permits it to be read using
  3245. ‘read’ or ‘recv’ without specifying the ‘MSG_OOB’ flag. *Note
  3246. Out-of-Band Data::. The value has type ‘int’; a nonzero value
  3247. means “yes”.
  3248. ‘SO_SNDBUF’
  3249. This option gets or sets the size of the output buffer. The value
  3250. is a ‘size_t’, which is the size in bytes.
  3251. ‘SO_RCVBUF’
  3252. This option gets or sets the size of the input buffer. The value
  3253. is a ‘size_t’, which is the size in bytes.
  3254. ‘SO_STYLE’
  3255. ‘SO_TYPE’
  3256. This option can be used with ‘getsockopt’ only. It is used to get
  3257. the socket’s communication style. ‘SO_TYPE’ is the historical
  3258. name, and ‘SO_STYLE’ is the preferred name in GNU. The value has
  3259. type ‘int’ and its value designates a communication style; see
  3260. *note Communication Styles::.
  3261. ‘SO_ERROR’
  3262. This option can be used with ‘getsockopt’ only. It is used to
  3263. reset the error status of the socket. The value is an ‘int’, which
  3264. represents the previous error status.
  3265. 
  3266. File: libc.info, Node: Networks Database, Prev: Socket Options, Up: Sockets
  3267. 16.13 Networks Database
  3268. =======================
  3269. Many systems come with a database that records a list of networks known
  3270. to the system developer. This is usually kept either in the file
  3271. ‘/etc/networks’ or in an equivalent from a name server. This data base
  3272. is useful for routing programs such as ‘route’, but it is not useful for
  3273. programs that simply communicate over the network. We provide functions
  3274. to access this database, which are declared in ‘netdb.h’.
  3275. -- Data Type: struct netent
  3276. This data type is used to represent information about entries in
  3277. the networks database. It has the following members:
  3278. ‘char *n_name’
  3279. This is the “official” name of the network.
  3280. ‘char **n_aliases’
  3281. These are alternative names for the network, represented as a
  3282. vector of strings. A null pointer terminates the array.
  3283. ‘int n_addrtype’
  3284. This is the type of the network number; this is always equal
  3285. to ‘AF_INET’ for Internet networks.
  3286. ‘unsigned long int n_net’
  3287. This is the network number. Network numbers are returned in
  3288. host byte order; see *note Byte Order::.
  3289. Use the ‘getnetbyname’ or ‘getnetbyaddr’ functions to search the
  3290. networks database for information about a specific network. The
  3291. information is returned in a statically-allocated structure; you must
  3292. copy the information if you need to save it.
  3293. -- Function: struct netent * getnetbyname (const char *NAME)
  3294. Preliminary: | MT-Unsafe race:netbyname env locale | AS-Unsafe
  3295. dlopen plugin heap lock | AC-Unsafe corrupt lock fd mem | *Note
  3296. POSIX Safety Concepts::.
  3297. The ‘getnetbyname’ function returns information about the network
  3298. named NAME. It returns a null pointer if there is no such network.
  3299. -- Function: struct netent * getnetbyaddr (uint32_t NET, int TYPE)
  3300. Preliminary: | MT-Unsafe race:netbyaddr locale | AS-Unsafe dlopen
  3301. plugin heap lock | AC-Unsafe corrupt lock fd mem | *Note POSIX
  3302. Safety Concepts::.
  3303. The ‘getnetbyaddr’ function returns information about the network
  3304. of type TYPE with number NET. You should specify a value of
  3305. ‘AF_INET’ for the TYPE argument for Internet networks.
  3306. ‘getnetbyaddr’ returns a null pointer if there is no such network.
  3307. You can also scan the networks database using ‘setnetent’,
  3308. ‘getnetent’ and ‘endnetent’. Be careful when using these functions
  3309. because they are not reentrant.
  3310. -- Function: void setnetent (int STAYOPEN)
  3311. Preliminary: | MT-Unsafe race:netent env locale | AS-Unsafe dlopen
  3312. plugin heap lock | AC-Unsafe corrupt lock fd mem | *Note POSIX
  3313. Safety Concepts::.
  3314. This function opens and rewinds the networks database.
  3315. If the STAYOPEN argument is nonzero, this sets a flag so that
  3316. subsequent calls to ‘getnetbyname’ or ‘getnetbyaddr’ will not close
  3317. the database (as they usually would). This makes for more
  3318. efficiency if you call those functions several times, by avoiding
  3319. reopening the database for each call.
  3320. -- Function: struct netent * getnetent (void)
  3321. Preliminary: | MT-Unsafe race:netent race:netentbuf env locale |
  3322. AS-Unsafe dlopen plugin heap lock | AC-Unsafe corrupt lock fd mem |
  3323. *Note POSIX Safety Concepts::.
  3324. This function returns the next entry in the networks database. It
  3325. returns a null pointer if there are no more entries.
  3326. -- Function: void endnetent (void)
  3327. Preliminary: | MT-Unsafe race:netent env locale | AS-Unsafe dlopen
  3328. plugin heap lock | AC-Unsafe corrupt lock fd mem | *Note POSIX
  3329. Safety Concepts::.
  3330. This function closes the networks database.
  3331. 
  3332. File: libc.info, Node: Low-Level Terminal Interface, Next: Syslog, Prev: Sockets, Up: Top
  3333. 17 Low-Level Terminal Interface
  3334. *******************************
  3335. This chapter describes functions that are specific to terminal devices.
  3336. You can use these functions to do things like turn off input echoing;
  3337. set serial line characteristics such as line speed and flow control; and
  3338. change which characters are used for end-of-file, command-line editing,
  3339. sending signals, and similar control functions.
  3340. Most of the functions in this chapter operate on file descriptors.
  3341. *Note Low-Level I/O::, for more information about what a file descriptor
  3342. is and how to open a file descriptor for a terminal device.
  3343. * Menu:
  3344. * Is It a Terminal:: How to determine if a file is a terminal
  3345. device, and what its name is.
  3346. * I/O Queues:: About flow control and typeahead.
  3347. * Canonical or Not:: Two basic styles of input processing.
  3348. * Terminal Modes:: How to examine and modify flags controlling
  3349. details of terminal I/O: echoing,
  3350. signals, editing. Posix.
  3351. * BSD Terminal Modes:: BSD compatible terminal mode setting
  3352. * Line Control:: Sending break sequences, clearing
  3353. terminal buffers …
  3354. * Noncanon Example:: How to read single characters without echo.
  3355. * Pseudo-Terminals:: How to open a pseudo-terminal.
  3356. 
  3357. File: libc.info, Node: Is It a Terminal, Next: I/O Queues, Up: Low-Level Terminal Interface
  3358. 17.1 Identifying Terminals
  3359. ==========================
  3360. The functions described in this chapter only work on files that
  3361. correspond to terminal devices. You can find out whether a file
  3362. descriptor is associated with a terminal by using the ‘isatty’ function.
  3363. Prototypes for the functions in this section are declared in the
  3364. header file ‘unistd.h’.
  3365. -- Function: int isatty (int FILEDES)
  3366. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3367. Concepts::.
  3368. This function returns ‘1’ if FILEDES is a file descriptor
  3369. associated with an open terminal device, and 0 otherwise.
  3370. If a file descriptor is associated with a terminal, you can get its
  3371. associated file name using the ‘ttyname’ function. See also the
  3372. ‘ctermid’ function, described in *note Identifying the Terminal::.
  3373. -- Function: char * ttyname (int FILEDES)
  3374. Preliminary: | MT-Unsafe race:ttyname | AS-Unsafe heap lock |
  3375. AC-Unsafe lock fd mem | *Note POSIX Safety Concepts::.
  3376. If the file descriptor FILEDES is associated with a terminal
  3377. device, the ‘ttyname’ function returns a pointer to a
  3378. statically-allocated, null-terminated string containing the file
  3379. name of the terminal file. The value is a null pointer if the file
  3380. descriptor isn’t associated with a terminal, or the file name
  3381. cannot be determined.
  3382. -- Function: int ttyname_r (int FILEDES, char *BUF, size_t LEN)
  3383. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem fd | *Note
  3384. POSIX Safety Concepts::.
  3385. The ‘ttyname_r’ function is similar to the ‘ttyname’ function
  3386. except that it places its result into the user-specified buffer
  3387. starting at BUF with length LEN.
  3388. The normal return value from ‘ttyname_r’ is 0. Otherwise an error
  3389. number is returned to indicate the error. The following ‘errno’
  3390. error conditions are defined for this function:
  3391. ‘EBADF’
  3392. The FILEDES argument is not a valid file descriptor.
  3393. ‘ENOTTY’
  3394. The FILEDES is not associated with a terminal.
  3395. ‘ERANGE’
  3396. The buffer length LEN is too small to store the string to be
  3397. returned.
  3398. 
  3399. File: libc.info, Node: I/O Queues, Next: Canonical or Not, Prev: Is It a Terminal, Up: Low-Level Terminal Interface
  3400. 17.2 I/O Queues
  3401. ===============
  3402. Many of the remaining functions in this section refer to the input and
  3403. output queues of a terminal device. These queues implement a form of
  3404. buffering _within the kernel_ independent of the buffering implemented
  3405. by I/O streams (*note I/O on Streams::).
  3406. The "terminal input queue" is also sometimes referred to as its
  3407. "typeahead buffer". It holds the characters that have been received
  3408. from the terminal but not yet read by any process.
  3409. The size of the input queue is described by the ‘MAX_INPUT’ and ‘_POSIX_MAX_INPUT’
  3410. parameters; see *note Limits for Files::. You are guaranteed a queue
  3411. size of at least ‘MAX_INPUT’, but the queue might be larger, and might
  3412. even dynamically change size. If input flow control is enabled by
  3413. setting the ‘IXOFF’ input mode bit (*note Input Modes::), the terminal
  3414. driver transmits STOP and START characters to the terminal when
  3415. necessary to prevent the queue from overflowing. Otherwise, input may
  3416. be lost if it comes in too fast from the terminal. In canonical mode,
  3417. all input stays in the queue until a newline character is received, so
  3418. the terminal input queue can fill up when you type a very long line.
  3419. *Note Canonical or Not::.
  3420. The "terminal output queue" is like the input queue, but for output;
  3421. it contains characters that have been written by processes, but not yet
  3422. transmitted to the terminal. If output flow control is enabled by
  3423. setting the ‘IXON’ input mode bit (*note Input Modes::), the terminal
  3424. driver obeys START and STOP characters sent by the terminal to stop and
  3425. restart transmission of output.
  3426. "Clearing" the terminal input queue means discarding any characters
  3427. that have been received but not yet read. Similarly, clearing the
  3428. terminal output queue means discarding any characters that have been
  3429. written but not yet transmitted.
  3430. 
  3431. File: libc.info, Node: Canonical or Not, Next: Terminal Modes, Prev: I/O Queues, Up: Low-Level Terminal Interface
  3432. 17.3 Two Styles of Input: Canonical or Not
  3433. ==========================================
  3434. POSIX systems support two basic modes of input: canonical and
  3435. noncanonical.
  3436. In "canonical input processing" mode, terminal input is processed in
  3437. lines terminated by newline (‘'\n'’), EOF, or EOL characters. No input
  3438. can be read until an entire line has been typed by the user, and the
  3439. ‘read’ function (*note I/O Primitives::) returns at most a single line
  3440. of input, no matter how many bytes are requested.
  3441. In canonical input mode, the operating system provides input editing
  3442. facilities: some characters are interpreted specially to perform editing
  3443. operations within the current line of text, such as ERASE and KILL.
  3444. *Note Editing Characters::.
  3445. The constants ‘_POSIX_MAX_CANON’ and ‘MAX_CANON’ parameterize the
  3446. maximum number of bytes which may appear in a single line of canonical
  3447. input. *Note Limits for Files::. You are guaranteed a maximum line
  3448. length of at least ‘MAX_CANON’ bytes, but the maximum might be larger,
  3449. and might even dynamically change size.
  3450. In "noncanonical input processing" mode, characters are not grouped
  3451. into lines, and ERASE and KILL processing is not performed. The
  3452. granularity with which bytes are read in noncanonical input mode is
  3453. controlled by the MIN and TIME settings. *Note Noncanonical Input::.
  3454. Most programs use canonical input mode, because this gives the user a
  3455. way to edit input line by line. The usual reason to use noncanonical
  3456. mode is when the program accepts single-character commands or provides
  3457. its own editing facilities.
  3458. The choice of canonical or noncanonical input is controlled by the
  3459. ‘ICANON’ flag in the ‘c_lflag’ member of ‘struct termios’. *Note Local
  3460. Modes::.
  3461. 
  3462. File: libc.info, Node: Terminal Modes, Next: BSD Terminal Modes, Prev: Canonical or Not, Up: Low-Level Terminal Interface
  3463. 17.4 Terminal Modes
  3464. ===================
  3465. This section describes the various terminal attributes that control how
  3466. input and output are done. The functions, data structures, and symbolic
  3467. constants are all declared in the header file ‘termios.h’.
  3468. Don’t confuse terminal attributes with file attributes. A device
  3469. special file which is associated with a terminal has file attributes as
  3470. described in *note File Attributes::. These are unrelated to the
  3471. attributes of the terminal device itself, which are discussed in this
  3472. section.
  3473. * Menu:
  3474. * Mode Data Types:: The data type ‘struct termios’ and
  3475. related types.
  3476. * Mode Functions:: Functions to read and set the terminal
  3477. attributes.
  3478. * Setting Modes:: The right way to set terminal attributes
  3479. reliably.
  3480. * Input Modes:: Flags controlling low-level input handling.
  3481. * Output Modes:: Flags controlling low-level output handling.
  3482. * Control Modes:: Flags controlling serial port behavior.
  3483. * Local Modes:: Flags controlling high-level input handling.
  3484. * Line Speed:: How to read and set the terminal line speed.
  3485. * Special Characters:: Characters that have special effects,
  3486. and how to change them.
  3487. * Noncanonical Input:: Controlling how long to wait for input.
  3488. 
  3489. File: libc.info, Node: Mode Data Types, Next: Mode Functions, Up: Terminal Modes
  3490. 17.4.1 Terminal Mode Data Types
  3491. -------------------------------
  3492. The entire collection of attributes of a terminal is stored in a
  3493. structure of type ‘struct termios’. This structure is used with the
  3494. functions ‘tcgetattr’ and ‘tcsetattr’ to read and set the attributes.
  3495. -- Data Type: struct termios
  3496. A ‘struct termios’ records all the I/O attributes of a terminal.
  3497. The structure includes at least the following members:
  3498. ‘tcflag_t c_iflag’
  3499. A bit mask specifying flags for input modes; see *note Input
  3500. Modes::.
  3501. ‘tcflag_t c_oflag’
  3502. A bit mask specifying flags for output modes; see *note Output
  3503. Modes::.
  3504. ‘tcflag_t c_cflag’
  3505. A bit mask specifying flags for control modes; see *note
  3506. Control Modes::.
  3507. ‘tcflag_t c_lflag’
  3508. A bit mask specifying flags for local modes; see *note Local
  3509. Modes::.
  3510. ‘cc_t c_cc[NCCS]’
  3511. An array specifying which characters are associated with
  3512. various control functions; see *note Special Characters::.
  3513. The ‘struct termios’ structure also contains members which encode
  3514. input and output transmission speeds, but the representation is not
  3515. specified. *Note Line Speed::, for how to examine and store the
  3516. speed values.
  3517. The following sections describe the details of the members of the
  3518. ‘struct termios’ structure.
  3519. -- Data Type: tcflag_t
  3520. This is an unsigned integer type used to represent the various bit
  3521. masks for terminal flags.
  3522. -- Data Type: cc_t
  3523. This is an unsigned integer type used to represent characters
  3524. associated with various terminal control functions.
  3525. -- Macro: int NCCS
  3526. The value of this macro is the number of elements in the ‘c_cc’
  3527. array.
  3528. 
  3529. File: libc.info, Node: Mode Functions, Next: Setting Modes, Prev: Mode Data Types, Up: Terminal Modes
  3530. 17.4.2 Terminal Mode Functions
  3531. ------------------------------
  3532. -- Function: int tcgetattr (int FILEDES, struct termios *TERMIOS-P)
  3533. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3534. Concepts::.
  3535. This function is used to examine the attributes of the terminal
  3536. device with file descriptor FILEDES. The attributes are returned
  3537. in the structure that TERMIOS-P points to.
  3538. If successful, ‘tcgetattr’ returns 0. A return value of -1
  3539. indicates an error. The following ‘errno’ error conditions are
  3540. defined for this function:
  3541. ‘EBADF’
  3542. The FILEDES argument is not a valid file descriptor.
  3543. ‘ENOTTY’
  3544. The FILEDES is not associated with a terminal.
  3545. -- Function: int tcsetattr (int FILEDES, int WHEN, const struct termios
  3546. *TERMIOS-P)
  3547. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3548. Concepts::.
  3549. This function sets the attributes of the terminal device with file
  3550. descriptor FILEDES. The new attributes are taken from the
  3551. structure that TERMIOS-P points to.
  3552. The WHEN argument specifies how to deal with input and output
  3553. already queued. It can be one of the following values:
  3554. ‘TCSANOW’
  3555. Make the change immediately.
  3556. ‘TCSADRAIN’
  3557. Make the change after waiting until all queued output has been
  3558. written. You should usually use this option when changing
  3559. parameters that affect output.
  3560. ‘TCSAFLUSH’
  3561. This is like ‘TCSADRAIN’, but also discards any queued input.
  3562. ‘TCSASOFT’
  3563. This is a flag bit that you can add to any of the above
  3564. alternatives. Its meaning is to inhibit alteration of the
  3565. state of the terminal hardware. It is a BSD extension; it is
  3566. only supported on BSD systems and GNU/Hurd systems.
  3567. Using ‘TCSASOFT’ is exactly the same as setting the ‘CIGNORE’
  3568. bit in the ‘c_cflag’ member of the structure TERMIOS-P points
  3569. to. *Note Control Modes::, for a description of ‘CIGNORE’.
  3570. If this function is called from a background process on its
  3571. controlling terminal, normally all processes in the process group
  3572. are sent a ‘SIGTTOU’ signal, in the same way as if the process were
  3573. trying to write to the terminal. The exception is if the calling
  3574. process itself is ignoring or blocking ‘SIGTTOU’ signals, in which
  3575. case the operation is performed and no signal is sent. *Note Job
  3576. Control::.
  3577. If successful, ‘tcsetattr’ returns 0. A return value of -1
  3578. indicates an error. The following ‘errno’ error conditions are
  3579. defined for this function:
  3580. ‘EBADF’
  3581. The FILEDES argument is not a valid file descriptor.
  3582. ‘ENOTTY’
  3583. The FILEDES is not associated with a terminal.
  3584. ‘EINVAL’
  3585. Either the value of the ‘when’ argument is not valid, or there
  3586. is something wrong with the data in the TERMIOS-P argument.
  3587. Although ‘tcgetattr’ and ‘tcsetattr’ specify the terminal device with
  3588. a file descriptor, the attributes are those of the terminal device
  3589. itself and not of the file descriptor. This means that the effects of
  3590. changing terminal attributes are persistent; if another process opens
  3591. the terminal file later on, it will see the changed attributes even
  3592. though it doesn’t have anything to do with the open file descriptor you
  3593. originally specified in changing the attributes.
  3594. Similarly, if a single process has multiple or duplicated file
  3595. descriptors for the same terminal device, changing the terminal
  3596. attributes affects input and output to all of these file descriptors.
  3597. This means, for example, that you can’t open one file descriptor or
  3598. stream to read from a terminal in the normal line-buffered, echoed mode;
  3599. and simultaneously have another file descriptor for the same terminal
  3600. that you use to read from it in single-character, non-echoed mode.
  3601. Instead, you have to explicitly switch the terminal back and forth
  3602. between the two modes.
  3603. 
  3604. File: libc.info, Node: Setting Modes, Next: Input Modes, Prev: Mode Functions, Up: Terminal Modes
  3605. 17.4.3 Setting Terminal Modes Properly
  3606. --------------------------------------
  3607. When you set terminal modes, you should call ‘tcgetattr’ first to get
  3608. the current modes of the particular terminal device, modify only those
  3609. modes that you are really interested in, and store the result with
  3610. ‘tcsetattr’.
  3611. It’s a bad idea to simply initialize a ‘struct termios’ structure to
  3612. a chosen set of attributes and pass it directly to ‘tcsetattr’. Your
  3613. program may be run years from now, on systems that support members not
  3614. documented in this manual. The way to avoid setting these members to
  3615. unreasonable values is to avoid changing them.
  3616. What’s more, different terminal devices may require different mode
  3617. settings in order to function properly. So you should avoid blindly
  3618. copying attributes from one terminal device to another.
  3619. When a member contains a collection of independent flags, as the
  3620. ‘c_iflag’, ‘c_oflag’ and ‘c_cflag’ members do, even setting the entire
  3621. member is a bad idea, because particular operating systems have their
  3622. own flags. Instead, you should start with the current value of the
  3623. member and alter only the flags whose values matter in your program,
  3624. leaving any other flags unchanged.
  3625. Here is an example of how to set one flag (‘ISTRIP’) in the ‘struct
  3626. termios’ structure while properly preserving all the other data in the
  3627. structure:
  3628. int
  3629. set_istrip (int desc, int value)
  3630. {
  3631. struct termios settings;
  3632. int result;
  3633. result = tcgetattr (desc, &settings);
  3634. if (result < 0)
  3635. {
  3636. perror ("error in tcgetattr");
  3637. return 0;
  3638. }
  3639. settings.c_iflag &= ~ISTRIP;
  3640. if (value)
  3641. settings.c_iflag |= ISTRIP;
  3642. result = tcsetattr (desc, TCSANOW, &settings);
  3643. if (result < 0)
  3644. {
  3645. perror ("error in tcsetattr");
  3646. return 0;
  3647. }
  3648. return 1;
  3649. }
  3650. 
  3651. File: libc.info, Node: Input Modes, Next: Output Modes, Prev: Setting Modes, Up: Terminal Modes
  3652. 17.4.4 Input Modes
  3653. ------------------
  3654. This section describes the terminal attribute flags that control fairly
  3655. low-level aspects of input processing: handling of parity errors, break
  3656. signals, flow control, and <RET> and <LFD> characters.
  3657. All of these flags are bits in the ‘c_iflag’ member of the ‘struct
  3658. termios’ structure. The member is an integer, and you change flags
  3659. using the operators ‘&’, ‘|’ and ‘^’. Don’t try to specify the entire
  3660. value for ‘c_iflag’—instead, change only specific flags and leave the
  3661. rest untouched (*note Setting Modes::).
  3662. -- Macro: tcflag_t INPCK
  3663. If this bit is set, input parity checking is enabled. If it is not
  3664. set, no checking at all is done for parity errors on input; the
  3665. characters are simply passed through to the application.
  3666. Parity checking on input processing is independent of whether
  3667. parity detection and generation on the underlying terminal hardware
  3668. is enabled; see *note Control Modes::. For example, you could
  3669. clear the ‘INPCK’ input mode flag and set the ‘PARENB’ control mode
  3670. flag to ignore parity errors on input, but still generate parity on
  3671. output.
  3672. If this bit is set, what happens when a parity error is detected
  3673. depends on whether the ‘IGNPAR’ or ‘PARMRK’ bits are set. If
  3674. neither of these bits are set, a byte with a parity error is passed
  3675. to the application as a ‘'\0'’ character.
  3676. -- Macro: tcflag_t IGNPAR
  3677. If this bit is set, any byte with a framing or parity error is
  3678. ignored. This is only useful if ‘INPCK’ is also set.
  3679. -- Macro: tcflag_t PARMRK
  3680. If this bit is set, input bytes with parity or framing errors are
  3681. marked when passed to the program. This bit is meaningful only
  3682. when ‘INPCK’ is set and ‘IGNPAR’ is not set.
  3683. The way erroneous bytes are marked is with two preceding bytes,
  3684. ‘377’ and ‘0’. Thus, the program actually reads three bytes for
  3685. one erroneous byte received from the terminal.
  3686. If a valid byte has the value ‘0377’, and ‘ISTRIP’ (see below) is
  3687. not set, the program might confuse it with the prefix that marks a
  3688. parity error. So a valid byte ‘0377’ is passed to the program as
  3689. two bytes, ‘0377’ ‘0377’, in this case.
  3690. -- Macro: tcflag_t ISTRIP
  3691. If this bit is set, valid input bytes are stripped to seven bits;
  3692. otherwise, all eight bits are available for programs to read.
  3693. -- Macro: tcflag_t IGNBRK
  3694. If this bit is set, break conditions are ignored.
  3695. A "break condition" is defined in the context of asynchronous
  3696. serial data transmission as a series of zero-value bits longer than
  3697. a single byte.
  3698. -- Macro: tcflag_t BRKINT
  3699. If this bit is set and ‘IGNBRK’ is not set, a break condition
  3700. clears the terminal input and output queues and raises a ‘SIGINT’
  3701. signal for the foreground process group associated with the
  3702. terminal.
  3703. If neither ‘BRKINT’ nor ‘IGNBRK’ are set, a break condition is
  3704. passed to the application as a single ‘'\0'’ character if ‘PARMRK’
  3705. is not set, or otherwise as a three-character sequence ‘'\377'’,
  3706. ‘'\0'’, ‘'\0'’.
  3707. -- Macro: tcflag_t IGNCR
  3708. If this bit is set, carriage return characters (‘'\r'’) are
  3709. discarded on input. Discarding carriage return may be useful on
  3710. terminals that send both carriage return and linefeed when you type
  3711. the <RET> key.
  3712. -- Macro: tcflag_t ICRNL
  3713. If this bit is set and ‘IGNCR’ is not set, carriage return
  3714. characters (‘'\r'’) received as input are passed to the application
  3715. as newline characters (‘'\n'’).
  3716. -- Macro: tcflag_t INLCR
  3717. If this bit is set, newline characters (‘'\n'’) received as input
  3718. are passed to the application as carriage return characters
  3719. (‘'\r'’).
  3720. -- Macro: tcflag_t IXOFF
  3721. If this bit is set, start/stop control on input is enabled. In
  3722. other words, the computer sends STOP and START characters as
  3723. necessary to prevent input from coming in faster than programs are
  3724. reading it. The idea is that the actual terminal hardware that is
  3725. generating the input data responds to a STOP character by
  3726. suspending transmission, and to a START character by resuming
  3727. transmission. *Note Start/Stop Characters::.
  3728. -- Macro: tcflag_t IXON
  3729. If this bit is set, start/stop control on output is enabled. In
  3730. other words, if the computer receives a STOP character, it suspends
  3731. output until a START character is received. In this case, the STOP
  3732. and START characters are never passed to the application program.
  3733. If this bit is not set, then START and STOP can be read as ordinary
  3734. characters. *Note Start/Stop Characters::.
  3735. -- Macro: tcflag_t IXANY
  3736. If this bit is set, any input character restarts output when output
  3737. has been suspended with the STOP character. Otherwise, only the
  3738. START character restarts output.
  3739. This is a BSD extension; it exists only on BSD systems and
  3740. GNU/Linux and GNU/Hurd systems.
  3741. -- Macro: tcflag_t IMAXBEL
  3742. If this bit is set, then filling up the terminal input buffer sends
  3743. a BEL character (code ‘007’) to the terminal to ring the bell.
  3744. This is a BSD extension.
  3745. 
  3746. File: libc.info, Node: Output Modes, Next: Control Modes, Prev: Input Modes, Up: Terminal Modes
  3747. 17.4.5 Output Modes
  3748. -------------------
  3749. This section describes the terminal flags and fields that control how
  3750. output characters are translated and padded for display. All of these
  3751. are contained in the ‘c_oflag’ member of the ‘struct termios’ structure.
  3752. The ‘c_oflag’ member itself is an integer, and you change the flags
  3753. and fields using the operators ‘&’, ‘|’, and ‘^’. Don’t try to specify
  3754. the entire value for ‘c_oflag’—instead, change only specific flags and
  3755. leave the rest untouched (*note Setting Modes::).
  3756. -- Macro: tcflag_t OPOST
  3757. If this bit is set, output data is processed in some unspecified
  3758. way so that it is displayed appropriately on the terminal device.
  3759. This typically includes mapping newline characters (‘'\n'’) onto
  3760. carriage return and linefeed pairs.
  3761. If this bit isn’t set, the characters are transmitted as-is.
  3762. The following three bits are effective only if ‘OPOST’ is set.
  3763. -- Macro: tcflag_t ONLCR
  3764. If this bit is set, convert the newline character on output into a
  3765. pair of characters, carriage return followed by linefeed.
  3766. -- Macro: tcflag_t OXTABS
  3767. If this bit is set, convert tab characters on output into the
  3768. appropriate number of spaces to emulate a tab stop every eight
  3769. columns. This bit exists only on BSD systems and GNU/Hurd systems;
  3770. on GNU/Linux systems it is available as ‘XTABS’.
  3771. -- Macro: tcflag_t ONOEOT
  3772. If this bit is set, discard ‘C-d’ characters (code ‘004’) on
  3773. output. These characters cause many dial-up terminals to
  3774. disconnect. This bit exists only on BSD systems and GNU/Hurd
  3775. systems.
  3776. 
  3777. File: libc.info, Node: Control Modes, Next: Local Modes, Prev: Output Modes, Up: Terminal Modes
  3778. 17.4.6 Control Modes
  3779. --------------------
  3780. This section describes the terminal flags and fields that control
  3781. parameters usually associated with asynchronous serial data
  3782. transmission. These flags may not make sense for other kinds of
  3783. terminal ports (such as a network connection pseudo-terminal). All of
  3784. these are contained in the ‘c_cflag’ member of the ‘struct termios’
  3785. structure.
  3786. The ‘c_cflag’ member itself is an integer, and you change the flags
  3787. and fields using the operators ‘&’, ‘|’, and ‘^’. Don’t try to specify
  3788. the entire value for ‘c_cflag’—instead, change only specific flags and
  3789. leave the rest untouched (*note Setting Modes::).
  3790. -- Macro: tcflag_t CLOCAL
  3791. If this bit is set, it indicates that the terminal is connected
  3792. “locally” and that the modem status lines (such as carrier detect)
  3793. should be ignored.
  3794. On many systems if this bit is not set and you call ‘open’ without
  3795. the ‘O_NONBLOCK’ flag set, ‘open’ blocks until a modem connection
  3796. is established.
  3797. If this bit is not set and a modem disconnect is detected, a
  3798. ‘SIGHUP’ signal is sent to the controlling process group for the
  3799. terminal (if it has one). Normally, this causes the process to
  3800. exit; see *note Signal Handling::. Reading from the terminal after
  3801. a disconnect causes an end-of-file condition, and writing causes an
  3802. ‘EIO’ error to be returned. The terminal device must be closed and
  3803. reopened to clear the condition.
  3804. -- Macro: tcflag_t HUPCL
  3805. If this bit is set, a modem disconnect is generated when all
  3806. processes that have the terminal device open have either closed the
  3807. file or exited.
  3808. -- Macro: tcflag_t CREAD
  3809. If this bit is set, input can be read from the terminal.
  3810. Otherwise, input is discarded when it arrives.
  3811. -- Macro: tcflag_t CSTOPB
  3812. If this bit is set, two stop bits are used. Otherwise, only one
  3813. stop bit is used.
  3814. -- Macro: tcflag_t PARENB
  3815. If this bit is set, generation and detection of a parity bit are
  3816. enabled. *Note Input Modes::, for information on how input parity
  3817. errors are handled.
  3818. If this bit is not set, no parity bit is added to output
  3819. characters, and input characters are not checked for correct
  3820. parity.
  3821. -- Macro: tcflag_t PARODD
  3822. This bit is only useful if ‘PARENB’ is set. If ‘PARODD’ is set,
  3823. odd parity is used, otherwise even parity is used.
  3824. The control mode flags also includes a field for the number of bits
  3825. per character. You can use the ‘CSIZE’ macro as a mask to extract the
  3826. value, like this: ‘settings.c_cflag & CSIZE’.
  3827. -- Macro: tcflag_t CSIZE
  3828. This is a mask for the number of bits per character.
  3829. -- Macro: tcflag_t CS5
  3830. This specifies five bits per byte.
  3831. -- Macro: tcflag_t CS6
  3832. This specifies six bits per byte.
  3833. -- Macro: tcflag_t CS7
  3834. This specifies seven bits per byte.
  3835. -- Macro: tcflag_t CS8
  3836. This specifies eight bits per byte.
  3837. The following four bits are BSD extensions; these exist only on BSD
  3838. systems and GNU/Hurd systems.
  3839. -- Macro: tcflag_t CCTS_OFLOW
  3840. If this bit is set, enable flow control of output based on the CTS
  3841. wire (RS232 protocol).
  3842. -- Macro: tcflag_t CRTS_IFLOW
  3843. If this bit is set, enable flow control of input based on the RTS
  3844. wire (RS232 protocol).
  3845. -- Macro: tcflag_t MDMBUF
  3846. If this bit is set, enable carrier-based flow control of output.
  3847. -- Macro: tcflag_t CIGNORE
  3848. If this bit is set, it says to ignore the control modes and line
  3849. speed values entirely. This is only meaningful in a call to
  3850. ‘tcsetattr’.
  3851. The ‘c_cflag’ member and the line speed values returned by
  3852. ‘cfgetispeed’ and ‘cfgetospeed’ will be unaffected by the call.
  3853. ‘CIGNORE’ is useful if you want to set all the software modes in
  3854. the other members, but leave the hardware details in ‘c_cflag’
  3855. unchanged. (This is how the ‘TCSASOFT’ flag to ‘tcsettattr’
  3856. works.)
  3857. This bit is never set in the structure filled in by ‘tcgetattr’.
  3858. 
  3859. File: libc.info, Node: Local Modes, Next: Line Speed, Prev: Control Modes, Up: Terminal Modes
  3860. 17.4.7 Local Modes
  3861. ------------------
  3862. This section describes the flags for the ‘c_lflag’ member of the ‘struct
  3863. termios’ structure. These flags generally control higher-level aspects
  3864. of input processing than the input modes flags described in *note Input
  3865. Modes::, such as echoing, signals, and the choice of canonical or
  3866. noncanonical input.
  3867. The ‘c_lflag’ member itself is an integer, and you change the flags
  3868. and fields using the operators ‘&’, ‘|’, and ‘^’. Don’t try to specify
  3869. the entire value for ‘c_lflag’—instead, change only specific flags and
  3870. leave the rest untouched (*note Setting Modes::).
  3871. -- Macro: tcflag_t ICANON
  3872. This bit, if set, enables canonical input processing mode.
  3873. Otherwise, input is processed in noncanonical mode. *Note
  3874. Canonical or Not::.
  3875. -- Macro: tcflag_t ECHO
  3876. If this bit is set, echoing of input characters back to the
  3877. terminal is enabled.
  3878. -- Macro: tcflag_t ECHOE
  3879. If this bit is set, echoing indicates erasure of input with the
  3880. ERASE character by erasing the last character in the current line
  3881. from the screen. Otherwise, the character erased is re-echoed to
  3882. show what has happened (suitable for a printing terminal).
  3883. This bit only controls the display behavior; the ‘ICANON’ bit by
  3884. itself controls actual recognition of the ERASE character and
  3885. erasure of input, without which ‘ECHOE’ is simply irrelevant.
  3886. -- Macro: tcflag_t ECHOPRT
  3887. This bit, like ‘ECHOE’, enables display of the ERASE character in a
  3888. way that is geared to a hardcopy terminal. When you type the ERASE
  3889. character, a ‘\’ character is printed followed by the first
  3890. character erased. Typing the ERASE character again just prints the
  3891. next character erased. Then, the next time you type a normal
  3892. character, a ‘/’ character is printed before the character echoes.
  3893. This is a BSD extension, and exists only in BSD systems and
  3894. GNU/Linux and GNU/Hurd systems.
  3895. -- Macro: tcflag_t ECHOK
  3896. This bit enables special display of the KILL character by moving to
  3897. a new line after echoing the KILL character normally. The behavior
  3898. of ‘ECHOKE’ (below) is nicer to look at.
  3899. If this bit is not set, the KILL character echoes just as it would
  3900. if it were not the KILL character. Then it is up to the user to
  3901. remember that the KILL character has erased the preceding input;
  3902. there is no indication of this on the screen.
  3903. This bit only controls the display behavior; the ‘ICANON’ bit by
  3904. itself controls actual recognition of the KILL character and
  3905. erasure of input, without which ‘ECHOK’ is simply irrelevant.
  3906. -- Macro: tcflag_t ECHOKE
  3907. This bit is similar to ‘ECHOK’. It enables special display of the
  3908. KILL character by erasing on the screen the entire line that has
  3909. been killed. This is a BSD extension, and exists only in BSD
  3910. systems and GNU/Linux and GNU/Hurd systems.
  3911. -- Macro: tcflag_t ECHONL
  3912. If this bit is set and the ‘ICANON’ bit is also set, then the
  3913. newline (‘'\n'’) character is echoed even if the ‘ECHO’ bit is not
  3914. set.
  3915. -- Macro: tcflag_t ECHOCTL
  3916. If this bit is set and the ‘ECHO’ bit is also set, echo control
  3917. characters with ‘^’ followed by the corresponding text character.
  3918. Thus, control-A echoes as ‘^A’. This is usually the preferred mode
  3919. for interactive input, because echoing a control character back to
  3920. the terminal could have some undesired effect on the terminal.
  3921. This is a BSD extension, and exists only in BSD systems and
  3922. GNU/Linux and GNU/Hurd systems.
  3923. -- Macro: tcflag_t ISIG
  3924. This bit controls whether the INTR, QUIT, and SUSP characters are
  3925. recognized. The functions associated with these characters are
  3926. performed if and only if this bit is set. Being in canonical or
  3927. noncanonical input mode has no effect on the interpretation of
  3928. these characters.
  3929. You should use caution when disabling recognition of these
  3930. characters. Programs that cannot be interrupted interactively are
  3931. very user-unfriendly. If you clear this bit, your program should
  3932. provide some alternate interface that allows the user to
  3933. interactively send the signals associated with these characters, or
  3934. to escape from the program.
  3935. *Note Signal Characters::.
  3936. -- Macro: tcflag_t IEXTEN
  3937. POSIX.1 gives ‘IEXTEN’ implementation-defined meaning, so you
  3938. cannot rely on this interpretation on all systems.
  3939. On BSD systems and GNU/Linux and GNU/Hurd systems, it enables the
  3940. LNEXT and DISCARD characters. *Note Other Special::.
  3941. -- Macro: tcflag_t NOFLSH
  3942. Normally, the INTR, QUIT, and SUSP characters cause input and
  3943. output queues for the terminal to be cleared. If this bit is set,
  3944. the queues are not cleared.
  3945. -- Macro: tcflag_t TOSTOP
  3946. If this bit is set and the system supports job control, then
  3947. ‘SIGTTOU’ signals are generated by background processes that
  3948. attempt to write to the terminal. *Note Access to the Terminal::.
  3949. The following bits are BSD extensions; they exist only on BSD systems
  3950. and GNU/Hurd systems.
  3951. -- Macro: tcflag_t ALTWERASE
  3952. This bit determines how far the WERASE character should erase. The
  3953. WERASE character erases back to the beginning of a word; the
  3954. question is, where do words begin?
  3955. If this bit is clear, then the beginning of a word is a
  3956. nonwhitespace character following a whitespace character. If the
  3957. bit is set, then the beginning of a word is an alphanumeric
  3958. character or underscore following a character which is none of
  3959. those.
  3960. *Note Editing Characters::, for more information about the WERASE
  3961. character.
  3962. -- Macro: tcflag_t FLUSHO
  3963. This is the bit that toggles when the user types the DISCARD
  3964. character. While this bit is set, all output is discarded. *Note
  3965. Other Special::.
  3966. -- Macro: tcflag_t NOKERNINFO
  3967. Setting this bit disables handling of the STATUS character. *Note
  3968. Other Special::.
  3969. -- Macro: tcflag_t PENDIN
  3970. If this bit is set, it indicates that there is a line of input that
  3971. needs to be reprinted. Typing the REPRINT character sets this bit;
  3972. the bit remains set until reprinting is finished. *Note Editing
  3973. Characters::.
  3974. 
  3975. File: libc.info, Node: Line Speed, Next: Special Characters, Prev: Local Modes, Up: Terminal Modes
  3976. 17.4.8 Line Speed
  3977. -----------------
  3978. The terminal line speed tells the computer how fast to read and write
  3979. data on the terminal.
  3980. If the terminal is connected to a real serial line, the terminal
  3981. speed you specify actually controls the line—if it doesn’t match the
  3982. terminal’s own idea of the speed, communication does not work. Real
  3983. serial ports accept only certain standard speeds. Also, particular
  3984. hardware may not support even all the standard speeds. Specifying a
  3985. speed of zero hangs up a dialup connection and turns off modem control
  3986. signals.
  3987. If the terminal is not a real serial line (for example, if it is a
  3988. network connection), then the line speed won’t really affect data
  3989. transmission speed, but some programs will use it to determine the
  3990. amount of padding needed. It’s best to specify a line speed value that
  3991. matches the actual speed of the actual terminal, but you can safely
  3992. experiment with different values to vary the amount of padding.
  3993. There are actually two line speeds for each terminal, one for input
  3994. and one for output. You can set them independently, but most often
  3995. terminals use the same speed for both directions.
  3996. The speed values are stored in the ‘struct termios’ structure, but
  3997. don’t try to access them in the ‘struct termios’ structure directly.
  3998. Instead, you should use the following functions to read and store them:
  3999. -- Function: speed_t cfgetospeed (const struct termios *TERMIOS-P)
  4000. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4001. Concepts::.
  4002. This function returns the output line speed stored in the structure
  4003. ‘*TERMIOS-P’.
  4004. -- Function: speed_t cfgetispeed (const struct termios *TERMIOS-P)
  4005. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4006. Concepts::.
  4007. This function returns the input line speed stored in the structure
  4008. ‘*TERMIOS-P’.
  4009. -- Function: int cfsetospeed (struct termios *TERMIOS-P, speed_t SPEED)
  4010. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4011. Concepts::.
  4012. This function stores SPEED in ‘*TERMIOS-P’ as the output speed.
  4013. The normal return value is 0; a value of -1 indicates an error. If
  4014. SPEED is not a speed, ‘cfsetospeed’ returns -1.
  4015. -- Function: int cfsetispeed (struct termios *TERMIOS-P, speed_t SPEED)
  4016. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4017. Concepts::.
  4018. This function stores SPEED in ‘*TERMIOS-P’ as the input speed. The
  4019. normal return value is 0; a value of -1 indicates an error. If
  4020. SPEED is not a speed, ‘cfsetospeed’ returns -1.
  4021. -- Function: int cfsetspeed (struct termios *TERMIOS-P, speed_t SPEED)
  4022. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4023. Concepts::.
  4024. This function stores SPEED in ‘*TERMIOS-P’ as both the input and
  4025. output speeds. The normal return value is 0; a value of -1
  4026. indicates an error. If SPEED is not a speed, ‘cfsetspeed’ returns
  4027. -1. This function is an extension in 4.4 BSD.
  4028. -- Data Type: speed_t
  4029. The ‘speed_t’ type is an unsigned integer data type used to
  4030. represent line speeds.
  4031. The functions ‘cfsetospeed’ and ‘cfsetispeed’ report errors only for
  4032. speed values that the system simply cannot handle. If you specify a
  4033. speed value that is basically acceptable, then those functions will
  4034. succeed. But they do not check that a particular hardware device can
  4035. actually support the specified speeds—in fact, they don’t know which
  4036. device you plan to set the speed for. If you use ‘tcsetattr’ to set the
  4037. speed of a particular device to a value that it cannot handle,
  4038. ‘tcsetattr’ returns -1.
  4039. *Portability note:* In the GNU C Library, the functions above accept
  4040. speeds measured in bits per second as input, and return speed values
  4041. measured in bits per second. Other libraries require speeds to be
  4042. indicated by special codes. For POSIX.1 portability, you must use one
  4043. of the following symbols to represent the speed; their precise numeric
  4044. values are system-dependent, but each name has a fixed meaning: ‘B110’
  4045. stands for 110 bps, ‘B300’ for 300 bps, and so on. There is no portable
  4046. way to represent any speed but these, but these are the only speeds that
  4047. typical serial lines can support.
  4048. B0 B50 B75 B110 B134 B150 B200
  4049. B300 B600 B1200 B1800 B2400 B4800
  4050. B9600 B19200 B38400 B57600 B115200
  4051. B230400 B460800
  4052. BSD defines two additional speed symbols as aliases: ‘EXTA’ is an
  4053. alias for ‘B19200’ and ‘EXTB’ is an alias for ‘B38400’. These aliases
  4054. are obsolete.
  4055. 
  4056. File: libc.info, Node: Special Characters, Next: Noncanonical Input, Prev: Line Speed, Up: Terminal Modes
  4057. 17.4.9 Special Characters
  4058. -------------------------
  4059. In canonical input, the terminal driver recognizes a number of special
  4060. characters which perform various control functions. These include the
  4061. ERASE character (usually <DEL>) for editing input, and other editing
  4062. characters. The INTR character (normally ‘C-c’) for sending a ‘SIGINT’
  4063. signal, and other signal-raising characters, may be available in either
  4064. canonical or noncanonical input mode. All these characters are
  4065. described in this section.
  4066. The particular characters used are specified in the ‘c_cc’ member of
  4067. the ‘struct termios’ structure. This member is an array; each element
  4068. specifies the character for a particular role. Each element has a
  4069. symbolic constant that stands for the index of that element—for example,
  4070. ‘VINTR’ is the index of the element that specifies the INTR character,
  4071. so storing ‘'='’ in ‘TERMIOS.c_cc[VINTR]’ specifies ‘=’ as the INTR
  4072. character.
  4073. On some systems, you can disable a particular special character
  4074. function by specifying the value ‘_POSIX_VDISABLE’ for that role. This
  4075. value is unequal to any possible character code. *Note Options for
  4076. Files::, for more information about how to tell whether the operating
  4077. system you are using supports ‘_POSIX_VDISABLE’.
  4078. * Menu:
  4079. * Editing Characters:: Special characters that terminate lines and
  4080. delete text, and other editing functions.
  4081. * Signal Characters:: Special characters that send or raise signals
  4082. to or for certain classes of processes.
  4083. * Start/Stop Characters:: Special characters that suspend or resume
  4084. suspended output.
  4085. * Other Special:: Other special characters for BSD systems:
  4086. they can discard output, and print status.
  4087. 
  4088. File: libc.info, Node: Editing Characters, Next: Signal Characters, Up: Special Characters
  4089. 17.4.9.1 Characters for Input Editing
  4090. .....................................
  4091. These special characters are active only in canonical input mode. *Note
  4092. Canonical or Not::.
  4093. -- Macro: int VEOF
  4094. This is the subscript for the EOF character in the special control
  4095. character array. ‘TERMIOS.c_cc[VEOF]’ holds the character itself.
  4096. The EOF character is recognized only in canonical input mode. It
  4097. acts as a line terminator in the same way as a newline character,
  4098. but if the EOF character is typed at the beginning of a line it
  4099. causes ‘read’ to return a byte count of zero, indicating
  4100. end-of-file. The EOF character itself is discarded.
  4101. Usually, the EOF character is ‘C-d’.
  4102. -- Macro: int VEOL
  4103. This is the subscript for the EOL character in the special control
  4104. character array. ‘TERMIOS.c_cc[VEOL]’ holds the character itself.
  4105. The EOL character is recognized only in canonical input mode. It
  4106. acts as a line terminator, just like a newline character. The EOL
  4107. character is not discarded; it is read as the last character in the
  4108. input line.
  4109. You don’t need to use the EOL character to make <RET> end a line.
  4110. Just set the ICRNL flag. In fact, this is the default state of
  4111. affairs.
  4112. -- Macro: int VEOL2
  4113. This is the subscript for the EOL2 character in the special control
  4114. character array. ‘TERMIOS.c_cc[VEOL2]’ holds the character itself.
  4115. The EOL2 character works just like the EOL character (see above),
  4116. but it can be a different character. Thus, you can specify two
  4117. characters to terminate an input line, by setting EOL to one of
  4118. them and EOL2 to the other.
  4119. The EOL2 character is a BSD extension; it exists only on BSD
  4120. systems and GNU/Linux and GNU/Hurd systems.
  4121. -- Macro: int VERASE
  4122. This is the subscript for the ERASE character in the special
  4123. control character array. ‘TERMIOS.c_cc[VERASE]’ holds the
  4124. character itself.
  4125. The ERASE character is recognized only in canonical input mode.
  4126. When the user types the erase character, the previous character
  4127. typed is discarded. (If the terminal generates multibyte character
  4128. sequences, this may cause more than one byte of input to be
  4129. discarded.) This cannot be used to erase past the beginning of the
  4130. current line of text. The ERASE character itself is discarded.
  4131. Usually, the ERASE character is <DEL>.
  4132. -- Macro: int VWERASE
  4133. This is the subscript for the WERASE character in the special
  4134. control character array. ‘TERMIOS.c_cc[VWERASE]’ holds the
  4135. character itself.
  4136. The WERASE character is recognized only in canonical mode. It
  4137. erases an entire word of prior input, and any whitespace after it;
  4138. whitespace characters before the word are not erased.
  4139. The definition of a “word” depends on the setting of the
  4140. ‘ALTWERASE’ mode; *note Local Modes::.
  4141. If the ‘ALTWERASE’ mode is not set, a word is defined as a sequence
  4142. of any characters except space or tab.
  4143. If the ‘ALTWERASE’ mode is set, a word is defined as a sequence of
  4144. characters containing only letters, numbers, and underscores,
  4145. optionally followed by one character that is not a letter, number,
  4146. or underscore.
  4147. The WERASE character is usually ‘C-w’.
  4148. This is a BSD extension.
  4149. -- Macro: int VKILL
  4150. This is the subscript for the KILL character in the special control
  4151. character array. ‘TERMIOS.c_cc[VKILL]’ holds the character itself.
  4152. The KILL character is recognized only in canonical input mode.
  4153. When the user types the kill character, the entire contents of the
  4154. current line of input are discarded. The kill character itself is
  4155. discarded too.
  4156. The KILL character is usually ‘C-u’.
  4157. -- Macro: int VREPRINT
  4158. This is the subscript for the REPRINT character in the special
  4159. control character array. ‘TERMIOS.c_cc[VREPRINT]’ holds the
  4160. character itself.
  4161. The REPRINT character is recognized only in canonical mode. It
  4162. reprints the current input line. If some asynchronous output has
  4163. come while you are typing, this lets you see the line you are
  4164. typing clearly again.
  4165. The REPRINT character is usually ‘C-r’.
  4166. This is a BSD extension.
  4167. 
  4168. File: libc.info, Node: Signal Characters, Next: Start/Stop Characters, Prev: Editing Characters, Up: Special Characters
  4169. 17.4.9.2 Characters that Cause Signals
  4170. ......................................
  4171. These special characters may be active in either canonical or
  4172. noncanonical input mode, but only when the ‘ISIG’ flag is set (*note
  4173. Local Modes::).
  4174. -- Macro: int VINTR
  4175. This is the subscript for the INTR character in the special control
  4176. character array. ‘TERMIOS.c_cc[VINTR]’ holds the character itself.
  4177. The INTR (interrupt) character raises a ‘SIGINT’ signal for all
  4178. processes in the foreground job associated with the terminal. The
  4179. INTR character itself is then discarded. *Note Signal Handling::,
  4180. for more information about signals.
  4181. Typically, the INTR character is ‘C-c’.
  4182. -- Macro: int VQUIT
  4183. This is the subscript for the QUIT character in the special control
  4184. character array. ‘TERMIOS.c_cc[VQUIT]’ holds the character itself.
  4185. The QUIT character raises a ‘SIGQUIT’ signal for all processes in
  4186. the foreground job associated with the terminal. The QUIT
  4187. character itself is then discarded. *Note Signal Handling::, for
  4188. more information about signals.
  4189. Typically, the QUIT character is ‘C-\’.
  4190. -- Macro: int VSUSP
  4191. This is the subscript for the SUSP character in the special control
  4192. character array. ‘TERMIOS.c_cc[VSUSP]’ holds the character itself.
  4193. The SUSP (suspend) character is recognized only if the
  4194. implementation supports job control (*note Job Control::). It
  4195. causes a ‘SIGTSTP’ signal to be sent to all processes in the
  4196. foreground job associated with the terminal. The SUSP character
  4197. itself is then discarded. *Note Signal Handling::, for more
  4198. information about signals.
  4199. Typically, the SUSP character is ‘C-z’.
  4200. Few applications disable the normal interpretation of the SUSP
  4201. character. If your program does this, it should provide some other
  4202. mechanism for the user to stop the job. When the user invokes this
  4203. mechanism, the program should send a ‘SIGTSTP’ signal to the process
  4204. group of the process, not just to the process itself. *Note Signaling
  4205. Another Process::.
  4206. -- Macro: int VDSUSP
  4207. This is the subscript for the DSUSP character in the special
  4208. control character array. ‘TERMIOS.c_cc[VDSUSP]’ holds the
  4209. character itself.
  4210. The DSUSP (suspend) character is recognized only if the
  4211. implementation supports job control (*note Job Control::). It
  4212. sends a ‘SIGTSTP’ signal, like the SUSP character, but not right
  4213. away—only when the program tries to read it as input. Not all
  4214. systems with job control support DSUSP; only BSD-compatible systems
  4215. do (including GNU/Hurd systems).
  4216. *Note Signal Handling::, for more information about signals.
  4217. Typically, the DSUSP character is ‘C-y’.
  4218. 
  4219. File: libc.info, Node: Start/Stop Characters, Next: Other Special, Prev: Signal Characters, Up: Special Characters
  4220. 17.4.9.3 Special Characters for Flow Control
  4221. ............................................
  4222. These special characters may be active in either canonical or
  4223. noncanonical input mode, but their use is controlled by the flags ‘IXON’
  4224. and ‘IXOFF’ (*note Input Modes::).
  4225. -- Macro: int VSTART
  4226. This is the subscript for the START character in the special
  4227. control character array. ‘TERMIOS.c_cc[VSTART]’ holds the
  4228. character itself.
  4229. The START character is used to support the ‘IXON’ and ‘IXOFF’ input
  4230. modes. If ‘IXON’ is set, receiving a START character resumes
  4231. suspended output; the START character itself is discarded. If
  4232. ‘IXANY’ is set, receiving any character at all resumes suspended
  4233. output; the resuming character is not discarded unless it is the
  4234. START character. If ‘IXOFF’ is set, the system may also transmit
  4235. START characters to the terminal.
  4236. The usual value for the START character is ‘C-q’. You may not be
  4237. able to change this value—the hardware may insist on using ‘C-q’
  4238. regardless of what you specify.
  4239. -- Macro: int VSTOP
  4240. This is the subscript for the STOP character in the special control
  4241. character array. ‘TERMIOS.c_cc[VSTOP]’ holds the character itself.
  4242. The STOP character is used to support the ‘IXON’ and ‘IXOFF’ input
  4243. modes. If ‘IXON’ is set, receiving a STOP character causes output
  4244. to be suspended; the STOP character itself is discarded. If
  4245. ‘IXOFF’ is set, the system may also transmit STOP characters to the
  4246. terminal, to prevent the input queue from overflowing.
  4247. The usual value for the STOP character is ‘C-s’. You may not be
  4248. able to change this value—the hardware may insist on using ‘C-s’
  4249. regardless of what you specify.
  4250. 
  4251. File: libc.info, Node: Other Special, Prev: Start/Stop Characters, Up: Special Characters
  4252. 17.4.9.4 Other Special Characters
  4253. .................................
  4254. -- Macro: int VLNEXT
  4255. This is the subscript for the LNEXT character in the special
  4256. control character array. ‘TERMIOS.c_cc[VLNEXT]’ holds the
  4257. character itself.
  4258. The LNEXT character is recognized only when ‘IEXTEN’ is set, but in
  4259. both canonical and noncanonical mode. It disables any special
  4260. significance of the next character the user types. Even if the
  4261. character would normally perform some editing function or generate
  4262. a signal, it is read as a plain character. This is the analogue of
  4263. the ‘C-q’ command in Emacs. “LNEXT” stands for “literal next.”
  4264. The LNEXT character is usually ‘C-v’.
  4265. This character is available on BSD systems and GNU/Linux and
  4266. GNU/Hurd systems.
  4267. -- Macro: int VDISCARD
  4268. This is the subscript for the DISCARD character in the special
  4269. control character array. ‘TERMIOS.c_cc[VDISCARD]’ holds the
  4270. character itself.
  4271. The DISCARD character is recognized only when ‘IEXTEN’ is set, but
  4272. in both canonical and noncanonical mode. Its effect is to toggle
  4273. the discard-output flag. When this flag is set, all program output
  4274. is discarded. Setting the flag also discards all output currently
  4275. in the output buffer. Typing any other character resets the flag.
  4276. This character is available on BSD systems and GNU/Linux and
  4277. GNU/Hurd systems.
  4278. -- Macro: int VSTATUS
  4279. This is the subscript for the STATUS character in the special
  4280. control character array. ‘TERMIOS.c_cc[VSTATUS]’ holds the
  4281. character itself.
  4282. The STATUS character’s effect is to print out a status message
  4283. about how the current process is running.
  4284. The STATUS character is recognized only in canonical mode, and only
  4285. if ‘NOKERNINFO’ is not set.
  4286. This character is available only on BSD systems and GNU/Hurd
  4287. systems.
  4288. 
  4289. File: libc.info, Node: Noncanonical Input, Prev: Special Characters, Up: Terminal Modes
  4290. 17.4.10 Noncanonical Input
  4291. --------------------------
  4292. In noncanonical input mode, the special editing characters such as ERASE
  4293. and KILL are ignored. The system facilities for the user to edit input
  4294. are disabled in noncanonical mode, so that all input characters (unless
  4295. they are special for signal or flow-control purposes) are passed to the
  4296. application program exactly as typed. It is up to the application
  4297. program to give the user ways to edit the input, if appropriate.
  4298. Noncanonical mode offers special parameters called MIN and TIME for
  4299. controlling whether and how long to wait for input to be available. You
  4300. can even use them to avoid ever waiting—to return immediately with
  4301. whatever input is available, or with no input.
  4302. The MIN and TIME are stored in elements of the ‘c_cc’ array, which is
  4303. a member of the ‘struct termios’ structure. Each element of this array
  4304. has a particular role, and each element has a symbolic constant that
  4305. stands for the index of that element. ‘VMIN’ and ‘VTIME’ are the names
  4306. for the indices in the array of the MIN and TIME slots.
  4307. -- Macro: int VMIN
  4308. This is the subscript for the MIN slot in the ‘c_cc’ array. Thus,
  4309. ‘TERMIOS.c_cc[VMIN]’ is the value itself.
  4310. The MIN slot is only meaningful in noncanonical input mode; it
  4311. specifies the minimum number of bytes that must be available in the
  4312. input queue in order for ‘read’ to return.
  4313. -- Macro: int VTIME
  4314. This is the subscript for the TIME slot in the ‘c_cc’ array. Thus,
  4315. ‘TERMIOS.c_cc[VTIME]’ is the value itself.
  4316. The TIME slot is only meaningful in noncanonical input mode; it
  4317. specifies how long to wait for input before returning, in units of
  4318. 0.1 seconds.
  4319. The MIN and TIME values interact to determine the criterion for when
  4320. ‘read’ should return; their precise meanings depend on which of them are
  4321. nonzero. There are four possible cases:
  4322. • Both TIME and MIN are nonzero.
  4323. In this case, TIME specifies how long to wait after each input
  4324. character to see if more input arrives. After the first character
  4325. received, ‘read’ keeps waiting until either MIN bytes have arrived
  4326. in all, or TIME elapses with no further input.
  4327. ‘read’ always blocks until the first character arrives, even if
  4328. TIME elapses first. ‘read’ can return more than MIN characters if
  4329. more than MIN happen to be in the queue.
  4330. • Both MIN and TIME are zero.
  4331. In this case, ‘read’ always returns immediately with as many
  4332. characters as are available in the queue, up to the number
  4333. requested. If no input is immediately available, ‘read’ returns a
  4334. value of zero.
  4335. • MIN is zero but TIME has a nonzero value.
  4336. In this case, ‘read’ waits for time TIME for input to become
  4337. available; the availability of a single byte is enough to satisfy
  4338. the read request and cause ‘read’ to return. When it returns, it
  4339. returns as many characters as are available, up to the number
  4340. requested. If no input is available before the timer expires,
  4341. ‘read’ returns a value of zero.
  4342. • TIME is zero but MIN has a nonzero value.
  4343. In this case, ‘read’ waits until at least MIN bytes are available
  4344. in the queue. At that time, ‘read’ returns as many characters as
  4345. are available, up to the number requested. ‘read’ can return more
  4346. than MIN characters if more than MIN happen to be in the queue.
  4347. What happens if MIN is 50 and you ask to read just 10 bytes?
  4348. Normally, ‘read’ waits until there are 50 bytes in the buffer (or, more
  4349. generally, the wait condition described above is satisfied), and then
  4350. reads 10 of them, leaving the other 40 buffered in the operating system
  4351. for a subsequent call to ‘read’.
  4352. *Portability note:* On some systems, the MIN and TIME slots are
  4353. actually the same as the EOF and EOL slots. This causes no serious
  4354. problem because the MIN and TIME slots are used only in noncanonical
  4355. input and the EOF and EOL slots are used only in canonical input, but it
  4356. isn’t very clean. The GNU C Library allocates separate slots for these
  4357. uses.
  4358. -- Function: void cfmakeraw (struct termios *TERMIOS-P)
  4359. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4360. Concepts::.
  4361. This function provides an easy way to set up ‘*TERMIOS-P’ for what
  4362. has traditionally been called “raw mode” in BSD. This uses
  4363. noncanonical input, and turns off most processing to give an
  4364. unmodified channel to the terminal.
  4365. It does exactly this:
  4366. TERMIOS-P->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
  4367. |INLCR|IGNCR|ICRNL|IXON);
  4368. TERMIOS-P->c_oflag &= ~OPOST;
  4369. TERMIOS-P->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
  4370. TERMIOS-P->c_cflag &= ~(CSIZE|PARENB);
  4371. TERMIOS-P->c_cflag |= CS8;
  4372. 
  4373. File: libc.info, Node: BSD Terminal Modes, Next: Line Control, Prev: Terminal Modes, Up: Low-Level Terminal Interface
  4374. 17.5 BSD Terminal Modes
  4375. =======================
  4376. The usual way to get and set terminal modes is with the functions
  4377. described in *note Terminal Modes::. However, on some systems you can
  4378. use the BSD-derived functions in this section to do some of the same
  4379. things. On many systems, these functions do not exist. Even with the
  4380. GNU C Library, the functions simply fail with ‘errno’ = ‘ENOSYS’ with
  4381. many kernels, including Linux.
  4382. The symbols used in this section are declared in ‘sgtty.h’.
  4383. -- Data Type: struct sgttyb
  4384. This structure is an input or output parameter list for ‘gtty’ and
  4385. ‘stty’.
  4386. ‘char sg_ispeed’
  4387. Line speed for input
  4388. ‘char sg_ospeed’
  4389. Line speed for output
  4390. ‘char sg_erase’
  4391. Erase character
  4392. ‘char sg_kill’
  4393. Kill character
  4394. ‘int sg_flags’
  4395. Various flags
  4396. -- Function: int gtty (int FILEDES, struct sgttyb *ATTRIBUTES)
  4397. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4398. Concepts::.
  4399. This function gets the attributes of a terminal.
  4400. ‘gtty’ sets *ATTRIBUTES to describe the terminal attributes of the
  4401. terminal which is open with file descriptor FILEDES.
  4402. -- Function: int stty (int FILEDES, const struct sgttyb *ATTRIBUTES)
  4403. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4404. Concepts::.
  4405. This function sets the attributes of a terminal.
  4406. ‘stty’ sets the terminal attributes of the terminal which is open
  4407. with file descriptor FILEDES to those described by *ATTRIBUTES.
  4408. 
  4409. File: libc.info, Node: Line Control, Next: Noncanon Example, Prev: BSD Terminal Modes, Up: Low-Level Terminal Interface
  4410. 17.6 Line Control Functions
  4411. ===========================
  4412. These functions perform miscellaneous control actions on terminal
  4413. devices. As regards terminal access, they are treated like doing
  4414. output: if any of these functions is used by a background process on its
  4415. controlling terminal, normally all processes in the process group are
  4416. sent a ‘SIGTTOU’ signal. The exception is if the calling process itself
  4417. is ignoring or blocking ‘SIGTTOU’ signals, in which case the operation
  4418. is performed and no signal is sent. *Note Job Control::.
  4419. -- Function: int tcsendbreak (int FILEDES, int DURATION)
  4420. Preliminary: | MT-Unsafe race:tcattr(filedes)/bsd | AS-Unsafe |
  4421. AC-Unsafe corrupt/bsd | *Note POSIX Safety Concepts::.
  4422. This function generates a break condition by transmitting a stream
  4423. of zero bits on the terminal associated with the file descriptor
  4424. FILEDES. The duration of the break is controlled by the DURATION
  4425. argument. If zero, the duration is between 0.25 and 0.5 seconds.
  4426. The meaning of a nonzero value depends on the operating system.
  4427. This function does nothing if the terminal is not an asynchronous
  4428. serial data port.
  4429. The return value is normally zero. In the event of an error, a
  4430. value of -1 is returned. The following ‘errno’ error conditions
  4431. are defined for this function:
  4432. ‘EBADF’
  4433. The FILEDES is not a valid file descriptor.
  4434. ‘ENOTTY’
  4435. The FILEDES is not associated with a terminal device.
  4436. -- Function: int tcdrain (int FILEDES)
  4437. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4438. Concepts::.
  4439. The ‘tcdrain’ function waits until all queued output to the
  4440. terminal FILEDES has been transmitted.
  4441. This function is a cancellation point in multi-threaded programs.
  4442. This is a problem if the thread allocates some resources (like
  4443. memory, file descriptors, semaphores or whatever) at the time
  4444. ‘tcdrain’ is called. If the thread gets canceled these resources
  4445. stay allocated until the program ends. To avoid this calls to
  4446. ‘tcdrain’ should be protected using cancellation handlers.
  4447. The return value is normally zero. In the event of an error, a
  4448. value of -1 is returned. The following ‘errno’ error conditions
  4449. are defined for this function:
  4450. ‘EBADF’
  4451. The FILEDES is not a valid file descriptor.
  4452. ‘ENOTTY’
  4453. The FILEDES is not associated with a terminal device.
  4454. ‘EINTR’
  4455. The operation was interrupted by delivery of a signal. *Note
  4456. Interrupted Primitives::.
  4457. -- Function: int tcflush (int FILEDES, int QUEUE)
  4458. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4459. Concepts::.
  4460. The ‘tcflush’ function is used to clear the input and/or output
  4461. queues associated with the terminal file FILEDES. The QUEUE
  4462. argument specifies which queue(s) to clear, and can be one of the
  4463. following values:
  4464. ‘TCIFLUSH’
  4465. Clear any input data received, but not yet read.
  4466. ‘TCOFLUSH’
  4467. Clear any output data written, but not yet transmitted.
  4468. ‘TCIOFLUSH’
  4469. Clear both queued input and output.
  4470. The return value is normally zero. In the event of an error, a
  4471. value of -1 is returned. The following ‘errno’ error conditions
  4472. are defined for this function:
  4473. ‘EBADF’
  4474. The FILEDES is not a valid file descriptor.
  4475. ‘ENOTTY’
  4476. The FILEDES is not associated with a terminal device.
  4477. ‘EINVAL’
  4478. A bad value was supplied as the QUEUE argument.
  4479. It is unfortunate that this function is named ‘tcflush’, because
  4480. the term “flush” is normally used for quite another
  4481. operation—waiting until all output is transmitted—and using it for
  4482. discarding input or output would be confusing. Unfortunately, the
  4483. name ‘tcflush’ comes from POSIX and we cannot change it.
  4484. -- Function: int tcflow (int FILEDES, int ACTION)
  4485. Preliminary: | MT-Unsafe race:tcattr(filedes)/bsd | AS-Unsafe |
  4486. AC-Safe | *Note POSIX Safety Concepts::.
  4487. The ‘tcflow’ function is used to perform operations relating to
  4488. XON/XOFF flow control on the terminal file specified by FILEDES.
  4489. The ACTION argument specifies what operation to perform, and can be
  4490. one of the following values:
  4491. ‘TCOOFF’
  4492. Suspend transmission of output.
  4493. ‘TCOON’
  4494. Restart transmission of output.
  4495. ‘TCIOFF’
  4496. Transmit a STOP character.
  4497. ‘TCION’
  4498. Transmit a START character.
  4499. For more information about the STOP and START characters, see *note
  4500. Special Characters::.
  4501. The return value is normally zero. In the event of an error, a
  4502. value of -1 is returned. The following ‘errno’ error conditions
  4503. are defined for this function:
  4504. ‘EBADF’
  4505. The FILEDES is not a valid file descriptor.
  4506. ‘ENOTTY’
  4507. The FILEDES is not associated with a terminal device.
  4508. ‘EINVAL’
  4509. A bad value was supplied as the ACTION argument.
  4510. 
  4511. File: libc.info, Node: Noncanon Example, Next: Pseudo-Terminals, Prev: Line Control, Up: Low-Level Terminal Interface
  4512. 17.7 Noncanonical Mode Example
  4513. ==============================
  4514. Here is an example program that shows how you can set up a terminal
  4515. device to read single characters in noncanonical input mode, without
  4516. echo.
  4517. #include <unistd.h>
  4518. #include <stdio.h>
  4519. #include <stdlib.h>
  4520. #include <termios.h>
  4521. /* Use this variable to remember original terminal attributes. */
  4522. struct termios saved_attributes;
  4523. void
  4524. reset_input_mode (void)
  4525. {
  4526. tcsetattr (STDIN_FILENO, TCSANOW, &saved_attributes);
  4527. }
  4528. void
  4529. set_input_mode (void)
  4530. {
  4531. struct termios tattr;
  4532. char *name;
  4533. /* Make sure stdin is a terminal. */
  4534. if (!isatty (STDIN_FILENO))
  4535. {
  4536. fprintf (stderr, "Not a terminal.\n");
  4537. exit (EXIT_FAILURE);
  4538. }
  4539. /* Save the terminal attributes so we can restore them later. */
  4540. tcgetattr (STDIN_FILENO, &saved_attributes);
  4541. atexit (reset_input_mode);
  4542. /* Set the funny terminal modes. */
  4543. tcgetattr (STDIN_FILENO, &tattr);
  4544. tattr.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */
  4545. tattr.c_cc[VMIN] = 1;
  4546. tattr.c_cc[VTIME] = 0;
  4547. tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr);
  4548. }
  4549. int
  4550. main (void)
  4551. {
  4552. char c;
  4553. set_input_mode ();
  4554. while (1)
  4555. {
  4556. read (STDIN_FILENO, &c, 1);
  4557. if (c == '\004') /* ‘C-d’ */
  4558. break;
  4559. else
  4560. putchar (c);
  4561. }
  4562. return EXIT_SUCCESS;
  4563. }
  4564. This program is careful to restore the original terminal modes before
  4565. exiting or terminating with a signal. It uses the ‘atexit’ function
  4566. (*note Cleanups on Exit::) to make sure this is done by ‘exit’.
  4567. The shell is supposed to take care of resetting the terminal modes
  4568. when a process is stopped or continued; see *note Job Control::. But
  4569. some existing shells do not actually do this, so you may wish to
  4570. establish handlers for job control signals that reset terminal modes.
  4571. The above example does so.
  4572. 
  4573. File: libc.info, Node: Pseudo-Terminals, Prev: Noncanon Example, Up: Low-Level Terminal Interface
  4574. 17.8 Pseudo-Terminals
  4575. =====================
  4576. A "pseudo-terminal" is a special interprocess communication channel that
  4577. acts like a terminal. One end of the channel is called the "master"
  4578. side or "master pseudo-terminal device", the other side is called the
  4579. "slave" side. Data written to the master side is received by the slave
  4580. side as if it was the result of a user typing at an ordinary terminal,
  4581. and data written to the slave side is sent to the master side as if it
  4582. was written on an ordinary terminal.
  4583. Pseudo terminals are the way programs like ‘xterm’ and ‘emacs’
  4584. implement their terminal emulation functionality.
  4585. * Menu:
  4586. * Allocation:: Allocating a pseudo terminal.
  4587. * Pseudo-Terminal Pairs:: How to open both sides of a
  4588. pseudo-terminal in a single operation.
  4589. 
  4590. File: libc.info, Node: Allocation, Next: Pseudo-Terminal Pairs, Up: Pseudo-Terminals
  4591. 17.8.1 Allocating Pseudo-Terminals
  4592. ----------------------------------
  4593. This subsection describes functions for allocating a pseudo-terminal,
  4594. and for making this pseudo-terminal available for actual use. These
  4595. functions are declared in the header file ‘stdlib.h’.
  4596. -- Function: int getpt (void)
  4597. Preliminary: | MT-Safe | AS-Safe | AC-Safe fd | *Note POSIX Safety
  4598. Concepts::.
  4599. The ‘getpt’ function returns a new file descriptor for the next
  4600. available master pseudo-terminal. The normal return value from
  4601. ‘getpt’ is a non-negative integer file descriptor. In the case of
  4602. an error, a value of -1 is returned instead. The following ‘errno’
  4603. conditions are defined for this function:
  4604. ‘ENOENT’
  4605. There are no free master pseudo-terminals available.
  4606. This function is a GNU extension.
  4607. -- Function: int grantpt (int FILEDES)
  4608. Preliminary: | MT-Safe locale | AS-Unsafe dlopen plugin heap lock |
  4609. AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
  4610. The ‘grantpt’ function changes the ownership and access permission
  4611. of the slave pseudo-terminal device corresponding to the master
  4612. pseudo-terminal device associated with the file descriptor FILEDES.
  4613. The owner is set from the real user ID of the calling process
  4614. (*note Process Persona::), and the group is set to a special group
  4615. (typically "tty") or from the real group ID of the calling process.
  4616. The access permission is set such that the file is both readable
  4617. and writable by the owner and only writable by the group.
  4618. On some systems this function is implemented by invoking a special
  4619. ‘setuid’ root program (*note How Change Persona::). As a
  4620. consequence, installing a signal handler for the ‘SIGCHLD’ signal
  4621. (*note Job Control Signals::) may interfere with a call to
  4622. ‘grantpt’.
  4623. The normal return value from ‘grantpt’ is 0; a value of -1 is
  4624. returned in case of failure. The following ‘errno’ error
  4625. conditions are defined for this function:
  4626. ‘EBADF’
  4627. The FILEDES argument is not a valid file descriptor.
  4628. ‘EINVAL’
  4629. The FILEDES argument is not associated with a master
  4630. pseudo-terminal device.
  4631. ‘EACCES’
  4632. The slave pseudo-terminal device corresponding to the master
  4633. associated with FILEDES could not be accessed.
  4634. -- Function: int unlockpt (int FILEDES)
  4635. Preliminary: | MT-Safe | AS-Unsafe heap/bsd | AC-Unsafe mem fd |
  4636. *Note POSIX Safety Concepts::.
  4637. The ‘unlockpt’ function unlocks the slave pseudo-terminal device
  4638. corresponding to the master pseudo-terminal device associated with
  4639. the file descriptor FILEDES. On many systems, the slave can only
  4640. be opened after unlocking, so portable applications should always
  4641. call ‘unlockpt’ before trying to open the slave.
  4642. The normal return value from ‘unlockpt’ is 0; a value of -1 is
  4643. returned in case of failure. The following ‘errno’ error
  4644. conditions are defined for this function:
  4645. ‘EBADF’
  4646. The FILEDES argument is not a valid file descriptor.
  4647. ‘EINVAL’
  4648. The FILEDES argument is not associated with a master
  4649. pseudo-terminal device.
  4650. -- Function: char * ptsname (int FILEDES)
  4651. Preliminary: | MT-Unsafe race:ptsname | AS-Unsafe heap/bsd |
  4652. AC-Unsafe mem fd | *Note POSIX Safety Concepts::.
  4653. If the file descriptor FILEDES is associated with a master
  4654. pseudo-terminal device, the ‘ptsname’ function returns a pointer to
  4655. a statically-allocated, null-terminated string containing the file
  4656. name of the associated slave pseudo-terminal file. This string
  4657. might be overwritten by subsequent calls to ‘ptsname’.
  4658. -- Function: int ptsname_r (int FILEDES, char *BUF, size_t LEN)
  4659. Preliminary: | MT-Safe | AS-Unsafe heap/bsd | AC-Unsafe mem fd |
  4660. *Note POSIX Safety Concepts::.
  4661. The ‘ptsname_r’ function is similar to the ‘ptsname’ function
  4662. except that it places its result into the user-specified buffer
  4663. starting at BUF with length LEN.
  4664. This function is a GNU extension.
  4665. *Portability Note:* On System V derived systems, the file returned by
  4666. the ‘ptsname’ and ‘ptsname_r’ functions may be STREAMS-based, and
  4667. therefore require additional processing after opening before it actually
  4668. behaves as a pseudo terminal.
  4669. Typical usage of these functions is illustrated by the following
  4670. example:
  4671. int
  4672. open_pty_pair (int *amaster, int *aslave)
  4673. {
  4674. int master, slave;
  4675. char *name;
  4676. master = getpt ();
  4677. if (master < 0)
  4678. return 0;
  4679. if (grantpt (master) < 0 || unlockpt (master) < 0)
  4680. goto close_master;
  4681. name = ptsname (master);
  4682. if (name == NULL)
  4683. goto close_master;
  4684. slave = open (name, O_RDWR);
  4685. if (slave == -1)
  4686. goto close_master;
  4687. if (isastream (slave))
  4688. {
  4689. if (ioctl (slave, I_PUSH, "ptem") < 0
  4690. || ioctl (slave, I_PUSH, "ldterm") < 0)
  4691. goto close_slave;
  4692. }
  4693. *amaster = master;
  4694. *aslave = slave;
  4695. return 1;
  4696. close_slave:
  4697. close (slave);
  4698. close_master:
  4699. close (master);
  4700. return 0;
  4701. }
  4702. 
  4703. File: libc.info, Node: Pseudo-Terminal Pairs, Prev: Allocation, Up: Pseudo-Terminals
  4704. 17.8.2 Opening a Pseudo-Terminal Pair
  4705. -------------------------------------
  4706. These functions, derived from BSD, are available in the separate
  4707. ‘libutil’ library, and declared in ‘pty.h’.
  4708. -- Function: int openpty (int *AMASTER, int *ASLAVE, char *NAME, const
  4709. struct termios *TERMP, const struct winsize *WINP)
  4710. Preliminary: | MT-Safe locale | AS-Unsafe dlopen plugin heap lock |
  4711. AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
  4712. This function allocates and opens a pseudo-terminal pair, returning
  4713. the file descriptor for the master in *AMASTER, and the file
  4714. descriptor for the slave in *ASLAVE. If the argument NAME is not a
  4715. null pointer, the file name of the slave pseudo-terminal device is
  4716. stored in ‘*name’. If TERMP is not a null pointer, the terminal
  4717. attributes of the slave are set to the ones specified in the
  4718. structure that TERMP points to (*note Terminal Modes::). Likewise,
  4719. if WINP is not a null pointer, the screen size of the slave is set
  4720. to the values specified in the structure that WINP points to.
  4721. The normal return value from ‘openpty’ is 0; a value of -1 is
  4722. returned in case of failure. The following ‘errno’ conditions are
  4723. defined for this function:
  4724. ‘ENOENT’
  4725. There are no free pseudo-terminal pairs available.
  4726. *Warning:* Using the ‘openpty’ function with NAME not set to ‘NULL’
  4727. is *very dangerous* because it provides no protection against
  4728. overflowing the string NAME. You should use the ‘ttyname’ function
  4729. on the file descriptor returned in *SLAVE to find out the file name
  4730. of the slave pseudo-terminal device instead.
  4731. -- Function: int forkpty (int *AMASTER, char *NAME, const struct
  4732. termios *TERMP, const struct winsize *WINP)
  4733. Preliminary: | MT-Safe locale | AS-Unsafe dlopen plugin heap lock |
  4734. AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
  4735. This function is similar to the ‘openpty’ function, but in
  4736. addition, forks a new process (*note Creating a Process::) and
  4737. makes the newly opened slave pseudo-terminal device the controlling
  4738. terminal (*note Controlling Terminal::) for the child process.
  4739. If the operation is successful, there are then both parent and
  4740. child processes and both see ‘forkpty’ return, but with different
  4741. values: it returns a value of 0 in the child process and returns
  4742. the child’s process ID in the parent process.
  4743. If the allocation of a pseudo-terminal pair or the process creation
  4744. failed, ‘forkpty’ returns a value of -1 in the parent process.
  4745. *Warning:* The ‘forkpty’ function has the same problems with
  4746. respect to the NAME argument as ‘openpty’.
  4747. 
  4748. File: libc.info, Node: Syslog, Next: Mathematics, Prev: Low-Level Terminal Interface, Up: Top
  4749. 18 Syslog
  4750. *********
  4751. This chapter describes facilities for issuing and logging messages of
  4752. system administration interest. This chapter has nothing to do with
  4753. programs issuing messages to their own users or keeping private logs
  4754. (One would typically do that with the facilities described in *note I/O
  4755. on Streams::).
  4756. Most systems have a facility called “Syslog” that allows programs to
  4757. submit messages of interest to system administrators and can be
  4758. configured to pass these messages on in various ways, such as printing
  4759. on the console, mailing to a particular person, or recording in a log
  4760. file for future reference.
  4761. A program uses the facilities in this chapter to submit such
  4762. messages.
  4763. * Menu:
  4764. * Overview of Syslog:: Overview of a system’s Syslog facility
  4765. * Submitting Syslog Messages:: Functions to submit messages to Syslog
  4766. 
  4767. File: libc.info, Node: Overview of Syslog, Next: Submitting Syslog Messages, Up: Syslog
  4768. 18.1 Overview of Syslog
  4769. =======================
  4770. System administrators have to deal with lots of different kinds of
  4771. messages from a plethora of subsystems within each system, and usually
  4772. lots of systems as well. For example, an FTP server might report every
  4773. connection it gets. The kernel might report hardware failures on a disk
  4774. drive. A DNS server might report usage statistics at regular intervals.
  4775. Some of these messages need to be brought to a system administrator’s
  4776. attention immediately. And it may not be just any system administrator
  4777. – there may be a particular system administrator who deals with a
  4778. particular kind of message. Other messages just need to be recorded for
  4779. future reference if there is a problem. Still others may need to have
  4780. information extracted from them by an automated process that generates
  4781. monthly reports.
  4782. To deal with these messages, most Unix systems have a facility called
  4783. "Syslog." It is generally based on a daemon called “Syslogd” Syslogd
  4784. listens for messages on a Unix domain socket named ‘/dev/log’. Based on
  4785. classification information in the messages and its configuration file
  4786. (usually ‘/etc/syslog.conf’), Syslogd routes them in various ways. Some
  4787. of the popular routings are:
  4788. • Write to the system console
  4789. • Mail to a specific user
  4790. • Write to a log file
  4791. • Pass to another daemon
  4792. • Discard
  4793. Syslogd can also handle messages from other systems. It listens on
  4794. the ‘syslog’ UDP port as well as the local socket for messages.
  4795. Syslog can handle messages from the kernel itself. But the kernel
  4796. doesn’t write to ‘/dev/log’; rather, another daemon (sometimes called
  4797. “Klogd”) extracts messages from the kernel and passes them on to Syslog
  4798. as any other process would (and it properly identifies them as messages
  4799. from the kernel).
  4800. Syslog can even handle messages that the kernel issued before Syslogd
  4801. or Klogd was running. A Linux kernel, for example, stores startup
  4802. messages in a kernel message ring and they are normally still there when
  4803. Klogd later starts up. Assuming Syslogd is running by the time Klogd
  4804. starts, Klogd then passes everything in the message ring to it.
  4805. In order to classify messages for disposition, Syslog requires any
  4806. process that submits a message to it to provide two pieces of
  4807. classification information with it:
  4808. facility
  4809. This identifies who submitted the message. There are a small
  4810. number of facilities defined. The kernel, the mail subsystem, and
  4811. an FTP server are examples of recognized facilities. For the
  4812. complete list, *Note syslog; vsyslog::. Keep in mind that these
  4813. are essentially arbitrary classifications. "Mail subsystem"
  4814. doesn’t have any more meaning than the system administrator gives
  4815. to it.
  4816. priority
  4817. This tells how important the content of the message is. Examples
  4818. of defined priority values are: debug, informational, warning and
  4819. critical. For the complete list, see *note syslog; vsyslog::.
  4820. Except for the fact that the priorities have a defined order, the
  4821. meaning of each of these priorities is entirely determined by the
  4822. system administrator.
  4823. A “facility/priority” is a number that indicates both the facility
  4824. and the priority.
  4825. *Warning:* This terminology is not universal. Some people use
  4826. “level” to refer to the priority and “priority” to refer to the
  4827. combination of facility and priority. A Linux kernel has a concept of a
  4828. message “level,” which corresponds both to a Syslog priority and to a
  4829. Syslog facility/priority (It can be both because the facility code for
  4830. the kernel is zero, and that makes priority and facility/priority the
  4831. same value).
  4832. The GNU C Library provides functions to submit messages to Syslog.
  4833. They do it by writing to the ‘/dev/log’ socket. *Note Submitting Syslog
  4834. Messages::.
  4835. The GNU C Library functions only work to submit messages to the
  4836. Syslog facility on the same system. To submit a message to the Syslog
  4837. facility on another system, use the socket I/O functions to write a UDP
  4838. datagram to the ‘syslog’ UDP port on that system. *Note Sockets::.
  4839. 
  4840. File: libc.info, Node: Submitting Syslog Messages, Prev: Overview of Syslog, Up: Syslog
  4841. 18.2 Submitting Syslog Messages
  4842. ===============================
  4843. The GNU C Library provides functions to submit messages to the Syslog
  4844. facility:
  4845. * Menu:
  4846. * openlog:: Open connection to Syslog
  4847. * syslog; vsyslog:: Submit message to Syslog
  4848. * closelog:: Close connection to Syslog
  4849. * setlogmask:: Cause certain messages to be ignored
  4850. * Syslog Example:: Example of all of the above
  4851. These functions only work to submit messages to the Syslog facility
  4852. on the same system. To submit a message to the Syslog facility on
  4853. another system, use the socket I/O functions to write a UDP datagram to
  4854. the ‘syslog’ UDP port on that system. *Note Sockets::.
  4855. 
  4856. File: libc.info, Node: openlog, Next: syslog; vsyslog, Up: Submitting Syslog Messages
  4857. 18.2.1 openlog
  4858. --------------
  4859. The symbols referred to in this section are declared in the file
  4860. ‘syslog.h’.
  4861. -- Function: void openlog (const char *IDENT, int OPTION, int FACILITY)
  4862. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock fd | *Note
  4863. POSIX Safety Concepts::.
  4864. ‘openlog’ opens or reopens a connection to Syslog in preparation
  4865. for submitting messages.
  4866. IDENT is an arbitrary identification string which future ‘syslog’
  4867. invocations will prefix to each message. This is intended to
  4868. identify the source of the message, and people conventionally set
  4869. it to the name of the program that will submit the messages.
  4870. If IDENT is NULL, or if ‘openlog’ is not called, the default
  4871. identification string used in Syslog messages will be the program
  4872. name, taken from argv[0].
  4873. Please note that the string pointer IDENT will be retained
  4874. internally by the Syslog routines. You must not free the memory
  4875. that IDENT points to. It is also dangerous to pass a reference to
  4876. an automatic variable since leaving the scope would mean ending the
  4877. lifetime of the variable. If you want to change the IDENT string,
  4878. you must call ‘openlog’ again; overwriting the string pointed to by
  4879. IDENT is not thread-safe.
  4880. You can cause the Syslog routines to drop the reference to IDENT
  4881. and go back to the default string (the program name taken from
  4882. argv[0]), by calling ‘closelog’: *Note closelog::.
  4883. In particular, if you are writing code for a shared library that
  4884. might get loaded and then unloaded (e.g. a PAM module), and you
  4885. use ‘openlog’, you must call ‘closelog’ before any point where your
  4886. library might get unloaded, as in this example:
  4887. #include <syslog.h>
  4888. void
  4889. shared_library_function (void)
  4890. {
  4891. openlog ("mylibrary", option, priority);
  4892. syslog (LOG_INFO, "shared library has been invoked");
  4893. closelog ();
  4894. }
  4895. Without the call to ‘closelog’, future invocations of ‘syslog’ by
  4896. the program using the shared library may crash, if the library gets
  4897. unloaded and the memory containing the string ‘"mylibrary"’ becomes
  4898. unmapped. This is a limitation of the BSD syslog interface.
  4899. ‘openlog’ may or may not open the ‘/dev/log’ socket, depending on
  4900. OPTION. If it does, it tries to open it and connect it as a stream
  4901. socket. If that doesn’t work, it tries to open it and connect it
  4902. as a datagram socket. The socket has the “Close on Exec”
  4903. attribute, so the kernel will close it if the process performs an
  4904. exec.
  4905. You don’t have to use ‘openlog’. If you call ‘syslog’ without
  4906. having called ‘openlog’, ‘syslog’ just opens the connection
  4907. implicitly and uses defaults for the information in IDENT and
  4908. OPTIONS.
  4909. OPTIONS is a bit string, with the bits as defined by the following
  4910. single bit masks:
  4911. ‘LOG_PERROR’
  4912. If on, ‘openlog’ sets up the connection so that any ‘syslog’
  4913. on this connection writes its message to the calling process’
  4914. Standard Error stream in addition to submitting it to Syslog.
  4915. If off, ‘syslog’ does not write the message to Standard Error.
  4916. ‘LOG_CONS’
  4917. If on, ‘openlog’ sets up the connection so that a ‘syslog’ on
  4918. this connection that fails to submit a message to Syslog
  4919. writes the message instead to system console. If off,
  4920. ‘syslog’ does not write to the system console (but of course
  4921. Syslog may write messages it receives to the console).
  4922. ‘LOG_PID’
  4923. When on, ‘openlog’ sets up the connection so that a ‘syslog’
  4924. on this connection inserts the calling process’ Process ID
  4925. (PID) into the message. When off, ‘openlog’ does not insert
  4926. the PID.
  4927. ‘LOG_NDELAY’
  4928. When on, ‘openlog’ opens and connects the ‘/dev/log’ socket.
  4929. When off, a future ‘syslog’ call must open and connect the
  4930. socket.
  4931. *Portability note:* In early systems, the sense of this bit
  4932. was exactly the opposite.
  4933. ‘LOG_ODELAY’
  4934. This bit does nothing. It exists for backward compatibility.
  4935. If any other bit in OPTIONS is on, the result is undefined.
  4936. FACILITY is the default facility code for this connection. A
  4937. ‘syslog’ on this connection that specifies default facility causes
  4938. this facility to be associated with the message. See ‘syslog’ for
  4939. possible values. A value of zero means the default, which is
  4940. ‘LOG_USER’.
  4941. If a Syslog connection is already open when you call ‘openlog’,
  4942. ‘openlog’ “reopens” the connection. Reopening is like opening
  4943. except that if you specify zero for the default facility code, the
  4944. default facility code simply remains unchanged and if you specify
  4945. LOG_NDELAY and the socket is already open and connected, ‘openlog’
  4946. just leaves it that way.
  4947. 
  4948. File: libc.info, Node: syslog; vsyslog, Next: closelog, Prev: openlog, Up: Submitting Syslog Messages
  4949. 18.2.2 syslog, vsyslog
  4950. ----------------------
  4951. The symbols referred to in this section are declared in the file
  4952. ‘syslog.h’.
  4953. -- Function: void syslog (int FACILITY_PRIORITY, const char *FORMAT, …)
  4954. Preliminary: | MT-Safe env locale | AS-Unsafe corrupt heap lock
  4955. dlopen | AC-Unsafe corrupt lock mem fd | *Note POSIX Safety
  4956. Concepts::.
  4957. ‘syslog’ submits a message to the Syslog facility. It does this by
  4958. writing to the Unix domain socket ‘/dev/log’.
  4959. ‘syslog’ submits the message with the facility and priority
  4960. indicated by FACILITY_PRIORITY. The macro ‘LOG_MAKEPRI’ generates
  4961. a facility/priority from a facility and a priority, as in the
  4962. following example:
  4963. LOG_MAKEPRI(LOG_USER, LOG_WARNING)
  4964. The possible values for the facility code are (macros):
  4965. ‘LOG_USER’
  4966. A miscellaneous user process
  4967. ‘LOG_MAIL’
  4968. Mail
  4969. ‘LOG_DAEMON’
  4970. A miscellaneous system daemon
  4971. ‘LOG_AUTH’
  4972. Security (authorization)
  4973. ‘LOG_SYSLOG’
  4974. Syslog
  4975. ‘LOG_LPR’
  4976. Central printer
  4977. ‘LOG_NEWS’
  4978. Network news (e.g. Usenet)
  4979. ‘LOG_UUCP’
  4980. UUCP
  4981. ‘LOG_CRON’
  4982. Cron and At
  4983. ‘LOG_AUTHPRIV’
  4984. Private security (authorization)
  4985. ‘LOG_FTP’
  4986. Ftp server
  4987. ‘LOG_LOCAL0’
  4988. Locally defined
  4989. ‘LOG_LOCAL1’
  4990. Locally defined
  4991. ‘LOG_LOCAL2’
  4992. Locally defined
  4993. ‘LOG_LOCAL3’
  4994. Locally defined
  4995. ‘LOG_LOCAL4’
  4996. Locally defined
  4997. ‘LOG_LOCAL5’
  4998. Locally defined
  4999. ‘LOG_LOCAL6’
  5000. Locally defined
  5001. ‘LOG_LOCAL7’
  5002. Locally defined
  5003. Results are undefined if the facility code is anything else.
  5004. *NB:* ‘syslog’ recognizes one other facility code: that of the
  5005. kernel. But you can’t specify that facility code with these
  5006. functions. If you try, it looks the same to ‘syslog’ as if you are
  5007. requesting the default facility. But you wouldn’t want to anyway,
  5008. because any program that uses the GNU C Library is not the kernel.
  5009. You can use just a priority code as FACILITY_PRIORITY. In that
  5010. case, ‘syslog’ assumes the default facility established when the
  5011. Syslog connection was opened. *Note Syslog Example::.
  5012. The possible values for the priority code are (macros):
  5013. ‘LOG_EMERG’
  5014. The message says the system is unusable.
  5015. ‘LOG_ALERT’
  5016. Action on the message must be taken immediately.
  5017. ‘LOG_CRIT’
  5018. The message states a critical condition.
  5019. ‘LOG_ERR’
  5020. The message describes an error.
  5021. ‘LOG_WARNING’
  5022. The message is a warning.
  5023. ‘LOG_NOTICE’
  5024. The message describes a normal but important event.
  5025. ‘LOG_INFO’
  5026. The message is purely informational.
  5027. ‘LOG_DEBUG’
  5028. The message is only for debugging purposes.
  5029. Results are undefined if the priority code is anything else.
  5030. If the process does not presently have a Syslog connection open
  5031. (i.e., it did not call ‘openlog’), ‘syslog’ implicitly opens the
  5032. connection the same as ‘openlog’ would, with the following defaults
  5033. for information that would otherwise be included in an ‘openlog’
  5034. call: The default identification string is the program name. The
  5035. default default facility is ‘LOG_USER’. The default for all the
  5036. connection options in OPTIONS is as if those bits were off.
  5037. ‘syslog’ leaves the Syslog connection open.
  5038. If the ‘/dev/log’ socket is not open and connected, ‘syslog’ opens
  5039. and connects it, the same as ‘openlog’ with the ‘LOG_NDELAY’ option
  5040. would.
  5041. ‘syslog’ leaves ‘/dev/log’ open and connected unless its attempt to
  5042. send the message failed, in which case ‘syslog’ closes it (with the
  5043. hope that a future implicit open will restore the Syslog connection
  5044. to a usable state).
  5045. Example:
  5046. #include <syslog.h>
  5047. syslog (LOG_MAKEPRI(LOG_LOCAL1, LOG_ERROR),
  5048. "Unable to make network connection to %s. Error=%m", host);
  5049. -- Function: void vsyslog (int FACILITY_PRIORITY, const char *FORMAT,
  5050. va_list ARGLIST)
  5051. Preliminary: | MT-Safe env locale | AS-Unsafe corrupt heap lock
  5052. dlopen | AC-Unsafe corrupt lock mem fd | *Note POSIX Safety
  5053. Concepts::.
  5054. This is functionally identical to ‘syslog’, with the BSD style
  5055. variable length argument.
  5056. 
  5057. File: libc.info, Node: closelog, Next: setlogmask, Prev: syslog; vsyslog, Up: Submitting Syslog Messages
  5058. 18.2.3 closelog
  5059. ---------------
  5060. The symbols referred to in this section are declared in the file
  5061. ‘syslog.h’.
  5062. -- Function: void closelog (void)
  5063. Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock fd | *Note
  5064. POSIX Safety Concepts::.
  5065. ‘closelog’ closes the current Syslog connection, if there is one.
  5066. This includes closing the ‘/dev/log’ socket, if it is open.
  5067. ‘closelog’ also sets the identification string for Syslog messages
  5068. back to the default, if ‘openlog’ was called with a non-NULL
  5069. argument to IDENT. The default identification string is the
  5070. program name taken from argv[0].
  5071. If you are writing shared library code that uses ‘openlog’ to
  5072. generate custom syslog output, you should use ‘closelog’ to drop
  5073. the GNU C Library’s internal reference to the IDENT pointer when
  5074. you are done. Please read the section on ‘openlog’ for more
  5075. information: *Note openlog::.
  5076. ‘closelog’ does not flush any buffers. You do not have to call
  5077. ‘closelog’ before re-opening a Syslog connection with ‘openlog’.
  5078. Syslog connections are automatically closed on exec or exit.
  5079. 
  5080. File: libc.info, Node: setlogmask, Next: Syslog Example, Prev: closelog, Up: Submitting Syslog Messages
  5081. 18.2.4 setlogmask
  5082. -----------------
  5083. The symbols referred to in this section are declared in the file
  5084. ‘syslog.h’.
  5085. -- Function: int setlogmask (int MASK)
  5086. Preliminary: | MT-Unsafe race:LogMask | AS-Unsafe | AC-Safe | *Note
  5087. POSIX Safety Concepts::.
  5088. ‘setlogmask’ sets a mask (the “logmask”) that determines which
  5089. future ‘syslog’ calls shall be ignored. If a program has not
  5090. called ‘setlogmask’, ‘syslog’ doesn’t ignore any calls. You can
  5091. use ‘setlogmask’ to specify that messages of particular priorities
  5092. shall be ignored in the future.
  5093. A ‘setlogmask’ call overrides any previous ‘setlogmask’ call.
  5094. Note that the logmask exists entirely independently of opening and
  5095. closing of Syslog connections.
  5096. Setting the logmask has a similar effect to, but is not the same
  5097. as, configuring Syslog. The Syslog configuration may cause Syslog
  5098. to discard certain messages it receives, but the logmask causes
  5099. certain messages never to get submitted to Syslog in the first
  5100. place.
  5101. MASK is a bit string with one bit corresponding to each of the
  5102. possible message priorities. If the bit is on, ‘syslog’ handles
  5103. messages of that priority normally. If it is off, ‘syslog’
  5104. discards messages of that priority. Use the message priority
  5105. macros described in *note syslog; vsyslog:: and the ‘LOG_MASK’ to
  5106. construct an appropriate MASK value, as in this example:
  5107. LOG_MASK(LOG_EMERG) | LOG_MASK(LOG_ERROR)
  5108. or
  5109. ~(LOG_MASK(LOG_INFO))
  5110. There is also a ‘LOG_UPTO’ macro, which generates a mask with the
  5111. bits on for a certain priority and all priorities above it:
  5112. LOG_UPTO(LOG_ERROR)
  5113. The unfortunate naming of the macro is due to the fact that
  5114. internally, higher numbers are used for lower message priorities.
  5115. 
  5116. File: libc.info, Node: Syslog Example, Prev: setlogmask, Up: Submitting Syslog Messages
  5117. 18.2.5 Syslog Example
  5118. ---------------------
  5119. Here is an example of ‘openlog’, ‘syslog’, and ‘closelog’:
  5120. This example sets the logmask so that debug and informational
  5121. messages get discarded without ever reaching Syslog. So the second
  5122. ‘syslog’ in the example does nothing.
  5123. #include <syslog.h>
  5124. setlogmask (LOG_UPTO (LOG_NOTICE));
  5125. openlog ("exampleprog", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
  5126. syslog (LOG_NOTICE, "Program started by User %d", getuid ());
  5127. syslog (LOG_INFO, "A tree falls in a forest");
  5128. closelog ();
  5129. 
  5130. File: libc.info, Node: Mathematics, Next: Arithmetic, Prev: Syslog, Up: Top
  5131. 19 Mathematics
  5132. **************
  5133. This chapter contains information about functions for performing
  5134. mathematical computations, such as trigonometric functions. Most of
  5135. these functions have prototypes declared in the header file ‘math.h’.
  5136. The complex-valued functions are defined in ‘complex.h’.
  5137. All mathematical functions which take a floating-point argument have
  5138. three variants, one each for ‘double’, ‘float’, and ‘long double’
  5139. arguments. The ‘double’ versions are mostly defined in ISO C89. The
  5140. ‘float’ and ‘long double’ versions are from the numeric extensions to C
  5141. included in ISO C99.
  5142. Which of the three versions of a function should be used depends on
  5143. the situation. For most calculations, the ‘float’ functions are the
  5144. fastest. On the other hand, the ‘long double’ functions have the
  5145. highest precision. ‘double’ is somewhere in between. It is usually
  5146. wise to pick the narrowest type that can accommodate your data. Not all
  5147. machines have a distinct ‘long double’ type; it may be the same as
  5148. ‘double’.
  5149. * Menu:
  5150. * Mathematical Constants:: Precise numeric values for often-used
  5151. constants.
  5152. * Trig Functions:: Sine, cosine, tangent, and friends.
  5153. * Inverse Trig Functions:: Arcsine, arccosine, etc.
  5154. * Exponents and Logarithms:: Also pow and sqrt.
  5155. * Hyperbolic Functions:: sinh, cosh, tanh, etc.
  5156. * Special Functions:: Bessel, gamma, erf.
  5157. * Errors in Math Functions:: Known Maximum Errors in Math Functions.
  5158. * Pseudo-Random Numbers:: Functions for generating pseudo-random
  5159. numbers.
  5160. * FP Function Optimizations:: Fast code or small code.
  5161. 
  5162. File: libc.info, Node: Mathematical Constants, Next: Trig Functions, Up: Mathematics
  5163. 19.1 Predefined Mathematical Constants
  5164. ======================================
  5165. The header ‘math.h’ defines several useful mathematical constants. All
  5166. values are defined as preprocessor macros starting with ‘M_’. The
  5167. values provided are:
  5168. ‘M_E’
  5169. The base of natural logarithms.
  5170. ‘M_LOG2E’
  5171. The logarithm to base ‘2’ of ‘M_E’.
  5172. ‘M_LOG10E’
  5173. The logarithm to base ‘10’ of ‘M_E’.
  5174. ‘M_LN2’
  5175. The natural logarithm of ‘2’.
  5176. ‘M_LN10’
  5177. The natural logarithm of ‘10’.
  5178. ‘M_PI’
  5179. Pi, the ratio of a circle’s circumference to its diameter.
  5180. ‘M_PI_2’
  5181. Pi divided by two.
  5182. ‘M_PI_4’
  5183. Pi divided by four.
  5184. ‘M_1_PI’
  5185. The reciprocal of pi (1/pi)
  5186. ‘M_2_PI’
  5187. Two times the reciprocal of pi.
  5188. ‘M_2_SQRTPI’
  5189. Two times the reciprocal of the square root of pi.
  5190. ‘M_SQRT2’
  5191. The square root of two.
  5192. ‘M_SQRT1_2’
  5193. The reciprocal of the square root of two (also the square root of
  5194. 1/2).
  5195. These constants come from the Unix98 standard and were also available
  5196. in 4.4BSD; therefore they are only defined if ‘_XOPEN_SOURCE=500’, or a
  5197. more general feature select macro, is defined. The default set of
  5198. features includes these constants. *Note Feature Test Macros::.
  5199. All values are of type ‘double’. As an extension, the GNU C Library
  5200. also defines these constants with type ‘long double’. The ‘long double’
  5201. macros have a lowercase ‘l’ appended to their names: ‘M_El’, ‘M_PIl’,
  5202. and so forth. These are only available if ‘_GNU_SOURCE’ is defined.
  5203. _Note:_ Some programs use a constant named ‘PI’ which has the same
  5204. value as ‘M_PI’. This constant is not standard; it may have appeared in
  5205. some old AT&T headers, and is mentioned in Stroustrup’s book on C++. It
  5206. infringes on the user’s name space, so the GNU C Library does not define
  5207. it. Fixing programs written to expect it is simple: replace ‘PI’ with
  5208. ‘M_PI’ throughout, or put ‘-DPI=M_PI’ on the compiler command line.
  5209. 
  5210. File: libc.info, Node: Trig Functions, Next: Inverse Trig Functions, Prev: Mathematical Constants, Up: Mathematics
  5211. 19.2 Trigonometric Functions
  5212. ============================
  5213. These are the familiar ‘sin’, ‘cos’, and ‘tan’ functions. The arguments
  5214. to all of these functions are in units of radians; recall that pi
  5215. radians equals 180 degrees.
  5216. The math library normally defines ‘M_PI’ to a ‘double’ approximation
  5217. of pi. If strict ISO and/or POSIX compliance are requested this
  5218. constant is not defined, but you can easily define it yourself:
  5219. #define M_PI 3.14159265358979323846264338327
  5220. You can also compute the value of pi with the expression ‘acos (-1.0)’.
  5221. -- Function: double sin (double X)
  5222. -- Function: float sinf (float X)
  5223. -- Function: long double sinl (long double X)
  5224. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5225. Concepts::.
  5226. These functions return the sine of X, where X is given in radians.
  5227. The return value is in the range ‘-1’ to ‘1’.
  5228. -- Function: double cos (double X)
  5229. -- Function: float cosf (float X)
  5230. -- Function: long double cosl (long double X)
  5231. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5232. Concepts::.
  5233. These functions return the cosine of X, where X is given in
  5234. radians. The return value is in the range ‘-1’ to ‘1’.
  5235. -- Function: double tan (double X)
  5236. -- Function: float tanf (float X)
  5237. -- Function: long double tanl (long double X)
  5238. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5239. Concepts::.
  5240. These functions return the tangent of X, where X is given in
  5241. radians.
  5242. Mathematically, the tangent function has singularities at odd
  5243. multiples of pi/2. If the argument X is too close to one of these
  5244. singularities, ‘tan’ will signal overflow.
  5245. In many applications where ‘sin’ and ‘cos’ are used, the sine and
  5246. cosine of the same angle are needed at the same time. It is more
  5247. efficient to compute them simultaneously, so the library provides a
  5248. function to do that.
  5249. -- Function: void sincos (double X, double *SINX, double *COSX)
  5250. -- Function: void sincosf (float X, float *SINX, float *COSX)
  5251. -- Function: void sincosl (long double X, long double *SINX, long
  5252. double *COSX)
  5253. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5254. Concepts::.
  5255. These functions return the sine of X in ‘*SINX’ and the cosine of X
  5256. in ‘*COSX’, where X is given in radians. Both values, ‘*SINX’ and
  5257. ‘*COSX’, are in the range of ‘-1’ to ‘1’.
  5258. This function is a GNU extension. Portable programs should be
  5259. prepared to cope with its absence.
  5260. ISO C99 defines variants of the trig functions which work on complex
  5261. numbers. The GNU C Library provides these functions, but they are only
  5262. useful if your compiler supports the new complex types defined by the
  5263. standard. (As of this writing GCC supports complex numbers, but there
  5264. are bugs in the implementation.)
  5265. -- Function: complex double csin (complex double Z)
  5266. -- Function: complex float csinf (complex float Z)
  5267. -- Function: complex long double csinl (complex long double Z)
  5268. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5269. Concepts::.
  5270. These functions return the complex sine of Z. The mathematical
  5271. definition of the complex sine is
  5272. sin (z) = 1/(2*i) * (exp (z*i) - exp (-z*i)).
  5273. -- Function: complex double ccos (complex double Z)
  5274. -- Function: complex float ccosf (complex float Z)
  5275. -- Function: complex long double ccosl (complex long double Z)
  5276. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5277. Concepts::.
  5278. These functions return the complex cosine of Z. The mathematical
  5279. definition of the complex cosine is
  5280. cos (z) = 1/2 * (exp (z*i) + exp (-z*i))
  5281. -- Function: complex double ctan (complex double Z)
  5282. -- Function: complex float ctanf (complex float Z)
  5283. -- Function: complex long double ctanl (complex long double Z)
  5284. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5285. Concepts::.
  5286. These functions return the complex tangent of Z. The mathematical
  5287. definition of the complex tangent is
  5288. tan (z) = -i * (exp (z*i) - exp (-z*i)) / (exp (z*i) + exp (-z*i))
  5289. The complex tangent has poles at pi/2 + 2n, where n is an integer.
  5290. ‘ctan’ may signal overflow if Z is too close to a pole.
  5291. 
  5292. File: libc.info, Node: Inverse Trig Functions, Next: Exponents and Logarithms, Prev: Trig Functions, Up: Mathematics
  5293. 19.3 Inverse Trigonometric Functions
  5294. ====================================
  5295. These are the usual arcsine, arccosine and arctangent functions, which
  5296. are the inverses of the sine, cosine and tangent functions respectively.
  5297. -- Function: double asin (double X)
  5298. -- Function: float asinf (float X)
  5299. -- Function: long double asinl (long double X)
  5300. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5301. Concepts::.
  5302. These functions compute the arcsine of X—that is, the value whose
  5303. sine is X. The value is in units of radians. Mathematically,
  5304. there are infinitely many such values; the one actually returned is
  5305. the one between ‘-pi/2’ and ‘pi/2’ (inclusive).
  5306. The arcsine function is defined mathematically only over the domain
  5307. ‘-1’ to ‘1’. If X is outside the domain, ‘asin’ signals a domain
  5308. error.
  5309. -- Function: double acos (double X)
  5310. -- Function: float acosf (float X)
  5311. -- Function: long double acosl (long double X)
  5312. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5313. Concepts::.
  5314. These functions compute the arccosine of X—that is, the value whose
  5315. cosine is X. The value is in units of radians. Mathematically,
  5316. there are infinitely many such values; the one actually returned is
  5317. the one between ‘0’ and ‘pi’ (inclusive).
  5318. The arccosine function is defined mathematically only over the
  5319. domain ‘-1’ to ‘1’. If X is outside the domain, ‘acos’ signals a
  5320. domain error.
  5321. -- Function: double atan (double X)
  5322. -- Function: float atanf (float X)
  5323. -- Function: long double atanl (long double X)
  5324. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5325. Concepts::.
  5326. These functions compute the arctangent of X—that is, the value
  5327. whose tangent is X. The value is in units of radians.
  5328. Mathematically, there are infinitely many such values; the one
  5329. actually returned is the one between ‘-pi/2’ and ‘pi/2’
  5330. (inclusive).
  5331. -- Function: double atan2 (double Y, double X)
  5332. -- Function: float atan2f (float Y, float X)
  5333. -- Function: long double atan2l (long double Y, long double X)
  5334. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5335. Concepts::.
  5336. This function computes the arctangent of Y/X, but the signs of both
  5337. arguments are used to determine the quadrant of the result, and X
  5338. is permitted to be zero. The return value is given in radians and
  5339. is in the range ‘-pi’ to ‘pi’, inclusive.
  5340. If X and Y are coordinates of a point in the plane, ‘atan2’ returns
  5341. the signed angle between the line from the origin to that point and
  5342. the x-axis. Thus, ‘atan2’ is useful for converting Cartesian
  5343. coordinates to polar coordinates. (To compute the radial
  5344. coordinate, use ‘hypot’; see *note Exponents and Logarithms::.)
  5345. If both X and Y are zero, ‘atan2’ returns zero.
  5346. ISO C99 defines complex versions of the inverse trig functions.
  5347. -- Function: complex double casin (complex double Z)
  5348. -- Function: complex float casinf (complex float Z)
  5349. -- Function: complex long double casinl (complex long double Z)
  5350. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5351. Concepts::.
  5352. These functions compute the complex arcsine of Z—that is, the value
  5353. whose sine is Z. The value returned is in radians.
  5354. Unlike the real-valued functions, ‘casin’ is defined for all values
  5355. of Z.
  5356. -- Function: complex double cacos (complex double Z)
  5357. -- Function: complex float cacosf (complex float Z)
  5358. -- Function: complex long double cacosl (complex long double Z)
  5359. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5360. Concepts::.
  5361. These functions compute the complex arccosine of Z—that is, the
  5362. value whose cosine is Z. The value returned is in radians.
  5363. Unlike the real-valued functions, ‘cacos’ is defined for all values
  5364. of Z.
  5365. -- Function: complex double catan (complex double Z)
  5366. -- Function: complex float catanf (complex float Z)
  5367. -- Function: complex long double catanl (complex long double Z)
  5368. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5369. Concepts::.
  5370. These functions compute the complex arctangent of Z—that is, the
  5371. value whose tangent is Z. The value is in units of radians.
  5372. 
  5373. File: libc.info, Node: Exponents and Logarithms, Next: Hyperbolic Functions, Prev: Inverse Trig Functions, Up: Mathematics
  5374. 19.4 Exponentiation and Logarithms
  5375. ==================================
  5376. -- Function: double exp (double X)
  5377. -- Function: float expf (float X)
  5378. -- Function: long double expl (long double X)
  5379. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5380. Concepts::.
  5381. These functions compute ‘e’ (the base of natural logarithms) raised
  5382. to the power X.
  5383. If the magnitude of the result is too large to be representable,
  5384. ‘exp’ signals overflow.
  5385. -- Function: double exp2 (double X)
  5386. -- Function: float exp2f (float X)
  5387. -- Function: long double exp2l (long double X)
  5388. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5389. Concepts::.
  5390. These functions compute ‘2’ raised to the power X. Mathematically,
  5391. ‘exp2 (x)’ is the same as ‘exp (x * log (2))’.
  5392. -- Function: double exp10 (double X)
  5393. -- Function: float exp10f (float X)
  5394. -- Function: long double exp10l (long double X)
  5395. -- Function: double pow10 (double X)
  5396. -- Function: float pow10f (float X)
  5397. -- Function: long double pow10l (long double X)
  5398. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5399. Concepts::.
  5400. These functions compute ‘10’ raised to the power X.
  5401. Mathematically, ‘exp10 (x)’ is the same as ‘exp (x * log (10))’.
  5402. The ‘exp10’ functions are from TS 18661-4:2015; the ‘pow10’ names
  5403. are GNU extensions. The name ‘exp10’ is preferred, since it is
  5404. analogous to ‘exp’ and ‘exp2’.
  5405. -- Function: double log (double X)
  5406. -- Function: float logf (float X)
  5407. -- Function: long double logl (long double X)
  5408. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5409. Concepts::.
  5410. These functions compute the natural logarithm of X. ‘exp (log
  5411. (X))’ equals X, exactly in mathematics and approximately in C.
  5412. If X is negative, ‘log’ signals a domain error. If X is zero, it
  5413. returns negative infinity; if X is too close to zero, it may signal
  5414. overflow.
  5415. -- Function: double log10 (double X)
  5416. -- Function: float log10f (float X)
  5417. -- Function: long double log10l (long double X)
  5418. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5419. Concepts::.
  5420. These functions return the base-10 logarithm of X. ‘log10 (X)’
  5421. equals ‘log (X) / log (10)’.
  5422. -- Function: double log2 (double X)
  5423. -- Function: float log2f (float X)
  5424. -- Function: long double log2l (long double X)
  5425. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5426. Concepts::.
  5427. These functions return the base-2 logarithm of X. ‘log2 (X)’
  5428. equals ‘log (X) / log (2)’.
  5429. -- Function: double logb (double X)
  5430. -- Function: float logbf (float X)
  5431. -- Function: long double logbl (long double X)
  5432. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5433. Concepts::.
  5434. These functions extract the exponent of X and return it as a
  5435. floating-point value. If ‘FLT_RADIX’ is two, ‘logb’ is equal to
  5436. ‘floor (log2 (x))’, except it’s probably faster.
  5437. If X is de-normalized, ‘logb’ returns the exponent X would have if
  5438. it were normalized. If X is infinity (positive or negative),
  5439. ‘logb’ returns oo. If X is zero, ‘logb’ returns oo. It does not
  5440. signal.
  5441. -- Function: int ilogb (double X)
  5442. -- Function: int ilogbf (float X)
  5443. -- Function: int ilogbl (long double X)
  5444. -- Function: long int llogb (double X)
  5445. -- Function: long int llogbf (float X)
  5446. -- Function: long int llogbl (long double X)
  5447. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5448. Concepts::.
  5449. These functions are equivalent to the corresponding ‘logb’
  5450. functions except that they return signed integer values. The
  5451. ‘ilogb’ functions are from ISO C99; the ‘llogb’ functions are from
  5452. TS 18661-1:2014.
  5453. Since integers cannot represent infinity and NaN, ‘ilogb’ instead
  5454. returns an integer that can’t be the exponent of a normal floating-point
  5455. number. ‘math.h’ defines constants so you can check for this.
  5456. -- Macro: int FP_ILOGB0
  5457. ‘ilogb’ returns this value if its argument is ‘0’. The numeric
  5458. value is either ‘INT_MIN’ or ‘-INT_MAX’.
  5459. This macro is defined in ISO C99.
  5460. -- Macro: long int FP_LLOGB0
  5461. ‘llogb’ returns this value if its argument is ‘0’. The numeric
  5462. value is either ‘LONG_MIN’ or ‘-LONG_MAX’.
  5463. This macro is defined in TS 18661-1:2014.
  5464. -- Macro: int FP_ILOGBNAN
  5465. ‘ilogb’ returns this value if its argument is ‘NaN’. The numeric
  5466. value is either ‘INT_MIN’ or ‘INT_MAX’.
  5467. This macro is defined in ISO C99.
  5468. -- Macro: long int FP_LLOGBNAN
  5469. ‘llogb’ returns this value if its argument is ‘NaN’. The numeric
  5470. value is either ‘LONG_MIN’ or ‘LONG_MAX’.
  5471. This macro is defined in TS 18661-1:2014.
  5472. These values are system specific. They might even be the same. The
  5473. proper way to test the result of ‘ilogb’ is as follows:
  5474. i = ilogb (f);
  5475. if (i == FP_ILOGB0 || i == FP_ILOGBNAN)
  5476. {
  5477. if (isnan (f))
  5478. {
  5479. /* Handle NaN. */
  5480. }
  5481. else if (f == 0.0)
  5482. {
  5483. /* Handle 0.0. */
  5484. }
  5485. else
  5486. {
  5487. /* Some other value with large exponent,
  5488. perhaps +Inf. */
  5489. }
  5490. }
  5491. -- Function: double pow (double BASE, double POWER)
  5492. -- Function: float powf (float BASE, float POWER)
  5493. -- Function: long double powl (long double BASE, long double POWER)
  5494. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5495. Concepts::.
  5496. These are general exponentiation functions, returning BASE raised
  5497. to POWER.
  5498. Mathematically, ‘pow’ would return a complex number when BASE is
  5499. negative and POWER is not an integral value. ‘pow’ can’t do that,
  5500. so instead it signals a domain error. ‘pow’ may also underflow or
  5501. overflow the destination type.
  5502. -- Function: double sqrt (double X)
  5503. -- Function: float sqrtf (float X)
  5504. -- Function: long double sqrtl (long double X)
  5505. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5506. Concepts::.
  5507. These functions return the nonnegative square root of X.
  5508. If X is negative, ‘sqrt’ signals a domain error. Mathematically,
  5509. it should return a complex number.
  5510. -- Function: double cbrt (double X)
  5511. -- Function: float cbrtf (float X)
  5512. -- Function: long double cbrtl (long double X)
  5513. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5514. Concepts::.
  5515. These functions return the cube root of X. They cannot fail; every
  5516. representable real value has a representable real cube root.
  5517. -- Function: double hypot (double X, double Y)
  5518. -- Function: float hypotf (float X, float Y)
  5519. -- Function: long double hypotl (long double X, long double Y)
  5520. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5521. Concepts::.
  5522. These functions return ‘sqrt (X*X + Y*Y)’. This is the length of
  5523. the hypotenuse of a right triangle with sides of length X and Y, or
  5524. the distance of the point (X, Y) from the origin. Using this
  5525. function instead of the direct formula is wise, since the error is
  5526. much smaller. See also the function ‘cabs’ in *note Absolute
  5527. Value::.
  5528. -- Function: double expm1 (double X)
  5529. -- Function: float expm1f (float X)
  5530. -- Function: long double expm1l (long double X)
  5531. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5532. Concepts::.
  5533. These functions return a value equivalent to ‘exp (X) - 1’. They
  5534. are computed in a way that is accurate even if X is near zero—a
  5535. case where ‘exp (X) - 1’ would be inaccurate owing to subtraction
  5536. of two numbers that are nearly equal.
  5537. -- Function: double log1p (double X)
  5538. -- Function: float log1pf (float X)
  5539. -- Function: long double log1pl (long double X)
  5540. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5541. Concepts::.
  5542. These functions return a value equivalent to ‘log (1 + X)’. They
  5543. are computed in a way that is accurate even if X is near zero.
  5544. ISO C99 defines complex variants of some of the exponentiation and
  5545. logarithm functions.
  5546. -- Function: complex double cexp (complex double Z)
  5547. -- Function: complex float cexpf (complex float Z)
  5548. -- Function: complex long double cexpl (complex long double Z)
  5549. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5550. Concepts::.
  5551. These functions return ‘e’ (the base of natural logarithms) raised
  5552. to the power of Z. Mathematically, this corresponds to the value
  5553. exp (z) = exp (creal (z)) * (cos (cimag (z)) + I * sin (cimag (z)))
  5554. -- Function: complex double clog (complex double Z)
  5555. -- Function: complex float clogf (complex float Z)
  5556. -- Function: complex long double clogl (complex long double Z)
  5557. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5558. Concepts::.
  5559. These functions return the natural logarithm of Z. Mathematically,
  5560. this corresponds to the value
  5561. log (z) = log (cabs (z)) + I * carg (z)
  5562. ‘clog’ has a pole at 0, and will signal overflow if Z equals or is
  5563. very close to 0. It is well-defined for all other values of Z.
  5564. -- Function: complex double clog10 (complex double Z)
  5565. -- Function: complex float clog10f (complex float Z)
  5566. -- Function: complex long double clog10l (complex long double Z)
  5567. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5568. Concepts::.
  5569. These functions return the base 10 logarithm of the complex value
  5570. Z. Mathematically, this corresponds to the value
  5571. log10 (z) = log10 (cabs (z)) + I * carg (z) / log (10)
  5572. These functions are GNU extensions.
  5573. -- Function: complex double csqrt (complex double Z)
  5574. -- Function: complex float csqrtf (complex float Z)
  5575. -- Function: complex long double csqrtl (complex long double Z)
  5576. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5577. Concepts::.
  5578. These functions return the complex square root of the argument Z.
  5579. Unlike the real-valued functions, they are defined for all values
  5580. of Z.
  5581. -- Function: complex double cpow (complex double BASE, complex double
  5582. POWER)
  5583. -- Function: complex float cpowf (complex float BASE, complex float
  5584. POWER)
  5585. -- Function: complex long double cpowl (complex long double BASE,
  5586. complex long double POWER)
  5587. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5588. Concepts::.
  5589. These functions return BASE raised to the power of POWER. This is
  5590. equivalent to ‘cexp (y * clog (x))’
  5591. 
  5592. File: libc.info, Node: Hyperbolic Functions, Next: Special Functions, Prev: Exponents and Logarithms, Up: Mathematics
  5593. 19.5 Hyperbolic Functions
  5594. =========================
  5595. The functions in this section are related to the exponential functions;
  5596. see *note Exponents and Logarithms::.
  5597. -- Function: double sinh (double X)
  5598. -- Function: float sinhf (float X)
  5599. -- Function: long double sinhl (long double X)
  5600. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5601. Concepts::.
  5602. These functions return the hyperbolic sine of X, defined
  5603. mathematically as ‘(exp (X) - exp (-X)) / 2’. They may signal
  5604. overflow if X is too large.
  5605. -- Function: double cosh (double X)
  5606. -- Function: float coshf (float X)
  5607. -- Function: long double coshl (long double X)
  5608. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5609. Concepts::.
  5610. These functions return the hyperbolic cosine of X, defined
  5611. mathematically as ‘(exp (X) + exp (-X)) / 2’. They may signal
  5612. overflow if X is too large.
  5613. -- Function: double tanh (double X)
  5614. -- Function: float tanhf (float X)
  5615. -- Function: long double tanhl (long double X)
  5616. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5617. Concepts::.
  5618. These functions return the hyperbolic tangent of X, defined
  5619. mathematically as ‘sinh (X) / cosh (X)’. They may signal overflow
  5620. if X is too large.
  5621. There are counterparts for the hyperbolic functions which take
  5622. complex arguments.
  5623. -- Function: complex double csinh (complex double Z)
  5624. -- Function: complex float csinhf (complex float Z)
  5625. -- Function: complex long double csinhl (complex long double Z)
  5626. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5627. Concepts::.
  5628. These functions return the complex hyperbolic sine of Z, defined
  5629. mathematically as ‘(exp (Z) - exp (-Z)) / 2’.
  5630. -- Function: complex double ccosh (complex double Z)
  5631. -- Function: complex float ccoshf (complex float Z)
  5632. -- Function: complex long double ccoshl (complex long double Z)
  5633. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5634. Concepts::.
  5635. These functions return the complex hyperbolic cosine of Z, defined
  5636. mathematically as ‘(exp (Z) + exp (-Z)) / 2’.
  5637. -- Function: complex double ctanh (complex double Z)
  5638. -- Function: complex float ctanhf (complex float Z)
  5639. -- Function: complex long double ctanhl (complex long double Z)
  5640. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5641. Concepts::.
  5642. These functions return the complex hyperbolic tangent of Z, defined
  5643. mathematically as ‘csinh (Z) / ccosh (Z)’.
  5644. -- Function: double asinh (double X)
  5645. -- Function: float asinhf (float X)
  5646. -- Function: long double asinhl (long double X)
  5647. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5648. Concepts::.
  5649. These functions return the inverse hyperbolic sine of X—the value
  5650. whose hyperbolic sine is X.
  5651. -- Function: double acosh (double X)
  5652. -- Function: float acoshf (float X)
  5653. -- Function: long double acoshl (long double X)
  5654. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5655. Concepts::.
  5656. These functions return the inverse hyperbolic cosine of X—the value
  5657. whose hyperbolic cosine is X. If X is less than ‘1’, ‘acosh’
  5658. signals a domain error.
  5659. -- Function: double atanh (double X)
  5660. -- Function: float atanhf (float X)
  5661. -- Function: long double atanhl (long double X)
  5662. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5663. Concepts::.
  5664. These functions return the inverse hyperbolic tangent of X—the
  5665. value whose hyperbolic tangent is X. If the absolute value of X is
  5666. greater than ‘1’, ‘atanh’ signals a domain error; if it is equal to
  5667. 1, ‘atanh’ returns infinity.
  5668. -- Function: complex double casinh (complex double Z)
  5669. -- Function: complex float casinhf (complex float Z)
  5670. -- Function: complex long double casinhl (complex long double Z)
  5671. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5672. Concepts::.
  5673. These functions return the inverse complex hyperbolic sine of Z—the
  5674. value whose complex hyperbolic sine is Z.
  5675. -- Function: complex double cacosh (complex double Z)
  5676. -- Function: complex float cacoshf (complex float Z)
  5677. -- Function: complex long double cacoshl (complex long double Z)
  5678. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5679. Concepts::.
  5680. These functions return the inverse complex hyperbolic cosine of
  5681. Z—the value whose complex hyperbolic cosine is Z. Unlike the
  5682. real-valued functions, there are no restrictions on the value of Z.
  5683. -- Function: complex double catanh (complex double Z)
  5684. -- Function: complex float catanhf (complex float Z)
  5685. -- Function: complex long double catanhl (complex long double Z)
  5686. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5687. Concepts::.
  5688. These functions return the inverse complex hyperbolic tangent of
  5689. Z—the value whose complex hyperbolic tangent is Z. Unlike the
  5690. real-valued functions, there are no restrictions on the value of Z.
  5691. 
  5692. File: libc.info, Node: Special Functions, Next: Errors in Math Functions, Prev: Hyperbolic Functions, Up: Mathematics
  5693. 19.6 Special Functions
  5694. ======================
  5695. These are some more exotic mathematical functions which are sometimes
  5696. useful. Currently they only have real-valued versions.
  5697. -- Function: double erf (double X)
  5698. -- Function: float erff (float X)
  5699. -- Function: long double erfl (long double X)
  5700. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5701. Concepts::.
  5702. ‘erf’ returns the error function of X. The error function is
  5703. defined as
  5704. erf (x) = 2/sqrt(pi) * integral from 0 to x of exp(-t^2) dt
  5705. -- Function: double erfc (double X)
  5706. -- Function: float erfcf (float X)
  5707. -- Function: long double erfcl (long double X)
  5708. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5709. Concepts::.
  5710. ‘erfc’ returns ‘1.0 - erf(X)’, but computed in a fashion that
  5711. avoids round-off error when X is large.
  5712. -- Function: double lgamma (double X)
  5713. -- Function: float lgammaf (float X)
  5714. -- Function: long double lgammal (long double X)
  5715. Preliminary: | MT-Unsafe race:signgam | AS-Unsafe | AC-Safe | *Note
  5716. POSIX Safety Concepts::.
  5717. ‘lgamma’ returns the natural logarithm of the absolute value of the
  5718. gamma function of X. The gamma function is defined as
  5719. gamma (x) = integral from 0 to oo of t^(x-1) e^-t dt
  5720. The sign of the gamma function is stored in the global variable
  5721. SIGNGAM, which is declared in ‘math.h’. It is ‘1’ if the
  5722. intermediate result was positive or zero, or ‘-1’ if it was
  5723. negative.
  5724. To compute the real gamma function you can use the ‘tgamma’
  5725. function or you can compute the values as follows:
  5726. lgam = lgamma(x);
  5727. gam = signgam*exp(lgam);
  5728. The gamma function has singularities at the non-positive integers.
  5729. ‘lgamma’ will raise the zero divide exception if evaluated at a
  5730. singularity.
  5731. -- Function: double lgamma_r (double X, int *SIGNP)
  5732. -- Function: float lgammaf_r (float X, int *SIGNP)
  5733. -- Function: long double lgammal_r (long double X, int *SIGNP)
  5734. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5735. Concepts::.
  5736. ‘lgamma_r’ is just like ‘lgamma’, but it stores the sign of the
  5737. intermediate result in the variable pointed to by SIGNP instead of
  5738. in the SIGNGAM global. This means it is reentrant.
  5739. -- Function: double gamma (double X)
  5740. -- Function: float gammaf (float X)
  5741. -- Function: long double gammal (long double X)
  5742. Preliminary: | MT-Unsafe race:signgam | AS-Unsafe | AC-Safe | *Note
  5743. POSIX Safety Concepts::.
  5744. These functions exist for compatibility reasons. They are
  5745. equivalent to ‘lgamma’ etc. It is better to use ‘lgamma’ since for
  5746. one the name reflects better the actual computation, and moreover
  5747. ‘lgamma’ is standardized in ISO C99 while ‘gamma’ is not.
  5748. -- Function: double tgamma (double X)
  5749. -- Function: float tgammaf (float X)
  5750. -- Function: long double tgammal (long double X)
  5751. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5752. Concepts::.
  5753. ‘tgamma’ applies the gamma function to X. The gamma function is
  5754. defined as
  5755. gamma (x) = integral from 0 to oo of t^(x-1) e^-t dt
  5756. This function was introduced in ISO C99.
  5757. -- Function: double j0 (double X)
  5758. -- Function: float j0f (float X)
  5759. -- Function: long double j0l (long double X)
  5760. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5761. Concepts::.
  5762. ‘j0’ returns the Bessel function of the first kind of order 0 of X.
  5763. It may signal underflow if X is too large.
  5764. -- Function: double j1 (double X)
  5765. -- Function: float j1f (float X)
  5766. -- Function: long double j1l (long double X)
  5767. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5768. Concepts::.
  5769. ‘j1’ returns the Bessel function of the first kind of order 1 of X.
  5770. It may signal underflow if X is too large.
  5771. -- Function: double jn (int N, double X)
  5772. -- Function: float jnf (int N, float X)
  5773. -- Function: long double jnl (int N, long double X)
  5774. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5775. Concepts::.
  5776. ‘jn’ returns the Bessel function of the first kind of order N of X.
  5777. It may signal underflow if X is too large.
  5778. -- Function: double y0 (double X)
  5779. -- Function: float y0f (float X)
  5780. -- Function: long double y0l (long double X)
  5781. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5782. Concepts::.
  5783. ‘y0’ returns the Bessel function of the second kind of order 0 of
  5784. X. It may signal underflow if X is too large. If X is negative,
  5785. ‘y0’ signals a domain error; if it is zero, ‘y0’ signals overflow
  5786. and returns -oo.
  5787. -- Function: double y1 (double X)
  5788. -- Function: float y1f (float X)
  5789. -- Function: long double y1l (long double X)
  5790. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5791. Concepts::.
  5792. ‘y1’ returns the Bessel function of the second kind of order 1 of
  5793. X. It may signal underflow if X is too large. If X is negative,
  5794. ‘y1’ signals a domain error; if it is zero, ‘y1’ signals overflow
  5795. and returns -oo.
  5796. -- Function: double yn (int N, double X)
  5797. -- Function: float ynf (int N, float X)
  5798. -- Function: long double ynl (int N, long double X)
  5799. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  5800. Concepts::.
  5801. ‘yn’ returns the Bessel function of the second kind of order N of
  5802. X. It may signal underflow if X is too large. If X is negative,
  5803. ‘yn’ signals a domain error; if it is zero, ‘yn’ signals overflow
  5804. and returns -oo.
  5805. 
  5806. File: libc.info, Node: Errors in Math Functions, Next: Pseudo-Random Numbers, Prev: Special Functions, Up: Mathematics
  5807. 19.7 Known Maximum Errors in Math Functions
  5808. ===========================================
  5809. This section lists the known errors of the functions in the math
  5810. library. Errors are measured in “units of the last place”. This is a
  5811. measure for the relative error. For a number z with the representation
  5812. d.d…d*2^e (we assume IEEE floating-point numbers with base 2) the ULP is
  5813. represented by
  5814. |d.d...d - (z / 2^e)| / 2^(p - 1)
  5815. where p is the number of bits in the mantissa of the floating-point
  5816. number representation. Ideally the error for all functions is always
  5817. less than 0.5ulps in round-to-nearest mode. Using rounding bits this is
  5818. also possible and normally implemented for the basic operations. Except
  5819. for certain functions such as ‘sqrt’, ‘fma’ and ‘rint’ whose results are
  5820. fully specified by reference to corresponding IEEE 754 floating-point
  5821. operations, and conversions between strings and floating point, the GNU
  5822. C Library does not aim for correctly rounded results for functions in
  5823. the math library, and does not aim for correctness in whether “inexact”
  5824. exceptions are raised. Instead, the goals for accuracy of functions
  5825. without fully specified results are as follows; some functions have bugs
  5826. meaning they do not meet these goals in all cases. In the future, the
  5827. GNU C Library may provide some other correctly rounding functions under
  5828. the names such as ‘crsin’ proposed for an extension to ISO C.
  5829. • Each function with a floating-point result behaves as if it
  5830. computes an infinite-precision result that is within a few ulp (in
  5831. both real and complex parts, for functions with complex results) of
  5832. the mathematically correct value of the function (interpreted
  5833. together with ISO C or POSIX semantics for the function in
  5834. question) at the exact value passed as the input. Exceptions are
  5835. raised appropriately for this value and in accordance with IEEE 754
  5836. / ISO C / POSIX semantics, and it is then rounded according to the
  5837. current rounding direction to the result that is returned to the
  5838. user. ‘errno’ may also be set (*note Math Error Reporting::).
  5839. (The “inexact” exception may be raised, or not raised, even if this
  5840. is inconsistent with the infinite-precision value.)
  5841. • For the IBM ‘long double’ format, as used on PowerPC GNU/Linux, the
  5842. accuracy goal is weaker for input values not exactly representable
  5843. in 106 bits of precision; it is as if the input value is some value
  5844. within 0.5ulp of the value actually passed, where “ulp” is
  5845. interpreted in terms of a fixed-precision 106-bit mantissa, but not
  5846. necessarily the exact value actually passed with discontiguous
  5847. mantissa bits.
  5848. • For the IBM ‘long double’ format, functions whose results are fully
  5849. specified by reference to corresponding IEEE 754 floating-point
  5850. operations have the same accuracy goals as other functions, but
  5851. with the error bound being the same as that for division (3ulp).
  5852. Furthermore, “inexact” and “underflow” exceptions may be raised for
  5853. all functions for any inputs, even where such exceptions are
  5854. inconsistent with the returned value, since the underlying
  5855. floating-point arithmetic has that property.
  5856. • Functions behave as if the infinite-precision result computed is
  5857. zero, infinity or NaN if and only if that is the mathematically
  5858. correct infinite-precision result. They behave as if the
  5859. infinite-precision result computed always has the same sign as the
  5860. mathematically correct result.
  5861. • If the mathematical result is more than a few ulp above the
  5862. overflow threshold for the current rounding direction, the value
  5863. returned is the appropriate overflow value for the current rounding
  5864. direction, with the overflow exception raised.
  5865. • If the mathematical result has magnitude well below half the least
  5866. subnormal magnitude, the returned value is either zero or the least
  5867. subnormal (in each case, with the correct sign), according to the
  5868. current rounding direction and with the underflow exception raised.
  5869. • Where the mathematical result underflows (before rounding) and is
  5870. not exactly representable as a floating-point value, the function
  5871. does not behave as if the computed infinite-precision result is an
  5872. exact value in the subnormal range. This means that the underflow
  5873. exception is raised other than possibly for cases where the
  5874. mathematical result is very close to the underflow threshold and
  5875. the function behaves as if it computes an infinite-precision result
  5876. that does not underflow. (So there may be spurious underflow
  5877. exceptions in cases where the underflowing result is exact, but not
  5878. missing underflow exceptions in cases where it is inexact.)
  5879. • The GNU C Library does not aim for functions to satisfy other
  5880. properties of the underlying mathematical function, such as
  5881. monotonicity, where not implied by the above goals.
  5882. • All the above applies to both real and complex parts, for complex
  5883. functions.
  5884. Therefore many of the functions in the math library have errors. The
  5885. table lists the maximum error for each function which is exposed by one
  5886. of the existing tests in the test suite. The table tries to cover as
  5887. much as possible and list the actual maximum error (or at least a
  5888. ballpark figure) but this is often not achieved due to the large search
  5889. space.
  5890. The table lists the ULP values for different architectures.
  5891. Different architectures have different results since their hardware
  5892. support for floating-point operations varies and also the existing
  5893. hardware support is different.
  5894. Function AArch64 ARM Alpha ColdFire Generic
  5895. acosf 1 1 1 - -
  5896. acos - - - - -
  5897. acosl 1 - 1 - -
  5898. acoshf 2 2 2 - -
  5899. acosh 2 2 2 - -
  5900. acoshl 2 - 2 - -
  5901. asinf 1 1 1 - -
  5902. asin - - - - -
  5903. asinl 1 - 1 - -
  5904. asinhf 1 1 1 - -
  5905. asinh 1 1 1 - -
  5906. asinhl 3 - 3 - -
  5907. atanf 1 1 1 - -
  5908. atan 1 - - - -
  5909. atanl 1 - 1 - -
  5910. atanhf 2 2 2 1 -
  5911. atanh 2 2 2 - -
  5912. atanhl 3 - 3 - -
  5913. atan2f 1 1 1 1 -
  5914. atan2 - - - - -
  5915. atan2l 1 - 1 - -
  5916. cabsf - - - - -
  5917. cabs 1 1 1 - -
  5918. cabsl 1 - 1 - -
  5919. cacosf 2 + i 2 2 + i 2 2 + i 2 - -
  5920. cacos 1 + i 1 1 + i 1 1 + i 1 - -
  5921. cacosl 2 + i 2 - 2 + i 2 - -
  5922. cacoshf 2 + i 2 2 + i 2 2 + i 2 0 + i 1 -
  5923. cacosh 1 + i 1 1 + i 1 1 + i 1 - -
  5924. cacoshl 2 + i 2 - 2 + i 2 - -
  5925. cargf 1 1 1 - -
  5926. carg 1 - - - -
  5927. cargl 2 - 2 - -
  5928. casinf 1 + i 2 1 + i 2 1 + i 2 1 + i 0 -
  5929. casin 1 + i 1 1 + i 1 1 + i 1 1 + i 0 -
  5930. casinl 2 + i 2 - 2 + i 2 - -
  5931. casinhf 2 + i 1 2 + i 1 2 + i 1 1 + i 6 -
  5932. casinh 1 + i 1 1 + i 1 1 + i 1 5 + i 3 -
  5933. casinhl 2 + i 2 - 2 + i 2 - -
  5934. catanf 1 + i 1 1 + i 1 1 + i 1 0 + i 1 -
  5935. catan 0 + i 1 0 + i 1 0 + i 1 0 + i 1 -
  5936. catanl 1 + i 1 - 1 + i 1 - -
  5937. catanhf 1 + i 1 1 + i 1 1 + i 1 - -
  5938. catanh 1 + i 0 1 + i 0 1 + i 0 4 + i 0 -
  5939. catanhl 1 + i 1 - 1 + i 1 - -
  5940. cbrtf 1 1 1 - -
  5941. cbrt 3 3 3 1 -
  5942. cbrtl 1 - 1 - -
  5943. ccosf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 -
  5944. ccos 1 + i 1 1 + i 1 1 + i 1 1 + i 0 -
  5945. ccosl 1 + i 1 - 1 + i 1 - -
  5946. ccoshf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 -
  5947. ccosh 1 + i 1 1 + i 1 1 + i 1 1 + i 0 -
  5948. ccoshl 1 + i 1 - 1 + i 1 - -
  5949. ceilf - - - - -
  5950. ceil - - - - -
  5951. ceill - - - - -
  5952. cexpf 1 + i 2 1 + i 2 1 + i 2 1 + i 1 -
  5953. cexp 2 + i 1 2 + i 1 2 + i 1 - -
  5954. cexpl 1 + i 1 - 1 + i 1 - -
  5955. cimagf - - - - -
  5956. cimag - - - - -
  5957. cimagl - - - - -
  5958. clogf 3 + i 1 3 + i 1 3 + i 1 1 + i 0 -
  5959. clog 3 + i 1 3 + i 0 3 + i 0 - -
  5960. clogl 2 + i 1 - 2 + i 1 - -
  5961. clog10f 4 + i 2 4 + i 2 4 + i 2 1 + i 1 -
  5962. clog10 3 + i 2 3 + i 2 3 + i 2 0 + i 1 -
  5963. clog10l 2 + i 2 - 2 + i 2 - -
  5964. conjf - - - - -
  5965. conj - - - - -
  5966. conjl - - - - -
  5967. copysignf - - - - -
  5968. copysign - - - - -
  5969. copysignl - - - - -
  5970. cosf 1 1 1 1 -
  5971. cos - - - 2 -
  5972. cosl 1 - 1 - -
  5973. coshf 1 1 1 - -
  5974. cosh 1 1 1 - -
  5975. coshl 1 - 1 - -
  5976. cpowf 5 + i 2 4 + i 2 4 + i 2 4 + i 2 -
  5977. cpow 2 + i 0 2 + i 0 2 + i 0 2 + i 2 -
  5978. cpowl 4 + i 1 - 4 + i 1 - -
  5979. cprojf - - - - -
  5980. cproj - - - - -
  5981. cprojl - - - - -
  5982. crealf - - - - -
  5983. creal - - - - -
  5984. creall - - - - -
  5985. csinf 1 + i 0 1 + i 0 1 + i 0 - -
  5986. csin 1 + i 0 1 + i 0 1 + i 0 - -
  5987. csinl 1 + i 1 - 1 + i 1 - -
  5988. csinhf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 -
  5989. csinh 0 + i 1 0 + i 1 0 + i 1 0 + i 1 -
  5990. csinhl 1 + i 1 - 1 + i 1 - -
  5991. csqrtf 2 + i 2 2 + i 2 2 + i 2 1 + i 0 -
  5992. csqrt 2 + i 2 2 + i 2 2 + i 2 - -
  5993. csqrtl 2 + i 2 - 2 + i 2 - -
  5994. ctanf 1 + i 1 1 + i 1 1 + i 1 - -
  5995. ctan 1 + i 2 1 + i 2 1 + i 2 0 + i 1 -
  5996. ctanl 3 + i 3 - 3 + i 3 - -
  5997. ctanhf 2 + i 1 1 + i 2 1 + i 2 2 + i 1 -
  5998. ctanh 2 + i 2 2 + i 2 2 + i 2 1 + i 0 -
  5999. ctanhl 3 + i 3 - 3 + i 3 - -
  6000. erff 1 1 1 - -
  6001. erf 1 1 1 1 -
  6002. erfl 1 - 1 - -
  6003. erfcf 2 2 2 - -
  6004. erfc 2 3 3 1 -
  6005. erfcl 2 - 2 - -
  6006. expf 1 1 1 - -
  6007. exp - - - - -
  6008. expl 1 - 1 - -
  6009. exp10f - - - 2 -
  6010. exp10 2 2 2 6 -
  6011. exp10l 2 - 2 - -
  6012. exp2f 1 1 1 - -
  6013. exp2 1 1 1 - -
  6014. exp2l 1 - 1 - -
  6015. expm1f 1 1 1 1 -
  6016. expm1 1 1 1 1 -
  6017. expm1l 1 - 1 - -
  6018. fabsf - - - - -
  6019. fabs - - - - -
  6020. fabsl - - - - -
  6021. fdimf - - - - -
  6022. fdim - - - - -
  6023. fdiml - - - - -
  6024. floorf - - - - -
  6025. floor - - - - -
  6026. floorl - - - - -
  6027. fmaf - - - - -
  6028. fma - - - - -
  6029. fmal - - - - -
  6030. fmaxf - - - - -
  6031. fmax - - - - -
  6032. fmaxl - - - - -
  6033. fmaxmagf - - - - -
  6034. fmaxmag - - - - -
  6035. fmaxmagl - - - - -
  6036. fminf - - - - -
  6037. fmin - - - - -
  6038. fminl - - - - -
  6039. fminmagf - - - - -
  6040. fminmag - - - - -
  6041. fminmagl - - - - -
  6042. fmodf - - - - -
  6043. fmod - - - - -
  6044. fmodl - - - - -
  6045. frexpf - - - - -
  6046. frexp - - - - -
  6047. frexpl - - - - -
  6048. fromfpf - - - - -
  6049. fromfp - - - - -
  6050. fromfpl - - - - -
  6051. fromfpxf - - - - -
  6052. fromfpx - - - - -
  6053. fromfpxl - - - - -
  6054. gammaf 4 4 4 - -
  6055. gamma 3 4 4 - -
  6056. gammal 5 - 5 - -
  6057. hypotf - - - 1 -
  6058. hypot 1 1 1 - -
  6059. hypotl 1 - 1 - -
  6060. ilogbf - - - - -
  6061. ilogb - - - - -
  6062. ilogbl - - - - -
  6063. j0f 2 2 2 2 -
  6064. j0 2 2 2 2 -
  6065. j0l 2 - 2 - -
  6066. j1f 2 2 2 2 -
  6067. j1 1 1 1 1 -
  6068. j1l 4 - 4 - -
  6069. jnf 4 4 4 4 -
  6070. jn 4 4 4 4 -
  6071. jnl 7 - 7 - -
  6072. lgammaf 4 4 4 2 -
  6073. lgamma 3 4 4 1 -
  6074. lgammal 5 - 5 - -
  6075. llogbf - - - - -
  6076. llogb - - - - -
  6077. llogbl - - - - -
  6078. lrintf - - - - -
  6079. lrint - - - - -
  6080. lrintl - - - - -
  6081. llrintf - - - - -
  6082. llrint - - - - -
  6083. llrintl - - - - -
  6084. logf 1 1 1 - -
  6085. log - - - - -
  6086. logl 1 - 1 - -
  6087. log10f 2 2 2 2 -
  6088. log10 2 2 2 1 -
  6089. log10l 1 - 1 - -
  6090. log1pf 1 1 1 1 -
  6091. log1p 1 1 1 - -
  6092. log1pl 2 - 2 - -
  6093. log2f 1 1 1 - -
  6094. log2 1 2 2 - -
  6095. log2l 2 - 2 - -
  6096. logbf - - - - -
  6097. logb - - - - -
  6098. logbl - - - - -
  6099. lroundf - - - - -
  6100. lround - - - - -
  6101. lroundl - - - - -
  6102. llroundf - - - - -
  6103. llround - - - - -
  6104. llroundl - - - - -
  6105. modff - - - - -
  6106. modf - - - - -
  6107. modfl - - - - -
  6108. nearbyintf - - - - -
  6109. nearbyint - - - - -
  6110. nearbyintl - - - - -
  6111. nextafterf - - - - -
  6112. nextafter - - - - -
  6113. nextafterl - - - - -
  6114. nextdownf - - - - -
  6115. nextdown - - - - -
  6116. nextdownl - - - - -
  6117. nexttowardf - - - - -
  6118. nexttoward - - - - -
  6119. nexttowardl - - - - -
  6120. nextupf - - - - -
  6121. nextup - - - - -
  6122. nextupl - - - - -
  6123. powf 1 1 1 - -
  6124. pow - - - - -
  6125. powl 2 - 2 - -
  6126. remainderf - - - - -
  6127. remainder - - - - -
  6128. remainderl - - - - -
  6129. remquof - - - - -
  6130. remquo - - - - -
  6131. remquol - - - - -
  6132. rintf - - - - -
  6133. rint - - - - -
  6134. rintl - - - - -
  6135. roundf - - - - -
  6136. round - - - - -
  6137. roundl - - - - -
  6138. roundevenf - - - - -
  6139. roundeven - - - - -
  6140. roundevenl - - - - -
  6141. scalbf - - - - -
  6142. scalb - - - - -
  6143. scalbl - - - - -
  6144. scalbnf - - - - -
  6145. scalbn - - - - -
  6146. scalbnl - - - - -
  6147. sinf 1 1 1 - -
  6148. sin - - - - -
  6149. sinl 1 - 1 - -
  6150. sincosf 1 1 1 1 -
  6151. sincos - - - 1 -
  6152. sincosl 1 - 1 - -
  6153. sinhf 2 2 2 - -
  6154. sinh 2 2 2 - -
  6155. sinhl 2 - 2 - -
  6156. sqrtf - - - - -
  6157. sqrt - - - - -
  6158. sqrtl - - - - -
  6159. tanf 1 1 1 - -
  6160. tan - - - 1 -
  6161. tanl 1 - 1 - -
  6162. tanhf 2 2 2 - -
  6163. tanh 2 2 2 - -
  6164. tanhl 2 - 2 - -
  6165. tgammaf 4 4 4 1 -
  6166. tgamma 5 5 5 1 -
  6167. tgammal 4 - 4 - -
  6168. truncf - - - - -
  6169. trunc - - - - -
  6170. truncl - - - - -
  6171. ufromfpf - - - - -
  6172. ufromfp - - - - -
  6173. ufromfpl - - - - -
  6174. ufromfpxf - - - - -
  6175. ufromfpx - - - - -
  6176. ufromfpxl - - - - -
  6177. y0f 1 1 1 1 -
  6178. y0 2 2 2 2 -
  6179. y0l 3 - 3 - -
  6180. y1f 2 2 2 2 -
  6181. y1 3 3 3 3 -
  6182. y1l 2 - 2 - -
  6183. ynf 2 2 2 2 -
  6184. yn 3 3 3 3 -
  6185. ynl 5 - 5 - -
  6186. Function HPPA IA64 M68k MIPS 32-bit MIPS 64-bit
  6187. acosf 1 - - 1 1
  6188. acos - - - - -
  6189. acosl - - - - 1
  6190. acoshf 2 - 1 2 2
  6191. acosh 2 - 1 2 2
  6192. acoshl - - 1 - 2
  6193. asinf 1 - - 1 1
  6194. asin - - - - -
  6195. asinl - - - - 1
  6196. asinhf 1 - 1 1 1
  6197. asinh 1 - 1 1 1
  6198. asinhl - - 1 - 3
  6199. atanf 1 - - 1 1
  6200. atan - - - - -
  6201. atanl - - - - 1
  6202. atanhf 2 - - 2 2
  6203. atanh 2 - - 2 2
  6204. atanhl - - - - 3
  6205. atan2f 1 - 1 1 1
  6206. atan2 - - - - -
  6207. atan2l - - 1 - 1
  6208. cabsf - - - - -
  6209. cabs 1 - 1 1 1
  6210. cabsl - - 1 - 1
  6211. cacosf 2 + i 2 2 + i 2 2 + i 1 2 + i 2 2 + i 2
  6212. cacos 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6213. cacosl - 1 + i 2 1 + i 2 - 2 + i 2
  6214. cacoshf 2 + i 2 2 + i 2 1 + i 2 2 + i 2 2 + i 2
  6215. cacosh 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6216. cacoshl - 2 + i 1 2 + i 1 - 2 + i 2
  6217. cargf 1 - 1 1 1
  6218. carg - - - - -
  6219. cargl - - 1 - 2
  6220. casinf 1 + i 2 1 + i 2 1 + i 1 1 + i 2 1 + i 2
  6221. casin 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6222. casinl 1 + i 0 1 + i 2 1 + i 2 - 2 + i 2
  6223. casinhf 2 + i 1 2 + i 1 1 + i 1 2 + i 1 2 + i 1
  6224. casinh 5 + i 3 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6225. casinhl 5 + i 3 2 + i 1 2 + i 1 - 2 + i 2
  6226. catanf 1 + i 1 0 + i 1 0 + i 1 1 + i 1 1 + i 1
  6227. catan 0 + i 1 0 + i 1 0 + i 1 0 + i 1 0 + i 1
  6228. catanl 0 + i 1 0 + i 1 1 + i 1 - 1 + i 1
  6229. catanhf 1 + i 1 1 + i 0 1 + i 0 1 + i 1 1 + i 1
  6230. catanh 4 + i 0 1 + i 0 1 + i 0 1 + i 0 1 + i 0
  6231. catanhl 4 + i 0 1 + i 0 1 + i 1 - 1 + i 1
  6232. cbrtf 1 - 1 1 1
  6233. cbrt 3 - 1 3 3
  6234. cbrtl 1 - 1 - 1
  6235. ccosf 1 + i 1 0 + i 1 - 1 + i 1 1 + i 1
  6236. ccos 1 + i 1 1 + i 1 - 1 + i 1 1 + i 1
  6237. ccosl 1 + i 0 1 + i 1 1 + i 1 - 1 + i 1
  6238. ccoshf 1 + i 1 1 + i 1 - 1 + i 1 1 + i 1
  6239. ccosh 1 + i 1 1 + i 1 - 1 + i 1 1 + i 1
  6240. ccoshl 1 + i 0 0 + i 1 0 + i 1 - 1 + i 1
  6241. ceilf - - - - -
  6242. ceil - - - - -
  6243. ceill - - - - -
  6244. cexpf 1 + i 2 1 + i 2 - 1 + i 2 1 + i 2
  6245. cexp 2 + i 1 2 + i 1 - 2 + i 1 2 + i 1
  6246. cexpl - 1 + i 1 1 + i 1 - 1 + i 1
  6247. cimagf - - - - -
  6248. cimag - - - - -
  6249. cimagl - - - - -
  6250. clogf 3 + i 1 1 + i 0 2 + i 1 3 + i 1 3 + i 1
  6251. clog 3 + i 0 1 + i 1 3 + i 1 3 + i 0 3 + i 0
  6252. clogl - 1 + i 1 3 + i 1 - 2 + i 1
  6253. clog10f 4 + i 2 2 + i 1 2 + i 1 4 + i 2 4 + i 2
  6254. clog10 3 + i 2 2 + i 1 2 + i 1 3 + i 2 3 + i 2
  6255. clog10l 0 + i 1 1 + i 1 3 + i 2 - 2 + i 2
  6256. conjf - - - - -
  6257. conj - - - - -
  6258. conjl - - - - -
  6259. copysignf - - - - -
  6260. copysign - - - - -
  6261. copysignl - - - - -
  6262. cosf 1 - - 1 1
  6263. cos 2 1 1 - -
  6264. cosl 2 - - - 1
  6265. coshf 1 - - 1 1
  6266. cosh 1 - - 1 1
  6267. coshl - - - - 1
  6268. cpowf 4 + i 2 5 + i 2 3 + i 5 4 + i 2 4 + i 2
  6269. cpow 2 + i 2 2 + i 0 1 + i 0 2 + i 0 2 + i 0
  6270. cpowl 2 + i 2 3 + i 4 3 + i 1 - 4 + i 1
  6271. cprojf - - - - -
  6272. cproj - - - - -
  6273. cprojl - - - - -
  6274. crealf - - - - -
  6275. creal - - - - -
  6276. creall - - - - -
  6277. csinf 1 + i 0 1 + i 1 - 1 + i 0 1 + i 0
  6278. csin 1 + i 0 1 + i 0 - 1 + i 0 1 + i 0
  6279. csinl - 1 + i 0 1 + i 0 - 1 + i 1
  6280. csinhf 1 + i 1 1 + i 1 - 1 + i 1 1 + i 1
  6281. csinh 0 + i 1 1 + i 1 - 0 + i 1 0 + i 1
  6282. csinhl 0 + i 1 1 + i 0 1 + i 0 - 1 + i 1
  6283. csqrtf 2 + i 2 1 + i 1 1 + i 1 2 + i 2 2 + i 2
  6284. csqrt 2 + i 2 1 + i 1 1 + i 1 2 + i 2 2 + i 2
  6285. csqrtl - 1 + i 1 2 + i 2 - 2 + i 2
  6286. ctanf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6287. ctan 1 + i 2 1 + i 2 1 + i 1 1 + i 2 1 + i 2
  6288. ctanl 0 + i 1 2 + i 2 2 + i 2 - 3 + i 3
  6289. ctanhf 1 + i 2 1 + i 1 1 + i 2 1 + i 2 1 + i 2
  6290. ctanh 2 + i 2 2 + i 2 1 + i 1 2 + i 2 2 + i 2
  6291. ctanhl 1 + i 0 1 + i 2 2 + i 2 - 3 + i 3
  6292. erff 1 - 1 1 1
  6293. erf 1 - - 1 1
  6294. erfl 1 - 1 - 1
  6295. erfcf 2 - 1 2 2
  6296. erfc 3 - - 3 3
  6297. erfcl 1 - 2 - 2
  6298. expf 1 - - 1 1
  6299. exp - - - - -
  6300. expl - - - - 1
  6301. exp10f 2 - - - -
  6302. exp10 6 - - 2 2
  6303. exp10l 6 - - - 2
  6304. exp2f 1 - - 1 1
  6305. exp2 1 - 1 1 1
  6306. exp2l - - - - 1
  6307. expm1f 1 - - 1 1
  6308. expm1 1 - - 1 1
  6309. expm1l 1 1 - - 1
  6310. fabsf - - - - -
  6311. fabs - - - - -
  6312. fabsl - - - - -
  6313. fdimf - - - - -
  6314. fdim - - - - -
  6315. fdiml - - - - -
  6316. floorf - - - - -
  6317. floor - - - - -
  6318. floorl - - - - -
  6319. fmaf - - - - -
  6320. fma - - - - -
  6321. fmal - - - - -
  6322. fmaxf - - - - -
  6323. fmax - - - - -
  6324. fmaxl - - - - -
  6325. fmaxmagf - - - - -
  6326. fmaxmag - - - - -
  6327. fmaxmagl - - - - -
  6328. fminf - - - - -
  6329. fmin - - - - -
  6330. fminl - - - - -
  6331. fminmagf - - - - -
  6332. fminmag - - - - -
  6333. fminmagl - - - - -
  6334. fmodf - - - - -
  6335. fmod - - - - -
  6336. fmodl - - - - -
  6337. frexpf - - - - -
  6338. frexp - - - - -
  6339. frexpl - - - - -
  6340. fromfpf - - - - -
  6341. fromfp - - - - -
  6342. fromfpl - - - - -
  6343. fromfpxf - - - - -
  6344. fromfpx - - - - -
  6345. fromfpxl - - - - -
  6346. gammaf 4 - 1 4 4
  6347. gamma 4 - - 4 4
  6348. gammal - - 2 - 5
  6349. hypotf 1 - - - -
  6350. hypot 1 - 1 1 1
  6351. hypotl - - 1 - 1
  6352. ilogbf - - - - -
  6353. ilogb - - - - -
  6354. ilogbl - - - - -
  6355. j0f 2 2 2 2 2
  6356. j0 2 2 1 2 2
  6357. j0l 2 2 2 - 2
  6358. j1f 2 2 2 2 2
  6359. j1 1 1 - 1 1
  6360. j1l 1 1 1 - 4
  6361. jnf 5 4 2 4 4
  6362. jn 4 4 2 4 4
  6363. jnl 4 4 4 - 7
  6364. lgammaf 4 - 1 4 4
  6365. lgamma 4 - - 4 4
  6366. lgammal 1 - 2 - 5
  6367. llogbf - - - - -
  6368. llogb - - - - -
  6369. llogbl - - - - -
  6370. lrintf - - - - -
  6371. lrint - - - - -
  6372. lrintl - - - - -
  6373. llrintf - - - - -
  6374. llrint - - - - -
  6375. llrintl - - - - -
  6376. logf 1 - - 1 1
  6377. log - - - - -
  6378. logl - - - - 1
  6379. log10f 2 - - 2 2
  6380. log10 2 - - 2 2
  6381. log10l 1 - - - 1
  6382. log1pf 1 - - 1 1
  6383. log1p 1 - - 1 1
  6384. log1pl - - - - 2
  6385. log2f 1 - - 1 1
  6386. log2 2 - - 2 2
  6387. log2l - - - - 2
  6388. logbf - - - - -
  6389. logb - - - - -
  6390. logbl - - - - -
  6391. lroundf - - - - -
  6392. lround - - - - -
  6393. lroundl - - - - -
  6394. llroundf - - - - -
  6395. llround - - - - -
  6396. llroundl - - - - -
  6397. modff - - - - -
  6398. modf - - - - -
  6399. modfl - - - - -
  6400. nearbyintf - - - - -
  6401. nearbyint - - - - -
  6402. nearbyintl - - - - -
  6403. nextafterf - - - - -
  6404. nextafter - - - - -
  6405. nextafterl - - - - -
  6406. nextdownf - - - - -
  6407. nextdown - - - - -
  6408. nextdownl - - - - -
  6409. nexttowardf - - - - -
  6410. nexttoward - - - - -
  6411. nexttowardl - - - - -
  6412. nextupf - - - - -
  6413. nextup - - - - -
  6414. nextupl - - - - -
  6415. powf 1 - 7 1 1
  6416. pow - - 1 - -
  6417. powl - - 9 - 2
  6418. remainderf - - - - -
  6419. remainder - - - - -
  6420. remainderl - - - - -
  6421. remquof - - - - -
  6422. remquo - - - - -
  6423. remquol - - - - -
  6424. rintf - - - - -
  6425. rint - - - - -
  6426. rintl - - - - -
  6427. roundf - - - - -
  6428. round - - - - -
  6429. roundl - - - - -
  6430. roundevenf - - - - -
  6431. roundeven - - - - -
  6432. roundevenl - - - - -
  6433. scalbf - - - - -
  6434. scalb - - - - -
  6435. scalbl - - - - -
  6436. scalbnf - - - - -
  6437. scalbn - - - - -
  6438. scalbnl - - - - -
  6439. sinf 1 - - 1 1
  6440. sin - 1 1 - -
  6441. sinl - - - - 1
  6442. sincosf 1 - - 1 1
  6443. sincos 1 1 - - -
  6444. sincosl 1 - - - 1
  6445. sinhf 2 - - 2 2
  6446. sinh 2 - - 2 2
  6447. sinhl - - - - 2
  6448. sqrtf - - - - -
  6449. sqrt - - - - -
  6450. sqrtl - - - - -
  6451. tanf 1 - - 1 1
  6452. tan 1 - - - -
  6453. tanl 1 - - - 1
  6454. tanhf 2 - - 2 2
  6455. tanh 2 - - 2 2
  6456. tanhl - - - - 2
  6457. tgammaf 4 - 4 4 4
  6458. tgamma 5 - 1 5 5
  6459. tgammal 1 1 9 - 4
  6460. truncf - - - - -
  6461. trunc - - - - -
  6462. truncl - - - - -
  6463. ufromfpf - - - - -
  6464. ufromfp - - - - -
  6465. ufromfpl - - - - -
  6466. ufromfpxf - - - - -
  6467. ufromfpx - - - - -
  6468. ufromfpxl - - - - -
  6469. y0f 1 1 1 1 1
  6470. y0 2 2 1 2 2
  6471. y0l 2 1 1 - 3
  6472. y1f 2 2 3 2 2
  6473. y1 3 3 1 3 3
  6474. y1l 3 2 2 - 2
  6475. ynf 2 3 3 2 2
  6476. yn 3 3 2 3 3
  6477. ynl 3 2 4 - 5
  6478. Function MicroBlaze Nios II PowerPC PowerPC S/390
  6479. soft-float
  6480. acosf - 1 1 1 1
  6481. acos - - - - -
  6482. acosl - - 1 1 1
  6483. acoshf - 2 2 2 2
  6484. acosh 1 2 2 2 2
  6485. acoshl - - 2 1 2
  6486. asinf - 1 1 1 1
  6487. asin - - - - -
  6488. asinl - - 2 2 1
  6489. asinhf 1 1 1 1 1
  6490. asinh 1 1 1 1 1
  6491. asinhl - - 2 2 3
  6492. atanf - 1 1 1 1
  6493. atan - - 1 - -
  6494. atanl - - 1 1 1
  6495. atanhf 1 2 2 2 2
  6496. atanh - 2 2 2 2
  6497. atanhl - - 2 2 3
  6498. atan2f 1 1 1 1 1
  6499. atan2 - - - - -
  6500. atan2l - - 2 2 1
  6501. cabsf - - - - -
  6502. cabs - 1 1 1 1
  6503. cabsl - - 1 1 1
  6504. cacosf 2 + i 2 2 + i 2 2 + i 2 2 + i 2 2 + i 2
  6505. cacos 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6506. cacosl - - 1 + i 2 2 + i 1 2 + i 2
  6507. cacoshf 2 + i 2 2 + i 2 2 + i 2 2 + i 2 2 + i 2
  6508. cacosh 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6509. cacoshl - - 2 + i 1 1 + i 2 2 + i 2
  6510. cargf - 1 1 1 1
  6511. carg - - 1 - -
  6512. cargl - - 2 2 2
  6513. casinf 1 + i 2 1 + i 2 1 + i 2 1 + i 2 1 + i 2
  6514. casin 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6515. casinl - - 1 + i 2 2 + i 1 2 + i 2
  6516. casinhf 2 + i 1 2 + i 1 2 + i 1 2 + i 1 2 + i 1
  6517. casinh 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6518. casinhl - - 2 + i 1 1 + i 2 2 + i 2
  6519. catanf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6520. catan 0 + i 1 0 + i 1 0 + i 1 0 + i 1 0 + i 1
  6521. catanl - - 1 + i 1 1 + i 1 1 + i 1
  6522. catanhf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6523. catanh 1 + i 0 1 + i 0 1 + i 0 1 + i 0 1 + i 0
  6524. catanhl - - 1 + i 1 1 + i 1 1 + i 1
  6525. cbrtf 1 1 1 1 1
  6526. cbrt 1 3 3 3 3
  6527. cbrtl - - 1 1 1
  6528. ccosf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6529. ccos 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6530. ccosl - - 1 + i 2 1 + i 2 1 + i 1
  6531. ccoshf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6532. ccosh 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6533. ccoshl - - 1 + i 2 1 + i 2 1 + i 1
  6534. ceilf - - - - -
  6535. ceil - - - - -
  6536. ceill - - - - -
  6537. cexpf 1 + i 2 1 + i 2 1 + i 2 1 + i 2 1 + i 2
  6538. cexp 2 + i 1 2 + i 1 2 + i 1 2 + i 1 2 + i 1
  6539. cexpl - - 2 + i 2 1 + i 1 1 + i 1
  6540. cimagf - - - - -
  6541. cimag - - - - -
  6542. cimagl - - - - -
  6543. clogf 1 + i 1 3 + i 1 3 + i 1 3 + i 1 3 + i 1
  6544. clog 1 + i 0 3 + i 0 3 + i 1 3 + i 0 3 + i 0
  6545. clogl - - 5 + i 2 2 + i 2 2 + i 1
  6546. clog10f 2 + i 1 4 + i 2 4 + i 2 4 + i 2 4 + i 2
  6547. clog10 2 + i 1 3 + i 2 3 + i 2 3 + i 2 3 + i 2
  6548. clog10l - - 3 + i 2 3 + i 2 2 + i 2
  6549. conjf - - - - -
  6550. conj - - - - -
  6551. conjl - - - - -
  6552. copysignf - - - - -
  6553. copysign - - - - -
  6554. copysignl - - - - -
  6555. cosf 1 1 1 1 1
  6556. cos - - - - -
  6557. cosl - - 4 4 1
  6558. coshf 1 1 1 1 1
  6559. cosh 1 1 1 1 1
  6560. coshl - - 3 3 1
  6561. cpowf 4 + i 2 4 + i 2 5 + i 2 4 + i 2 5 + i 2
  6562. cpow 2 + i 0 2 + i 0 2 + i 0 2 + i 0 2 + i 0
  6563. cpowl - - 4 + i 2 4 + i 1 4 + i 1
  6564. cprojf - - - - -
  6565. cproj - - - - -
  6566. cprojl - - - - -
  6567. crealf - - - - -
  6568. creal - - - - -
  6569. creall - - - - -
  6570. csinf 1 + i 0 1 + i 0 1 + i 0 1 + i 0 1 + i 0
  6571. csin 1 + i 0 1 + i 0 1 + i 0 1 + i 0 1 + i 0
  6572. csinl - - 2 + i 1 2 + i 1 1 + i 1
  6573. csinhf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6574. csinh 0 + i 1 0 + i 1 0 + i 1 0 + i 1 0 + i 1
  6575. csinhl - - 1 + i 2 1 + i 2 1 + i 1
  6576. csqrtf 1 + i 1 2 + i 2 2 + i 2 2 + i 2 2 + i 2
  6577. csqrt 1 + i 1 2 + i 2 2 + i 2 2 + i 2 2 + i 2
  6578. csqrtl - - 1 + i 1 1 + i 1 2 + i 2
  6579. ctanf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6580. ctan 1 + i 2 1 + i 2 1 + i 2 1 + i 2 1 + i 2
  6581. ctanl - - 3 + i 2 3 + i 2 3 + i 3
  6582. ctanhf 1 + i 2 1 + i 2 2 + i 1 1 + i 2 2 + i 1
  6583. ctanh 2 + i 2 2 + i 2 2 + i 2 2 + i 2 2 + i 2
  6584. ctanhl - - 3 + i 3 2 + i 3 3 + i 3
  6585. erff - 1 1 1 1
  6586. erf 1 1 1 1 1
  6587. erfl - - 1 1 1
  6588. erfcf 1 2 2 2 2
  6589. erfc 1 3 2 3 2
  6590. erfcl - - 3 3 2
  6591. expf - 1 1 1 1
  6592. exp - - 1 - -
  6593. expl - - 1 1 1
  6594. exp10f - - - - -
  6595. exp10 1 2 2 2 2
  6596. exp10l - - 1 1 2
  6597. exp2f - 1 1 1 1
  6598. exp2 - 1 1 1 1
  6599. exp2l - - 2 1 1
  6600. expm1f 1 1 1 1 1
  6601. expm1 1 1 1 1 1
  6602. expm1l - - 1 1 1
  6603. fabsf - - - - -
  6604. fabs - - - - -
  6605. fabsl - - - - -
  6606. fdimf - - - - -
  6607. fdim - - - - -
  6608. fdiml - - - - -
  6609. floorf - - - - -
  6610. floor - - - - -
  6611. floorl - - - - -
  6612. fmaf - - - - -
  6613. fma - - - - -
  6614. fmal - - 1 1 -
  6615. fmaxf - - - - -
  6616. fmax - - - - -
  6617. fmaxl - - - - -
  6618. fmaxmagf - - - - -
  6619. fmaxmag - - - - -
  6620. fmaxmagl - - - - -
  6621. fminf - - - - -
  6622. fmin - - - - -
  6623. fminl - - - - -
  6624. fminmagf - - - - -
  6625. fminmag - - - - -
  6626. fminmagl - - - - -
  6627. fmodf - - - - -
  6628. fmod - - - - -
  6629. fmodl - - 1 1 -
  6630. frexpf - - - - -
  6631. frexp - - - - -
  6632. frexpl - - - - -
  6633. fromfpf - - - - -
  6634. fromfp - - - - -
  6635. fromfpl - - - - -
  6636. fromfpxf - - - - -
  6637. fromfpx - - - - -
  6638. fromfpxl - - - - -
  6639. gammaf 1 4 4 4 4
  6640. gamma 1 4 3 4 3
  6641. gammal - - 3 3 5
  6642. hypotf - - - - -
  6643. hypot 1 1 1 1 1
  6644. hypotl - - 1 1 1
  6645. ilogbf - - - - -
  6646. ilogb - - - - -
  6647. ilogbl - - - - -
  6648. j0f 2 2 2 2 2
  6649. j0 2 2 2 2 2
  6650. j0l - - 2 2 2
  6651. j1f 2 2 2 2 2
  6652. j1 1 1 1 1 1
  6653. j1l - - 2 1 4
  6654. jnf 4 4 4 4 4
  6655. jn 4 4 4 4 4
  6656. jnl - - 4 4 7
  6657. lgammaf 1 4 4 4 4
  6658. lgamma 1 4 3 4 3
  6659. lgammal - - 3 3 5
  6660. llogbf - - - - -
  6661. llogb - - - - -
  6662. llogbl - - - - -
  6663. lrintf - - - - -
  6664. lrint - - - - -
  6665. lrintl - - - - -
  6666. llrintf - - - - -
  6667. llrint - - - - -
  6668. llrintl - - - - -
  6669. logf 1 1 1 1 1
  6670. log - - - - -
  6671. logl - - 1 1 1
  6672. log10f 2 2 2 2 2
  6673. log10 1 2 2 2 2
  6674. log10l - - 1 1 1
  6675. log1pf 1 1 1 1 1
  6676. log1p - 1 1 1 1
  6677. log1pl - - 2 2 2
  6678. log2f - 1 1 1 1
  6679. log2 - 2 1 2 1
  6680. log2l - - 1 1 2
  6681. logbf - - - - -
  6682. logb - - - - -
  6683. logbl - - - - -
  6684. lroundf - - - - -
  6685. lround - - - - -
  6686. lroundl - - - - -
  6687. llroundf - - - - -
  6688. llround - - - - -
  6689. llroundl - - - - -
  6690. modff - - - - -
  6691. modf - - - - -
  6692. modfl - - - - -
  6693. nearbyintf - - - - -
  6694. nearbyint - - - - -
  6695. nearbyintl - - - - -
  6696. nextafterf - - - - -
  6697. nextafter - - - - -
  6698. nextafterl - - - - -
  6699. nextdownf - - - - -
  6700. nextdown - - - - -
  6701. nextdownl - - - - -
  6702. nexttowardf - - - - -
  6703. nexttoward - - - - -
  6704. nexttowardl - - - - -
  6705. nextupf - - - - -
  6706. nextup - - - - -
  6707. nextupl - - - - -
  6708. powf 1 3 1 1 1
  6709. pow - - - - -
  6710. powl - - 1 1 2
  6711. remainderf - - - - -
  6712. remainder - - - - -
  6713. remainderl - - - - -
  6714. remquof - - - - -
  6715. remquo - - - - -
  6716. remquol - - - - -
  6717. rintf - - - - -
  6718. rint - - - - -
  6719. rintl - - - - -
  6720. roundf - - - - -
  6721. round - - - - -
  6722. roundl - - - - -
  6723. roundevenf - - - - -
  6724. roundeven - - - - -
  6725. roundevenl - - - - -
  6726. scalbf - - - - -
  6727. scalb - - - - -
  6728. scalbl - - - - -
  6729. scalbnf - - - - -
  6730. scalbn - - - - -
  6731. scalbnl - - - - -
  6732. sinf 1 1 1 1 1
  6733. sin - - - - -
  6734. sinl - - 1 1 1
  6735. sincosf 1 1 1 1 1
  6736. sincos - - - - -
  6737. sincosl - - 1 1 1
  6738. sinhf - 2 2 2 2
  6739. sinh - 2 2 2 2
  6740. sinhl - - 3 3 2
  6741. sqrtf - - - - -
  6742. sqrt - - - - -
  6743. sqrtl - - 1 1 -
  6744. tanf - 1 1 1 1
  6745. tan - - - - -
  6746. tanl - - 2 2 1
  6747. tanhf - 2 2 2 2
  6748. tanh - 2 2 2 2
  6749. tanhl - - 1 1 2
  6750. tgammaf 3 5 4 4 4
  6751. tgamma 4 5 5 5 5
  6752. tgammal - - 5 3 4
  6753. truncf - - - - -
  6754. trunc - - - - -
  6755. truncl - - - - -
  6756. ufromfpf - - - - -
  6757. ufromfp - - - - -
  6758. ufromfpl - - - - -
  6759. ufromfpxf - - - - -
  6760. ufromfpx - - - - -
  6761. ufromfpxl - - - - -
  6762. y0f 1 1 1 1 1
  6763. y0 2 2 2 2 2
  6764. y0l - - 1 1 3
  6765. y1f 2 2 2 2 2
  6766. y1 3 3 3 3 3
  6767. y1l - - 2 2 2
  6768. ynf 2 2 2 2 2
  6769. yn 3 3 3 3 3
  6770. ynl - - 2 2 5
  6771. Function SH Sparc Tile i686 ix86
  6772. acosf - 1 1 - -
  6773. acos - - - 1 1
  6774. acosl - 1 - 1 1
  6775. acoshf - 2 2 - -
  6776. acosh 1 2 2 1 1
  6777. acoshl - 2 - 2 2
  6778. asinf - 1 1 - -
  6779. asin - - - 1 1
  6780. asinl - 1 - 1 1
  6781. asinhf 1 1 1 - -
  6782. asinh 1 1 1 1 1
  6783. asinhl - 3 - 3 3
  6784. atanf - 1 1 - -
  6785. atan - - - 1 1
  6786. atanl - 1 - 1 1
  6787. atanhf 1 2 2 - -
  6788. atanh - 2 2 1 1
  6789. atanhl - 3 - 3 3
  6790. atan2f 1 1 1 - -
  6791. atan2 - - - 1 1
  6792. atan2l - 1 - 1 1
  6793. cabsf - - - - -
  6794. cabs - 1 1 1 1
  6795. cabsl - 1 - 1 1
  6796. cacosf 2 + i 2 2 + i 2 2 + i 2 1 + i 1 1 + i 1
  6797. cacos 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6798. cacosl - 2 + i 2 - 1 + i 2 1 + i 2
  6799. cacoshf 2 + i 2 2 + i 2 2 + i 2 1 + i 1 1 + i 1
  6800. cacosh 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6801. cacoshl - 2 + i 2 - 2 + i 1 2 + i 1
  6802. cargf - 1 1 - -
  6803. carg - - - 1 1
  6804. cargl - 2 - 1 1
  6805. casinf 1 + i 2 1 + i 2 1 + i 2 1 + i 1 1 + i 1
  6806. casin 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6807. casinl - 2 + i 2 - 1 + i 2 1 + i 2
  6808. casinhf 2 + i 1 2 + i 1 2 + i 1 1 + i 1 1 + i 1
  6809. casinh 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6810. casinhl - 2 + i 2 - 2 + i 1 2 + i 1
  6811. catanf 1 + i 1 1 + i 1 1 + i 1 0 + i 1 0 + i 1
  6812. catan 0 + i 1 0 + i 1 0 + i 1 0 + i 1 0 + i 1
  6813. catanl - 1 + i 1 - 0 + i 1 0 + i 1
  6814. catanhf 1 + i 1 1 + i 1 1 + i 1 1 + i 0 1 + i 0
  6815. catanh 1 + i 0 1 + i 0 1 + i 0 1 + i 0 1 + i 0
  6816. catanhl - 1 + i 1 - 1 + i 0 1 + i 0
  6817. cbrtf 1 1 1 1 1
  6818. cbrt 1 3 3 1 1
  6819. cbrtl - 1 - 3 3
  6820. ccosf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6821. ccos 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6822. ccosl - 1 + i 1 - 1 + i 1 1 + i 1
  6823. ccoshf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6824. ccosh 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6825. ccoshl - 1 + i 1 - 1 + i 1 1 + i 1
  6826. ceilf - - - - -
  6827. ceil - - - - -
  6828. ceill - - - - -
  6829. cexpf 1 + i 2 1 + i 2 1 + i 2 1 + i 2 1 + i 2
  6830. cexp 2 + i 1 2 + i 1 2 + i 1 2 + i 1 2 + i 1
  6831. cexpl - 1 + i 1 - 1 + i 1 1 + i 1
  6832. cimagf - - - - -
  6833. cimag - - - - -
  6834. cimagl - - - - -
  6835. clogf 1 + i 1 3 + i 1 3 + i 1 1 + i 0 1 + i 0
  6836. clog 1 + i 0 3 + i 0 3 + i 0 2 + i 1 2 + i 1
  6837. clogl - 4 + i 1 - 3 + i 1 3 + i 1
  6838. clog10f 2 + i 1 4 + i 2 4 + i 2 2 + i 0 2 + i 0
  6839. clog10 2 + i 1 3 + i 2 3 + i 2 2 + i 1 2 + i 1
  6840. clog10l - 4 + i 2 - 4 + i 2 4 + i 2
  6841. conjf - - - - -
  6842. conj - - - - -
  6843. conjl - - - - -
  6844. copysignf - - - - -
  6845. copysign - - - - -
  6846. copysignl - - - - -
  6847. cosf 1 1 1 - 1
  6848. cos - - - - -
  6849. cosl - 1 - 1 1
  6850. coshf 1 1 1 1 1
  6851. cosh 1 1 1 1 1
  6852. coshl - 1 - 2 2
  6853. cpowf 4 + i 2 4 + i 2 4 + i 2 5 + i 2 5 + i 2
  6854. cpow 2 + i 0 2 + i 0 2 + i 0 2 + i 1 2 + i 0
  6855. cpowl - 4 + i 1 - 3 + i 4 3 + i 4
  6856. cprojf - - - - -
  6857. cproj - - - - -
  6858. cprojl - - - - -
  6859. crealf - - - - -
  6860. creal - - - - -
  6861. creall - - - - -
  6862. csinf 1 + i 0 1 + i 0 1 + i 0 1 + i 1 1 + i 1
  6863. csin 1 + i 0 1 + i 0 1 + i 0 1 + i 1 1 + i 0
  6864. csinl - 1 + i 1 - 1 + i 0 1 + i 0
  6865. csinhf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 0 + i 1
  6866. csinh 0 + i 1 0 + i 1 0 + i 1 1 + i 1 0 + i 1
  6867. csinhl - 1 + i 1 - 1 + i 1 1 + i 1
  6868. csqrtf 1 + i 1 2 + i 2 2 + i 2 0 + i 1 0 + i 1
  6869. csqrt 1 + i 1 2 + i 2 2 + i 2 1 + i 1 1 + i 1
  6870. csqrtl - 2 + i 2 - 2 + i 2 2 + i 2
  6871. ctanf 1 + i 1 1 + i 1 1 + i 1 1 + i 1 1 + i 1
  6872. ctan 1 + i 2 1 + i 2 1 + i 2 1 + i 1 1 + i 1
  6873. ctanl - 3 + i 3 - 2 + i 1 2 + i 1
  6874. ctanhf 1 + i 2 1 + i 2 1 + i 2 1 + i 1 1 + i 1
  6875. ctanh 2 + i 2 2 + i 2 2 + i 2 1 + i 1 1 + i 1
  6876. ctanhl - 3 + i 3 - 1 + i 2 1 + i 2
  6877. erff - 1 1 1 1
  6878. erf 1 1 1 1 1
  6879. erfl - 1 - 1 1
  6880. erfcf 1 2 2 1 1
  6881. erfc 1 3 3 1 1
  6882. erfcl - 2 - 3 3
  6883. expf - 1 1 - -
  6884. exp - - - 1 1
  6885. expl - 1 - 1 1
  6886. exp10f - - - - -
  6887. exp10 1 2 2 1 1
  6888. exp10l - 2 - 1 1
  6889. exp2f - 1 1 - -
  6890. exp2 - 1 1 1 1
  6891. exp2l - 1 - 1 1
  6892. expm1f 1 1 1 - -
  6893. expm1 1 1 1 1 1
  6894. expm1l - 1 - 2 2
  6895. fabsf - - - - -
  6896. fabs - - - - -
  6897. fabsl - - - - -
  6898. fdimf - - - - -
  6899. fdim - - - - -
  6900. fdiml - - - - -
  6901. floorf - - - - -
  6902. floor - - - - -
  6903. floorl - - - - -
  6904. fmaf - - - - -
  6905. fma - - - - -
  6906. fmal - - - - -
  6907. fmaxf - - - - -
  6908. fmax - - - - -
  6909. fmaxl - - - - -
  6910. fmaxmagf - - - - -
  6911. fmaxmag - - - - -
  6912. fmaxmagl - - - - -
  6913. fminf - - - - -
  6914. fmin - - - - -
  6915. fminl - - - - -
  6916. fminmagf - - - - -
  6917. fminmag - - - - -
  6918. fminmagl - - - - -
  6919. fmodf - - - - -
  6920. fmod - - - - -
  6921. fmodl - - - - -
  6922. frexpf - - - - -
  6923. frexp - - - - -
  6924. frexpl - - - - -
  6925. fromfpf - - - - -
  6926. fromfp - - - - -
  6927. fromfpl - - - - -
  6928. fromfpxf - - - - -
  6929. fromfpx - - - - -
  6930. fromfpxl - - - - -
  6931. gammaf 1 4 4 3 2
  6932. gamma 1 4 4 3 3
  6933. gammal - 5 - 4 4
  6934. hypotf - - - - -
  6935. hypot 1 1 1 1 1
  6936. hypotl - 1 - 1 1
  6937. ilogbf - - - - -
  6938. ilogb - - - - -
  6939. ilogbl - - - - -
  6940. j0f 2 2 2 1 1
  6941. j0 2 2 2 1 1
  6942. j0l - 2 - 2 2
  6943. j1f 2 2 2 1 1
  6944. j1 1 1 1 2 2
  6945. j1l - 4 - 1 1
  6946. jnf 4 4 4 3 3
  6947. jn 4 4 4 2 2
  6948. jnl - 7 - 4 4
  6949. lgammaf 1 4 4 3 2
  6950. lgamma 1 4 4 3 3
  6951. lgammal - 5 - 4 4
  6952. llogbf - - - - -
  6953. llogb - - - - -
  6954. llogbl - - - - -
  6955. lrintf - - - - -
  6956. lrint - - - - -
  6957. lrintl - - - - -
  6958. llrintf - - - - -
  6959. llrint - - - - -
  6960. llrintl - - - - -
  6961. logf 1 1 1 - -
  6962. log - - - 1 1
  6963. logl - 1 - 1 1
  6964. log10f 2 2 2 - -
  6965. log10 1 2 2 1 1
  6966. log10l - 1 - 1 1
  6967. log1pf 1 1 1 - -
  6968. log1p - 1 1 1 1
  6969. log1pl - 2 - 2 2
  6970. log2f - 1 1 - -
  6971. log2 - 2 2 1 1
  6972. log2l - 2 - 1 1
  6973. logbf - - - - -
  6974. logb - - - - -
  6975. logbl - - - - -
  6976. lroundf - - - - -
  6977. lround - - - - -
  6978. lroundl - - - - -
  6979. llroundf - - - - -
  6980. llround - - - - -
  6981. llroundl - - - - -
  6982. modff - - - - -
  6983. modf - - - - -
  6984. modfl - - - - -
  6985. nearbyintf - - - - -
  6986. nearbyint - - - - -
  6987. nearbyintl - - - - -
  6988. nextafterf - - - - -
  6989. nextafter - - - - -
  6990. nextafterl - - - - -
  6991. nextdownf - - - - -
  6992. nextdown - - - - -
  6993. nextdownl - - - - -
  6994. nexttowardf - - - - -
  6995. nexttoward - - - - -
  6996. nexttowardl - - - - -
  6997. nextupf - - - - -
  6998. nextup - - - - -
  6999. nextupl - - - - -
  7000. powf 1 3 3 - -
  7001. pow - - - 1 1
  7002. powl - 2 - 1 1
  7003. remainderf - - - - -
  7004. remainder - - - - -
  7005. remainderl - - - - -
  7006. remquof - - - - -
  7007. remquo - - - - -
  7008. remquol - - - - -
  7009. rintf - - - - -
  7010. rint - - - - -
  7011. rintl - - - - -
  7012. roundf - - - - -
  7013. round - - - - -
  7014. roundl - - - - -
  7015. roundevenf - - - - -
  7016. roundeven - - - - -
  7017. roundevenl - - - - -
  7018. scalbf - - - - -
  7019. scalb - - - - -
  7020. scalbl - - - - -
  7021. scalbnf - - - - -
  7022. scalbn - - - - -
  7023. scalbnl - - - - -
  7024. sinf 1 1 1 - 1
  7025. sin - - - - -
  7026. sinl - 1 - 1 1
  7027. sincosf 1 1 1 - 1
  7028. sincos - - - - -
  7029. sincosl - 1 - 1 1
  7030. sinhf - 2 2 - -
  7031. sinh - 2 2 1 1
  7032. sinhl - 2 - 2 2
  7033. sqrtf - - - - -
  7034. sqrt - - - - -
  7035. sqrtl - - - - -
  7036. tanf - 1 1 1 1
  7037. tan - - - - -
  7038. tanl - 1 - 2 2
  7039. tanhf - 2 2 - -
  7040. tanh - 2 2 1 1
  7041. tanhl - 2 - 3 3
  7042. tgammaf 3 5 5 3 3
  7043. tgamma 4 5 5 3 3
  7044. tgammal - 4 - 5 5
  7045. truncf - - - - -
  7046. trunc - - - - -
  7047. truncl - - - - -
  7048. ufromfpf - - - - -
  7049. ufromfp - - - - -
  7050. ufromfpl - - - - -
  7051. ufromfpxf - - - - -
  7052. ufromfpx - - - - -
  7053. ufromfpxl - - - - -
  7054. y0f 1 1 1 1 1
  7055. y0 2 2 2 1 1
  7056. y0l - 3 - 1 1
  7057. y1f 2 2 2 2 2
  7058. y1 3 3 3 2 2
  7059. y1l - 2 - 2 2
  7060. ynf 2 2 2 3 3
  7061. yn 3 3 3 2 2
  7062. ynl - 5 - 4 4