ccgo_linux_386.go 533 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746
  1. // Code generated for linux/386 by 'gcc -no-main-minimize --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-macro=m_ --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -extended-errors -ignore-link-errors -ignore-unsupported-alignment -ignore-link-errors -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/386 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/limd/include/linux/386 -shared -DPIC .libs/arc4random.o.go .libs/arc4random_uniform.o.go .libs/bsd_getopt.o.go .libs/closefrom.o.go .libs/dehumanize_number.o.go .libs/err.o.go .libs/expand_number.o.go .libs/explicit_bzero.o.go .libs/fgetln.o.go .libs/freezero.o.go .libs/fgetwln.o.go .libs/flopen.o.go .libs/fmtcheck.o.go .libs/fparseln.o.go .libs/fpurge.o.go .libs/funopen.o.go .libs/getbsize.o.go .libs/getpeereid.o.go .libs/heapsort.o.go .libs/humanize_number.o.go .libs/inet_net_pton.o.go .libs/md5.o.go .libs/merge.o.go .libs/nlist.o.go .libs/pidfile.o.go .libs/progname.o.go .libs/pwcache.o.go .libs/radixsort.o.go .libs/readpassphrase.o.go .libs/reallocarray.o.go .libs/reallocf.o.go .libs/recallocarray.o.go .libs/setmode.o.go .libs/setproctitle.o.go .libs/strlcat.o.go .libs/strlcpy.o.go .libs/stringlist.o.go .libs/strmode.o.go .libs/strnstr.o.go .libs/strtoi.o.go .libs/strtonum.o.go .libs/strtou.o.go .libs/timeconv.o.go .libs/unvis.o.go .libs/vis.o.go .libs/wcslcat.o.go .libs/wcslcpy.o.go .libs/getentropy.o.go -lmd -mlong-double-64 -o .libs/libbsd.so.0.11.7.go', DO NOT EDIT.
  2. //go:build linux && 386
  3. package libbsd
  4. import (
  5. "reflect"
  6. "unsafe"
  7. "modernc.org/libc"
  8. "modernc.org/libmd"
  9. )
  10. var _ reflect.Type
  11. var _ unsafe.Pointer
  12. const m_ARG_MAX = 131072
  13. const m_AT_EACCESS = 0x200
  14. const m_AT_EMPTY_PATH = 0x1000
  15. const m_AT_NO_AUTOMOUNT = 0x800
  16. const m_AT_RECURSIVE = 0x8000
  17. const m_AT_REMOVEDIR = 0x200
  18. const m_AT_STATX_DONT_SYNC = 0x4000
  19. const m_AT_STATX_FORCE_SYNC = 0x2000
  20. const m_AT_STATX_SYNC_AS_STAT = 0x0000
  21. const m_AT_STATX_SYNC_TYPE = 0x6000
  22. const m_AT_SYMLINK_FOLLOW = 0x400
  23. const m_AT_SYMLINK_NOFOLLOW = 0x100
  24. const m_BC_BASE_MAX = 99
  25. const m_BC_DIM_MAX = 2048
  26. const m_BC_SCALE_MAX = 99
  27. const m_BC_STRING_MAX = 1000
  28. const m_BIG_ENDIAN = "__BIG_ENDIAN"
  29. const m_BLOCKSZ = 64
  30. const m_BUFSIZ = 1024
  31. const m_BUS_ADRALN = 1
  32. const m_BUS_ADRERR = 2
  33. const m_BUS_MCEERR_AO = 5
  34. const m_BUS_MCEERR_AR = 4
  35. const m_BUS_OBJERR = 3
  36. const m_BYTE_ORDER = "__BYTE_ORDER"
  37. const m_CANBSIZ = 255
  38. const m_CHARCLASS_NAME_MAX = 14
  39. const m_CHAR_BIT = 8
  40. const m_CHAR_MAX = 255
  41. const m_CHAR_MIN = 0
  42. const m_CLD_CONTINUED = 6
  43. const m_CLD_DUMPED = 3
  44. const m_CLD_EXITED = 1
  45. const m_CLD_KILLED = 2
  46. const m_CLD_STOPPED = 5
  47. const m_CLD_TRAPPED = 4
  48. const m_CLOCKS_PER_SEC = 1000000
  49. const m_CLOCK_BOOTTIME = 7
  50. const m_CLOCK_BOOTTIME_ALARM = 9
  51. const m_CLOCK_MONOTONIC = 1
  52. const m_CLOCK_MONOTONIC_COARSE = 6
  53. const m_CLOCK_MONOTONIC_RAW = 4
  54. const m_CLOCK_PROCESS_CPUTIME_ID = 2
  55. const m_CLOCK_REALTIME = 0
  56. const m_CLOCK_REALTIME_ALARM = 8
  57. const m_CLOCK_REALTIME_COARSE = 5
  58. const m_CLOCK_SGI_CYCLE = 10
  59. const m_CLOCK_TAI = 11
  60. const m_CLOCK_THREAD_CPUTIME_ID = 3
  61. const m_CLONE_CHILD_CLEARTID = 0x00200000
  62. const m_CLONE_CHILD_SETTID = 0x01000000
  63. const m_CLONE_DETACHED = 0x00400000
  64. const m_CLONE_FILES = 0x00000400
  65. const m_CLONE_FS = 0x00000200
  66. const m_CLONE_IO = 0x80000000
  67. const m_CLONE_NEWCGROUP = 0x02000000
  68. const m_CLONE_NEWIPC = 0x08000000
  69. const m_CLONE_NEWNET = 0x40000000
  70. const m_CLONE_NEWNS = 0x00020000
  71. const m_CLONE_NEWPID = 0x20000000
  72. const m_CLONE_NEWTIME = 0x00000080
  73. const m_CLONE_NEWUSER = 0x10000000
  74. const m_CLONE_NEWUTS = 0x04000000
  75. const m_CLONE_PARENT = 0x00008000
  76. const m_CLONE_PARENT_SETTID = 0x00100000
  77. const m_CLONE_PIDFD = 0x00001000
  78. const m_CLONE_PTRACE = 0x00002000
  79. const m_CLONE_SETTLS = 0x00080000
  80. const m_CLONE_SIGHAND = 0x00000800
  81. const m_CLONE_SYSVSEM = 0x00040000
  82. const m_CLONE_THREAD = 0x00010000
  83. const m_CLONE_UNTRACED = 0x00800000
  84. const m_CLONE_VFORK = 0x00004000
  85. const m_CLONE_VM = 0x00000100
  86. const m_COLL_WEIGHTS_MAX = 2
  87. const m_CPU_SETSIZE = 1024
  88. const m_CSIGNAL = 0x000000ff
  89. const m_DELAYTIMER_MAX = 0x7fffffff
  90. const m_DEV_BSIZE = 512
  91. const m_DN_ACCESS = 0x00000001
  92. const m_DN_ATTRIB = 0x00000020
  93. const m_DN_CREATE = 0x00000004
  94. const m_DN_DELETE = 0x00000008
  95. const m_DN_MODIFY = 0x00000002
  96. const m_DN_MULTISHOT = 0x80000000
  97. const m_DN_RENAME = 0x00000010
  98. const m_EXIT_FAILURE = 1
  99. const m_EXIT_SUCCESS = 0
  100. const m_EXPR_NEST_MAX = 32
  101. const m_FALLOC_FL_KEEP_SIZE = 1
  102. const m_FALLOC_FL_PUNCH_HOLE = 2
  103. const m_FAPPEND = "O_APPEND"
  104. const m_FASYNC = "O_ASYNC"
  105. const m_FD_CLOEXEC = 1
  106. const m_FD_SETSIZE = 1024
  107. const m_FFSYNC = "O_SYNC"
  108. const m_FILENAME_MAX = 4096
  109. const m_FILESIZEBITS = 64
  110. const m_FNDELAY = "O_NDELAY"
  111. const m_FNONBLOCK = "O_NONBLOCK"
  112. const m_FOPEN_MAX = 1000
  113. const m_FPARSELN_UNESCALL = 0x0f
  114. const m_FPARSELN_UNESCCOMM = 0x04
  115. const m_FPARSELN_UNESCCONT = 0x02
  116. const m_FPARSELN_UNESCESC = 0x01
  117. const m_FPARSELN_UNESCREST = 0x08
  118. const m_FPE_FLTDIV = 3
  119. const m_FPE_FLTINV = 7
  120. const m_FPE_FLTOVF = 4
  121. const m_FPE_FLTRES = 6
  122. const m_FPE_FLTSUB = 8
  123. const m_FPE_FLTUND = 5
  124. const m_FPE_INTDIV = 1
  125. const m_FPE_INTOVF = 2
  126. const m_F_ADD_SEALS = 1033
  127. const m_F_CANCELLK = 1029
  128. const m_F_DUPFD = 0
  129. const m_F_DUPFD_CLOEXEC = 1030
  130. const m_F_GETFD = 1
  131. const m_F_GETFL = 3
  132. const m_F_GETLEASE = 1025
  133. const m_F_GETLK = 12
  134. const m_F_GETOWN = 9
  135. const m_F_GETOWNER_UIDS = 17
  136. const m_F_GETOWN_EX = 16
  137. const m_F_GETPIPE_SZ = 1032
  138. const m_F_GETSIG = 11
  139. const m_F_GET_FILE_RW_HINT = 1037
  140. const m_F_GET_RW_HINT = 1035
  141. const m_F_GET_SEALS = 1034
  142. const m_F_LOCK = 1
  143. const m_F_NOTIFY = 1026
  144. const m_F_OFD_GETLK = 36
  145. const m_F_OFD_SETLK = 37
  146. const m_F_OFD_SETLKW = 38
  147. const m_F_OK = 0
  148. const m_F_OWNER_GID = 2
  149. const m_F_OWNER_PGRP = 2
  150. const m_F_OWNER_PID = 1
  151. const m_F_OWNER_TID = 0
  152. const m_F_RDLCK = 0
  153. const m_F_SEAL_FUTURE_WRITE = 0x0010
  154. const m_F_SEAL_GROW = 0x0004
  155. const m_F_SEAL_SEAL = 0x0001
  156. const m_F_SEAL_SHRINK = 0x0002
  157. const m_F_SEAL_WRITE = 0x0008
  158. const m_F_SETFD = 2
  159. const m_F_SETFL = 4
  160. const m_F_SETLEASE = 1024
  161. const m_F_SETLK = 13
  162. const m_F_SETLKW = 14
  163. const m_F_SETOWN = 8
  164. const m_F_SETOWN_EX = 15
  165. const m_F_SETPIPE_SZ = 1031
  166. const m_F_SETSIG = 10
  167. const m_F_SET_FILE_RW_HINT = 1038
  168. const m_F_SET_RW_HINT = 1036
  169. const m_F_TEST = 3
  170. const m_F_TLOCK = 2
  171. const m_F_ULOCK = 0
  172. const m_F_UNLCK = 2
  173. const m_F_WRLCK = 1
  174. const m_HAVE_CLEARENV = 1
  175. const m_HAVE_CONFIG_H = 1
  176. const m_HAVE_DIRENT_H = 1
  177. const m_HAVE_DIRFD = 1
  178. const m_HAVE_DLFCN_H = 1
  179. const m_HAVE_FOPENCOOKIE = 1
  180. const m_HAVE_GETAUXVAL = 1
  181. const m_HAVE_GETENTROPY = 1
  182. const m_HAVE_GETLINE = 1
  183. const m_HAVE_GRP_H = 1
  184. const m_HAVE_INTTYPES_H = 1
  185. const m_HAVE_PROGRAM_INVOCATION_SHORT_NAME = 1
  186. const m_HAVE_PWD_H = 1
  187. const m_HAVE_STDINT_H = 1
  188. const m_HAVE_STDIO_H = 1
  189. const m_HAVE_STDLIB_H = 1
  190. const m_HAVE_STRINGS_H = 1
  191. const m_HAVE_STRING_H = 1
  192. const m_HAVE_SYSCONF = 1
  193. const m_HAVE_SYS_DIR_H = 1
  194. const m_HAVE_SYS_STAT_H = 1
  195. const m_HAVE_SYS_TYPES_H = 1
  196. const m_HAVE_TYPEOF = 1
  197. const m_HAVE_UNISTD_H = 1
  198. const m_HAVE_WCHAR_H = 1
  199. const m_HAVE___FPURGE = 1
  200. const m_HAVE___PROGNAME = 1
  201. const m_HN_AUTOSCALE = 0x20
  202. const m_HN_B = 0x04
  203. const m_HN_DECIMAL = 0x01
  204. const m_HN_DIVISOR_1000 = 0x08
  205. const m_HN_GETSCALE = 0x10
  206. const m_HN_IEC_PREFIXES = 0x10
  207. const m_HN_NOSPACE = 0x02
  208. const m_HOST_NAME_MAX = 255
  209. const m_ILL_BADSTK = 8
  210. const m_ILL_COPROC = 7
  211. const m_ILL_ILLADR = 3
  212. const m_ILL_ILLOPC = 1
  213. const m_ILL_ILLOPN = 2
  214. const m_ILL_ILLTRP = 4
  215. const m_ILL_PRVOPC = 5
  216. const m_ILL_PRVREG = 6
  217. const m_INT16_MAX = 0x7fff
  218. const m_INT32_MAX = 0x7fffffff
  219. const m_INT64_MAX = 0x7fffffffffffffff
  220. const m_INT8_MAX = 0x7f
  221. const m_INTMAX_MAX = "INT64_MAX"
  222. const m_INTMAX_MIN = "INT64_MIN"
  223. const m_INTPTR_MAX = "INT32_MAX"
  224. const m_INTPTR_MIN = "INT32_MIN"
  225. const m_INT_FAST16_MAX = "INT32_MAX"
  226. const m_INT_FAST16_MIN = "INT32_MIN"
  227. const m_INT_FAST32_MAX = "INT32_MAX"
  228. const m_INT_FAST32_MIN = "INT32_MIN"
  229. const m_INT_FAST64_MAX = "INT64_MAX"
  230. const m_INT_FAST64_MIN = "INT64_MIN"
  231. const m_INT_FAST8_MAX = "INT8_MAX"
  232. const m_INT_FAST8_MIN = "INT8_MIN"
  233. const m_INT_LEAST16_MAX = "INT16_MAX"
  234. const m_INT_LEAST16_MIN = "INT16_MIN"
  235. const m_INT_LEAST32_MAX = "INT32_MAX"
  236. const m_INT_LEAST32_MIN = "INT32_MIN"
  237. const m_INT_LEAST64_MAX = "INT64_MAX"
  238. const m_INT_LEAST64_MIN = "INT64_MIN"
  239. const m_INT_LEAST8_MAX = "INT8_MAX"
  240. const m_INT_LEAST8_MIN = "INT8_MIN"
  241. const m_INT_MAX = 0x7fffffff
  242. const m_IOV_MAX = 1024
  243. const m_ITIMER_PROF = 2
  244. const m_ITIMER_REAL = 0
  245. const m_ITIMER_VIRTUAL = 1
  246. const m_IVSZ = 8
  247. const m_KEYSZ = 32
  248. const m_LIBBSD_DISABLE_DEPRECATED = 1
  249. const m_LIBBSD_OVERLAY = 1
  250. const m_LINE_MAX = 4096
  251. const m_LITTLE_ENDIAN = "__LITTLE_ENDIAN"
  252. const m_LLONG_MAX = 0x7fffffffffffffff
  253. const m_LOGIN_NAME_MAX = 256
  254. const m_LONG_BIT = 32
  255. const m_LONG_MAX = "__LONG_MAX"
  256. const m_LT_OBJDIR = ".libs/"
  257. const m_L_INCR = 1
  258. const m_L_SET = 0
  259. const m_L_XTND = 2
  260. const m_L_ctermid = 20
  261. const m_L_cuserid = 20
  262. const m_L_tmpnam = 20
  263. const m_MADV_COLD = 20
  264. const m_MADV_DODUMP = 17
  265. const m_MADV_DOFORK = 11
  266. const m_MADV_DONTDUMP = 16
  267. const m_MADV_DONTFORK = 10
  268. const m_MADV_DONTNEED = 4
  269. const m_MADV_FREE = 8
  270. const m_MADV_HUGEPAGE = 14
  271. const m_MADV_HWPOISON = 100
  272. const m_MADV_KEEPONFORK = 19
  273. const m_MADV_MERGEABLE = 12
  274. const m_MADV_NOHUGEPAGE = 15
  275. const m_MADV_NORMAL = 0
  276. const m_MADV_PAGEOUT = 21
  277. const m_MADV_RANDOM = 1
  278. const m_MADV_REMOVE = 9
  279. const m_MADV_SEQUENTIAL = 2
  280. const m_MADV_SOFT_OFFLINE = 101
  281. const m_MADV_UNMERGEABLE = 13
  282. const m_MADV_WILLNEED = 3
  283. const m_MADV_WIPEONFORK = 18
  284. const m_MAP_32BIT = 0x40
  285. const m_MAP_ANON = 32
  286. const m_MAP_ANONYMOUS = "MAP_ANON"
  287. const m_MAP_DENYWRITE = 0x0800
  288. const m_MAP_EXECUTABLE = 0x1000
  289. const m_MAP_FILE = 0
  290. const m_MAP_FIXED = 0x10
  291. const m_MAP_FIXED_NOREPLACE = 0x100000
  292. const m_MAP_GROWSDOWN = 0x0100
  293. const m_MAP_HUGETLB = 0x40000
  294. const m_MAP_HUGE_MASK = 0x3f
  295. const m_MAP_HUGE_SHIFT = 26
  296. const m_MAP_LOCKED = 0x2000
  297. const m_MAP_NONBLOCK = 0x10000
  298. const m_MAP_NORESERVE = 0x4000
  299. const m_MAP_POPULATE = 0x8000
  300. const m_MAP_PRIVATE = 2
  301. const m_MAP_SHARED = 0x01
  302. const m_MAP_SHARED_VALIDATE = 0x03
  303. const m_MAP_STACK = 0x20000
  304. const m_MAP_SYNC = 0x80000
  305. const m_MAP_TYPE = 0x0f
  306. const m_MAXHOSTNAMELEN = 64
  307. const m_MAXNAMLEN = 255
  308. const m_MAXPATHLEN = 4096
  309. const m_MAXSYMLINKS = 20
  310. const m_MAX_HANDLE_SZ = 128
  311. const m_MB_LEN_MAX = 4
  312. const m_MCL_CURRENT = 1
  313. const m_MCL_FUTURE = 2
  314. const m_MCL_ONFAULT = 4
  315. const m_MFD_ALLOW_SEALING = 0x0002
  316. const m_MFD_CLOEXEC = 0x0001
  317. const m_MFD_HUGETLB = 0x0004
  318. const m_MINSIGSTKSZ = 2048
  319. const m_MLOCK_ONFAULT = 0x01
  320. const m_MQ_PRIO_MAX = 32768
  321. const m_MREMAP_DONTUNMAP = 4
  322. const m_MREMAP_FIXED = 2
  323. const m_MREMAP_MAYMOVE = 1
  324. const m_MS_ASYNC = 1
  325. const m_MS_INVALIDATE = 2
  326. const m_MS_SYNC = 4
  327. const m_NAME_MAX = 255
  328. const m_NBBY = 8
  329. const m_NCARGS = 131072
  330. const m_NDEBUG = 1
  331. const m_NGROUPS = 32
  332. const m_NGROUPS_MAX = 32
  333. const m_NL_ARGMAX = 9
  334. const m_NL_LANGMAX = 32
  335. const m_NL_MSGMAX = 32767
  336. const m_NL_NMAX = 16
  337. const m_NL_SETMAX = 255
  338. const m_NL_TEXTMAX = 2048
  339. const m_NOFILE = 256
  340. const m_NSIG = "_NSIG"
  341. const m_NZERO = 20
  342. const m_O_APPEND = 02000
  343. const m_O_ASYNC = 020000
  344. const m_O_CLOEXEC = 02000000
  345. const m_O_CREAT = 0100
  346. const m_O_DIRECT = 040000
  347. const m_O_DIRECTORY = 0200000
  348. const m_O_DSYNC = 010000
  349. const m_O_EXCL = 0200
  350. const m_O_EXEC = "O_PATH"
  351. const m_O_LARGEFILE = 0100000
  352. const m_O_NDELAY = "O_NONBLOCK"
  353. const m_O_NOATIME = 01000000
  354. const m_O_NOCTTY = 0400
  355. const m_O_NOFOLLOW = 0400000
  356. const m_O_NONBLOCK = 04000
  357. const m_O_PATH = 010000000
  358. const m_O_RDONLY = 00
  359. const m_O_RDWR = 02
  360. const m_O_RSYNC = 04010000
  361. const m_O_SEARCH = "O_PATH"
  362. const m_O_SYNC = 04010000
  363. const m_O_TMPFILE = 020200000
  364. const m_O_TRUNC = 01000
  365. const m_O_TTY_INIT = 0
  366. const m_O_WRONLY = 01
  367. const m_PACKAGE = "libbsd"
  368. const m_PACKAGE_BUGREPORT = "libbsd@lists.freedesktop.org"
  369. const m_PACKAGE_NAME = "libbsd"
  370. const m_PACKAGE_STRING = "libbsd 0.11.7"
  371. const m_PACKAGE_TARNAME = "libbsd"
  372. const m_PACKAGE_URL = ""
  373. const m_PACKAGE_VERSION = "0.11.7"
  374. const m_PAGESIZE = 4096
  375. const m_PAGE_SIZE = "PAGESIZE"
  376. const m_PATH_MAX = 4096
  377. const m_PDP_ENDIAN = "__PDP_ENDIAN"
  378. const m_PIC = 1
  379. const m_PIPE_BUF = 4096
  380. const m_POLL_ERR = 4
  381. const m_POLL_HUP = 6
  382. const m_POLL_IN = 1
  383. const m_POLL_MSG = 3
  384. const m_POLL_OUT = 2
  385. const m_POLL_PRI = 5
  386. const m_POSIX_CLOSE_RESTART = 0
  387. const m_POSIX_FADV_DONTNEED = 4
  388. const m_POSIX_FADV_NOREUSE = 5
  389. const m_POSIX_FADV_NORMAL = 0
  390. const m_POSIX_FADV_RANDOM = 1
  391. const m_POSIX_FADV_SEQUENTIAL = 2
  392. const m_POSIX_FADV_WILLNEED = 3
  393. const m_POSIX_MADV_DONTNEED = 4
  394. const m_POSIX_MADV_NORMAL = 0
  395. const m_POSIX_MADV_RANDOM = 1
  396. const m_POSIX_MADV_SEQUENTIAL = 2
  397. const m_POSIX_MADV_WILLNEED = 3
  398. const m_PRIO_MAX = 20
  399. const m_PRIO_PGRP = 1
  400. const m_PRIO_PROCESS = 0
  401. const m_PRIO_USER = 2
  402. const m_PROT_EXEC = 4
  403. const m_PROT_GROWSDOWN = 0x01000000
  404. const m_PROT_GROWSUP = 0x02000000
  405. const m_PROT_NONE = 0
  406. const m_PROT_READ = 1
  407. const m_PROT_WRITE = 2
  408. const m_PTHREAD_CANCEL_ASYNCHRONOUS = 1
  409. const m_PTHREAD_CANCEL_DEFERRED = 0
  410. const m_PTHREAD_CANCEL_DISABLE = 1
  411. const m_PTHREAD_CANCEL_ENABLE = 0
  412. const m_PTHREAD_CANCEL_MASKED = 2
  413. const m_PTHREAD_CREATE_DETACHED = 1
  414. const m_PTHREAD_CREATE_JOINABLE = 0
  415. const m_PTHREAD_DESTRUCTOR_ITERATIONS = 4
  416. const m_PTHREAD_EXPLICIT_SCHED = 1
  417. const m_PTHREAD_INHERIT_SCHED = 0
  418. const m_PTHREAD_KEYS_MAX = 128
  419. const m_PTHREAD_MUTEX_DEFAULT = 0
  420. const m_PTHREAD_MUTEX_ERRORCHECK = 2
  421. const m_PTHREAD_MUTEX_NORMAL = 0
  422. const m_PTHREAD_MUTEX_RECURSIVE = 1
  423. const m_PTHREAD_MUTEX_ROBUST = 1
  424. const m_PTHREAD_MUTEX_STALLED = 0
  425. const m_PTHREAD_ONCE_INIT = 0
  426. const m_PTHREAD_PRIO_INHERIT = 1
  427. const m_PTHREAD_PRIO_NONE = 0
  428. const m_PTHREAD_PRIO_PROTECT = 2
  429. const m_PTHREAD_PROCESS_PRIVATE = 0
  430. const m_PTHREAD_PROCESS_SHARED = 1
  431. const m_PTHREAD_SCOPE_PROCESS = 1
  432. const m_PTHREAD_SCOPE_SYSTEM = 0
  433. const m_PTHREAD_STACK_MIN = 2048
  434. const m_PTRDIFF_MAX = "INT32_MAX"
  435. const m_PTRDIFF_MIN = "INT32_MIN"
  436. const m_P_tmpdir = "/tmp"
  437. const m_RAND_MAX = 0x7fffffff
  438. const m_RE_DUP_MAX = 255
  439. const m_RLIMIT_AS = 9
  440. const m_RLIMIT_CORE = 4
  441. const m_RLIMIT_CPU = 0
  442. const m_RLIMIT_DATA = 2
  443. const m_RLIMIT_FSIZE = 1
  444. const m_RLIMIT_LOCKS = 10
  445. const m_RLIMIT_MEMLOCK = 8
  446. const m_RLIMIT_MSGQUEUE = 12
  447. const m_RLIMIT_NICE = 13
  448. const m_RLIMIT_NLIMITS = 16
  449. const m_RLIMIT_NOFILE = 7
  450. const m_RLIMIT_NPROC = 6
  451. const m_RLIMIT_RSS = 5
  452. const m_RLIMIT_RTPRIO = 14
  453. const m_RLIMIT_RTTIME = 15
  454. const m_RLIMIT_SIGPENDING = 11
  455. const m_RLIMIT_STACK = 3
  456. const m_RLIM_NLIMITS = "RLIMIT_NLIMITS"
  457. const m_RLIM_SAVED_CUR = "RLIM_INFINITY"
  458. const m_RLIM_SAVED_MAX = "RLIM_INFINITY"
  459. const m_RUSAGE_SELF = 0
  460. const m_RUSAGE_THREAD = 1
  461. const m_RWF_WRITE_LIFE_NOT_SET = 0
  462. const m_RWH_WRITE_LIFE_EXTREME = 5
  463. const m_RWH_WRITE_LIFE_LONG = 4
  464. const m_RWH_WRITE_LIFE_MEDIUM = 3
  465. const m_RWH_WRITE_LIFE_NONE = 1
  466. const m_RWH_WRITE_LIFE_SHORT = 2
  467. const m_R_OK = 4
  468. const m_SA_EXPOSE_TAGBITS = 0x00000800
  469. const m_SA_NOCLDSTOP = 1
  470. const m_SA_NOCLDWAIT = 2
  471. const m_SA_NODEFER = 0x40000000
  472. const m_SA_NOMASK = "SA_NODEFER"
  473. const m_SA_ONESHOT = "SA_RESETHAND"
  474. const m_SA_ONSTACK = 0x08000000
  475. const m_SA_RESETHAND = 0x80000000
  476. const m_SA_RESTART = 0x10000000
  477. const m_SA_RESTORER = 0x04000000
  478. const m_SA_SIGINFO = 4
  479. const m_SA_UNSUPPORTED = 0x00000400
  480. const m_SCHAR_MAX = 127
  481. const m_SCHED_BATCH = 3
  482. const m_SCHED_DEADLINE = 6
  483. const m_SCHED_FIFO = 1
  484. const m_SCHED_IDLE = 5
  485. const m_SCHED_OTHER = 0
  486. const m_SCHED_RESET_ON_FORK = 0x40000000
  487. const m_SCHED_RR = 2
  488. const m_SEEK_DATA = 3
  489. const m_SEEK_HOLE = 4
  490. const m_SEGV_ACCERR = 2
  491. const m_SEGV_BNDERR = 3
  492. const m_SEGV_MAPERR = 1
  493. const m_SEGV_MTEAERR = 8
  494. const m_SEGV_MTESERR = 9
  495. const m_SEGV_PKUERR = 4
  496. const m_SEM_NSEMS_MAX = 256
  497. const m_SEM_VALUE_MAX = 0x7fffffff
  498. const m_SHRT_MAX = 0x7fff
  499. const m_SIGABRT = 6
  500. const m_SIGALRM = 14
  501. const m_SIGBUS = 7
  502. const m_SIGCHLD = 17
  503. const m_SIGCONT = 18
  504. const m_SIGEV_NONE = 1
  505. const m_SIGEV_SIGNAL = 0
  506. const m_SIGEV_THREAD = 2
  507. const m_SIGEV_THREAD_ID = 4
  508. const m_SIGFPE = 8
  509. const m_SIGHUP = 1
  510. const m_SIGILL = 4
  511. const m_SIGINT = 2
  512. const m_SIGIO = 29
  513. const m_SIGIOT = "SIGABRT"
  514. const m_SIGKILL = 9
  515. const m_SIGPIPE = 13
  516. const m_SIGPOLL = 29
  517. const m_SIGPROF = 27
  518. const m_SIGPWR = 30
  519. const m_SIGQUIT = 3
  520. const m_SIGSEGV = 11
  521. const m_SIGSTKFLT = 16
  522. const m_SIGSTKSZ = 8192
  523. const m_SIGSTOP = 19
  524. const m_SIGSYS = 31
  525. const m_SIGTERM = 15
  526. const m_SIGTRAP = 5
  527. const m_SIGTSTP = 20
  528. const m_SIGTTIN = 21
  529. const m_SIGTTOU = 22
  530. const m_SIGUNUSED = "SIGSYS"
  531. const m_SIGURG = 23
  532. const m_SIGUSR1 = 10
  533. const m_SIGUSR2 = 12
  534. const m_SIGVTALRM = 26
  535. const m_SIGWINCH = 28
  536. const m_SIGXCPU = 24
  537. const m_SIGXFSZ = 25
  538. const m_SIG_ATOMIC_MAX = "INT32_MAX"
  539. const m_SIG_ATOMIC_MIN = "INT32_MIN"
  540. const m_SIG_BLOCK = 0
  541. const m_SIG_SETMASK = 2
  542. const m_SIG_UNBLOCK = 1
  543. const m_SIZE_MAX = "UINT32_MAX"
  544. const m_SI_KERNEL = 128
  545. const m_SI_USER = 0
  546. const m_SPLICE_F_GIFT = 8
  547. const m_SPLICE_F_MORE = 4
  548. const m_SPLICE_F_MOVE = 1
  549. const m_SPLICE_F_NONBLOCK = 2
  550. const m_SSIZE_MAX = "LONG_MAX"
  551. const m_SS_DISABLE = 2
  552. const m_SS_FLAG_BITS = "SS_AUTODISARM"
  553. const m_SS_ONSTACK = 1
  554. const m_STATX_ALL = 0xfff
  555. const m_STATX_ATIME = 0x20
  556. const m_STATX_BASIC_STATS = 0x7ff
  557. const m_STATX_BLOCKS = 0x400
  558. const m_STATX_BTIME = 0x800
  559. const m_STATX_CTIME = 0x80
  560. const m_STATX_GID = 0x10
  561. const m_STATX_INO = 0x100
  562. const m_STATX_MODE = 2
  563. const m_STATX_MTIME = 0x40
  564. const m_STATX_NLINK = 4
  565. const m_STATX_SIZE = 0x200
  566. const m_STATX_TYPE = 1
  567. const m_STATX_UID = 8
  568. const m_STDC_HEADERS = 1
  569. const m_STDERR_FILENO = 2
  570. const m_STDIN_FILENO = 0
  571. const m_STDOUT_FILENO = 1
  572. const m_SYMLOOP_MAX = 40
  573. const m_SYNC_FILE_RANGE_WAIT_AFTER = 4
  574. const m_SYNC_FILE_RANGE_WAIT_BEFORE = 1
  575. const m_SYNC_FILE_RANGE_WRITE = 2
  576. const m_SYS_SECCOMP = 1
  577. const m_SYS_USER_DISPATCH = 2
  578. const m_S_IEXEC = "S_IXUSR"
  579. const m_S_IFBLK = 0060000
  580. const m_S_IFCHR = 0020000
  581. const m_S_IFDIR = 0040000
  582. const m_S_IFIFO = 0010000
  583. const m_S_IFLNK = 0120000
  584. const m_S_IFMT = 0170000
  585. const m_S_IFREG = 0100000
  586. const m_S_IFSOCK = 0140000
  587. const m_S_IREAD = "S_IRUSR"
  588. const m_S_IRGRP = 0040
  589. const m_S_IROTH = 0004
  590. const m_S_IRUSR = 0400
  591. const m_S_IRWXG = 0070
  592. const m_S_IRWXO = 0007
  593. const m_S_IRWXU = 0700
  594. const m_S_ISGID = 02000
  595. const m_S_ISTXT = "S_ISVTX"
  596. const m_S_ISUID = 04000
  597. const m_S_ISVTX = 01000
  598. const m_S_IWGRP = 0020
  599. const m_S_IWOTH = 0002
  600. const m_S_IWRITE = "S_IWUSR"
  601. const m_S_IWUSR = 0200
  602. const m_S_IXGRP = 0010
  603. const m_S_IXOTH = 0001
  604. const m_S_IXUSR = 0100
  605. const m_TIMER_ABSTIME = 1
  606. const m_TIME_UTC = 1
  607. const m_TMP_MAX = 10000
  608. const m_TRAP_BRANCH = 3
  609. const m_TRAP_BRKPT = 1
  610. const m_TRAP_HWBKPT = 4
  611. const m_TRAP_TRACE = 2
  612. const m_TRAP_UNK = 5
  613. const m_TTY_NAME_MAX = 32
  614. const m_TZNAME_MAX = 6
  615. const m_UCHAR_MAX = 255
  616. const m_UINT16_MAX = 0xffff
  617. const m_UINT32_MAX = "0xffffffffu"
  618. const m_UINT64_MAX = "0xffffffffffffffffu"
  619. const m_UINT8_MAX = 0xff
  620. const m_UINTMAX_MAX = "UINT64_MAX"
  621. const m_UINTPTR_MAX = "UINT32_MAX"
  622. const m_UINT_FAST16_MAX = "UINT32_MAX"
  623. const m_UINT_FAST32_MAX = "UINT32_MAX"
  624. const m_UINT_FAST64_MAX = "UINT64_MAX"
  625. const m_UINT_FAST8_MAX = "UINT8_MAX"
  626. const m_UINT_LEAST16_MAX = "UINT16_MAX"
  627. const m_UINT_LEAST32_MAX = "UINT32_MAX"
  628. const m_UINT_LEAST64_MAX = "UINT64_MAX"
  629. const m_UINT_LEAST8_MAX = "UINT8_MAX"
  630. const m_UINT_MAX = 0xffffffff
  631. const m_USHRT_MAX = 0xffff
  632. const m_UTIME_NOW = 0x3fffffff
  633. const m_UTIME_OMIT = 0x3ffffffe
  634. const m_VERSION = "0.11.7"
  635. const m_WINT_MAX = "UINT32_MAX"
  636. const m_WINT_MIN = 0
  637. const m_WNOHANG = 1
  638. const m_WORD_BIT = 32
  639. const m_WUNTRACED = 2
  640. const m_W_OK = 2
  641. const m_X_OK = 1
  642. const m__ALL_SOURCE = 1
  643. const m__CS_GNU_LIBC_VERSION = 2
  644. const m__CS_GNU_LIBPTHREAD_VERSION = 3
  645. const m__CS_PATH = 0
  646. const m__CS_POSIX_V5_WIDTH_RESTRICTED_ENVS = 4
  647. const m__CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116
  648. const m__CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117
  649. const m__CS_POSIX_V6_ILP32_OFF32_LIBS = 1118
  650. const m__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 1119
  651. const m__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120
  652. const m__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121
  653. const m__CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122
  654. const m__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123
  655. const m__CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124
  656. const m__CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125
  657. const m__CS_POSIX_V6_LP64_OFF64_LIBS = 1126
  658. const m__CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127
  659. const m__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128
  660. const m__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129
  661. const m__CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130
  662. const m__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131
  663. const m__CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 1
  664. const m__CS_POSIX_V7_ILP32_OFF32_CFLAGS = 1132
  665. const m__CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 1133
  666. const m__CS_POSIX_V7_ILP32_OFF32_LIBS = 1134
  667. const m__CS_POSIX_V7_ILP32_OFF32_LINTFLAGS = 1135
  668. const m__CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 1136
  669. const m__CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 1137
  670. const m__CS_POSIX_V7_ILP32_OFFBIG_LIBS = 1138
  671. const m__CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139
  672. const m__CS_POSIX_V7_LP64_OFF64_CFLAGS = 1140
  673. const m__CS_POSIX_V7_LP64_OFF64_LDFLAGS = 1141
  674. const m__CS_POSIX_V7_LP64_OFF64_LIBS = 1142
  675. const m__CS_POSIX_V7_LP64_OFF64_LINTFLAGS = 1143
  676. const m__CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 1144
  677. const m__CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 1145
  678. const m__CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 1146
  679. const m__CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147
  680. const m__CS_POSIX_V7_THREADS_CFLAGS = 1150
  681. const m__CS_POSIX_V7_THREADS_LDFLAGS = 1151
  682. const m__CS_POSIX_V7_WIDTH_RESTRICTED_ENVS = 5
  683. const m__CS_V6_ENV = 1148
  684. const m__CS_V7_ENV = 1149
  685. const m__DARWIN_C_SOURCE = 1
  686. const m__FILE_OFFSET_BITS = 64
  687. const m__GNU_SOURCE = 1
  688. const m__HPUX_ALT_XOPEN_SOCKET_API = 1
  689. const m__ILP32 = 1
  690. const m__IOFBF = 0
  691. const m__IOLBF = 1
  692. const m__IONBF = 2
  693. const m__NETBSD_SOURCE = 1
  694. const m__NSIG = 65
  695. const m__OPENBSD_SOURCE = 1
  696. const m__PC_2_SYMLINKS = 20
  697. const m__PC_ALLOC_SIZE_MIN = 18
  698. const m__PC_ASYNC_IO = 10
  699. const m__PC_CHOWN_RESTRICTED = 6
  700. const m__PC_FILESIZEBITS = 13
  701. const m__PC_LINK_MAX = 0
  702. const m__PC_MAX_CANON = 1
  703. const m__PC_MAX_INPUT = 2
  704. const m__PC_NAME_MAX = 3
  705. const m__PC_NO_TRUNC = 7
  706. const m__PC_PATH_MAX = 4
  707. const m__PC_PIPE_BUF = 5
  708. const m__PC_PRIO_IO = 11
  709. const m__PC_REC_INCR_XFER_SIZE = 14
  710. const m__PC_REC_MAX_XFER_SIZE = 15
  711. const m__PC_REC_MIN_XFER_SIZE = 16
  712. const m__PC_REC_XFER_ALIGN = 17
  713. const m__PC_SOCK_MAXBUF = 12
  714. const m__PC_SYMLINK_MAX = 19
  715. const m__PC_SYNC_IO = 9
  716. const m__PC_VDISABLE = 8
  717. const m__POSIX2_BC_BASE_MAX = 99
  718. const m__POSIX2_BC_DIM_MAX = 2048
  719. const m__POSIX2_BC_SCALE_MAX = 99
  720. const m__POSIX2_BC_STRING_MAX = 1000
  721. const m__POSIX2_CHARCLASS_NAME_MAX = 14
  722. const m__POSIX2_COLL_WEIGHTS_MAX = 2
  723. const m__POSIX2_C_BIND = "_POSIX_VERSION"
  724. const m__POSIX2_EXPR_NEST_MAX = 32
  725. const m__POSIX2_LINE_MAX = 2048
  726. const m__POSIX2_RE_DUP_MAX = 255
  727. const m__POSIX2_VERSION = "_POSIX_VERSION"
  728. const m__POSIX_ADVISORY_INFO = "_POSIX_VERSION"
  729. const m__POSIX_AIO_LISTIO_MAX = 2
  730. const m__POSIX_AIO_MAX = 1
  731. const m__POSIX_ARG_MAX = 4096
  732. const m__POSIX_ASYNCHRONOUS_IO = "_POSIX_VERSION"
  733. const m__POSIX_BARRIERS = "_POSIX_VERSION"
  734. const m__POSIX_CHILD_MAX = 25
  735. const m__POSIX_CHOWN_RESTRICTED = 1
  736. const m__POSIX_CLOCKRES_MIN = 20000000
  737. const m__POSIX_CLOCK_SELECTION = "_POSIX_VERSION"
  738. const m__POSIX_CPUTIME = "_POSIX_VERSION"
  739. const m__POSIX_DELAYTIMER_MAX = 32
  740. const m__POSIX_FSYNC = "_POSIX_VERSION"
  741. const m__POSIX_HOST_NAME_MAX = 255
  742. const m__POSIX_IPV6 = "_POSIX_VERSION"
  743. const m__POSIX_JOB_CONTROL = 1
  744. const m__POSIX_LINK_MAX = 8
  745. const m__POSIX_LOGIN_NAME_MAX = 9
  746. const m__POSIX_MAPPED_FILES = "_POSIX_VERSION"
  747. const m__POSIX_MAX_CANON = 255
  748. const m__POSIX_MAX_INPUT = 255
  749. const m__POSIX_MEMLOCK = "_POSIX_VERSION"
  750. const m__POSIX_MEMLOCK_RANGE = "_POSIX_VERSION"
  751. const m__POSIX_MEMORY_PROTECTION = "_POSIX_VERSION"
  752. const m__POSIX_MESSAGE_PASSING = "_POSIX_VERSION"
  753. const m__POSIX_MONOTONIC_CLOCK = "_POSIX_VERSION"
  754. const m__POSIX_MQ_OPEN_MAX = 8
  755. const m__POSIX_MQ_PRIO_MAX = 32
  756. const m__POSIX_NAME_MAX = 14
  757. const m__POSIX_NGROUPS_MAX = 8
  758. const m__POSIX_NO_TRUNC = 1
  759. const m__POSIX_OPEN_MAX = 20
  760. const m__POSIX_PATH_MAX = 256
  761. const m__POSIX_PIPE_BUF = 512
  762. const m__POSIX_PTHREAD_SEMANTICS = 1
  763. const m__POSIX_RAW_SOCKETS = "_POSIX_VERSION"
  764. const m__POSIX_READER_WRITER_LOCKS = "_POSIX_VERSION"
  765. const m__POSIX_REALTIME_SIGNALS = "_POSIX_VERSION"
  766. const m__POSIX_REGEXP = 1
  767. const m__POSIX_RE_DUP_MAX = 255
  768. const m__POSIX_RTSIG_MAX = 8
  769. const m__POSIX_SAVED_IDS = 1
  770. const m__POSIX_SEMAPHORES = "_POSIX_VERSION"
  771. const m__POSIX_SEM_NSEMS_MAX = 256
  772. const m__POSIX_SEM_VALUE_MAX = 32767
  773. const m__POSIX_SHARED_MEMORY_OBJECTS = "_POSIX_VERSION"
  774. const m__POSIX_SHELL = 1
  775. const m__POSIX_SIGQUEUE_MAX = 32
  776. const m__POSIX_SPAWN = "_POSIX_VERSION"
  777. const m__POSIX_SPIN_LOCKS = "_POSIX_VERSION"
  778. const m__POSIX_SSIZE_MAX = 32767
  779. const m__POSIX_SS_REPL_MAX = 4
  780. const m__POSIX_STREAM_MAX = 8
  781. const m__POSIX_SYMLINK_MAX = 255
  782. const m__POSIX_SYMLOOP_MAX = 8
  783. const m__POSIX_THREADS = "_POSIX_VERSION"
  784. const m__POSIX_THREAD_ATTR_STACKADDR = "_POSIX_VERSION"
  785. const m__POSIX_THREAD_ATTR_STACKSIZE = "_POSIX_VERSION"
  786. const m__POSIX_THREAD_CPUTIME = "_POSIX_VERSION"
  787. const m__POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4
  788. const m__POSIX_THREAD_KEYS_MAX = 128
  789. const m__POSIX_THREAD_PRIORITY_SCHEDULING = "_POSIX_VERSION"
  790. const m__POSIX_THREAD_PROCESS_SHARED = "_POSIX_VERSION"
  791. const m__POSIX_THREAD_SAFE_FUNCTIONS = "_POSIX_VERSION"
  792. const m__POSIX_THREAD_THREADS_MAX = 64
  793. const m__POSIX_TIMEOUTS = "_POSIX_VERSION"
  794. const m__POSIX_TIMERS = "_POSIX_VERSION"
  795. const m__POSIX_TIMER_MAX = 32
  796. const m__POSIX_TRACE_EVENT_NAME_MAX = 30
  797. const m__POSIX_TRACE_NAME_MAX = 8
  798. const m__POSIX_TRACE_SYS_MAX = 8
  799. const m__POSIX_TRACE_USER_EVENT_MAX = 32
  800. const m__POSIX_TTY_NAME_MAX = 9
  801. const m__POSIX_TZNAME_MAX = 6
  802. const m__POSIX_V6_ILP32_OFFBIG = 1
  803. const m__POSIX_V7_ILP32_OFFBIG = 1
  804. const m__POSIX_VDISABLE = 0
  805. const m__POSIX_VERSION = 200809
  806. const m__REDIR_TIME64 = 1
  807. const m__SC_2_CHAR_TERM = 95
  808. const m__SC_2_C_BIND = 47
  809. const m__SC_2_C_DEV = 48
  810. const m__SC_2_FORT_DEV = 49
  811. const m__SC_2_FORT_RUN = 50
  812. const m__SC_2_LOCALEDEF = 52
  813. const m__SC_2_PBS = 168
  814. const m__SC_2_PBS_ACCOUNTING = 169
  815. const m__SC_2_PBS_CHECKPOINT = 175
  816. const m__SC_2_PBS_LOCATE = 170
  817. const m__SC_2_PBS_MESSAGE = 171
  818. const m__SC_2_PBS_TRACK = 172
  819. const m__SC_2_SW_DEV = 51
  820. const m__SC_2_UPE = 97
  821. const m__SC_2_VERSION = 46
  822. const m__SC_ADVISORY_INFO = 132
  823. const m__SC_AIO_LISTIO_MAX = 23
  824. const m__SC_AIO_MAX = 24
  825. const m__SC_AIO_PRIO_DELTA_MAX = 25
  826. const m__SC_ARG_MAX = 0
  827. const m__SC_ASYNCHRONOUS_IO = 12
  828. const m__SC_ATEXIT_MAX = 87
  829. const m__SC_AVPHYS_PAGES = 86
  830. const m__SC_BARRIERS = 133
  831. const m__SC_BC_BASE_MAX = 36
  832. const m__SC_BC_DIM_MAX = 37
  833. const m__SC_BC_SCALE_MAX = 38
  834. const m__SC_BC_STRING_MAX = 39
  835. const m__SC_CHILD_MAX = 1
  836. const m__SC_CLK_TCK = 2
  837. const m__SC_CLOCK_SELECTION = 137
  838. const m__SC_COLL_WEIGHTS_MAX = 40
  839. const m__SC_CPUTIME = 138
  840. const m__SC_DELAYTIMER_MAX = 26
  841. const m__SC_EXPR_NEST_MAX = 42
  842. const m__SC_FSYNC = 15
  843. const m__SC_GETGR_R_SIZE_MAX = 69
  844. const m__SC_GETPW_R_SIZE_MAX = 70
  845. const m__SC_HOST_NAME_MAX = 180
  846. const m__SC_IOV_MAX = 60
  847. const m__SC_IPV6 = 235
  848. const m__SC_JOB_CONTROL = 7
  849. const m__SC_LINE_MAX = 43
  850. const m__SC_LOGIN_NAME_MAX = 71
  851. const m__SC_MAPPED_FILES = 16
  852. const m__SC_MEMLOCK = 17
  853. const m__SC_MEMLOCK_RANGE = 18
  854. const m__SC_MEMORY_PROTECTION = 19
  855. const m__SC_MESSAGE_PASSING = 20
  856. const m__SC_MINSIGSTKSZ = 249
  857. const m__SC_MONOTONIC_CLOCK = 149
  858. const m__SC_MQ_OPEN_MAX = 27
  859. const m__SC_MQ_PRIO_MAX = 28
  860. const m__SC_NGROUPS_MAX = 3
  861. const m__SC_NPROCESSORS_CONF = 83
  862. const m__SC_NPROCESSORS_ONLN = 84
  863. const m__SC_NZERO = 109
  864. const m__SC_OPEN_MAX = 4
  865. const m__SC_PAGESIZE = 30
  866. const m__SC_PAGE_SIZE = 30
  867. const m__SC_PASS_MAX = 88
  868. const m__SC_PHYS_PAGES = 85
  869. const m__SC_PRIORITIZED_IO = 13
  870. const m__SC_PRIORITY_SCHEDULING = 10
  871. const m__SC_RAW_SOCKETS = 236
  872. const m__SC_READER_WRITER_LOCKS = 153
  873. const m__SC_REALTIME_SIGNALS = 9
  874. const m__SC_REGEXP = 155
  875. const m__SC_RE_DUP_MAX = 44
  876. const m__SC_RTSIG_MAX = 31
  877. const m__SC_SAVED_IDS = 8
  878. const m__SC_SEMAPHORES = 21
  879. const m__SC_SEM_NSEMS_MAX = 32
  880. const m__SC_SEM_VALUE_MAX = 33
  881. const m__SC_SHARED_MEMORY_OBJECTS = 22
  882. const m__SC_SHELL = 157
  883. const m__SC_SIGQUEUE_MAX = 34
  884. const m__SC_SIGSTKSZ = 250
  885. const m__SC_SPAWN = 159
  886. const m__SC_SPIN_LOCKS = 154
  887. const m__SC_SPORADIC_SERVER = 160
  888. const m__SC_SS_REPL_MAX = 241
  889. const m__SC_STREAMS = 174
  890. const m__SC_STREAM_MAX = 5
  891. const m__SC_SYMLOOP_MAX = 173
  892. const m__SC_SYNCHRONIZED_IO = 14
  893. const m__SC_THREADS = 67
  894. const m__SC_THREAD_ATTR_STACKADDR = 77
  895. const m__SC_THREAD_ATTR_STACKSIZE = 78
  896. const m__SC_THREAD_CPUTIME = 139
  897. const m__SC_THREAD_DESTRUCTOR_ITERATIONS = 73
  898. const m__SC_THREAD_KEYS_MAX = 74
  899. const m__SC_THREAD_PRIORITY_SCHEDULING = 79
  900. const m__SC_THREAD_PRIO_INHERIT = 80
  901. const m__SC_THREAD_PRIO_PROTECT = 81
  902. const m__SC_THREAD_PROCESS_SHARED = 82
  903. const m__SC_THREAD_ROBUST_PRIO_INHERIT = 247
  904. const m__SC_THREAD_ROBUST_PRIO_PROTECT = 248
  905. const m__SC_THREAD_SAFE_FUNCTIONS = 68
  906. const m__SC_THREAD_SPORADIC_SERVER = 161
  907. const m__SC_THREAD_STACK_MIN = 75
  908. const m__SC_THREAD_THREADS_MAX = 76
  909. const m__SC_TIMEOUTS = 164
  910. const m__SC_TIMERS = 11
  911. const m__SC_TIMER_MAX = 35
  912. const m__SC_TRACE = 181
  913. const m__SC_TRACE_EVENT_FILTER = 182
  914. const m__SC_TRACE_EVENT_NAME_MAX = 242
  915. const m__SC_TRACE_INHERIT = 183
  916. const m__SC_TRACE_LOG = 184
  917. const m__SC_TRACE_NAME_MAX = 243
  918. const m__SC_TRACE_SYS_MAX = 244
  919. const m__SC_TRACE_USER_EVENT_MAX = 245
  920. const m__SC_TTY_NAME_MAX = 72
  921. const m__SC_TYPED_MEMORY_OBJECTS = 165
  922. const m__SC_TZNAME_MAX = 6
  923. const m__SC_UIO_MAXIOV = 60
  924. const m__SC_V6_ILP32_OFF32 = 176
  925. const m__SC_V6_ILP32_OFFBIG = 177
  926. const m__SC_V6_LP64_OFF64 = 178
  927. const m__SC_V6_LPBIG_OFFBIG = 179
  928. const m__SC_V7_ILP32_OFF32 = 237
  929. const m__SC_V7_ILP32_OFFBIG = 238
  930. const m__SC_V7_LP64_OFF64 = 239
  931. const m__SC_V7_LPBIG_OFFBIG = 240
  932. const m__SC_VERSION = 29
  933. const m__SC_XBS5_ILP32_OFF32 = 125
  934. const m__SC_XBS5_ILP32_OFFBIG = 126
  935. const m__SC_XBS5_LP64_OFF64 = 127
  936. const m__SC_XBS5_LPBIG_OFFBIG = 128
  937. const m__SC_XOPEN_CRYPT = 92
  938. const m__SC_XOPEN_ENH_I18N = 93
  939. const m__SC_XOPEN_LEGACY = 129
  940. const m__SC_XOPEN_REALTIME = 130
  941. const m__SC_XOPEN_REALTIME_THREADS = 131
  942. const m__SC_XOPEN_SHM = 94
  943. const m__SC_XOPEN_STREAMS = 246
  944. const m__SC_XOPEN_UNIX = 91
  945. const m__SC_XOPEN_VERSION = 89
  946. const m__SC_XOPEN_XCU_VERSION = 90
  947. const m__SC_XOPEN_XPG2 = 98
  948. const m__SC_XOPEN_XPG3 = 99
  949. const m__SC_XOPEN_XPG4 = 100
  950. const m__STDC_PREDEF_H = 1
  951. const m__SYS_CDEFS_H = 1
  952. const m__TANDEM_SOURCE = 1
  953. const m__XOPEN_ENH_I18N = 1
  954. const m__XOPEN_IOV_MAX = 16
  955. const m__XOPEN_NAME_MAX = 255
  956. const m__XOPEN_PATH_MAX = 1024
  957. const m__XOPEN_UNIX = 1
  958. const m__XOPEN_VERSION = 700
  959. const m___ATOMIC_ACQUIRE = 2
  960. const m___ATOMIC_ACQ_REL = 4
  961. const m___ATOMIC_CONSUME = 1
  962. const m___ATOMIC_HLE_ACQUIRE = 65536
  963. const m___ATOMIC_HLE_RELEASE = 131072
  964. const m___ATOMIC_RELAXED = 0
  965. const m___ATOMIC_RELEASE = 3
  966. const m___ATOMIC_SEQ_CST = 5
  967. const m___BIGGEST_ALIGNMENT__ = 16
  968. const m___BIG_ENDIAN = 4321
  969. const m___BYTE_ORDER = 1234
  970. const m___BYTE_ORDER__ = "__ORDER_LITTLE_ENDIAN__"
  971. const m___CCGO__ = 1
  972. const m___CHAR_BIT__ = 8
  973. const m___DBL_DECIMAL_DIG__ = 17
  974. const m___DBL_DIG__ = 15
  975. const m___DBL_HAS_DENORM__ = 1
  976. const m___DBL_HAS_INFINITY__ = 1
  977. const m___DBL_HAS_QUIET_NAN__ = 1
  978. const m___DBL_IS_IEC_60559__ = 2
  979. const m___DBL_MANT_DIG__ = 53
  980. const m___DBL_MAX_10_EXP__ = 308
  981. const m___DBL_MAX_EXP__ = 1024
  982. const m___DEC128_EPSILON__ = 1e-33
  983. const m___DEC128_MANT_DIG__ = 34
  984. const m___DEC128_MAX_EXP__ = 6145
  985. const m___DEC128_MAX__ = "9.999999999999999999999999999999999E6144"
  986. const m___DEC128_MIN__ = 1e-6143
  987. const m___DEC128_SUBNORMAL_MIN__ = 0.000000000000000000000000000000001e-6143
  988. const m___DEC32_EPSILON__ = 1e-6
  989. const m___DEC32_MANT_DIG__ = 7
  990. const m___DEC32_MAX_EXP__ = 97
  991. const m___DEC32_MAX__ = 9.999999e96
  992. const m___DEC32_MIN__ = 1e-95
  993. const m___DEC32_SUBNORMAL_MIN__ = 0.000001e-95
  994. const m___DEC64_EPSILON__ = 1e-15
  995. const m___DEC64_MANT_DIG__ = 16
  996. const m___DEC64_MAX_EXP__ = 385
  997. const m___DEC64_MAX__ = "9.999999999999999E384"
  998. const m___DEC64_MIN__ = 1e-383
  999. const m___DEC64_SUBNORMAL_MIN__ = 0.000000000000001e-383
  1000. const m___DECIMAL_BID_FORMAT__ = 1
  1001. const m___DECIMAL_DIG__ = 17
  1002. const m___DEC_EVAL_METHOD__ = 2
  1003. const m___ELF__ = 1
  1004. const m___EXTENSIONS__ = 1
  1005. const m___FINITE_MATH_ONLY__ = 0
  1006. const m___FLOAT_WORD_ORDER__ = "__ORDER_LITTLE_ENDIAN__"
  1007. const m___FLT128_DECIMAL_DIG__ = 36
  1008. const m___FLT128_DENORM_MIN__ = 6.47517511943802511092443895822764655e-4966
  1009. const m___FLT128_DIG__ = 33
  1010. const m___FLT128_EPSILON__ = 1.92592994438723585305597794258492732e-34
  1011. const m___FLT128_HAS_DENORM__ = 1
  1012. const m___FLT128_HAS_INFINITY__ = 1
  1013. const m___FLT128_HAS_QUIET_NAN__ = 1
  1014. const m___FLT128_IS_IEC_60559__ = 2
  1015. const m___FLT128_MANT_DIG__ = 113
  1016. const m___FLT128_MAX_10_EXP__ = 4932
  1017. const m___FLT128_MAX_EXP__ = 16384
  1018. const m___FLT128_MAX__ = "1.18973149535723176508575932662800702e+4932"
  1019. const m___FLT128_MIN__ = 3.36210314311209350626267781732175260e-4932
  1020. const m___FLT128_NORM_MAX__ = "1.18973149535723176508575932662800702e+4932"
  1021. const m___FLT32X_DECIMAL_DIG__ = 17
  1022. const m___FLT32X_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324
  1023. const m___FLT32X_DIG__ = 15
  1024. const m___FLT32X_EPSILON__ = 2.22044604925031308084726333618164062e-16
  1025. const m___FLT32X_HAS_DENORM__ = 1
  1026. const m___FLT32X_HAS_INFINITY__ = 1
  1027. const m___FLT32X_HAS_QUIET_NAN__ = 1
  1028. const m___FLT32X_IS_IEC_60559__ = 2
  1029. const m___FLT32X_MANT_DIG__ = 53
  1030. const m___FLT32X_MAX_10_EXP__ = 308
  1031. const m___FLT32X_MAX_EXP__ = 1024
  1032. const m___FLT32X_MAX__ = 1.79769313486231570814527423731704357e+308
  1033. const m___FLT32X_MIN__ = 2.22507385850720138309023271733240406e-308
  1034. const m___FLT32X_NORM_MAX__ = 1.79769313486231570814527423731704357e+308
  1035. const m___FLT32_DECIMAL_DIG__ = 9
  1036. const m___FLT32_DENORM_MIN__ = 1.40129846432481707092372958328991613e-45
  1037. const m___FLT32_DIG__ = 6
  1038. const m___FLT32_EPSILON__ = 1.19209289550781250000000000000000000e-7
  1039. const m___FLT32_HAS_DENORM__ = 1
  1040. const m___FLT32_HAS_INFINITY__ = 1
  1041. const m___FLT32_HAS_QUIET_NAN__ = 1
  1042. const m___FLT32_IS_IEC_60559__ = 2
  1043. const m___FLT32_MANT_DIG__ = 24
  1044. const m___FLT32_MAX_10_EXP__ = 38
  1045. const m___FLT32_MAX_EXP__ = 128
  1046. const m___FLT32_MAX__ = 3.40282346638528859811704183484516925e+38
  1047. const m___FLT32_MIN__ = 1.17549435082228750796873653722224568e-38
  1048. const m___FLT32_NORM_MAX__ = 3.40282346638528859811704183484516925e+38
  1049. const m___FLT64X_DECIMAL_DIG__ = 36
  1050. const m___FLT64X_DENORM_MIN__ = 6.47517511943802511092443895822764655e-4966
  1051. const m___FLT64X_DIG__ = 33
  1052. const m___FLT64X_EPSILON__ = 1.92592994438723585305597794258492732e-34
  1053. const m___FLT64X_HAS_DENORM__ = 1
  1054. const m___FLT64X_HAS_INFINITY__ = 1
  1055. const m___FLT64X_HAS_QUIET_NAN__ = 1
  1056. const m___FLT64X_IS_IEC_60559__ = 2
  1057. const m___FLT64X_MANT_DIG__ = 113
  1058. const m___FLT64X_MAX_10_EXP__ = 4932
  1059. const m___FLT64X_MAX_EXP__ = 16384
  1060. const m___FLT64X_MAX__ = "1.18973149535723176508575932662800702e+4932"
  1061. const m___FLT64X_MIN__ = 3.36210314311209350626267781732175260e-4932
  1062. const m___FLT64X_NORM_MAX__ = "1.18973149535723176508575932662800702e+4932"
  1063. const m___FLT64_DECIMAL_DIG__ = 17
  1064. const m___FLT64_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324
  1065. const m___FLT64_DIG__ = 15
  1066. const m___FLT64_EPSILON__ = 2.22044604925031308084726333618164062e-16
  1067. const m___FLT64_HAS_DENORM__ = 1
  1068. const m___FLT64_HAS_INFINITY__ = 1
  1069. const m___FLT64_HAS_QUIET_NAN__ = 1
  1070. const m___FLT64_IS_IEC_60559__ = 2
  1071. const m___FLT64_MANT_DIG__ = 53
  1072. const m___FLT64_MAX_10_EXP__ = 308
  1073. const m___FLT64_MAX_EXP__ = 1024
  1074. const m___FLT64_MAX__ = 1.79769313486231570814527423731704357e+308
  1075. const m___FLT64_MIN__ = 2.22507385850720138309023271733240406e-308
  1076. const m___FLT64_NORM_MAX__ = 1.79769313486231570814527423731704357e+308
  1077. const m___FLT_DECIMAL_DIG__ = 9
  1078. const m___FLT_DENORM_MIN__ = 1.40129846432481707092372958328991613e-45
  1079. const m___FLT_DIG__ = 6
  1080. const m___FLT_EPSILON__ = 1.19209289550781250000000000000000000e-7
  1081. const m___FLT_EVAL_METHOD_TS_18661_3__ = 2
  1082. const m___FLT_EVAL_METHOD__ = 2
  1083. const m___FLT_HAS_DENORM__ = 1
  1084. const m___FLT_HAS_INFINITY__ = 1
  1085. const m___FLT_HAS_QUIET_NAN__ = 1
  1086. const m___FLT_IS_IEC_60559__ = 2
  1087. const m___FLT_MANT_DIG__ = 24
  1088. const m___FLT_MAX_10_EXP__ = 38
  1089. const m___FLT_MAX_EXP__ = 128
  1090. const m___FLT_MAX__ = 3.40282346638528859811704183484516925e+38
  1091. const m___FLT_MIN__ = 1.17549435082228750796873653722224568e-38
  1092. const m___FLT_NORM_MAX__ = 3.40282346638528859811704183484516925e+38
  1093. const m___FLT_RADIX__ = 2
  1094. const m___FUNCTION__ = "__func__"
  1095. const m___GCC_ASM_FLAG_OUTPUTS__ = 1
  1096. const m___GCC_ATOMIC_BOOL_LOCK_FREE = 2
  1097. const m___GCC_ATOMIC_CHAR16_T_LOCK_FREE = 2
  1098. const m___GCC_ATOMIC_CHAR32_T_LOCK_FREE = 2
  1099. const m___GCC_ATOMIC_CHAR_LOCK_FREE = 2
  1100. const m___GCC_ATOMIC_INT_LOCK_FREE = 2
  1101. const m___GCC_ATOMIC_LLONG_LOCK_FREE = 2
  1102. const m___GCC_ATOMIC_LONG_LOCK_FREE = 2
  1103. const m___GCC_ATOMIC_POINTER_LOCK_FREE = 2
  1104. const m___GCC_ATOMIC_SHORT_LOCK_FREE = 2
  1105. const m___GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1
  1106. const m___GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2
  1107. const m___GCC_CONSTRUCTIVE_SIZE = 64
  1108. const m___GCC_DESTRUCTIVE_SIZE = 64
  1109. const m___GCC_HAVE_DWARF2_CFI_ASM = 1
  1110. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = 1
  1111. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 = 1
  1112. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = 1
  1113. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1
  1114. const m___GCC_IEC_559 = 2
  1115. const m___GCC_IEC_559_COMPLEX = 2
  1116. const m___GNUC_EXECUTION_CHARSET_NAME = "UTF-8"
  1117. const m___GNUC_MINOR__ = 2
  1118. const m___GNUC_PATCHLEVEL__ = 0
  1119. const m___GNUC_STDC_INLINE__ = 1
  1120. const m___GNUC_WIDE_EXECUTION_CHARSET_NAME = "UTF-32LE"
  1121. const m___GNUC__ = 12
  1122. const m___GXX_ABI_VERSION = 1017
  1123. const m___HAVE_GENERIC_SELECTION = 0
  1124. const m___HAVE_SPECULATION_SAFE_VALUE = 1
  1125. const m___ILP32__ = 1
  1126. const m___INT16_MAX__ = 0x7fff
  1127. const m___INT32_MAX__ = 0x7fffffff
  1128. const m___INT32_TYPE__ = "int"
  1129. const m___INT64_MAX__ = 0x7fffffffffffffff
  1130. const m___INT8_MAX__ = 0x7f
  1131. const m___INTMAX_MAX__ = 0x7fffffffffffffff
  1132. const m___INTMAX_WIDTH__ = 64
  1133. const m___INTPTR_MAX__ = 0x7fffffff
  1134. const m___INTPTR_TYPE__ = "int"
  1135. const m___INTPTR_WIDTH__ = 32
  1136. const m___INT_FAST16_MAX__ = 0x7fffffff
  1137. const m___INT_FAST16_TYPE__ = "int"
  1138. const m___INT_FAST16_WIDTH__ = 32
  1139. const m___INT_FAST32_MAX__ = 0x7fffffff
  1140. const m___INT_FAST32_TYPE__ = "int"
  1141. const m___INT_FAST32_WIDTH__ = 32
  1142. const m___INT_FAST64_MAX__ = 0x7fffffffffffffff
  1143. const m___INT_FAST64_WIDTH__ = 64
  1144. const m___INT_FAST8_MAX__ = 0x7f
  1145. const m___INT_FAST8_WIDTH__ = 8
  1146. const m___INT_LEAST16_MAX__ = 0x7fff
  1147. const m___INT_LEAST16_WIDTH__ = 16
  1148. const m___INT_LEAST32_MAX__ = 0x7fffffff
  1149. const m___INT_LEAST32_TYPE__ = "int"
  1150. const m___INT_LEAST32_WIDTH__ = 32
  1151. const m___INT_LEAST64_MAX__ = 0x7fffffffffffffff
  1152. const m___INT_LEAST64_WIDTH__ = 64
  1153. const m___INT_LEAST8_MAX__ = 0x7f
  1154. const m___INT_LEAST8_WIDTH__ = 8
  1155. const m___INT_MAX__ = 0x7fffffff
  1156. const m___INT_WIDTH__ = 32
  1157. const m___LAHF_SAHF__ = 1
  1158. const m___LDBL_DECIMAL_DIG__ = 17
  1159. const m___LDBL_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324
  1160. const m___LDBL_DIG__ = 15
  1161. const m___LDBL_EPSILON__ = 2.22044604925031308084726333618164062e-16
  1162. const m___LDBL_HAS_DENORM__ = 1
  1163. const m___LDBL_HAS_INFINITY__ = 1
  1164. const m___LDBL_HAS_QUIET_NAN__ = 1
  1165. const m___LDBL_IS_IEC_60559__ = 2
  1166. const m___LDBL_MANT_DIG__ = 53
  1167. const m___LDBL_MAX_10_EXP__ = 308
  1168. const m___LDBL_MAX_EXP__ = 1024
  1169. const m___LDBL_MAX__ = 1.79769313486231570814527423731704357e+308
  1170. const m___LDBL_MIN__ = 2.22507385850720138309023271733240406e-308
  1171. const m___LDBL_NORM_MAX__ = 1.79769313486231570814527423731704357e+308
  1172. const m___LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = 0
  1173. const m___LITTLE_ENDIAN = 1234
  1174. const m___LONG_DOUBLE_64__ = 1
  1175. const m___LONG_LONG_MAX__ = 0x7fffffffffffffff
  1176. const m___LONG_LONG_WIDTH__ = 64
  1177. const m___LONG_MAX = 0x7fffffff
  1178. const m___LONG_MAX__ = 0x7fffffff
  1179. const m___LONG_WIDTH__ = 32
  1180. const m___NO_INLINE__ = 1
  1181. const m___ORDER_BIG_ENDIAN__ = 4321
  1182. const m___ORDER_LITTLE_ENDIAN__ = 1234
  1183. const m___ORDER_PDP_ENDIAN__ = 3412
  1184. const m___PDP_ENDIAN = 3412
  1185. const m___PIC__ = 2
  1186. const m___PIE__ = 2
  1187. const m___PRAGMA_REDEFINE_EXTNAME = 1
  1188. const m___PRETTY_FUNCTION__ = "__func__"
  1189. const m___PTRDIFF_MAX__ = 0x7fffffff
  1190. const m___PTRDIFF_TYPE__ = "int"
  1191. const m___PTRDIFF_WIDTH__ = 32
  1192. const m___REENTRANT = 1
  1193. const m___SCHAR_MAX__ = 0x7f
  1194. const m___SCHAR_WIDTH__ = 8
  1195. const m___SEG_FS = 1
  1196. const m___SEG_GS = 1
  1197. const m___SHRT_MAX__ = 0x7fff
  1198. const m___SHRT_WIDTH__ = 16
  1199. const m___SIG_ATOMIC_MAX__ = 0x7fffffff
  1200. const m___SIG_ATOMIC_TYPE__ = "int"
  1201. const m___SIG_ATOMIC_WIDTH__ = 32
  1202. const m___SIZEOF_DOUBLE__ = 8
  1203. const m___SIZEOF_FLOAT128__ = 16
  1204. const m___SIZEOF_FLOAT80__ = 12
  1205. const m___SIZEOF_FLOAT__ = 4
  1206. const m___SIZEOF_INT__ = 4
  1207. const m___SIZEOF_LONG_DOUBLE__ = 8
  1208. const m___SIZEOF_LONG_LONG__ = 8
  1209. const m___SIZEOF_LONG__ = 4
  1210. const m___SIZEOF_POINTER__ = 4
  1211. const m___SIZEOF_PTRDIFF_T__ = 4
  1212. const m___SIZEOF_SHORT__ = 2
  1213. const m___SIZEOF_SIZE_T__ = 4
  1214. const m___SIZEOF_WCHAR_T__ = 4
  1215. const m___SIZEOF_WINT_T__ = 4
  1216. const m___SIZE_MAX__ = 0xffffffff
  1217. const m___SIZE_WIDTH__ = 32
  1218. const m___STDC_HOSTED__ = 1
  1219. const m___STDC_IEC_559_COMPLEX__ = 1
  1220. const m___STDC_IEC_559__ = 1
  1221. const m___STDC_IEC_60559_BFP__ = 201404
  1222. const m___STDC_IEC_60559_COMPLEX__ = 201404
  1223. const m___STDC_ISO_10646__ = 201706
  1224. const m___STDC_UTF_16__ = 1
  1225. const m___STDC_UTF_32__ = 1
  1226. const m___STDC_VERSION__ = 201710
  1227. const m___STDC_WANT_IEC_60559_ATTRIBS_EXT__ = 1
  1228. const m___STDC_WANT_IEC_60559_BFP_EXT__ = 1
  1229. const m___STDC_WANT_IEC_60559_DFP_EXT__ = 1
  1230. const m___STDC_WANT_IEC_60559_FUNCS_EXT__ = 1
  1231. const m___STDC_WANT_IEC_60559_TYPES_EXT__ = 1
  1232. const m___STDC_WANT_LIB_EXT2__ = 1
  1233. const m___STDC_WANT_MATH_SPEC_FUNCS__ = 1
  1234. const m___STDC__ = 1
  1235. const m___UINT16_MAX__ = 0xffff
  1236. const m___UINT32_MAX__ = 0xffffffff
  1237. const m___UINT64_MAX__ = "0xffffffffffffffffU"
  1238. const m___UINT8_MAX__ = 0xff
  1239. const m___UINTMAX_MAX__ = "0xffffffffffffffffU"
  1240. const m___UINTPTR_MAX__ = 0xffffffff
  1241. const m___UINT_FAST16_MAX__ = 0xffffffff
  1242. const m___UINT_FAST32_MAX__ = 0xffffffff
  1243. const m___UINT_FAST64_MAX__ = "0xffffffffffffffffU"
  1244. const m___UINT_FAST8_MAX__ = 0xff
  1245. const m___UINT_LEAST16_MAX__ = 0xffff
  1246. const m___UINT_LEAST32_MAX__ = 0xffffffff
  1247. const m___UINT_LEAST64_MAX__ = "0xffffffffffffffffU"
  1248. const m___UINT_LEAST8_MAX__ = 0xff
  1249. const m___USE_TIME_BITS64 = 1
  1250. const m___VERSION__ = "12.2.0"
  1251. const m___WCHAR_MAX__ = 0x7fffffff
  1252. const m___WCHAR_WIDTH__ = 32
  1253. const m___WINT_MAX__ = 0xffffffff
  1254. const m___WINT_MIN__ = 0
  1255. const m___WINT_WIDTH__ = 32
  1256. const m___WORDSIZE = 32
  1257. const m___WORDSIZE32_PTRDIFF_LONG = 0
  1258. const m___WORDSIZE32_SIZE_ULONG = 0
  1259. const m___WORDSIZE_TIME64_COMPAT32 = 1
  1260. const m___code_model_32__ = 1
  1261. const m___glibc_c99_flexarr_available = 1
  1262. const m___gnu_linux__ = 1
  1263. const m___i386 = 1
  1264. const m___i386__ = 1
  1265. const m___i686 = 1
  1266. const m___i686__ = 1
  1267. const m___inline = "inline"
  1268. const m___linux = 1
  1269. const m___linux__ = 1
  1270. const m___pentiumpro = 1
  1271. const m___pentiumpro__ = 1
  1272. const m___pic__ = 2
  1273. const m___pie__ = 2
  1274. const m___restrict = "restrict"
  1275. const m___tm_gmtoff = "tm_gmtoff"
  1276. const m___tm_zone = "tm_zone"
  1277. const m___ucontext = "ucontext"
  1278. const m___unix = 1
  1279. const m___unix__ = 1
  1280. const m_alloca = "__builtin_alloca"
  1281. const m_i386 = 1
  1282. const m_inline = "__inline"
  1283. const m_linux = 1
  1284. const m_loff_t = "off_t"
  1285. const m_prlimit64 = "prlimit"
  1286. const m_unix = 1
  1287. type t__builtin_va_list = uintptr
  1288. type t__predefined_size_t = uint32
  1289. type t__predefined_wchar_t = int32
  1290. type t__predefined_ptrdiff_t = int32
  1291. type Tsize_t = uint32
  1292. type Tssize_t = int32
  1293. type Tmode_t = uint32
  1294. type Toff_t = int64
  1295. type Tpid_t = int32
  1296. type Tiovec = struct {
  1297. Fiov_base uintptr
  1298. Fiov_len Tsize_t
  1299. }
  1300. type Tflock = struct {
  1301. Fl_type int16
  1302. Fl_whence int16
  1303. Fl_start Toff_t
  1304. Fl_len Toff_t
  1305. Fl_pid Tpid_t
  1306. }
  1307. type Tfile_handle = struct {
  1308. Fhandle_bytes uint32
  1309. Fhandle_type int32
  1310. }
  1311. type Tf_owner_ex = struct {
  1312. Ftype1 int32
  1313. Fpid Tpid_t
  1314. }
  1315. type Ttime_t = int64
  1316. type Tclock_t = int32
  1317. type Ttimespec = struct {
  1318. Ftv_sec Ttime_t
  1319. Ftv_nsec int32
  1320. F__ccgo12 uint32
  1321. }
  1322. type Tuid_t = uint32
  1323. type Tpthread_t = uintptr
  1324. type Tsigset_t = struct {
  1325. F__bits [32]uint32
  1326. }
  1327. type t__sigset_t = Tsigset_t
  1328. type Tpthread_attr_t = struct {
  1329. F__u struct {
  1330. F__vi [0][9]int32
  1331. F__s [0][9]uint32
  1332. F__i [9]int32
  1333. }
  1334. }
  1335. type Tstack_t = struct {
  1336. Fss_sp uintptr
  1337. Fss_flags int32
  1338. Fss_size Tsize_t
  1339. }
  1340. type Tsigaltstack = Tstack_t
  1341. const _REG_GS = 0
  1342. const _REG_FS = 1
  1343. const _REG_ES = 2
  1344. const _REG_DS = 3
  1345. const _REG_EDI = 4
  1346. const _REG_ESI = 5
  1347. const _REG_EBP = 6
  1348. const _REG_ESP = 7
  1349. const _REG_EBX = 8
  1350. const _REG_EDX = 9
  1351. const _REG_ECX = 10
  1352. const _REG_EAX = 11
  1353. const _REG_TRAPNO = 12
  1354. const _REG_ERR = 13
  1355. const _REG_EIP = 14
  1356. const _REG_CS = 15
  1357. const _REG_EFL = 16
  1358. const _REG_UESP = 17
  1359. const _REG_SS = 18
  1360. type Tgreg_t = int32
  1361. type Tgregset_t = [19]int32
  1362. type Tfpregset_t = uintptr
  1363. type T_fpstate = struct {
  1364. Fcw uint32
  1365. Fsw uint32
  1366. Ftag uint32
  1367. Fipoff uint32
  1368. Fcssel uint32
  1369. Fdataoff uint32
  1370. Fdatasel uint32
  1371. F_st [8]struct {
  1372. Fsignificand [4]uint16
  1373. Fexponent uint16
  1374. }
  1375. Fstatus uint32
  1376. }
  1377. type Tsigcontext = struct {
  1378. Fgs uint16
  1379. F__gsh uint16
  1380. Ffs uint16
  1381. F__fsh uint16
  1382. Fes uint16
  1383. F__esh uint16
  1384. Fds uint16
  1385. F__dsh uint16
  1386. Fedi uint32
  1387. Fesi uint32
  1388. Febp uint32
  1389. Fesp uint32
  1390. Febx uint32
  1391. Fedx uint32
  1392. Fecx uint32
  1393. Feax uint32
  1394. Ftrapno uint32
  1395. Ferr uint32
  1396. Feip uint32
  1397. Fcs uint16
  1398. F__csh uint16
  1399. Feflags uint32
  1400. Fesp_at_signal uint32
  1401. Fss uint16
  1402. F__ssh uint16
  1403. Ffpstate uintptr
  1404. Foldmask uint32
  1405. Fcr2 uint32
  1406. }
  1407. type Tmcontext_t = struct {
  1408. Fgregs Tgregset_t
  1409. Ffpregs Tfpregset_t
  1410. Foldmask uint32
  1411. Fcr2 uint32
  1412. }
  1413. type Tucontext_t = struct {
  1414. Fuc_flags uint32
  1415. Fuc_link uintptr
  1416. Fuc_stack Tstack_t
  1417. Fuc_mcontext Tmcontext_t
  1418. Fuc_sigmask Tsigset_t
  1419. F__fpregs_mem [28]uint32
  1420. }
  1421. type Tucontext = Tucontext_t
  1422. type Tsigval = struct {
  1423. Fsival_ptr [0]uintptr
  1424. Fsival_int int32
  1425. }
  1426. type Tsiginfo_t = struct {
  1427. Fsi_signo int32
  1428. Fsi_errno int32
  1429. Fsi_code int32
  1430. F__si_fields struct {
  1431. F__si_common [0]struct {
  1432. F__first struct {
  1433. F__timer [0]struct {
  1434. Fsi_timerid int32
  1435. Fsi_overrun int32
  1436. }
  1437. F__piduid struct {
  1438. Fsi_pid Tpid_t
  1439. Fsi_uid Tuid_t
  1440. }
  1441. }
  1442. F__second struct {
  1443. F__sigchld [0]struct {
  1444. Fsi_status int32
  1445. Fsi_utime Tclock_t
  1446. Fsi_stime Tclock_t
  1447. }
  1448. Fsi_value Tsigval
  1449. F__ccgo_pad2 [8]byte
  1450. }
  1451. }
  1452. F__sigfault [0]struct {
  1453. Fsi_addr uintptr
  1454. Fsi_addr_lsb int16
  1455. F__first struct {
  1456. Fsi_pkey [0]uint32
  1457. F__addr_bnd struct {
  1458. Fsi_lower uintptr
  1459. Fsi_upper uintptr
  1460. }
  1461. }
  1462. }
  1463. F__sigpoll [0]struct {
  1464. Fsi_band int32
  1465. Fsi_fd int32
  1466. }
  1467. F__sigsys [0]struct {
  1468. Fsi_call_addr uintptr
  1469. Fsi_syscall int32
  1470. Fsi_arch uint32
  1471. }
  1472. F__pad [116]int8
  1473. }
  1474. }
  1475. type Tsigaction = struct {
  1476. F__sa_handler struct {
  1477. Fsa_sigaction [0]uintptr
  1478. Fsa_handler uintptr
  1479. }
  1480. Fsa_mask Tsigset_t
  1481. Fsa_flags int32
  1482. Fsa_restorer uintptr
  1483. }
  1484. type Tsigevent = struct {
  1485. Fsigev_value Tsigval
  1486. Fsigev_signo int32
  1487. Fsigev_notify int32
  1488. F__sev_fields struct {
  1489. Fsigev_notify_thread_id [0]Tpid_t
  1490. F__sev_thread [0]struct {
  1491. Fsigev_notify_function uintptr
  1492. Fsigev_notify_attributes uintptr
  1493. }
  1494. F__pad [52]int8
  1495. }
  1496. }
  1497. type Tsig_t = uintptr
  1498. type Tsighandler_t = uintptr
  1499. type Tsig_atomic_t = int32
  1500. type Tuintptr_t = uint32
  1501. type Tintptr_t = int32
  1502. type Tint8_t = int8
  1503. type Tint16_t = int16
  1504. type Tint32_t = int32
  1505. type Tint64_t = int64
  1506. type Tintmax_t = int64
  1507. type Tuint8_t = uint8
  1508. type Tuint16_t = uint16
  1509. type Tuint32_t = uint32
  1510. type Tuint64_t = uint64
  1511. type Tuintmax_t = uint64
  1512. type Tint_fast8_t = int8
  1513. type Tint_fast64_t = int64
  1514. type Tint_least8_t = int8
  1515. type Tint_least16_t = int16
  1516. type Tint_least32_t = int32
  1517. type Tint_least64_t = int64
  1518. type Tuint_fast8_t = uint8
  1519. type Tuint_fast64_t = uint64
  1520. type Tuint_least8_t = uint8
  1521. type Tuint_least16_t = uint16
  1522. type Tuint_least32_t = uint32
  1523. type Tuint_least64_t = uint64
  1524. type Tint_fast16_t = int32
  1525. type Tint_fast32_t = int32
  1526. type Tuint_fast16_t = uint32
  1527. type Tuint_fast32_t = uint32
  1528. type Twchar_t = int32
  1529. type Tdiv_t = struct {
  1530. Fquot int32
  1531. Frem int32
  1532. }
  1533. type Tldiv_t = struct {
  1534. Fquot int32
  1535. Frem int32
  1536. }
  1537. type Tlldiv_t = struct {
  1538. Fquot int64
  1539. Frem int64
  1540. }
  1541. type Tregister_t = int32
  1542. type Tsuseconds_t = int64
  1543. type Tu_int64_t = uint64
  1544. type Tnlink_t = uint32
  1545. type Tino_t = uint64
  1546. type Tdev_t = uint64
  1547. type Tblksize_t = int32
  1548. type Tblkcnt_t = int64
  1549. type Tfsblkcnt_t = uint64
  1550. type Tfsfilcnt_t = uint64
  1551. type Ttimer_t = uintptr
  1552. type Tclockid_t = int32
  1553. type Tid_t = uint32
  1554. type Tgid_t = uint32
  1555. type Tkey_t = int32
  1556. type Tuseconds_t = uint32
  1557. type Tpthread_once_t = int32
  1558. type Tpthread_key_t = uint32
  1559. type Tpthread_spinlock_t = int32
  1560. type Tpthread_mutexattr_t = struct {
  1561. F__attr uint32
  1562. }
  1563. type Tpthread_condattr_t = struct {
  1564. F__attr uint32
  1565. }
  1566. type Tpthread_barrierattr_t = struct {
  1567. F__attr uint32
  1568. }
  1569. type Tpthread_rwlockattr_t = struct {
  1570. F__attr [2]uint32
  1571. }
  1572. type Tpthread_mutex_t = struct {
  1573. F__u struct {
  1574. F__vi [0][6]int32
  1575. F__p [0][6]uintptr
  1576. F__i [6]int32
  1577. }
  1578. F__ccgo_room int32
  1579. }
  1580. type Tpthread_cond_t = struct {
  1581. F__u struct {
  1582. F__vi [0][12]int32
  1583. F__p [0][12]uintptr
  1584. F__i [12]int32
  1585. }
  1586. }
  1587. type Tpthread_rwlock_t = struct {
  1588. F__u struct {
  1589. F__vi [0][8]int32
  1590. F__p [0][8]uintptr
  1591. F__i [8]int32
  1592. }
  1593. }
  1594. type Tpthread_barrier_t = struct {
  1595. F__u struct {
  1596. F__vi [0][5]int32
  1597. F__p [0][5]uintptr
  1598. F__i [5]int32
  1599. }
  1600. }
  1601. type Tu_int8_t = uint8
  1602. type Tu_int16_t = uint16
  1603. type Tu_int32_t = uint32
  1604. type Tcaddr_t = uintptr
  1605. type Tu_char = uint8
  1606. type Tu_short = uint16
  1607. type Tushort = uint16
  1608. type Tu_int = uint32
  1609. type Tuint = uint32
  1610. type Tu_long = uint32
  1611. type Tulong = uint32
  1612. type Tquad_t = int64
  1613. type Tu_quad_t = uint64
  1614. type Ttimeval = struct {
  1615. Ftv_sec Ttime_t
  1616. Ftv_usec Tsuseconds_t
  1617. }
  1618. type Tfd_mask = uint32
  1619. type Tfd_set = struct {
  1620. Ffds_bits [32]uint32
  1621. }
  1622. type Tva_list = uintptr
  1623. type t__isoc_va_list = uintptr
  1624. type Tfpos_t = struct {
  1625. F__lldata [0]int64
  1626. F__align [0]float64
  1627. F__opaque [16]int8
  1628. }
  1629. type T_G_fpos64_t = Tfpos_t
  1630. type Tcookie_io_functions_t = struct {
  1631. Fread uintptr
  1632. Fwrite uintptr
  1633. Fseek uintptr
  1634. Fclose1 uintptr
  1635. }
  1636. type T_IO_cookie_io_functions_t = Tcookie_io_functions_t
  1637. type Tstat = struct {
  1638. Fst_dev Tdev_t
  1639. F__st_dev_padding int32
  1640. F__st_ino_truncated int32
  1641. Fst_mode Tmode_t
  1642. Fst_nlink Tnlink_t
  1643. Fst_uid Tuid_t
  1644. Fst_gid Tgid_t
  1645. Fst_rdev Tdev_t
  1646. F__st_rdev_padding int32
  1647. Fst_size Toff_t
  1648. Fst_blksize Tblksize_t
  1649. Fst_blocks Tblkcnt_t
  1650. F__st_atim32 struct {
  1651. Ftv_sec int32
  1652. Ftv_nsec int32
  1653. }
  1654. F__st_mtim32 struct {
  1655. Ftv_sec int32
  1656. Ftv_nsec int32
  1657. }
  1658. F__st_ctim32 struct {
  1659. Ftv_sec int32
  1660. Ftv_nsec int32
  1661. }
  1662. Fst_ino Tino_t
  1663. Fst_atim Ttimespec
  1664. Fst_mtim Ttimespec
  1665. Fst_ctim Ttimespec
  1666. }
  1667. type Tstatx_timestamp = struct {
  1668. Ftv_sec Tint64_t
  1669. Ftv_nsec Tuint32_t
  1670. F__pad Tuint32_t
  1671. }
  1672. type Tstatx = struct {
  1673. Fstx_mask Tuint32_t
  1674. Fstx_blksize Tuint32_t
  1675. Fstx_attributes Tuint64_t
  1676. Fstx_nlink Tuint32_t
  1677. Fstx_uid Tuint32_t
  1678. Fstx_gid Tuint32_t
  1679. Fstx_mode Tuint16_t
  1680. F__pad0 [1]Tuint16_t
  1681. Fstx_ino Tuint64_t
  1682. Fstx_size Tuint64_t
  1683. Fstx_blocks Tuint64_t
  1684. Fstx_attributes_mask Tuint64_t
  1685. Fstx_atime Tstatx_timestamp
  1686. Fstx_btime Tstatx_timestamp
  1687. Fstx_ctime Tstatx_timestamp
  1688. Fstx_mtime Tstatx_timestamp
  1689. Fstx_rdev_major Tuint32_t
  1690. Fstx_rdev_minor Tuint32_t
  1691. Fstx_dev_major Tuint32_t
  1692. Fstx_dev_minor Tuint32_t
  1693. F__pad1 [14]Tuint64_t
  1694. }
  1695. type Tlocale_t = uintptr
  1696. type Titimerval = struct {
  1697. Fit_interval Ttimeval
  1698. Fit_value Ttimeval
  1699. }
  1700. type Ttimezone = struct {
  1701. Ftz_minuteswest int32
  1702. Ftz_dsttime int32
  1703. }
  1704. type Tu8 = uint8
  1705. type Tu32 = uint32
  1706. type Tchacha_ctx = struct {
  1707. Finput [16]Tu32
  1708. }
  1709. var _sigma = [16]int8{'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'}
  1710. var _tau = [16]int8{'e', 'x', 'p', 'a', 'n', 'd', ' ', '1', '6', '-', 'b', 'y', 't', 'e', ' ', 'k'}
  1711. func _chacha_keysetup(tls *libc.TLS, x uintptr, k uintptr, kbits Tu32) {
  1712. var constants uintptr
  1713. _ = constants
  1714. *(*Tu32)(unsafe.Pointer(x + 4*4)) = uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(0)))) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(0) + 1)))<<libc.Int32FromInt32(8) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(0) + 2)))<<libc.Int32FromInt32(16) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(0) + 3)))<<libc.Int32FromInt32(24)
  1715. *(*Tu32)(unsafe.Pointer(x + 5*4)) = uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(4)))) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(8) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(16) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(4) + 3)))<<libc.Int32FromInt32(24)
  1716. *(*Tu32)(unsafe.Pointer(x + 6*4)) = uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(8)))) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(8) + 1)))<<libc.Int32FromInt32(8) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(8) + 2)))<<libc.Int32FromInt32(16) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(8) + 3)))<<libc.Int32FromInt32(24)
  1717. *(*Tu32)(unsafe.Pointer(x + 7*4)) = uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(12)))) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(12) + 1)))<<libc.Int32FromInt32(8) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(12) + 2)))<<libc.Int32FromInt32(16) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(12) + 3)))<<libc.Int32FromInt32(24)
  1718. if kbits == uint32(256) {
  1719. k += uintptr(16)
  1720. constants = uintptr(unsafe.Pointer(&_sigma))
  1721. } else {
  1722. constants = uintptr(unsafe.Pointer(&_tau))
  1723. }
  1724. *(*Tu32)(unsafe.Pointer(x + 8*4)) = uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(0)))) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(0) + 1)))<<libc.Int32FromInt32(8) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(0) + 2)))<<libc.Int32FromInt32(16) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(0) + 3)))<<libc.Int32FromInt32(24)
  1725. *(*Tu32)(unsafe.Pointer(x + 9*4)) = uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(4)))) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(8) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(16) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(4) + 3)))<<libc.Int32FromInt32(24)
  1726. *(*Tu32)(unsafe.Pointer(x + 10*4)) = uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(8)))) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(8) + 1)))<<libc.Int32FromInt32(8) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(8) + 2)))<<libc.Int32FromInt32(16) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(8) + 3)))<<libc.Int32FromInt32(24)
  1727. *(*Tu32)(unsafe.Pointer(x + 11*4)) = uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(12)))) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(12) + 1)))<<libc.Int32FromInt32(8) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(12) + 2)))<<libc.Int32FromInt32(16) | uint32(*(*Tu8)(unsafe.Pointer(k + libc.UintptrFromInt32(12) + 3)))<<libc.Int32FromInt32(24)
  1728. *(*Tu32)(unsafe.Pointer(x)) = libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(0)))) | libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(0) + 1)))<<libc.Int32FromInt32(8) | libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(0) + 2)))<<libc.Int32FromInt32(16) | libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(0) + 3)))<<libc.Int32FromInt32(24)
  1729. *(*Tu32)(unsafe.Pointer(x + 1*4)) = libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(4)))) | libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(8) | libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(16) | libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(4) + 3)))<<libc.Int32FromInt32(24)
  1730. *(*Tu32)(unsafe.Pointer(x + 2*4)) = libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(8)))) | libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(8) + 1)))<<libc.Int32FromInt32(8) | libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(8) + 2)))<<libc.Int32FromInt32(16) | libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(8) + 3)))<<libc.Int32FromInt32(24)
  1731. *(*Tu32)(unsafe.Pointer(x + 3*4)) = libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(12)))) | libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(12) + 1)))<<libc.Int32FromInt32(8) | libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(12) + 2)))<<libc.Int32FromInt32(16) | libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(constants + libc.UintptrFromInt32(12) + 3)))<<libc.Int32FromInt32(24)
  1732. }
  1733. func _chacha_ivsetup(tls *libc.TLS, x uintptr, iv uintptr) {
  1734. *(*Tu32)(unsafe.Pointer(x + 12*4)) = uint32(0)
  1735. *(*Tu32)(unsafe.Pointer(x + 13*4)) = uint32(0)
  1736. *(*Tu32)(unsafe.Pointer(x + 14*4)) = uint32(*(*Tu8)(unsafe.Pointer(iv + libc.UintptrFromInt32(0)))) | uint32(*(*Tu8)(unsafe.Pointer(iv + libc.UintptrFromInt32(0) + 1)))<<libc.Int32FromInt32(8) | uint32(*(*Tu8)(unsafe.Pointer(iv + libc.UintptrFromInt32(0) + 2)))<<libc.Int32FromInt32(16) | uint32(*(*Tu8)(unsafe.Pointer(iv + libc.UintptrFromInt32(0) + 3)))<<libc.Int32FromInt32(24)
  1737. *(*Tu32)(unsafe.Pointer(x + 15*4)) = uint32(*(*Tu8)(unsafe.Pointer(iv + libc.UintptrFromInt32(4)))) | uint32(*(*Tu8)(unsafe.Pointer(iv + libc.UintptrFromInt32(4) + 1)))<<libc.Int32FromInt32(8) | uint32(*(*Tu8)(unsafe.Pointer(iv + libc.UintptrFromInt32(4) + 2)))<<libc.Int32FromInt32(16) | uint32(*(*Tu8)(unsafe.Pointer(iv + libc.UintptrFromInt32(4) + 3)))<<libc.Int32FromInt32(24)
  1738. }
  1739. func _chacha_encrypt_bytes(tls *libc.TLS, x uintptr, m uintptr, c uintptr, bytes Tu32) {
  1740. bp := tls.Alloc(64)
  1741. defer tls.Free(64)
  1742. var ctarget uintptr
  1743. var i uint32
  1744. var j0, j1, j10, j11, j12, j13, j14, j15, j2, j3, j4, j5, j6, j7, j8, j9, x0, x1, x10, x11, x12, x13, x14, x15, x2, x3, x4, x5, x6, x7, x8, x9 Tu32
  1745. var _ /* tmp at bp+0 */ [64]Tu8
  1746. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = ctarget, i, j0, j1, j10, j11, j12, j13, j14, j15, j2, j3, j4, j5, j6, j7, j8, j9, x0, x1, x10, x11, x12, x13, x14, x15, x2, x3, x4, x5, x6, x7, x8, x9
  1747. ctarget = libc.UintptrFromInt32(0)
  1748. if !(bytes != 0) {
  1749. return
  1750. }
  1751. j0 = *(*Tu32)(unsafe.Pointer(x))
  1752. j1 = *(*Tu32)(unsafe.Pointer(x + 1*4))
  1753. j2 = *(*Tu32)(unsafe.Pointer(x + 2*4))
  1754. j3 = *(*Tu32)(unsafe.Pointer(x + 3*4))
  1755. j4 = *(*Tu32)(unsafe.Pointer(x + 4*4))
  1756. j5 = *(*Tu32)(unsafe.Pointer(x + 5*4))
  1757. j6 = *(*Tu32)(unsafe.Pointer(x + 6*4))
  1758. j7 = *(*Tu32)(unsafe.Pointer(x + 7*4))
  1759. j8 = *(*Tu32)(unsafe.Pointer(x + 8*4))
  1760. j9 = *(*Tu32)(unsafe.Pointer(x + 9*4))
  1761. j10 = *(*Tu32)(unsafe.Pointer(x + 10*4))
  1762. j11 = *(*Tu32)(unsafe.Pointer(x + 11*4))
  1763. j12 = *(*Tu32)(unsafe.Pointer(x + 12*4))
  1764. j13 = *(*Tu32)(unsafe.Pointer(x + 13*4))
  1765. j14 = *(*Tu32)(unsafe.Pointer(x + 14*4))
  1766. j15 = *(*Tu32)(unsafe.Pointer(x + 15*4))
  1767. for {
  1768. if bytes < uint32(64) {
  1769. i = uint32(0)
  1770. for {
  1771. if !(i < bytes) {
  1772. break
  1773. }
  1774. (*(*[64]Tu8)(unsafe.Pointer(bp)))[i] = *(*Tu8)(unsafe.Pointer(m + uintptr(i)))
  1775. goto _2
  1776. _2:
  1777. ;
  1778. i++
  1779. }
  1780. m = bp
  1781. ctarget = c
  1782. c = bp
  1783. }
  1784. x0 = j0
  1785. x1 = j1
  1786. x2 = j2
  1787. x3 = j3
  1788. x4 = j4
  1789. x5 = j5
  1790. x6 = j6
  1791. x7 = j7
  1792. x8 = j8
  1793. x9 = j9
  1794. x10 = j10
  1795. x11 = j11
  1796. x12 = j12
  1797. x13 = j13
  1798. x14 = j14
  1799. x15 = j15
  1800. i = uint32(20)
  1801. for {
  1802. if !(i > uint32(0)) {
  1803. break
  1804. }
  1805. x0 = (x0 + x4) & libc.Uint32FromUint32(0xFFFFFFFF)
  1806. x12 = (x12^x0)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x12^x0)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
  1807. x8 = (x8 + x12) & libc.Uint32FromUint32(0xFFFFFFFF)
  1808. x4 = (x4^x8)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x4^x8)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
  1809. x0 = (x0 + x4) & libc.Uint32FromUint32(0xFFFFFFFF)
  1810. x12 = (x12^x0)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x12^x0)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
  1811. x8 = (x8 + x12) & libc.Uint32FromUint32(0xFFFFFFFF)
  1812. x4 = (x4^x8)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x4^x8)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
  1813. x1 = (x1 + x5) & libc.Uint32FromUint32(0xFFFFFFFF)
  1814. x13 = (x13^x1)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x13^x1)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
  1815. x9 = (x9 + x13) & libc.Uint32FromUint32(0xFFFFFFFF)
  1816. x5 = (x5^x9)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x5^x9)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
  1817. x1 = (x1 + x5) & libc.Uint32FromUint32(0xFFFFFFFF)
  1818. x13 = (x13^x1)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x13^x1)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
  1819. x9 = (x9 + x13) & libc.Uint32FromUint32(0xFFFFFFFF)
  1820. x5 = (x5^x9)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x5^x9)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
  1821. x2 = (x2 + x6) & libc.Uint32FromUint32(0xFFFFFFFF)
  1822. x14 = (x14^x2)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x14^x2)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
  1823. x10 = (x10 + x14) & libc.Uint32FromUint32(0xFFFFFFFF)
  1824. x6 = (x6^x10)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x6^x10)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
  1825. x2 = (x2 + x6) & libc.Uint32FromUint32(0xFFFFFFFF)
  1826. x14 = (x14^x2)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x14^x2)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
  1827. x10 = (x10 + x14) & libc.Uint32FromUint32(0xFFFFFFFF)
  1828. x6 = (x6^x10)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x6^x10)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
  1829. x3 = (x3 + x7) & libc.Uint32FromUint32(0xFFFFFFFF)
  1830. x15 = (x15^x3)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x15^x3)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
  1831. x11 = (x11 + x15) & libc.Uint32FromUint32(0xFFFFFFFF)
  1832. x7 = (x7^x11)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x7^x11)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
  1833. x3 = (x3 + x7) & libc.Uint32FromUint32(0xFFFFFFFF)
  1834. x15 = (x15^x3)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x15^x3)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
  1835. x11 = (x11 + x15) & libc.Uint32FromUint32(0xFFFFFFFF)
  1836. x7 = (x7^x11)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x7^x11)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
  1837. x0 = (x0 + x5) & libc.Uint32FromUint32(0xFFFFFFFF)
  1838. x15 = (x15^x0)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x15^x0)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
  1839. x10 = (x10 + x15) & libc.Uint32FromUint32(0xFFFFFFFF)
  1840. x5 = (x5^x10)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x5^x10)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
  1841. x0 = (x0 + x5) & libc.Uint32FromUint32(0xFFFFFFFF)
  1842. x15 = (x15^x0)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x15^x0)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
  1843. x10 = (x10 + x15) & libc.Uint32FromUint32(0xFFFFFFFF)
  1844. x5 = (x5^x10)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x5^x10)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
  1845. x1 = (x1 + x6) & libc.Uint32FromUint32(0xFFFFFFFF)
  1846. x12 = (x12^x1)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x12^x1)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
  1847. x11 = (x11 + x12) & libc.Uint32FromUint32(0xFFFFFFFF)
  1848. x6 = (x6^x11)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x6^x11)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
  1849. x1 = (x1 + x6) & libc.Uint32FromUint32(0xFFFFFFFF)
  1850. x12 = (x12^x1)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x12^x1)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
  1851. x11 = (x11 + x12) & libc.Uint32FromUint32(0xFFFFFFFF)
  1852. x6 = (x6^x11)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x6^x11)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
  1853. x2 = (x2 + x7) & libc.Uint32FromUint32(0xFFFFFFFF)
  1854. x13 = (x13^x2)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x13^x2)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
  1855. x8 = (x8 + x13) & libc.Uint32FromUint32(0xFFFFFFFF)
  1856. x7 = (x7^x8)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x7^x8)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
  1857. x2 = (x2 + x7) & libc.Uint32FromUint32(0xFFFFFFFF)
  1858. x13 = (x13^x2)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x13^x2)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
  1859. x8 = (x8 + x13) & libc.Uint32FromUint32(0xFFFFFFFF)
  1860. x7 = (x7^x8)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x7^x8)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
  1861. x3 = (x3 + x4) & libc.Uint32FromUint32(0xFFFFFFFF)
  1862. x14 = (x14^x3)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x14^x3)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
  1863. x9 = (x9 + x14) & libc.Uint32FromUint32(0xFFFFFFFF)
  1864. x4 = (x4^x9)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x4^x9)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
  1865. x3 = (x3 + x4) & libc.Uint32FromUint32(0xFFFFFFFF)
  1866. x14 = (x14^x3)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x14^x3)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
  1867. x9 = (x9 + x14) & libc.Uint32FromUint32(0xFFFFFFFF)
  1868. x4 = (x4^x9)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x4^x9)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
  1869. goto _3
  1870. _3:
  1871. ;
  1872. i -= uint32(2)
  1873. }
  1874. x0 = (x0 + j0) & libc.Uint32FromUint32(0xFFFFFFFF)
  1875. x1 = (x1 + j1) & libc.Uint32FromUint32(0xFFFFFFFF)
  1876. x2 = (x2 + j2) & libc.Uint32FromUint32(0xFFFFFFFF)
  1877. x3 = (x3 + j3) & libc.Uint32FromUint32(0xFFFFFFFF)
  1878. x4 = (x4 + j4) & libc.Uint32FromUint32(0xFFFFFFFF)
  1879. x5 = (x5 + j5) & libc.Uint32FromUint32(0xFFFFFFFF)
  1880. x6 = (x6 + j6) & libc.Uint32FromUint32(0xFFFFFFFF)
  1881. x7 = (x7 + j7) & libc.Uint32FromUint32(0xFFFFFFFF)
  1882. x8 = (x8 + j8) & libc.Uint32FromUint32(0xFFFFFFFF)
  1883. x9 = (x9 + j9) & libc.Uint32FromUint32(0xFFFFFFFF)
  1884. x10 = (x10 + j10) & libc.Uint32FromUint32(0xFFFFFFFF)
  1885. x11 = (x11 + j11) & libc.Uint32FromUint32(0xFFFFFFFF)
  1886. x12 = (x12 + j12) & libc.Uint32FromUint32(0xFFFFFFFF)
  1887. x13 = (x13 + j13) & libc.Uint32FromUint32(0xFFFFFFFF)
  1888. x14 = (x14 + j14) & libc.Uint32FromUint32(0xFFFFFFFF)
  1889. x15 = (x15 + j15) & libc.Uint32FromUint32(0xFFFFFFFF)
  1890. j12 = (j12 + libc.Uint32FromInt32(libc.Int32FromInt32(1))) & libc.Uint32FromUint32(0xFFFFFFFF)
  1891. if !(j12 != 0) {
  1892. j13 = (j13 + libc.Uint32FromInt32(libc.Int32FromInt32(1))) & libc.Uint32FromUint32(0xFFFFFFFF)
  1893. }
  1894. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(0))) = uint8(uint32(uint8(x0)) & libc.Uint32FromUint32(0xFF))
  1895. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(0) + 1)) = uint8(uint32(uint8(x0>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1896. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(0) + 2)) = uint8(uint32(uint8(x0>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1897. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(0) + 3)) = uint8(uint32(uint8(x0>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1898. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(4))) = uint8(uint32(uint8(x1)) & libc.Uint32FromUint32(0xFF))
  1899. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(4) + 1)) = uint8(uint32(uint8(x1>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1900. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(4) + 2)) = uint8(uint32(uint8(x1>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1901. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(4) + 3)) = uint8(uint32(uint8(x1>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1902. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(8))) = uint8(uint32(uint8(x2)) & libc.Uint32FromUint32(0xFF))
  1903. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(8) + 1)) = uint8(uint32(uint8(x2>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1904. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(8) + 2)) = uint8(uint32(uint8(x2>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1905. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(8) + 3)) = uint8(uint32(uint8(x2>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1906. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(12))) = uint8(uint32(uint8(x3)) & libc.Uint32FromUint32(0xFF))
  1907. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(12) + 1)) = uint8(uint32(uint8(x3>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1908. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(12) + 2)) = uint8(uint32(uint8(x3>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1909. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(12) + 3)) = uint8(uint32(uint8(x3>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1910. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(16))) = uint8(uint32(uint8(x4)) & libc.Uint32FromUint32(0xFF))
  1911. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(16) + 1)) = uint8(uint32(uint8(x4>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1912. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(16) + 2)) = uint8(uint32(uint8(x4>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1913. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(16) + 3)) = uint8(uint32(uint8(x4>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1914. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(20))) = uint8(uint32(uint8(x5)) & libc.Uint32FromUint32(0xFF))
  1915. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(20) + 1)) = uint8(uint32(uint8(x5>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1916. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(20) + 2)) = uint8(uint32(uint8(x5>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1917. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(20) + 3)) = uint8(uint32(uint8(x5>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1918. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(24))) = uint8(uint32(uint8(x6)) & libc.Uint32FromUint32(0xFF))
  1919. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(24) + 1)) = uint8(uint32(uint8(x6>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1920. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(24) + 2)) = uint8(uint32(uint8(x6>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1921. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(24) + 3)) = uint8(uint32(uint8(x6>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1922. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(28))) = uint8(uint32(uint8(x7)) & libc.Uint32FromUint32(0xFF))
  1923. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(28) + 1)) = uint8(uint32(uint8(x7>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1924. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(28) + 2)) = uint8(uint32(uint8(x7>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1925. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(28) + 3)) = uint8(uint32(uint8(x7>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1926. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(32))) = uint8(uint32(uint8(x8)) & libc.Uint32FromUint32(0xFF))
  1927. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(32) + 1)) = uint8(uint32(uint8(x8>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1928. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(32) + 2)) = uint8(uint32(uint8(x8>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1929. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(32) + 3)) = uint8(uint32(uint8(x8>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1930. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(36))) = uint8(uint32(uint8(x9)) & libc.Uint32FromUint32(0xFF))
  1931. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(36) + 1)) = uint8(uint32(uint8(x9>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1932. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(36) + 2)) = uint8(uint32(uint8(x9>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1933. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(36) + 3)) = uint8(uint32(uint8(x9>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1934. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(40))) = uint8(uint32(uint8(x10)) & libc.Uint32FromUint32(0xFF))
  1935. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(40) + 1)) = uint8(uint32(uint8(x10>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1936. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(40) + 2)) = uint8(uint32(uint8(x10>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1937. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(40) + 3)) = uint8(uint32(uint8(x10>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1938. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(44))) = uint8(uint32(uint8(x11)) & libc.Uint32FromUint32(0xFF))
  1939. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(44) + 1)) = uint8(uint32(uint8(x11>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1940. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(44) + 2)) = uint8(uint32(uint8(x11>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1941. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(44) + 3)) = uint8(uint32(uint8(x11>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1942. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(48))) = uint8(uint32(uint8(x12)) & libc.Uint32FromUint32(0xFF))
  1943. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(48) + 1)) = uint8(uint32(uint8(x12>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1944. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(48) + 2)) = uint8(uint32(uint8(x12>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1945. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(48) + 3)) = uint8(uint32(uint8(x12>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1946. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(52))) = uint8(uint32(uint8(x13)) & libc.Uint32FromUint32(0xFF))
  1947. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(52) + 1)) = uint8(uint32(uint8(x13>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1948. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(52) + 2)) = uint8(uint32(uint8(x13>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1949. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(52) + 3)) = uint8(uint32(uint8(x13>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1950. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(56))) = uint8(uint32(uint8(x14)) & libc.Uint32FromUint32(0xFF))
  1951. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(56) + 1)) = uint8(uint32(uint8(x14>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1952. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(56) + 2)) = uint8(uint32(uint8(x14>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1953. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(56) + 3)) = uint8(uint32(uint8(x14>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1954. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(60))) = uint8(uint32(uint8(x15)) & libc.Uint32FromUint32(0xFF))
  1955. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(60) + 1)) = uint8(uint32(uint8(x15>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
  1956. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(60) + 2)) = uint8(uint32(uint8(x15>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
  1957. *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(60) + 3)) = uint8(uint32(uint8(x15>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
  1958. if bytes <= uint32(64) {
  1959. if bytes < uint32(64) {
  1960. i = uint32(0)
  1961. for {
  1962. if !(i < bytes) {
  1963. break
  1964. }
  1965. *(*Tu8)(unsafe.Pointer(ctarget + uintptr(i))) = *(*Tu8)(unsafe.Pointer(c + uintptr(i)))
  1966. goto _4
  1967. _4:
  1968. ;
  1969. i++
  1970. }
  1971. }
  1972. *(*Tu32)(unsafe.Pointer(x + 12*4)) = j12
  1973. *(*Tu32)(unsafe.Pointer(x + 13*4)) = j13
  1974. return
  1975. }
  1976. bytes -= uint32(64)
  1977. c += uintptr(64)
  1978. goto _1
  1979. _1:
  1980. }
  1981. }
  1982. // C documentation
  1983. //
  1984. // /* Marked MAP_INHERIT_ZERO, so zero'd out in fork children. */
  1985. type T_rs = struct {
  1986. Frs_have Tsize_t
  1987. Frs_count Tsize_t
  1988. }
  1989. // C documentation
  1990. //
  1991. // /* Marked MAP_INHERIT_ZERO, so zero'd out in fork children. */
  1992. var _rs uintptr
  1993. // C documentation
  1994. //
  1995. // /* Maybe be preserved in fork children, if _rs_allocate() decides. */
  1996. type T_rsx = struct {
  1997. Frs_chacha Tchacha_ctx
  1998. Frs_buf [1024]uint8
  1999. }
  2000. // C documentation
  2001. //
  2002. // /* Maybe be preserved in fork children, if _rs_allocate() decides. */
  2003. var _rsx uintptr
  2004. type Trlim_t = uint64
  2005. type Trlimit = struct {
  2006. Frlim_cur Trlim_t
  2007. Frlim_max Trlim_t
  2008. }
  2009. type Trusage = struct {
  2010. Fru_utime Ttimeval
  2011. Fru_stime Ttimeval
  2012. Fru_maxrss int32
  2013. Fru_ixrss int32
  2014. Fru_idrss int32
  2015. Fru_isrss int32
  2016. Fru_minflt int32
  2017. Fru_majflt int32
  2018. Fru_nswap int32
  2019. Fru_inblock int32
  2020. Fru_oublock int32
  2021. Fru_msgsnd int32
  2022. Fru_msgrcv int32
  2023. Fru_nsignals int32
  2024. Fru_nvcsw int32
  2025. Fru_nivcsw int32
  2026. F__reserved [16]int32
  2027. }
  2028. type Tsched_param = struct {
  2029. Fsched_priority int32
  2030. F__reserved1 int32
  2031. F__reserved2 [4]int32
  2032. F__reserved3 int32
  2033. }
  2034. type Tcpu_set_t = struct {
  2035. F__bits [32]uint32
  2036. }
  2037. type Ttm = struct {
  2038. Ftm_sec int32
  2039. Ftm_min int32
  2040. Ftm_hour int32
  2041. Ftm_mday int32
  2042. Ftm_mon int32
  2043. Ftm_year int32
  2044. Ftm_wday int32
  2045. Ftm_yday int32
  2046. Ftm_isdst int32
  2047. Ftm_gmtoff int32
  2048. Ftm_zone uintptr
  2049. }
  2050. type Titimerspec = struct {
  2051. Fit_interval Ttimespec
  2052. Fit_value Ttimespec
  2053. }
  2054. type t__ptcb = struct {
  2055. F__f uintptr
  2056. F__x uintptr
  2057. F__next uintptr
  2058. }
  2059. type Tcpu_set_t1 = struct {
  2060. F__bits [32]uint32
  2061. }
  2062. var _arc4random_mtx = Tpthread_mutex_t{}
  2063. var __rs_forked Tsig_atomic_t
  2064. func __rs_init(tls *libc.TLS, buf uintptr, n Tsize_t) {
  2065. var v1, v2, v3, v6 uintptr
  2066. var v4 int32
  2067. _, _, _, _, _ = v1, v2, v3, v4, v6
  2068. if n < libc.Uint32FromInt32(libc.Int32FromInt32(m_KEYSZ)+libc.Int32FromInt32(m_IVSZ)) {
  2069. return
  2070. }
  2071. if _rs == libc.UintptrFromInt32(0) {
  2072. v1 = uintptr(unsafe.Pointer(&_rs))
  2073. v2 = uintptr(unsafe.Pointer(&_rsx))
  2074. v3 = libc.Xmmap(tls, libc.UintptrFromInt32(0), uint32(8), libc.Int32FromInt32(m_PROT_READ)|libc.Int32FromInt32(m_PROT_WRITE), libc.Int32FromInt32(m_MAP_ANON)|libc.Int32FromInt32(m_MAP_PRIVATE), -int32(1), 0)
  2075. *(*uintptr)(unsafe.Pointer(v1)) = v3
  2076. if v3 == uintptr(-libc.Int32FromInt32(1)) {
  2077. v4 = -int32(1)
  2078. goto _5
  2079. }
  2080. v6 = libc.Xmmap(tls, libc.UintptrFromInt32(0), uint32(1088), libc.Int32FromInt32(m_PROT_READ)|libc.Int32FromInt32(m_PROT_WRITE), libc.Int32FromInt32(m_MAP_ANON)|libc.Int32FromInt32(m_MAP_PRIVATE), -int32(1), 0)
  2081. *(*uintptr)(unsafe.Pointer(v2)) = v6
  2082. if v6 == uintptr(-libc.Int32FromInt32(1)) {
  2083. libc.Xmunmap(tls, *(*uintptr)(unsafe.Pointer(v1)), uint32(8))
  2084. *(*uintptr)(unsafe.Pointer(v1)) = libc.UintptrFromInt32(0)
  2085. v4 = -int32(1)
  2086. goto _5
  2087. }
  2088. libc.Xpthread_atfork(tls, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), __ccgo_fp(__rs_forkhandler))
  2089. v4 = 0
  2090. goto _5
  2091. _5:
  2092. if v4 == -int32(1) {
  2093. libc.X_exit(tls, int32(1))
  2094. }
  2095. }
  2096. _chacha_keysetup(tls, _rsx, buf, libc.Uint32FromInt32(libc.Int32FromInt32(m_KEYSZ)*libc.Int32FromInt32(8)))
  2097. _chacha_ivsetup(tls, _rsx, buf+uintptr(m_KEYSZ))
  2098. }
  2099. func __rs_rekey(tls *libc.TLS, dat uintptr, datlen Tsize_t) {
  2100. var i, m Tsize_t
  2101. var v1 uint32
  2102. var p3 uintptr
  2103. _, _, _, _ = i, m, v1, p3
  2104. /* fill rs_buf with the keystream */
  2105. _chacha_encrypt_bytes(tls, _rsx, _rsx+64, _rsx+64, uint32(1024))
  2106. /* mix in optional user provided data */
  2107. if dat != 0 {
  2108. if datlen < libc.Uint32FromInt32(libc.Int32FromInt32(m_KEYSZ)+libc.Int32FromInt32(m_IVSZ)) {
  2109. v1 = datlen
  2110. } else {
  2111. v1 = libc.Uint32FromInt32(libc.Int32FromInt32(m_KEYSZ) + libc.Int32FromInt32(m_IVSZ))
  2112. }
  2113. m = v1
  2114. i = uint32(0)
  2115. for {
  2116. if !(i < m) {
  2117. break
  2118. }
  2119. p3 = _rsx + 64 + uintptr(i)
  2120. *(*uint8)(unsafe.Pointer(p3)) = uint8(int32(*(*uint8)(unsafe.Pointer(p3))) ^ libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(dat + uintptr(i)))))
  2121. goto _2
  2122. _2:
  2123. ;
  2124. i++
  2125. }
  2126. }
  2127. /* immediately reinit for backtracking resistance */
  2128. __rs_init(tls, _rsx+64, libc.Uint32FromInt32(libc.Int32FromInt32(m_KEYSZ)+libc.Int32FromInt32(m_IVSZ)))
  2129. libc.Xmemset(tls, _rsx+64, 0, libc.Uint32FromInt32(libc.Int32FromInt32(m_KEYSZ)+libc.Int32FromInt32(m_IVSZ)))
  2130. (*T_rs)(unsafe.Pointer(_rs)).Frs_have = libc.Uint32FromInt64(1024) - libc.Uint32FromInt32(m_KEYSZ) - libc.Uint32FromInt32(m_IVSZ)
  2131. }
  2132. func __rs_stir(tls *libc.TLS) {
  2133. bp := tls.Alloc(48)
  2134. defer tls.Free(48)
  2135. var _ /* rekey_fuzz at bp+40 */ Tuint32_t
  2136. var _ /* rnd at bp+0 */ [40]uint8
  2137. *(*Tuint32_t)(unsafe.Pointer(bp + 40)) = uint32(0)
  2138. if Xgetentropy(tls, bp, uint32(40)) == -int32(1) {
  2139. libc.Xraise(tls, int32(m_SIGKILL))
  2140. }
  2141. if !(_rs != 0) {
  2142. __rs_init(tls, bp, uint32(40))
  2143. } else {
  2144. __rs_rekey(tls, bp, uint32(40))
  2145. }
  2146. Xexplicit_bzero(tls, bp, uint32(40)) /* discard source seed */
  2147. /* invalidate rs_buf */
  2148. (*T_rs)(unsafe.Pointer(_rs)).Frs_have = uint32(0)
  2149. libc.Xmemset(tls, _rsx+64, 0, uint32(1024))
  2150. /* rekey interval should not be predictable */
  2151. _chacha_encrypt_bytes(tls, _rsx, bp+40, bp+40, uint32(4))
  2152. (*T_rs)(unsafe.Pointer(_rs)).Frs_count = libc.Uint32FromInt32(libc.Int32FromInt32(1024)*libc.Int32FromInt32(1024)) + *(*Tuint32_t)(unsafe.Pointer(bp + 40))%libc.Uint32FromInt32(libc.Int32FromInt32(1024)*libc.Int32FromInt32(1024))
  2153. }
  2154. func __rs_stir_if_needed(tls *libc.TLS, len1 Tsize_t) {
  2155. __rs_forkdetect(tls)
  2156. if !(_rs != 0) || (*T_rs)(unsafe.Pointer(_rs)).Frs_count <= len1 {
  2157. __rs_stir(tls)
  2158. }
  2159. if (*T_rs)(unsafe.Pointer(_rs)).Frs_count <= len1 {
  2160. (*T_rs)(unsafe.Pointer(_rs)).Frs_count = uint32(0)
  2161. } else {
  2162. *(*Tsize_t)(unsafe.Pointer(_rs + 4)) -= len1
  2163. }
  2164. }
  2165. func __rs_random_buf(tls *libc.TLS, _buf uintptr, n Tsize_t) {
  2166. var buf, keystream uintptr
  2167. var m Tsize_t
  2168. var v1 uint32
  2169. _, _, _, _ = buf, keystream, m, v1
  2170. buf = _buf
  2171. __rs_stir_if_needed(tls, n)
  2172. for n > uint32(0) {
  2173. if (*T_rs)(unsafe.Pointer(_rs)).Frs_have > uint32(0) {
  2174. if n < (*T_rs)(unsafe.Pointer(_rs)).Frs_have {
  2175. v1 = n
  2176. } else {
  2177. v1 = (*T_rs)(unsafe.Pointer(_rs)).Frs_have
  2178. }
  2179. m = v1
  2180. keystream = _rsx + 64 + uintptr(1024) - uintptr((*T_rs)(unsafe.Pointer(_rs)).Frs_have)
  2181. libc.Xmemcpy(tls, buf, keystream, m)
  2182. libc.Xmemset(tls, keystream, 0, m)
  2183. buf += uintptr(m)
  2184. n -= m
  2185. *(*Tsize_t)(unsafe.Pointer(_rs)) -= m
  2186. }
  2187. if (*T_rs)(unsafe.Pointer(_rs)).Frs_have == uint32(0) {
  2188. __rs_rekey(tls, libc.UintptrFromInt32(0), uint32(0))
  2189. }
  2190. }
  2191. }
  2192. func __rs_random_u32(tls *libc.TLS, val uintptr) {
  2193. var keystream uintptr
  2194. _ = keystream
  2195. __rs_stir_if_needed(tls, uint32(4))
  2196. if (*T_rs)(unsafe.Pointer(_rs)).Frs_have < uint32(4) {
  2197. __rs_rekey(tls, libc.UintptrFromInt32(0), uint32(0))
  2198. }
  2199. keystream = _rsx + 64 + uintptr(1024) - uintptr((*T_rs)(unsafe.Pointer(_rs)).Frs_have)
  2200. libc.Xmemcpy(tls, val, keystream, uint32(4))
  2201. libc.Xmemset(tls, keystream, 0, uint32(4))
  2202. *(*Tsize_t)(unsafe.Pointer(_rs)) -= uint32(4)
  2203. }
  2204. func Xarc4random_stir(tls *libc.TLS) {
  2205. libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
  2206. __rs_stir(tls)
  2207. libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
  2208. }
  2209. func Xarc4random_addrandom(tls *libc.TLS, dat uintptr, datlen int32) {
  2210. libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
  2211. __rs_stir_if_needed(tls, libc.Uint32FromInt32(datlen))
  2212. __rs_rekey(tls, dat, libc.Uint32FromInt32(datlen))
  2213. libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
  2214. }
  2215. func Xarc4random(tls *libc.TLS) (r Tuint32_t) {
  2216. bp := tls.Alloc(16)
  2217. defer tls.Free(16)
  2218. var _ /* val at bp+0 */ Tuint32_t
  2219. libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
  2220. __rs_random_u32(tls, bp)
  2221. libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
  2222. return *(*Tuint32_t)(unsafe.Pointer(bp))
  2223. }
  2224. func Xarc4random_buf(tls *libc.TLS, buf uintptr, n Tsize_t) {
  2225. libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
  2226. __rs_random_buf(tls, buf, n)
  2227. libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
  2228. }
  2229. // C documentation
  2230. //
  2231. // /*
  2232. // * Calculate a uniformly distributed random number less than upper_bound
  2233. // * avoiding "modulo bias".
  2234. // *
  2235. // * Uniformity is achieved by generating new random numbers until the one
  2236. // * returned is outside the range [0, 2**32 % upper_bound). This
  2237. // * guarantees the selected random number will be inside
  2238. // * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound)
  2239. // * after reduction modulo upper_bound.
  2240. // */
  2241. func Xarc4random_uniform(tls *libc.TLS, upper_bound Tuint32_t) (r1 Tuint32_t) {
  2242. var min, r Tuint32_t
  2243. _, _ = min, r
  2244. if upper_bound < uint32(2) {
  2245. return uint32(0)
  2246. }
  2247. /* 2**32 % x == (2**32 - x) % x */
  2248. min = -upper_bound % upper_bound
  2249. /*
  2250. * This could theoretically loop forever but each retry has
  2251. * p > 0.5 (worst case, usually far better) of selecting a
  2252. * number inside the range we need, so it should rarely need
  2253. * to re-roll.
  2254. */
  2255. for {
  2256. r = Xarc4random(tls)
  2257. if r >= min {
  2258. break
  2259. }
  2260. goto _1
  2261. _1:
  2262. }
  2263. return r % upper_bound
  2264. }
  2265. const m_SEEK_CUR = 1
  2266. const m_SEEK_END = 2
  2267. const m_SEEK_SET = 0
  2268. const m_no_argument = 0
  2269. const m_optional_argument = 2
  2270. const m_required_argument = 1
  2271. type Toption = struct {
  2272. Fname uintptr
  2273. Fhas_arg int32
  2274. Fflag uintptr
  2275. Fval int32
  2276. }
  2277. func Xbsd_getopt(tls *libc.TLS, argc int32, argv uintptr, shortopts uintptr) (r int32) {
  2278. if Xoptreset == int32(1) {
  2279. Xoptreset = 0
  2280. libc.Xoptind = 0
  2281. }
  2282. /*
  2283. * Make sure we are using the system getopt() and not a possible
  2284. * overlay macro.
  2285. */
  2286. return libc.Xgetopt(tls, argc, argv, shortopts)
  2287. }
  2288. const m_DT_BLK = 6
  2289. const m_DT_CHR = 2
  2290. const m_DT_DIR = 4
  2291. const m_DT_FIFO = 1
  2292. const m_DT_LNK = 10
  2293. const m_DT_REG = 8
  2294. const m_DT_SOCK = 12
  2295. const m_DT_UNKNOWN = 0
  2296. const m_DT_WHT = 14
  2297. const m_E2BIG = 7
  2298. const m_EACCES = 13
  2299. const m_EADDRINUSE = 98
  2300. const m_EADDRNOTAVAIL = 99
  2301. const m_EADV = 68
  2302. const m_EAFNOSUPPORT = 97
  2303. const m_EAGAIN = 11
  2304. const m_EALREADY = 114
  2305. const m_EBADE = 52
  2306. const m_EBADF = 9
  2307. const m_EBADFD = 77
  2308. const m_EBADMSG = 74
  2309. const m_EBADR = 53
  2310. const m_EBADRQC = 56
  2311. const m_EBADSLT = 57
  2312. const m_EBFONT = 59
  2313. const m_EBUSY = 16
  2314. const m_ECANCELED = 125
  2315. const m_ECHILD = 10
  2316. const m_ECHRNG = 44
  2317. const m_ECOMM = 70
  2318. const m_ECONNABORTED = 103
  2319. const m_ECONNREFUSED = 111
  2320. const m_ECONNRESET = 104
  2321. const m_EDEADLK = 35
  2322. const m_EDEADLOCK = "EDEADLK"
  2323. const m_EDESTADDRREQ = 89
  2324. const m_EDOM = 33
  2325. const m_EDOTDOT = 73
  2326. const m_EDQUOT = 122
  2327. const m_EEXIST = 17
  2328. const m_EFAULT = 14
  2329. const m_EFBIG = 27
  2330. const m_EHOSTDOWN = 112
  2331. const m_EHOSTUNREACH = 113
  2332. const m_EHWPOISON = 133
  2333. const m_EIDRM = 43
  2334. const m_EILSEQ = 84
  2335. const m_EINPROGRESS = 115
  2336. const m_EINTR = 4
  2337. const m_EINVAL = 22
  2338. const m_EIO = 5
  2339. const m_EISCONN = 106
  2340. const m_EISDIR = 21
  2341. const m_EISNAM = 120
  2342. const m_EKEYEXPIRED = 127
  2343. const m_EKEYREJECTED = 129
  2344. const m_EKEYREVOKED = 128
  2345. const m_EL2HLT = 51
  2346. const m_EL2NSYNC = 45
  2347. const m_EL3HLT = 46
  2348. const m_EL3RST = 47
  2349. const m_ELIBACC = 79
  2350. const m_ELIBBAD = 80
  2351. const m_ELIBEXEC = 83
  2352. const m_ELIBMAX = 82
  2353. const m_ELIBSCN = 81
  2354. const m_ELNRNG = 48
  2355. const m_ELOOP = 40
  2356. const m_EMEDIUMTYPE = 124
  2357. const m_EMFILE = 24
  2358. const m_EMLINK = 31
  2359. const m_EMSGSIZE = 90
  2360. const m_EMULTIHOP = 72
  2361. const m_ENAMETOOLONG = 36
  2362. const m_ENAVAIL = 119
  2363. const m_ENETDOWN = 100
  2364. const m_ENETRESET = 102
  2365. const m_ENETUNREACH = 101
  2366. const m_ENFILE = 23
  2367. const m_ENOANO = 55
  2368. const m_ENOBUFS = 105
  2369. const m_ENOCSI = 50
  2370. const m_ENODATA = 61
  2371. const m_ENODEV = 19
  2372. const m_ENOENT = 2
  2373. const m_ENOEXEC = 8
  2374. const m_ENOKEY = 126
  2375. const m_ENOLCK = 37
  2376. const m_ENOLINK = 67
  2377. const m_ENOMEDIUM = 123
  2378. const m_ENOMEM = 12
  2379. const m_ENOMSG = 42
  2380. const m_ENONET = 64
  2381. const m_ENOPKG = 65
  2382. const m_ENOPROTOOPT = 92
  2383. const m_ENOSPC = 28
  2384. const m_ENOSR = 63
  2385. const m_ENOSTR = 60
  2386. const m_ENOSYS = 38
  2387. const m_ENOTBLK = 15
  2388. const m_ENOTCONN = 107
  2389. const m_ENOTDIR = 20
  2390. const m_ENOTEMPTY = 39
  2391. const m_ENOTNAM = 118
  2392. const m_ENOTRECOVERABLE = 131
  2393. const m_ENOTSOCK = 88
  2394. const m_ENOTSUP = "EOPNOTSUPP"
  2395. const m_ENOTTY = 25
  2396. const m_ENOTUNIQ = 76
  2397. const m_ENXIO = 6
  2398. const m_EOPNOTSUPP = 95
  2399. const m_EOVERFLOW = 75
  2400. const m_EOWNERDEAD = 130
  2401. const m_EPERM = 1
  2402. const m_EPFNOSUPPORT = 96
  2403. const m_EPIPE = 32
  2404. const m_EPROTO = 71
  2405. const m_EPROTONOSUPPORT = 93
  2406. const m_EPROTOTYPE = 91
  2407. const m_ERANGE = 34
  2408. const m_EREMCHG = 78
  2409. const m_EREMOTE = 66
  2410. const m_EREMOTEIO = 121
  2411. const m_ERESTART = 85
  2412. const m_ERFKILL = 132
  2413. const m_EROFS = 30
  2414. const m_ESHUTDOWN = 108
  2415. const m_ESOCKTNOSUPPORT = 94
  2416. const m_ESPIPE = 29
  2417. const m_ESRCH = 3
  2418. const m_ESRMNT = 69
  2419. const m_ESTALE = 116
  2420. const m_ESTRPIPE = 86
  2421. const m_ETIME = 62
  2422. const m_ETIMEDOUT = 110
  2423. const m_ETOOMANYREFS = 109
  2424. const m_ETXTBSY = 26
  2425. const m_EUCLEAN = 117
  2426. const m_EUNATCH = 49
  2427. const m_EUSERS = 87
  2428. const m_EWOULDBLOCK = "EAGAIN"
  2429. const m_EXDEV = 18
  2430. const m_EXFULL = 54
  2431. const m_INT_MAX1 = 2147483647
  2432. const m_OPEN_MAX = 256
  2433. const m_SYS__llseek = 140
  2434. const m_SYS__newselect = 142
  2435. const m_SYS__sysctl = 149
  2436. const m_SYS_accept4 = 364
  2437. const m_SYS_access = 33
  2438. const m_SYS_acct = 51
  2439. const m_SYS_add_key = 286
  2440. const m_SYS_adjtimex = 124
  2441. const m_SYS_afs_syscall = 137
  2442. const m_SYS_alarm = 27
  2443. const m_SYS_arch_prctl = 384
  2444. const m_SYS_bdflush = 134
  2445. const m_SYS_bind = 361
  2446. const m_SYS_bpf = 357
  2447. const m_SYS_break = 17
  2448. const m_SYS_brk = 45
  2449. const m_SYS_cachestat = 451
  2450. const m_SYS_capget = 184
  2451. const m_SYS_capset = 185
  2452. const m_SYS_chdir = 12
  2453. const m_SYS_chmod = 15
  2454. const m_SYS_chown = 182
  2455. const m_SYS_chown32 = 212
  2456. const m_SYS_chroot = 61
  2457. const m_SYS_clock_adjtime = 343
  2458. const m_SYS_clock_adjtime64 = 405
  2459. const m_SYS_clock_getres_time64 = 406
  2460. const m_SYS_clock_gettime64 = 403
  2461. const m_SYS_clock_nanosleep_time64 = 407
  2462. const m_SYS_clock_settime64 = 404
  2463. const m_SYS_clone = 120
  2464. const m_SYS_clone3 = 435
  2465. const m_SYS_close = 6
  2466. const m_SYS_close_range = 436
  2467. const m_SYS_connect = 362
  2468. const m_SYS_copy_file_range = 377
  2469. const m_SYS_creat = 8
  2470. const m_SYS_create_module = 127
  2471. const m_SYS_delete_module = 129
  2472. const m_SYS_dup = 41
  2473. const m_SYS_dup2 = 63
  2474. const m_SYS_dup3 = 330
  2475. const m_SYS_epoll_create = 254
  2476. const m_SYS_epoll_create1 = 329
  2477. const m_SYS_epoll_ctl = 255
  2478. const m_SYS_epoll_pwait = 319
  2479. const m_SYS_epoll_pwait2 = 441
  2480. const m_SYS_epoll_wait = 256
  2481. const m_SYS_eventfd = 323
  2482. const m_SYS_eventfd2 = 328
  2483. const m_SYS_execve = 11
  2484. const m_SYS_execveat = 358
  2485. const m_SYS_exit = 1
  2486. const m_SYS_exit_group = 252
  2487. const m_SYS_faccessat = 307
  2488. const m_SYS_faccessat2 = 439
  2489. const m_SYS_fadvise64 = 250
  2490. const m_SYS_fadvise64_64 = 272
  2491. const m_SYS_fallocate = 324
  2492. const m_SYS_fanotify_init = 338
  2493. const m_SYS_fanotify_mark = 339
  2494. const m_SYS_fchdir = 133
  2495. const m_SYS_fchmod = 94
  2496. const m_SYS_fchmodat = 306
  2497. const m_SYS_fchmodat2 = 452
  2498. const m_SYS_fchown = 95
  2499. const m_SYS_fchown32 = 207
  2500. const m_SYS_fchownat = 298
  2501. const m_SYS_fcntl = 55
  2502. const m_SYS_fcntl64 = 221
  2503. const m_SYS_fdatasync = 148
  2504. const m_SYS_fgetxattr = 231
  2505. const m_SYS_finit_module = 350
  2506. const m_SYS_flistxattr = 234
  2507. const m_SYS_flock = 143
  2508. const m_SYS_fork = 2
  2509. const m_SYS_fremovexattr = 237
  2510. const m_SYS_fsconfig = 431
  2511. const m_SYS_fsetxattr = 228
  2512. const m_SYS_fsmount = 432
  2513. const m_SYS_fsopen = 430
  2514. const m_SYS_fspick = 433
  2515. const m_SYS_fstat = 108
  2516. const m_SYS_fstat64 = 197
  2517. const m_SYS_fstatat64 = 300
  2518. const m_SYS_fstatfs = 100
  2519. const m_SYS_fstatfs64 = 269
  2520. const m_SYS_fsync = 118
  2521. const m_SYS_ftime = 35
  2522. const m_SYS_ftruncate = 93
  2523. const m_SYS_ftruncate64 = 194
  2524. const m_SYS_futex = 240
  2525. const m_SYS_futex_time64 = 422
  2526. const m_SYS_futex_waitv = 449
  2527. const m_SYS_futimesat = 299
  2528. const m_SYS_get_kernel_syms = 130
  2529. const m_SYS_get_mempolicy = 275
  2530. const m_SYS_get_robust_list = 312
  2531. const m_SYS_get_thread_area = 244
  2532. const m_SYS_getcpu = 318
  2533. const m_SYS_getcwd = 183
  2534. const m_SYS_getdents = 141
  2535. const m_SYS_getdents64 = 220
  2536. const m_SYS_getegid = 50
  2537. const m_SYS_getegid32 = 202
  2538. const m_SYS_geteuid = 49
  2539. const m_SYS_geteuid32 = 201
  2540. const m_SYS_getgid = 47
  2541. const m_SYS_getgid32 = 200
  2542. const m_SYS_getgroups = 80
  2543. const m_SYS_getgroups32 = 205
  2544. const m_SYS_getitimer = 105
  2545. const m_SYS_getpeername = 368
  2546. const m_SYS_getpgid = 132
  2547. const m_SYS_getpgrp = 65
  2548. const m_SYS_getpid = 20
  2549. const m_SYS_getpmsg = 188
  2550. const m_SYS_getppid = 64
  2551. const m_SYS_getpriority = 96
  2552. const m_SYS_getrandom = 355
  2553. const m_SYS_getresgid = 171
  2554. const m_SYS_getresgid32 = 211
  2555. const m_SYS_getresuid = 165
  2556. const m_SYS_getresuid32 = 209
  2557. const m_SYS_getrlimit = 76
  2558. const m_SYS_getrusage = 77
  2559. const m_SYS_getsid = 147
  2560. const m_SYS_getsockname = 367
  2561. const m_SYS_getsockopt = 365
  2562. const m_SYS_gettid = 224
  2563. const m_SYS_gettimeofday_time32 = 78
  2564. const m_SYS_getuid = 24
  2565. const m_SYS_getuid32 = 199
  2566. const m_SYS_getxattr = 229
  2567. const m_SYS_gtty = 32
  2568. const m_SYS_idle = 112
  2569. const m_SYS_init_module = 128
  2570. const m_SYS_inotify_add_watch = 292
  2571. const m_SYS_inotify_init = 291
  2572. const m_SYS_inotify_init1 = 332
  2573. const m_SYS_inotify_rm_watch = 293
  2574. const m_SYS_io_cancel = 249
  2575. const m_SYS_io_destroy = 246
  2576. const m_SYS_io_getevents = 247
  2577. const m_SYS_io_pgetevents = 385
  2578. const m_SYS_io_pgetevents_time64 = 416
  2579. const m_SYS_io_setup = 245
  2580. const m_SYS_io_submit = 248
  2581. const m_SYS_io_uring_enter = 426
  2582. const m_SYS_io_uring_register = 427
  2583. const m_SYS_io_uring_setup = 425
  2584. const m_SYS_ioctl = 54
  2585. const m_SYS_ioperm = 101
  2586. const m_SYS_iopl = 110
  2587. const m_SYS_ioprio_get = 290
  2588. const m_SYS_ioprio_set = 289
  2589. const m_SYS_ipc = 117
  2590. const m_SYS_kcmp = 349
  2591. const m_SYS_kexec_load = 283
  2592. const m_SYS_keyctl = 288
  2593. const m_SYS_kill = 37
  2594. const m_SYS_landlock_add_rule = 445
  2595. const m_SYS_landlock_create_ruleset = 444
  2596. const m_SYS_landlock_restrict_self = 446
  2597. const m_SYS_lchown = 16
  2598. const m_SYS_lchown32 = 198
  2599. const m_SYS_lgetxattr = 230
  2600. const m_SYS_link = 9
  2601. const m_SYS_linkat = 303
  2602. const m_SYS_listen = 363
  2603. const m_SYS_listxattr = 232
  2604. const m_SYS_llistxattr = 233
  2605. const m_SYS_lock = 53
  2606. const m_SYS_lookup_dcookie = 253
  2607. const m_SYS_lremovexattr = 236
  2608. const m_SYS_lseek = 19
  2609. const m_SYS_lsetxattr = 227
  2610. const m_SYS_lstat = 107
  2611. const m_SYS_lstat64 = 196
  2612. const m_SYS_madvise = 219
  2613. const m_SYS_mbind = 274
  2614. const m_SYS_membarrier = 375
  2615. const m_SYS_memfd_create = 356
  2616. const m_SYS_memfd_secret = 447
  2617. const m_SYS_migrate_pages = 294
  2618. const m_SYS_mincore = 218
  2619. const m_SYS_mkdir = 39
  2620. const m_SYS_mkdirat = 296
  2621. const m_SYS_mknod = 14
  2622. const m_SYS_mknodat = 297
  2623. const m_SYS_mlock = 150
  2624. const m_SYS_mlock2 = 376
  2625. const m_SYS_mlockall = 152
  2626. const m_SYS_mmap = 90
  2627. const m_SYS_mmap2 = 192
  2628. const m_SYS_modify_ldt = 123
  2629. const m_SYS_mount = 21
  2630. const m_SYS_mount_setattr = 442
  2631. const m_SYS_move_mount = 429
  2632. const m_SYS_move_pages = 317
  2633. const m_SYS_mprotect = 125
  2634. const m_SYS_mpx = 56
  2635. const m_SYS_mq_open = 277
  2636. const m_SYS_mq_timedreceive_time64 = 419
  2637. const m_SYS_mq_timedsend_time64 = 418
  2638. const m_SYS_mremap = 163
  2639. const m_SYS_msgctl = 402
  2640. const m_SYS_msgget = 399
  2641. const m_SYS_msgrcv = 401
  2642. const m_SYS_msgsnd = 400
  2643. const m_SYS_msync = 144
  2644. const m_SYS_munlock = 151
  2645. const m_SYS_munlockall = 153
  2646. const m_SYS_munmap = 91
  2647. const m_SYS_name_to_handle_at = 341
  2648. const m_SYS_nanosleep = 162
  2649. const m_SYS_nfsservctl = 169
  2650. const m_SYS_nice = 34
  2651. const m_SYS_oldfstat = 28
  2652. const m_SYS_oldlstat = 84
  2653. const m_SYS_oldolduname = 59
  2654. const m_SYS_oldstat = 18
  2655. const m_SYS_olduname = 109
  2656. const m_SYS_open = 5
  2657. const m_SYS_open_by_handle_at = 342
  2658. const m_SYS_open_tree = 428
  2659. const m_SYS_openat = 295
  2660. const m_SYS_openat2 = 437
  2661. const m_SYS_pause = 29
  2662. const m_SYS_perf_event_open = 336
  2663. const m_SYS_personality = 136
  2664. const m_SYS_pidfd_getfd = 438
  2665. const m_SYS_pidfd_open = 434
  2666. const m_SYS_pidfd_send_signal = 424
  2667. const m_SYS_pipe = 42
  2668. const m_SYS_pipe2 = 331
  2669. const m_SYS_pivot_root = 217
  2670. const m_SYS_pkey_alloc = 381
  2671. const m_SYS_pkey_free = 382
  2672. const m_SYS_pkey_mprotect = 380
  2673. const m_SYS_poll = 168
  2674. const m_SYS_ppoll = 309
  2675. const m_SYS_ppoll_time64 = 414
  2676. const m_SYS_prctl = 172
  2677. const m_SYS_pread64 = 180
  2678. const m_SYS_preadv = 333
  2679. const m_SYS_preadv2 = 378
  2680. const m_SYS_prlimit64 = 340
  2681. const m_SYS_process_madvise = 440
  2682. const m_SYS_process_mrelease = 448
  2683. const m_SYS_process_vm_readv = 347
  2684. const m_SYS_process_vm_writev = 348
  2685. const m_SYS_prof = 44
  2686. const m_SYS_profil = 98
  2687. const m_SYS_pselect6 = 308
  2688. const m_SYS_pselect6_time64 = 413
  2689. const m_SYS_ptrace = 26
  2690. const m_SYS_putpmsg = 189
  2691. const m_SYS_pwrite64 = 181
  2692. const m_SYS_pwritev = 334
  2693. const m_SYS_pwritev2 = 379
  2694. const m_SYS_query_module = 167
  2695. const m_SYS_quotactl = 131
  2696. const m_SYS_read = 3
  2697. const m_SYS_readahead = 225
  2698. const m_SYS_readdir = 89
  2699. const m_SYS_readlink = 85
  2700. const m_SYS_readlinkat = 305
  2701. const m_SYS_readv = 145
  2702. const m_SYS_reboot = 88
  2703. const m_SYS_recvfrom = 371
  2704. const m_SYS_recvmmsg = 337
  2705. const m_SYS_recvmmsg_time64 = 417
  2706. const m_SYS_recvmsg = 372
  2707. const m_SYS_remap_file_pages = 257
  2708. const m_SYS_removexattr = 235
  2709. const m_SYS_rename = 38
  2710. const m_SYS_renameat = 302
  2711. const m_SYS_renameat2 = 353
  2712. const m_SYS_request_key = 287
  2713. const m_SYS_restart_syscall = 0
  2714. const m_SYS_rmdir = 40
  2715. const m_SYS_rseq = 386
  2716. const m_SYS_rt_sigaction = 174
  2717. const m_SYS_rt_sigpending = 176
  2718. const m_SYS_rt_sigprocmask = 175
  2719. const m_SYS_rt_sigqueueinfo = 178
  2720. const m_SYS_rt_sigreturn = 173
  2721. const m_SYS_rt_sigsuspend = 179
  2722. const m_SYS_rt_sigtimedwait = 177
  2723. const m_SYS_rt_sigtimedwait_time64 = 421
  2724. const m_SYS_rt_tgsigqueueinfo = 335
  2725. const m_SYS_sched_get_priority_max = 159
  2726. const m_SYS_sched_get_priority_min = 160
  2727. const m_SYS_sched_getaffinity = 242
  2728. const m_SYS_sched_getattr = 352
  2729. const m_SYS_sched_getparam = 155
  2730. const m_SYS_sched_getscheduler = 157
  2731. const m_SYS_sched_rr_get_interval = 161
  2732. const m_SYS_sched_rr_get_interval_time64 = 423
  2733. const m_SYS_sched_setaffinity = 241
  2734. const m_SYS_sched_setattr = 351
  2735. const m_SYS_sched_setparam = 154
  2736. const m_SYS_sched_setscheduler = 156
  2737. const m_SYS_sched_yield = 158
  2738. const m_SYS_seccomp = 354
  2739. const m_SYS_select = 82
  2740. const m_SYS_semctl = 394
  2741. const m_SYS_semget = 393
  2742. const m_SYS_semtimedop_time64 = 420
  2743. const m_SYS_sendfile = 187
  2744. const m_SYS_sendfile64 = 239
  2745. const m_SYS_sendmmsg = 345
  2746. const m_SYS_sendmsg = 370
  2747. const m_SYS_sendto = 369
  2748. const m_SYS_set_mempolicy = 276
  2749. const m_SYS_set_mempolicy_home_node = 450
  2750. const m_SYS_set_robust_list = 311
  2751. const m_SYS_set_thread_area = 243
  2752. const m_SYS_set_tid_address = 258
  2753. const m_SYS_setdomainname = 121
  2754. const m_SYS_setfsgid = 139
  2755. const m_SYS_setfsgid32 = 216
  2756. const m_SYS_setfsuid = 138
  2757. const m_SYS_setfsuid32 = 215
  2758. const m_SYS_setgid = 46
  2759. const m_SYS_setgid32 = 214
  2760. const m_SYS_setgroups = 81
  2761. const m_SYS_setgroups32 = 206
  2762. const m_SYS_sethostname = 74
  2763. const m_SYS_setitimer = 104
  2764. const m_SYS_setns = 346
  2765. const m_SYS_setpgid = 57
  2766. const m_SYS_setpriority = 97
  2767. const m_SYS_setregid = 71
  2768. const m_SYS_setregid32 = 204
  2769. const m_SYS_setresgid = 170
  2770. const m_SYS_setresgid32 = 210
  2771. const m_SYS_setresuid = 164
  2772. const m_SYS_setresuid32 = 208
  2773. const m_SYS_setreuid = 70
  2774. const m_SYS_setreuid32 = 203
  2775. const m_SYS_setrlimit = 75
  2776. const m_SYS_setsid = 66
  2777. const m_SYS_setsockopt = 366
  2778. const m_SYS_settimeofday_time32 = 79
  2779. const m_SYS_setuid = 23
  2780. const m_SYS_setuid32 = 213
  2781. const m_SYS_setxattr = 226
  2782. const m_SYS_sgetmask = 68
  2783. const m_SYS_shmat = 397
  2784. const m_SYS_shmctl = 396
  2785. const m_SYS_shmdt = 398
  2786. const m_SYS_shmget = 395
  2787. const m_SYS_shutdown = 373
  2788. const m_SYS_sigaction = 67
  2789. const m_SYS_sigaltstack = 186
  2790. const m_SYS_signal = 48
  2791. const m_SYS_signalfd = 321
  2792. const m_SYS_signalfd4 = 327
  2793. const m_SYS_sigpending = 73
  2794. const m_SYS_sigprocmask = 126
  2795. const m_SYS_sigreturn = 119
  2796. const m_SYS_sigsuspend = 72
  2797. const m_SYS_socket = 359
  2798. const m_SYS_socketcall = 102
  2799. const m_SYS_socketpair = 360
  2800. const m_SYS_splice = 313
  2801. const m_SYS_ssetmask = 69
  2802. const m_SYS_stat = 106
  2803. const m_SYS_stat64 = 195
  2804. const m_SYS_statfs = 99
  2805. const m_SYS_statfs64 = 268
  2806. const m_SYS_statx = 383
  2807. const m_SYS_stime = 25
  2808. const m_SYS_stty = 31
  2809. const m_SYS_swapoff = 115
  2810. const m_SYS_swapon = 87
  2811. const m_SYS_symlink = 83
  2812. const m_SYS_symlinkat = 304
  2813. const m_SYS_sync = 36
  2814. const m_SYS_sync_file_range = 314
  2815. const m_SYS_syncfs = 344
  2816. const m_SYS_sysfs = 135
  2817. const m_SYS_sysinfo = 116
  2818. const m_SYS_syslog = 103
  2819. const m_SYS_tee = 315
  2820. const m_SYS_tgkill = 270
  2821. const m_SYS_time = 13
  2822. const m_SYS_timer_create = 259
  2823. const m_SYS_timer_gettime64 = 408
  2824. const m_SYS_timer_settime64 = 409
  2825. const m_SYS_timerfd_create = 322
  2826. const m_SYS_timerfd_gettime32 = 326
  2827. const m_SYS_timerfd_gettime64 = 410
  2828. const m_SYS_timerfd_settime32 = 325
  2829. const m_SYS_timerfd_settime64 = 411
  2830. const m_SYS_times = 43
  2831. const m_SYS_tkill = 238
  2832. const m_SYS_truncate = 92
  2833. const m_SYS_truncate64 = 193
  2834. const m_SYS_ugetrlimit = 191
  2835. const m_SYS_ulimit = 58
  2836. const m_SYS_umask = 60
  2837. const m_SYS_umount = 22
  2838. const m_SYS_umount2 = 52
  2839. const m_SYS_uname = 122
  2840. const m_SYS_unlink = 10
  2841. const m_SYS_unlinkat = 301
  2842. const m_SYS_unshare = 310
  2843. const m_SYS_uselib = 86
  2844. const m_SYS_userfaultfd = 374
  2845. const m_SYS_ustat = 62
  2846. const m_SYS_utime = 30
  2847. const m_SYS_utimensat = 320
  2848. const m_SYS_utimensat_time64 = 412
  2849. const m_SYS_utimes = 271
  2850. const m_SYS_vfork = 190
  2851. const m_SYS_vhangup = 111
  2852. const m_SYS_vm86 = 166
  2853. const m_SYS_vm86old = 113
  2854. const m_SYS_vmsplice = 316
  2855. const m_SYS_vserver = 273
  2856. const m_SYS_wait4 = 114
  2857. const m_SYS_waitid = 284
  2858. const m_SYS_waitpid = 7
  2859. const m_SYS_write = 4
  2860. const m_SYS_writev = 146
  2861. const m_UINT_MAX1 = 4294967295
  2862. const m___NR__llseek = 140
  2863. const m___NR__newselect = 142
  2864. const m___NR__sysctl = 149
  2865. const m___NR_accept4 = 364
  2866. const m___NR_access = 33
  2867. const m___NR_acct = 51
  2868. const m___NR_add_key = 286
  2869. const m___NR_adjtimex = 124
  2870. const m___NR_afs_syscall = 137
  2871. const m___NR_alarm = 27
  2872. const m___NR_arch_prctl = 384
  2873. const m___NR_bdflush = 134
  2874. const m___NR_bind = 361
  2875. const m___NR_bpf = 357
  2876. const m___NR_break = 17
  2877. const m___NR_brk = 45
  2878. const m___NR_cachestat = 451
  2879. const m___NR_capget = 184
  2880. const m___NR_capset = 185
  2881. const m___NR_chdir = 12
  2882. const m___NR_chmod = 15
  2883. const m___NR_chown = 182
  2884. const m___NR_chown32 = 212
  2885. const m___NR_chroot = 61
  2886. const m___NR_clock_adjtime = 343
  2887. const m___NR_clock_adjtime64 = 405
  2888. const m___NR_clock_getres_time64 = 406
  2889. const m___NR_clock_gettime64 = 403
  2890. const m___NR_clock_nanosleep_time64 = 407
  2891. const m___NR_clock_settime64 = 404
  2892. const m___NR_clone = 120
  2893. const m___NR_clone3 = 435
  2894. const m___NR_close = 6
  2895. const m___NR_close_range = 436
  2896. const m___NR_connect = 362
  2897. const m___NR_copy_file_range = 377
  2898. const m___NR_creat = 8
  2899. const m___NR_create_module = 127
  2900. const m___NR_delete_module = 129
  2901. const m___NR_dup = 41
  2902. const m___NR_dup2 = 63
  2903. const m___NR_dup3 = 330
  2904. const m___NR_epoll_create = 254
  2905. const m___NR_epoll_create1 = 329
  2906. const m___NR_epoll_ctl = 255
  2907. const m___NR_epoll_pwait = 319
  2908. const m___NR_epoll_pwait2 = 441
  2909. const m___NR_epoll_wait = 256
  2910. const m___NR_eventfd = 323
  2911. const m___NR_eventfd2 = 328
  2912. const m___NR_execve = 11
  2913. const m___NR_execveat = 358
  2914. const m___NR_exit = 1
  2915. const m___NR_exit_group = 252
  2916. const m___NR_faccessat = 307
  2917. const m___NR_faccessat2 = 439
  2918. const m___NR_fadvise64 = 250
  2919. const m___NR_fadvise64_64 = 272
  2920. const m___NR_fallocate = 324
  2921. const m___NR_fanotify_init = 338
  2922. const m___NR_fanotify_mark = 339
  2923. const m___NR_fchdir = 133
  2924. const m___NR_fchmod = 94
  2925. const m___NR_fchmodat = 306
  2926. const m___NR_fchmodat2 = 452
  2927. const m___NR_fchown = 95
  2928. const m___NR_fchown32 = 207
  2929. const m___NR_fchownat = 298
  2930. const m___NR_fcntl = 55
  2931. const m___NR_fcntl64 = 221
  2932. const m___NR_fdatasync = 148
  2933. const m___NR_fgetxattr = 231
  2934. const m___NR_finit_module = 350
  2935. const m___NR_flistxattr = 234
  2936. const m___NR_flock = 143
  2937. const m___NR_fork = 2
  2938. const m___NR_fremovexattr = 237
  2939. const m___NR_fsconfig = 431
  2940. const m___NR_fsetxattr = 228
  2941. const m___NR_fsmount = 432
  2942. const m___NR_fsopen = 430
  2943. const m___NR_fspick = 433
  2944. const m___NR_fstat = 108
  2945. const m___NR_fstat64 = 197
  2946. const m___NR_fstatat64 = 300
  2947. const m___NR_fstatfs = 100
  2948. const m___NR_fstatfs64 = 269
  2949. const m___NR_fsync = 118
  2950. const m___NR_ftime = 35
  2951. const m___NR_ftruncate = 93
  2952. const m___NR_ftruncate64 = 194
  2953. const m___NR_futex = 240
  2954. const m___NR_futex_time64 = 422
  2955. const m___NR_futex_waitv = 449
  2956. const m___NR_futimesat = 299
  2957. const m___NR_get_kernel_syms = 130
  2958. const m___NR_get_mempolicy = 275
  2959. const m___NR_get_robust_list = 312
  2960. const m___NR_get_thread_area = 244
  2961. const m___NR_getcpu = 318
  2962. const m___NR_getcwd = 183
  2963. const m___NR_getdents = 141
  2964. const m___NR_getdents64 = 220
  2965. const m___NR_getegid = 50
  2966. const m___NR_getegid32 = 202
  2967. const m___NR_geteuid = 49
  2968. const m___NR_geteuid32 = 201
  2969. const m___NR_getgid = 47
  2970. const m___NR_getgid32 = 200
  2971. const m___NR_getgroups = 80
  2972. const m___NR_getgroups32 = 205
  2973. const m___NR_getitimer = 105
  2974. const m___NR_getpeername = 368
  2975. const m___NR_getpgid = 132
  2976. const m___NR_getpgrp = 65
  2977. const m___NR_getpid = 20
  2978. const m___NR_getpmsg = 188
  2979. const m___NR_getppid = 64
  2980. const m___NR_getpriority = 96
  2981. const m___NR_getrandom = 355
  2982. const m___NR_getresgid = 171
  2983. const m___NR_getresgid32 = 211
  2984. const m___NR_getresuid = 165
  2985. const m___NR_getresuid32 = 209
  2986. const m___NR_getrlimit = 76
  2987. const m___NR_getrusage = 77
  2988. const m___NR_getsid = 147
  2989. const m___NR_getsockname = 367
  2990. const m___NR_getsockopt = 365
  2991. const m___NR_gettid = 224
  2992. const m___NR_gettimeofday_time32 = 78
  2993. const m___NR_getuid = 24
  2994. const m___NR_getuid32 = 199
  2995. const m___NR_getxattr = 229
  2996. const m___NR_gtty = 32
  2997. const m___NR_idle = 112
  2998. const m___NR_init_module = 128
  2999. const m___NR_inotify_add_watch = 292
  3000. const m___NR_inotify_init = 291
  3001. const m___NR_inotify_init1 = 332
  3002. const m___NR_inotify_rm_watch = 293
  3003. const m___NR_io_cancel = 249
  3004. const m___NR_io_destroy = 246
  3005. const m___NR_io_getevents = 247
  3006. const m___NR_io_pgetevents = 385
  3007. const m___NR_io_pgetevents_time64 = 416
  3008. const m___NR_io_setup = 245
  3009. const m___NR_io_submit = 248
  3010. const m___NR_io_uring_enter = 426
  3011. const m___NR_io_uring_register = 427
  3012. const m___NR_io_uring_setup = 425
  3013. const m___NR_ioctl = 54
  3014. const m___NR_ioperm = 101
  3015. const m___NR_iopl = 110
  3016. const m___NR_ioprio_get = 290
  3017. const m___NR_ioprio_set = 289
  3018. const m___NR_ipc = 117
  3019. const m___NR_kcmp = 349
  3020. const m___NR_kexec_load = 283
  3021. const m___NR_keyctl = 288
  3022. const m___NR_kill = 37
  3023. const m___NR_landlock_add_rule = 445
  3024. const m___NR_landlock_create_ruleset = 444
  3025. const m___NR_landlock_restrict_self = 446
  3026. const m___NR_lchown = 16
  3027. const m___NR_lchown32 = 198
  3028. const m___NR_lgetxattr = 230
  3029. const m___NR_link = 9
  3030. const m___NR_linkat = 303
  3031. const m___NR_listen = 363
  3032. const m___NR_listxattr = 232
  3033. const m___NR_llistxattr = 233
  3034. const m___NR_lock = 53
  3035. const m___NR_lookup_dcookie = 253
  3036. const m___NR_lremovexattr = 236
  3037. const m___NR_lseek = 19
  3038. const m___NR_lsetxattr = 227
  3039. const m___NR_lstat = 107
  3040. const m___NR_lstat64 = 196
  3041. const m___NR_madvise = 219
  3042. const m___NR_mbind = 274
  3043. const m___NR_membarrier = 375
  3044. const m___NR_memfd_create = 356
  3045. const m___NR_memfd_secret = 447
  3046. const m___NR_migrate_pages = 294
  3047. const m___NR_mincore = 218
  3048. const m___NR_mkdir = 39
  3049. const m___NR_mkdirat = 296
  3050. const m___NR_mknod = 14
  3051. const m___NR_mknodat = 297
  3052. const m___NR_mlock = 150
  3053. const m___NR_mlock2 = 376
  3054. const m___NR_mlockall = 152
  3055. const m___NR_mmap = 90
  3056. const m___NR_mmap2 = 192
  3057. const m___NR_modify_ldt = 123
  3058. const m___NR_mount = 21
  3059. const m___NR_mount_setattr = 442
  3060. const m___NR_move_mount = 429
  3061. const m___NR_move_pages = 317
  3062. const m___NR_mprotect = 125
  3063. const m___NR_mpx = 56
  3064. const m___NR_mq_open = 277
  3065. const m___NR_mq_timedreceive_time64 = 419
  3066. const m___NR_mq_timedsend_time64 = 418
  3067. const m___NR_mremap = 163
  3068. const m___NR_msgctl = 402
  3069. const m___NR_msgget = 399
  3070. const m___NR_msgrcv = 401
  3071. const m___NR_msgsnd = 400
  3072. const m___NR_msync = 144
  3073. const m___NR_munlock = 151
  3074. const m___NR_munlockall = 153
  3075. const m___NR_munmap = 91
  3076. const m___NR_name_to_handle_at = 341
  3077. const m___NR_nanosleep = 162
  3078. const m___NR_nfsservctl = 169
  3079. const m___NR_nice = 34
  3080. const m___NR_oldfstat = 28
  3081. const m___NR_oldlstat = 84
  3082. const m___NR_oldolduname = 59
  3083. const m___NR_oldstat = 18
  3084. const m___NR_olduname = 109
  3085. const m___NR_open = 5
  3086. const m___NR_open_by_handle_at = 342
  3087. const m___NR_open_tree = 428
  3088. const m___NR_openat = 295
  3089. const m___NR_openat2 = 437
  3090. const m___NR_pause = 29
  3091. const m___NR_perf_event_open = 336
  3092. const m___NR_personality = 136
  3093. const m___NR_pidfd_getfd = 438
  3094. const m___NR_pidfd_open = 434
  3095. const m___NR_pidfd_send_signal = 424
  3096. const m___NR_pipe = 42
  3097. const m___NR_pipe2 = 331
  3098. const m___NR_pivot_root = 217
  3099. const m___NR_pkey_alloc = 381
  3100. const m___NR_pkey_free = 382
  3101. const m___NR_pkey_mprotect = 380
  3102. const m___NR_poll = 168
  3103. const m___NR_ppoll = 309
  3104. const m___NR_ppoll_time64 = 414
  3105. const m___NR_prctl = 172
  3106. const m___NR_pread64 = 180
  3107. const m___NR_preadv = 333
  3108. const m___NR_preadv2 = 378
  3109. const m___NR_prlimit64 = 340
  3110. const m___NR_process_madvise = 440
  3111. const m___NR_process_mrelease = 448
  3112. const m___NR_process_vm_readv = 347
  3113. const m___NR_process_vm_writev = 348
  3114. const m___NR_prof = 44
  3115. const m___NR_profil = 98
  3116. const m___NR_pselect6 = 308
  3117. const m___NR_pselect6_time64 = 413
  3118. const m___NR_ptrace = 26
  3119. const m___NR_putpmsg = 189
  3120. const m___NR_pwrite64 = 181
  3121. const m___NR_pwritev = 334
  3122. const m___NR_pwritev2 = 379
  3123. const m___NR_query_module = 167
  3124. const m___NR_quotactl = 131
  3125. const m___NR_read = 3
  3126. const m___NR_readahead = 225
  3127. const m___NR_readdir = 89
  3128. const m___NR_readlink = 85
  3129. const m___NR_readlinkat = 305
  3130. const m___NR_readv = 145
  3131. const m___NR_reboot = 88
  3132. const m___NR_recvfrom = 371
  3133. const m___NR_recvmmsg = 337
  3134. const m___NR_recvmmsg_time64 = 417
  3135. const m___NR_recvmsg = 372
  3136. const m___NR_remap_file_pages = 257
  3137. const m___NR_removexattr = 235
  3138. const m___NR_rename = 38
  3139. const m___NR_renameat = 302
  3140. const m___NR_renameat2 = 353
  3141. const m___NR_request_key = 287
  3142. const m___NR_restart_syscall = 0
  3143. const m___NR_rmdir = 40
  3144. const m___NR_rseq = 386
  3145. const m___NR_rt_sigaction = 174
  3146. const m___NR_rt_sigpending = 176
  3147. const m___NR_rt_sigprocmask = 175
  3148. const m___NR_rt_sigqueueinfo = 178
  3149. const m___NR_rt_sigreturn = 173
  3150. const m___NR_rt_sigsuspend = 179
  3151. const m___NR_rt_sigtimedwait = 177
  3152. const m___NR_rt_sigtimedwait_time64 = 421
  3153. const m___NR_rt_tgsigqueueinfo = 335
  3154. const m___NR_sched_get_priority_max = 159
  3155. const m___NR_sched_get_priority_min = 160
  3156. const m___NR_sched_getaffinity = 242
  3157. const m___NR_sched_getattr = 352
  3158. const m___NR_sched_getparam = 155
  3159. const m___NR_sched_getscheduler = 157
  3160. const m___NR_sched_rr_get_interval = 161
  3161. const m___NR_sched_rr_get_interval_time64 = 423
  3162. const m___NR_sched_setaffinity = 241
  3163. const m___NR_sched_setattr = 351
  3164. const m___NR_sched_setparam = 154
  3165. const m___NR_sched_setscheduler = 156
  3166. const m___NR_sched_yield = 158
  3167. const m___NR_seccomp = 354
  3168. const m___NR_select = 82
  3169. const m___NR_semctl = 394
  3170. const m___NR_semget = 393
  3171. const m___NR_semtimedop_time64 = 420
  3172. const m___NR_sendfile = 187
  3173. const m___NR_sendfile64 = 239
  3174. const m___NR_sendmmsg = 345
  3175. const m___NR_sendmsg = 370
  3176. const m___NR_sendto = 369
  3177. const m___NR_set_mempolicy = 276
  3178. const m___NR_set_mempolicy_home_node = 450
  3179. const m___NR_set_robust_list = 311
  3180. const m___NR_set_thread_area = 243
  3181. const m___NR_set_tid_address = 258
  3182. const m___NR_setdomainname = 121
  3183. const m___NR_setfsgid = 139
  3184. const m___NR_setfsgid32 = 216
  3185. const m___NR_setfsuid = 138
  3186. const m___NR_setfsuid32 = 215
  3187. const m___NR_setgid = 46
  3188. const m___NR_setgid32 = 214
  3189. const m___NR_setgroups = 81
  3190. const m___NR_setgroups32 = 206
  3191. const m___NR_sethostname = 74
  3192. const m___NR_setitimer = 104
  3193. const m___NR_setns = 346
  3194. const m___NR_setpgid = 57
  3195. const m___NR_setpriority = 97
  3196. const m___NR_setregid = 71
  3197. const m___NR_setregid32 = 204
  3198. const m___NR_setresgid = 170
  3199. const m___NR_setresgid32 = 210
  3200. const m___NR_setresuid = 164
  3201. const m___NR_setresuid32 = 208
  3202. const m___NR_setreuid = 70
  3203. const m___NR_setreuid32 = 203
  3204. const m___NR_setrlimit = 75
  3205. const m___NR_setsid = 66
  3206. const m___NR_setsockopt = 366
  3207. const m___NR_settimeofday_time32 = 79
  3208. const m___NR_setuid = 23
  3209. const m___NR_setuid32 = 213
  3210. const m___NR_setxattr = 226
  3211. const m___NR_sgetmask = 68
  3212. const m___NR_shmat = 397
  3213. const m___NR_shmctl = 396
  3214. const m___NR_shmdt = 398
  3215. const m___NR_shmget = 395
  3216. const m___NR_shutdown = 373
  3217. const m___NR_sigaction = 67
  3218. const m___NR_sigaltstack = 186
  3219. const m___NR_signal = 48
  3220. const m___NR_signalfd = 321
  3221. const m___NR_signalfd4 = 327
  3222. const m___NR_sigpending = 73
  3223. const m___NR_sigprocmask = 126
  3224. const m___NR_sigreturn = 119
  3225. const m___NR_sigsuspend = 72
  3226. const m___NR_socket = 359
  3227. const m___NR_socketcall = 102
  3228. const m___NR_socketpair = 360
  3229. const m___NR_splice = 313
  3230. const m___NR_ssetmask = 69
  3231. const m___NR_stat = 106
  3232. const m___NR_stat64 = 195
  3233. const m___NR_statfs = 99
  3234. const m___NR_statfs64 = 268
  3235. const m___NR_statx = 383
  3236. const m___NR_stime = 25
  3237. const m___NR_stty = 31
  3238. const m___NR_swapoff = 115
  3239. const m___NR_swapon = 87
  3240. const m___NR_symlink = 83
  3241. const m___NR_symlinkat = 304
  3242. const m___NR_sync = 36
  3243. const m___NR_sync_file_range = 314
  3244. const m___NR_syncfs = 344
  3245. const m___NR_sysfs = 135
  3246. const m___NR_sysinfo = 116
  3247. const m___NR_syslog = 103
  3248. const m___NR_tee = 315
  3249. const m___NR_tgkill = 270
  3250. const m___NR_time = 13
  3251. const m___NR_timer_create = 259
  3252. const m___NR_timer_gettime64 = 408
  3253. const m___NR_timer_settime64 = 409
  3254. const m___NR_timerfd_create = 322
  3255. const m___NR_timerfd_gettime32 = 326
  3256. const m___NR_timerfd_gettime64 = 410
  3257. const m___NR_timerfd_settime32 = 325
  3258. const m___NR_timerfd_settime64 = 411
  3259. const m___NR_times = 43
  3260. const m___NR_tkill = 238
  3261. const m___NR_truncate = 92
  3262. const m___NR_truncate64 = 193
  3263. const m___NR_ugetrlimit = 191
  3264. const m___NR_ulimit = 58
  3265. const m___NR_umask = 60
  3266. const m___NR_umount = 22
  3267. const m___NR_umount2 = 52
  3268. const m___NR_uname = 122
  3269. const m___NR_unlink = 10
  3270. const m___NR_unlinkat = 301
  3271. const m___NR_unshare = 310
  3272. const m___NR_uselib = 86
  3273. const m___NR_userfaultfd = 374
  3274. const m___NR_ustat = 62
  3275. const m___NR_utime = 30
  3276. const m___NR_utimensat = 320
  3277. const m___NR_utimensat_time64 = 412
  3278. const m___NR_utimes = 271
  3279. const m___NR_vfork = 190
  3280. const m___NR_vhangup = 111
  3281. const m___NR_vm86 = 166
  3282. const m___NR_vm86old = 113
  3283. const m___NR_vmsplice = 316
  3284. const m___NR_vserver = 273
  3285. const m___NR_wait4 = 114
  3286. const m___NR_waitid = 284
  3287. const m___NR_waitpid = 7
  3288. const m___NR_write = 4
  3289. const m___NR_writev = 146
  3290. const m_d_fileno = "d_ino"
  3291. type Tdirent = struct {
  3292. Fd_ino Tino_t
  3293. Fd_off Toff_t
  3294. Fd_reclen uint16
  3295. Fd_type uint8
  3296. Fd_name [256]int8
  3297. }
  3298. func _closefrom_close(tls *libc.TLS, fd int32) {
  3299. libc.Xclose(tls, fd)
  3300. }
  3301. func _sys_close_range(tls *libc.TLS, fd uint32, max_fd uint32, flags uint32) (r int32) {
  3302. bp := tls.Alloc(32)
  3303. defer tls.Free(32)
  3304. return int32(libc.Xsyscall(tls, int32(m_SYS_close_range), libc.VaList(bp+8, fd, max_fd, flags)))
  3305. }
  3306. // C documentation
  3307. //
  3308. // /*
  3309. // * Close all file descriptors greater than or equal to lowfd.
  3310. // * This is the expensive (fallback) method.
  3311. // */
  3312. func _closefrom_fallback(tls *libc.TLS, lowfd int32) {
  3313. var fd, maxfd int32
  3314. _, _ = fd, maxfd
  3315. /*
  3316. * Fall back on sysconf(_SC_OPEN_MAX) or getdtablesize(). This is
  3317. * equivalent to checking the RLIMIT_NOFILE soft limit. It is
  3318. * possible for there to be open file descriptors past this limit
  3319. * but there is not much we can do about that since the hard limit
  3320. * may be RLIM_INFINITY (LLONG_MAX or ULLONG_MAX on modern systems).
  3321. */
  3322. maxfd = libc.Xsysconf(tls, int32(m__SC_OPEN_MAX))
  3323. if maxfd < int32(m_OPEN_MAX) {
  3324. maxfd = int32(m_OPEN_MAX)
  3325. }
  3326. /* Make sure we did not get RLIM_INFINITY as the upper limit. */
  3327. if maxfd > int32(m_INT_MAX1) {
  3328. maxfd = int32(m_INT_MAX1)
  3329. }
  3330. fd = lowfd
  3331. for {
  3332. if !(fd < maxfd) {
  3333. break
  3334. }
  3335. _closefrom_close(tls, fd)
  3336. goto _1
  3337. _1:
  3338. ;
  3339. fd++
  3340. }
  3341. }
  3342. func _closefrom_procfs(tls *libc.TLS, lowfd int32) (r int32) {
  3343. bp := tls.Alloc(16)
  3344. defer tls.Free(16)
  3345. var dent, dirp, fd_array, path, ptr, v1 uintptr
  3346. var fd, fd_array_size, fd_array_used, i, ret, v2 int32
  3347. var _ /* errstr at bp+0 */ uintptr
  3348. _, _, _, _, _, _, _, _, _, _, _, _ = dent, dirp, fd, fd_array, fd_array_size, fd_array_used, i, path, ptr, ret, v1, v2
  3349. fd_array = libc.UintptrFromInt32(0)
  3350. fd_array_used = 0
  3351. fd_array_size = 0
  3352. ret = 0
  3353. /* Use /proc/self/fd (or /dev/fd on macOS) if it exists. */
  3354. path = __ccgo_ts
  3355. dirp = libc.Xopendir(tls, path)
  3356. if dirp == libc.UintptrFromInt32(0) {
  3357. return -int32(1)
  3358. }
  3359. for {
  3360. v1 = libc.Xreaddir(tls, dirp)
  3361. dent = v1
  3362. if !(v1 != libc.UintptrFromInt32(0)) {
  3363. break
  3364. }
  3365. fd = int32(Xstrtonum(tls, dent+19, int64(lowfd), int64(m_INT_MAX1), bp))
  3366. if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) || fd == libc.Xdirfd(tls, dirp) {
  3367. continue
  3368. }
  3369. if fd_array_used >= fd_array_size {
  3370. if fd_array_size > 0 {
  3371. fd_array_size *= int32(2)
  3372. } else {
  3373. fd_array_size = int32(32)
  3374. }
  3375. ptr = Xreallocarray(tls, fd_array, libc.Uint32FromInt32(fd_array_size), uint32(4))
  3376. if ptr == libc.UintptrFromInt32(0) {
  3377. ret = -int32(1)
  3378. break
  3379. }
  3380. fd_array = ptr
  3381. }
  3382. v2 = fd_array_used
  3383. fd_array_used++
  3384. *(*int32)(unsafe.Pointer(fd_array + uintptr(v2)*4)) = fd
  3385. }
  3386. i = 0
  3387. for {
  3388. if !(i < fd_array_used) {
  3389. break
  3390. }
  3391. _closefrom_close(tls, *(*int32)(unsafe.Pointer(fd_array + uintptr(i)*4)))
  3392. goto _3
  3393. _3:
  3394. ;
  3395. i++
  3396. }
  3397. libc.Xfree(tls, fd_array)
  3398. libc.Xclosedir(tls, dirp)
  3399. return ret
  3400. }
  3401. // C documentation
  3402. //
  3403. // /*
  3404. // * Close all file descriptors greater than or equal to lowfd.
  3405. // * We try the fast way first, falling back on the slow method.
  3406. // */
  3407. func Xclosefrom(tls *libc.TLS, lowfd int32) {
  3408. if lowfd < 0 {
  3409. lowfd = 0
  3410. }
  3411. /* Try the fast methods first, if possible. */
  3412. if _sys_close_range(tls, libc.Uint32FromInt32(lowfd), uint32(0xffffffff), uint32(0)) == 0 {
  3413. return
  3414. }
  3415. if _closefrom_procfs(tls, lowfd) != -int32(1) {
  3416. return
  3417. }
  3418. /* Do things the slow way. */
  3419. _closefrom_fallback(tls, lowfd)
  3420. }
  3421. const m_INT64_MAX1 = 9223372036854775807
  3422. func Xdehumanize_number(tls *libc.TLS, buf uintptr, num uintptr) (r int32) {
  3423. bp := tls.Alloc(16)
  3424. defer tls.Free(16)
  3425. var rc, sign, v1, v2 int32
  3426. var rmax Tuint64_t
  3427. var _ /* rval at bp+0 */ Tuint64_t
  3428. _, _, _, _, _ = rc, rmax, sign, v1, v2
  3429. sign = +libc.Int32FromInt32(1)
  3430. /* The current expand_number() implementation uses bit shifts, so
  3431. * we cannot pass negative numbers, preserve the sign and apply it
  3432. * later. */
  3433. for {
  3434. v1 = int32(*(*int8)(unsafe.Pointer(buf)))
  3435. v2 = libc.BoolInt32(v1 == int32(' ') || libc.Uint32FromInt32(v1)-uint32('\t') < uint32(5))
  3436. goto _3
  3437. _3:
  3438. if !(v2 != 0) {
  3439. break
  3440. }
  3441. buf++
  3442. }
  3443. if int32(*(*int8)(unsafe.Pointer(buf))) == int32('-') {
  3444. sign = -int32(1)
  3445. buf++
  3446. }
  3447. rc = Xexpand_number(tls, buf, bp)
  3448. if rc < 0 {
  3449. return rc
  3450. }
  3451. /* The sign has been stripped, so rval has the absolute value.
  3452. * Error out, regardless of the sign, if rval is greater than
  3453. * abs(INT64_MIN) (== INT64_MAX + 1), or if the sign is positive
  3454. * and the value has overflown by one (INT64_MAX + 1). */
  3455. rmax = libc.Uint64FromInt64(libc.Int64FromInt64(m_INT64_MAX1)) + libc.Uint64FromUint64(1)
  3456. if *(*Tuint64_t)(unsafe.Pointer(bp)) > rmax || *(*Tuint64_t)(unsafe.Pointer(bp)) == rmax && sign == +libc.Int32FromInt32(1) {
  3457. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ERANGE)
  3458. return -int32(1)
  3459. }
  3460. *(*Tint64_t)(unsafe.Pointer(num)) = libc.Int64FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) * libc.Uint64FromInt32(sign))
  3461. return 0
  3462. }
  3463. const m_INT64_MAX2 = 0x7fffffffffffffff
  3464. /*
  3465. * Copyright © 2004-2005, 2009, 2011-2013 Guillem Jover <guillem@hadrons.org>
  3466. *
  3467. * Redistribution and use in source and binary forms, with or without
  3468. * modification, are permitted provided that the following conditions
  3469. * are met:
  3470. * 1. Redistributions of source code must retain the above copyright
  3471. * notice, this list of conditions and the following disclaimer.
  3472. * 2. Redistributions in binary form must reproduce the above copyright
  3473. * notice, this list of conditions and the following disclaimer in the
  3474. * documentation and/or other materials provided with the distribution.
  3475. * 3. The name of the author may not be used to endorse or promote products
  3476. * derived from this software without specific prior written permission.
  3477. *
  3478. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  3479. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  3480. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  3481. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  3482. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  3483. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  3484. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  3485. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  3486. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  3487. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3488. */
  3489. func Xvwarnc(tls *libc.TLS, code int32, format uintptr, ap Tva_list) {
  3490. bp := tls.Alloc(16)
  3491. defer tls.Free(16)
  3492. libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+14, libc.VaList(bp+8, Xgetprogname(tls)))
  3493. if format != 0 {
  3494. libc.Xvfprintf(tls, libc.Xstderr, format, ap)
  3495. libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+19, 0)
  3496. }
  3497. libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+22, libc.VaList(bp+8, libc.Xstrerror(tls, code)))
  3498. }
  3499. func Xwarnc(tls *libc.TLS, code int32, format uintptr, va uintptr) {
  3500. var ap Tva_list
  3501. _ = ap
  3502. ap = va
  3503. Xvwarnc(tls, code, format, ap)
  3504. _ = ap
  3505. }
  3506. func Xverrc(tls *libc.TLS, status int32, code int32, format uintptr, ap Tva_list) {
  3507. bp := tls.Alloc(16)
  3508. defer tls.Free(16)
  3509. libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+14, libc.VaList(bp+8, Xgetprogname(tls)))
  3510. if format != 0 {
  3511. libc.Xvfprintf(tls, libc.Xstderr, format, ap)
  3512. libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+19, 0)
  3513. }
  3514. libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+22, libc.VaList(bp+8, libc.Xstrerror(tls, code)))
  3515. libc.Xexit(tls, status)
  3516. }
  3517. func Xerrc(tls *libc.TLS, status int32, code int32, format uintptr, va uintptr) {
  3518. var ap Tva_list
  3519. _ = ap
  3520. ap = va
  3521. Xverrc(tls, status, code, format, ap)
  3522. _ = ap
  3523. }
  3524. const m_PRIX16 = "X"
  3525. const m_PRIX32 = "X"
  3526. const m_PRIX8 = "X"
  3527. const m_PRIXFAST16 = "X"
  3528. const m_PRIXFAST32 = "X"
  3529. const m_PRIXFAST8 = "X"
  3530. const m_PRIXLEAST16 = "X"
  3531. const m_PRIXLEAST32 = "X"
  3532. const m_PRIXLEAST8 = "X"
  3533. const m_PRId16 = "d"
  3534. const m_PRId32 = "d"
  3535. const m_PRId8 = "d"
  3536. const m_PRIdFAST16 = "d"
  3537. const m_PRIdFAST32 = "d"
  3538. const m_PRIdFAST8 = "d"
  3539. const m_PRIdLEAST16 = "d"
  3540. const m_PRIdLEAST32 = "d"
  3541. const m_PRIdLEAST8 = "d"
  3542. const m_PRIi16 = "i"
  3543. const m_PRIi32 = "i"
  3544. const m_PRIi8 = "i"
  3545. const m_PRIiFAST16 = "i"
  3546. const m_PRIiFAST32 = "i"
  3547. const m_PRIiFAST8 = "i"
  3548. const m_PRIiLEAST16 = "i"
  3549. const m_PRIiLEAST32 = "i"
  3550. const m_PRIiLEAST8 = "i"
  3551. const m_PRIo16 = "o"
  3552. const m_PRIo32 = "o"
  3553. const m_PRIo8 = "o"
  3554. const m_PRIoFAST16 = "o"
  3555. const m_PRIoFAST32 = "o"
  3556. const m_PRIoFAST8 = "o"
  3557. const m_PRIoLEAST16 = "o"
  3558. const m_PRIoLEAST32 = "o"
  3559. const m_PRIoLEAST8 = "o"
  3560. const m_PRIu16 = "u"
  3561. const m_PRIu32 = "u"
  3562. const m_PRIu8 = "u"
  3563. const m_PRIuFAST16 = "u"
  3564. const m_PRIuFAST32 = "u"
  3565. const m_PRIuFAST8 = "u"
  3566. const m_PRIuLEAST16 = "u"
  3567. const m_PRIuLEAST32 = "u"
  3568. const m_PRIuLEAST8 = "u"
  3569. const m_PRIx16 = "x"
  3570. const m_PRIx32 = "x"
  3571. const m_PRIx8 = "x"
  3572. const m_PRIxFAST16 = "x"
  3573. const m_PRIxFAST32 = "x"
  3574. const m_PRIxFAST8 = "x"
  3575. const m_PRIxLEAST16 = "x"
  3576. const m_PRIxLEAST32 = "x"
  3577. const m_PRIxLEAST8 = "x"
  3578. const m_SCNd16 = "hd"
  3579. const m_SCNd32 = "d"
  3580. const m_SCNd8 = "hhd"
  3581. const m_SCNdFAST16 = "d"
  3582. const m_SCNdFAST32 = "d"
  3583. const m_SCNdFAST8 = "hhd"
  3584. const m_SCNdLEAST16 = "hd"
  3585. const m_SCNdLEAST32 = "d"
  3586. const m_SCNdLEAST8 = "hhd"
  3587. const m_SCNi16 = "hi"
  3588. const m_SCNi32 = "i"
  3589. const m_SCNi8 = "hhi"
  3590. const m_SCNiFAST16 = "i"
  3591. const m_SCNiFAST32 = "i"
  3592. const m_SCNiFAST8 = "hhi"
  3593. const m_SCNiLEAST16 = "hi"
  3594. const m_SCNiLEAST32 = "i"
  3595. const m_SCNiLEAST8 = "hhi"
  3596. const m_SCNo16 = "ho"
  3597. const m_SCNo32 = "o"
  3598. const m_SCNo8 = "hho"
  3599. const m_SCNoFAST16 = "o"
  3600. const m_SCNoFAST32 = "o"
  3601. const m_SCNoFAST8 = "hho"
  3602. const m_SCNoLEAST16 = "ho"
  3603. const m_SCNoLEAST32 = "o"
  3604. const m_SCNoLEAST8 = "hho"
  3605. const m_SCNu16 = "hu"
  3606. const m_SCNu32 = "u"
  3607. const m_SCNu8 = "hhu"
  3608. const m_SCNuFAST16 = "u"
  3609. const m_SCNuFAST32 = "u"
  3610. const m_SCNuFAST8 = "hhu"
  3611. const m_SCNuLEAST16 = "hu"
  3612. const m_SCNuLEAST32 = "u"
  3613. const m_SCNuLEAST8 = "hhu"
  3614. const m_SCNx16 = "hx"
  3615. const m_SCNx32 = "x"
  3616. const m_SCNx8 = "hhx"
  3617. const m_SCNxFAST16 = "x"
  3618. const m_SCNxFAST32 = "x"
  3619. const m_SCNxFAST8 = "hhx"
  3620. const m_SCNxLEAST16 = "hx"
  3621. const m_SCNxLEAST32 = "x"
  3622. const m_SCNxLEAST8 = "hhx"
  3623. const m___PRI64 = "ll"
  3624. const m___PRIPTR = ""
  3625. type Timaxdiv_t = struct {
  3626. Fquot Tintmax_t
  3627. Frem Tintmax_t
  3628. }
  3629. /* Values for humanize_number(3)'s flags parameter. */
  3630. /* Values for humanize_number(3)'s scale parameter. */
  3631. /*
  3632. * fparseln() specific operation flags.
  3633. */
  3634. // C documentation
  3635. //
  3636. // /*
  3637. // * Convert an expression of the following forms to a uint64_t.
  3638. // * 1) A positive decimal number.
  3639. // * 2) A positive decimal number followed by a 'b' or 'B' (mult by 1).
  3640. // * 3) A positive decimal number followed by a 'k' or 'K' (mult by 1 << 10).
  3641. // * 4) A positive decimal number followed by a 'm' or 'M' (mult by 1 << 20).
  3642. // * 5) A positive decimal number followed by a 'g' or 'G' (mult by 1 << 30).
  3643. // * 6) A positive decimal number followed by a 't' or 'T' (mult by 1 << 40).
  3644. // * 7) A positive decimal number followed by a 'p' or 'P' (mult by 1 << 50).
  3645. // * 8) A positive decimal number followed by a 'e' or 'E' (mult by 1 << 60).
  3646. // */
  3647. func Xexpand_number(tls *libc.TLS, buf uintptr, num uintptr) (r int32) {
  3648. bp := tls.Alloc(16)
  3649. defer tls.Free(16)
  3650. var number Tuint64_t
  3651. var shift uint32
  3652. var _ /* endptr at bp+0 */ uintptr
  3653. _, _ = number, shift
  3654. number = libc.Xstrtoumax(tls, buf, bp, 0)
  3655. if *(*uintptr)(unsafe.Pointer(bp)) == buf {
  3656. /* No valid digits. */
  3657. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  3658. return -int32(1)
  3659. }
  3660. switch libc.Xtolower(tls, libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))) {
  3661. case int32('e'):
  3662. shift = uint32(60)
  3663. case int32('p'):
  3664. shift = uint32(50)
  3665. case int32('t'):
  3666. shift = uint32(40)
  3667. case int32('g'):
  3668. shift = uint32(30)
  3669. case int32('m'):
  3670. shift = uint32(20)
  3671. case int32('k'):
  3672. shift = uint32(10)
  3673. case int32('b'):
  3674. fallthrough
  3675. case int32('\000'): /* No unit. */
  3676. *(*Tuint64_t)(unsafe.Pointer(num)) = number
  3677. return 0
  3678. default:
  3679. /* Unrecognized unit. */
  3680. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  3681. return -int32(1)
  3682. }
  3683. if number<<shift>>shift != number {
  3684. /* Overflow */
  3685. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ERANGE)
  3686. return -int32(1)
  3687. }
  3688. *(*Tuint64_t)(unsafe.Pointer(num)) = number << shift
  3689. return 0
  3690. }
  3691. func X__explicit_bzero_hook(tls *libc.TLS, buf uintptr, len1 Tsize_t) {
  3692. }
  3693. func Xexplicit_bzero(tls *libc.TLS, buf uintptr, len1 Tsize_t) {
  3694. libc.Xmemset(tls, buf, 0, len1)
  3695. X__explicit_bzero_hook(tls, buf, len1)
  3696. }
  3697. const m_FILEBUF_POOL_ITEMS = 32
  3698. /*
  3699. * Copyright © 2015 Guillem Jover <guillem@hadrons.org>
  3700. *
  3701. * Redistribution and use in source and binary forms, with or without
  3702. * modification, are permitted provided that the following conditions
  3703. * are met:
  3704. * 1. Redistributions of source code must retain the above copyright
  3705. * notice, this list of conditions and the following disclaimer.
  3706. * 2. Redistributions in binary form must reproduce the above copyright
  3707. * notice, this list of conditions and the following disclaimer in the
  3708. * documentation and/or other materials provided with the distribution.
  3709. * 3. The name of the author may not be used to endorse or promote products
  3710. * derived from this software without specific prior written permission.
  3711. *
  3712. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  3713. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  3714. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  3715. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  3716. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  3717. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  3718. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  3719. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  3720. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  3721. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3722. */
  3723. /*
  3724. * Copyright © 2004-2006, 2009-2011 Guillem Jover <guillem@hadrons.org>
  3725. *
  3726. * Redistribution and use in source and binary forms, with or without
  3727. * modification, are permitted provided that the following conditions
  3728. * are met:
  3729. * 1. Redistributions of source code must retain the above copyright
  3730. * notice, this list of conditions and the following disclaimer.
  3731. * 2. Redistributions in binary form must reproduce the above copyright
  3732. * notice, this list of conditions and the following disclaimer in the
  3733. * documentation and/or other materials provided with the distribution.
  3734. * 3. The name of the author may not be used to endorse or promote products
  3735. * derived from this software without specific prior written permission.
  3736. *
  3737. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  3738. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  3739. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  3740. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  3741. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  3742. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  3743. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  3744. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  3745. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  3746. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3747. */
  3748. /* Clang expands this to 1 if an identifier is *not* reserved. */
  3749. /*
  3750. * Some libc implementations do not have a <sys/cdefs.h>, in particular
  3751. * musl, try to handle this gracefully.
  3752. */
  3753. /* Copyright (C) 1992-2022 Free Software Foundation, Inc.
  3754. Copyright The GNU Toolchain Authors.
  3755. This file is part of the GNU C Library.
  3756. The GNU C Library is free software; you can redistribute it and/or
  3757. modify it under the terms of the GNU Lesser General Public
  3758. License as published by the Free Software Foundation; either
  3759. version 2.1 of the License, or (at your option) any later version.
  3760. The GNU C Library is distributed in the hope that it will be useful,
  3761. but WITHOUT ANY WARRANTY; without even the implied warranty of
  3762. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  3763. Lesser General Public License for more details.
  3764. You should have received a copy of the GNU Lesser General Public
  3765. License along with the GNU C Library; if not, see
  3766. <https://www.gnu.org/licenses/>. */
  3767. type Tfilebuf = struct {
  3768. Ffp uintptr
  3769. Fbuf uintptr
  3770. Flen1 Tsize_t
  3771. }
  3772. var _fb_pool [32]Tfilebuf
  3773. var _fb_pool_cur int32
  3774. func Xfgetln(tls *libc.TLS, stream uintptr, len1 uintptr) (r uintptr) {
  3775. var fb uintptr
  3776. var nread Tssize_t
  3777. _, _ = fb, nread
  3778. libc.Xflockfile(tls, stream)
  3779. /* Try to diminish the possibility of several fgetln() calls being
  3780. * used on different streams, by using a pool of buffers per file. */
  3781. fb = uintptr(unsafe.Pointer(&_fb_pool)) + uintptr(_fb_pool_cur)*12
  3782. if (*Tfilebuf)(unsafe.Pointer(fb)).Ffp != stream && (*Tfilebuf)(unsafe.Pointer(fb)).Ffp != libc.UintptrFromInt32(0) {
  3783. _fb_pool_cur++
  3784. _fb_pool_cur %= int32(m_FILEBUF_POOL_ITEMS)
  3785. fb = uintptr(unsafe.Pointer(&_fb_pool)) + uintptr(_fb_pool_cur)*12
  3786. }
  3787. (*Tfilebuf)(unsafe.Pointer(fb)).Ffp = stream
  3788. nread = libc.Xgetline(tls, fb+4, fb+8, stream)
  3789. libc.Xfunlockfile(tls, stream)
  3790. /* Note: the getdelim/getline API ensures nread != 0. */
  3791. if nread == -int32(1) {
  3792. *(*Tsize_t)(unsafe.Pointer(len1)) = uint32(0)
  3793. return libc.UintptrFromInt32(0)
  3794. } else {
  3795. *(*Tsize_t)(unsafe.Pointer(len1)) = libc.Uint32FromInt32(nread)
  3796. return (*Tfilebuf)(unsafe.Pointer(fb)).Fbuf
  3797. }
  3798. return r
  3799. }
  3800. var _libbsd_emit_link_warning_fgetln = [115]int8{'T', 'h', 'e', ' ', 'f', 'g', 'e', 't', 'l', 'n', '(', ')', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'c', 'a', 'n', 'n', 'o', 't', ' ', 'b', 'e', ' ', 's', 'a', 'f', 'e', 'l', 'y', ' ', 'p', 'o', 'r', 't', 'e', 'd', ',', ' ', 'u', 's', 'e', ' ', 'g', 'e', 't', 'l', 'i', 'n', 'e', '(', '3', ')', ' ', 'i', 'n', 's', 't', 'e', 'a', 'd', ',', ' ', 'a', 's', ' ', 'i', 't', ' ', 'i', 's', ' ', 's', 'u', 'p', 'p', 'o', 'r', 't', 'e', 'd', ' ', 'b', 'y', ' ', 'G', 'N', 'U', ' ', 'a', 'n', 'd', ' ', 'P', 'O', 'S', 'I', 'X', '.', '1', '-', '2', '0', '0', '8', '.'}
  3801. func Xfreezero(tls *libc.TLS, ptr uintptr, sz Tsize_t) {
  3802. /* This is legal. */
  3803. if ptr == libc.UintptrFromInt32(0) {
  3804. return
  3805. }
  3806. Xexplicit_bzero(tls, ptr, sz)
  3807. libc.Xfree(tls, ptr)
  3808. }
  3809. const m_FILEWBUF_INIT_LEN = 128
  3810. const m_FILEWBUF_POOL_ITEMS = 32
  3811. type Twint_t = uint32
  3812. type Twctype_t = uint32
  3813. type Tmbstate_t = struct {
  3814. F__opaque1 uint32
  3815. F__opaque2 uint32
  3816. }
  3817. type t__mbstate_t = Tmbstate_t
  3818. type Tmax_align_t = struct {
  3819. F__ll int64
  3820. F__ld float64
  3821. }
  3822. type Tptrdiff_t = int32
  3823. /*
  3824. * Copyright © 2015 Guillem Jover <guillem@hadrons.org>
  3825. *
  3826. * Redistribution and use in source and binary forms, with or without
  3827. * modification, are permitted provided that the following conditions
  3828. * are met:
  3829. * 1. Redistributions of source code must retain the above copyright
  3830. * notice, this list of conditions and the following disclaimer.
  3831. * 2. Redistributions in binary form must reproduce the above copyright
  3832. * notice, this list of conditions and the following disclaimer in the
  3833. * documentation and/or other materials provided with the distribution.
  3834. * 3. The name of the author may not be used to endorse or promote products
  3835. * derived from this software without specific prior written permission.
  3836. *
  3837. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  3838. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  3839. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  3840. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  3841. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  3842. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  3843. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  3844. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  3845. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  3846. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3847. */
  3848. /*
  3849. * Copyright © 2004-2006, 2009-2011 Guillem Jover <guillem@hadrons.org>
  3850. *
  3851. * Redistribution and use in source and binary forms, with or without
  3852. * modification, are permitted provided that the following conditions
  3853. * are met:
  3854. * 1. Redistributions of source code must retain the above copyright
  3855. * notice, this list of conditions and the following disclaimer.
  3856. * 2. Redistributions in binary form must reproduce the above copyright
  3857. * notice, this list of conditions and the following disclaimer in the
  3858. * documentation and/or other materials provided with the distribution.
  3859. * 3. The name of the author may not be used to endorse or promote products
  3860. * derived from this software without specific prior written permission.
  3861. *
  3862. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  3863. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  3864. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  3865. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  3866. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  3867. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  3868. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  3869. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  3870. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  3871. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3872. */
  3873. /* Clang expands this to 1 if an identifier is *not* reserved. */
  3874. /*
  3875. * Some libc implementations do not have a <sys/cdefs.h>, in particular
  3876. * musl, try to handle this gracefully.
  3877. */
  3878. /* Copyright (C) 1992-2022 Free Software Foundation, Inc.
  3879. Copyright The GNU Toolchain Authors.
  3880. This file is part of the GNU C Library.
  3881. The GNU C Library is free software; you can redistribute it and/or
  3882. modify it under the terms of the GNU Lesser General Public
  3883. License as published by the Free Software Foundation; either
  3884. version 2.1 of the License, or (at your option) any later version.
  3885. The GNU C Library is distributed in the hope that it will be useful,
  3886. but WITHOUT ANY WARRANTY; without even the implied warranty of
  3887. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  3888. Lesser General Public License for more details.
  3889. You should have received a copy of the GNU Lesser General Public
  3890. License along with the GNU C Library; if not, see
  3891. <https://www.gnu.org/licenses/>. */
  3892. type Tfilewbuf = struct {
  3893. Ffp uintptr
  3894. Fwbuf uintptr
  3895. Flen1 Tsize_t
  3896. }
  3897. var _fb_pool1 [32]Tfilewbuf
  3898. var _fb_pool_cur1 int32
  3899. func Xfgetwln(tls *libc.TLS, stream uintptr, lenp uintptr) (r uintptr) {
  3900. var fb, wp, v3 uintptr
  3901. var wc, v1 Twint_t
  3902. var wused, v2 Tsize_t
  3903. _, _, _, _, _, _, _ = fb, wc, wp, wused, v1, v2, v3
  3904. wused = uint32(0)
  3905. /* Try to diminish the possibility of several fgetwln() calls being
  3906. * used on different streams, by using a pool of buffers per file. */
  3907. fb = uintptr(unsafe.Pointer(&_fb_pool1)) + uintptr(_fb_pool_cur1)*12
  3908. if (*Tfilewbuf)(unsafe.Pointer(fb)).Ffp != stream && (*Tfilewbuf)(unsafe.Pointer(fb)).Ffp != libc.UintptrFromInt32(0) {
  3909. _fb_pool_cur1++
  3910. _fb_pool_cur1 %= int32(m_FILEWBUF_POOL_ITEMS)
  3911. fb = uintptr(unsafe.Pointer(&_fb_pool1)) + uintptr(_fb_pool_cur1)*12
  3912. }
  3913. (*Tfilewbuf)(unsafe.Pointer(fb)).Ffp = stream
  3914. for {
  3915. v1 = libc.Xfgetwc(tls, stream)
  3916. wc = v1
  3917. if !(v1 != uint32(0xffffffff)) {
  3918. break
  3919. }
  3920. if !((*Tfilewbuf)(unsafe.Pointer(fb)).Flen1 != 0) || wused >= (*Tfilewbuf)(unsafe.Pointer(fb)).Flen1 {
  3921. if (*Tfilewbuf)(unsafe.Pointer(fb)).Flen1 != 0 {
  3922. *(*Tsize_t)(unsafe.Pointer(fb + 8)) *= uint32(2)
  3923. } else {
  3924. (*Tfilewbuf)(unsafe.Pointer(fb)).Flen1 = uint32(m_FILEWBUF_INIT_LEN)
  3925. }
  3926. wp = Xreallocarray(tls, (*Tfilewbuf)(unsafe.Pointer(fb)).Fwbuf, (*Tfilewbuf)(unsafe.Pointer(fb)).Flen1, uint32(4))
  3927. if wp == libc.UintptrFromInt32(0) {
  3928. wused = uint32(0)
  3929. break
  3930. }
  3931. (*Tfilewbuf)(unsafe.Pointer(fb)).Fwbuf = wp
  3932. }
  3933. v2 = wused
  3934. wused++
  3935. *(*Twchar_t)(unsafe.Pointer((*Tfilewbuf)(unsafe.Pointer(fb)).Fwbuf + uintptr(v2)*4)) = libc.Int32FromUint32(wc)
  3936. if wc == uint32('\n') {
  3937. break
  3938. }
  3939. }
  3940. *(*Tsize_t)(unsafe.Pointer(lenp)) = wused
  3941. if wused != 0 {
  3942. v3 = (*Tfilewbuf)(unsafe.Pointer(fb)).Fwbuf
  3943. } else {
  3944. v3 = libc.UintptrFromInt32(0)
  3945. }
  3946. return v3
  3947. }
  3948. // C documentation
  3949. //
  3950. // /* XXX: Ideally we'd recommend getwline(3), but unfortunately even though it
  3951. // * was part of the ISO/IEC TR 24731-2:2010 draft, it did not make it into C11
  3952. // * and is not widely implemented. */
  3953. var _libbsd_emit_link_warning_fgetwln = [115]int8{'T', 'h', 'e', ' ', 'f', 'g', 'e', 't', 'w', 'l', 'n', '(', ')', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'c', 'a', 'n', 'n', 'o', 't', ' ', 'b', 'e', ' ', 's', 'a', 'f', 'e', 'l', 'y', ' ', 'p', 'o', 'r', 't', 'e', 'd', ',', ' ', 'u', 's', 'e', ' ', 'f', 'g', 'e', 't', 'w', 'c', '(', '3', ')', ' ', 'i', 'n', 's', 't', 'e', 'a', 'd', ',', ' ', 'a', 's', ' ', 'i', 't', ' ', 'i', 's', ' ', 's', 'u', 'p', 'p', 'o', 'r', 't', 'e', 'd', ' ', 'b', 'y', ' ', 'C', '9', '9', ' ', 'a', 'n', 'd', ' ', 'P', 'O', 'S', 'I', 'X', '.', '1', '-', '2', '0', '0', '1', '.'}
  3954. const m_LOCK_EX = 2
  3955. const m_LOCK_NB = 4
  3956. const m_LOCK_SH = 1
  3957. const m_LOCK_UN = 8
  3958. const m_O_CREAT1 = 64
  3959. const m_O_NONBLOCK1 = 2048
  3960. const m_O_TRUNC1 = 512
  3961. /* Values for humanize_number(3)'s flags parameter. */
  3962. /* Values for humanize_number(3)'s scale parameter. */
  3963. /*
  3964. * fparseln() specific operation flags.
  3965. */
  3966. // C documentation
  3967. //
  3968. // /*
  3969. // * Reliably open and lock a file.
  3970. // *
  3971. // * Please do not modify this code without first reading the revision history
  3972. // * and discussing your changes with <des@freebsd.org>. Don't be fooled by the
  3973. // * code's apparent simplicity; there would be no need for this function if it
  3974. // * was easy to get right.
  3975. // */
  3976. func _vflopenat(tls *libc.TLS, dirfd int32, path uintptr, flags int32, ap Tva_list) (r int32) {
  3977. bp := tls.Alloc(304)
  3978. defer tls.Free(304)
  3979. var fd, operation, serrno, trunc, v2 int32
  3980. var mode Tmode_t
  3981. var _ /* fsb at bp+144 */ Tstat
  3982. var _ /* sb at bp+0 */ Tstat
  3983. _, _, _, _, _, _ = fd, mode, operation, serrno, trunc, v2
  3984. mode = uint32(0)
  3985. if flags&int32(m_O_CREAT1) != 0 {
  3986. mode = libc.Uint32FromInt32(libc.VaInt32(&ap)) /* mode_t promoted to int */
  3987. }
  3988. operation = int32(m_LOCK_EX)
  3989. if flags&int32(m_O_NONBLOCK1) != 0 {
  3990. operation |= int32(m_LOCK_NB)
  3991. }
  3992. trunc = flags & int32(m_O_TRUNC1)
  3993. flags &= ^libc.Int32FromInt32(m_O_TRUNC1)
  3994. for {
  3995. v2 = libc.Xopenat(tls, dirfd, path, flags, libc.VaList(bp+296, mode))
  3996. fd = v2
  3997. if v2 == -int32(1) {
  3998. /* non-existent or no access */
  3999. return -int32(1)
  4000. }
  4001. if libc.Xflock(tls, fd, operation) == -int32(1) {
  4002. /* unsupported or interrupted */
  4003. serrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  4004. libc.Xclose(tls, fd)
  4005. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = serrno
  4006. return -int32(1)
  4007. }
  4008. if libc.Xfstatat(tls, dirfd, path, bp, 0) == -int32(1) {
  4009. /* disappeared from under our feet */
  4010. libc.Xclose(tls, fd)
  4011. goto _1
  4012. }
  4013. if libc.Xfstat(tls, fd, bp+144) == -int32(1) {
  4014. /* can't happen [tm] */
  4015. serrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  4016. libc.Xclose(tls, fd)
  4017. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = serrno
  4018. return -int32(1)
  4019. }
  4020. if (*(*Tstat)(unsafe.Pointer(bp))).Fst_dev != (*(*Tstat)(unsafe.Pointer(bp + 144))).Fst_dev || (*(*Tstat)(unsafe.Pointer(bp))).Fst_ino != (*(*Tstat)(unsafe.Pointer(bp + 144))).Fst_ino {
  4021. /* changed under our feet */
  4022. libc.Xclose(tls, fd)
  4023. goto _1
  4024. }
  4025. if trunc != 0 && libc.Xftruncate(tls, fd, 0) != 0 {
  4026. /* can't happen [tm] */
  4027. serrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  4028. libc.Xclose(tls, fd)
  4029. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = serrno
  4030. return -int32(1)
  4031. }
  4032. /*
  4033. * The following change is provided as a specific example to
  4034. * avoid.
  4035. */
  4036. return fd
  4037. goto _1
  4038. _1:
  4039. }
  4040. return r
  4041. }
  4042. func Xflopen(tls *libc.TLS, path uintptr, flags int32, va uintptr) (r int32) {
  4043. var ap Tva_list
  4044. var ret int32
  4045. _, _ = ap, ret
  4046. ap = va
  4047. ret = _vflopenat(tls, -int32(100), path, flags, ap)
  4048. _ = ap
  4049. return ret
  4050. }
  4051. func Xflopenat(tls *libc.TLS, dirfd int32, path uintptr, flags int32, va uintptr) (r int32) {
  4052. var ap Tva_list
  4053. var ret int32
  4054. _, _ = ap, ret
  4055. ap = va
  4056. ret = _vflopenat(tls, dirfd, path, flags, ap)
  4057. _ = ap
  4058. return ret
  4059. }
  4060. type ___e_fmtcheck_types = int32
  4061. const _FMTCHECK_START = 0
  4062. const _FMTCHECK_SHORT = 1
  4063. const _FMTCHECK_INT = 2
  4064. const _FMTCHECK_WINTT = 3
  4065. const _FMTCHECK_LONG = 4
  4066. const _FMTCHECK_QUAD = 5
  4067. const _FMTCHECK_INTMAXT = 6
  4068. const _FMTCHECK_PTRDIFFT = 7
  4069. const _FMTCHECK_SIZET = 8
  4070. const _FMTCHECK_POINTER = 9
  4071. const _FMTCHECK_CHARPOINTER = 10
  4072. const _FMTCHECK_SHORTPOINTER = 11
  4073. const _FMTCHECK_INTPOINTER = 12
  4074. const _FMTCHECK_LONGPOINTER = 13
  4075. const _FMTCHECK_QUADPOINTER = 14
  4076. const _FMTCHECK_INTMAXTPOINTER = 15
  4077. const _FMTCHECK_PTRDIFFTPOINTER = 16
  4078. const _FMTCHECK_SIZETPOINTER = 17
  4079. const _FMTCHECK_DOUBLE = 18
  4080. const _FMTCHECK_LONGDOUBLE = 19
  4081. const _FMTCHECK_STRING = 20
  4082. const _FMTCHECK_WSTRING = 21
  4083. const _FMTCHECK_WIDTH = 22
  4084. const _FMTCHECK_PRECISION = 23
  4085. const _FMTCHECK_DONE = 24
  4086. const _FMTCHECK_UNKNOWN = 25
  4087. type TEFT = int32
  4088. type _e_modifier = int32
  4089. const _MOD_NONE = 0
  4090. const _MOD_CHAR = 1
  4091. const _MOD_SHORT = 2
  4092. const _MOD_LONG = 3
  4093. const _MOD_QUAD = 4
  4094. const _MOD_INTMAXT = 5
  4095. const _MOD_LONGDOUBLE = 6
  4096. const _MOD_PTRDIFFT = 7
  4097. const _MOD_SIZET = 8
  4098. func _get_next_format_from_precision(tls *libc.TLS, pf uintptr) (r TEFT) {
  4099. var f uintptr
  4100. var modifier _e_modifier
  4101. _, _ = f, modifier
  4102. f = *(*uintptr)(unsafe.Pointer(pf))
  4103. switch int32(*(*int8)(unsafe.Pointer(f))) {
  4104. case int32('h'):
  4105. f++
  4106. if !(*(*int8)(unsafe.Pointer(f)) != 0) {
  4107. *(*uintptr)(unsafe.Pointer(pf)) = f
  4108. return int32(_FMTCHECK_UNKNOWN)
  4109. }
  4110. if int32(*(*int8)(unsafe.Pointer(f))) == int32('h') {
  4111. f++
  4112. modifier = int32(_MOD_CHAR)
  4113. } else {
  4114. modifier = int32(_MOD_SHORT)
  4115. }
  4116. case int32('j'):
  4117. f++
  4118. modifier = int32(_MOD_INTMAXT)
  4119. case int32('l'):
  4120. f++
  4121. if !(*(*int8)(unsafe.Pointer(f)) != 0) {
  4122. *(*uintptr)(unsafe.Pointer(pf)) = f
  4123. return int32(_FMTCHECK_UNKNOWN)
  4124. }
  4125. if int32(*(*int8)(unsafe.Pointer(f))) == int32('l') {
  4126. f++
  4127. modifier = int32(_MOD_QUAD)
  4128. } else {
  4129. modifier = int32(_MOD_LONG)
  4130. }
  4131. case int32('q'):
  4132. f++
  4133. modifier = int32(_MOD_QUAD)
  4134. case int32('t'):
  4135. f++
  4136. modifier = int32(_MOD_PTRDIFFT)
  4137. case int32('z'):
  4138. f++
  4139. modifier = int32(_MOD_SIZET)
  4140. case int32('L'):
  4141. f++
  4142. modifier = int32(_MOD_LONGDOUBLE)
  4143. default:
  4144. modifier = int32(_MOD_NONE)
  4145. break
  4146. }
  4147. if !(*(*int8)(unsafe.Pointer(f)) != 0) {
  4148. *(*uintptr)(unsafe.Pointer(pf)) = f
  4149. return int32(_FMTCHECK_UNKNOWN)
  4150. }
  4151. if libc.Xstrchr(tls, __ccgo_ts+26, int32(*(*int8)(unsafe.Pointer(f)))) != 0 {
  4152. switch modifier {
  4153. case int32(_MOD_LONG):
  4154. goto _1
  4155. case int32(_MOD_QUAD):
  4156. goto _2
  4157. case int32(_MOD_INTMAXT):
  4158. goto _3
  4159. case int32(_MOD_PTRDIFFT):
  4160. goto _4
  4161. case int32(_MOD_SIZET):
  4162. goto _5
  4163. case int32(_MOD_NONE):
  4164. goto _6
  4165. case int32(_MOD_SHORT):
  4166. goto _7
  4167. case int32(_MOD_CHAR):
  4168. goto _8
  4169. default:
  4170. goto _9
  4171. }
  4172. goto _10
  4173. _1:
  4174. ;
  4175. _13:
  4176. ;
  4177. *(*uintptr)(unsafe.Pointer(pf)) = f
  4178. return int32(_FMTCHECK_LONG)
  4179. goto _12
  4180. _12:
  4181. ;
  4182. if 0 != 0 {
  4183. goto _13
  4184. }
  4185. goto _11
  4186. _11:
  4187. ;
  4188. _2:
  4189. ;
  4190. *(*uintptr)(unsafe.Pointer(pf)) = f
  4191. return int32(_FMTCHECK_QUAD)
  4192. _3:
  4193. ;
  4194. *(*uintptr)(unsafe.Pointer(pf)) = f
  4195. return int32(_FMTCHECK_INTMAXT)
  4196. _4:
  4197. ;
  4198. *(*uintptr)(unsafe.Pointer(pf)) = f
  4199. return int32(_FMTCHECK_PTRDIFFT)
  4200. _5:
  4201. ;
  4202. *(*uintptr)(unsafe.Pointer(pf)) = f
  4203. return int32(_FMTCHECK_SIZET)
  4204. _8:
  4205. ;
  4206. _7:
  4207. ;
  4208. _6:
  4209. ;
  4210. *(*uintptr)(unsafe.Pointer(pf)) = f
  4211. return int32(_FMTCHECK_INT)
  4212. _9:
  4213. ;
  4214. *(*uintptr)(unsafe.Pointer(pf)) = f
  4215. return int32(_FMTCHECK_UNKNOWN)
  4216. _10:
  4217. }
  4218. if int32(*(*int8)(unsafe.Pointer(f))) == int32('n') {
  4219. switch modifier {
  4220. case int32(_MOD_CHAR):
  4221. goto _14
  4222. case int32(_MOD_SHORT):
  4223. goto _15
  4224. case int32(_MOD_LONG):
  4225. goto _16
  4226. case int32(_MOD_QUAD):
  4227. goto _17
  4228. case int32(_MOD_INTMAXT):
  4229. goto _18
  4230. case int32(_MOD_PTRDIFFT):
  4231. goto _19
  4232. case int32(_MOD_SIZET):
  4233. goto _20
  4234. case int32(_MOD_NONE):
  4235. goto _21
  4236. default:
  4237. goto _22
  4238. }
  4239. goto _23
  4240. _14:
  4241. ;
  4242. _26:
  4243. ;
  4244. *(*uintptr)(unsafe.Pointer(pf)) = f
  4245. return int32(_FMTCHECK_CHARPOINTER)
  4246. goto _25
  4247. _25:
  4248. ;
  4249. if 0 != 0 {
  4250. goto _26
  4251. }
  4252. goto _24
  4253. _24:
  4254. ;
  4255. _15:
  4256. ;
  4257. *(*uintptr)(unsafe.Pointer(pf)) = f
  4258. return int32(_FMTCHECK_SHORTPOINTER)
  4259. _16:
  4260. ;
  4261. *(*uintptr)(unsafe.Pointer(pf)) = f
  4262. return int32(_FMTCHECK_LONGPOINTER)
  4263. _17:
  4264. ;
  4265. *(*uintptr)(unsafe.Pointer(pf)) = f
  4266. return int32(_FMTCHECK_QUADPOINTER)
  4267. _18:
  4268. ;
  4269. *(*uintptr)(unsafe.Pointer(pf)) = f
  4270. return int32(_FMTCHECK_INTMAXTPOINTER)
  4271. _19:
  4272. ;
  4273. *(*uintptr)(unsafe.Pointer(pf)) = f
  4274. return int32(_FMTCHECK_PTRDIFFTPOINTER)
  4275. _20:
  4276. ;
  4277. *(*uintptr)(unsafe.Pointer(pf)) = f
  4278. return int32(_FMTCHECK_SIZETPOINTER)
  4279. _21:
  4280. ;
  4281. *(*uintptr)(unsafe.Pointer(pf)) = f
  4282. return int32(_FMTCHECK_INTPOINTER)
  4283. _22:
  4284. ;
  4285. *(*uintptr)(unsafe.Pointer(pf)) = f
  4286. return int32(_FMTCHECK_UNKNOWN)
  4287. _23:
  4288. }
  4289. if libc.Xstrchr(tls, __ccgo_ts+33, int32(*(*int8)(unsafe.Pointer(f)))) != 0 {
  4290. if modifier != int32(_MOD_NONE) {
  4291. *(*uintptr)(unsafe.Pointer(pf)) = f
  4292. return int32(_FMTCHECK_UNKNOWN)
  4293. }
  4294. *(*uintptr)(unsafe.Pointer(pf)) = f
  4295. return int32(_FMTCHECK_LONG)
  4296. }
  4297. if libc.Xstrchr(tls, __ccgo_ts+37, int32(*(*int8)(unsafe.Pointer(f)))) != 0 {
  4298. switch modifier {
  4299. case int32(_MOD_LONGDOUBLE):
  4300. goto _27
  4301. case int32(_MOD_NONE):
  4302. goto _28
  4303. case int32(_MOD_LONG):
  4304. goto _29
  4305. default:
  4306. goto _30
  4307. }
  4308. goto _31
  4309. _27:
  4310. ;
  4311. _34:
  4312. ;
  4313. *(*uintptr)(unsafe.Pointer(pf)) = f
  4314. return int32(_FMTCHECK_LONGDOUBLE)
  4315. goto _33
  4316. _33:
  4317. ;
  4318. if 0 != 0 {
  4319. goto _34
  4320. }
  4321. goto _32
  4322. _32:
  4323. ;
  4324. _29:
  4325. ;
  4326. _28:
  4327. ;
  4328. *(*uintptr)(unsafe.Pointer(pf)) = f
  4329. return int32(_FMTCHECK_DOUBLE)
  4330. _30:
  4331. ;
  4332. *(*uintptr)(unsafe.Pointer(pf)) = f
  4333. return int32(_FMTCHECK_UNKNOWN)
  4334. _31:
  4335. }
  4336. if int32(*(*int8)(unsafe.Pointer(f))) == int32('c') {
  4337. switch modifier {
  4338. case int32(_MOD_LONG):
  4339. goto _35
  4340. case int32(_MOD_NONE):
  4341. goto _36
  4342. default:
  4343. goto _37
  4344. }
  4345. goto _38
  4346. _35:
  4347. ;
  4348. _41:
  4349. ;
  4350. *(*uintptr)(unsafe.Pointer(pf)) = f
  4351. return int32(_FMTCHECK_WINTT)
  4352. goto _40
  4353. _40:
  4354. ;
  4355. if 0 != 0 {
  4356. goto _41
  4357. }
  4358. goto _39
  4359. _39:
  4360. ;
  4361. _36:
  4362. ;
  4363. *(*uintptr)(unsafe.Pointer(pf)) = f
  4364. return int32(_FMTCHECK_INT)
  4365. _37:
  4366. ;
  4367. *(*uintptr)(unsafe.Pointer(pf)) = f
  4368. return int32(_FMTCHECK_UNKNOWN)
  4369. _38:
  4370. }
  4371. if int32(*(*int8)(unsafe.Pointer(f))) == int32('C') {
  4372. if modifier != int32(_MOD_NONE) {
  4373. *(*uintptr)(unsafe.Pointer(pf)) = f
  4374. return int32(_FMTCHECK_UNKNOWN)
  4375. }
  4376. *(*uintptr)(unsafe.Pointer(pf)) = f
  4377. return int32(_FMTCHECK_WINTT)
  4378. }
  4379. if int32(*(*int8)(unsafe.Pointer(f))) == int32('s') {
  4380. switch modifier {
  4381. case int32(_MOD_LONG):
  4382. goto _42
  4383. case int32(_MOD_NONE):
  4384. goto _43
  4385. default:
  4386. goto _44
  4387. }
  4388. goto _45
  4389. _42:
  4390. ;
  4391. _48:
  4392. ;
  4393. *(*uintptr)(unsafe.Pointer(pf)) = f
  4394. return int32(_FMTCHECK_WSTRING)
  4395. goto _47
  4396. _47:
  4397. ;
  4398. if 0 != 0 {
  4399. goto _48
  4400. }
  4401. goto _46
  4402. _46:
  4403. ;
  4404. _43:
  4405. ;
  4406. *(*uintptr)(unsafe.Pointer(pf)) = f
  4407. return int32(_FMTCHECK_STRING)
  4408. _44:
  4409. ;
  4410. *(*uintptr)(unsafe.Pointer(pf)) = f
  4411. return int32(_FMTCHECK_UNKNOWN)
  4412. _45:
  4413. }
  4414. if int32(*(*int8)(unsafe.Pointer(f))) == int32('S') {
  4415. if modifier != int32(_MOD_NONE) {
  4416. *(*uintptr)(unsafe.Pointer(pf)) = f
  4417. return int32(_FMTCHECK_UNKNOWN)
  4418. }
  4419. *(*uintptr)(unsafe.Pointer(pf)) = f
  4420. return int32(_FMTCHECK_WSTRING)
  4421. }
  4422. if int32(*(*int8)(unsafe.Pointer(f))) == int32('p') {
  4423. if modifier != int32(_MOD_NONE) {
  4424. *(*uintptr)(unsafe.Pointer(pf)) = f
  4425. return int32(_FMTCHECK_UNKNOWN)
  4426. }
  4427. *(*uintptr)(unsafe.Pointer(pf)) = f
  4428. return int32(_FMTCHECK_POINTER)
  4429. }
  4430. *(*uintptr)(unsafe.Pointer(pf)) = f
  4431. return int32(_FMTCHECK_UNKNOWN)
  4432. /*NOTREACHED*/
  4433. return r
  4434. }
  4435. func _get_next_format_from_width(tls *libc.TLS, pf uintptr) (r TEFT) {
  4436. var f uintptr
  4437. _ = f
  4438. f = *(*uintptr)(unsafe.Pointer(pf))
  4439. if int32(*(*int8)(unsafe.Pointer(f))) == int32('.') {
  4440. f++
  4441. if int32(*(*int8)(unsafe.Pointer(f))) == int32('*') {
  4442. *(*uintptr)(unsafe.Pointer(pf)) = f
  4443. return int32(_FMTCHECK_PRECISION)
  4444. }
  4445. /* eat any precision (empty is allowed) */
  4446. for libc.BoolInt32(uint32(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(f))))-uint32('0') < uint32(10)) != 0 {
  4447. f++
  4448. }
  4449. if !(*(*int8)(unsafe.Pointer(f)) != 0) {
  4450. *(*uintptr)(unsafe.Pointer(pf)) = f
  4451. return int32(_FMTCHECK_UNKNOWN)
  4452. }
  4453. }
  4454. *(*uintptr)(unsafe.Pointer(pf)) = f
  4455. return _get_next_format_from_precision(tls, pf)
  4456. /*NOTREACHED*/
  4457. return r
  4458. }
  4459. func _get_next_format(tls *libc.TLS, pf uintptr, eft TEFT) (r TEFT) {
  4460. var f uintptr
  4461. var infmt int32
  4462. _, _ = f, infmt
  4463. if eft == int32(_FMTCHECK_WIDTH) {
  4464. *(*uintptr)(unsafe.Pointer(pf))++
  4465. return _get_next_format_from_width(tls, pf)
  4466. } else {
  4467. if eft == int32(_FMTCHECK_PRECISION) {
  4468. *(*uintptr)(unsafe.Pointer(pf))++
  4469. return _get_next_format_from_precision(tls, pf)
  4470. }
  4471. }
  4472. f = *(*uintptr)(unsafe.Pointer(pf))
  4473. infmt = 0
  4474. for !(infmt != 0) {
  4475. f = libc.Xstrchr(tls, f, int32('%'))
  4476. if f == libc.UintptrFromInt32(0) {
  4477. *(*uintptr)(unsafe.Pointer(pf)) = f
  4478. return int32(_FMTCHECK_DONE)
  4479. }
  4480. f++
  4481. if !(*(*int8)(unsafe.Pointer(f)) != 0) {
  4482. *(*uintptr)(unsafe.Pointer(pf)) = f
  4483. return int32(_FMTCHECK_UNKNOWN)
  4484. }
  4485. if int32(*(*int8)(unsafe.Pointer(f))) != int32('%') {
  4486. infmt = int32(1)
  4487. } else {
  4488. f++
  4489. }
  4490. }
  4491. /* Eat any of the flags */
  4492. for *(*int8)(unsafe.Pointer(f)) != 0 && libc.Xstrchr(tls, __ccgo_ts+46, int32(*(*int8)(unsafe.Pointer(f)))) != 0 {
  4493. f++
  4494. }
  4495. if int32(*(*int8)(unsafe.Pointer(f))) == int32('*') {
  4496. *(*uintptr)(unsafe.Pointer(pf)) = f
  4497. return int32(_FMTCHECK_WIDTH)
  4498. }
  4499. /* eat any width */
  4500. for libc.BoolInt32(uint32(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(f))))-uint32('0') < uint32(10)) != 0 {
  4501. f++
  4502. }
  4503. if !(*(*int8)(unsafe.Pointer(f)) != 0) {
  4504. *(*uintptr)(unsafe.Pointer(pf)) = f
  4505. return int32(_FMTCHECK_UNKNOWN)
  4506. }
  4507. *(*uintptr)(unsafe.Pointer(pf)) = f
  4508. return _get_next_format_from_width(tls, pf)
  4509. /*NOTREACHED*/
  4510. return r
  4511. }
  4512. func Xfmtcheck(tls *libc.TLS, f1 uintptr, f2 uintptr) (r uintptr) {
  4513. bp := tls.Alloc(16)
  4514. defer tls.Free(16)
  4515. var f1t, f2t, v1 TEFT
  4516. var _ /* f1p at bp+0 */ uintptr
  4517. var _ /* f2p at bp+4 */ uintptr
  4518. _, _, _ = f1t, f2t, v1
  4519. if !(f1 != 0) {
  4520. return f2
  4521. }
  4522. *(*uintptr)(unsafe.Pointer(bp)) = f1
  4523. f1t = int32(_FMTCHECK_START)
  4524. *(*uintptr)(unsafe.Pointer(bp + 4)) = f2
  4525. f2t = int32(_FMTCHECK_START)
  4526. for {
  4527. v1 = _get_next_format(tls, bp, f1t)
  4528. f1t = v1
  4529. if !(v1 != int32(_FMTCHECK_DONE)) {
  4530. break
  4531. }
  4532. if f1t == int32(_FMTCHECK_UNKNOWN) {
  4533. return f2
  4534. }
  4535. f2t = _get_next_format(tls, bp+4, f2t)
  4536. if f1t != f2t {
  4537. return f2
  4538. }
  4539. }
  4540. return f1
  4541. }
  4542. const m_FPARSELN_UNESCALL1 = 15
  4543. const m_FPARSELN_UNESCCOMM1 = 4
  4544. const m_FPARSELN_UNESCCONT1 = 2
  4545. const m_FPARSELN_UNESCESC1 = 1
  4546. const m_FPARSELN_UNESCREST1 = 8
  4547. const m_static_assert = "_Static_assert"
  4548. // C documentation
  4549. //
  4550. // /* isescaped():
  4551. // * Return true if the character in *p that belongs to a string
  4552. // * that starts in *sp, is escaped by the escape character esc.
  4553. // */
  4554. func _isescaped(tls *libc.TLS, sp uintptr, p uintptr, esc int32) (r int32) {
  4555. var cp, v2 uintptr
  4556. var ne Tsize_t
  4557. _, _, _ = cp, ne, v2
  4558. /* No escape character */
  4559. if esc == int32('\000') {
  4560. return 0
  4561. }
  4562. /* Count the number of escape characters that precede ours */
  4563. ne = uint32(0)
  4564. cp = p
  4565. for {
  4566. cp--
  4567. v2 = cp
  4568. if !(v2 >= sp && int32(*(*int8)(unsafe.Pointer(cp))) == esc) {
  4569. break
  4570. }
  4571. goto _1
  4572. goto _1
  4573. _1:
  4574. ;
  4575. ne++
  4576. }
  4577. /* Return true if odd number of escape characters */
  4578. return libc.BoolInt32(ne&uint32(1) != uint32(0))
  4579. }
  4580. // C documentation
  4581. //
  4582. // /* fparseln():
  4583. // * Read a line from a file parsing continuations ending in * and eliminating trailing newlines, or comments starting with
  4584. // * the comment char.
  4585. // */
  4586. func Xfparseln(tls *libc.TLS, fp uintptr, size uintptr, lineno uintptr, str uintptr, flags int32) (r uintptr) {
  4587. bp := tls.Alloc(16)
  4588. defer tls.Free(16)
  4589. var buf, cp, v2, v3, v4, v5, v6, v7, v8, v9 uintptr
  4590. var cnt, skipesc int32
  4591. var com, con, esc, nl int8
  4592. var len1 Tsize_t
  4593. var s Tssize_t
  4594. var _ /* ptr at bp+4 */ uintptr
  4595. var _ /* ptrlen at bp+0 */ Tsize_t
  4596. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = buf, cnt, com, con, cp, esc, len1, nl, s, skipesc, v2, v3, v4, v5, v6, v7, v8, v9
  4597. len1 = uint32(0)
  4598. buf = libc.UintptrFromInt32(0)
  4599. *(*Tsize_t)(unsafe.Pointer(bp)) = uint32(0)
  4600. *(*uintptr)(unsafe.Pointer(bp + 4)) = libc.UintptrFromInt32(0)
  4601. cnt = int32(1)
  4602. if str == libc.UintptrFromInt32(0) {
  4603. str = uintptr(unsafe.Pointer(&_dstr))
  4604. }
  4605. esc = *(*int8)(unsafe.Pointer(str))
  4606. con = *(*int8)(unsafe.Pointer(str + 1))
  4607. com = *(*int8)(unsafe.Pointer(str + 2))
  4608. /*
  4609. * XXX: it would be cool to be able to specify the newline character,
  4610. * getdelim(3) does let us, but supporting it would diverge from BSDs.
  4611. */
  4612. nl = int8('\n')
  4613. libc.Xflockfile(tls, fp)
  4614. for cnt != 0 {
  4615. cnt = 0
  4616. if lineno != 0 {
  4617. *(*Tsize_t)(unsafe.Pointer(lineno))++
  4618. }
  4619. s = libc.Xgetline(tls, bp+4, bp, fp)
  4620. if s < 0 {
  4621. break
  4622. }
  4623. if s != 0 && com != 0 { /* Check and eliminate comments */
  4624. cp = *(*uintptr)(unsafe.Pointer(bp + 4))
  4625. for {
  4626. if !(cp < *(*uintptr)(unsafe.Pointer(bp + 4))+uintptr(s)) {
  4627. break
  4628. }
  4629. if int32(*(*int8)(unsafe.Pointer(cp))) == int32(com) && !(_isescaped(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), cp, int32(esc)) != 0) {
  4630. s = int32(cp) - int32(*(*uintptr)(unsafe.Pointer(bp + 4)))
  4631. cnt = libc.BoolInt32(s == 0 && buf == libc.UintptrFromInt32(0))
  4632. break
  4633. }
  4634. goto _1
  4635. _1:
  4636. ;
  4637. cp++
  4638. }
  4639. }
  4640. if s != 0 && nl != 0 { /* Check and eliminate newlines */
  4641. cp = *(*uintptr)(unsafe.Pointer(bp + 4)) + uintptr(s-int32(1))
  4642. if int32(*(*int8)(unsafe.Pointer(cp))) == int32(nl) {
  4643. s--
  4644. } /* forget newline */
  4645. }
  4646. if s != 0 && con != 0 { /* Check and eliminate continuations */
  4647. cp = *(*uintptr)(unsafe.Pointer(bp + 4)) + uintptr(s-int32(1))
  4648. if int32(*(*int8)(unsafe.Pointer(cp))) == int32(con) && !(_isescaped(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), cp, int32(esc)) != 0) {
  4649. s-- /* forget continuation char */
  4650. cnt = int32(1)
  4651. }
  4652. }
  4653. if s == 0 {
  4654. /*
  4655. * nothing to add, skip realloc except in case
  4656. * we need a minimal buf to return an empty line
  4657. */
  4658. if cnt != 0 || buf != libc.UintptrFromInt32(0) {
  4659. continue
  4660. }
  4661. }
  4662. v2 = libc.Xrealloc(tls, buf, len1+libc.Uint32FromInt32(s)+uint32(1))
  4663. cp = v2
  4664. if v2 == libc.UintptrFromInt32(0) {
  4665. libc.Xfunlockfile(tls, fp)
  4666. libc.Xfree(tls, buf)
  4667. libc.Xfree(tls, *(*uintptr)(unsafe.Pointer(bp + 4)))
  4668. return libc.UintptrFromInt32(0)
  4669. }
  4670. buf = cp
  4671. libc.Xmemcpy(tls, buf+uintptr(len1), *(*uintptr)(unsafe.Pointer(bp + 4)), libc.Uint32FromInt32(s))
  4672. len1 += libc.Uint32FromInt32(s)
  4673. *(*int8)(unsafe.Pointer(buf + uintptr(len1))) = int8('\000')
  4674. }
  4675. libc.Xfunlockfile(tls, fp)
  4676. libc.Xfree(tls, *(*uintptr)(unsafe.Pointer(bp + 4)))
  4677. if flags&int32(m_FPARSELN_UNESCALL1) != 0 && esc != 0 && buf != libc.UintptrFromInt32(0) && libc.Xstrchr(tls, buf, int32(esc)) != libc.UintptrFromInt32(0) {
  4678. v3 = buf
  4679. cp = v3
  4680. *(*uintptr)(unsafe.Pointer(bp + 4)) = v3
  4681. for int32(*(*int8)(unsafe.Pointer(cp))) != int32('\000') {
  4682. for int32(*(*int8)(unsafe.Pointer(cp))) != int32('\000') && int32(*(*int8)(unsafe.Pointer(cp))) != int32(esc) {
  4683. v4 = *(*uintptr)(unsafe.Pointer(bp + 4))
  4684. *(*uintptr)(unsafe.Pointer(bp + 4))++
  4685. v5 = cp
  4686. cp++
  4687. *(*int8)(unsafe.Pointer(v4)) = *(*int8)(unsafe.Pointer(v5))
  4688. }
  4689. if int32(*(*int8)(unsafe.Pointer(cp))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(cp + 1))) == int32('\000') {
  4690. break
  4691. }
  4692. skipesc = 0
  4693. if int32(*(*int8)(unsafe.Pointer(cp + 1))) == int32(com) {
  4694. skipesc += flags & int32(m_FPARSELN_UNESCCOMM1)
  4695. }
  4696. if int32(*(*int8)(unsafe.Pointer(cp + 1))) == int32(con) {
  4697. skipesc += flags & int32(m_FPARSELN_UNESCCONT1)
  4698. }
  4699. if int32(*(*int8)(unsafe.Pointer(cp + 1))) == int32(esc) {
  4700. skipesc += flags & int32(m_FPARSELN_UNESCESC1)
  4701. }
  4702. if int32(*(*int8)(unsafe.Pointer(cp + 1))) != int32(com) && int32(*(*int8)(unsafe.Pointer(cp + 1))) != int32(con) && int32(*(*int8)(unsafe.Pointer(cp + 1))) != int32(esc) {
  4703. skipesc = flags & int32(m_FPARSELN_UNESCREST1)
  4704. }
  4705. if skipesc != 0 {
  4706. cp++
  4707. } else {
  4708. v6 = *(*uintptr)(unsafe.Pointer(bp + 4))
  4709. *(*uintptr)(unsafe.Pointer(bp + 4))++
  4710. v7 = cp
  4711. cp++
  4712. *(*int8)(unsafe.Pointer(v6)) = *(*int8)(unsafe.Pointer(v7))
  4713. }
  4714. v8 = *(*uintptr)(unsafe.Pointer(bp + 4))
  4715. *(*uintptr)(unsafe.Pointer(bp + 4))++
  4716. v9 = cp
  4717. cp++
  4718. *(*int8)(unsafe.Pointer(v8)) = *(*int8)(unsafe.Pointer(v9))
  4719. }
  4720. *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))) = int8('\000')
  4721. len1 = libc.Xstrlen(tls, buf)
  4722. }
  4723. if size != 0 {
  4724. *(*Tsize_t)(unsafe.Pointer(size)) = len1
  4725. }
  4726. return buf
  4727. }
  4728. var _dstr = [3]int8{
  4729. 0: int8('\\'),
  4730. 1: int8('\\'),
  4731. 2: int8('#'),
  4732. }
  4733. const m_FSETLOCKING_BYCALLER = 2
  4734. const m_FSETLOCKING_INTERNAL = 1
  4735. const m_FSETLOCKING_QUERY = 0
  4736. func Xfpurge(tls *libc.TLS, fp uintptr) (r int32) {
  4737. if fp == libc.UintptrFromInt32(0) {
  4738. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EBADF)
  4739. return -int32(1)
  4740. }
  4741. libc.X__fpurge(tls, fp)
  4742. return 0
  4743. }
  4744. const m_FPARSELN_UNESCALL2 = 0x0f
  4745. const m_FPARSELN_UNESCCOMM2 = 0x04
  4746. const m_FPARSELN_UNESCCONT2 = 0x02
  4747. const m_FPARSELN_UNESCESC2 = 0x01
  4748. const m_FPARSELN_UNESCREST2 = 0x08
  4749. const m_KB = 1024
  4750. const m_MAXB = "GB"
  4751. func Xgetbsize(tls *libc.TLS, headerlenp uintptr, blocksizep uintptr) (r uintptr) {
  4752. bp := tls.Alloc(32)
  4753. defer tls.Free(32)
  4754. var blocksize, max, mul, n, v15, v16, v17, v4 int32
  4755. var form, p, v3 uintptr
  4756. var _ /* ep at bp+0 */ uintptr
  4757. _, _, _, _, _, _, _, _, _, _, _ = blocksize, form, max, mul, n, p, v15, v16, v17, v3, v4
  4758. form = __ccgo_ts + 53
  4759. v3 = libc.Xgetenv(tls, __ccgo_ts+54)
  4760. p = v3
  4761. if !(v3 != libc.UintptrFromInt32(0) && int32(*(*int8)(unsafe.Pointer(p))) != int32('\000')) {
  4762. goto _1
  4763. }
  4764. v4 = libc.Xstrtol(tls, p, bp, int32(10))
  4765. n = v4
  4766. if v4 < 0 {
  4767. goto underflow
  4768. }
  4769. if n == 0 {
  4770. n = int32(1)
  4771. }
  4772. if *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) != 0 && *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)) != 0 {
  4773. goto fmterr
  4774. }
  4775. switch int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) {
  4776. case int32('g'):
  4777. goto _5
  4778. case int32('G'):
  4779. goto _6
  4780. case int32('k'):
  4781. goto _7
  4782. case int32('K'):
  4783. goto _8
  4784. case int32('m'):
  4785. goto _9
  4786. case int32('M'):
  4787. goto _10
  4788. case int32('\000'):
  4789. goto _11
  4790. default:
  4791. goto _12
  4792. }
  4793. goto _13
  4794. _6:
  4795. ;
  4796. _5:
  4797. ;
  4798. form = __ccgo_ts + 64
  4799. max = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) / (libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024))
  4800. mul = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024)
  4801. goto _13
  4802. _8:
  4803. ;
  4804. _7:
  4805. ;
  4806. form = __ccgo_ts + 66
  4807. max = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) / libc.Int32FromInt32(1024)
  4808. mul = int32(1024)
  4809. goto _13
  4810. _10:
  4811. ;
  4812. _9:
  4813. ;
  4814. form = __ccgo_ts + 68
  4815. max = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) / (libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024))
  4816. mul = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024)
  4817. goto _13
  4818. _11:
  4819. ;
  4820. max = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024)
  4821. mul = int32(1)
  4822. goto _13
  4823. _12:
  4824. ;
  4825. goto fmterr
  4826. fmterr:
  4827. ;
  4828. libc.Xwarnx(tls, __ccgo_ts+70, libc.VaList(bp+16, p))
  4829. n = int32(512)
  4830. max = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024)
  4831. mul = int32(1)
  4832. goto _13
  4833. _13:
  4834. ;
  4835. if n > max {
  4836. libc.Xwarnx(tls, __ccgo_ts+92, libc.VaList(bp+16, libc.Int32FromInt32(1024)*libc.Int32FromInt32(1024)*libc.Int32FromInt32(1024)/(libc.Int32FromInt32(1024)*libc.Int32FromInt32(1024)*libc.Int32FromInt32(1024))))
  4837. n = max
  4838. }
  4839. v15 = n * mul
  4840. blocksize = v15
  4841. if !(v15 < int32(512)) {
  4842. goto _14
  4843. }
  4844. goto underflow
  4845. underflow:
  4846. ;
  4847. libc.Xwarnx(tls, __ccgo_ts+118, 0)
  4848. form = __ccgo_ts + 53
  4849. v16 = libc.Int32FromInt32(512)
  4850. n = v16
  4851. blocksize = v16
  4852. _14:
  4853. ;
  4854. goto _2
  4855. _1:
  4856. ;
  4857. v17 = libc.Int32FromInt32(512)
  4858. n = v17
  4859. blocksize = v17
  4860. _2:
  4861. ;
  4862. libc.X__builtin_snprintf(tls, uintptr(unsafe.Pointer(&_header)), uint32(20), __ccgo_ts+143, libc.VaList(bp+16, n, form))
  4863. *(*int32)(unsafe.Pointer(headerlenp)) = libc.Int32FromUint32(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&_header))))
  4864. *(*int32)(unsafe.Pointer(blocksizep)) = blocksize
  4865. return uintptr(unsafe.Pointer(&_header))
  4866. }
  4867. var _header [20]int8
  4868. const m_AF_ALG = "PF_ALG"
  4869. const m_AF_APPLETALK = "PF_APPLETALK"
  4870. const m_AF_ASH = "PF_ASH"
  4871. const m_AF_ATMPVC = "PF_ATMPVC"
  4872. const m_AF_ATMSVC = "PF_ATMSVC"
  4873. const m_AF_AX25 = "PF_AX25"
  4874. const m_AF_BLUETOOTH = "PF_BLUETOOTH"
  4875. const m_AF_BRIDGE = "PF_BRIDGE"
  4876. const m_AF_CAIF = "PF_CAIF"
  4877. const m_AF_CAN = "PF_CAN"
  4878. const m_AF_DECnet = "PF_DECnet"
  4879. const m_AF_ECONET = "PF_ECONET"
  4880. const m_AF_FILE = "AF_LOCAL"
  4881. const m_AF_IB = "PF_IB"
  4882. const m_AF_IEEE802154 = "PF_IEEE802154"
  4883. const m_AF_INET = "PF_INET"
  4884. const m_AF_INET6 = "PF_INET6"
  4885. const m_AF_IPX = "PF_IPX"
  4886. const m_AF_IRDA = "PF_IRDA"
  4887. const m_AF_ISDN = "PF_ISDN"
  4888. const m_AF_IUCV = "PF_IUCV"
  4889. const m_AF_KCM = "PF_KCM"
  4890. const m_AF_KEY = "PF_KEY"
  4891. const m_AF_LLC = "PF_LLC"
  4892. const m_AF_LOCAL = "PF_LOCAL"
  4893. const m_AF_MAX = "PF_MAX"
  4894. const m_AF_MPLS = "PF_MPLS"
  4895. const m_AF_NETBEUI = "PF_NETBEUI"
  4896. const m_AF_NETLINK = "PF_NETLINK"
  4897. const m_AF_NETROM = "PF_NETROM"
  4898. const m_AF_NFC = "PF_NFC"
  4899. const m_AF_PACKET = "PF_PACKET"
  4900. const m_AF_PHONET = "PF_PHONET"
  4901. const m_AF_PPPOX = "PF_PPPOX"
  4902. const m_AF_QIPCRTR = "PF_QIPCRTR"
  4903. const m_AF_RDS = "PF_RDS"
  4904. const m_AF_ROSE = "PF_ROSE"
  4905. const m_AF_ROUTE = "PF_ROUTE"
  4906. const m_AF_RXRPC = "PF_RXRPC"
  4907. const m_AF_SECURITY = "PF_SECURITY"
  4908. const m_AF_SMC = "PF_SMC"
  4909. const m_AF_SNA = "PF_SNA"
  4910. const m_AF_TIPC = "PF_TIPC"
  4911. const m_AF_UNIX = "AF_LOCAL"
  4912. const m_AF_UNSPEC = "PF_UNSPEC"
  4913. const m_AF_VSOCK = "PF_VSOCK"
  4914. const m_AF_WANPIPE = "PF_WANPIPE"
  4915. const m_AF_X25 = "PF_X25"
  4916. const m_AF_XDP = "PF_XDP"
  4917. const m_INT_MAX2 = 0x7fffffff
  4918. const m_MSG_BATCH = 0x40000
  4919. const m_MSG_CMSG_CLOEXEC = 0x40000000
  4920. const m_MSG_CONFIRM = 0x0800
  4921. const m_MSG_CTRUNC = 0x0008
  4922. const m_MSG_DONTROUTE = 0x0004
  4923. const m_MSG_DONTWAIT = 0x0040
  4924. const m_MSG_EOR = 0x0080
  4925. const m_MSG_ERRQUEUE = 0x2000
  4926. const m_MSG_FASTOPEN = 0x20000000
  4927. const m_MSG_FIN = 0x0200
  4928. const m_MSG_MORE = 0x8000
  4929. const m_MSG_NOSIGNAL = 0x4000
  4930. const m_MSG_OOB = 0x0001
  4931. const m_MSG_PEEK = 0x0002
  4932. const m_MSG_PROXY = 0x0010
  4933. const m_MSG_RST = 0x1000
  4934. const m_MSG_SYN = 0x0400
  4935. const m_MSG_TRUNC = 0x0020
  4936. const m_MSG_WAITALL = 0x0100
  4937. const m_MSG_WAITFORONE = 0x10000
  4938. const m_MSG_ZEROCOPY = 0x4000000
  4939. const m_PF_ALG = 38
  4940. const m_PF_APPLETALK = 5
  4941. const m_PF_ASH = 18
  4942. const m_PF_ATMPVC = 8
  4943. const m_PF_ATMSVC = 20
  4944. const m_PF_AX25 = 3
  4945. const m_PF_BLUETOOTH = 31
  4946. const m_PF_BRIDGE = 7
  4947. const m_PF_CAIF = 37
  4948. const m_PF_CAN = 29
  4949. const m_PF_DECnet = 12
  4950. const m_PF_ECONET = 19
  4951. const m_PF_FILE = "PF_LOCAL"
  4952. const m_PF_IB = 27
  4953. const m_PF_IEEE802154 = 36
  4954. const m_PF_INET = 2
  4955. const m_PF_INET6 = 10
  4956. const m_PF_IPX = 4
  4957. const m_PF_IRDA = 23
  4958. const m_PF_ISDN = 34
  4959. const m_PF_IUCV = 32
  4960. const m_PF_KCM = 41
  4961. const m_PF_KEY = 15
  4962. const m_PF_LLC = 26
  4963. const m_PF_LOCAL = 1
  4964. const m_PF_MAX = 45
  4965. const m_PF_MPLS = 28
  4966. const m_PF_NETBEUI = 13
  4967. const m_PF_NETLINK = 16
  4968. const m_PF_NETROM = 6
  4969. const m_PF_NFC = 39
  4970. const m_PF_PACKET = 17
  4971. const m_PF_PHONET = 35
  4972. const m_PF_PPPOX = 24
  4973. const m_PF_QIPCRTR = 42
  4974. const m_PF_RDS = 21
  4975. const m_PF_ROSE = 11
  4976. const m_PF_ROUTE = "PF_NETLINK"
  4977. const m_PF_RXRPC = 33
  4978. const m_PF_SECURITY = 14
  4979. const m_PF_SMC = 43
  4980. const m_PF_SNA = 22
  4981. const m_PF_TIPC = 30
  4982. const m_PF_UNIX = "PF_LOCAL"
  4983. const m_PF_UNSPEC = 0
  4984. const m_PF_VSOCK = 40
  4985. const m_PF_WANPIPE = 25
  4986. const m_PF_X25 = 9
  4987. const m_PF_XDP = 44
  4988. const m_SCM_CREDENTIALS = 0x02
  4989. const m_SCM_RIGHTS = 0x01
  4990. const m_SCM_TIMESTAMP = "SO_TIMESTAMP"
  4991. const m_SCM_TIMESTAMPING = "SO_TIMESTAMPING"
  4992. const m_SCM_TIMESTAMPING_OPT_STATS = 54
  4993. const m_SCM_TIMESTAMPING_PKTINFO = 58
  4994. const m_SCM_TIMESTAMPNS = "SO_TIMESTAMPNS"
  4995. const m_SCM_TXTIME = "SO_TXTIME"
  4996. const m_SCM_WIFI_STATUS = "SO_WIFI_STATUS"
  4997. const m_SHUT_RD = 0
  4998. const m_SHUT_RDWR = 2
  4999. const m_SHUT_WR = 1
  5000. const m_SOCK_CLOEXEC = 02000000
  5001. const m_SOCK_DCCP = 6
  5002. const m_SOCK_DGRAM = 2
  5003. const m_SOCK_NONBLOCK = 04000
  5004. const m_SOCK_PACKET = 10
  5005. const m_SOCK_RAW = 3
  5006. const m_SOCK_RDM = 4
  5007. const m_SOCK_SEQPACKET = 5
  5008. const m_SOCK_STREAM = 1
  5009. const m_SOL_AAL = 265
  5010. const m_SOL_ALG = 279
  5011. const m_SOL_ATM = 264
  5012. const m_SOL_BLUETOOTH = 274
  5013. const m_SOL_CAIF = 278
  5014. const m_SOL_DCCP = 269
  5015. const m_SOL_DECNET = 261
  5016. const m_SOL_ICMPV6 = 58
  5017. const m_SOL_IP = 0
  5018. const m_SOL_IPV6 = 41
  5019. const m_SOL_IRDA = 266
  5020. const m_SOL_IUCV = 277
  5021. const m_SOL_KCM = 281
  5022. const m_SOL_LLC = 268
  5023. const m_SOL_NETBEUI = 267
  5024. const m_SOL_NETLINK = 270
  5025. const m_SOL_NFC = 280
  5026. const m_SOL_PACKET = 263
  5027. const m_SOL_PNPIPE = 275
  5028. const m_SOL_PPPOL2TP = 273
  5029. const m_SOL_RAW = 255
  5030. const m_SOL_RDS = 276
  5031. const m_SOL_RXRPC = 272
  5032. const m_SOL_SOCKET = 1
  5033. const m_SOL_TIPC = 271
  5034. const m_SOL_TLS = 282
  5035. const m_SOL_X25 = 262
  5036. const m_SOL_XDP = 283
  5037. const m_SOMAXCONN = 128
  5038. const m_SO_ACCEPTCONN = 30
  5039. const m_SO_ATTACH_BPF = 50
  5040. const m_SO_ATTACH_FILTER = 26
  5041. const m_SO_ATTACH_REUSEPORT_CBPF = 51
  5042. const m_SO_ATTACH_REUSEPORT_EBPF = 52
  5043. const m_SO_BINDTODEVICE = 25
  5044. const m_SO_BINDTOIFINDEX = 62
  5045. const m_SO_BPF_EXTENSIONS = 48
  5046. const m_SO_BROADCAST = 6
  5047. const m_SO_BSDCOMPAT = 14
  5048. const m_SO_BUSY_POLL = 46
  5049. const m_SO_BUSY_POLL_BUDGET = 70
  5050. const m_SO_CNX_ADVICE = 53
  5051. const m_SO_COOKIE = 57
  5052. const m_SO_DEBUG = 1
  5053. const m_SO_DETACH_BPF = "SO_DETACH_FILTER"
  5054. const m_SO_DETACH_FILTER = 27
  5055. const m_SO_DETACH_REUSEPORT_BPF = 68
  5056. const m_SO_DOMAIN = 39
  5057. const m_SO_DONTROUTE = 5
  5058. const m_SO_ERROR = 4
  5059. const m_SO_GET_FILTER = "SO_ATTACH_FILTER"
  5060. const m_SO_INCOMING_CPU = 49
  5061. const m_SO_INCOMING_NAPI_ID = 56
  5062. const m_SO_KEEPALIVE = 9
  5063. const m_SO_LINGER = 13
  5064. const m_SO_LOCK_FILTER = 44
  5065. const m_SO_MARK = 36
  5066. const m_SO_MAX_PACING_RATE = 47
  5067. const m_SO_MEMINFO = 55
  5068. const m_SO_NOFCS = 43
  5069. const m_SO_NO_CHECK = 11
  5070. const m_SO_OOBINLINE = 10
  5071. const m_SO_PASSCRED = 16
  5072. const m_SO_PASSSEC = 34
  5073. const m_SO_PEEK_OFF = 42
  5074. const m_SO_PEERCRED = 17
  5075. const m_SO_PEERGROUPS = 59
  5076. const m_SO_PEERNAME = 28
  5077. const m_SO_PEERSEC = 31
  5078. const m_SO_PREFER_BUSY_POLL = 69
  5079. const m_SO_PRIORITY = 12
  5080. const m_SO_PROTOCOL = 38
  5081. const m_SO_RCVBUF = 8
  5082. const m_SO_RCVBUFFORCE = 33
  5083. const m_SO_RCVLOWAT = 18
  5084. const m_SO_RCVTIMEO = 66
  5085. const m_SO_REUSEADDR = 2
  5086. const m_SO_REUSEPORT = 15
  5087. const m_SO_RXQ_OVFL = 40
  5088. const m_SO_SECURITY_AUTHENTICATION = 22
  5089. const m_SO_SECURITY_ENCRYPTION_NETWORK = 24
  5090. const m_SO_SECURITY_ENCRYPTION_TRANSPORT = 23
  5091. const m_SO_SELECT_ERR_QUEUE = 45
  5092. const m_SO_SNDBUF = 7
  5093. const m_SO_SNDBUFFORCE = 32
  5094. const m_SO_SNDLOWAT = 19
  5095. const m_SO_SNDTIMEO = 67
  5096. const m_SO_TIMESTAMP = 63
  5097. const m_SO_TIMESTAMPING = 65
  5098. const m_SO_TIMESTAMPNS = 64
  5099. const m_SO_TXTIME = 61
  5100. const m_SO_TYPE = 3
  5101. const m_SO_WIFI_STATUS = 41
  5102. const m_SO_ZEROCOPY = 60
  5103. const m_UINT_MAX2 = 0xffffffff
  5104. type Tsocklen_t = uint32
  5105. type Tsa_family_t = uint16
  5106. type Tmsghdr = struct {
  5107. Fmsg_name uintptr
  5108. Fmsg_namelen Tsocklen_t
  5109. Fmsg_iov uintptr
  5110. Fmsg_iovlen int32
  5111. Fmsg_control uintptr
  5112. Fmsg_controllen Tsocklen_t
  5113. Fmsg_flags int32
  5114. }
  5115. type Tcmsghdr = struct {
  5116. Fcmsg_len Tsocklen_t
  5117. Fcmsg_level int32
  5118. Fcmsg_type int32
  5119. }
  5120. type Tucred = struct {
  5121. Fpid Tpid_t
  5122. Fuid Tuid_t
  5123. Fgid Tgid_t
  5124. }
  5125. type Tmmsghdr = struct {
  5126. Fmsg_hdr Tmsghdr
  5127. Fmsg_len uint32
  5128. }
  5129. type Tlinger = struct {
  5130. Fl_onoff int32
  5131. Fl_linger int32
  5132. }
  5133. type Tsockaddr = struct {
  5134. Fsa_family Tsa_family_t
  5135. Fsa_data [14]int8
  5136. }
  5137. type Tsockaddr_storage = struct {
  5138. Fss_family Tsa_family_t
  5139. F__ss_padding [122]int8
  5140. F__ss_align uint32
  5141. }
  5142. type Tsockaddr_un = struct {
  5143. Fsun_family Tsa_family_t
  5144. Fsun_path [108]int8
  5145. }
  5146. // C documentation
  5147. //
  5148. // /* Linux and OpenBSD */
  5149. func Xgetpeereid(tls *libc.TLS, s int32, euid uintptr, egid uintptr) (r int32) {
  5150. bp := tls.Alloc(16)
  5151. defer tls.Free(16)
  5152. var ret int32
  5153. var _ /* cred at bp+0 */ Tucred
  5154. var _ /* credlen at bp+12 */ Tsocklen_t
  5155. _ = ret
  5156. *(*Tsocklen_t)(unsafe.Pointer(bp + 12)) = uint32(12)
  5157. ret = libc.Xgetsockopt(tls, s, int32(m_SOL_SOCKET), int32(m_SO_PEERCRED), bp, bp+12)
  5158. if ret != 0 {
  5159. return ret
  5160. }
  5161. *(*Tuid_t)(unsafe.Pointer(euid)) = (*(*Tucred)(unsafe.Pointer(bp))).Fuid
  5162. *(*Tgid_t)(unsafe.Pointer(egid)) = (*(*Tucred)(unsafe.Pointer(bp))).Fgid
  5163. return 0
  5164. }
  5165. /*
  5166. * Swap two areas of size number of bytes. Although qsort(3) permits random
  5167. * blocks of memory to be sorted, sorting pointers is almost certainly the
  5168. * common case (and, were it not, could easily be made so). Regardless, it
  5169. * isn't worth optimizing; the SWAP's get sped up by the cache, and pointer
  5170. * arithmetic gets lost in the time required for comparison function calls.
  5171. */
  5172. /* Copy one block of size size to another. */
  5173. /*
  5174. * Build the list into a heap, where a heap is defined such that for
  5175. * the records K1 ... KN, Kj/2 >= Kj for 1 <= j/2 <= j <= N.
  5176. *
  5177. * There are two cases. If j == nmemb, select largest of Ki and Kj. If
  5178. * j < nmemb, select largest of Ki, Kj and Kj+1.
  5179. */
  5180. /*
  5181. * Select the top of the heap and 'heapify'. Since by far the most expensive
  5182. * action is the call to the compar function, a considerable optimization
  5183. * in the average case can be achieved due to the fact that k, the displaced
  5184. * element, is usually quite small, so it would be preferable to first
  5185. * heapify, always maintaining the invariant that the larger child is copied
  5186. * over its parent's record.
  5187. *
  5188. * Then, starting from the *bottom* of the heap, finding k's correct place,
  5189. * again maintaining the invariant. As a result of the invariant no element
  5190. * is 'lost' when k is assigned its correct place in the heap.
  5191. *
  5192. * The time savings from this optimization are on the order of 15-20% for the
  5193. * average case. See Knuth, Vol. 3, page 158, problem 18.
  5194. *
  5195. * XXX Don't break the #define SELECT line, below. Reiser cpp gets upset.
  5196. */
  5197. // C documentation
  5198. //
  5199. // /*
  5200. // * Heapsort -- Knuth, Vol. 3, page 145. Runs in O (N lg N), both average
  5201. // * and worst. While heapsort is faster than the worst case of quicksort,
  5202. // * the BSD quicksort does median selection so that the chance of finding
  5203. // * a data set that will trigger the worst case is nonexistent. Heapsort's
  5204. // * only advantage over quicksort is that it requires little additional memory.
  5205. // */
  5206. func Xheapsort(tls *libc.TLS, vbase uintptr, nmemb Tsize_t, size Tsize_t, compar uintptr) (r int32) {
  5207. var base, k, p, t, tmp1, tmp2, v1, v12, v13, v16, v17, v22, v23, v27, v28, v31, v32, v8, v9 uintptr
  5208. var cnt, i, j, l, v10, v14, v19, v20, v25, v29, v3, v5, v6 Tsize_t
  5209. var tmp int8
  5210. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = base, cnt, i, j, k, l, p, t, tmp, tmp1, tmp2, v1, v10, v12, v13, v14, v16, v17, v19, v20, v22, v23, v25, v27, v28, v29, v3, v31, v32, v5, v6, v8, v9
  5211. if nmemb <= uint32(1) {
  5212. return 0
  5213. }
  5214. if !(size != 0) {
  5215. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  5216. return -int32(1)
  5217. }
  5218. v1 = libc.Xmalloc(tls, size)
  5219. k = v1
  5220. if v1 == libc.UintptrFromInt32(0) {
  5221. return -int32(1)
  5222. }
  5223. /*
  5224. * Items are numbered from 1 to nmemb, so offset from size bytes
  5225. * below the starting address.
  5226. */
  5227. base = vbase - uintptr(size)
  5228. l = nmemb/uint32(2) + uint32(1)
  5229. for {
  5230. l--
  5231. v3 = l
  5232. if !(v3 != 0) {
  5233. break
  5234. }
  5235. i = l
  5236. for {
  5237. v5 = i * libc.Uint32FromInt32(2)
  5238. j = v5
  5239. if !(v5 <= nmemb) {
  5240. break
  5241. }
  5242. p = base + uintptr(j*size)
  5243. if j < nmemb && (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, p, p+uintptr(size)) < 0 {
  5244. p += uintptr(size)
  5245. j++
  5246. }
  5247. t = base + uintptr(i*size)
  5248. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, p, t) <= 0 {
  5249. break
  5250. }
  5251. cnt = size
  5252. for {
  5253. tmp = *(*int8)(unsafe.Pointer(t))
  5254. v8 = t
  5255. t++
  5256. *(*int8)(unsafe.Pointer(v8)) = *(*int8)(unsafe.Pointer(p))
  5257. v9 = p
  5258. p++
  5259. *(*int8)(unsafe.Pointer(v9)) = tmp
  5260. goto _7
  5261. _7:
  5262. ;
  5263. cnt--
  5264. v6 = cnt
  5265. if !(v6 != 0) {
  5266. break
  5267. }
  5268. }
  5269. goto _4
  5270. _4:
  5271. ;
  5272. i = j
  5273. }
  5274. goto _2
  5275. _2:
  5276. }
  5277. /*
  5278. * For each element of the heap, save the largest element into its
  5279. * final slot, save the displaced element (k), then recreate the
  5280. * heap.
  5281. */
  5282. for nmemb > uint32(1) {
  5283. cnt = size
  5284. tmp1 = k
  5285. tmp2 = base + uintptr(nmemb*size)
  5286. for {
  5287. v12 = tmp1
  5288. tmp1++
  5289. v13 = tmp2
  5290. tmp2++
  5291. *(*int8)(unsafe.Pointer(v12)) = *(*int8)(unsafe.Pointer(v13))
  5292. goto _11
  5293. _11:
  5294. ;
  5295. cnt--
  5296. v10 = cnt
  5297. if !(v10 != 0) {
  5298. break
  5299. }
  5300. }
  5301. cnt = size
  5302. tmp1 = base + uintptr(nmemb*size)
  5303. tmp2 = base + uintptr(size)
  5304. for {
  5305. v16 = tmp1
  5306. tmp1++
  5307. v17 = tmp2
  5308. tmp2++
  5309. *(*int8)(unsafe.Pointer(v16)) = *(*int8)(unsafe.Pointer(v17))
  5310. goto _15
  5311. _15:
  5312. ;
  5313. cnt--
  5314. v14 = cnt
  5315. if !(v14 != 0) {
  5316. break
  5317. }
  5318. }
  5319. nmemb--
  5320. i = uint32(1)
  5321. for {
  5322. v19 = i * libc.Uint32FromInt32(2)
  5323. j = v19
  5324. if !(v19 <= nmemb) {
  5325. break
  5326. }
  5327. p = base + uintptr(j*size)
  5328. if j < nmemb && (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, p, p+uintptr(size)) < 0 {
  5329. p += uintptr(size)
  5330. j++
  5331. }
  5332. t = base + uintptr(i*size)
  5333. cnt = size
  5334. tmp1 = t
  5335. tmp2 = p
  5336. for {
  5337. v22 = tmp1
  5338. tmp1++
  5339. v23 = tmp2
  5340. tmp2++
  5341. *(*int8)(unsafe.Pointer(v22)) = *(*int8)(unsafe.Pointer(v23))
  5342. goto _21
  5343. _21:
  5344. ;
  5345. cnt--
  5346. v20 = cnt
  5347. if !(v20 != 0) {
  5348. break
  5349. }
  5350. }
  5351. goto _18
  5352. _18:
  5353. ;
  5354. i = j
  5355. }
  5356. for {
  5357. j = i
  5358. i = j / uint32(2)
  5359. p = base + uintptr(j*size)
  5360. t = base + uintptr(i*size)
  5361. if j == uint32(1) || (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, k, t) < 0 {
  5362. cnt = size
  5363. tmp1 = p
  5364. tmp2 = k
  5365. for {
  5366. v27 = tmp1
  5367. tmp1++
  5368. v28 = tmp2
  5369. tmp2++
  5370. *(*int8)(unsafe.Pointer(v27)) = *(*int8)(unsafe.Pointer(v28))
  5371. goto _26
  5372. _26:
  5373. ;
  5374. cnt--
  5375. v25 = cnt
  5376. if !(v25 != 0) {
  5377. break
  5378. }
  5379. }
  5380. break
  5381. }
  5382. cnt = size
  5383. tmp1 = p
  5384. tmp2 = t
  5385. for {
  5386. v31 = tmp1
  5387. tmp1++
  5388. v32 = tmp2
  5389. tmp2++
  5390. *(*int8)(unsafe.Pointer(v31)) = *(*int8)(unsafe.Pointer(v32))
  5391. goto _30
  5392. _30:
  5393. ;
  5394. cnt--
  5395. v29 = cnt
  5396. if !(v29 != 0) {
  5397. break
  5398. }
  5399. }
  5400. goto _24
  5401. _24:
  5402. }
  5403. }
  5404. libc.Xfree(tls, k)
  5405. return 0
  5406. }
  5407. const m_HN_AUTOSCALE1 = 32
  5408. const m_HN_B1 = 4
  5409. const m_HN_DECIMAL1 = 1
  5410. const m_HN_DIVISOR_10001 = 8
  5411. const m_HN_GETSCALE1 = 16
  5412. const m_HN_IEC_PREFIXES1 = 16
  5413. const m_HN_NOSPACE1 = 2
  5414. const m_LC_ALL = 6
  5415. const m_LC_ALL_MASK = 0x7fffffff
  5416. const m_LC_COLLATE = 3
  5417. const m_LC_CTYPE = 0
  5418. const m_LC_MESSAGES = 5
  5419. const m_LC_MONETARY = 4
  5420. const m_LC_NUMERIC = 1
  5421. const m_LC_TIME = 2
  5422. type Tlconv = struct {
  5423. Fdecimal_point uintptr
  5424. Fthousands_sep uintptr
  5425. Fgrouping uintptr
  5426. Fint_curr_symbol uintptr
  5427. Fcurrency_symbol uintptr
  5428. Fmon_decimal_point uintptr
  5429. Fmon_thousands_sep uintptr
  5430. Fmon_grouping uintptr
  5431. Fpositive_sign uintptr
  5432. Fnegative_sign uintptr
  5433. Fint_frac_digits int8
  5434. Ffrac_digits int8
  5435. Fp_cs_precedes int8
  5436. Fp_sep_by_space int8
  5437. Fn_cs_precedes int8
  5438. Fn_sep_by_space int8
  5439. Fp_sign_posn int8
  5440. Fn_sign_posn int8
  5441. Fint_p_cs_precedes int8
  5442. Fint_p_sep_by_space int8
  5443. Fint_n_cs_precedes int8
  5444. Fint_n_sep_by_space int8
  5445. Fint_p_sign_posn int8
  5446. Fint_n_sign_posn int8
  5447. }
  5448. /*
  5449. * Copyright (c) 1996 Peter Wemm <peter@FreeBSD.org>.
  5450. * All rights reserved.
  5451. * Copyright (c) 2002 Networks Associates Technology, Inc.
  5452. * All rights reserved.
  5453. *
  5454. * Portions of this software were developed for the FreeBSD Project by
  5455. * ThinkSec AS and NAI Labs, the Security Research Division of Network
  5456. * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
  5457. * ("CBOSS"), as part of the DARPA CHATS research program.
  5458. *
  5459. * Redistribution and use in source and binary forms, with or without
  5460. * modification, is permitted provided that the following conditions
  5461. * are met:
  5462. * 1. Redistributions of source code must retain the above copyright
  5463. * notice, this list of conditions and the following disclaimer.
  5464. * 2. Redistributions in binary form must reproduce the above copyright
  5465. * notice, this list of conditions and the following disclaimer in the
  5466. * documentation and/or other materials provided with the distribution.
  5467. * 3. The name of the author may not be used to endorse or promote
  5468. * products derived from this software without specific prior written
  5469. * permission.
  5470. *
  5471. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  5472. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  5473. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  5474. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  5475. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  5476. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  5477. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  5478. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  5479. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  5480. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  5481. * SUCH DAMAGE.
  5482. *
  5483. * $FreeBSD: src/lib/libutil/libutil.h,v 1.47 2008/04/23 00:49:12 scf Exp $
  5484. */
  5485. var _maxscale = int32(6)
  5486. func Xhumanize_number(tls *libc.TLS, buf uintptr, len1 Tsize_t, quotient Tint64_t, suffix uintptr, scale int32, flags int32) (r1 int32) {
  5487. bp := tls.Alloc(64)
  5488. defer tls.Free(64)
  5489. var baselen Tsize_t
  5490. var divisor, max Tint64_t
  5491. var divisordeccut, i, r, remainder, s1, s2, sign, v2 int32
  5492. var prefixes, sep uintptr
  5493. _, _, _, _, _, _, _, _, _, _, _, _, _ = baselen, divisor, divisordeccut, i, max, prefixes, r, remainder, s1, s2, sep, sign, v2
  5494. /* Since so many callers don't check -1, NUL terminate the buffer */
  5495. if len1 > uint32(0) {
  5496. *(*int8)(unsafe.Pointer(buf)) = int8('\000')
  5497. }
  5498. /* validate args */
  5499. if buf == libc.UintptrFromInt32(0) || suffix == libc.UintptrFromInt32(0) {
  5500. return -int32(1)
  5501. }
  5502. if scale < 0 {
  5503. return -int32(1)
  5504. } else {
  5505. if scale > _maxscale && scale & ^(libc.Int32FromInt32(m_HN_AUTOSCALE1)|libc.Int32FromInt32(m_HN_GETSCALE1)) != 0 {
  5506. return -int32(1)
  5507. }
  5508. }
  5509. if flags&int32(m_HN_DIVISOR_10001) != 0 && flags&int32(m_HN_IEC_PREFIXES1) != 0 {
  5510. return -int32(1)
  5511. }
  5512. /* setup parameters */
  5513. remainder = 0
  5514. if flags&int32(m_HN_IEC_PREFIXES1) != 0 {
  5515. baselen = uint32(2)
  5516. /*
  5517. * Use the prefixes for power of two recommended by
  5518. * the International Electrotechnical Commission
  5519. * (IEC) in IEC 80000-3 (i.e. Ki, Mi, Gi...).
  5520. *
  5521. * HN_IEC_PREFIXES implies a divisor of 1024 here
  5522. * (use of HN_DIVISOR_1000 would have triggered
  5523. * an assertion earlier).
  5524. */
  5525. divisor = int64(1024)
  5526. divisordeccut = int32(973) /* ceil(.95 * 1024) */
  5527. if flags&int32(m_HN_B1) != 0 {
  5528. prefixes = __ccgo_ts + 156
  5529. } else {
  5530. prefixes = __ccgo_ts + 177
  5531. }
  5532. } else {
  5533. baselen = uint32(1)
  5534. if flags&int32(m_HN_DIVISOR_10001) != 0 {
  5535. divisor = int64(1000)
  5536. divisordeccut = int32(950)
  5537. if flags&int32(m_HN_B1) != 0 {
  5538. prefixes = __ccgo_ts + 198
  5539. } else {
  5540. prefixes = __ccgo_ts + 218
  5541. }
  5542. } else {
  5543. divisor = int64(1024)
  5544. divisordeccut = int32(973) /* ceil(.95 * 1024) */
  5545. if flags&int32(m_HN_B1) != 0 {
  5546. prefixes = __ccgo_ts + 238
  5547. } else {
  5548. prefixes = __ccgo_ts + 258
  5549. }
  5550. }
  5551. }
  5552. if quotient < 0 {
  5553. sign = -int32(1)
  5554. quotient = -quotient
  5555. baselen += uint32(2) /* sign, digit */
  5556. } else {
  5557. sign = int32(1)
  5558. baselen += uint32(1) /* digit */
  5559. }
  5560. if flags&int32(m_HN_NOSPACE1) != 0 {
  5561. sep = __ccgo_ts + 53
  5562. } else {
  5563. sep = __ccgo_ts + 278
  5564. baselen++
  5565. }
  5566. baselen += libc.Xstrlen(tls, suffix)
  5567. /* Check if enough room for `x y' + suffix + `\0' */
  5568. if len1 < baselen+uint32(1) {
  5569. return -int32(1)
  5570. }
  5571. if scale&(libc.Int32FromInt32(m_HN_AUTOSCALE1)|libc.Int32FromInt32(m_HN_GETSCALE1)) != 0 {
  5572. /* See if there is additional columns can be used. */
  5573. max = int64(1)
  5574. i = libc.Int32FromUint32(len1 - baselen)
  5575. for {
  5576. v2 = i
  5577. i--
  5578. if !(v2 > 0) {
  5579. break
  5580. }
  5581. max *= int64(10)
  5582. goto _1
  5583. _1:
  5584. }
  5585. /*
  5586. * Divide the number until it fits the given column.
  5587. * If there will be an overflow by the rounding below,
  5588. * divide once more.
  5589. */
  5590. i = 0
  5591. for {
  5592. if !((quotient >= max || quotient == max-int64(1) && (remainder >= divisordeccut || int64(remainder) >= divisor/int64(2))) && i < _maxscale) {
  5593. break
  5594. }
  5595. remainder = int32(quotient % divisor)
  5596. quotient /= divisor
  5597. goto _3
  5598. _3:
  5599. ;
  5600. i++
  5601. }
  5602. if scale&int32(m_HN_GETSCALE1) != 0 {
  5603. return i
  5604. }
  5605. } else {
  5606. i = 0
  5607. for {
  5608. if !(i < scale && i < _maxscale) {
  5609. break
  5610. }
  5611. remainder = int32(quotient % divisor)
  5612. quotient /= divisor
  5613. goto _4
  5614. _4:
  5615. ;
  5616. i++
  5617. }
  5618. }
  5619. /* If a value <= 9.9 after rounding and ... */
  5620. /*
  5621. * XXX - should we make sure there is enough space for the decimal
  5622. * place and if not, don't do HN_DECIMAL?
  5623. */
  5624. if (quotient == int64(9) && remainder < divisordeccut || quotient < int64(9)) && i > 0 && flags&int32(m_HN_DECIMAL1) != 0 {
  5625. s1 = int32(int64(int32(quotient)) + (int64(remainder*int32(10))+divisor/int64(2))/divisor/int64(10))
  5626. s2 = int32((int64(remainder*int32(10)) + divisor/int64(2)) / divisor % int64(10))
  5627. r = libc.X__builtin_snprintf(tls, buf, len1, __ccgo_ts+280, libc.VaList(bp+8, sign*s1, (*Tlconv)(unsafe.Pointer(libc.Xlocaleconv(tls))).Fdecimal_point, s2, sep, prefixes+uintptr(i*int32(3)), suffix))
  5628. } else {
  5629. r = libc.X__builtin_snprintf(tls, buf, len1, __ccgo_ts+293, libc.VaList(bp+8, int64(sign)*(quotient+(int64(remainder)+divisor/int64(2))/divisor), sep, prefixes+uintptr(i*int32(3)), suffix))
  5630. }
  5631. return r
  5632. }
  5633. const m_HN_AUTOSCALE2 = 0x20
  5634. const m_HN_B2 = 0x04
  5635. const m_HN_DECIMAL2 = 0x01
  5636. const m_HN_DIVISOR_10002 = 0x08
  5637. const m_HN_GETSCALE2 = 0x10
  5638. const m_HN_IEC_PREFIXES2 = 0x10
  5639. const m_HN_NOSPACE2 = 0x02
  5640. const m_INET6_ADDRSTRLEN = 46
  5641. const m_INET_ADDRSTRLEN = 16
  5642. const m_IN_CLASSA_MAX = 128
  5643. const m_IN_CLASSA_NET = 0xff000000
  5644. const m_IN_CLASSA_NSHIFT = 24
  5645. const m_IN_CLASSB_MAX = 65536
  5646. const m_IN_CLASSB_NET = 0xffff0000
  5647. const m_IN_CLASSB_NSHIFT = 16
  5648. const m_IN_CLASSC_NET = 0xffffff00
  5649. const m_IN_CLASSC_NSHIFT = 8
  5650. const m_IN_LOOPBACKNET = 127
  5651. const m_IPPORT_RESERVED = 1024
  5652. const m_IPPROTO_AH = 51
  5653. const m_IPPROTO_BEETPH = 94
  5654. const m_IPPROTO_COMP = 108
  5655. const m_IPPROTO_DCCP = 33
  5656. const m_IPPROTO_DSTOPTS = 60
  5657. const m_IPPROTO_EGP = 8
  5658. const m_IPPROTO_ENCAP = 98
  5659. const m_IPPROTO_ESP = 50
  5660. const m_IPPROTO_ETHERNET = 143
  5661. const m_IPPROTO_FRAGMENT = 44
  5662. const m_IPPROTO_GRE = 47
  5663. const m_IPPROTO_HOPOPTS = 0
  5664. const m_IPPROTO_ICMP = 1
  5665. const m_IPPROTO_ICMPV6 = 58
  5666. const m_IPPROTO_IDP = 22
  5667. const m_IPPROTO_IGMP = 2
  5668. const m_IPPROTO_IP = 0
  5669. const m_IPPROTO_IPIP = 4
  5670. const m_IPPROTO_IPV6 = 41
  5671. const m_IPPROTO_MAX = 263
  5672. const m_IPPROTO_MH = 135
  5673. const m_IPPROTO_MPLS = 137
  5674. const m_IPPROTO_MPTCP = 262
  5675. const m_IPPROTO_MTP = 92
  5676. const m_IPPROTO_NONE = 59
  5677. const m_IPPROTO_PIM = 103
  5678. const m_IPPROTO_PUP = 12
  5679. const m_IPPROTO_RAW = 255
  5680. const m_IPPROTO_ROUTING = 43
  5681. const m_IPPROTO_RSVP = 46
  5682. const m_IPPROTO_SCTP = 132
  5683. const m_IPPROTO_TCP = 6
  5684. const m_IPPROTO_TP = 29
  5685. const m_IPPROTO_UDP = 17
  5686. const m_IPPROTO_UDPLITE = 136
  5687. const m_IPV6_2292DSTOPTS = 4
  5688. const m_IPV6_2292HOPLIMIT = 8
  5689. const m_IPV6_2292HOPOPTS = 3
  5690. const m_IPV6_2292PKTINFO = 2
  5691. const m_IPV6_2292PKTOPTIONS = 6
  5692. const m_IPV6_2292RTHDR = 5
  5693. const m_IPV6_ADDRFORM = 1
  5694. const m_IPV6_ADDR_PREFERENCES = 72
  5695. const m_IPV6_ADD_MEMBERSHIP = "IPV6_JOIN_GROUP"
  5696. const m_IPV6_AUTHHDR = 10
  5697. const m_IPV6_AUTOFLOWLABEL = 70
  5698. const m_IPV6_CHECKSUM = 7
  5699. const m_IPV6_DONTFRAG = 62
  5700. const m_IPV6_DROP_MEMBERSHIP = "IPV6_LEAVE_GROUP"
  5701. const m_IPV6_DSTOPTS = 59
  5702. const m_IPV6_FREEBIND = 78
  5703. const m_IPV6_HDRINCL = 36
  5704. const m_IPV6_HOPLIMIT = 52
  5705. const m_IPV6_HOPOPTS = 54
  5706. const m_IPV6_IPSEC_POLICY = 34
  5707. const m_IPV6_JOIN_ANYCAST = 27
  5708. const m_IPV6_JOIN_GROUP = 20
  5709. const m_IPV6_LEAVE_ANYCAST = 28
  5710. const m_IPV6_LEAVE_GROUP = 21
  5711. const m_IPV6_MINHOPCOUNT = 73
  5712. const m_IPV6_MTU = 24
  5713. const m_IPV6_MTU_DISCOVER = 23
  5714. const m_IPV6_MULTICAST_ALL = 29
  5715. const m_IPV6_MULTICAST_HOPS = 18
  5716. const m_IPV6_MULTICAST_IF = 17
  5717. const m_IPV6_MULTICAST_LOOP = 19
  5718. const m_IPV6_NEXTHOP = 9
  5719. const m_IPV6_ORIGDSTADDR = 74
  5720. const m_IPV6_PATHMTU = 61
  5721. const m_IPV6_PKTINFO = 50
  5722. const m_IPV6_PMTUDISC_DO = 2
  5723. const m_IPV6_PMTUDISC_DONT = 0
  5724. const m_IPV6_PMTUDISC_INTERFACE = 4
  5725. const m_IPV6_PMTUDISC_OMIT = 5
  5726. const m_IPV6_PMTUDISC_PROBE = 3
  5727. const m_IPV6_PMTUDISC_WANT = 1
  5728. const m_IPV6_PREFER_SRC_CGA = 0x0008
  5729. const m_IPV6_PREFER_SRC_COA = 0x0004
  5730. const m_IPV6_PREFER_SRC_HOME = 0x0400
  5731. const m_IPV6_PREFER_SRC_NONCGA = 0x0800
  5732. const m_IPV6_PREFER_SRC_PUBLIC = 0x0002
  5733. const m_IPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x0100
  5734. const m_IPV6_PREFER_SRC_TMP = 0x0001
  5735. const m_IPV6_RECVDSTOPTS = 58
  5736. const m_IPV6_RECVERR = 25
  5737. const m_IPV6_RECVFRAGSIZE = 77
  5738. const m_IPV6_RECVHOPLIMIT = 51
  5739. const m_IPV6_RECVHOPOPTS = 53
  5740. const m_IPV6_RECVORIGDSTADDR = "IPV6_ORIGDSTADDR"
  5741. const m_IPV6_RECVPATHMTU = 60
  5742. const m_IPV6_RECVPKTINFO = 49
  5743. const m_IPV6_RECVRTHDR = 56
  5744. const m_IPV6_RECVTCLASS = 66
  5745. const m_IPV6_ROUTER_ALERT = 22
  5746. const m_IPV6_ROUTER_ALERT_ISOLATE = 30
  5747. const m_IPV6_RTHDR = 57
  5748. const m_IPV6_RTHDRDSTOPTS = 55
  5749. const m_IPV6_RTHDR_LOOSE = 0
  5750. const m_IPV6_RTHDR_STRICT = 1
  5751. const m_IPV6_RTHDR_TYPE_0 = 0
  5752. const m_IPV6_RXDSTOPTS = "IPV6_DSTOPTS"
  5753. const m_IPV6_RXHOPOPTS = "IPV6_HOPOPTS"
  5754. const m_IPV6_TCLASS = 67
  5755. const m_IPV6_TRANSPARENT = 75
  5756. const m_IPV6_UNICAST_HOPS = 16
  5757. const m_IPV6_UNICAST_IF = 76
  5758. const m_IPV6_V6ONLY = 26
  5759. const m_IPV6_XFRM_POLICY = 35
  5760. const m_IP_ADD_MEMBERSHIP = 35
  5761. const m_IP_ADD_SOURCE_MEMBERSHIP = 39
  5762. const m_IP_BIND_ADDRESS_NO_PORT = 24
  5763. const m_IP_BLOCK_SOURCE = 38
  5764. const m_IP_CHECKSUM = 23
  5765. const m_IP_DEFAULT_MULTICAST_LOOP = 1
  5766. const m_IP_DEFAULT_MULTICAST_TTL = 1
  5767. const m_IP_DROP_MEMBERSHIP = 36
  5768. const m_IP_DROP_SOURCE_MEMBERSHIP = 40
  5769. const m_IP_FREEBIND = 15
  5770. const m_IP_HDRINCL = 3
  5771. const m_IP_IPSEC_POLICY = 16
  5772. const m_IP_MAX_MEMBERSHIPS = 20
  5773. const m_IP_MINTTL = 21
  5774. const m_IP_MSFILTER = 41
  5775. const m_IP_MTU = 14
  5776. const m_IP_MTU_DISCOVER = 10
  5777. const m_IP_MULTICAST_ALL = 49
  5778. const m_IP_MULTICAST_IF = 32
  5779. const m_IP_MULTICAST_LOOP = 34
  5780. const m_IP_MULTICAST_TTL = 33
  5781. const m_IP_NODEFRAG = 22
  5782. const m_IP_OPTIONS = 4
  5783. const m_IP_ORIGDSTADDR = 20
  5784. const m_IP_PASSSEC = 18
  5785. const m_IP_PKTINFO = 8
  5786. const m_IP_PKTOPTIONS = 9
  5787. const m_IP_PMTUDISC = 10
  5788. const m_IP_PMTUDISC_DO = 2
  5789. const m_IP_PMTUDISC_DONT = 0
  5790. const m_IP_PMTUDISC_INTERFACE = 4
  5791. const m_IP_PMTUDISC_OMIT = 5
  5792. const m_IP_PMTUDISC_PROBE = 3
  5793. const m_IP_PMTUDISC_WANT = 1
  5794. const m_IP_RECVERR = 11
  5795. const m_IP_RECVERR_RFC4884 = 26
  5796. const m_IP_RECVFRAGSIZE = 25
  5797. const m_IP_RECVOPTS = 6
  5798. const m_IP_RECVORIGDSTADDR = "IP_ORIGDSTADDR"
  5799. const m_IP_RECVRETOPTS = "IP_RETOPTS"
  5800. const m_IP_RECVTOS = 13
  5801. const m_IP_RECVTTL = 12
  5802. const m_IP_RETOPTS = 7
  5803. const m_IP_ROUTER_ALERT = 5
  5804. const m_IP_TOS = 1
  5805. const m_IP_TRANSPARENT = 19
  5806. const m_IP_TTL = 2
  5807. const m_IP_UNBLOCK_SOURCE = 37
  5808. const m_IP_UNICAST_IF = 50
  5809. const m_IP_XFRM_POLICY = 17
  5810. const m_MCAST_BLOCK_SOURCE = 43
  5811. const m_MCAST_EXCLUDE = 0
  5812. const m_MCAST_INCLUDE = 1
  5813. const m_MCAST_JOIN_GROUP = 42
  5814. const m_MCAST_JOIN_SOURCE_GROUP = 46
  5815. const m_MCAST_LEAVE_GROUP = 45
  5816. const m_MCAST_LEAVE_SOURCE_GROUP = 47
  5817. const m_MCAST_MSFILTER = 48
  5818. const m_MCAST_UNBLOCK_SOURCE = 44
  5819. const m___UAPI_DEF_IN6_ADDR = 0
  5820. const m___UAPI_DEF_IN6_ADDR_ALT = 0
  5821. const m___UAPI_DEF_IN6_PKTINFO = 0
  5822. const m___UAPI_DEF_IN_ADDR = 0
  5823. const m___UAPI_DEF_IN_CLASS = 0
  5824. const m___UAPI_DEF_IN_IPPROTO = 0
  5825. const m___UAPI_DEF_IN_PKTINFO = 0
  5826. const m___UAPI_DEF_IP6_MTUINFO = 0
  5827. const m___UAPI_DEF_IPPROTO_V6 = 0
  5828. const m___UAPI_DEF_IPV6_MREQ = 0
  5829. const m___UAPI_DEF_IPV6_OPTIONS = 0
  5830. const m___UAPI_DEF_IP_MREQ = 0
  5831. const m___UAPI_DEF_SOCKADDR_IN = 0
  5832. const m___UAPI_DEF_SOCKADDR_IN6 = 0
  5833. type Tin_port_t = uint16
  5834. type Tin_addr_t = uint32
  5835. type Tin_addr = struct {
  5836. Fs_addr Tin_addr_t
  5837. }
  5838. type Tsockaddr_in = struct {
  5839. Fsin_family Tsa_family_t
  5840. Fsin_port Tin_port_t
  5841. Fsin_addr Tin_addr
  5842. Fsin_zero [8]Tuint8_t
  5843. }
  5844. type Tin6_addr = struct {
  5845. F__in6_union struct {
  5846. F__s6_addr16 [0][8]Tuint16_t
  5847. F__s6_addr32 [0][4]Tuint32_t
  5848. F__s6_addr [16]Tuint8_t
  5849. }
  5850. }
  5851. type Tsockaddr_in6 = struct {
  5852. Fsin6_family Tsa_family_t
  5853. Fsin6_port Tin_port_t
  5854. Fsin6_flowinfo Tuint32_t
  5855. Fsin6_addr Tin6_addr
  5856. Fsin6_scope_id Tuint32_t
  5857. }
  5858. type Tipv6_mreq = struct {
  5859. Fipv6mr_multiaddr Tin6_addr
  5860. Fipv6mr_interface uint32
  5861. }
  5862. type Tip_opts = struct {
  5863. Fip_dst Tin_addr
  5864. Fip_opts [40]int8
  5865. }
  5866. type Tip_mreq = struct {
  5867. Fimr_multiaddr Tin_addr
  5868. Fimr_interface Tin_addr
  5869. }
  5870. type Tip_mreqn = struct {
  5871. Fimr_multiaddr Tin_addr
  5872. Fimr_address Tin_addr
  5873. Fimr_ifindex int32
  5874. }
  5875. type Tip_mreq_source = struct {
  5876. Fimr_multiaddr Tin_addr
  5877. Fimr_interface Tin_addr
  5878. Fimr_sourceaddr Tin_addr
  5879. }
  5880. type Tip_msfilter = struct {
  5881. Fimsf_multiaddr Tin_addr
  5882. Fimsf_interface Tin_addr
  5883. Fimsf_fmode Tuint32_t
  5884. Fimsf_numsrc Tuint32_t
  5885. Fimsf_slist [1]Tin_addr
  5886. }
  5887. type Tgroup_req = struct {
  5888. Fgr_interface Tuint32_t
  5889. Fgr_group Tsockaddr_storage
  5890. }
  5891. type Tgroup_source_req = struct {
  5892. Fgsr_interface Tuint32_t
  5893. Fgsr_group Tsockaddr_storage
  5894. Fgsr_source Tsockaddr_storage
  5895. }
  5896. type Tgroup_filter = struct {
  5897. Fgf_interface Tuint32_t
  5898. Fgf_group Tsockaddr_storage
  5899. Fgf_fmode Tuint32_t
  5900. Fgf_numsrc Tuint32_t
  5901. Fgf_slist [1]Tsockaddr_storage
  5902. }
  5903. type Tin_pktinfo = struct {
  5904. Fipi_ifindex int32
  5905. Fipi_spec_dst Tin_addr
  5906. Fipi_addr Tin_addr
  5907. }
  5908. type Tin6_pktinfo = struct {
  5909. Fipi6_addr Tin6_addr
  5910. Fipi6_ifindex uint32
  5911. }
  5912. type Tip6_mtuinfo = struct {
  5913. Fip6m_addr Tsockaddr_in6
  5914. Fip6m_mtu Tuint32_t
  5915. }
  5916. // C documentation
  5917. //
  5918. // /*
  5919. // * static int
  5920. // * inet_net_pton(af, src, dst, size)
  5921. // * convert network number from presentation to network format.
  5922. // * accepts hex octets, hex strings, decimal octets, and /CIDR.
  5923. // * "size" is in bytes and describes "dst".
  5924. // * return:
  5925. // * number of bits, either imputed classfully or specified with /CIDR,
  5926. // * or -1 if some failure occurred (check errno). ENOENT means it was
  5927. // * not a valid network specification.
  5928. // * author:
  5929. // * Paul Vixie (ISC), June 1996
  5930. // */
  5931. func Xinet_net_pton(tls *libc.TLS, af int32, src uintptr, dst uintptr, size Tsize_t) (r int32) {
  5932. switch af {
  5933. case int32(m_PF_INET):
  5934. return _inet_net_pton_ipv4(tls, src, dst, size)
  5935. default:
  5936. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EAFNOSUPPORT)
  5937. return -int32(1)
  5938. }
  5939. return r
  5940. }
  5941. // C documentation
  5942. //
  5943. // /*
  5944. // * static int
  5945. // * inet_net_pton_ipv4(src, dst, size)
  5946. // * convert IPv4 network number from presentation to network format.
  5947. // * accepts hex octets, hex strings, decimal octets, and /CIDR.
  5948. // * "size" is in bytes and describes "dst".
  5949. // * return:
  5950. // * number of bits, either imputed classfully or specified with /CIDR,
  5951. // * or -1 if some failure occurred (check errno). ENOENT means it was
  5952. // * not an IPv4 network specification.
  5953. // * note:
  5954. // * network byte order assumed. this means 192.5.5.240/28 has
  5955. // * 0x11110000 in its fourth octet.
  5956. // * author:
  5957. // * Paul Vixie (ISC), June 1996
  5958. // */
  5959. func _inet_net_pton_ipv4(tls *libc.TLS, src uintptr, dst uintptr, size Tsize_t) (r int32) {
  5960. var bits, ch, dirty, n, tmp, v10, v17, v2, v5 int32
  5961. var odst, v1, v11, v14, v15, v16, v18, v21, v3, v8, p4, p6 uintptr
  5962. var v13, v20, v7 Tsize_t
  5963. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bits, ch, dirty, n, odst, tmp, v1, v10, v11, v13, v14, v15, v16, v17, v18, v2, v20, v21, v3, v5, v7, v8, p4, p6
  5964. odst = dst
  5965. v1 = src
  5966. src++
  5967. ch = int32(*(*int8)(unsafe.Pointer(v1)))
  5968. if ch == int32('0') && (int32(*(*int8)(unsafe.Pointer(src))) == int32('x') || int32(*(*int8)(unsafe.Pointer(src))) == int32('X')) && libc.BoolInt32(libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(src + 1))) < uint32(128)) != 0 && libc.Xisxdigit(tls, int32(*(*int8)(unsafe.Pointer(src + 1)))) != 0 {
  5969. /* Hexadecimal: Eat nybble string. */
  5970. if size <= uint32(0) {
  5971. goto emsgsize
  5972. }
  5973. *(*uint8)(unsafe.Pointer(dst)) = uint8(0)
  5974. dirty = libc.Int32FromInt32(0)
  5975. src++ /* skip x or X. */
  5976. for {
  5977. v3 = src
  5978. src++
  5979. v2 = int32(*(*int8)(unsafe.Pointer(v3)))
  5980. ch = v2
  5981. if !(v2 != int32('\000') && libc.BoolInt32(libc.Uint32FromInt32(ch) < uint32(128)) != 0 && libc.Xisxdigit(tls, ch) != 0) {
  5982. break
  5983. }
  5984. if libc.BoolInt32(libc.Uint32FromInt32(ch)-uint32('A') < uint32(26)) != 0 {
  5985. ch = libc.Xtolower(tls, ch)
  5986. }
  5987. n = int32(libc.Xstrchr(tls, uintptr(unsafe.Pointer(&_xdigits)), ch)) - t__predefined_ptrdiff_t(uintptr(unsafe.Pointer(&_xdigits)))
  5988. p4 = dst
  5989. *(*uint8)(unsafe.Pointer(p4)) = uint8(int32(*(*uint8)(unsafe.Pointer(p4))) | n)
  5990. v5 = dirty
  5991. dirty++
  5992. if !(v5 != 0) {
  5993. p6 = dst
  5994. *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) << libc.Int32FromInt32(4))
  5995. } else {
  5996. v7 = size
  5997. size--
  5998. if v7 > uint32(0) {
  5999. dst++
  6000. v8 = dst
  6001. *(*uint8)(unsafe.Pointer(v8)) = uint8(0)
  6002. dirty = libc.Int32FromInt32(0)
  6003. } else {
  6004. goto emsgsize
  6005. }
  6006. }
  6007. }
  6008. if dirty != 0 {
  6009. size--
  6010. }
  6011. } else {
  6012. if libc.BoolInt32(libc.Uint32FromInt32(ch) < uint32(128)) != 0 && libc.BoolInt32(libc.Uint32FromInt32(ch)-uint32('0') < uint32(10)) != 0 {
  6013. /* Decimal: eat dotted digit string. */
  6014. for {
  6015. tmp = 0
  6016. for {
  6017. n = int32(libc.Xstrchr(tls, uintptr(unsafe.Pointer(&_digits)), ch)) - t__predefined_ptrdiff_t(uintptr(unsafe.Pointer(&_digits)))
  6018. tmp *= int32(10)
  6019. tmp += n
  6020. if tmp > int32(255) {
  6021. goto enoent
  6022. }
  6023. goto _12
  6024. _12:
  6025. ;
  6026. v11 = src
  6027. src++
  6028. v10 = int32(*(*int8)(unsafe.Pointer(v11)))
  6029. ch = v10
  6030. if !(v10 != int32('\000') && libc.BoolInt32(libc.Uint32FromInt32(ch) < uint32(128)) != 0 && libc.BoolInt32(libc.Uint32FromInt32(ch)-uint32('0') < uint32(10)) != 0) {
  6031. break
  6032. }
  6033. }
  6034. v13 = size
  6035. size--
  6036. if v13 <= uint32(0) {
  6037. goto emsgsize
  6038. }
  6039. v14 = dst
  6040. dst++
  6041. *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(tmp)
  6042. if ch == int32('\000') || ch == int32('/') {
  6043. break
  6044. }
  6045. if ch != int32('.') {
  6046. goto enoent
  6047. }
  6048. v15 = src
  6049. src++
  6050. ch = int32(*(*int8)(unsafe.Pointer(v15)))
  6051. if !(libc.BoolInt32(libc.Uint32FromInt32(ch) < libc.Uint32FromInt32(128)) != 0) || !(libc.BoolInt32(libc.Uint32FromInt32(ch)-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0) {
  6052. goto enoent
  6053. }
  6054. goto _9
  6055. _9:
  6056. }
  6057. } else {
  6058. goto enoent
  6059. }
  6060. }
  6061. bits = -int32(1)
  6062. if ch == int32('/') && libc.BoolInt32(libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(src))) < uint32(128)) != 0 && libc.BoolInt32(libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(src)))-uint32('0') < uint32(10)) != 0 && dst > odst {
  6063. /* CIDR width specifier. Nothing can follow it. */
  6064. v16 = src
  6065. src++
  6066. ch = int32(*(*int8)(unsafe.Pointer(v16))) /* Skip over the /. */
  6067. bits = 0
  6068. for {
  6069. n = int32(libc.Xstrchr(tls, uintptr(unsafe.Pointer(&_digits)), ch)) - t__predefined_ptrdiff_t(uintptr(unsafe.Pointer(&_digits)))
  6070. bits *= int32(10)
  6071. bits += n
  6072. goto _19
  6073. _19:
  6074. ;
  6075. v18 = src
  6076. src++
  6077. v17 = int32(*(*int8)(unsafe.Pointer(v18)))
  6078. ch = v17
  6079. if !(v17 != int32('\000') && libc.BoolInt32(libc.Uint32FromInt32(ch) < uint32(128)) != 0 && libc.BoolInt32(libc.Uint32FromInt32(ch)-uint32('0') < uint32(10)) != 0) {
  6080. break
  6081. }
  6082. }
  6083. if ch != int32('\000') {
  6084. goto enoent
  6085. }
  6086. if bits > int32(32) {
  6087. goto emsgsize
  6088. }
  6089. }
  6090. /* Firey death and destruction unless we prefetched EOS. */
  6091. if ch != int32('\000') {
  6092. goto enoent
  6093. }
  6094. /* If nothing was written to the destination, we found no address. */
  6095. if dst == odst {
  6096. goto enoent
  6097. }
  6098. /* If no CIDR spec was given, infer width from net class. */
  6099. if bits == -int32(1) {
  6100. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(odst))) >= int32(240) { /* Class E */
  6101. bits = int32(32)
  6102. } else {
  6103. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(odst))) >= int32(224) { /* Class D */
  6104. bits = int32(4)
  6105. } else {
  6106. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(odst))) >= int32(192) { /* Class C */
  6107. bits = int32(24)
  6108. } else {
  6109. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(odst))) >= int32(128) { /* Class B */
  6110. bits = int32(16)
  6111. } else { /* Class A */
  6112. bits = int32(8)
  6113. }
  6114. }
  6115. }
  6116. }
  6117. /* If imputed mask is narrower than specified octets, widen. */
  6118. if bits < (int32(dst)-int32(odst))*int32(8) {
  6119. bits = (int32(dst) - int32(odst)) * int32(8)
  6120. }
  6121. }
  6122. /* Extend network to cover the actual mask. */
  6123. for bits > (int32(dst)-int32(odst))*int32(8) {
  6124. v20 = size
  6125. size--
  6126. if v20 <= uint32(0) {
  6127. goto emsgsize
  6128. }
  6129. v21 = dst
  6130. dst++
  6131. *(*uint8)(unsafe.Pointer(v21)) = uint8('\000')
  6132. }
  6133. return bits
  6134. goto enoent
  6135. enoent:
  6136. ;
  6137. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOENT)
  6138. return -int32(1)
  6139. goto emsgsize
  6140. emsgsize:
  6141. ;
  6142. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EMSGSIZE)
  6143. return -int32(1)
  6144. }
  6145. var _xdigits = [17]int8{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}
  6146. var _digits = [11]int8{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
  6147. const m_MD5_BLOCK_LENGTH = 64
  6148. const m_MD5_DIGEST_LENGTH = 16
  6149. type TMD5_CTX = struct {
  6150. Fstate [4]Tuint32_t
  6151. Fcount Tuint64_t
  6152. Fbuffer [64]Tuint8_t
  6153. }
  6154. type TMD5Context = TMD5_CTX
  6155. /* Avoid polluting the namespace. Even though this makes this usage
  6156. * implementation-specific, defining it unconditionally should not be
  6157. * a problem, and better than possibly breaking unexpecting code. */
  6158. /*
  6159. * Copyright © 2015 Guillem Jover <guillem@hadrons.org>
  6160. *
  6161. * Redistribution and use in source and binary forms, with or without
  6162. * modification, are permitted provided that the following conditions
  6163. * are met:
  6164. * 1. Redistributions of source code must retain the above copyright
  6165. * notice, this list of conditions and the following disclaimer.
  6166. * 2. Redistributions in binary form must reproduce the above copyright
  6167. * notice, this list of conditions and the following disclaimer in the
  6168. * documentation and/or other materials provided with the distribution.
  6169. * 3. The name of the author may not be used to endorse or promote products
  6170. * derived from this software without specific prior written permission.
  6171. *
  6172. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  6173. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  6174. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  6175. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  6176. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  6177. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  6178. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  6179. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  6180. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  6181. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6182. */
  6183. /*
  6184. * Copyright © 2004-2006, 2009-2011 Guillem Jover <guillem@hadrons.org>
  6185. *
  6186. * Redistribution and use in source and binary forms, with or without
  6187. * modification, are permitted provided that the following conditions
  6188. * are met:
  6189. * 1. Redistributions of source code must retain the above copyright
  6190. * notice, this list of conditions and the following disclaimer.
  6191. * 2. Redistributions in binary form must reproduce the above copyright
  6192. * notice, this list of conditions and the following disclaimer in the
  6193. * documentation and/or other materials provided with the distribution.
  6194. * 3. The name of the author may not be used to endorse or promote products
  6195. * derived from this software without specific prior written permission.
  6196. *
  6197. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  6198. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  6199. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  6200. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  6201. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  6202. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  6203. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  6204. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  6205. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  6206. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6207. */
  6208. /* Clang expands this to 1 if an identifier is *not* reserved. */
  6209. /*
  6210. * Some libc implementations do not have a <sys/cdefs.h>, in particular
  6211. * musl, try to handle this gracefully.
  6212. */
  6213. /* Copyright (C) 1992-2022 Free Software Foundation, Inc.
  6214. Copyright The GNU Toolchain Authors.
  6215. This file is part of the GNU C Library.
  6216. The GNU C Library is free software; you can redistribute it and/or
  6217. modify it under the terms of the GNU Lesser General Public
  6218. License as published by the Free Software Foundation; either
  6219. version 2.1 of the License, or (at your option) any later version.
  6220. The GNU C Library is distributed in the hope that it will be useful,
  6221. but WITHOUT ANY WARRANTY; without even the implied warranty of
  6222. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6223. Lesser General Public License for more details.
  6224. You should have received a copy of the GNU Lesser General Public
  6225. License along with the GNU C Library; if not, see
  6226. <https://www.gnu.org/licenses/>. */
  6227. /* We are almost always included from features.h. */
  6228. /* The GNU libc does not support any K&R compilers or the traditional mode
  6229. of ISO C compilers anymore. Check for some of the combinations not
  6230. supported anymore. */
  6231. /* Some user header file might have defined this before. */
  6232. /* Compilers that lack __has_attribute may object to
  6233. #if defined __has_attribute && __has_attribute (...)
  6234. even though they do not need to evaluate the right-hand side of the &&.
  6235. Similarly for __has_builtin, etc. */
  6236. /* All functions, except those with callbacks or those that
  6237. synchronize memory, are leaf functions. */
  6238. /* GCC can always grok prototypes. For C++ programs we add throw()
  6239. to help it optimize the function calls. But this only works with
  6240. gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions
  6241. as non-throwing using a function attribute since programs can use
  6242. the -fexceptions options for C code as well. */
  6243. /* These two macros are not used in glibc anymore. They are kept here
  6244. only because some other projects expect the macros to be defined. */
  6245. /* For these things, GCC behaves the ANSI way normally,
  6246. and the non-ANSI way under -traditional. */
  6247. /* This is not a typedef so `const __ptr_t' does the right thing. */
  6248. /* C++ needs to know that types and declarations are C, not C++. */
  6249. /* Fortify support. */
  6250. /* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */
  6251. /* Support for flexible arrays.
  6252. Headers that should use flexible arrays only if they're "real"
  6253. (e.g. only if they won't affect sizeof()) should test
  6254. #if __glibc_c99_flexarr_available. */
  6255. /* __asm__ ("xyz") is used throughout the headers to rename functions
  6256. at the assembly language level. This is wrapped by the __REDIRECT
  6257. macro, in order to support compilers that can do this some other
  6258. way. When compilers don't support asm-names at all, we have to do
  6259. preprocessor tricks instead (which don't have exactly the right
  6260. semantics, but it's the best we can do).
  6261. Example:
  6262. int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
  6263. /*
  6264. #elif __SOME_OTHER_COMPILER__
  6265. # define __REDIRECT(name, proto, alias) name proto; _Pragma("let " #name " = " #alias)
  6266. */
  6267. /* GCC and clang have various useful declarations that can be made with
  6268. the '__attribute__' syntax. All of the ways we use this do fine if
  6269. they are omitted for compilers that don't understand it. */
  6270. /* At some point during the gcc 2.96 development the `malloc' attribute
  6271. for functions was introduced. We don't want to use it unconditionally
  6272. (although this would be possible) since it generates warnings. */
  6273. /* Tell the compiler which arguments to an allocation function
  6274. indicate the size of the allocation. */
  6275. /* Tell the compiler which argument to an allocation function
  6276. indicates the alignment of the allocation. */
  6277. /* At some point during the gcc 2.96 development the `pure' attribute
  6278. for functions was introduced. We don't want to use it unconditionally
  6279. (although this would be possible) since it generates warnings. */
  6280. /* This declaration tells the compiler that the value is constant. */
  6281. /* At some point during the gcc 3.1 development the `used' attribute
  6282. for functions was introduced. We don't want to use it unconditionally
  6283. (although this would be possible) since it generates warnings. */
  6284. /* Since version 3.2, gcc allows marking deprecated functions. */
  6285. /* Since version 4.5, gcc also allows one to specify the message printed
  6286. when a deprecated function is used. clang claims to be gcc 4.2, but
  6287. may also support this feature. */
  6288. /* At some point during the gcc 2.8 development the `format_arg' attribute
  6289. for functions was introduced. We don't want to use it unconditionally
  6290. (although this would be possible) since it generates warnings.
  6291. If several `format_arg' attributes are given for the same function, in
  6292. gcc-3.0 and older, all but the last one are ignored. In newer gccs,
  6293. all designated arguments are considered. */
  6294. /* At some point during the gcc 2.97 development the `strfmon' format
  6295. attribute for functions was introduced. We don't want to use it
  6296. unconditionally (although this would be possible) since it
  6297. generates warnings. */
  6298. /* The nonnull function attribute marks pointer parameters that
  6299. must not be NULL. This has the name __nonnull in glibc,
  6300. and __attribute_nonnull__ in files shared with Gnulib to avoid
  6301. collision with a different __nonnull in DragonFlyBSD 5.9. */
  6302. /* The returns_nonnull function attribute marks the return type of the function
  6303. as always being non-null. */
  6304. /* If fortification mode, we warn about unused results of certain
  6305. function calls which can lead to problems. */
  6306. /* Forces a function to be always inlined. */
  6307. /* Associate error messages with the source location of the call site rather
  6308. than with the source location inside the function. */
  6309. /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
  6310. inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__
  6311. or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions
  6312. older than 4.3 may define these macros and still not guarantee GNU inlining
  6313. semantics.
  6314. clang++ identifies itself as gcc-4.2, but has support for GNU inlining
  6315. semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and
  6316. __GNUC_GNU_INLINE__ macro definitions. */
  6317. /* GCC 4.3 and above allow passing all anonymous arguments of an
  6318. __extern_always_inline function to some other vararg function. */
  6319. /* It is possible to compile containing GCC extensions even if GCC is
  6320. run in pedantic mode if the uses are carefully marked using the
  6321. `__extension__' keyword. But this is not generally available before
  6322. version 2.8. */
  6323. /* __restrict is known in EGCS 1.2 and above, and in clang.
  6324. It works also in C++ mode (outside of arrays), but only when spelled
  6325. as '__restrict', not 'restrict'. */
  6326. /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
  6327. array_name[restrict]
  6328. GCC 3.1 and clang support this.
  6329. This syntax is not usable in C++ mode. */
  6330. /* Undefine (also defined in libc-symbols.h). */
  6331. /* Gnulib avoids including these, as they don't work on non-glibc or
  6332. older glibc platforms. */
  6333. /* Determine the wordsize from the preprocessor defines. */
  6334. /* Properties of long double type. ldbl-96 version.
  6335. Copyright (C) 2016-2022 Free Software Foundation, Inc.
  6336. This file is part of the GNU C Library.
  6337. The GNU C Library is free software; you can redistribute it and/or
  6338. modify it under the terms of the GNU Lesser General Public
  6339. License published by the Free Software Foundation; either
  6340. version 2.1 of the License, or (at your option) any later version.
  6341. The GNU C Library is distributed in the hope that it will be useful,
  6342. but WITHOUT ANY WARRANTY; without even the implied warranty of
  6343. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  6344. Lesser General Public License for more details.
  6345. You should have received a copy of the GNU Lesser General Public
  6346. License along with the GNU C Library; if not, see
  6347. <https://www.gnu.org/licenses/>. */
  6348. /* long double is distinct from double, so there is nothing to
  6349. define here. */
  6350. /* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is
  6351. intended for use in preprocessor macros.
  6352. Note: MESSAGE must be a _single_ string; concatenation of string
  6353. literals is not supported. */
  6354. /* Generic selection (ISO C11) is a C-only feature, available in GCC
  6355. since version 4.9. Previous versions do not provide generic
  6356. selection, even though they might set __STDC_VERSION__ to 201112L,
  6357. when in -std=c11 mode. Thus, we must check for !defined __GNUC__
  6358. when testing __STDC_VERSION__ for generic selection support.
  6359. On the other hand, Clang also defines __GNUC__, so a clang-specific
  6360. check is required to enable the use of generic selection. */
  6361. /* Specify that a function such as setjmp or vfork may return
  6362. twice. */
  6363. /*
  6364. * On non-glibc based systems, we cannot unconditionally use the
  6365. * __GLIBC_PREREQ macro as it gets expanded before evaluation.
  6366. */
  6367. /*
  6368. * Some kFreeBSD headers expect those macros to be set for sanity checks.
  6369. */
  6370. /* Linux headers define a struct with a member names __unused.
  6371. * Debian bugs: #522773 (linux), #522774 (libc).
  6372. * Disable for now. */
  6373. /*
  6374. * Return the number of elements in a statically-allocated array,
  6375. * __x.
  6376. */
  6377. /*
  6378. * We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
  6379. * require it.
  6380. */
  6381. /*
  6382. * Given the pointer x to the member m of the struct s, return
  6383. * a pointer to the containing structure. When using GCC, we first
  6384. * assign pointer x to a local variable, to check that its type is
  6385. * compatible with member m.
  6386. */
  6387. func Xlibbsd_MD5Init(tls *libc.TLS, context uintptr) {
  6388. libmd.XMD5Init(tls, context)
  6389. }
  6390. var _libbsd_emit_link_warning_MD5Init = [77]int8{'T', 'h', 'e', ' ', 'M', 'D', '5', 'I', 'n', 'i', 't', '(', ')', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'i', 'n', ' ', 'l', 'i', 'b', 'b', 's', 'd', ' ', 'i', 's', ' ', 'a', ' ', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', ' ', 'w', 'r', 'a', 'p', 'p', 'e', 'r', ',', ' ', 'u', 's', 'e', ' ', 'l', 'i', 'b', 'm', 'd', ' ', 'i', 'n', 's', 't', 'e', 'a', 'd', '.'}
  6391. func Xlibbsd_MD5Update(tls *libc.TLS, context uintptr, data uintptr, len1 Tsize_t) {
  6392. libmd.XMD5Update(tls, context, data, len1)
  6393. }
  6394. var _libbsd_emit_link_warning_MD5Update = [79]int8{'T', 'h', 'e', ' ', 'M', 'D', '5', 'U', 'p', 'd', 'a', 't', 'e', '(', ')', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'i', 'n', ' ', 'l', 'i', 'b', 'b', 's', 'd', ' ', 'i', 's', ' ', 'a', ' ', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', ' ', 'w', 'r', 'a', 'p', 'p', 'e', 'r', ',', ' ', 'u', 's', 'e', ' ', 'l', 'i', 'b', 'm', 'd', ' ', 'i', 'n', 's', 't', 'e', 'a', 'd', '.'}
  6395. func Xlibbsd_MD5Pad(tls *libc.TLS, context uintptr) {
  6396. libmd.XMD5Pad(tls, context)
  6397. }
  6398. var _libbsd_emit_link_warning_MD5Pad = [76]int8{'T', 'h', 'e', ' ', 'M', 'D', '5', 'P', 'a', 'd', '(', ')', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'i', 'n', ' ', 'l', 'i', 'b', 'b', 's', 'd', ' ', 'i', 's', ' ', 'a', ' ', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', ' ', 'w', 'r', 'a', 'p', 'p', 'e', 'r', ',', ' ', 'u', 's', 'e', ' ', 'l', 'i', 'b', 'm', 'd', ' ', 'i', 'n', 's', 't', 'e', 'a', 'd', '.'}
  6399. func Xlibbsd_MD5Final(tls *libc.TLS, digest uintptr, context uintptr) {
  6400. libmd.XMD5Final(tls, digest, context)
  6401. }
  6402. var _libbsd_emit_link_warning_MD5Final = [78]int8{'T', 'h', 'e', ' ', 'M', 'D', '5', 'F', 'i', 'n', 'a', 'l', '(', ')', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'i', 'n', ' ', 'l', 'i', 'b', 'b', 's', 'd', ' ', 'i', 's', ' ', 'a', ' ', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', ' ', 'w', 'r', 'a', 'p', 'p', 'e', 'r', ',', ' ', 'u', 's', 'e', ' ', 'l', 'i', 'b', 'm', 'd', ' ', 'i', 'n', 's', 't', 'e', 'a', 'd', '.'}
  6403. func Xlibbsd_MD5Transform(tls *libc.TLS, state uintptr, block uintptr) {
  6404. libmd.XMD5Transform(tls, state, block)
  6405. }
  6406. var _libbsd_emit_link_warning_MD5Transform = [82]int8{'T', 'h', 'e', ' ', 'M', 'D', '5', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', '(', ')', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'i', 'n', ' ', 'l', 'i', 'b', 'b', 's', 'd', ' ', 'i', 's', ' ', 'a', ' ', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', ' ', 'w', 'r', 'a', 'p', 'p', 'e', 'r', ',', ' ', 'u', 's', 'e', ' ', 'l', 'i', 'b', 'm', 'd', ' ', 'i', 'n', 's', 't', 'e', 'a', 'd', '.'}
  6407. func Xlibbsd_MD5End(tls *libc.TLS, context uintptr, buf uintptr) (r uintptr) {
  6408. return libmd.XMD5End(tls, context, buf)
  6409. }
  6410. var _libbsd_emit_link_warning_MD5End = [76]int8{'T', 'h', 'e', ' ', 'M', 'D', '5', 'E', 'n', 'd', '(', ')', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'i', 'n', ' ', 'l', 'i', 'b', 'b', 's', 'd', ' ', 'i', 's', ' ', 'a', ' ', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', ' ', 'w', 'r', 'a', 'p', 'p', 'e', 'r', ',', ' ', 'u', 's', 'e', ' ', 'l', 'i', 'b', 'm', 'd', ' ', 'i', 'n', 's', 't', 'e', 'a', 'd', '.'}
  6411. func Xlibbsd_MD5File(tls *libc.TLS, filename uintptr, buf uintptr) (r uintptr) {
  6412. return libmd.XMD5File(tls, filename, buf)
  6413. }
  6414. var _libbsd_emit_link_warning_MD5File = [77]int8{'T', 'h', 'e', ' ', 'M', 'D', '5', 'F', 'i', 'l', 'e', '(', ')', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'i', 'n', ' ', 'l', 'i', 'b', 'b', 's', 'd', ' ', 'i', 's', ' ', 'a', ' ', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', ' ', 'w', 'r', 'a', 'p', 'p', 'e', 'r', ',', ' ', 'u', 's', 'e', ' ', 'l', 'i', 'b', 'm', 'd', ' ', 'i', 'n', 's', 't', 'e', 'a', 'd', '.'}
  6415. func Xlibbsd_MD5FileChunk(tls *libc.TLS, filename uintptr, buf uintptr, offset Toff_t, length Toff_t) (r uintptr) {
  6416. return libmd.XMD5FileChunk(tls, filename, buf, offset, length)
  6417. }
  6418. var _libbsd_emit_link_warning_MD5FileChunk = [82]int8{'T', 'h', 'e', ' ', 'M', 'D', '5', 'F', 'i', 'l', 'e', 'C', 'h', 'u', 'n', 'k', '(', ')', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'i', 'n', ' ', 'l', 'i', 'b', 'b', 's', 'd', ' ', 'i', 's', ' ', 'a', ' ', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', ' ', 'w', 'r', 'a', 'p', 'p', 'e', 'r', ',', ' ', 'u', 's', 'e', ' ', 'l', 'i', 'b', 'm', 'd', ' ', 'i', 'n', 's', 't', 'e', 'a', 'd', '.'}
  6419. func Xlibbsd_MD5Data(tls *libc.TLS, data uintptr, len1 Tsize_t, buf uintptr) (r uintptr) {
  6420. return libmd.XMD5Data(tls, data, len1, buf)
  6421. }
  6422. var _libbsd_emit_link_warning_MD5Data = [77]int8{'T', 'h', 'e', ' ', 'M', 'D', '5', 'D', 'a', 't', 'a', '(', ')', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'i', 'n', ' ', 'l', 'i', 'b', 'b', 's', 'd', ' ', 'i', 's', ' ', 'a', ' ', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', ' ', 'w', 'r', 'a', 'p', 'p', 'e', 'r', ',', ' ', 'u', 's', 'e', ' ', 'l', 'i', 'b', 'm', 'd', ' ', 'i', 'n', 's', 't', 'e', 'a', 'd', '.'}
  6423. const m_THRESHOLD = 16
  6424. /*
  6425. * Find the next possible pointer head. (Trickery for forcing an array
  6426. * to do double duty as a linked list when objects do not align with word
  6427. * boundaries.
  6428. */
  6429. /* Assumption: PSIZE is a power of 2. */
  6430. // C documentation
  6431. //
  6432. // /*
  6433. // * Arguments are as for qsort.
  6434. // */
  6435. func Xmergesort(tls *libc.TLS, base uintptr, nmemb Tsize_t, size Tsize_t, cmp uintptr) (r int32) {
  6436. var b, f1, f2, l1, l2, last, list1, list2, p, p1, p2, q, t, tp2, v1, v10, v11, v12, v13, v15, v16, v18, v19, v21, v22, v24, v25, v26, v27, v28, v29, v4, v5 uintptr
  6437. var big, iflag, sense, v2 int32
  6438. var i, v8 Tsize_t
  6439. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = b, big, f1, f2, i, iflag, l1, l2, last, list1, list2, p, p1, p2, q, sense, t, tp2, v1, v10, v11, v12, v13, v15, v16, v18, v19, v2, v21, v22, v24, v25, v26, v27, v28, v29, v4, v5, v8
  6440. if size < libc.Uint32FromInt64(4)/libc.Uint32FromInt32(2) { /* Pointers must fit into 2 * size. */
  6441. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  6442. return -int32(1)
  6443. }
  6444. if nmemb == uint32(0) {
  6445. return 0
  6446. }
  6447. /*
  6448. * XXX
  6449. * Stupid subtraction for the Cray.
  6450. */
  6451. iflag = 0
  6452. if !(size%libc.Uint32FromInt64(4) != 0) && !(libc.Uint32FromInt32(int32(base)-int32(libc.UintptrFromInt32(0)))%libc.Uint32FromInt64(4) != 0) {
  6453. iflag = int32(1)
  6454. }
  6455. v1 = libc.Xmalloc(tls, nmemb*size+uint32(4))
  6456. list2 = v1
  6457. if v1 == libc.UintptrFromInt32(0) {
  6458. return -int32(1)
  6459. }
  6460. list1 = base
  6461. _setup(tls, list1, list2, nmemb, size, cmp)
  6462. last = list2 + uintptr(nmemb*size)
  6463. v2 = libc.Int32FromInt32(0)
  6464. big = v2
  6465. i = libc.Uint32FromInt32(v2)
  6466. for *(*uintptr)(unsafe.Pointer(libc.UintptrFromInt32(0) + uintptr(libc.Uint32FromInt32(int32(list2+libc.UintptrFromInt64(4)-libc.UintptrFromInt32(1))-int32(libc.UintptrFromInt32(0))) & ^(libc.Uint32FromInt64(4)-libc.Uint32FromInt32(1))))) != last {
  6467. l2 = list1
  6468. p1 = libc.UintptrFromInt32(0) + uintptr(libc.Uint32FromInt32(int32(list1+libc.UintptrFromInt64(4)-libc.UintptrFromInt32(1))-int32(libc.UintptrFromInt32(0))) & ^(libc.Uint32FromInt64(4)-libc.Uint32FromInt32(1)))
  6469. v4 = list2
  6470. p2 = v4
  6471. tp2 = v4
  6472. for {
  6473. if !(p2 != last) {
  6474. break
  6475. }
  6476. p2 = *(*uintptr)(unsafe.Pointer(libc.UintptrFromInt32(0) + uintptr(libc.Uint32FromInt32(int32(p2+libc.UintptrFromInt64(4)-libc.UintptrFromInt32(1))-int32(libc.UintptrFromInt32(0))) & ^(libc.Uint32FromInt64(4)-libc.Uint32FromInt32(1)))))
  6477. f1 = l2
  6478. v5 = list1 + uintptr(int32(p2)-int32(list2))
  6479. l1 = v5
  6480. f2 = v5
  6481. if p2 != last {
  6482. p2 = *(*uintptr)(unsafe.Pointer(libc.UintptrFromInt32(0) + uintptr(libc.Uint32FromInt32(int32(p2+libc.UintptrFromInt64(4)-libc.UintptrFromInt32(1))-int32(libc.UintptrFromInt32(0))) & ^(libc.Uint32FromInt64(4)-libc.Uint32FromInt32(1)))))
  6483. }
  6484. l2 = list1 + uintptr(int32(p2)-int32(list2))
  6485. for f1 < l1 && f2 < l2 {
  6486. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, f1, f2) <= 0 {
  6487. q = f2
  6488. b = f1
  6489. t = l1
  6490. sense = -int32(1)
  6491. } else {
  6492. q = f1
  6493. b = f2
  6494. t = l2
  6495. sense = 0
  6496. }
  6497. if !!(big != 0) {
  6498. goto _6
  6499. } /* here i = 0 */
  6500. for {
  6501. b += uintptr(size)
  6502. if !(b < t && (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, q, b) > sense) {
  6503. break
  6504. }
  6505. i++
  6506. v8 = i
  6507. if v8 == uint32(6) {
  6508. big = int32(1)
  6509. goto EXPONENTIAL
  6510. }
  6511. }
  6512. goto _7
  6513. _6:
  6514. ;
  6515. goto EXPONENTIAL
  6516. EXPONENTIAL:
  6517. ;
  6518. i = size
  6519. for {
  6520. v10 = b + uintptr(i)
  6521. p = v10
  6522. if v10 >= t {
  6523. v11 = t - uintptr(size)
  6524. p = v11
  6525. if v11 > b && (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, q, p) <= sense {
  6526. t = p
  6527. } else {
  6528. b = p
  6529. }
  6530. break
  6531. } else {
  6532. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, q, p) <= sense {
  6533. t = p
  6534. if i == size {
  6535. big = 0
  6536. }
  6537. goto FASTCASE
  6538. } else {
  6539. b = p
  6540. }
  6541. }
  6542. goto _9
  6543. _9:
  6544. ;
  6545. i <<= uint32(1)
  6546. }
  6547. for t > b+uintptr(size) {
  6548. i = libc.Uint32FromInt32(int32(t)-int32(b)) / size >> int32(1) * size
  6549. v12 = b + uintptr(i)
  6550. p = v12
  6551. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, q, v12) <= sense {
  6552. t = p
  6553. } else {
  6554. b = p
  6555. }
  6556. }
  6557. goto COPY
  6558. goto FASTCASE
  6559. FASTCASE:
  6560. ;
  6561. for i > size {
  6562. i >>= uint32(1)
  6563. v13 = b + uintptr(i)
  6564. p = v13
  6565. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, q, v13) <= sense {
  6566. t = p
  6567. } else {
  6568. b = p
  6569. }
  6570. }
  6571. goto COPY
  6572. COPY:
  6573. ;
  6574. b = t
  6575. _7:
  6576. ;
  6577. i = size
  6578. if q == f1 {
  6579. if iflag != 0 {
  6580. for cond := true; cond; cond = f2 < b {
  6581. *(*int32)(unsafe.Pointer(tp2)) = *(*int32)(unsafe.Pointer(f2))
  6582. f2 += uintptr(4)
  6583. tp2 += uintptr(4)
  6584. }
  6585. for {
  6586. *(*int32)(unsafe.Pointer(tp2)) = *(*int32)(unsafe.Pointer(f1))
  6587. f1 += uintptr(4)
  6588. tp2 += uintptr(4)
  6589. goto _14
  6590. _14:
  6591. ;
  6592. i -= uint32(4)
  6593. if !(i != 0) {
  6594. break
  6595. }
  6596. }
  6597. } else {
  6598. for cond := true; cond; cond = f2 < b {
  6599. v15 = tp2
  6600. tp2++
  6601. v16 = f2
  6602. f2++
  6603. *(*uint8)(unsafe.Pointer(v15)) = *(*uint8)(unsafe.Pointer(v16))
  6604. }
  6605. for {
  6606. v18 = tp2
  6607. tp2++
  6608. v19 = f1
  6609. f1++
  6610. *(*uint8)(unsafe.Pointer(v18)) = *(*uint8)(unsafe.Pointer(v19))
  6611. goto _17
  6612. _17:
  6613. ;
  6614. i -= uint32(1)
  6615. if !(i != 0) {
  6616. break
  6617. }
  6618. }
  6619. }
  6620. } else {
  6621. if iflag != 0 {
  6622. for cond := true; cond; cond = f1 < b {
  6623. *(*int32)(unsafe.Pointer(tp2)) = *(*int32)(unsafe.Pointer(f1))
  6624. f1 += uintptr(4)
  6625. tp2 += uintptr(4)
  6626. }
  6627. for {
  6628. *(*int32)(unsafe.Pointer(tp2)) = *(*int32)(unsafe.Pointer(f2))
  6629. f2 += uintptr(4)
  6630. tp2 += uintptr(4)
  6631. goto _20
  6632. _20:
  6633. ;
  6634. i -= uint32(4)
  6635. if !(i != 0) {
  6636. break
  6637. }
  6638. }
  6639. } else {
  6640. for cond := true; cond; cond = f1 < b {
  6641. v21 = tp2
  6642. tp2++
  6643. v22 = f1
  6644. f1++
  6645. *(*uint8)(unsafe.Pointer(v21)) = *(*uint8)(unsafe.Pointer(v22))
  6646. }
  6647. for {
  6648. v24 = tp2
  6649. tp2++
  6650. v25 = f2
  6651. f2++
  6652. *(*uint8)(unsafe.Pointer(v24)) = *(*uint8)(unsafe.Pointer(v25))
  6653. goto _23
  6654. _23:
  6655. ;
  6656. i -= uint32(1)
  6657. if !(i != 0) {
  6658. break
  6659. }
  6660. }
  6661. }
  6662. }
  6663. }
  6664. if f2 < l2 {
  6665. if iflag != 0 {
  6666. for cond := true; cond; cond = f2 < l2 {
  6667. *(*int32)(unsafe.Pointer(tp2)) = *(*int32)(unsafe.Pointer(f2))
  6668. f2 += uintptr(4)
  6669. tp2 += uintptr(4)
  6670. }
  6671. } else {
  6672. for cond := true; cond; cond = f2 < l2 {
  6673. v26 = tp2
  6674. tp2++
  6675. v27 = f2
  6676. f2++
  6677. *(*uint8)(unsafe.Pointer(v26)) = *(*uint8)(unsafe.Pointer(v27))
  6678. }
  6679. }
  6680. } else {
  6681. if f1 < l1 {
  6682. if iflag != 0 {
  6683. for cond := true; cond; cond = f1 < l1 {
  6684. *(*int32)(unsafe.Pointer(tp2)) = *(*int32)(unsafe.Pointer(f1))
  6685. f1 += uintptr(4)
  6686. tp2 += uintptr(4)
  6687. }
  6688. } else {
  6689. for cond := true; cond; cond = f1 < l1 {
  6690. v28 = tp2
  6691. tp2++
  6692. v29 = f1
  6693. f1++
  6694. *(*uint8)(unsafe.Pointer(v28)) = *(*uint8)(unsafe.Pointer(v29))
  6695. }
  6696. }
  6697. }
  6698. }
  6699. *(*uintptr)(unsafe.Pointer(p1)) = l2
  6700. goto _3
  6701. _3:
  6702. ;
  6703. p1 = libc.UintptrFromInt32(0) + uintptr(libc.Uint32FromInt32(int32(l2+libc.UintptrFromInt64(4)-libc.UintptrFromInt32(1))-int32(libc.UintptrFromInt32(0))) & ^(libc.Uint32FromInt64(4)-libc.Uint32FromInt32(1)))
  6704. }
  6705. tp2 = list1 /* swap list1, list2 */
  6706. list1 = list2
  6707. list2 = tp2
  6708. last = list2 + uintptr(nmemb*size)
  6709. }
  6710. if base == list2 {
  6711. libc.Xmemmove(tls, list2, list1, nmemb*size)
  6712. list2 = list1
  6713. }
  6714. libc.Xfree(tls, list2)
  6715. return 0
  6716. }
  6717. // C documentation
  6718. //
  6719. // /*
  6720. // * Optional hybrid natural/pairwise first pass. Eats up list1 in runs of
  6721. // * increasing order, list2 in a corresponding linked list. Checks for runs
  6722. // * when THRESHOLD/2 pairs compare with same sense. (Only used when NATURAL
  6723. // * is defined. Otherwise simple pairwise merging is used.)
  6724. // */
  6725. func _setup(tls *libc.TLS, list1 uintptr, list2 uintptr, n Tsize_t, size Tsize_t, cmp uintptr) {
  6726. var f1, f2, l2, last, p2, s, v10, v13, v14, v17, v18, v19, v20, v4, v7, v8 uintptr
  6727. var i, length, sense, size2, tmp, v11, v15, v5 int32
  6728. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = f1, f2, i, l2, last, length, p2, s, sense, size2, tmp, v10, v11, v13, v14, v15, v17, v18, v19, v20, v4, v5, v7, v8
  6729. size2 = libc.Int32FromUint32(size * uint32(2))
  6730. if n <= uint32(5) {
  6731. _insertionsort(tls, list1, n, size, cmp)
  6732. *(*uintptr)(unsafe.Pointer(libc.UintptrFromInt32(0) + uintptr(libc.Uint32FromInt32(int32(list2+libc.UintptrFromInt64(4)-libc.UintptrFromInt32(1))-int32(libc.UintptrFromInt32(0))) & ^(libc.Uint32FromInt64(4)-libc.Uint32FromInt32(1))))) = list2 + uintptr(n*size)
  6733. return
  6734. }
  6735. /*
  6736. * Avoid running pointers out of bounds; limit n to evens
  6737. * for simplicity.
  6738. */
  6739. i = libc.Int32FromUint32(uint32(4) + n&uint32(1))
  6740. _insertionsort(tls, list1+uintptr((n-libc.Uint32FromInt32(i))*size), libc.Uint32FromInt32(i), size, cmp)
  6741. last = list1 + uintptr(size*(n-libc.Uint32FromInt32(i)))
  6742. *(*uintptr)(unsafe.Pointer(libc.UintptrFromInt32(0) + uintptr(libc.Uint32FromInt32(int32(list2+uintptr(int32(last)-int32(list1))+libc.UintptrFromInt64(4)-libc.UintptrFromInt32(1))-int32(libc.UintptrFromInt32(0))) & ^(libc.Uint32FromInt64(4)-libc.Uint32FromInt32(1))))) = list2 + uintptr(n*size)
  6743. p2 = list2
  6744. f1 = list1
  6745. sense = libc.BoolInt32((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, f1, f1+uintptr(size)) > 0)
  6746. for {
  6747. if !(f1 < last) {
  6748. break
  6749. }
  6750. length = int32(2)
  6751. /* Find pairs with same sense. */
  6752. f2 = f1 + uintptr(size2)
  6753. for {
  6754. if !(f2 < last) {
  6755. break
  6756. }
  6757. if libc.BoolInt32((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, f2, f2+uintptr(size)) > 0) != sense {
  6758. break
  6759. }
  6760. length += int32(2)
  6761. goto _2
  6762. _2:
  6763. ;
  6764. f2 += uintptr(size2)
  6765. }
  6766. if length < int32(m_THRESHOLD) { /* Pairwise merge */
  6767. for {
  6768. v4 = uintptr(int32(f1+uintptr(size2))-int32(list1)) + list2
  6769. *(*uintptr)(unsafe.Pointer(libc.UintptrFromInt32(0) + uintptr(libc.Uint32FromInt32(int32(p2+libc.UintptrFromInt64(4)-libc.UintptrFromInt32(1))-int32(libc.UintptrFromInt32(0))) & ^(libc.Uint32FromInt64(4)-libc.Uint32FromInt32(1))))) = v4
  6770. p2 = v4
  6771. if sense > 0 {
  6772. s = f1 + uintptr(size)
  6773. i = libc.Int32FromUint32(size)
  6774. for {
  6775. tmp = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(f1)))
  6776. v7 = f1
  6777. f1++
  6778. *(*uint8)(unsafe.Pointer(v7)) = *(*uint8)(unsafe.Pointer(s))
  6779. v8 = s
  6780. s++
  6781. *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(tmp)
  6782. goto _6
  6783. _6:
  6784. ;
  6785. i--
  6786. v5 = i
  6787. if !(v5 != 0) {
  6788. break
  6789. }
  6790. }
  6791. f1 -= uintptr(size)
  6792. }
  6793. goto _3
  6794. _3:
  6795. ;
  6796. f1 += uintptr(size2)
  6797. if !(f1 < f2) {
  6798. break
  6799. }
  6800. }
  6801. } else { /* Natural merge */
  6802. l2 = f2
  6803. f2 = f1 + uintptr(size2)
  6804. for {
  6805. if !(f2 < l2) {
  6806. break
  6807. }
  6808. if libc.BoolInt32((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, f2-uintptr(size), f2) > 0) != sense {
  6809. v10 = uintptr(int32(f2)-int32(list1)) + list2
  6810. *(*uintptr)(unsafe.Pointer(libc.UintptrFromInt32(0) + uintptr(libc.Uint32FromInt32(int32(p2+libc.UintptrFromInt64(4)-libc.UintptrFromInt32(1))-int32(libc.UintptrFromInt32(0))) & ^(libc.Uint32FromInt64(4)-libc.Uint32FromInt32(1))))) = v10
  6811. p2 = v10
  6812. if sense > 0 {
  6813. s = f2 - uintptr(size)
  6814. for cond := true; cond; cond = f1 < s {
  6815. i = libc.Int32FromUint32(size)
  6816. for {
  6817. tmp = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(f1)))
  6818. v13 = f1
  6819. f1++
  6820. *(*uint8)(unsafe.Pointer(v13)) = *(*uint8)(unsafe.Pointer(s))
  6821. v14 = s
  6822. s++
  6823. *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(tmp)
  6824. goto _12
  6825. _12:
  6826. ;
  6827. i--
  6828. v11 = i
  6829. if !(v11 != 0) {
  6830. break
  6831. }
  6832. }
  6833. s -= uintptr(size2)
  6834. }
  6835. }
  6836. f1 = f2
  6837. }
  6838. goto _9
  6839. _9:
  6840. ;
  6841. f2 += uintptr(size2)
  6842. }
  6843. if sense > 0 {
  6844. s = f2 - uintptr(size)
  6845. for cond := true; cond; cond = f1 < s {
  6846. i = libc.Int32FromUint32(size)
  6847. for {
  6848. tmp = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(f1)))
  6849. v17 = f1
  6850. f1++
  6851. *(*uint8)(unsafe.Pointer(v17)) = *(*uint8)(unsafe.Pointer(s))
  6852. v18 = s
  6853. s++
  6854. *(*uint8)(unsafe.Pointer(v18)) = libc.Uint8FromInt32(tmp)
  6855. goto _16
  6856. _16:
  6857. ;
  6858. i--
  6859. v15 = i
  6860. if !(v15 != 0) {
  6861. break
  6862. }
  6863. }
  6864. s -= uintptr(size2)
  6865. }
  6866. }
  6867. f1 = f2
  6868. if f2 < last || (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, f2-uintptr(size), f2) > 0 {
  6869. v19 = uintptr(int32(f2)-int32(list1)) + list2
  6870. *(*uintptr)(unsafe.Pointer(libc.UintptrFromInt32(0) + uintptr(libc.Uint32FromInt32(int32(p2+libc.UintptrFromInt64(4)-libc.UintptrFromInt32(1))-int32(libc.UintptrFromInt32(0))) & ^(libc.Uint32FromInt64(4)-libc.Uint32FromInt32(1))))) = v19
  6871. p2 = v19
  6872. } else {
  6873. v20 = list2 + uintptr(n*size)
  6874. *(*uintptr)(unsafe.Pointer(libc.UintptrFromInt32(0) + uintptr(libc.Uint32FromInt32(int32(p2+libc.UintptrFromInt64(4)-libc.UintptrFromInt32(1))-int32(libc.UintptrFromInt32(0))) & ^(libc.Uint32FromInt64(4)-libc.Uint32FromInt32(1))))) = v20
  6875. p2 = v20
  6876. }
  6877. }
  6878. goto _1
  6879. _1:
  6880. ;
  6881. sense = libc.BoolInt32(!(sense != 0))
  6882. }
  6883. }
  6884. // C documentation
  6885. //
  6886. // /*
  6887. // * This is to avoid out-of-bounds addresses in sorting the
  6888. // * last 4 elements.
  6889. // */
  6890. func _insertionsort(tls *libc.TLS, a uintptr, n Tsize_t, size Tsize_t, cmp uintptr) {
  6891. var ai, s, t, u, v6, v7 uintptr
  6892. var i, v4 int32
  6893. var tmp uint8
  6894. var v2 Tsize_t
  6895. _, _, _, _, _, _, _, _, _, _ = ai, i, s, t, tmp, u, v2, v4, v6, v7
  6896. ai = a + uintptr(size)
  6897. for {
  6898. n--
  6899. v2 = n
  6900. if !(v2 >= uint32(1)) {
  6901. break
  6902. }
  6903. t = ai
  6904. for {
  6905. if !(t > a) {
  6906. break
  6907. }
  6908. u = t - uintptr(size)
  6909. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, u, t) <= 0 {
  6910. break
  6911. }
  6912. s = t
  6913. i = libc.Int32FromUint32(size)
  6914. for {
  6915. tmp = *(*uint8)(unsafe.Pointer(u))
  6916. v6 = u
  6917. u++
  6918. *(*uint8)(unsafe.Pointer(v6)) = *(*uint8)(unsafe.Pointer(s))
  6919. v7 = s
  6920. s++
  6921. *(*uint8)(unsafe.Pointer(v7)) = tmp
  6922. goto _5
  6923. _5:
  6924. ;
  6925. i--
  6926. v4 = i
  6927. if !(v4 != 0) {
  6928. break
  6929. }
  6930. }
  6931. u -= uintptr(size)
  6932. goto _3
  6933. _3:
  6934. ;
  6935. t -= uintptr(size)
  6936. }
  6937. goto _1
  6938. _1:
  6939. ;
  6940. ai += uintptr(size)
  6941. }
  6942. }
  6943. const m_AT_BASE = 7
  6944. const m_AT_BASE_PLATFORM = 24
  6945. const m_AT_CLKTCK = 17
  6946. const m_AT_DCACHEBSIZE = 19
  6947. const m_AT_EGID = 14
  6948. const m_AT_ENTRY = 9
  6949. const m_AT_EUID = 12
  6950. const m_AT_EXECFD = 2
  6951. const m_AT_EXECFN = 31
  6952. const m_AT_FLAGS = 8
  6953. const m_AT_FPUCW = 18
  6954. const m_AT_GID = 13
  6955. const m_AT_HWCAP = 16
  6956. const m_AT_HWCAP2 = 26
  6957. const m_AT_ICACHEBSIZE = 20
  6958. const m_AT_IGNORE = 1
  6959. const m_AT_IGNOREPPC = 22
  6960. const m_AT_L1D_CACHEGEOMETRY = 43
  6961. const m_AT_L1D_CACHESHAPE = 35
  6962. const m_AT_L1D_CACHESIZE = 42
  6963. const m_AT_L1I_CACHEGEOMETRY = 41
  6964. const m_AT_L1I_CACHESHAPE = 34
  6965. const m_AT_L1I_CACHESIZE = 40
  6966. const m_AT_L2_CACHEGEOMETRY = 45
  6967. const m_AT_L2_CACHESHAPE = 36
  6968. const m_AT_L2_CACHESIZE = 44
  6969. const m_AT_L3_CACHEGEOMETRY = 47
  6970. const m_AT_L3_CACHESHAPE = 37
  6971. const m_AT_L3_CACHESIZE = 46
  6972. const m_AT_MINSIGSTKSZ = 51
  6973. const m_AT_NOTELF = 10
  6974. const m_AT_NULL = 0
  6975. const m_AT_PAGESZ = 6
  6976. const m_AT_PHDR = 3
  6977. const m_AT_PHENT = 4
  6978. const m_AT_PHNUM = 5
  6979. const m_AT_PLATFORM = 15
  6980. const m_AT_RANDOM = 25
  6981. const m_AT_SECURE = 23
  6982. const m_AT_SYSINFO = 32
  6983. const m_AT_SYSINFO_EHDR = 33
  6984. const m_AT_UCACHEBSIZE = 21
  6985. const m_AT_UID = 11
  6986. const m_AUX_FUNC = 2
  6987. const m_AUX_OBJECT = 1
  6988. const m_BIND_WEAK = 2
  6989. const m_DF_1_CONFALT = 0x00002000
  6990. const m_DF_1_DIRECT = 0x00000100
  6991. const m_DF_1_DISPRELDNE = 0x00008000
  6992. const m_DF_1_DISPRELPND = 0x00010000
  6993. const m_DF_1_EDITED = 0x00200000
  6994. const m_DF_1_ENDFILTEE = 0x00004000
  6995. const m_DF_1_GLOBAL = 0x00000002
  6996. const m_DF_1_GLOBAUDIT = 0x01000000
  6997. const m_DF_1_GROUP = 0x00000004
  6998. const m_DF_1_IGNMULDEF = 0x00040000
  6999. const m_DF_1_INITFIRST = 0x00000020
  7000. const m_DF_1_INTERPOSE = 0x00000400
  7001. const m_DF_1_LOADFLTR = 0x00000010
  7002. const m_DF_1_NODEFLIB = 0x00000800
  7003. const m_DF_1_NODELETE = 0x00000008
  7004. const m_DF_1_NODIRECT = 0x00020000
  7005. const m_DF_1_NODUMP = 0x00001000
  7006. const m_DF_1_NOHDR = 0x00100000
  7007. const m_DF_1_NOKSYMS = 0x00080000
  7008. const m_DF_1_NOOPEN = 0x00000040
  7009. const m_DF_1_NORELOC = 0x00400000
  7010. const m_DF_1_NOW = 0x00000001
  7011. const m_DF_1_ORIGIN = 0x00000080
  7012. const m_DF_1_PIE = 0x08000000
  7013. const m_DF_1_SINGLETON = 0x02000000
  7014. const m_DF_1_STUB = 0x04000000
  7015. const m_DF_1_SYMINTPOSE = 0x00800000
  7016. const m_DF_1_TRANS = 0x00000200
  7017. const m_DF_BIND_NOW = 0x00000008
  7018. const m_DF_ORIGIN = 0x00000001
  7019. const m_DF_P1_GROUPPERM = 0x00000002
  7020. const m_DF_P1_LAZYLOAD = 0x00000001
  7021. const m_DF_STATIC_TLS = 0x00000010
  7022. const m_DF_SYMBOLIC = 0x00000002
  7023. const m_DF_TEXTREL = 0x00000004
  7024. const m_DTF_1_CONFEXP = 0x00000002
  7025. const m_DTF_1_PARINIT = 0x00000001
  7026. const m_DT_ADDRNUM = 11
  7027. const m_DT_ADDRRNGHI = 0x6ffffeff
  7028. const m_DT_ADDRRNGLO = 0x6ffffe00
  7029. const m_DT_ALPHA_NUM = 1
  7030. const m_DT_AUDIT = 0x6ffffefc
  7031. const m_DT_AUXILIARY = 0x7ffffffd
  7032. const m_DT_BIND_NOW = 24
  7033. const m_DT_CHECKSUM = 0x6ffffdf8
  7034. const m_DT_CONFIG = 0x6ffffefa
  7035. const m_DT_DEBUG = 21
  7036. const m_DT_DEPAUDIT = 0x6ffffefb
  7037. const m_DT_ENCODING = 32
  7038. const m_DT_EXTRANUM = 3
  7039. const m_DT_FEATURE_1 = 0x6ffffdfc
  7040. const m_DT_FILTER = 0x7fffffff
  7041. const m_DT_FINI = 13
  7042. const m_DT_FINI_ARRAY = 26
  7043. const m_DT_FINI_ARRAYSZ = 28
  7044. const m_DT_FLAGS = 30
  7045. const m_DT_FLAGS_1 = 0x6ffffffb
  7046. const m_DT_GNU_CONFLICT = 0x6ffffef8
  7047. const m_DT_GNU_CONFLICTSZ = 0x6ffffdf6
  7048. const m_DT_GNU_HASH = 0x6ffffef5
  7049. const m_DT_GNU_LIBLIST = 0x6ffffef9
  7050. const m_DT_GNU_LIBLISTSZ = 0x6ffffdf7
  7051. const m_DT_GNU_PRELINKED = 0x6ffffdf5
  7052. const m_DT_HASH = 4
  7053. const m_DT_HIOS = 0x6ffff000
  7054. const m_DT_HIPROC = 0x7fffffff
  7055. const m_DT_IA_64_NUM = 1
  7056. const m_DT_INIT = 12
  7057. const m_DT_INIT_ARRAY = 25
  7058. const m_DT_INIT_ARRAYSZ = 27
  7059. const m_DT_JMPREL = 23
  7060. const m_DT_LOOS = 0x6000000d
  7061. const m_DT_LOPROC = 0x70000000
  7062. const m_DT_MIPS_AUX_DYNAMIC = 0x70000031
  7063. const m_DT_MIPS_BASE_ADDRESS = 0x70000006
  7064. const m_DT_MIPS_COMPACT_SIZE = 0x7000002f
  7065. const m_DT_MIPS_CONFLICT = 0x70000008
  7066. const m_DT_MIPS_CONFLICTNO = 0x7000000b
  7067. const m_DT_MIPS_CXX_FLAGS = 0x70000022
  7068. const m_DT_MIPS_DELTA_CLASS = 0x70000017
  7069. const m_DT_MIPS_DELTA_CLASSSYM = 0x70000020
  7070. const m_DT_MIPS_DELTA_CLASSSYM_NO = 0x70000021
  7071. const m_DT_MIPS_DELTA_CLASS_NO = 0x70000018
  7072. const m_DT_MIPS_DELTA_INSTANCE = 0x70000019
  7073. const m_DT_MIPS_DELTA_INSTANCE_NO = 0x7000001a
  7074. const m_DT_MIPS_DELTA_RELOC = 0x7000001b
  7075. const m_DT_MIPS_DELTA_RELOC_NO = 0x7000001c
  7076. const m_DT_MIPS_DELTA_SYM = 0x7000001d
  7077. const m_DT_MIPS_DELTA_SYM_NO = 0x7000001e
  7078. const m_DT_MIPS_DYNSTR_ALIGN = 0x7000002b
  7079. const m_DT_MIPS_FLAGS = 0x70000005
  7080. const m_DT_MIPS_GOTSYM = 0x70000013
  7081. const m_DT_MIPS_GP_VALUE = 0x70000030
  7082. const m_DT_MIPS_HIDDEN_GOTIDX = 0x70000027
  7083. const m_DT_MIPS_HIPAGENO = 0x70000014
  7084. const m_DT_MIPS_ICHECKSUM = 0x70000003
  7085. const m_DT_MIPS_INTERFACE = 0x7000002a
  7086. const m_DT_MIPS_INTERFACE_SIZE = 0x7000002c
  7087. const m_DT_MIPS_IVERSION = 0x70000004
  7088. const m_DT_MIPS_LIBLIST = 0x70000009
  7089. const m_DT_MIPS_LIBLISTNO = 0x70000010
  7090. const m_DT_MIPS_LOCALPAGE_GOTIDX = 0x70000025
  7091. const m_DT_MIPS_LOCAL_GOTIDX = 0x70000026
  7092. const m_DT_MIPS_LOCAL_GOTNO = 0x7000000a
  7093. const m_DT_MIPS_MSYM = 0x70000007
  7094. const m_DT_MIPS_NUM = 0x36
  7095. const m_DT_MIPS_OPTIONS = 0x70000029
  7096. const m_DT_MIPS_PERF_SUFFIX = 0x7000002e
  7097. const m_DT_MIPS_PIXIE_INIT = 0x70000023
  7098. const m_DT_MIPS_PLTGOT = 0x70000032
  7099. const m_DT_MIPS_PROTECTED_GOTIDX = 0x70000028
  7100. const m_DT_MIPS_RLD_MAP = 0x70000016
  7101. const m_DT_MIPS_RLD_MAP_REL = 0x70000035
  7102. const m_DT_MIPS_RLD_TEXT_RESOLVE_ADDR = 0x7000002d
  7103. const m_DT_MIPS_RLD_VERSION = 0x70000001
  7104. const m_DT_MIPS_RWPLT = 0x70000034
  7105. const m_DT_MIPS_SYMBOL_LIB = 0x70000024
  7106. const m_DT_MIPS_SYMTABNO = 0x70000011
  7107. const m_DT_MIPS_TIME_STAMP = 0x70000002
  7108. const m_DT_MIPS_UNREFEXTNO = 0x70000012
  7109. const m_DT_MOVEENT = 0x6ffffdfa
  7110. const m_DT_MOVESZ = 0x6ffffdfb
  7111. const m_DT_MOVETAB = 0x6ffffefe
  7112. const m_DT_NEEDED = 1
  7113. const m_DT_NIOS2_GP = 0x70000002
  7114. const m_DT_NULL = 0
  7115. const m_DT_NUM = 38
  7116. const m_DT_PLTGOT = 3
  7117. const m_DT_PLTPAD = 0x6ffffefd
  7118. const m_DT_PLTPADSZ = 0x6ffffdf9
  7119. const m_DT_PLTREL = 20
  7120. const m_DT_PLTRELSZ = 2
  7121. const m_DT_POSFLAG_1 = 0x6ffffdfd
  7122. const m_DT_PPC64_NUM = 4
  7123. const m_DT_PPC_NUM = 2
  7124. const m_DT_PREINIT_ARRAY = 32
  7125. const m_DT_PREINIT_ARRAYSZ = 33
  7126. const m_DT_PROCNUM = "DT_MIPS_NUM"
  7127. const m_DT_REL = 17
  7128. const m_DT_RELA = 7
  7129. const m_DT_RELACOUNT = 0x6ffffff9
  7130. const m_DT_RELAENT = 9
  7131. const m_DT_RELASZ = 8
  7132. const m_DT_RELCOUNT = 0x6ffffffa
  7133. const m_DT_RELENT = 19
  7134. const m_DT_RELR = 36
  7135. const m_DT_RELRENT = 37
  7136. const m_DT_RELRSZ = 35
  7137. const m_DT_RELSZ = 18
  7138. const m_DT_RPATH = 15
  7139. const m_DT_RUNPATH = 29
  7140. const m_DT_SONAME = 14
  7141. const m_DT_SPARC_NUM = 2
  7142. const m_DT_SPARC_REGISTER = 0x70000001
  7143. const m_DT_STRSZ = 10
  7144. const m_DT_STRTAB = 5
  7145. const m_DT_SYMBOLIC = 16
  7146. const m_DT_SYMENT = 11
  7147. const m_DT_SYMINENT = 0x6ffffdff
  7148. const m_DT_SYMINFO = 0x6ffffeff
  7149. const m_DT_SYMINSZ = 0x6ffffdfe
  7150. const m_DT_SYMTAB = 6
  7151. const m_DT_SYMTAB_SHNDX = 34
  7152. const m_DT_TEXTREL = 22
  7153. const m_DT_TLSDESC_GOT = 0x6ffffef7
  7154. const m_DT_TLSDESC_PLT = 0x6ffffef6
  7155. const m_DT_VALNUM = 12
  7156. const m_DT_VALRNGHI = 0x6ffffdff
  7157. const m_DT_VALRNGLO = 0x6ffffd00
  7158. const m_DT_VERDEF = 0x6ffffffc
  7159. const m_DT_VERDEFNUM = 0x6ffffffd
  7160. const m_DT_VERNEED = 0x6ffffffe
  7161. const m_DT_VERNEEDNUM = 0x6fffffff
  7162. const m_DT_VERSIONTAGNUM = 16
  7163. const m_DT_VERSYM = 0x6ffffff0
  7164. const m_EFA_PARISC_1_0 = 0x020b
  7165. const m_EFA_PARISC_1_1 = 0x0210
  7166. const m_EFA_PARISC_2_0 = 0x0214
  7167. const m_EF_ALPHA_32BIT = 1
  7168. const m_EF_ALPHA_CANRELAX = 2
  7169. const m_EF_ARM_ABI_FLOAT_HARD = 0x400
  7170. const m_EF_ARM_ABI_FLOAT_SOFT = 0x200
  7171. const m_EF_ARM_ALIGN8 = 0x40
  7172. const m_EF_ARM_APCS_26 = 0x08
  7173. const m_EF_ARM_APCS_FLOAT = 0x10
  7174. const m_EF_ARM_BE8 = 0x00800000
  7175. const m_EF_ARM_DYNSYMSUSESEGIDX = 0x08
  7176. const m_EF_ARM_EABIMASK = 0xFF000000
  7177. const m_EF_ARM_EABI_UNKNOWN = 0x00000000
  7178. const m_EF_ARM_EABI_VER1 = 0x01000000
  7179. const m_EF_ARM_EABI_VER2 = 0x02000000
  7180. const m_EF_ARM_EABI_VER3 = 0x03000000
  7181. const m_EF_ARM_EABI_VER4 = 0x04000000
  7182. const m_EF_ARM_EABI_VER5 = 0x05000000
  7183. const m_EF_ARM_HASENTRY = 0x02
  7184. const m_EF_ARM_INTERWORK = 0x04
  7185. const m_EF_ARM_LE8 = 0x00400000
  7186. const m_EF_ARM_MAPSYMSFIRST = 0x10
  7187. const m_EF_ARM_MAVERICK_FLOAT = 0x800
  7188. const m_EF_ARM_NEW_ABI = 0x80
  7189. const m_EF_ARM_OLD_ABI = 0x100
  7190. const m_EF_ARM_PIC = 0x20
  7191. const m_EF_ARM_RELEXEC = 0x01
  7192. const m_EF_ARM_SOFT_FLOAT = 0x200
  7193. const m_EF_ARM_SYMSARESORTED = 0x04
  7194. const m_EF_ARM_VFP_FLOAT = 0x400
  7195. const m_EF_CPU32 = 0x00810000
  7196. const m_EF_IA_64_ABI64 = 0x00000010
  7197. const m_EF_IA_64_ARCH = 0xff000000
  7198. const m_EF_IA_64_MASKOS = 0x0000000f
  7199. const m_EF_LARCH_ABI_DOUBLE_FLOAT = 0x03
  7200. const m_EF_LARCH_ABI_MODIFIER_MASK = 0x07
  7201. const m_EF_LARCH_ABI_SINGLE_FLOAT = 0x02
  7202. const m_EF_LARCH_ABI_SOFT_FLOAT = 0x01
  7203. const m_EF_LARCH_OBJABI_V1 = 0x40
  7204. const m_EF_MIPS_64BIT_WHIRL = 16
  7205. const m_EF_MIPS_ABI2 = 32
  7206. const m_EF_MIPS_ABI_ON32 = 64
  7207. const m_EF_MIPS_ARCH = 0xf0000000
  7208. const m_EF_MIPS_ARCH_1 = 0x00000000
  7209. const m_EF_MIPS_ARCH_2 = 0x10000000
  7210. const m_EF_MIPS_ARCH_3 = 0x20000000
  7211. const m_EF_MIPS_ARCH_32 = 0x50000000
  7212. const m_EF_MIPS_ARCH_32R2 = 0x70000000
  7213. const m_EF_MIPS_ARCH_4 = 0x30000000
  7214. const m_EF_MIPS_ARCH_5 = 0x40000000
  7215. const m_EF_MIPS_ARCH_64 = 0x60000000
  7216. const m_EF_MIPS_ARCH_64R2 = 0x80000000
  7217. const m_EF_MIPS_CPIC = 4
  7218. const m_EF_MIPS_FP64 = 512
  7219. const m_EF_MIPS_NAN2008 = 1024
  7220. const m_EF_MIPS_NOREORDER = 1
  7221. const m_EF_MIPS_PIC = 2
  7222. const m_EF_MIPS_XGOT = 8
  7223. const m_EF_PARISC_ARCH = 0x0000ffff
  7224. const m_EF_PARISC_EXT = 0x00020000
  7225. const m_EF_PARISC_LAZYSWAP = 0x00400000
  7226. const m_EF_PARISC_LSB = 0x00040000
  7227. const m_EF_PARISC_NO_KABP = 0x00100000
  7228. const m_EF_PARISC_TRAPNIL = 0x00010000
  7229. const m_EF_PARISC_WIDE = 0x00080000
  7230. const m_EF_PPC64_ABI = 3
  7231. const m_EF_PPC_EMB = 0x80000000
  7232. const m_EF_PPC_RELOCATABLE = 0x00010000
  7233. const m_EF_PPC_RELOCATABLE_LIB = 0x00008000
  7234. const m_EF_SH1 = 0x1
  7235. const m_EF_SH2 = 0x2
  7236. const m_EF_SH2A = 0xd
  7237. const m_EF_SH2A_NOFPU = 0x13
  7238. const m_EF_SH2A_SH3E = 0x18
  7239. const m_EF_SH2A_SH3_NOFPU = 0x16
  7240. const m_EF_SH2A_SH4 = 0x17
  7241. const m_EF_SH2A_SH4_NOFPU = 0x15
  7242. const m_EF_SH2E = 0xb
  7243. const m_EF_SH3 = 0x3
  7244. const m_EF_SH3E = 0x8
  7245. const m_EF_SH3_DSP = 0x5
  7246. const m_EF_SH3_NOMMU = 0x14
  7247. const m_EF_SH4 = 0x9
  7248. const m_EF_SH4A = 0xc
  7249. const m_EF_SH4AL_DSP = 0x6
  7250. const m_EF_SH4A_NOFPU = 0x11
  7251. const m_EF_SH4_NOFPU = 0x10
  7252. const m_EF_SH4_NOMMU_NOFPU = 0x12
  7253. const m_EF_SH_DSP = 0x4
  7254. const m_EF_SH_MACH_MASK = 0x1f
  7255. const m_EF_SH_UNKNOWN = 0x0
  7256. const m_EF_SPARCV9_MM = 3
  7257. const m_EF_SPARCV9_PSO = 1
  7258. const m_EF_SPARCV9_RMO = 2
  7259. const m_EF_SPARCV9_TSO = 0
  7260. const m_EF_SPARC_32PLUS = 0x000100
  7261. const m_EF_SPARC_EXT_MASK = 0xFFFF00
  7262. const m_EF_SPARC_HAL_R1 = 0x000400
  7263. const m_EF_SPARC_LEDATA = 0x800000
  7264. const m_EF_SPARC_SUN_US1 = 0x000200
  7265. const m_EF_SPARC_SUN_US3 = 0x000800
  7266. const m_EI_ABIVERSION = 8
  7267. const m_EI_CLASS = 4
  7268. const m_EI_DATA = 5
  7269. const m_EI_MAG0 = 0
  7270. const m_EI_MAG1 = 1
  7271. const m_EI_MAG2 = 2
  7272. const m_EI_MAG3 = 3
  7273. const m_EI_NIDENT = 16
  7274. const m_EI_OSABI = 7
  7275. const m_EI_PAD = 9
  7276. const m_EI_VERSION = 6
  7277. const m_ELFCLASS32 = 1
  7278. const m_ELFCLASS64 = 2
  7279. const m_ELFCLASSNONE = 0
  7280. const m_ELFCLASSNUM = 3
  7281. const m_ELFCOMPRESS_HIOS = 0x6fffffff
  7282. const m_ELFCOMPRESS_HIPROC = 0x7fffffff
  7283. const m_ELFCOMPRESS_LOOS = 0x60000000
  7284. const m_ELFCOMPRESS_LOPROC = 0x70000000
  7285. const m_ELFCOMPRESS_ZLIB = 1
  7286. const m_ELFCOMPRESS_ZSTD = 2
  7287. const m_ELFDATA2LSB = 1
  7288. const m_ELFDATA2MSB = 2
  7289. const m_ELFDATANONE = 0
  7290. const m_ELFDATANUM = 3
  7291. const m_ELFMAG = "\\177ELF"
  7292. const m_ELFMAG0 = 127
  7293. const m_ELFMAG1 = 69
  7294. const m_ELFMAG2 = 76
  7295. const m_ELFMAG3 = 70
  7296. const m_ELFOSABI_AIX = 7
  7297. const m_ELFOSABI_ARM = 97
  7298. const m_ELFOSABI_FREEBSD = 9
  7299. const m_ELFOSABI_GNU = 3
  7300. const m_ELFOSABI_HPUX = 1
  7301. const m_ELFOSABI_IRIX = 8
  7302. const m_ELFOSABI_LINUX = 3
  7303. const m_ELFOSABI_MODESTO = 11
  7304. const m_ELFOSABI_NETBSD = 2
  7305. const m_ELFOSABI_NONE = 0
  7306. const m_ELFOSABI_OPENBSD = 12
  7307. const m_ELFOSABI_SOLARIS = 6
  7308. const m_ELFOSABI_STANDALONE = 255
  7309. const m_ELFOSABI_SYSV = 0
  7310. const m_ELFOSABI_TRU64 = 10
  7311. const m_ELF_NOTE_ABI = "NT_GNU_ABI_TAG"
  7312. const m_ELF_NOTE_GNU = "GNU"
  7313. const m_ELF_NOTE_OS_FREEBSD = 3
  7314. const m_ELF_NOTE_OS_GNU = 1
  7315. const m_ELF_NOTE_OS_LINUX = 0
  7316. const m_ELF_NOTE_OS_SOLARIS2 = 2
  7317. const m_ELF_NOTE_PAGESIZE_HINT = 1
  7318. const m_ELF_NOTE_SOLARIS = "SUNW Solaris"
  7319. const m_ELF_ST_BIND = "ELF32_ST_BIND"
  7320. const m_ELF_ST_TYPE = "ELF32_ST_TYPE"
  7321. const m_ELF_TARG_CLASS = "ELFCLASS32"
  7322. const m_ELF_TARG_DATA = "ELFDATA2LSB"
  7323. const m_ELF_TARG_MACH = "EM_386"
  7324. const m_ELF_TARG_VER = "EV_CURRENT"
  7325. const m_EM_386 = 3
  7326. const m_EM_56800EX = 200
  7327. const m_EM_68HC05 = 72
  7328. const m_EM_68HC08 = 71
  7329. const m_EM_68HC11 = 70
  7330. const m_EM_68HC12 = 53
  7331. const m_EM_68HC16 = 69
  7332. const m_EM_68K = 4
  7333. const m_EM_78KOR = 199
  7334. const m_EM_8051 = 165
  7335. const m_EM_860 = 7
  7336. const m_EM_88K = 5
  7337. const m_EM_960 = 19
  7338. const m_EM_AARCH64 = 183
  7339. const m_EM_ALPHA = 0x9026
  7340. const m_EM_ALTERA_NIOS2 = 113
  7341. const m_EM_AMDGPU = 224
  7342. const m_EM_ARC = 45
  7343. const m_EM_ARCA = 109
  7344. const m_EM_ARC_A5 = 93
  7345. const m_EM_ARC_COMPACT = 93
  7346. const m_EM_ARC_COMPACT2 = 195
  7347. const m_EM_ARM = 40
  7348. const m_EM_AVR = 83
  7349. const m_EM_AVR32 = 185
  7350. const m_EM_BA1 = 201
  7351. const m_EM_BA2 = 202
  7352. const m_EM_BLACKFIN = 106
  7353. const m_EM_BPF = 247
  7354. const m_EM_C166 = 116
  7355. const m_EM_CDP = 215
  7356. const m_EM_CE = 119
  7357. const m_EM_CLOUDSHIELD = 192
  7358. const m_EM_COGE = 216
  7359. const m_EM_COLDFIRE = 52
  7360. const m_EM_COOL = 217
  7361. const m_EM_COREA_1ST = 193
  7362. const m_EM_COREA_2ND = 194
  7363. const m_EM_CR = 103
  7364. const m_EM_CR16 = 177
  7365. const m_EM_CRAYNV2 = 172
  7366. const m_EM_CRIS = 76
  7367. const m_EM_CRX = 114
  7368. const m_EM_CSKY = 252
  7369. const m_EM_CSR_KALIMBA = 219
  7370. const m_EM_CUDA = 190
  7371. const m_EM_CYPRESS_M8C = 161
  7372. const m_EM_D10V = 85
  7373. const m_EM_D30V = 86
  7374. const m_EM_DSP24 = 136
  7375. const m_EM_DSPIC30F = 118
  7376. const m_EM_DXP = 112
  7377. const m_EM_ECOG16 = 176
  7378. const m_EM_ECOG1X = 168
  7379. const m_EM_ECOG2 = 134
  7380. const m_EM_EMX16 = 212
  7381. const m_EM_EMX8 = 213
  7382. const m_EM_ETPU = 178
  7383. const m_EM_EXCESS = 111
  7384. const m_EM_F2MC16 = 104
  7385. const m_EM_FAKE_ALPHA = 41
  7386. const m_EM_FIREPATH = 78
  7387. const m_EM_FR20 = 37
  7388. const m_EM_FR30 = 84
  7389. const m_EM_FT32 = 222
  7390. const m_EM_FX66 = 66
  7391. const m_EM_H8S = 48
  7392. const m_EM_H8_300 = 46
  7393. const m_EM_H8_300H = 47
  7394. const m_EM_H8_500 = 49
  7395. const m_EM_HUANY = 81
  7396. const m_EM_IA_64 = 50
  7397. const m_EM_IP2K = 101
  7398. const m_EM_JAVELIN = 77
  7399. const m_EM_K10M = 181
  7400. const m_EM_KM32 = 210
  7401. const m_EM_KMX32 = 211
  7402. const m_EM_KVARC = 214
  7403. const m_EM_L10M = 180
  7404. const m_EM_LATTICEMICO32 = 138
  7405. const m_EM_LOONGARCH = 258
  7406. const m_EM_M16C = 117
  7407. const m_EM_M32 = 1
  7408. const m_EM_M32C = 120
  7409. const m_EM_M32R = 88
  7410. const m_EM_MANIK = 171
  7411. const m_EM_MAX = 102
  7412. const m_EM_MAXQ30 = 169
  7413. const m_EM_MCHP_PIC = 204
  7414. const m_EM_MCST_ELBRUS = 175
  7415. const m_EM_ME16 = 59
  7416. const m_EM_METAG = 174
  7417. const m_EM_MICROBLAZE = 189
  7418. const m_EM_MIPS = 8
  7419. const m_EM_MIPS_RS3_LE = 10
  7420. const m_EM_MIPS_X = 51
  7421. const m_EM_MMA = 54
  7422. const m_EM_MMDSP_PLUS = 160
  7423. const m_EM_MMIX = 80
  7424. const m_EM_MN10200 = 90
  7425. const m_EM_MN10300 = 89
  7426. const m_EM_MOXIE = 223
  7427. const m_EM_MSP430 = 105
  7428. const m_EM_NCPU = 56
  7429. const m_EM_NDR1 = 57
  7430. const m_EM_NDS32 = 167
  7431. const m_EM_NONE = 0
  7432. const m_EM_NORC = 218
  7433. const m_EM_NS32K = 97
  7434. const m_EM_NUM = 259
  7435. const m_EM_OPEN8 = 196
  7436. const m_EM_OPENRISC = 92
  7437. const m_EM_OR1K = 92
  7438. const m_EM_PARISC = 15
  7439. const m_EM_PCP = 55
  7440. const m_EM_PDSP = 63
  7441. const m_EM_PJ = 91
  7442. const m_EM_PPC = 20
  7443. const m_EM_PPC64 = 21
  7444. const m_EM_PRISM = 82
  7445. const m_EM_QDSP6 = 164
  7446. const m_EM_R32C = 162
  7447. const m_EM_RCE = 39
  7448. const m_EM_RH32 = 38
  7449. const m_EM_RISCV = 243
  7450. const m_EM_RL78 = 197
  7451. const m_EM_RS08 = 132
  7452. const m_EM_RX = 173
  7453. const m_EM_S370 = 9
  7454. const m_EM_S390 = 22
  7455. const m_EM_SCORE7 = 135
  7456. const m_EM_SEP = 108
  7457. const m_EM_SE_C17 = 139
  7458. const m_EM_SE_C33 = 107
  7459. const m_EM_SH = 42
  7460. const m_EM_SHARC = 133
  7461. const m_EM_SLE9X = 179
  7462. const m_EM_SNP1K = 99
  7463. const m_EM_SPARC = 2
  7464. const m_EM_SPARC32PLUS = 18
  7465. const m_EM_SPARCV9 = 43
  7466. const m_EM_ST100 = 60
  7467. const m_EM_ST19 = 74
  7468. const m_EM_ST200 = 100
  7469. const m_EM_ST7 = 68
  7470. const m_EM_ST9PLUS = 67
  7471. const m_EM_STARCORE = 58
  7472. const m_EM_STM8 = 186
  7473. const m_EM_STXP7X = 166
  7474. const m_EM_SVX = 73
  7475. const m_EM_TILE64 = 187
  7476. const m_EM_TILEGX = 191
  7477. const m_EM_TILEPRO = 188
  7478. const m_EM_TINYJ = 61
  7479. const m_EM_TI_ARP32 = 143
  7480. const m_EM_TI_C2000 = 141
  7481. const m_EM_TI_C5500 = 142
  7482. const m_EM_TI_C6000 = 140
  7483. const m_EM_TI_PRU = 144
  7484. const m_EM_TMM_GPP = 96
  7485. const m_EM_TPC = 98
  7486. const m_EM_TRICORE = 44
  7487. const m_EM_TRIMEDIA = 163
  7488. const m_EM_TSK3000 = 131
  7489. const m_EM_UNICORE = 110
  7490. const m_EM_V800 = 36
  7491. const m_EM_V850 = 87
  7492. const m_EM_VAX = 75
  7493. const m_EM_VIDEOCORE = 95
  7494. const m_EM_VIDEOCORE3 = 137
  7495. const m_EM_VIDEOCORE5 = 198
  7496. const m_EM_VISIUM = 221
  7497. const m_EM_VPP500 = 17
  7498. const m_EM_X86_64 = 62
  7499. const m_EM_XCORE = 203
  7500. const m_EM_XGATE = 115
  7501. const m_EM_XIMO16 = 170
  7502. const m_EM_XTENSA = 94
  7503. const m_EM_Z80 = 220
  7504. const m_EM_ZSP = 79
  7505. const m_ET_CORE = 4
  7506. const m_ET_DYN = 3
  7507. const m_ET_EXEC = 2
  7508. const m_ET_HIOS = 0xfeff
  7509. const m_ET_HIPROC = 0xffff
  7510. const m_ET_LOOS = 0xfe00
  7511. const m_ET_LOPROC = 0xff00
  7512. const m_ET_NONE = 0
  7513. const m_ET_NUM = 5
  7514. const m_ET_REL = 1
  7515. const m_EV_CURRENT = 1
  7516. const m_EV_NONE = 0
  7517. const m_EV_NUM = 2
  7518. const m_E_MIPS_ARCH_1 = 0x00000000
  7519. const m_E_MIPS_ARCH_2 = 0x10000000
  7520. const m_E_MIPS_ARCH_3 = 0x20000000
  7521. const m_E_MIPS_ARCH_32 = 0x50000000
  7522. const m_E_MIPS_ARCH_4 = 0x30000000
  7523. const m_E_MIPS_ARCH_5 = 0x40000000
  7524. const m_E_MIPS_ARCH_64 = 0x60000000
  7525. const m_Elf_Ehdr = "Elf32_Ehdr"
  7526. const m_Elf_Off = "Elf32_Off"
  7527. const m_Elf_Shdr = "Elf32_Shdr"
  7528. const m_Elf_Sword = "Elf32_Sword"
  7529. const m_Elf_Sym = "Elf32_Sym"
  7530. const m_Elf_Word = "Elf32_Word"
  7531. const m_GRP_COMDAT = 0x1
  7532. const m_LITUSE_ALPHA_ADDR = 0
  7533. const m_LITUSE_ALPHA_BASE = 1
  7534. const m_LITUSE_ALPHA_BYTOFF = 2
  7535. const m_LITUSE_ALPHA_JSR = 3
  7536. const m_LITUSE_ALPHA_TLS_GD = 4
  7537. const m_LITUSE_ALPHA_TLS_LDM = 5
  7538. const m_LL_NONE = 0
  7539. const m_MAP_ANON1 = 0x20
  7540. const m_MAP_PRIVATE1 = 0x02
  7541. const m_MIPS_AFL_ASE_DSP = 0x00000001
  7542. const m_MIPS_AFL_ASE_DSPR2 = 0x00000002
  7543. const m_MIPS_AFL_ASE_EVA = 0x00000004
  7544. const m_MIPS_AFL_ASE_MASK = 0x00001fff
  7545. const m_MIPS_AFL_ASE_MCU = 0x00000008
  7546. const m_MIPS_AFL_ASE_MDMX = 0x00000010
  7547. const m_MIPS_AFL_ASE_MICROMIPS = 0x00000800
  7548. const m_MIPS_AFL_ASE_MIPS16 = 0x00000400
  7549. const m_MIPS_AFL_ASE_MIPS3D = 0x00000020
  7550. const m_MIPS_AFL_ASE_MSA = 0x00000200
  7551. const m_MIPS_AFL_ASE_MT = 0x00000040
  7552. const m_MIPS_AFL_ASE_SMARTMIPS = 0x00000080
  7553. const m_MIPS_AFL_ASE_VIRT = 0x00000100
  7554. const m_MIPS_AFL_ASE_XPA = 0x00001000
  7555. const m_MIPS_AFL_EXT_10000 = 11
  7556. const m_MIPS_AFL_EXT_3900 = 10
  7557. const m_MIPS_AFL_EXT_4010 = 8
  7558. const m_MIPS_AFL_EXT_4100 = 9
  7559. const m_MIPS_AFL_EXT_4111 = 13
  7560. const m_MIPS_AFL_EXT_4120 = 14
  7561. const m_MIPS_AFL_EXT_4650 = 7
  7562. const m_MIPS_AFL_EXT_5400 = 15
  7563. const m_MIPS_AFL_EXT_5500 = 16
  7564. const m_MIPS_AFL_EXT_5900 = 6
  7565. const m_MIPS_AFL_EXT_LOONGSON_2E = 17
  7566. const m_MIPS_AFL_EXT_LOONGSON_2F = 18
  7567. const m_MIPS_AFL_EXT_LOONGSON_3A = 4
  7568. const m_MIPS_AFL_EXT_OCTEON = 5
  7569. const m_MIPS_AFL_EXT_OCTEON2 = 2
  7570. const m_MIPS_AFL_EXT_OCTEONP = 3
  7571. const m_MIPS_AFL_EXT_SB1 = 12
  7572. const m_MIPS_AFL_EXT_XLR = 1
  7573. const m_MIPS_AFL_FLAGS1_ODDSPREG = 1
  7574. const m_MIPS_AFL_REG_128 = 0x03
  7575. const m_MIPS_AFL_REG_32 = 0x01
  7576. const m_MIPS_AFL_REG_64 = 0x02
  7577. const m_MIPS_AFL_REG_NONE = 0x00
  7578. const m_NT_386_IOPERM = 0x201
  7579. const m_NT_386_TLS = 0x200
  7580. const m_NT_ARC_V2 = 0x600
  7581. const m_NT_ARM_HW_BREAK = 0x402
  7582. const m_NT_ARM_HW_WATCH = 0x403
  7583. const m_NT_ARM_PACA_KEYS = 0x407
  7584. const m_NT_ARM_PACG_KEYS = 0x408
  7585. const m_NT_ARM_PAC_ENABLED_KEYS = 0x40a
  7586. const m_NT_ARM_PAC_MASK = 0x406
  7587. const m_NT_ARM_SVE = 0x405
  7588. const m_NT_ARM_SYSTEM_CALL = 0x404
  7589. const m_NT_ARM_TAGGED_ADDR_CTRL = 0x409
  7590. const m_NT_ARM_TLS = 0x401
  7591. const m_NT_ARM_VFP = 0x400
  7592. const m_NT_ASRS = 8
  7593. const m_NT_AUXV = 6
  7594. const m_NT_FILE = 0x46494c45
  7595. const m_NT_FPREGSET = 2
  7596. const m_NT_GNU_ABI_TAG = 1
  7597. const m_NT_GNU_BUILD_ID = 3
  7598. const m_NT_GNU_GOLD_VERSION = 4
  7599. const m_NT_GNU_PROPERTY_TYPE_0 = 5
  7600. const m_NT_GWINDOWS = 7
  7601. const m_NT_LOONGARCH_CPUCFG = 0xa00
  7602. const m_NT_LOONGARCH_CSR = 0xa01
  7603. const m_NT_LOONGARCH_LASX = 0xa03
  7604. const m_NT_LOONGARCH_LBT = 0xa04
  7605. const m_NT_LOONGARCH_LSX = 0xa02
  7606. const m_NT_LWPSINFO = 17
  7607. const m_NT_LWPSTATUS = 16
  7608. const m_NT_METAG_CBUF = 0x500
  7609. const m_NT_METAG_RPIPE = 0x501
  7610. const m_NT_METAG_TLS = 0x502
  7611. const m_NT_MIPS_DSP = 0x800
  7612. const m_NT_MIPS_FP_MODE = 0x801
  7613. const m_NT_MIPS_MSA = 0x802
  7614. const m_NT_PLATFORM = 5
  7615. const m_NT_PPC_DSCR = 0x105
  7616. const m_NT_PPC_EBB = 0x106
  7617. const m_NT_PPC_PMU = 0x107
  7618. const m_NT_PPC_PPR = 0x104
  7619. const m_NT_PPC_SPE = 0x101
  7620. const m_NT_PPC_TAR = 0x103
  7621. const m_NT_PPC_TM_CDSCR = 0x10f
  7622. const m_NT_PPC_TM_CFPR = 0x109
  7623. const m_NT_PPC_TM_CGPR = 0x108
  7624. const m_NT_PPC_TM_CPPR = 0x10e
  7625. const m_NT_PPC_TM_CTAR = 0x10d
  7626. const m_NT_PPC_TM_CVMX = 0x10a
  7627. const m_NT_PPC_TM_CVSX = 0x10b
  7628. const m_NT_PPC_TM_SPR = 0x10c
  7629. const m_NT_PPC_VMX = 0x100
  7630. const m_NT_PPC_VSX = 0x102
  7631. const m_NT_PRCRED = 14
  7632. const m_NT_PRFPREG = 2
  7633. const m_NT_PRFPXREG = 20
  7634. const m_NT_PRPSINFO = 3
  7635. const m_NT_PRSTATUS = 1
  7636. const m_NT_PRXFPREG = 0x46e62b7f
  7637. const m_NT_PRXREG = 4
  7638. const m_NT_PSINFO = 13
  7639. const m_NT_PSTATUS = 10
  7640. const m_NT_RISCV_CSR = 0x900
  7641. const m_NT_RISCV_VECTOR = 0x901
  7642. const m_NT_S390_CTRS = 0x304
  7643. const m_NT_S390_GS_BC = 0x30c
  7644. const m_NT_S390_GS_CB = 0x30b
  7645. const m_NT_S390_HIGH_GPRS = 0x300
  7646. const m_NT_S390_LAST_BREAK = 0x306
  7647. const m_NT_S390_PREFIX = 0x305
  7648. const m_NT_S390_RI_CB = 0x30d
  7649. const m_NT_S390_SYSTEM_CALL = 0x307
  7650. const m_NT_S390_TDB = 0x308
  7651. const m_NT_S390_TIMER = 0x301
  7652. const m_NT_S390_TODCMP = 0x302
  7653. const m_NT_S390_TODPREG = 0x303
  7654. const m_NT_S390_VXRS_HIGH = 0x30a
  7655. const m_NT_S390_VXRS_LOW = 0x309
  7656. const m_NT_SIGINFO = 0x53494749
  7657. const m_NT_TASKSTRUCT = 4
  7658. const m_NT_UTSNAME = 15
  7659. const m_NT_VERSION = 1
  7660. const m_NT_VMCOREDD = 0x700
  7661. const m_NT_X86_XSTATE = 0x202
  7662. const m_N_ABS = 2
  7663. const m_N_BSS = 8
  7664. const m_N_COMM = 0x12
  7665. const m_N_DATA = 6
  7666. const m_N_EXT = 1
  7667. const m_N_FN = 30
  7668. const m_N_FORMAT = "%08x"
  7669. const m_N_INDR = 0x0a
  7670. const m_N_SETA = 0x14
  7671. const m_N_SETB = 0x1a
  7672. const m_N_SETD = 0x18
  7673. const m_N_SETT = 0x16
  7674. const m_N_SETV = 0x1c
  7675. const m_N_SIZE = 0x0c
  7676. const m_N_STAB = 0xe0
  7677. const m_N_TEXT = 4
  7678. const m_N_TYPE = 0x1e
  7679. const m_N_UNDF = 0
  7680. const m_N_WARN = 0x1e
  7681. const m_ODK_EXCEPTIONS = 2
  7682. const m_ODK_FILL = 5
  7683. const m_ODK_HWAND = 7
  7684. const m_ODK_HWOR = 8
  7685. const m_ODK_HWPATCH = 4
  7686. const m_ODK_NULL = 0
  7687. const m_ODK_PAD = 3
  7688. const m_ODK_REGINFO = 1
  7689. const m_ODK_TAGS = 6
  7690. const m_OEX_DISMISS = 0x80000
  7691. const m_OEX_FPDBUG = 0x40000
  7692. const m_OEX_FPU_DIV0 = 0x08
  7693. const m_OEX_FPU_INEX = 0x01
  7694. const m_OEX_FPU_INVAL = 0x10
  7695. const m_OEX_FPU_MAX = 0x1f00
  7696. const m_OEX_FPU_MIN = 0x1f
  7697. const m_OEX_FPU_OFLO = 0x04
  7698. const m_OEX_FPU_UFLO = 0x02
  7699. const m_OEX_PAGE0 = 0x10000
  7700. const m_OEX_PRECISEFP = "OEX_FPDBUG"
  7701. const m_OEX_SMM = 0x20000
  7702. const m_OHWA0_R4KEOP_CHECKED = 0x00000001
  7703. const m_OHWA1_R4KEOP_CLEAN = 0x00000002
  7704. const m_OHW_R4KEOP = 0x1
  7705. const m_OHW_R5KCVTL = 0x8
  7706. const m_OHW_R5KEOP = 0x4
  7707. const m_OHW_R8KPFETCH = 0x2
  7708. const m_OPAD_POSTFIX = 0x2
  7709. const m_OPAD_PREFIX = 0x1
  7710. const m_OPAD_SYMBOL = 0x4
  7711. const m_O_CREAT2 = 0100
  7712. const m_O_NONBLOCK2 = 04000
  7713. const m_O_RDONLY1 = 0
  7714. const m_O_TRUNC2 = 01000
  7715. const m_PF_ARM_ABS = 0x40000000
  7716. const m_PF_ARM_PI = 0x20000000
  7717. const m_PF_ARM_SB = 0x10000000
  7718. const m_PF_HP_CODE = 0x01000000
  7719. const m_PF_HP_FAR_SHARED = 0x00200000
  7720. const m_PF_HP_LAZYSWAP = 0x04000000
  7721. const m_PF_HP_MODIFY = 0x02000000
  7722. const m_PF_HP_NEAR_SHARED = 0x00400000
  7723. const m_PF_HP_PAGE_SIZE = 0x00100000
  7724. const m_PF_HP_SBP = 0x08000000
  7725. const m_PF_IA_64_NORECOV = 0x80000000
  7726. const m_PF_MASKOS = 0x0ff00000
  7727. const m_PF_MASKPROC = 0xf0000000
  7728. const m_PF_MIPS_LOCAL = 0x10000000
  7729. const m_PF_PARISC_SBP = 0x08000000
  7730. const m_PN_XNUM = 0xffff
  7731. const m_PPC64_OPT_LOCALENTRY = 4
  7732. const m_PPC64_OPT_MULTI_TOC = 2
  7733. const m_PPC64_OPT_TLS = 1
  7734. const m_PPC_OPT_TLS = 1
  7735. const m_PT_DYNAMIC = 2
  7736. const m_PT_GNU_EH_FRAME = 0x6474e550
  7737. const m_PT_GNU_PROPERTY = 0x6474e553
  7738. const m_PT_GNU_RELRO = 0x6474e552
  7739. const m_PT_GNU_STACK = 0x6474e551
  7740. const m_PT_HIOS = 0x6fffffff
  7741. const m_PT_HIPROC = 0x7fffffff
  7742. const m_PT_HISUNW = 0x6fffffff
  7743. const m_PT_INTERP = 3
  7744. const m_PT_LOAD = 1
  7745. const m_PT_LOOS = 0x60000000
  7746. const m_PT_LOPROC = 0x70000000
  7747. const m_PT_LOSUNW = 0x6ffffffa
  7748. const m_PT_MIPS_ABIFLAGS = 0x70000003
  7749. const m_PT_MIPS_OPTIONS = 0x70000002
  7750. const m_PT_MIPS_REGINFO = 0x70000000
  7751. const m_PT_MIPS_RTPROC = 0x70000001
  7752. const m_PT_NOTE = 4
  7753. const m_PT_NULL = 0
  7754. const m_PT_NUM = 8
  7755. const m_PT_PARISC_ARCHEXT = 0x70000000
  7756. const m_PT_PARISC_UNWIND = 0x70000001
  7757. const m_PT_PHDR = 6
  7758. const m_PT_SHLIB = 5
  7759. const m_PT_SUNWBSS = 0x6ffffffa
  7760. const m_PT_SUNWSTACK = 0x6ffffffb
  7761. const m_PT_TLS = 7
  7762. const m_RHF_NONE = 0
  7763. const m_R_386_16 = 20
  7764. const m_R_386_32 = 1
  7765. const m_R_386_32PLT = 11
  7766. const m_R_386_8 = 22
  7767. const m_R_386_COPY = 5
  7768. const m_R_386_GLOB_DAT = 6
  7769. const m_R_386_GOT32 = 3
  7770. const m_R_386_GOT32X = 43
  7771. const m_R_386_GOTOFF = 9
  7772. const m_R_386_GOTPC = 10
  7773. const m_R_386_IRELATIVE = 42
  7774. const m_R_386_JMP_SLOT = 7
  7775. const m_R_386_NONE = 0
  7776. const m_R_386_NUM = 44
  7777. const m_R_386_PC16 = 21
  7778. const m_R_386_PC32 = 2
  7779. const m_R_386_PC8 = 23
  7780. const m_R_386_PLT32 = 4
  7781. const m_R_386_RELATIVE = 8
  7782. const m_R_386_SIZE32 = 38
  7783. const m_R_386_TLS_DESC = 41
  7784. const m_R_386_TLS_DESC_CALL = 40
  7785. const m_R_386_TLS_DTPMOD32 = 35
  7786. const m_R_386_TLS_DTPOFF32 = 36
  7787. const m_R_386_TLS_GD = 18
  7788. const m_R_386_TLS_GD_32 = 24
  7789. const m_R_386_TLS_GD_CALL = 26
  7790. const m_R_386_TLS_GD_POP = 27
  7791. const m_R_386_TLS_GD_PUSH = 25
  7792. const m_R_386_TLS_GOTDESC = 39
  7793. const m_R_386_TLS_GOTIE = 16
  7794. const m_R_386_TLS_IE = 15
  7795. const m_R_386_TLS_IE_32 = 33
  7796. const m_R_386_TLS_LDM = 19
  7797. const m_R_386_TLS_LDM_32 = 28
  7798. const m_R_386_TLS_LDM_CALL = 30
  7799. const m_R_386_TLS_LDM_POP = 31
  7800. const m_R_386_TLS_LDM_PUSH = 29
  7801. const m_R_386_TLS_LDO_32 = 32
  7802. const m_R_386_TLS_LE = 17
  7803. const m_R_386_TLS_LE_32 = 34
  7804. const m_R_386_TLS_TPOFF = 14
  7805. const m_R_386_TLS_TPOFF32 = 37
  7806. const m_R_390_12 = 2
  7807. const m_R_390_16 = 3
  7808. const m_R_390_20 = 57
  7809. const m_R_390_32 = 4
  7810. const m_R_390_64 = 22
  7811. const m_R_390_8 = 1
  7812. const m_R_390_COPY = 9
  7813. const m_R_390_GLOB_DAT = 10
  7814. const m_R_390_GOT12 = 6
  7815. const m_R_390_GOT16 = 15
  7816. const m_R_390_GOT20 = 58
  7817. const m_R_390_GOT32 = 7
  7818. const m_R_390_GOT64 = 24
  7819. const m_R_390_GOTENT = 26
  7820. const m_R_390_GOTOFF16 = 27
  7821. const m_R_390_GOTOFF32 = 13
  7822. const m_R_390_GOTOFF64 = 28
  7823. const m_R_390_GOTPC = 14
  7824. const m_R_390_GOTPCDBL = 21
  7825. const m_R_390_GOTPLT12 = 29
  7826. const m_R_390_GOTPLT16 = 30
  7827. const m_R_390_GOTPLT20 = 59
  7828. const m_R_390_GOTPLT32 = 31
  7829. const m_R_390_GOTPLT64 = 32
  7830. const m_R_390_GOTPLTENT = 33
  7831. const m_R_390_JMP_SLOT = 11
  7832. const m_R_390_NONE = 0
  7833. const m_R_390_NUM = 61
  7834. const m_R_390_PC16 = 16
  7835. const m_R_390_PC16DBL = 17
  7836. const m_R_390_PC32 = 5
  7837. const m_R_390_PC32DBL = 19
  7838. const m_R_390_PC64 = 23
  7839. const m_R_390_PLT16DBL = 18
  7840. const m_R_390_PLT32 = 8
  7841. const m_R_390_PLT32DBL = 20
  7842. const m_R_390_PLT64 = 25
  7843. const m_R_390_PLTOFF16 = 34
  7844. const m_R_390_PLTOFF32 = 35
  7845. const m_R_390_PLTOFF64 = 36
  7846. const m_R_390_RELATIVE = 12
  7847. const m_R_390_TLS_DTPMOD = 54
  7848. const m_R_390_TLS_DTPOFF = 55
  7849. const m_R_390_TLS_GD32 = 40
  7850. const m_R_390_TLS_GD64 = 41
  7851. const m_R_390_TLS_GDCALL = 38
  7852. const m_R_390_TLS_GOTIE12 = 42
  7853. const m_R_390_TLS_GOTIE20 = 60
  7854. const m_R_390_TLS_GOTIE32 = 43
  7855. const m_R_390_TLS_GOTIE64 = 44
  7856. const m_R_390_TLS_IE32 = 47
  7857. const m_R_390_TLS_IE64 = 48
  7858. const m_R_390_TLS_IEENT = 49
  7859. const m_R_390_TLS_LDCALL = 39
  7860. const m_R_390_TLS_LDM32 = 45
  7861. const m_R_390_TLS_LDM64 = 46
  7862. const m_R_390_TLS_LDO32 = 52
  7863. const m_R_390_TLS_LDO64 = 53
  7864. const m_R_390_TLS_LE32 = 50
  7865. const m_R_390_TLS_LE64 = 51
  7866. const m_R_390_TLS_LOAD = 37
  7867. const m_R_390_TLS_TPOFF = 56
  7868. const m_R_68K_16 = 2
  7869. const m_R_68K_32 = 1
  7870. const m_R_68K_8 = 3
  7871. const m_R_68K_COPY = 19
  7872. const m_R_68K_GLOB_DAT = 20
  7873. const m_R_68K_GOT16 = 8
  7874. const m_R_68K_GOT16O = 11
  7875. const m_R_68K_GOT32 = 7
  7876. const m_R_68K_GOT32O = 10
  7877. const m_R_68K_GOT8 = 9
  7878. const m_R_68K_GOT8O = 12
  7879. const m_R_68K_JMP_SLOT = 21
  7880. const m_R_68K_NONE = 0
  7881. const m_R_68K_NUM = 43
  7882. const m_R_68K_PC16 = 5
  7883. const m_R_68K_PC32 = 4
  7884. const m_R_68K_PC8 = 6
  7885. const m_R_68K_PLT16 = 14
  7886. const m_R_68K_PLT16O = 17
  7887. const m_R_68K_PLT32 = 13
  7888. const m_R_68K_PLT32O = 16
  7889. const m_R_68K_PLT8 = 15
  7890. const m_R_68K_PLT8O = 18
  7891. const m_R_68K_RELATIVE = 22
  7892. const m_R_68K_TLS_DTPMOD32 = 40
  7893. const m_R_68K_TLS_DTPREL32 = 41
  7894. const m_R_68K_TLS_GD16 = 26
  7895. const m_R_68K_TLS_GD32 = 25
  7896. const m_R_68K_TLS_GD8 = 27
  7897. const m_R_68K_TLS_IE16 = 35
  7898. const m_R_68K_TLS_IE32 = 34
  7899. const m_R_68K_TLS_IE8 = 36
  7900. const m_R_68K_TLS_LDM16 = 29
  7901. const m_R_68K_TLS_LDM32 = 28
  7902. const m_R_68K_TLS_LDM8 = 30
  7903. const m_R_68K_TLS_LDO16 = 32
  7904. const m_R_68K_TLS_LDO32 = 31
  7905. const m_R_68K_TLS_LDO8 = 33
  7906. const m_R_68K_TLS_LE16 = 38
  7907. const m_R_68K_TLS_LE32 = 37
  7908. const m_R_68K_TLS_LE8 = 39
  7909. const m_R_68K_TLS_TPREL32 = 42
  7910. const m_R_AARCH64_ABS16 = 259
  7911. const m_R_AARCH64_ABS32 = 258
  7912. const m_R_AARCH64_ABS64 = 257
  7913. const m_R_AARCH64_ADD_ABS_LO12_NC = 277
  7914. const m_R_AARCH64_ADR_GOT_PAGE = 311
  7915. const m_R_AARCH64_ADR_PREL_LO21 = 274
  7916. const m_R_AARCH64_ADR_PREL_PG_HI21 = 275
  7917. const m_R_AARCH64_ADR_PREL_PG_HI21_NC = 276
  7918. const m_R_AARCH64_CALL26 = 283
  7919. const m_R_AARCH64_CONDBR19 = 280
  7920. const m_R_AARCH64_COPY = 1024
  7921. const m_R_AARCH64_GLOB_DAT = 1025
  7922. const m_R_AARCH64_GOTREL32 = 308
  7923. const m_R_AARCH64_GOTREL64 = 307
  7924. const m_R_AARCH64_GOT_LD_PREL19 = 309
  7925. const m_R_AARCH64_JUMP26 = 282
  7926. const m_R_AARCH64_JUMP_SLOT = 1026
  7927. const m_R_AARCH64_LD64_GOTOFF_LO15 = 310
  7928. const m_R_AARCH64_LD64_GOTPAGE_LO15 = 313
  7929. const m_R_AARCH64_LD64_GOT_LO12_NC = 312
  7930. const m_R_AARCH64_LDST128_ABS_LO12_NC = 299
  7931. const m_R_AARCH64_LDST16_ABS_LO12_NC = 284
  7932. const m_R_AARCH64_LDST32_ABS_LO12_NC = 285
  7933. const m_R_AARCH64_LDST64_ABS_LO12_NC = 286
  7934. const m_R_AARCH64_LDST8_ABS_LO12_NC = 278
  7935. const m_R_AARCH64_LD_PREL_LO19 = 273
  7936. const m_R_AARCH64_MOVW_GOTOFF_G0 = 300
  7937. const m_R_AARCH64_MOVW_GOTOFF_G0_NC = 301
  7938. const m_R_AARCH64_MOVW_GOTOFF_G1 = 302
  7939. const m_R_AARCH64_MOVW_GOTOFF_G1_NC = 303
  7940. const m_R_AARCH64_MOVW_GOTOFF_G2 = 304
  7941. const m_R_AARCH64_MOVW_GOTOFF_G2_NC = 305
  7942. const m_R_AARCH64_MOVW_GOTOFF_G3 = 306
  7943. const m_R_AARCH64_MOVW_PREL_G0 = 287
  7944. const m_R_AARCH64_MOVW_PREL_G0_NC = 288
  7945. const m_R_AARCH64_MOVW_PREL_G1 = 289
  7946. const m_R_AARCH64_MOVW_PREL_G1_NC = 290
  7947. const m_R_AARCH64_MOVW_PREL_G2 = 291
  7948. const m_R_AARCH64_MOVW_PREL_G2_NC = 292
  7949. const m_R_AARCH64_MOVW_PREL_G3 = 293
  7950. const m_R_AARCH64_MOVW_SABS_G0 = 270
  7951. const m_R_AARCH64_MOVW_SABS_G1 = 271
  7952. const m_R_AARCH64_MOVW_SABS_G2 = 272
  7953. const m_R_AARCH64_MOVW_UABS_G0 = 263
  7954. const m_R_AARCH64_MOVW_UABS_G0_NC = 264
  7955. const m_R_AARCH64_MOVW_UABS_G1 = 265
  7956. const m_R_AARCH64_MOVW_UABS_G1_NC = 266
  7957. const m_R_AARCH64_MOVW_UABS_G2 = 267
  7958. const m_R_AARCH64_MOVW_UABS_G2_NC = 268
  7959. const m_R_AARCH64_MOVW_UABS_G3 = 269
  7960. const m_R_AARCH64_NONE = 0
  7961. const m_R_AARCH64_P32_ABS32 = 1
  7962. const m_R_AARCH64_P32_COPY = 180
  7963. const m_R_AARCH64_P32_GLOB_DAT = 181
  7964. const m_R_AARCH64_P32_IRELATIVE = 188
  7965. const m_R_AARCH64_P32_JUMP_SLOT = 182
  7966. const m_R_AARCH64_P32_RELATIVE = 183
  7967. const m_R_AARCH64_P32_TLSDESC = 187
  7968. const m_R_AARCH64_P32_TLS_DTPMOD = 184
  7969. const m_R_AARCH64_P32_TLS_DTPREL = 185
  7970. const m_R_AARCH64_P32_TLS_TPREL = 186
  7971. const m_R_AARCH64_PREL16 = 262
  7972. const m_R_AARCH64_PREL32 = 261
  7973. const m_R_AARCH64_PREL64 = 260
  7974. const m_R_AARCH64_RELATIVE = 1027
  7975. const m_R_AARCH64_TLSDESC = 1031
  7976. const m_R_AARCH64_TLSDESC_ADD = 568
  7977. const m_R_AARCH64_TLSDESC_ADD_LO12 = 564
  7978. const m_R_AARCH64_TLSDESC_ADR_PAGE21 = 562
  7979. const m_R_AARCH64_TLSDESC_ADR_PREL21 = 561
  7980. const m_R_AARCH64_TLSDESC_CALL = 569
  7981. const m_R_AARCH64_TLSDESC_LD64_LO12 = 563
  7982. const m_R_AARCH64_TLSDESC_LDR = 567
  7983. const m_R_AARCH64_TLSDESC_LD_PREL19 = 560
  7984. const m_R_AARCH64_TLSDESC_OFF_G0_NC = 566
  7985. const m_R_AARCH64_TLSDESC_OFF_G1 = 565
  7986. const m_R_AARCH64_TLSGD_ADD_LO12_NC = 514
  7987. const m_R_AARCH64_TLSGD_ADR_PAGE21 = 513
  7988. const m_R_AARCH64_TLSGD_ADR_PREL21 = 512
  7989. const m_R_AARCH64_TLSGD_MOVW_G0_NC = 516
  7990. const m_R_AARCH64_TLSGD_MOVW_G1 = 515
  7991. const m_R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 = 541
  7992. const m_R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC = 542
  7993. const m_R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 = 543
  7994. const m_R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC = 540
  7995. const m_R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 = 539
  7996. const m_R_AARCH64_TLSLD_ADD_DTPREL_HI12 = 528
  7997. const m_R_AARCH64_TLSLD_ADD_DTPREL_LO12 = 529
  7998. const m_R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC = 530
  7999. const m_R_AARCH64_TLSLD_ADD_LO12_NC = 519
  8000. const m_R_AARCH64_TLSLD_ADR_PAGE21 = 518
  8001. const m_R_AARCH64_TLSLD_ADR_PREL21 = 517
  8002. const m_R_AARCH64_TLSLD_LDST128_DTPREL_LO12 = 572
  8003. const m_R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC = 573
  8004. const m_R_AARCH64_TLSLD_LDST16_DTPREL_LO12 = 533
  8005. const m_R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC = 534
  8006. const m_R_AARCH64_TLSLD_LDST32_DTPREL_LO12 = 535
  8007. const m_R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC = 536
  8008. const m_R_AARCH64_TLSLD_LDST64_DTPREL_LO12 = 537
  8009. const m_R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC = 538
  8010. const m_R_AARCH64_TLSLD_LDST8_DTPREL_LO12 = 531
  8011. const m_R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC = 532
  8012. const m_R_AARCH64_TLSLD_LD_PREL19 = 522
  8013. const m_R_AARCH64_TLSLD_MOVW_DTPREL_G0 = 526
  8014. const m_R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC = 527
  8015. const m_R_AARCH64_TLSLD_MOVW_DTPREL_G1 = 524
  8016. const m_R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC = 525
  8017. const m_R_AARCH64_TLSLD_MOVW_DTPREL_G2 = 523
  8018. const m_R_AARCH64_TLSLD_MOVW_G0_NC = 521
  8019. const m_R_AARCH64_TLSLD_MOVW_G1 = 520
  8020. const m_R_AARCH64_TLSLE_ADD_TPREL_HI12 = 549
  8021. const m_R_AARCH64_TLSLE_ADD_TPREL_LO12 = 550
  8022. const m_R_AARCH64_TLSLE_ADD_TPREL_LO12_NC = 551
  8023. const m_R_AARCH64_TLSLE_LDST128_TPREL_LO12 = 570
  8024. const m_R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC = 571
  8025. const m_R_AARCH64_TLSLE_LDST16_TPREL_LO12 = 554
  8026. const m_R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC = 555
  8027. const m_R_AARCH64_TLSLE_LDST32_TPREL_LO12 = 556
  8028. const m_R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC = 557
  8029. const m_R_AARCH64_TLSLE_LDST64_TPREL_LO12 = 558
  8030. const m_R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC = 559
  8031. const m_R_AARCH64_TLSLE_LDST8_TPREL_LO12 = 552
  8032. const m_R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC = 553
  8033. const m_R_AARCH64_TLSLE_MOVW_TPREL_G0 = 547
  8034. const m_R_AARCH64_TLSLE_MOVW_TPREL_G0_NC = 548
  8035. const m_R_AARCH64_TLSLE_MOVW_TPREL_G1 = 545
  8036. const m_R_AARCH64_TLSLE_MOVW_TPREL_G1_NC = 546
  8037. const m_R_AARCH64_TLSLE_MOVW_TPREL_G2 = 544
  8038. const m_R_AARCH64_TLS_DTPMOD = 1028
  8039. const m_R_AARCH64_TLS_DTPMOD64 = 1028
  8040. const m_R_AARCH64_TLS_DTPREL = 1029
  8041. const m_R_AARCH64_TLS_DTPREL64 = 1029
  8042. const m_R_AARCH64_TLS_TPREL = 1030
  8043. const m_R_AARCH64_TLS_TPREL64 = 1030
  8044. const m_R_AARCH64_TSTBR14 = 279
  8045. const m_R_ALPHA_BRADDR = 7
  8046. const m_R_ALPHA_COPY = 24
  8047. const m_R_ALPHA_DTPMOD64 = 31
  8048. const m_R_ALPHA_DTPREL16 = 36
  8049. const m_R_ALPHA_DTPREL64 = 33
  8050. const m_R_ALPHA_DTPRELHI = 34
  8051. const m_R_ALPHA_DTPRELLO = 35
  8052. const m_R_ALPHA_GLOB_DAT = 25
  8053. const m_R_ALPHA_GOTDTPREL = 32
  8054. const m_R_ALPHA_GOTTPREL = 37
  8055. const m_R_ALPHA_GPDISP = 6
  8056. const m_R_ALPHA_GPREL16 = 19
  8057. const m_R_ALPHA_GPREL32 = 3
  8058. const m_R_ALPHA_GPRELHIGH = 17
  8059. const m_R_ALPHA_GPRELLOW = 18
  8060. const m_R_ALPHA_HINT = 8
  8061. const m_R_ALPHA_JMP_SLOT = 26
  8062. const m_R_ALPHA_LITERAL = 4
  8063. const m_R_ALPHA_LITUSE = 5
  8064. const m_R_ALPHA_NONE = 0
  8065. const m_R_ALPHA_NUM = 46
  8066. const m_R_ALPHA_REFLONG = 1
  8067. const m_R_ALPHA_REFQUAD = 2
  8068. const m_R_ALPHA_RELATIVE = 27
  8069. const m_R_ALPHA_SREL16 = 9
  8070. const m_R_ALPHA_SREL32 = 10
  8071. const m_R_ALPHA_SREL64 = 11
  8072. const m_R_ALPHA_TLSGD = 29
  8073. const m_R_ALPHA_TLS_GD_HI = 28
  8074. const m_R_ALPHA_TLS_LDM = 30
  8075. const m_R_ALPHA_TPREL16 = 41
  8076. const m_R_ALPHA_TPREL64 = 38
  8077. const m_R_ALPHA_TPRELHI = 39
  8078. const m_R_ALPHA_TPRELLO = 40
  8079. const m_R_ARM_ABS12 = 6
  8080. const m_R_ARM_ABS16 = 5
  8081. const m_R_ARM_ABS32 = 2
  8082. const m_R_ARM_ABS32_NOI = 55
  8083. const m_R_ARM_ABS8 = 8
  8084. const m_R_ARM_ALU_PCREL_15_8 = 33
  8085. const m_R_ARM_ALU_PCREL_23_15 = 34
  8086. const m_R_ARM_ALU_PCREL_7_0 = 32
  8087. const m_R_ARM_ALU_PC_G0 = 58
  8088. const m_R_ARM_ALU_PC_G0_NC = 57
  8089. const m_R_ARM_ALU_PC_G1 = 60
  8090. const m_R_ARM_ALU_PC_G1_NC = 59
  8091. const m_R_ARM_ALU_PC_G2 = 61
  8092. const m_R_ARM_ALU_SBREL_19_12 = 36
  8093. const m_R_ARM_ALU_SBREL_27_20 = 37
  8094. const m_R_ARM_ALU_SB_G0 = 71
  8095. const m_R_ARM_ALU_SB_G0_NC = 70
  8096. const m_R_ARM_ALU_SB_G1 = 73
  8097. const m_R_ARM_ALU_SB_G1_NC = 72
  8098. const m_R_ARM_ALU_SB_G2 = 74
  8099. const m_R_ARM_AMP_VCALL9 = 12
  8100. const m_R_ARM_BASE_ABS = 31
  8101. const m_R_ARM_CALL = 28
  8102. const m_R_ARM_COPY = 20
  8103. const m_R_ARM_GLOB_DAT = 21
  8104. const m_R_ARM_GNU_VTENTRY = 100
  8105. const m_R_ARM_GNU_VTINHERIT = 101
  8106. const m_R_ARM_GOT32 = 26
  8107. const m_R_ARM_GOTOFF = 24
  8108. const m_R_ARM_GOTOFF12 = 98
  8109. const m_R_ARM_GOTPC = 25
  8110. const m_R_ARM_GOTRELAX = 99
  8111. const m_R_ARM_GOT_ABS = 95
  8112. const m_R_ARM_GOT_BREL12 = 97
  8113. const m_R_ARM_GOT_PREL = 96
  8114. const m_R_ARM_IRELATIVE = 160
  8115. const m_R_ARM_JUMP24 = 29
  8116. const m_R_ARM_JUMP_SLOT = 22
  8117. const m_R_ARM_LDC_PC_G0 = 67
  8118. const m_R_ARM_LDC_PC_G1 = 68
  8119. const m_R_ARM_LDC_PC_G2 = 69
  8120. const m_R_ARM_LDC_SB_G0 = 81
  8121. const m_R_ARM_LDC_SB_G1 = 82
  8122. const m_R_ARM_LDC_SB_G2 = 83
  8123. const m_R_ARM_LDRS_PC_G0 = 64
  8124. const m_R_ARM_LDRS_PC_G1 = 65
  8125. const m_R_ARM_LDRS_PC_G2 = 66
  8126. const m_R_ARM_LDRS_SB_G0 = 78
  8127. const m_R_ARM_LDRS_SB_G1 = 79
  8128. const m_R_ARM_LDRS_SB_G2 = 80
  8129. const m_R_ARM_LDR_PC_G1 = 62
  8130. const m_R_ARM_LDR_PC_G2 = 63
  8131. const m_R_ARM_LDR_SBREL_11_0 = 35
  8132. const m_R_ARM_LDR_SB_G0 = 75
  8133. const m_R_ARM_LDR_SB_G1 = 76
  8134. const m_R_ARM_LDR_SB_G2 = 77
  8135. const m_R_ARM_ME_TOO = 128
  8136. const m_R_ARM_MOVT_ABS = 44
  8137. const m_R_ARM_MOVT_BREL = 85
  8138. const m_R_ARM_MOVT_PREL = 46
  8139. const m_R_ARM_MOVW_ABS_NC = 43
  8140. const m_R_ARM_MOVW_BREL = 86
  8141. const m_R_ARM_MOVW_BREL_NC = 84
  8142. const m_R_ARM_MOVW_PREL_NC = 45
  8143. const m_R_ARM_NONE = 0
  8144. const m_R_ARM_NUM = 256
  8145. const m_R_ARM_PC13 = 4
  8146. const m_R_ARM_PC24 = 1
  8147. const m_R_ARM_PLT32 = 27
  8148. const m_R_ARM_PLT32_ABS = 94
  8149. const m_R_ARM_PREL31 = 42
  8150. const m_R_ARM_RABS22 = 253
  8151. const m_R_ARM_RBASE = 255
  8152. const m_R_ARM_REL32 = 3
  8153. const m_R_ARM_REL32_NOI = 56
  8154. const m_R_ARM_RELATIVE = 23
  8155. const m_R_ARM_RPC24 = 254
  8156. const m_R_ARM_RREL32 = 252
  8157. const m_R_ARM_RSBREL32 = 250
  8158. const m_R_ARM_RXPC25 = 249
  8159. const m_R_ARM_SBREL31 = 39
  8160. const m_R_ARM_SBREL32 = 9
  8161. const m_R_ARM_TARGET1 = 38
  8162. const m_R_ARM_TARGET2 = 41
  8163. const m_R_ARM_THM_ABS5 = 7
  8164. const m_R_ARM_THM_ALU_PREL_11_0 = 53
  8165. const m_R_ARM_THM_GOT_BREL12 = 131
  8166. const m_R_ARM_THM_JUMP19 = 51
  8167. const m_R_ARM_THM_JUMP24 = 30
  8168. const m_R_ARM_THM_JUMP6 = 52
  8169. const m_R_ARM_THM_MOVT_ABS = 48
  8170. const m_R_ARM_THM_MOVT_BREL = 88
  8171. const m_R_ARM_THM_MOVT_PREL = 50
  8172. const m_R_ARM_THM_MOVW_ABS_NC = 47
  8173. const m_R_ARM_THM_MOVW_BREL = 89
  8174. const m_R_ARM_THM_MOVW_BREL_NC = 87
  8175. const m_R_ARM_THM_MOVW_PREL_NC = 49
  8176. const m_R_ARM_THM_PC11 = 102
  8177. const m_R_ARM_THM_PC12 = 54
  8178. const m_R_ARM_THM_PC22 = 10
  8179. const m_R_ARM_THM_PC8 = 11
  8180. const m_R_ARM_THM_PC9 = 103
  8181. const m_R_ARM_THM_RPC22 = 251
  8182. const m_R_ARM_THM_SWI8 = 14
  8183. const m_R_ARM_THM_TLS_CALL = 93
  8184. const m_R_ARM_THM_TLS_DESCSEQ = 129
  8185. const m_R_ARM_THM_TLS_DESCSEQ16 = 129
  8186. const m_R_ARM_THM_TLS_DESCSEQ32 = 130
  8187. const m_R_ARM_THM_XPC22 = 16
  8188. const m_R_ARM_TLS_CALL = 91
  8189. const m_R_ARM_TLS_DESC = 13
  8190. const m_R_ARM_TLS_DESCSEQ = 92
  8191. const m_R_ARM_TLS_DTPMOD32 = 17
  8192. const m_R_ARM_TLS_DTPOFF32 = 18
  8193. const m_R_ARM_TLS_GD32 = 104
  8194. const m_R_ARM_TLS_GOTDESC = 90
  8195. const m_R_ARM_TLS_IE12GP = 111
  8196. const m_R_ARM_TLS_IE32 = 107
  8197. const m_R_ARM_TLS_LDM32 = 105
  8198. const m_R_ARM_TLS_LDO12 = 109
  8199. const m_R_ARM_TLS_LDO32 = 106
  8200. const m_R_ARM_TLS_LE12 = 110
  8201. const m_R_ARM_TLS_LE32 = 108
  8202. const m_R_ARM_TLS_TPOFF32 = 19
  8203. const m_R_ARM_V4BX = 40
  8204. const m_R_ARM_XPC25 = 15
  8205. const m_R_BPF_MAP_FD = 1
  8206. const m_R_BPF_NONE = 0
  8207. const m_R_CKCORE_ADDR32 = 1
  8208. const m_R_CKCORE_ADDRGOT = 17
  8209. const m_R_CKCORE_ADDRGOT_HI16 = 36
  8210. const m_R_CKCORE_ADDRGOT_LO16 = 37
  8211. const m_R_CKCORE_ADDRPLT = 18
  8212. const m_R_CKCORE_ADDRPLT_HI16 = 38
  8213. const m_R_CKCORE_ADDRPLT_LO16 = 39
  8214. const m_R_CKCORE_ADDR_HI16 = 24
  8215. const m_R_CKCORE_ADDR_LO16 = 25
  8216. const m_R_CKCORE_COPY = 10
  8217. const m_R_CKCORE_DOFFSET_IMM18 = 44
  8218. const m_R_CKCORE_DOFFSET_IMM18BY2 = 45
  8219. const m_R_CKCORE_DOFFSET_IMM18BY4 = 46
  8220. const m_R_CKCORE_DOFFSET_LO16 = 42
  8221. const m_R_CKCORE_GLOB_DAT = 11
  8222. const m_R_CKCORE_GOT12 = 30
  8223. const m_R_CKCORE_GOT32 = 15
  8224. const m_R_CKCORE_GOTOFF = 13
  8225. const m_R_CKCORE_GOTOFF_HI16 = 28
  8226. const m_R_CKCORE_GOTOFF_LO16 = 29
  8227. const m_R_CKCORE_GOTPC = 14
  8228. const m_R_CKCORE_GOTPC_HI16 = 26
  8229. const m_R_CKCORE_GOTPC_LO16 = 27
  8230. const m_R_CKCORE_GOT_HI16 = 31
  8231. const m_R_CKCORE_GOT_IMM18BY4 = 48
  8232. const m_R_CKCORE_GOT_LO16 = 32
  8233. const m_R_CKCORE_JUMP_SLOT = 12
  8234. const m_R_CKCORE_NONE = 0
  8235. const m_R_CKCORE_PCREL32 = 5
  8236. const m_R_CKCORE_PCRELIMM11BY2 = 3
  8237. const m_R_CKCORE_PCRELIMM8BY4 = 2
  8238. const m_R_CKCORE_PCRELJSR_IMM11BY2 = 6
  8239. const m_R_CKCORE_PCREL_IMM10BY2 = 22
  8240. const m_R_CKCORE_PCREL_IMM10BY4 = 23
  8241. const m_R_CKCORE_PCREL_IMM16BY2 = 20
  8242. const m_R_CKCORE_PCREL_IMM16BY4 = 21
  8243. const m_R_CKCORE_PCREL_IMM18BY2 = 43
  8244. const m_R_CKCORE_PCREL_IMM26BY2 = 19
  8245. const m_R_CKCORE_PCREL_IMM7BY4 = 50
  8246. const m_R_CKCORE_PCREL_JSR_IMM26BY2 = 40
  8247. const m_R_CKCORE_PLT12 = 33
  8248. const m_R_CKCORE_PLT32 = 16
  8249. const m_R_CKCORE_PLT_HI16 = 34
  8250. const m_R_CKCORE_PLT_IMM18BY4 = 49
  8251. const m_R_CKCORE_PLT_LO16 = 35
  8252. const m_R_CKCORE_RELATIVE = 9
  8253. const m_R_CKCORE_TLS_DTPMOD32 = 56
  8254. const m_R_CKCORE_TLS_DTPOFF32 = 57
  8255. const m_R_CKCORE_TLS_GD32 = 53
  8256. const m_R_CKCORE_TLS_IE32 = 52
  8257. const m_R_CKCORE_TLS_LDM32 = 54
  8258. const m_R_CKCORE_TLS_LDO32 = 55
  8259. const m_R_CKCORE_TLS_LE32 = 51
  8260. const m_R_CKCORE_TLS_TPOFF32 = 58
  8261. const m_R_CKCORE_TOFFSET_LO16 = 41
  8262. const m_R_CRIS_16 = 2
  8263. const m_R_CRIS_16_GOT = 13
  8264. const m_R_CRIS_16_GOTPLT = 15
  8265. const m_R_CRIS_16_PCREL = 5
  8266. const m_R_CRIS_32 = 3
  8267. const m_R_CRIS_32_GOT = 14
  8268. const m_R_CRIS_32_GOTPLT = 16
  8269. const m_R_CRIS_32_GOTREL = 17
  8270. const m_R_CRIS_32_PCREL = 6
  8271. const m_R_CRIS_32_PLT_GOTREL = 18
  8272. const m_R_CRIS_32_PLT_PCREL = 19
  8273. const m_R_CRIS_8 = 1
  8274. const m_R_CRIS_8_PCREL = 4
  8275. const m_R_CRIS_COPY = 9
  8276. const m_R_CRIS_GLOB_DAT = 10
  8277. const m_R_CRIS_GNU_VTENTRY = 8
  8278. const m_R_CRIS_GNU_VTINHERIT = 7
  8279. const m_R_CRIS_JUMP_SLOT = 11
  8280. const m_R_CRIS_NONE = 0
  8281. const m_R_CRIS_NUM = 20
  8282. const m_R_CRIS_RELATIVE = 12
  8283. const m_R_IA64_COPY = 0x84
  8284. const m_R_IA64_DIR32LSB = 0x25
  8285. const m_R_IA64_DIR32MSB = 0x24
  8286. const m_R_IA64_DIR64LSB = 0x27
  8287. const m_R_IA64_DIR64MSB = 0x26
  8288. const m_R_IA64_DTPMOD64LSB = 0xa7
  8289. const m_R_IA64_DTPMOD64MSB = 0xa6
  8290. const m_R_IA64_DTPREL14 = 0xb1
  8291. const m_R_IA64_DTPREL22 = 0xb2
  8292. const m_R_IA64_DTPREL32LSB = 0xb5
  8293. const m_R_IA64_DTPREL32MSB = 0xb4
  8294. const m_R_IA64_DTPREL64I = 0xb3
  8295. const m_R_IA64_DTPREL64LSB = 0xb7
  8296. const m_R_IA64_DTPREL64MSB = 0xb6
  8297. const m_R_IA64_FPTR32LSB = 0x45
  8298. const m_R_IA64_FPTR32MSB = 0x44
  8299. const m_R_IA64_FPTR64I = 0x43
  8300. const m_R_IA64_FPTR64LSB = 0x47
  8301. const m_R_IA64_FPTR64MSB = 0x46
  8302. const m_R_IA64_GPREL22 = 0x2a
  8303. const m_R_IA64_GPREL32LSB = 0x2d
  8304. const m_R_IA64_GPREL32MSB = 0x2c
  8305. const m_R_IA64_GPREL64I = 0x2b
  8306. const m_R_IA64_GPREL64LSB = 0x2f
  8307. const m_R_IA64_GPREL64MSB = 0x2e
  8308. const m_R_IA64_IMM14 = 0x21
  8309. const m_R_IA64_IMM22 = 0x22
  8310. const m_R_IA64_IMM64 = 0x23
  8311. const m_R_IA64_IPLTLSB = 0x81
  8312. const m_R_IA64_IPLTMSB = 0x80
  8313. const m_R_IA64_LDXMOV = 0x87
  8314. const m_R_IA64_LTOFF22 = 0x32
  8315. const m_R_IA64_LTOFF22X = 0x86
  8316. const m_R_IA64_LTOFF64I = 0x33
  8317. const m_R_IA64_LTOFF_DTPMOD22 = 0xaa
  8318. const m_R_IA64_LTOFF_DTPREL22 = 0xba
  8319. const m_R_IA64_LTOFF_FPTR22 = 0x52
  8320. const m_R_IA64_LTOFF_FPTR32LSB = 0x55
  8321. const m_R_IA64_LTOFF_FPTR32MSB = 0x54
  8322. const m_R_IA64_LTOFF_FPTR64I = 0x53
  8323. const m_R_IA64_LTOFF_FPTR64LSB = 0x57
  8324. const m_R_IA64_LTOFF_FPTR64MSB = 0x56
  8325. const m_R_IA64_LTOFF_TPREL22 = 0x9a
  8326. const m_R_IA64_LTV32LSB = 0x75
  8327. const m_R_IA64_LTV32MSB = 0x74
  8328. const m_R_IA64_LTV64LSB = 0x77
  8329. const m_R_IA64_LTV64MSB = 0x76
  8330. const m_R_IA64_NONE = 0x00
  8331. const m_R_IA64_PCREL21B = 0x49
  8332. const m_R_IA64_PCREL21BI = 0x79
  8333. const m_R_IA64_PCREL21F = 0x4b
  8334. const m_R_IA64_PCREL21M = 0x4a
  8335. const m_R_IA64_PCREL22 = 0x7a
  8336. const m_R_IA64_PCREL32LSB = 0x4d
  8337. const m_R_IA64_PCREL32MSB = 0x4c
  8338. const m_R_IA64_PCREL60B = 0x48
  8339. const m_R_IA64_PCREL64I = 0x7b
  8340. const m_R_IA64_PCREL64LSB = 0x4f
  8341. const m_R_IA64_PCREL64MSB = 0x4e
  8342. const m_R_IA64_PLTOFF22 = 0x3a
  8343. const m_R_IA64_PLTOFF64I = 0x3b
  8344. const m_R_IA64_PLTOFF64LSB = 0x3f
  8345. const m_R_IA64_PLTOFF64MSB = 0x3e
  8346. const m_R_IA64_REL32LSB = 0x6d
  8347. const m_R_IA64_REL32MSB = 0x6c
  8348. const m_R_IA64_REL64LSB = 0x6f
  8349. const m_R_IA64_REL64MSB = 0x6e
  8350. const m_R_IA64_SECREL32LSB = 0x65
  8351. const m_R_IA64_SECREL32MSB = 0x64
  8352. const m_R_IA64_SECREL64LSB = 0x67
  8353. const m_R_IA64_SECREL64MSB = 0x66
  8354. const m_R_IA64_SEGREL32LSB = 0x5d
  8355. const m_R_IA64_SEGREL32MSB = 0x5c
  8356. const m_R_IA64_SEGREL64LSB = 0x5f
  8357. const m_R_IA64_SEGREL64MSB = 0x5e
  8358. const m_R_IA64_SUB = 0x85
  8359. const m_R_IA64_TPREL14 = 0x91
  8360. const m_R_IA64_TPREL22 = 0x92
  8361. const m_R_IA64_TPREL64I = 0x93
  8362. const m_R_IA64_TPREL64LSB = 0x97
  8363. const m_R_IA64_TPREL64MSB = 0x96
  8364. const m_R_LARCH_32 = 1
  8365. const m_R_LARCH_32_PCREL = 99
  8366. const m_R_LARCH_64 = 2
  8367. const m_R_LARCH_ABS64_HI12 = 70
  8368. const m_R_LARCH_ABS64_LO20 = 69
  8369. const m_R_LARCH_ABS_HI20 = 67
  8370. const m_R_LARCH_ABS_LO12 = 68
  8371. const m_R_LARCH_ADD16 = 48
  8372. const m_R_LARCH_ADD24 = 49
  8373. const m_R_LARCH_ADD32 = 50
  8374. const m_R_LARCH_ADD64 = 51
  8375. const m_R_LARCH_ADD8 = 47
  8376. const m_R_LARCH_B16 = 64
  8377. const m_R_LARCH_B21 = 65
  8378. const m_R_LARCH_B26 = 66
  8379. const m_R_LARCH_COPY = 4
  8380. const m_R_LARCH_GNU_VTENTRY = 58
  8381. const m_R_LARCH_GNU_VTINHERIT = 57
  8382. const m_R_LARCH_GOT64_HI12 = 82
  8383. const m_R_LARCH_GOT64_LO20 = 81
  8384. const m_R_LARCH_GOT64_PC_HI12 = 78
  8385. const m_R_LARCH_GOT64_PC_LO20 = 77
  8386. const m_R_LARCH_GOT_HI20 = 79
  8387. const m_R_LARCH_GOT_LO12 = 80
  8388. const m_R_LARCH_GOT_PC_HI20 = 75
  8389. const m_R_LARCH_GOT_PC_LO12 = 76
  8390. const m_R_LARCH_IRELATIVE = 12
  8391. const m_R_LARCH_JUMP_SLOT = 5
  8392. const m_R_LARCH_MARK_LA = 20
  8393. const m_R_LARCH_MARK_PCREL = 21
  8394. const m_R_LARCH_NONE = 0
  8395. const m_R_LARCH_PCALA64_HI12 = 74
  8396. const m_R_LARCH_PCALA64_LO20 = 73
  8397. const m_R_LARCH_PCALA_HI20 = 71
  8398. const m_R_LARCH_PCALA_LO12 = 72
  8399. const m_R_LARCH_RELATIVE = 3
  8400. const m_R_LARCH_RELAX = 100
  8401. const m_R_LARCH_SOP_ADD = 35
  8402. const m_R_LARCH_SOP_AND = 36
  8403. const m_R_LARCH_SOP_ASSERT = 30
  8404. const m_R_LARCH_SOP_IF_ELSE = 37
  8405. const m_R_LARCH_SOP_NOT = 31
  8406. const m_R_LARCH_SOP_POP_32_S_0_10_10_16_S2 = 45
  8407. const m_R_LARCH_SOP_POP_32_S_0_5_10_16_S2 = 44
  8408. const m_R_LARCH_SOP_POP_32_S_10_12 = 40
  8409. const m_R_LARCH_SOP_POP_32_S_10_16 = 41
  8410. const m_R_LARCH_SOP_POP_32_S_10_16_S2 = 42
  8411. const m_R_LARCH_SOP_POP_32_S_10_5 = 38
  8412. const m_R_LARCH_SOP_POP_32_S_5_20 = 43
  8413. const m_R_LARCH_SOP_POP_32_U = 46
  8414. const m_R_LARCH_SOP_POP_32_U_10_12 = 39
  8415. const m_R_LARCH_SOP_PUSH_ABSOLUTE = 23
  8416. const m_R_LARCH_SOP_PUSH_DUP = 24
  8417. const m_R_LARCH_SOP_PUSH_GPREL = 25
  8418. const m_R_LARCH_SOP_PUSH_PCREL = 22
  8419. const m_R_LARCH_SOP_PUSH_PLT_PCREL = 29
  8420. const m_R_LARCH_SOP_PUSH_TLS_GD = 28
  8421. const m_R_LARCH_SOP_PUSH_TLS_GOT = 27
  8422. const m_R_LARCH_SOP_PUSH_TLS_TPREL = 26
  8423. const m_R_LARCH_SOP_SL = 33
  8424. const m_R_LARCH_SOP_SR = 34
  8425. const m_R_LARCH_SOP_SUB = 32
  8426. const m_R_LARCH_SUB16 = 53
  8427. const m_R_LARCH_SUB24 = 54
  8428. const m_R_LARCH_SUB32 = 55
  8429. const m_R_LARCH_SUB64 = 56
  8430. const m_R_LARCH_SUB8 = 52
  8431. const m_R_LARCH_TLS_DTPMOD32 = 6
  8432. const m_R_LARCH_TLS_DTPMOD64 = 7
  8433. const m_R_LARCH_TLS_DTPREL32 = 8
  8434. const m_R_LARCH_TLS_DTPREL64 = 9
  8435. const m_R_LARCH_TLS_GD_HI20 = 98
  8436. const m_R_LARCH_TLS_GD_PC_HI20 = 97
  8437. const m_R_LARCH_TLS_IE64_HI12 = 94
  8438. const m_R_LARCH_TLS_IE64_LO20 = 93
  8439. const m_R_LARCH_TLS_IE64_PC_HI12 = 90
  8440. const m_R_LARCH_TLS_IE64_PC_LO20 = 89
  8441. const m_R_LARCH_TLS_IE_HI20 = 91
  8442. const m_R_LARCH_TLS_IE_LO12 = 92
  8443. const m_R_LARCH_TLS_IE_PC_HI20 = 87
  8444. const m_R_LARCH_TLS_IE_PC_LO12 = 88
  8445. const m_R_LARCH_TLS_LD_HI20 = 96
  8446. const m_R_LARCH_TLS_LD_PC_HI20 = 95
  8447. const m_R_LARCH_TLS_LE64_HI12 = 86
  8448. const m_R_LARCH_TLS_LE64_LO20 = 85
  8449. const m_R_LARCH_TLS_LE_HI20 = 83
  8450. const m_R_LARCH_TLS_LE_LO12 = 84
  8451. const m_R_LARCH_TLS_TPREL32 = 10
  8452. const m_R_LARCH_TLS_TPREL64 = 11
  8453. const m_R_M32R_10_PCREL = 4
  8454. const m_R_M32R_10_PCREL_RELA = 36
  8455. const m_R_M32R_16 = 1
  8456. const m_R_M32R_16_RELA = 33
  8457. const m_R_M32R_18_PCREL = 5
  8458. const m_R_M32R_18_PCREL_RELA = 37
  8459. const m_R_M32R_24 = 3
  8460. const m_R_M32R_24_RELA = 35
  8461. const m_R_M32R_26_PCREL = 6
  8462. const m_R_M32R_26_PCREL_RELA = 38
  8463. const m_R_M32R_26_PLTREL = 49
  8464. const m_R_M32R_32 = 2
  8465. const m_R_M32R_32_RELA = 34
  8466. const m_R_M32R_COPY = 50
  8467. const m_R_M32R_GLOB_DAT = 51
  8468. const m_R_M32R_GNU_VTENTRY = 12
  8469. const m_R_M32R_GNU_VTINHERIT = 11
  8470. const m_R_M32R_GOT16_HI_SLO = 57
  8471. const m_R_M32R_GOT16_HI_ULO = 56
  8472. const m_R_M32R_GOT16_LO = 58
  8473. const m_R_M32R_GOT24 = 48
  8474. const m_R_M32R_GOTOFF = 54
  8475. const m_R_M32R_GOTOFF_HI_SLO = 63
  8476. const m_R_M32R_GOTOFF_HI_ULO = 62
  8477. const m_R_M32R_GOTOFF_LO = 64
  8478. const m_R_M32R_GOTPC24 = 55
  8479. const m_R_M32R_GOTPC_HI_SLO = 60
  8480. const m_R_M32R_GOTPC_HI_ULO = 59
  8481. const m_R_M32R_GOTPC_LO = 61
  8482. const m_R_M32R_HI16_SLO = 8
  8483. const m_R_M32R_HI16_SLO_RELA = 40
  8484. const m_R_M32R_HI16_ULO = 7
  8485. const m_R_M32R_HI16_ULO_RELA = 39
  8486. const m_R_M32R_JMP_SLOT = 52
  8487. const m_R_M32R_LO16 = 9
  8488. const m_R_M32R_LO16_RELA = 41
  8489. const m_R_M32R_NONE = 0
  8490. const m_R_M32R_NUM = 256
  8491. const m_R_M32R_REL32 = 45
  8492. const m_R_M32R_RELATIVE = 53
  8493. const m_R_M32R_RELA_GNU_VTENTRY = 44
  8494. const m_R_M32R_RELA_GNU_VTINHERIT = 43
  8495. const m_R_M32R_SDA16 = 10
  8496. const m_R_M32R_SDA16_RELA = 42
  8497. const m_R_MICROBLAZE_32 = 1
  8498. const m_R_MICROBLAZE_32_LO = 6
  8499. const m_R_MICROBLAZE_32_PCREL = 2
  8500. const m_R_MICROBLAZE_32_PCREL_LO = 4
  8501. const m_R_MICROBLAZE_32_SYM_OP_SYM = 10
  8502. const m_R_MICROBLAZE_64 = 5
  8503. const m_R_MICROBLAZE_64_NONE = 9
  8504. const m_R_MICROBLAZE_64_PCREL = 3
  8505. const m_R_MICROBLAZE_COPY = 21
  8506. const m_R_MICROBLAZE_GLOB_DAT = 18
  8507. const m_R_MICROBLAZE_GNU_VTENTRY = 12
  8508. const m_R_MICROBLAZE_GNU_VTINHERIT = 11
  8509. const m_R_MICROBLAZE_GOTOFF_32 = 20
  8510. const m_R_MICROBLAZE_GOTOFF_64 = 19
  8511. const m_R_MICROBLAZE_GOTPC_64 = 13
  8512. const m_R_MICROBLAZE_GOT_64 = 14
  8513. const m_R_MICROBLAZE_JUMP_SLOT = 17
  8514. const m_R_MICROBLAZE_NONE = 0
  8515. const m_R_MICROBLAZE_PLT_64 = 15
  8516. const m_R_MICROBLAZE_REL = 16
  8517. const m_R_MICROBLAZE_SRO32 = 7
  8518. const m_R_MICROBLAZE_SRW32 = 8
  8519. const m_R_MICROBLAZE_TLS = 22
  8520. const m_R_MICROBLAZE_TLSDTPMOD32 = 25
  8521. const m_R_MICROBLAZE_TLSDTPREL32 = 26
  8522. const m_R_MICROBLAZE_TLSDTPREL64 = 27
  8523. const m_R_MICROBLAZE_TLSGD = 23
  8524. const m_R_MICROBLAZE_TLSGOTTPREL32 = 28
  8525. const m_R_MICROBLAZE_TLSLD = 24
  8526. const m_R_MICROBLAZE_TLSTPREL32 = 29
  8527. const m_R_MIPS_16 = 1
  8528. const m_R_MIPS_26 = 4
  8529. const m_R_MIPS_32 = 2
  8530. const m_R_MIPS_64 = 18
  8531. const m_R_MIPS_ADD_IMMEDIATE = 34
  8532. const m_R_MIPS_CALL16 = 11
  8533. const m_R_MIPS_CALL_HI16 = 30
  8534. const m_R_MIPS_CALL_LO16 = 31
  8535. const m_R_MIPS_COPY = 126
  8536. const m_R_MIPS_DELETE = 27
  8537. const m_R_MIPS_GLOB_DAT = 51
  8538. const m_R_MIPS_GOT16 = 9
  8539. const m_R_MIPS_GOT_DISP = 19
  8540. const m_R_MIPS_GOT_HI16 = 22
  8541. const m_R_MIPS_GOT_LO16 = 23
  8542. const m_R_MIPS_GOT_OFST = 21
  8543. const m_R_MIPS_GOT_PAGE = 20
  8544. const m_R_MIPS_GPREL16 = 7
  8545. const m_R_MIPS_GPREL32 = 12
  8546. const m_R_MIPS_HI16 = 5
  8547. const m_R_MIPS_HIGHER = 28
  8548. const m_R_MIPS_HIGHEST = 29
  8549. const m_R_MIPS_INSERT_A = 25
  8550. const m_R_MIPS_INSERT_B = 26
  8551. const m_R_MIPS_JALR = 37
  8552. const m_R_MIPS_JUMP_SLOT = 127
  8553. const m_R_MIPS_LITERAL = 8
  8554. const m_R_MIPS_LO16 = 6
  8555. const m_R_MIPS_NONE = 0
  8556. const m_R_MIPS_NUM = 128
  8557. const m_R_MIPS_PC16 = 10
  8558. const m_R_MIPS_PJUMP = 35
  8559. const m_R_MIPS_REL16 = 33
  8560. const m_R_MIPS_REL32 = 3
  8561. const m_R_MIPS_RELGOT = 36
  8562. const m_R_MIPS_SCN_DISP = 32
  8563. const m_R_MIPS_SHIFT5 = 16
  8564. const m_R_MIPS_SHIFT6 = 17
  8565. const m_R_MIPS_SUB = 24
  8566. const m_R_MIPS_TLS_DTPMOD32 = 38
  8567. const m_R_MIPS_TLS_DTPMOD64 = 40
  8568. const m_R_MIPS_TLS_DTPREL32 = 39
  8569. const m_R_MIPS_TLS_DTPREL64 = 41
  8570. const m_R_MIPS_TLS_DTPREL_HI16 = 44
  8571. const m_R_MIPS_TLS_DTPREL_LO16 = 45
  8572. const m_R_MIPS_TLS_GD = 42
  8573. const m_R_MIPS_TLS_GOTTPREL = 46
  8574. const m_R_MIPS_TLS_LDM = 43
  8575. const m_R_MIPS_TLS_TPREL32 = 47
  8576. const m_R_MIPS_TLS_TPREL64 = 48
  8577. const m_R_MIPS_TLS_TPREL_HI16 = 49
  8578. const m_R_MIPS_TLS_TPREL_LO16 = 50
  8579. const m_R_MN10300_16 = 2
  8580. const m_R_MN10300_24 = 9
  8581. const m_R_MN10300_32 = 1
  8582. const m_R_MN10300_8 = 3
  8583. const m_R_MN10300_COPY = 20
  8584. const m_R_MN10300_GLOB_DAT = 21
  8585. const m_R_MN10300_GNU_VTENTRY = 8
  8586. const m_R_MN10300_GNU_VTINHERIT = 7
  8587. const m_R_MN10300_GOT16 = 19
  8588. const m_R_MN10300_GOT24 = 18
  8589. const m_R_MN10300_GOT32 = 17
  8590. const m_R_MN10300_GOTOFF16 = 14
  8591. const m_R_MN10300_GOTOFF24 = 13
  8592. const m_R_MN10300_GOTOFF32 = 12
  8593. const m_R_MN10300_GOTPC16 = 11
  8594. const m_R_MN10300_GOTPC32 = 10
  8595. const m_R_MN10300_JMP_SLOT = 22
  8596. const m_R_MN10300_NONE = 0
  8597. const m_R_MN10300_NUM = 24
  8598. const m_R_MN10300_PCREL16 = 5
  8599. const m_R_MN10300_PCREL32 = 4
  8600. const m_R_MN10300_PCREL8 = 6
  8601. const m_R_MN10300_PLT16 = 16
  8602. const m_R_MN10300_PLT32 = 15
  8603. const m_R_MN10300_RELATIVE = 23
  8604. const m_R_NIOS2_ALIGN = 21
  8605. const m_R_NIOS2_BFD_RELOC_16 = 13
  8606. const m_R_NIOS2_BFD_RELOC_32 = 12
  8607. const m_R_NIOS2_BFD_RELOC_8 = 14
  8608. const m_R_NIOS2_CACHE_OPX = 6
  8609. const m_R_NIOS2_CALL16 = 23
  8610. const m_R_NIOS2_CALL26 = 4
  8611. const m_R_NIOS2_CALL26_NOAT = 41
  8612. const m_R_NIOS2_CALLR = 20
  8613. const m_R_NIOS2_CALL_HA = 45
  8614. const m_R_NIOS2_CALL_LO = 44
  8615. const m_R_NIOS2_CJMP = 19
  8616. const m_R_NIOS2_COPY = 36
  8617. const m_R_NIOS2_GLOB_DAT = 37
  8618. const m_R_NIOS2_GNU_VTENTRY = 17
  8619. const m_R_NIOS2_GNU_VTINHERIT = 16
  8620. const m_R_NIOS2_GOT16 = 22
  8621. const m_R_NIOS2_GOTOFF = 40
  8622. const m_R_NIOS2_GOTOFF_HA = 25
  8623. const m_R_NIOS2_GOTOFF_LO = 24
  8624. const m_R_NIOS2_GOT_HA = 43
  8625. const m_R_NIOS2_GOT_LO = 42
  8626. const m_R_NIOS2_GPREL = 15
  8627. const m_R_NIOS2_HI16 = 9
  8628. const m_R_NIOS2_HIADJ16 = 11
  8629. const m_R_NIOS2_IMM5 = 5
  8630. const m_R_NIOS2_IMM6 = 7
  8631. const m_R_NIOS2_IMM8 = 8
  8632. const m_R_NIOS2_JUMP_SLOT = 38
  8633. const m_R_NIOS2_LO16 = 10
  8634. const m_R_NIOS2_NONE = 0
  8635. const m_R_NIOS2_PCREL16 = 3
  8636. const m_R_NIOS2_PCREL_HA = 27
  8637. const m_R_NIOS2_PCREL_LO = 26
  8638. const m_R_NIOS2_RELATIVE = 39
  8639. const m_R_NIOS2_S16 = 1
  8640. const m_R_NIOS2_TLS_DTPMOD = 33
  8641. const m_R_NIOS2_TLS_DTPREL = 34
  8642. const m_R_NIOS2_TLS_GD16 = 28
  8643. const m_R_NIOS2_TLS_IE16 = 31
  8644. const m_R_NIOS2_TLS_LDM16 = 29
  8645. const m_R_NIOS2_TLS_LDO16 = 30
  8646. const m_R_NIOS2_TLS_LE16 = 32
  8647. const m_R_NIOS2_TLS_TPREL = 35
  8648. const m_R_NIOS2_U16 = 2
  8649. const m_R_NIOS2_UJMP = 18
  8650. const m_R_OR1K_16 = 2
  8651. const m_R_OR1K_16_PCREL = 10
  8652. const m_R_OR1K_32 = 1
  8653. const m_R_OR1K_32_PCREL = 9
  8654. const m_R_OR1K_8 = 3
  8655. const m_R_OR1K_8_PCREL = 11
  8656. const m_R_OR1K_COPY = 18
  8657. const m_R_OR1K_GLOB_DAT = 19
  8658. const m_R_OR1K_GNU_VTENTRY = 7
  8659. const m_R_OR1K_GNU_VTINHERIT = 8
  8660. const m_R_OR1K_GOT16 = 14
  8661. const m_R_OR1K_GOTOFF_HI16 = 16
  8662. const m_R_OR1K_GOTOFF_LO16 = 17
  8663. const m_R_OR1K_GOTPC_HI16 = 12
  8664. const m_R_OR1K_GOTPC_LO16 = 13
  8665. const m_R_OR1K_HI_16_IN_INSN = 5
  8666. const m_R_OR1K_INSN_REL_26 = 6
  8667. const m_R_OR1K_JMP_SLOT = 20
  8668. const m_R_OR1K_LO_16_IN_INSN = 4
  8669. const m_R_OR1K_NONE = 0
  8670. const m_R_OR1K_PLT26 = 15
  8671. const m_R_OR1K_RELATIVE = 21
  8672. const m_R_OR1K_TLS_DTPMOD = 34
  8673. const m_R_OR1K_TLS_DTPOFF = 33
  8674. const m_R_OR1K_TLS_GD_HI16 = 22
  8675. const m_R_OR1K_TLS_GD_LO16 = 23
  8676. const m_R_OR1K_TLS_IE_HI16 = 28
  8677. const m_R_OR1K_TLS_IE_LO16 = 29
  8678. const m_R_OR1K_TLS_LDM_HI16 = 24
  8679. const m_R_OR1K_TLS_LDM_LO16 = 25
  8680. const m_R_OR1K_TLS_LDO_HI16 = 26
  8681. const m_R_OR1K_TLS_LDO_LO16 = 27
  8682. const m_R_OR1K_TLS_LE_HI16 = 30
  8683. const m_R_OR1K_TLS_LE_LO16 = 31
  8684. const m_R_OR1K_TLS_TPOFF = 32
  8685. const m_R_PARISC_COPY = 128
  8686. const m_R_PARISC_DIR14DR = 84
  8687. const m_R_PARISC_DIR14R = 6
  8688. const m_R_PARISC_DIR14WR = 83
  8689. const m_R_PARISC_DIR16DF = 87
  8690. const m_R_PARISC_DIR16F = 85
  8691. const m_R_PARISC_DIR16WF = 86
  8692. const m_R_PARISC_DIR17F = 4
  8693. const m_R_PARISC_DIR17R = 3
  8694. const m_R_PARISC_DIR21L = 2
  8695. const m_R_PARISC_DIR32 = 1
  8696. const m_R_PARISC_DIR64 = 80
  8697. const m_R_PARISC_DPREL14R = 22
  8698. const m_R_PARISC_DPREL21L = 18
  8699. const m_R_PARISC_EPLT = 130
  8700. const m_R_PARISC_FPTR64 = 64
  8701. const m_R_PARISC_GNU_VTENTRY = 232
  8702. const m_R_PARISC_GNU_VTINHERIT = 233
  8703. const m_R_PARISC_GPREL14DR = 92
  8704. const m_R_PARISC_GPREL14R = 30
  8705. const m_R_PARISC_GPREL14WR = 91
  8706. const m_R_PARISC_GPREL16DF = 95
  8707. const m_R_PARISC_GPREL16F = 93
  8708. const m_R_PARISC_GPREL16WF = 94
  8709. const m_R_PARISC_GPREL21L = 26
  8710. const m_R_PARISC_GPREL64 = 88
  8711. const m_R_PARISC_HIRESERVE = 255
  8712. const m_R_PARISC_IPLT = 129
  8713. const m_R_PARISC_LORESERVE = 128
  8714. const m_R_PARISC_LTOFF14DR = 100
  8715. const m_R_PARISC_LTOFF14R = 38
  8716. const m_R_PARISC_LTOFF14WR = 99
  8717. const m_R_PARISC_LTOFF16DF = 103
  8718. const m_R_PARISC_LTOFF16F = 101
  8719. const m_R_PARISC_LTOFF16WF = 102
  8720. const m_R_PARISC_LTOFF21L = 34
  8721. const m_R_PARISC_LTOFF64 = 96
  8722. const m_R_PARISC_LTOFF_FPTR14DR = 124
  8723. const m_R_PARISC_LTOFF_FPTR14R = 62
  8724. const m_R_PARISC_LTOFF_FPTR14WR = 123
  8725. const m_R_PARISC_LTOFF_FPTR16DF = 127
  8726. const m_R_PARISC_LTOFF_FPTR16F = 125
  8727. const m_R_PARISC_LTOFF_FPTR16WF = 126
  8728. const m_R_PARISC_LTOFF_FPTR21L = 58
  8729. const m_R_PARISC_LTOFF_FPTR32 = 57
  8730. const m_R_PARISC_LTOFF_FPTR64 = 120
  8731. const m_R_PARISC_LTOFF_TP14DR = 228
  8732. const m_R_PARISC_LTOFF_TP14F = 167
  8733. const m_R_PARISC_LTOFF_TP14R = 166
  8734. const m_R_PARISC_LTOFF_TP14WR = 227
  8735. const m_R_PARISC_LTOFF_TP16DF = 231
  8736. const m_R_PARISC_LTOFF_TP16F = 229
  8737. const m_R_PARISC_LTOFF_TP16WF = 230
  8738. const m_R_PARISC_LTOFF_TP21L = 162
  8739. const m_R_PARISC_LTOFF_TP64 = 224
  8740. const m_R_PARISC_NONE = 0
  8741. const m_R_PARISC_PCREL14DR = 76
  8742. const m_R_PARISC_PCREL14R = 14
  8743. const m_R_PARISC_PCREL14WR = 75
  8744. const m_R_PARISC_PCREL16DF = 79
  8745. const m_R_PARISC_PCREL16F = 77
  8746. const m_R_PARISC_PCREL16WF = 78
  8747. const m_R_PARISC_PCREL17F = 12
  8748. const m_R_PARISC_PCREL17R = 11
  8749. const m_R_PARISC_PCREL21L = 10
  8750. const m_R_PARISC_PCREL22F = 74
  8751. const m_R_PARISC_PCREL32 = 9
  8752. const m_R_PARISC_PCREL64 = 72
  8753. const m_R_PARISC_PLABEL14R = 70
  8754. const m_R_PARISC_PLABEL21L = 66
  8755. const m_R_PARISC_PLABEL32 = 65
  8756. const m_R_PARISC_PLTOFF14DR = 116
  8757. const m_R_PARISC_PLTOFF14R = 54
  8758. const m_R_PARISC_PLTOFF14WR = 115
  8759. const m_R_PARISC_PLTOFF16DF = 119
  8760. const m_R_PARISC_PLTOFF16F = 117
  8761. const m_R_PARISC_PLTOFF16WF = 118
  8762. const m_R_PARISC_PLTOFF21L = 50
  8763. const m_R_PARISC_SECREL32 = 41
  8764. const m_R_PARISC_SECREL64 = 104
  8765. const m_R_PARISC_SEGBASE = 48
  8766. const m_R_PARISC_SEGREL32 = 49
  8767. const m_R_PARISC_SEGREL64 = 112
  8768. const m_R_PARISC_TLS_DTPMOD32 = 242
  8769. const m_R_PARISC_TLS_DTPMOD64 = 243
  8770. const m_R_PARISC_TLS_DTPOFF32 = 244
  8771. const m_R_PARISC_TLS_DTPOFF64 = 245
  8772. const m_R_PARISC_TLS_GD14R = 235
  8773. const m_R_PARISC_TLS_GD21L = 234
  8774. const m_R_PARISC_TLS_GDCALL = 236
  8775. const m_R_PARISC_TLS_IE14R = "R_PARISC_LTOFF_TP14R"
  8776. const m_R_PARISC_TLS_IE21L = "R_PARISC_LTOFF_TP21L"
  8777. const m_R_PARISC_TLS_LDM14R = 238
  8778. const m_R_PARISC_TLS_LDM21L = 237
  8779. const m_R_PARISC_TLS_LDMCALL = 239
  8780. const m_R_PARISC_TLS_LDO14R = 241
  8781. const m_R_PARISC_TLS_LDO21L = 240
  8782. const m_R_PARISC_TLS_LE14R = "R_PARISC_TPREL14R"
  8783. const m_R_PARISC_TLS_LE21L = "R_PARISC_TPREL21L"
  8784. const m_R_PARISC_TLS_TPREL32 = "R_PARISC_TPREL32"
  8785. const m_R_PARISC_TLS_TPREL64 = "R_PARISC_TPREL64"
  8786. const m_R_PARISC_TPREL14DR = 220
  8787. const m_R_PARISC_TPREL14R = 158
  8788. const m_R_PARISC_TPREL14WR = 219
  8789. const m_R_PARISC_TPREL16DF = 223
  8790. const m_R_PARISC_TPREL16F = 221
  8791. const m_R_PARISC_TPREL16WF = 222
  8792. const m_R_PARISC_TPREL21L = 154
  8793. const m_R_PARISC_TPREL32 = 153
  8794. const m_R_PARISC_TPREL64 = 216
  8795. const m_R_PPC64_ADDR14 = "R_PPC_ADDR14"
  8796. const m_R_PPC64_ADDR14_BRNTAKEN = "R_PPC_ADDR14_BRNTAKEN"
  8797. const m_R_PPC64_ADDR14_BRTAKEN = "R_PPC_ADDR14_BRTAKEN"
  8798. const m_R_PPC64_ADDR16 = "R_PPC_ADDR16"
  8799. const m_R_PPC64_ADDR16_DS = 56
  8800. const m_R_PPC64_ADDR16_HA = "R_PPC_ADDR16_HA"
  8801. const m_R_PPC64_ADDR16_HI = "R_PPC_ADDR16_HI"
  8802. const m_R_PPC64_ADDR16_HIGH = 110
  8803. const m_R_PPC64_ADDR16_HIGHA = 111
  8804. const m_R_PPC64_ADDR16_HIGHER = 39
  8805. const m_R_PPC64_ADDR16_HIGHERA = 40
  8806. const m_R_PPC64_ADDR16_HIGHEST = 41
  8807. const m_R_PPC64_ADDR16_HIGHESTA = 42
  8808. const m_R_PPC64_ADDR16_LO = "R_PPC_ADDR16_LO"
  8809. const m_R_PPC64_ADDR16_LO_DS = 57
  8810. const m_R_PPC64_ADDR24 = "R_PPC_ADDR24"
  8811. const m_R_PPC64_ADDR30 = 37
  8812. const m_R_PPC64_ADDR32 = "R_PPC_ADDR32"
  8813. const m_R_PPC64_ADDR64 = 38
  8814. const m_R_PPC64_COPY = "R_PPC_COPY"
  8815. const m_R_PPC64_DTPMOD64 = 68
  8816. const m_R_PPC64_DTPREL16 = 74
  8817. const m_R_PPC64_DTPREL16_DS = 101
  8818. const m_R_PPC64_DTPREL16_HA = 77
  8819. const m_R_PPC64_DTPREL16_HI = 76
  8820. const m_R_PPC64_DTPREL16_HIGH = 114
  8821. const m_R_PPC64_DTPREL16_HIGHA = 115
  8822. const m_R_PPC64_DTPREL16_HIGHER = 103
  8823. const m_R_PPC64_DTPREL16_HIGHERA = 104
  8824. const m_R_PPC64_DTPREL16_HIGHEST = 105
  8825. const m_R_PPC64_DTPREL16_HIGHESTA = 106
  8826. const m_R_PPC64_DTPREL16_LO = 75
  8827. const m_R_PPC64_DTPREL16_LO_DS = 102
  8828. const m_R_PPC64_DTPREL64 = 78
  8829. const m_R_PPC64_GLOB_DAT = "R_PPC_GLOB_DAT"
  8830. const m_R_PPC64_GOT16 = "R_PPC_GOT16"
  8831. const m_R_PPC64_GOT16_DS = 58
  8832. const m_R_PPC64_GOT16_HA = "R_PPC_GOT16_HA"
  8833. const m_R_PPC64_GOT16_HI = "R_PPC_GOT16_HI"
  8834. const m_R_PPC64_GOT16_LO = "R_PPC_GOT16_LO"
  8835. const m_R_PPC64_GOT16_LO_DS = 59
  8836. const m_R_PPC64_GOT_DTPREL16_DS = 91
  8837. const m_R_PPC64_GOT_DTPREL16_HA = 94
  8838. const m_R_PPC64_GOT_DTPREL16_HI = 93
  8839. const m_R_PPC64_GOT_DTPREL16_LO_DS = 92
  8840. const m_R_PPC64_GOT_TLSGD16 = 79
  8841. const m_R_PPC64_GOT_TLSGD16_HA = 82
  8842. const m_R_PPC64_GOT_TLSGD16_HI = 81
  8843. const m_R_PPC64_GOT_TLSGD16_LO = 80
  8844. const m_R_PPC64_GOT_TLSLD16 = 83
  8845. const m_R_PPC64_GOT_TLSLD16_HA = 86
  8846. const m_R_PPC64_GOT_TLSLD16_HI = 85
  8847. const m_R_PPC64_GOT_TLSLD16_LO = 84
  8848. const m_R_PPC64_GOT_TPREL16_DS = 87
  8849. const m_R_PPC64_GOT_TPREL16_HA = 90
  8850. const m_R_PPC64_GOT_TPREL16_HI = 89
  8851. const m_R_PPC64_GOT_TPREL16_LO_DS = 88
  8852. const m_R_PPC64_IRELATIVE = 248
  8853. const m_R_PPC64_JMP_IREL = 247
  8854. const m_R_PPC64_JMP_SLOT = "R_PPC_JMP_SLOT"
  8855. const m_R_PPC64_NONE = "R_PPC_NONE"
  8856. const m_R_PPC64_PLT16_HA = "R_PPC_PLT16_HA"
  8857. const m_R_PPC64_PLT16_HI = "R_PPC_PLT16_HI"
  8858. const m_R_PPC64_PLT16_LO = "R_PPC_PLT16_LO"
  8859. const m_R_PPC64_PLT16_LO_DS = 60
  8860. const m_R_PPC64_PLT32 = "R_PPC_PLT32"
  8861. const m_R_PPC64_PLT64 = 45
  8862. const m_R_PPC64_PLTGOT16 = 52
  8863. const m_R_PPC64_PLTGOT16_DS = 65
  8864. const m_R_PPC64_PLTGOT16_HA = 55
  8865. const m_R_PPC64_PLTGOT16_HI = 54
  8866. const m_R_PPC64_PLTGOT16_LO = 53
  8867. const m_R_PPC64_PLTGOT16_LO_DS = 66
  8868. const m_R_PPC64_PLTREL32 = "R_PPC_PLTREL32"
  8869. const m_R_PPC64_PLTREL64 = 46
  8870. const m_R_PPC64_REL14 = "R_PPC_REL14"
  8871. const m_R_PPC64_REL14_BRNTAKEN = "R_PPC_REL14_BRNTAKEN"
  8872. const m_R_PPC64_REL14_BRTAKEN = "R_PPC_REL14_BRTAKEN"
  8873. const m_R_PPC64_REL16 = 249
  8874. const m_R_PPC64_REL16_HA = 252
  8875. const m_R_PPC64_REL16_HI = 251
  8876. const m_R_PPC64_REL16_LO = 250
  8877. const m_R_PPC64_REL24 = "R_PPC_REL24"
  8878. const m_R_PPC64_REL32 = "R_PPC_REL32"
  8879. const m_R_PPC64_REL64 = 44
  8880. const m_R_PPC64_RELATIVE = "R_PPC_RELATIVE"
  8881. const m_R_PPC64_SECTOFF = "R_PPC_SECTOFF"
  8882. const m_R_PPC64_SECTOFF_DS = 61
  8883. const m_R_PPC64_SECTOFF_HA = "R_PPC_SECTOFF_HA"
  8884. const m_R_PPC64_SECTOFF_HI = "R_PPC_SECTOFF_HI"
  8885. const m_R_PPC64_SECTOFF_LO = "R_PPC_SECTOFF_LO"
  8886. const m_R_PPC64_SECTOFF_LO_DS = 62
  8887. const m_R_PPC64_TLS = 67
  8888. const m_R_PPC64_TLSGD = 107
  8889. const m_R_PPC64_TLSLD = 108
  8890. const m_R_PPC64_TOC = 51
  8891. const m_R_PPC64_TOC16 = 47
  8892. const m_R_PPC64_TOC16_DS = 63
  8893. const m_R_PPC64_TOC16_HA = 50
  8894. const m_R_PPC64_TOC16_HI = 49
  8895. const m_R_PPC64_TOC16_LO = 48
  8896. const m_R_PPC64_TOC16_LO_DS = 64
  8897. const m_R_PPC64_TOCSAVE = 109
  8898. const m_R_PPC64_TPREL16 = 69
  8899. const m_R_PPC64_TPREL16_DS = 95
  8900. const m_R_PPC64_TPREL16_HA = 72
  8901. const m_R_PPC64_TPREL16_HI = 71
  8902. const m_R_PPC64_TPREL16_HIGH = 112
  8903. const m_R_PPC64_TPREL16_HIGHA = 113
  8904. const m_R_PPC64_TPREL16_HIGHER = 97
  8905. const m_R_PPC64_TPREL16_HIGHERA = 98
  8906. const m_R_PPC64_TPREL16_HIGHEST = 99
  8907. const m_R_PPC64_TPREL16_HIGHESTA = 100
  8908. const m_R_PPC64_TPREL16_LO = 70
  8909. const m_R_PPC64_TPREL16_LO_DS = 96
  8910. const m_R_PPC64_TPREL64 = 73
  8911. const m_R_PPC64_UADDR16 = "R_PPC_UADDR16"
  8912. const m_R_PPC64_UADDR32 = "R_PPC_UADDR32"
  8913. const m_R_PPC64_UADDR64 = 43
  8914. const m_R_PPC_ADDR14 = 7
  8915. const m_R_PPC_ADDR14_BRNTAKEN = 9
  8916. const m_R_PPC_ADDR14_BRTAKEN = 8
  8917. const m_R_PPC_ADDR16 = 3
  8918. const m_R_PPC_ADDR16_HA = 6
  8919. const m_R_PPC_ADDR16_HI = 5
  8920. const m_R_PPC_ADDR16_LO = 4
  8921. const m_R_PPC_ADDR24 = 2
  8922. const m_R_PPC_ADDR32 = 1
  8923. const m_R_PPC_COPY = 19
  8924. const m_R_PPC_DIAB_RELSDA_HA = 185
  8925. const m_R_PPC_DIAB_RELSDA_HI = 184
  8926. const m_R_PPC_DIAB_RELSDA_LO = 183
  8927. const m_R_PPC_DIAB_SDA21_HA = 182
  8928. const m_R_PPC_DIAB_SDA21_HI = 181
  8929. const m_R_PPC_DIAB_SDA21_LO = 180
  8930. const m_R_PPC_DTPMOD32 = 68
  8931. const m_R_PPC_DTPREL16 = 74
  8932. const m_R_PPC_DTPREL16_HA = 77
  8933. const m_R_PPC_DTPREL16_HI = 76
  8934. const m_R_PPC_DTPREL16_LO = 75
  8935. const m_R_PPC_DTPREL32 = 78
  8936. const m_R_PPC_EMB_BIT_FLD = 115
  8937. const m_R_PPC_EMB_MRKREF = 110
  8938. const m_R_PPC_EMB_NADDR16 = 102
  8939. const m_R_PPC_EMB_NADDR16_HA = 105
  8940. const m_R_PPC_EMB_NADDR16_HI = 104
  8941. const m_R_PPC_EMB_NADDR16_LO = 103
  8942. const m_R_PPC_EMB_NADDR32 = 101
  8943. const m_R_PPC_EMB_RELSDA = 116
  8944. const m_R_PPC_EMB_RELSEC16 = 111
  8945. const m_R_PPC_EMB_RELST_HA = 114
  8946. const m_R_PPC_EMB_RELST_HI = 113
  8947. const m_R_PPC_EMB_RELST_LO = 112
  8948. const m_R_PPC_EMB_SDA21 = 109
  8949. const m_R_PPC_EMB_SDA2I16 = 107
  8950. const m_R_PPC_EMB_SDA2REL = 108
  8951. const m_R_PPC_EMB_SDAI16 = 106
  8952. const m_R_PPC_GLOB_DAT = 20
  8953. const m_R_PPC_GOT16 = 14
  8954. const m_R_PPC_GOT16_HA = 17
  8955. const m_R_PPC_GOT16_HI = 16
  8956. const m_R_PPC_GOT16_LO = 15
  8957. const m_R_PPC_GOT_DTPREL16 = 91
  8958. const m_R_PPC_GOT_DTPREL16_HA = 94
  8959. const m_R_PPC_GOT_DTPREL16_HI = 93
  8960. const m_R_PPC_GOT_DTPREL16_LO = 92
  8961. const m_R_PPC_GOT_TLSGD16 = 79
  8962. const m_R_PPC_GOT_TLSGD16_HA = 82
  8963. const m_R_PPC_GOT_TLSGD16_HI = 81
  8964. const m_R_PPC_GOT_TLSGD16_LO = 80
  8965. const m_R_PPC_GOT_TLSLD16 = 83
  8966. const m_R_PPC_GOT_TLSLD16_HA = 86
  8967. const m_R_PPC_GOT_TLSLD16_HI = 85
  8968. const m_R_PPC_GOT_TLSLD16_LO = 84
  8969. const m_R_PPC_GOT_TPREL16 = 87
  8970. const m_R_PPC_GOT_TPREL16_HA = 90
  8971. const m_R_PPC_GOT_TPREL16_HI = 89
  8972. const m_R_PPC_GOT_TPREL16_LO = 88
  8973. const m_R_PPC_IRELATIVE = 248
  8974. const m_R_PPC_JMP_SLOT = 21
  8975. const m_R_PPC_LOCAL24PC = 23
  8976. const m_R_PPC_NONE = 0
  8977. const m_R_PPC_PLT16_HA = 31
  8978. const m_R_PPC_PLT16_HI = 30
  8979. const m_R_PPC_PLT16_LO = 29
  8980. const m_R_PPC_PLT32 = 27
  8981. const m_R_PPC_PLTREL24 = 18
  8982. const m_R_PPC_PLTREL32 = 28
  8983. const m_R_PPC_REL14 = 11
  8984. const m_R_PPC_REL14_BRNTAKEN = 13
  8985. const m_R_PPC_REL14_BRTAKEN = 12
  8986. const m_R_PPC_REL16 = 249
  8987. const m_R_PPC_REL16_HA = 252
  8988. const m_R_PPC_REL16_HI = 251
  8989. const m_R_PPC_REL16_LO = 250
  8990. const m_R_PPC_REL24 = 10
  8991. const m_R_PPC_REL32 = 26
  8992. const m_R_PPC_RELATIVE = 22
  8993. const m_R_PPC_SDAREL16 = 32
  8994. const m_R_PPC_SECTOFF = 33
  8995. const m_R_PPC_SECTOFF_HA = 36
  8996. const m_R_PPC_SECTOFF_HI = 35
  8997. const m_R_PPC_SECTOFF_LO = 34
  8998. const m_R_PPC_TLS = 67
  8999. const m_R_PPC_TLSGD = 95
  9000. const m_R_PPC_TLSLD = 96
  9001. const m_R_PPC_TOC16 = 255
  9002. const m_R_PPC_TPREL16 = 69
  9003. const m_R_PPC_TPREL16_HA = 72
  9004. const m_R_PPC_TPREL16_HI = 71
  9005. const m_R_PPC_TPREL16_LO = 70
  9006. const m_R_PPC_TPREL32 = 73
  9007. const m_R_PPC_UADDR16 = 25
  9008. const m_R_PPC_UADDR32 = 24
  9009. const m_R_RISCV_32 = 1
  9010. const m_R_RISCV_32_PCREL = 57
  9011. const m_R_RISCV_64 = 2
  9012. const m_R_RISCV_ADD16 = 34
  9013. const m_R_RISCV_ADD32 = 35
  9014. const m_R_RISCV_ADD64 = 36
  9015. const m_R_RISCV_ADD8 = 33
  9016. const m_R_RISCV_ALIGN = 43
  9017. const m_R_RISCV_BRANCH = 16
  9018. const m_R_RISCV_CALL = 18
  9019. const m_R_RISCV_CALL_PLT = 19
  9020. const m_R_RISCV_COPY = 4
  9021. const m_R_RISCV_GOT32_PCREL = 41
  9022. const m_R_RISCV_GOT_HI20 = 20
  9023. const m_R_RISCV_HI20 = 26
  9024. const m_R_RISCV_IRELATIVE = 58
  9025. const m_R_RISCV_JAL = 17
  9026. const m_R_RISCV_JUMP_SLOT = 5
  9027. const m_R_RISCV_LO12_I = 27
  9028. const m_R_RISCV_LO12_S = 28
  9029. const m_R_RISCV_NONE = 0
  9030. const m_R_RISCV_PCREL_HI20 = 23
  9031. const m_R_RISCV_PCREL_LO12_I = 24
  9032. const m_R_RISCV_PCREL_LO12_S = 25
  9033. const m_R_RISCV_PLT32 = 59
  9034. const m_R_RISCV_RELATIVE = 3
  9035. const m_R_RISCV_RELAX = 51
  9036. const m_R_RISCV_RVC_BRANCH = 44
  9037. const m_R_RISCV_RVC_JUMP = 45
  9038. const m_R_RISCV_RVC_LUI = 46
  9039. const m_R_RISCV_SET16 = 55
  9040. const m_R_RISCV_SET32 = 56
  9041. const m_R_RISCV_SET6 = 53
  9042. const m_R_RISCV_SET8 = 54
  9043. const m_R_RISCV_SET_ULEB128 = 60
  9044. const m_R_RISCV_SUB16 = 38
  9045. const m_R_RISCV_SUB32 = 39
  9046. const m_R_RISCV_SUB6 = 52
  9047. const m_R_RISCV_SUB64 = 40
  9048. const m_R_RISCV_SUB8 = 37
  9049. const m_R_RISCV_SUB_ULEB128 = 61
  9050. const m_R_RISCV_TLSDESC = 12
  9051. const m_R_RISCV_TLSDESC_ADD_LO12 = 64
  9052. const m_R_RISCV_TLSDESC_CALL = 65
  9053. const m_R_RISCV_TLSDESC_HI20 = 62
  9054. const m_R_RISCV_TLSDESC_LOAD_LO12 = 63
  9055. const m_R_RISCV_TLS_DTPMOD32 = 6
  9056. const m_R_RISCV_TLS_DTPMOD64 = 7
  9057. const m_R_RISCV_TLS_DTPREL32 = 8
  9058. const m_R_RISCV_TLS_DTPREL64 = 9
  9059. const m_R_RISCV_TLS_GD_HI20 = 22
  9060. const m_R_RISCV_TLS_GOT_HI20 = 21
  9061. const m_R_RISCV_TLS_TPREL32 = 10
  9062. const m_R_RISCV_TLS_TPREL64 = 11
  9063. const m_R_RISCV_TPREL_ADD = 32
  9064. const m_R_RISCV_TPREL_HI20 = 29
  9065. const m_R_RISCV_TPREL_LO12_I = 30
  9066. const m_R_RISCV_TPREL_LO12_S = 31
  9067. const m_R_SH_ALIGN = 29
  9068. const m_R_SH_CODE = 30
  9069. const m_R_SH_COPY = 162
  9070. const m_R_SH_COUNT = 28
  9071. const m_R_SH_DATA = 31
  9072. const m_R_SH_DIR32 = 1
  9073. const m_R_SH_DIR8BP = 7
  9074. const m_R_SH_DIR8L = 9
  9075. const m_R_SH_DIR8W = 8
  9076. const m_R_SH_DIR8WPL = 5
  9077. const m_R_SH_DIR8WPN = 3
  9078. const m_R_SH_DIR8WPZ = 6
  9079. const m_R_SH_FUNCDESC = 207
  9080. const m_R_SH_FUNCDESC_VALUE = 208
  9081. const m_R_SH_GLOB_DAT = 163
  9082. const m_R_SH_GNU_VTENTRY = 35
  9083. const m_R_SH_GNU_VTINHERIT = 34
  9084. const m_R_SH_GOT20 = 201
  9085. const m_R_SH_GOT32 = 160
  9086. const m_R_SH_GOTFUNCDESC = 203
  9087. const m_R_SH_GOTFUNCDEST20 = 204
  9088. const m_R_SH_GOTOFF = 166
  9089. const m_R_SH_GOTOFF20 = 202
  9090. const m_R_SH_GOTOFFFUNCDESC = 205
  9091. const m_R_SH_GOTOFFFUNCDEST20 = 206
  9092. const m_R_SH_GOTPC = 167
  9093. const m_R_SH_IND12W = 4
  9094. const m_R_SH_JMP_SLOT = 164
  9095. const m_R_SH_LABEL = 32
  9096. const m_R_SH_NONE = 0
  9097. const m_R_SH_NUM = 256
  9098. const m_R_SH_PLT32 = 161
  9099. const m_R_SH_REL32 = 2
  9100. const m_R_SH_RELATIVE = 165
  9101. const m_R_SH_SWITCH16 = 25
  9102. const m_R_SH_SWITCH32 = 26
  9103. const m_R_SH_SWITCH8 = 33
  9104. const m_R_SH_TLS_DTPMOD32 = 149
  9105. const m_R_SH_TLS_DTPOFF32 = 150
  9106. const m_R_SH_TLS_GD_32 = 144
  9107. const m_R_SH_TLS_IE_32 = 147
  9108. const m_R_SH_TLS_LDO_32 = 146
  9109. const m_R_SH_TLS_LD_32 = 145
  9110. const m_R_SH_TLS_LE_32 = 148
  9111. const m_R_SH_TLS_TPOFF32 = 151
  9112. const m_R_SH_USES = 27
  9113. const m_R_SPARC_10 = 30
  9114. const m_R_SPARC_11 = 31
  9115. const m_R_SPARC_13 = 11
  9116. const m_R_SPARC_16 = 2
  9117. const m_R_SPARC_22 = 10
  9118. const m_R_SPARC_32 = 3
  9119. const m_R_SPARC_5 = 44
  9120. const m_R_SPARC_6 = 45
  9121. const m_R_SPARC_64 = 32
  9122. const m_R_SPARC_7 = 43
  9123. const m_R_SPARC_8 = 1
  9124. const m_R_SPARC_COPY = 19
  9125. const m_R_SPARC_DISP16 = 5
  9126. const m_R_SPARC_DISP32 = 6
  9127. const m_R_SPARC_DISP64 = 46
  9128. const m_R_SPARC_DISP8 = 4
  9129. const m_R_SPARC_GLOB_DAT = 20
  9130. const m_R_SPARC_GLOB_JMP = 42
  9131. const m_R_SPARC_GNU_VTENTRY = 251
  9132. const m_R_SPARC_GNU_VTINHERIT = 250
  9133. const m_R_SPARC_GOT10 = 13
  9134. const m_R_SPARC_GOT13 = 14
  9135. const m_R_SPARC_GOT22 = 15
  9136. const m_R_SPARC_GOTDATA_HIX22 = 80
  9137. const m_R_SPARC_GOTDATA_LOX10 = 81
  9138. const m_R_SPARC_GOTDATA_OP = 84
  9139. const m_R_SPARC_GOTDATA_OP_HIX22 = 82
  9140. const m_R_SPARC_GOTDATA_OP_LOX10 = 83
  9141. const m_R_SPARC_H34 = 85
  9142. const m_R_SPARC_H44 = 50
  9143. const m_R_SPARC_HH22 = 34
  9144. const m_R_SPARC_HI22 = 9
  9145. const m_R_SPARC_HIPLT22 = 25
  9146. const m_R_SPARC_HIX22 = 48
  9147. const m_R_SPARC_HM10 = 35
  9148. const m_R_SPARC_JMP_SLOT = 21
  9149. const m_R_SPARC_L44 = 52
  9150. const m_R_SPARC_LM22 = 36
  9151. const m_R_SPARC_LO10 = 12
  9152. const m_R_SPARC_LOPLT10 = 26
  9153. const m_R_SPARC_LOX10 = 49
  9154. const m_R_SPARC_M44 = 51
  9155. const m_R_SPARC_NONE = 0
  9156. const m_R_SPARC_NUM = 253
  9157. const m_R_SPARC_OLO10 = 33
  9158. const m_R_SPARC_PC10 = 16
  9159. const m_R_SPARC_PC22 = 17
  9160. const m_R_SPARC_PCPLT10 = 29
  9161. const m_R_SPARC_PCPLT22 = 28
  9162. const m_R_SPARC_PCPLT32 = 27
  9163. const m_R_SPARC_PC_HH22 = 37
  9164. const m_R_SPARC_PC_HM10 = 38
  9165. const m_R_SPARC_PC_LM22 = 39
  9166. const m_R_SPARC_PLT32 = 24
  9167. const m_R_SPARC_PLT64 = 47
  9168. const m_R_SPARC_REGISTER = 53
  9169. const m_R_SPARC_RELATIVE = 22
  9170. const m_R_SPARC_REV32 = 252
  9171. const m_R_SPARC_SIZE32 = 86
  9172. const m_R_SPARC_SIZE64 = 87
  9173. const m_R_SPARC_TLS_DTPMOD32 = 74
  9174. const m_R_SPARC_TLS_DTPMOD64 = 75
  9175. const m_R_SPARC_TLS_DTPOFF32 = 76
  9176. const m_R_SPARC_TLS_DTPOFF64 = 77
  9177. const m_R_SPARC_TLS_GD_ADD = 58
  9178. const m_R_SPARC_TLS_GD_CALL = 59
  9179. const m_R_SPARC_TLS_GD_HI22 = 56
  9180. const m_R_SPARC_TLS_GD_LO10 = 57
  9181. const m_R_SPARC_TLS_IE_ADD = 71
  9182. const m_R_SPARC_TLS_IE_HI22 = 67
  9183. const m_R_SPARC_TLS_IE_LD = 69
  9184. const m_R_SPARC_TLS_IE_LDX = 70
  9185. const m_R_SPARC_TLS_IE_LO10 = 68
  9186. const m_R_SPARC_TLS_LDM_ADD = 62
  9187. const m_R_SPARC_TLS_LDM_CALL = 63
  9188. const m_R_SPARC_TLS_LDM_HI22 = 60
  9189. const m_R_SPARC_TLS_LDM_LO10 = 61
  9190. const m_R_SPARC_TLS_LDO_ADD = 66
  9191. const m_R_SPARC_TLS_LDO_HIX22 = 64
  9192. const m_R_SPARC_TLS_LDO_LOX10 = 65
  9193. const m_R_SPARC_TLS_LE_HIX22 = 72
  9194. const m_R_SPARC_TLS_LE_LOX10 = 73
  9195. const m_R_SPARC_TLS_TPOFF32 = 78
  9196. const m_R_SPARC_TLS_TPOFF64 = 79
  9197. const m_R_SPARC_UA16 = 55
  9198. const m_R_SPARC_UA32 = 23
  9199. const m_R_SPARC_UA64 = 54
  9200. const m_R_SPARC_WDISP16 = 40
  9201. const m_R_SPARC_WDISP19 = 41
  9202. const m_R_SPARC_WDISP22 = 8
  9203. const m_R_SPARC_WDISP30 = 7
  9204. const m_R_SPARC_WPLT30 = 18
  9205. const m_R_X86_64_16 = 12
  9206. const m_R_X86_64_32 = 10
  9207. const m_R_X86_64_32S = 11
  9208. const m_R_X86_64_64 = 1
  9209. const m_R_X86_64_8 = 14
  9210. const m_R_X86_64_COPY = 5
  9211. const m_R_X86_64_DTPMOD64 = 16
  9212. const m_R_X86_64_DTPOFF32 = 21
  9213. const m_R_X86_64_DTPOFF64 = 17
  9214. const m_R_X86_64_GLOB_DAT = 6
  9215. const m_R_X86_64_GOT32 = 3
  9216. const m_R_X86_64_GOT64 = 27
  9217. const m_R_X86_64_GOTOFF64 = 25
  9218. const m_R_X86_64_GOTPC32 = 26
  9219. const m_R_X86_64_GOTPC32_TLSDESC = 34
  9220. const m_R_X86_64_GOTPC64 = 29
  9221. const m_R_X86_64_GOTPCREL = 9
  9222. const m_R_X86_64_GOTPCREL64 = 28
  9223. const m_R_X86_64_GOTPCRELX = 41
  9224. const m_R_X86_64_GOTPLT64 = 30
  9225. const m_R_X86_64_GOTTPOFF = 22
  9226. const m_R_X86_64_IRELATIVE = 37
  9227. const m_R_X86_64_JUMP_SLOT = 7
  9228. const m_R_X86_64_NONE = 0
  9229. const m_R_X86_64_NUM = 43
  9230. const m_R_X86_64_PC16 = 13
  9231. const m_R_X86_64_PC32 = 2
  9232. const m_R_X86_64_PC64 = 24
  9233. const m_R_X86_64_PC8 = 15
  9234. const m_R_X86_64_PLT32 = 4
  9235. const m_R_X86_64_PLTOFF64 = 31
  9236. const m_R_X86_64_RELATIVE = 8
  9237. const m_R_X86_64_RELATIVE64 = 38
  9238. const m_R_X86_64_REX_GOTPCRELX = 42
  9239. const m_R_X86_64_SIZE32 = 32
  9240. const m_R_X86_64_SIZE64 = 33
  9241. const m_R_X86_64_TLSDESC = 36
  9242. const m_R_X86_64_TLSDESC_CALL = 35
  9243. const m_R_X86_64_TLSGD = 19
  9244. const m_R_X86_64_TLSLD = 20
  9245. const m_R_X86_64_TPOFF32 = 23
  9246. const m_R_X86_64_TPOFF64 = 18
  9247. const m_SELFMAG = 4
  9248. const m_SHF_ALPHA_GPREL = 0x10000000
  9249. const m_SHF_ARM_COMDEF = 0x80000000
  9250. const m_SHF_ARM_ENTRYSECT = 0x10000000
  9251. const m_SHF_IA_64_NORECOV = 0x20000000
  9252. const m_SHF_IA_64_SHORT = 0x10000000
  9253. const m_SHF_MASKOS = 0x0ff00000
  9254. const m_SHF_MASKPROC = 0xf0000000
  9255. const m_SHF_MIPS_ADDR = 0x40000000
  9256. const m_SHF_MIPS_GPREL = 0x10000000
  9257. const m_SHF_MIPS_LOCAL = 0x04000000
  9258. const m_SHF_MIPS_MERGE = 0x20000000
  9259. const m_SHF_MIPS_NAMES = 0x02000000
  9260. const m_SHF_MIPS_NODUPE = 0x01000000
  9261. const m_SHF_MIPS_NOSTRIP = 0x08000000
  9262. const m_SHF_MIPS_STRINGS = 0x80000000
  9263. const m_SHF_PARISC_HUGE = 0x40000000
  9264. const m_SHF_PARISC_SBP = 0x80000000
  9265. const m_SHF_PARISC_SHORT = 0x20000000
  9266. const m_SHN_ABS = 65521
  9267. const m_SHN_AFTER = 0xff01
  9268. const m_SHN_BEFORE = 0xff00
  9269. const m_SHN_COMMON = 65522
  9270. const m_SHN_HIOS = 0xff3f
  9271. const m_SHN_HIPROC = 0xff1f
  9272. const m_SHN_HIRESERVE = 0xffff
  9273. const m_SHN_LOOS = 0xff20
  9274. const m_SHN_LOPROC = 0xff00
  9275. const m_SHN_LORESERVE = 0xff00
  9276. const m_SHN_MIPS_ACOMMON = 0xff00
  9277. const m_SHN_MIPS_DATA = 0xff02
  9278. const m_SHN_MIPS_SCOMMON = 0xff03
  9279. const m_SHN_MIPS_SUNDEFINED = 0xff04
  9280. const m_SHN_MIPS_TEXT = 0xff01
  9281. const m_SHN_PARISC_ANSI_COMMON = 0xff00
  9282. const m_SHN_PARISC_HUGE_COMMON = 0xff01
  9283. const m_SHN_UNDEF = 0
  9284. const m_SHN_XINDEX = 0xffff
  9285. const m_SHT_ALPHA_DEBUG = 0x70000001
  9286. const m_SHT_ALPHA_REGINFO = 0x70000002
  9287. const m_SHT_CHECKSUM = 0x6ffffff8
  9288. const m_SHT_DYNAMIC = 6
  9289. const m_SHT_DYNSYM = 11
  9290. const m_SHT_FINI_ARRAY = 15
  9291. const m_SHT_GNU_ATTRIBUTES = 0x6ffffff5
  9292. const m_SHT_GNU_HASH = 0x6ffffff6
  9293. const m_SHT_GNU_LIBLIST = 0x6ffffff7
  9294. const m_SHT_GNU_verdef = 0x6ffffffd
  9295. const m_SHT_GNU_verneed = 0x6ffffffe
  9296. const m_SHT_GNU_versym = 0x6fffffff
  9297. const m_SHT_GROUP = 17
  9298. const m_SHT_HASH = 5
  9299. const m_SHT_HIOS = 0x6fffffff
  9300. const m_SHT_HIPROC = 0x7fffffff
  9301. const m_SHT_HISUNW = 0x6fffffff
  9302. const m_SHT_HIUSER = 0x8fffffff
  9303. const m_SHT_INIT_ARRAY = 14
  9304. const m_SHT_LOOS = 0x60000000
  9305. const m_SHT_LOPROC = 0x70000000
  9306. const m_SHT_LOSUNW = 0x6ffffffa
  9307. const m_SHT_LOUSER = 0x80000000
  9308. const m_SHT_MIPS_AUXSYM = 0x70000016
  9309. const m_SHT_MIPS_CONFLICT = 0x70000002
  9310. const m_SHT_MIPS_CONTENT = 0x7000000c
  9311. const m_SHT_MIPS_DEBUG = 0x70000005
  9312. const m_SHT_MIPS_DELTACLASS = 0x7000001d
  9313. const m_SHT_MIPS_DELTADECL = 0x7000001f
  9314. const m_SHT_MIPS_DELTAINST = 0x7000001c
  9315. const m_SHT_MIPS_DELTASYM = 0x7000001b
  9316. const m_SHT_MIPS_DENSE = 0x70000013
  9317. const m_SHT_MIPS_DWARF = 0x7000001e
  9318. const m_SHT_MIPS_EH_REGION = 0x70000027
  9319. const m_SHT_MIPS_EVENTS = 0x70000021
  9320. const m_SHT_MIPS_EXTSYM = 0x70000012
  9321. const m_SHT_MIPS_FDESC = 0x70000011
  9322. const m_SHT_MIPS_GPTAB = 0x70000003
  9323. const m_SHT_MIPS_IFACE = 0x7000000b
  9324. const m_SHT_MIPS_LIBLIST = 0x70000000
  9325. const m_SHT_MIPS_LINE = 0x70000019
  9326. const m_SHT_MIPS_LOCSTR = 0x70000018
  9327. const m_SHT_MIPS_LOCSYM = 0x70000015
  9328. const m_SHT_MIPS_MSYM = 0x70000001
  9329. const m_SHT_MIPS_OPTIONS = 0x7000000d
  9330. const m_SHT_MIPS_OPTSYM = 0x70000017
  9331. const m_SHT_MIPS_PACKAGE = 0x70000007
  9332. const m_SHT_MIPS_PACKSYM = 0x70000008
  9333. const m_SHT_MIPS_PDESC = 0x70000014
  9334. const m_SHT_MIPS_PDR_EXCEPTION = 0x70000029
  9335. const m_SHT_MIPS_PIXIE = 0x70000023
  9336. const m_SHT_MIPS_REGINFO = 0x70000006
  9337. const m_SHT_MIPS_RELD = 0x70000009
  9338. const m_SHT_MIPS_RFDESC = 0x7000001a
  9339. const m_SHT_MIPS_SHDR = 0x70000010
  9340. const m_SHT_MIPS_SYMBOL_LIB = 0x70000020
  9341. const m_SHT_MIPS_TRANSLATE = 0x70000022
  9342. const m_SHT_MIPS_UCODE = 0x70000004
  9343. const m_SHT_MIPS_WHIRL = 0x70000026
  9344. const m_SHT_MIPS_XLATE = 0x70000024
  9345. const m_SHT_MIPS_XLATE_DEBUG = 0x70000025
  9346. const m_SHT_MIPS_XLATE_OLD = 0x70000028
  9347. const m_SHT_NOBITS = 8
  9348. const m_SHT_NOTE = 7
  9349. const m_SHT_NULL = 0
  9350. const m_SHT_NUM = 20
  9351. const m_SHT_PARISC_DOC = 0x70000002
  9352. const m_SHT_PARISC_EXT = 0x70000000
  9353. const m_SHT_PARISC_UNWIND = 0x70000001
  9354. const m_SHT_PREINIT_ARRAY = 16
  9355. const m_SHT_PROGBITS = 1
  9356. const m_SHT_REL = 9
  9357. const m_SHT_RELA = 4
  9358. const m_SHT_RELR = 19
  9359. const m_SHT_SHLIB = 10
  9360. const m_SHT_STRTAB = 3
  9361. const m_SHT_SUNW_COMDAT = 0x6ffffffb
  9362. const m_SHT_SUNW_move = 0x6ffffffa
  9363. const m_SHT_SUNW_syminfo = 0x6ffffffc
  9364. const m_SHT_SYMTAB = 2
  9365. const m_SHT_SYMTAB_SHNDX = 18
  9366. const m_STB_GLOBAL = 1
  9367. const m_STB_GNU_UNIQUE = 10
  9368. const m_STB_HIOS = 12
  9369. const m_STB_HIPROC = 15
  9370. const m_STB_LOCAL = 0
  9371. const m_STB_LOOS = 10
  9372. const m_STB_LOPROC = 13
  9373. const m_STB_MIPS_SPLIT_COMMON = 13
  9374. const m_STB_NUM = 3
  9375. const m_STB_WEAK = 2
  9376. const m_STN_UNDEF = 0
  9377. const m_STO_ALPHA_NOPV = 0x80
  9378. const m_STO_ALPHA_STD_GPLOAD = 0x88
  9379. const m_STO_MIPS_DEFAULT = 0x0
  9380. const m_STO_MIPS_HIDDEN = 0x2
  9381. const m_STO_MIPS_INTERNAL = 0x1
  9382. const m_STO_MIPS_PLT = 0x8
  9383. const m_STO_MIPS_PROTECTED = 0x3
  9384. const m_STO_MIPS_SC_ALIGN_UNUSED = 0xff
  9385. const m_STO_PPC64_LOCAL_BIT = 5
  9386. const m_STO_PPC64_LOCAL_MASK = 0xe0
  9387. const m_STT_ARM_16BIT = "STT_HIPROC"
  9388. const m_STT_ARM_TFUNC = "STT_LOPROC"
  9389. const m_STT_COMMON = 5
  9390. const m_STT_FILE = 4
  9391. const m_STT_FUNC = 2
  9392. const m_STT_GNU_IFUNC = 10
  9393. const m_STT_HIOS = 12
  9394. const m_STT_HIPROC = 15
  9395. const m_STT_LOOS = 10
  9396. const m_STT_LOPROC = 13
  9397. const m_STT_NOTYPE = 0
  9398. const m_STT_NUM = 7
  9399. const m_STT_OBJECT = 1
  9400. const m_STT_PARISC_MILLICODE = 13
  9401. const m_STT_SECTION = 3
  9402. const m_STT_SPARC_REGISTER = 13
  9403. const m_STT_TLS = 6
  9404. const m_STV_DEFAULT = 0
  9405. const m_STV_HIDDEN = 2
  9406. const m_STV_INTERNAL = 1
  9407. const m_STV_PROTECTED = 3
  9408. const m_SYMINFO_BT_LOWRESERVE = 0xff00
  9409. const m_SYMINFO_BT_PARENT = 0xfffe
  9410. const m_SYMINFO_BT_SELF = 0xffff
  9411. const m_SYMINFO_CURRENT = 1
  9412. const m_SYMINFO_FLG_COPY = 0x0004
  9413. const m_SYMINFO_FLG_DIRECT = 0x0001
  9414. const m_SYMINFO_FLG_LAZYLOAD = 0x0008
  9415. const m_SYMINFO_FLG_PASSTHRU = 0x0002
  9416. const m_SYMINFO_NONE = 0
  9417. const m_SYMINFO_NUM = 2
  9418. const m_VER_DEF_CURRENT = 1
  9419. const m_VER_DEF_NONE = 0
  9420. const m_VER_DEF_NUM = 2
  9421. const m_VER_FLG_BASE = 0x1
  9422. const m_VER_FLG_WEAK = 0x2
  9423. const m_VER_NDX_ELIMINATE = 0xff01
  9424. const m_VER_NDX_GLOBAL = 1
  9425. const m_VER_NDX_LOCAL = 0
  9426. const m_VER_NDX_LORESERVE = 0xff00
  9427. const m_VER_NEED_CURRENT = 1
  9428. const m_VER_NEED_NONE = 0
  9429. const m_VER_NEED_NUM = 2
  9430. const m_n_hash = "n_desc"
  9431. type Tnlist = struct {
  9432. F__ccgo0_0 struct {
  9433. Fn_un [0]struct {
  9434. Fn_next [0]uintptr
  9435. Fn_strx [0]int32
  9436. Fn_name uintptr
  9437. }
  9438. Fn_name uintptr
  9439. }
  9440. Fn_type uint8
  9441. Fn_other int8
  9442. Fn_desc int16
  9443. Fn_value uint32
  9444. }
  9445. type TElf32_Half = uint16
  9446. type TElf64_Half = uint16
  9447. type TElf32_Word = uint32
  9448. type TElf32_Sword = int32
  9449. type TElf64_Word = uint32
  9450. type TElf64_Sword = int32
  9451. type TElf32_Xword = uint64
  9452. type TElf32_Sxword = int64
  9453. type TElf64_Xword = uint64
  9454. type TElf64_Sxword = int64
  9455. type TElf32_Addr = uint32
  9456. type TElf64_Addr = uint64
  9457. type TElf32_Off = uint32
  9458. type TElf64_Off = uint64
  9459. type TElf32_Section = uint16
  9460. type TElf64_Section = uint16
  9461. type TElf32_Versym = uint16
  9462. type TElf64_Versym = uint16
  9463. type TElf32_Ehdr = struct {
  9464. Fe_ident [16]uint8
  9465. Fe_type TElf32_Half
  9466. Fe_machine TElf32_Half
  9467. Fe_version TElf32_Word
  9468. Fe_entry TElf32_Addr
  9469. Fe_phoff TElf32_Off
  9470. Fe_shoff TElf32_Off
  9471. Fe_flags TElf32_Word
  9472. Fe_ehsize TElf32_Half
  9473. Fe_phentsize TElf32_Half
  9474. Fe_phnum TElf32_Half
  9475. Fe_shentsize TElf32_Half
  9476. Fe_shnum TElf32_Half
  9477. Fe_shstrndx TElf32_Half
  9478. }
  9479. type TElf64_Ehdr = struct {
  9480. Fe_ident [16]uint8
  9481. Fe_type TElf64_Half
  9482. Fe_machine TElf64_Half
  9483. Fe_version TElf64_Word
  9484. Fe_entry TElf64_Addr
  9485. Fe_phoff TElf64_Off
  9486. Fe_shoff TElf64_Off
  9487. Fe_flags TElf64_Word
  9488. Fe_ehsize TElf64_Half
  9489. Fe_phentsize TElf64_Half
  9490. Fe_phnum TElf64_Half
  9491. Fe_shentsize TElf64_Half
  9492. Fe_shnum TElf64_Half
  9493. Fe_shstrndx TElf64_Half
  9494. }
  9495. type TElf32_Shdr = struct {
  9496. Fsh_name TElf32_Word
  9497. Fsh_type TElf32_Word
  9498. Fsh_flags TElf32_Word
  9499. Fsh_addr TElf32_Addr
  9500. Fsh_offset TElf32_Off
  9501. Fsh_size TElf32_Word
  9502. Fsh_link TElf32_Word
  9503. Fsh_info TElf32_Word
  9504. Fsh_addralign TElf32_Word
  9505. Fsh_entsize TElf32_Word
  9506. }
  9507. type TElf64_Shdr = struct {
  9508. Fsh_name TElf64_Word
  9509. Fsh_type TElf64_Word
  9510. Fsh_flags TElf64_Xword
  9511. Fsh_addr TElf64_Addr
  9512. Fsh_offset TElf64_Off
  9513. Fsh_size TElf64_Xword
  9514. Fsh_link TElf64_Word
  9515. Fsh_info TElf64_Word
  9516. Fsh_addralign TElf64_Xword
  9517. Fsh_entsize TElf64_Xword
  9518. }
  9519. type TElf32_Chdr = struct {
  9520. Fch_type TElf32_Word
  9521. Fch_size TElf32_Word
  9522. Fch_addralign TElf32_Word
  9523. }
  9524. type TElf64_Chdr = struct {
  9525. Fch_type TElf64_Word
  9526. Fch_reserved TElf64_Word
  9527. Fch_size TElf64_Xword
  9528. Fch_addralign TElf64_Xword
  9529. }
  9530. type TElf32_Sym = struct {
  9531. Fst_name TElf32_Word
  9532. Fst_value TElf32_Addr
  9533. Fst_size TElf32_Word
  9534. Fst_info uint8
  9535. Fst_other uint8
  9536. Fst_shndx TElf32_Section
  9537. }
  9538. type TElf64_Sym = struct {
  9539. Fst_name TElf64_Word
  9540. Fst_info uint8
  9541. Fst_other uint8
  9542. Fst_shndx TElf64_Section
  9543. Fst_value TElf64_Addr
  9544. Fst_size TElf64_Xword
  9545. }
  9546. type TElf32_Syminfo = struct {
  9547. Fsi_boundto TElf32_Half
  9548. Fsi_flags TElf32_Half
  9549. }
  9550. type TElf64_Syminfo = struct {
  9551. Fsi_boundto TElf64_Half
  9552. Fsi_flags TElf64_Half
  9553. }
  9554. type TElf32_Rel = struct {
  9555. Fr_offset TElf32_Addr
  9556. Fr_info TElf32_Word
  9557. }
  9558. type TElf64_Rel = struct {
  9559. Fr_offset TElf64_Addr
  9560. Fr_info TElf64_Xword
  9561. }
  9562. type TElf32_Rela = struct {
  9563. Fr_offset TElf32_Addr
  9564. Fr_info TElf32_Word
  9565. Fr_addend TElf32_Sword
  9566. }
  9567. type TElf64_Rela = struct {
  9568. Fr_offset TElf64_Addr
  9569. Fr_info TElf64_Xword
  9570. Fr_addend TElf64_Sxword
  9571. }
  9572. type TElf32_Relr = uint32
  9573. type TElf64_Relr = uint64
  9574. type TElf32_Phdr = struct {
  9575. Fp_type TElf32_Word
  9576. Fp_offset TElf32_Off
  9577. Fp_vaddr TElf32_Addr
  9578. Fp_paddr TElf32_Addr
  9579. Fp_filesz TElf32_Word
  9580. Fp_memsz TElf32_Word
  9581. Fp_flags TElf32_Word
  9582. Fp_align TElf32_Word
  9583. }
  9584. type TElf64_Phdr = struct {
  9585. Fp_type TElf64_Word
  9586. Fp_flags TElf64_Word
  9587. Fp_offset TElf64_Off
  9588. Fp_vaddr TElf64_Addr
  9589. Fp_paddr TElf64_Addr
  9590. Fp_filesz TElf64_Xword
  9591. Fp_memsz TElf64_Xword
  9592. Fp_align TElf64_Xword
  9593. }
  9594. type TElf32_Dyn = struct {
  9595. Fd_tag TElf32_Sword
  9596. Fd_un struct {
  9597. Fd_ptr [0]TElf32_Addr
  9598. Fd_val TElf32_Word
  9599. }
  9600. }
  9601. type TElf64_Dyn = struct {
  9602. Fd_tag TElf64_Sxword
  9603. Fd_un struct {
  9604. Fd_ptr [0]TElf64_Addr
  9605. Fd_val TElf64_Xword
  9606. }
  9607. }
  9608. type TElf32_Verdef = struct {
  9609. Fvd_version TElf32_Half
  9610. Fvd_flags TElf32_Half
  9611. Fvd_ndx TElf32_Half
  9612. Fvd_cnt TElf32_Half
  9613. Fvd_hash TElf32_Word
  9614. Fvd_aux TElf32_Word
  9615. Fvd_next TElf32_Word
  9616. }
  9617. type TElf64_Verdef = struct {
  9618. Fvd_version TElf64_Half
  9619. Fvd_flags TElf64_Half
  9620. Fvd_ndx TElf64_Half
  9621. Fvd_cnt TElf64_Half
  9622. Fvd_hash TElf64_Word
  9623. Fvd_aux TElf64_Word
  9624. Fvd_next TElf64_Word
  9625. }
  9626. type TElf32_Verdaux = struct {
  9627. Fvda_name TElf32_Word
  9628. Fvda_next TElf32_Word
  9629. }
  9630. type TElf64_Verdaux = struct {
  9631. Fvda_name TElf64_Word
  9632. Fvda_next TElf64_Word
  9633. }
  9634. type TElf32_Verneed = struct {
  9635. Fvn_version TElf32_Half
  9636. Fvn_cnt TElf32_Half
  9637. Fvn_file TElf32_Word
  9638. Fvn_aux TElf32_Word
  9639. Fvn_next TElf32_Word
  9640. }
  9641. type TElf64_Verneed = struct {
  9642. Fvn_version TElf64_Half
  9643. Fvn_cnt TElf64_Half
  9644. Fvn_file TElf64_Word
  9645. Fvn_aux TElf64_Word
  9646. Fvn_next TElf64_Word
  9647. }
  9648. type TElf32_Vernaux = struct {
  9649. Fvna_hash TElf32_Word
  9650. Fvna_flags TElf32_Half
  9651. Fvna_other TElf32_Half
  9652. Fvna_name TElf32_Word
  9653. Fvna_next TElf32_Word
  9654. }
  9655. type TElf64_Vernaux = struct {
  9656. Fvna_hash TElf64_Word
  9657. Fvna_flags TElf64_Half
  9658. Fvna_other TElf64_Half
  9659. Fvna_name TElf64_Word
  9660. Fvna_next TElf64_Word
  9661. }
  9662. type TElf32_auxv_t = struct {
  9663. Fa_type Tuint32_t
  9664. Fa_un struct {
  9665. Fa_val Tuint32_t
  9666. }
  9667. }
  9668. type TElf64_auxv_t = struct {
  9669. Fa_type Tuint64_t
  9670. Fa_un struct {
  9671. Fa_val Tuint64_t
  9672. }
  9673. }
  9674. type TElf32_Nhdr = struct {
  9675. Fn_namesz TElf32_Word
  9676. Fn_descsz TElf32_Word
  9677. Fn_type TElf32_Word
  9678. }
  9679. type TElf64_Nhdr = struct {
  9680. Fn_namesz TElf64_Word
  9681. Fn_descsz TElf64_Word
  9682. Fn_type TElf64_Word
  9683. }
  9684. type TElf32_Move = struct {
  9685. Fm_value TElf32_Xword
  9686. Fm_info TElf32_Word
  9687. Fm_poffset TElf32_Word
  9688. Fm_repeat TElf32_Half
  9689. Fm_stride TElf32_Half
  9690. }
  9691. type TElf64_Move = struct {
  9692. Fm_value TElf64_Xword
  9693. Fm_info TElf64_Xword
  9694. Fm_poffset TElf64_Xword
  9695. Fm_repeat TElf64_Half
  9696. Fm_stride TElf64_Half
  9697. }
  9698. type TElf32_gptab = struct {
  9699. Fgt_entry [0]struct {
  9700. Fgt_g_value TElf32_Word
  9701. Fgt_bytes TElf32_Word
  9702. }
  9703. Fgt_header struct {
  9704. Fgt_current_g_value TElf32_Word
  9705. Fgt_unused TElf32_Word
  9706. }
  9707. }
  9708. type TElf32_RegInfo = struct {
  9709. Fri_gprmask TElf32_Word
  9710. Fri_cprmask [4]TElf32_Word
  9711. Fri_gp_value TElf32_Sword
  9712. }
  9713. type TElf_Options = struct {
  9714. Fkind uint8
  9715. Fsize uint8
  9716. Fsection TElf32_Section
  9717. Finfo TElf32_Word
  9718. }
  9719. type TElf_Options_Hw = struct {
  9720. Fhwp_flags1 TElf32_Word
  9721. Fhwp_flags2 TElf32_Word
  9722. }
  9723. type TElf32_Lib = struct {
  9724. Fl_name TElf32_Word
  9725. Fl_time_stamp TElf32_Word
  9726. Fl_checksum TElf32_Word
  9727. Fl_version TElf32_Word
  9728. Fl_flags TElf32_Word
  9729. }
  9730. type TElf64_Lib = struct {
  9731. Fl_name TElf64_Word
  9732. Fl_time_stamp TElf64_Word
  9733. Fl_checksum TElf64_Word
  9734. Fl_version TElf64_Word
  9735. Fl_flags TElf64_Word
  9736. }
  9737. type TElf32_Conflict = uint32
  9738. type TElf_MIPS_ABIFlags_v0 = struct {
  9739. Fversion TElf32_Half
  9740. Fisa_level uint8
  9741. Fisa_rev uint8
  9742. Fgpr_size uint8
  9743. Fcpr1_size uint8
  9744. Fcpr2_size uint8
  9745. Ffp_abi uint8
  9746. Fisa_ext TElf32_Word
  9747. Fases TElf32_Word
  9748. Fflags1 TElf32_Word
  9749. Fflags2 TElf32_Word
  9750. }
  9751. const _Val_GNU_MIPS_ABI_FP_ANY = 0
  9752. const _Val_GNU_MIPS_ABI_FP_DOUBLE = 1
  9753. const _Val_GNU_MIPS_ABI_FP_SINGLE = 2
  9754. const _Val_GNU_MIPS_ABI_FP_SOFT = 3
  9755. const _Val_GNU_MIPS_ABI_FP_OLD_64 = 4
  9756. const _Val_GNU_MIPS_ABI_FP_XX = 5
  9757. const _Val_GNU_MIPS_ABI_FP_64 = 6
  9758. const _Val_GNU_MIPS_ABI_FP_64A = 7
  9759. const _Val_GNU_MIPS_ABI_FP_MAX = 7
  9760. // C documentation
  9761. //
  9762. // /*
  9763. // * __elf_is_okay__ - Determine if ehdr really
  9764. // * is ELF and valid for the target platform.
  9765. // *
  9766. // * WARNING: This is NOT an ELF ABI function and
  9767. // * as such its use should be restricted.
  9768. // */
  9769. func ___elf_is_okay__(tls *libc.TLS, ehdr uintptr) (r int32) {
  9770. var retval int32
  9771. _ = retval
  9772. retval = 0
  9773. /*
  9774. * We need to check magic, class size, endianess,
  9775. * and version before we look at the rest of the
  9776. * Elf_Ehdr structure. These few elements are
  9777. * represented in a machine independent fashion.
  9778. */
  9779. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(ehdr))) == int32(m_ELFMAG0) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(ehdr + 1))) == int32('E') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(ehdr + 2))) == int32('L') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(ehdr + 3))) == int32('F') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(ehdr + 4))) == int32(m_ELFCLASS32) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(ehdr + 5))) == int32(m_ELFDATA2LSB) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(ehdr + 6))) == int32(m_EV_CURRENT) {
  9780. /* Now check the machine dependent header */
  9781. if libc.Int32FromUint16((*TElf32_Ehdr)(unsafe.Pointer(ehdr)).Fe_machine) == int32(m_EM_386) && (*TElf32_Ehdr)(unsafe.Pointer(ehdr)).Fe_version == uint32(m_EV_CURRENT) {
  9782. retval = int32(1)
  9783. }
  9784. }
  9785. return retval
  9786. }
  9787. // C documentation
  9788. //
  9789. // /*
  9790. // * Convert an Elf_Sym into an nlist structure. This fills in only the
  9791. // * n_value and n_type members.
  9792. // */
  9793. func _elf_sym_to_nlist(tls *libc.TLS, nl uintptr, s uintptr, shdr uintptr, shnum int32) {
  9794. var sh, p5 uintptr
  9795. var v1, v2, v3, v4 int32
  9796. _, _, _, _, _, _ = sh, v1, v2, v3, v4, p5
  9797. (*Tnlist)(unsafe.Pointer(nl)).Fn_value = (*TElf32_Sym)(unsafe.Pointer(s)).Fst_value
  9798. switch libc.Int32FromUint16((*TElf32_Sym)(unsafe.Pointer(s)).Fst_shndx) {
  9799. case m_SHN_UNDEF:
  9800. fallthrough
  9801. case int32(m_SHN_COMMON):
  9802. (*Tnlist)(unsafe.Pointer(nl)).Fn_type = uint8(m_N_UNDF)
  9803. case int32(m_SHN_ABS):
  9804. if libc.Int32FromUint8((*TElf32_Sym)(unsafe.Pointer(s)).Fst_info)&int32(0xf) == int32(m_STT_FILE) {
  9805. v1 = int32(m_N_FN)
  9806. } else {
  9807. v1 = int32(m_N_ABS)
  9808. }
  9809. (*Tnlist)(unsafe.Pointer(nl)).Fn_type = libc.Uint8FromInt32(v1)
  9810. default:
  9811. if libc.Int32FromUint16((*TElf32_Sym)(unsafe.Pointer(s)).Fst_shndx) >= shnum {
  9812. (*Tnlist)(unsafe.Pointer(nl)).Fn_type = uint8(m_N_UNDF)
  9813. } else {
  9814. sh = shdr + uintptr((*TElf32_Sym)(unsafe.Pointer(s)).Fst_shndx)*40
  9815. if (*TElf32_Shdr)(unsafe.Pointer(sh)).Fsh_type == uint32(m_SHT_PROGBITS) {
  9816. if (*TElf32_Shdr)(unsafe.Pointer(sh)).Fsh_flags&libc.Uint32FromInt32(libc.Int32FromInt32(1)<<libc.Int32FromInt32(0)) != 0 {
  9817. v3 = int32(m_N_DATA)
  9818. } else {
  9819. v3 = int32(m_N_TEXT)
  9820. }
  9821. v2 = v3
  9822. } else {
  9823. if (*TElf32_Shdr)(unsafe.Pointer(sh)).Fsh_type == uint32(m_SHT_NOBITS) {
  9824. v4 = int32(m_N_BSS)
  9825. } else {
  9826. v4 = m_N_UNDF
  9827. }
  9828. v2 = v4
  9829. }
  9830. (*Tnlist)(unsafe.Pointer(nl)).Fn_type = libc.Uint8FromInt32(v2)
  9831. }
  9832. break
  9833. }
  9834. if libc.Int32FromUint8((*TElf32_Sym)(unsafe.Pointer(s)).Fst_info)>>int32(4) == int32(m_STB_GLOBAL) || libc.Int32FromUint8((*TElf32_Sym)(unsafe.Pointer(s)).Fst_info)>>int32(4) == int32(m_STB_WEAK) {
  9835. p5 = nl + 4
  9836. *(*uint8)(unsafe.Pointer(p5)) = uint8(int32(*(*uint8)(unsafe.Pointer(p5))) | libc.Int32FromInt32(m_N_EXT))
  9837. }
  9838. }
  9839. func X__fdnlist(tls *libc.TLS, fd int32, list uintptr) (r int32) {
  9840. bp := tls.Alloc(16592)
  9841. defer tls.Free(16592)
  9842. var cc, i TElf32_Sword
  9843. var errsave, nent, v6 int32
  9844. var name, p, s, shdr, strtab uintptr
  9845. var shdr_size, size, symsize, symstrsize TElf32_Word
  9846. var symoff, symstroff TElf32_Off
  9847. var v3 uint32
  9848. var _ /* ehdr at bp+16384 */ TElf32_Ehdr
  9849. var _ /* sbuf at bp+0 */ [1024]TElf32_Sym
  9850. var _ /* st at bp+16436 */ Tstat
  9851. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cc, errsave, i, name, nent, p, s, shdr, shdr_size, size, strtab, symoff, symsize, symstroff, symstrsize, v3, v6
  9852. symoff = uint32(0)
  9853. symstroff = uint32(0)
  9854. symsize = uint32(0)
  9855. symstrsize = uint32(0)
  9856. nent = -int32(1)
  9857. strtab = libc.UintptrFromInt32(0)
  9858. shdr = libc.UintptrFromInt32(0)
  9859. /* Make sure obj is OK */
  9860. if libc.Xlseek(tls, fd, libc.Int64FromInt32(0), 0) == int64(-int32(1)) || libc.Uint32FromInt32(libc.Xread(tls, fd, bp+16384, uint32(52))) != uint32(52) || !(___elf_is_okay__(tls, bp+16384) != 0) || libc.Xfstat(tls, fd, bp+16436) < 0 {
  9861. return -int32(1)
  9862. }
  9863. if libc.Int32FromUint16((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shnum) == 0 || uint32((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shentsize) != uint32(40) {
  9864. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ERANGE)
  9865. return -int32(1)
  9866. }
  9867. /* calculate section header table size */
  9868. shdr_size = libc.Uint32FromInt32(libc.Int32FromUint16((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shentsize) * libc.Int32FromUint16((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shnum))
  9869. /* Make sure it's not too big to mmap */
  9870. if libc.Int64FromUint32(shdr_size) > (*(*Tstat)(unsafe.Pointer(bp + 16436))).Fst_size {
  9871. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EFBIG)
  9872. return -int32(1)
  9873. }
  9874. shdr = libc.Xmalloc(tls, shdr_size)
  9875. if shdr == libc.UintptrFromInt32(0) {
  9876. return -int32(1)
  9877. }
  9878. /* Load section header table. */
  9879. if libc.Xpread(tls, fd, shdr, shdr_size, libc.Int64FromUint32((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shoff)) != libc.Int32FromUint32(shdr_size) {
  9880. goto done
  9881. }
  9882. /*
  9883. * Find the symbol table entry and it's corresponding
  9884. * string table entry. Version 1.1 of the ABI states
  9885. * that there is only one symbol table but that this
  9886. * could change in the future.
  9887. */
  9888. i = 0
  9889. for {
  9890. if !(i < libc.Int32FromUint16((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shnum)) {
  9891. break
  9892. }
  9893. if (*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr(i)*40))).Fsh_type == uint32(m_SHT_SYMTAB) {
  9894. if (*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr(i)*40))).Fsh_link >= uint32((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shnum) {
  9895. goto done
  9896. }
  9897. symoff = (*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr(i)*40))).Fsh_offset
  9898. symsize = (*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr(i)*40))).Fsh_size
  9899. symstroff = (*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr((*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr(i)*40))).Fsh_link)*40))).Fsh_offset
  9900. symstrsize = (*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr((*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr(i)*40))).Fsh_link)*40))).Fsh_size
  9901. break
  9902. }
  9903. goto _1
  9904. _1:
  9905. ;
  9906. i++
  9907. }
  9908. /* Check for files too large to mmap. */
  9909. if libc.Int64FromUint32(symstrsize) > (*(*Tstat)(unsafe.Pointer(bp + 16436))).Fst_size {
  9910. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EFBIG)
  9911. goto done
  9912. }
  9913. /*
  9914. * Load string table into our address space. This gives us
  9915. * an easy way to randomly access all the strings, without
  9916. * making the memory allocation permanent as with malloc/free
  9917. * (i.e., munmap will return it to the system).
  9918. */
  9919. strtab = libc.Xmalloc(tls, symstrsize)
  9920. if strtab == libc.UintptrFromInt32(0) {
  9921. goto done
  9922. }
  9923. if libc.Xpread(tls, fd, strtab, symstrsize, libc.Int64FromUint32(symstroff)) != libc.Int32FromUint32(symstrsize) {
  9924. goto done
  9925. }
  9926. /*
  9927. * clean out any left-over information for all valid entries.
  9928. * Type and value defined to be 0 if not found; historical
  9929. * versions cleared other and desc as well. Also figure out
  9930. * the largest string length so don't read any more of the
  9931. * string table than we have to.
  9932. *
  9933. * XXX clearing anything other than n_type and n_value violates
  9934. * the semantics given in the man page.
  9935. */
  9936. nent = 0
  9937. p = list
  9938. for {
  9939. if !!(*(*uintptr)(unsafe.Pointer(p)) == uintptr(0) || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p))))) == 0) {
  9940. break
  9941. }
  9942. (*Tnlist)(unsafe.Pointer(p)).Fn_type = uint8(0)
  9943. (*Tnlist)(unsafe.Pointer(p)).Fn_other = 0
  9944. (*Tnlist)(unsafe.Pointer(p)).Fn_desc = 0
  9945. (*Tnlist)(unsafe.Pointer(p)).Fn_value = uint32(0)
  9946. nent++
  9947. goto _2
  9948. _2:
  9949. ;
  9950. p += 12
  9951. }
  9952. /* Don't process any further if object is stripped. */
  9953. if symoff == uint32(0) {
  9954. goto done
  9955. }
  9956. if libc.Xlseek(tls, fd, libc.Int64FromUint32(symoff), 0) == int64(-int32(1)) {
  9957. nent = -int32(1)
  9958. goto done
  9959. }
  9960. for symsize > uint32(0) && nent > 0 {
  9961. if symsize < libc.Uint32FromInt64(16384) {
  9962. v3 = symsize
  9963. } else {
  9964. v3 = libc.Uint32FromInt64(16384)
  9965. }
  9966. cc = libc.Int32FromUint32(v3)
  9967. if libc.Xread(tls, fd, bp, libc.Uint32FromInt32(cc)) != cc {
  9968. break
  9969. }
  9970. symsize -= libc.Uint32FromInt32(cc)
  9971. s = bp
  9972. for {
  9973. if !(cc > 0 && nent > 0) {
  9974. break
  9975. }
  9976. name = strtab + uintptr((*TElf32_Sym)(unsafe.Pointer(s)).Fst_name)
  9977. if int32(*(*int8)(unsafe.Pointer(name))) == int32('\000') {
  9978. goto _4
  9979. }
  9980. size = symstrsize - (*TElf32_Sym)(unsafe.Pointer(s)).Fst_name
  9981. p = list
  9982. for {
  9983. if !!(*(*uintptr)(unsafe.Pointer(p)) == uintptr(0) || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p))))) == 0) {
  9984. break
  9985. }
  9986. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p))))) == int32('_') && libc.Xstrncmp(tls, name, *(*uintptr)(unsafe.Pointer(p))+uintptr(1), size) == 0 || libc.Xstrncmp(tls, name, *(*uintptr)(unsafe.Pointer(p)), size) == 0 {
  9987. _elf_sym_to_nlist(tls, p, s, shdr, libc.Int32FromUint16((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shnum))
  9988. nent--
  9989. v6 = nent
  9990. if v6 <= 0 {
  9991. break
  9992. }
  9993. }
  9994. goto _5
  9995. _5:
  9996. ;
  9997. p += 12
  9998. }
  9999. goto _4
  10000. _4:
  10001. ;
  10002. s += 16
  10003. cc = TElf32_Sword(uint32(cc) - libc.Uint32FromInt64(16))
  10004. }
  10005. }
  10006. goto done
  10007. done:
  10008. ;
  10009. errsave = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  10010. libc.Xfree(tls, strtab)
  10011. libc.Xfree(tls, shdr)
  10012. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = errsave
  10013. return nent
  10014. }
  10015. func Xnlist(tls *libc.TLS, name uintptr, list uintptr) (r int32) {
  10016. bp := tls.Alloc(16)
  10017. defer tls.Free(16)
  10018. var fd, n int32
  10019. _, _ = fd, n
  10020. if list == libc.UintptrFromInt32(0) {
  10021. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  10022. return -int32(1)
  10023. }
  10024. fd = libc.Xopen(tls, name, m_O_RDONLY1, libc.VaList(bp+8, 0))
  10025. if fd < 0 {
  10026. return -int32(1)
  10027. }
  10028. n = X__fdnlist(tls, fd, list)
  10029. libc.Xclose(tls, fd)
  10030. return n
  10031. }
  10032. const m_O_CREAT3 = 64
  10033. const m_O_NONBLOCK3 = 2048
  10034. const m_O_TRUNC3 = 512
  10035. const m_O_WRONLY1 = 1
  10036. type Tpidfh = struct {
  10037. Fpf_fd int32
  10038. Fpf_path uintptr
  10039. Fpf_dev Tdev_t
  10040. Fpf_ino Tino_t
  10041. }
  10042. func _pidfile_verify(tls *libc.TLS, pfh uintptr) (r int32) {
  10043. bp := tls.Alloc(144)
  10044. defer tls.Free(144)
  10045. var _ /* sb at bp+0 */ Tstat
  10046. if pfh == libc.UintptrFromInt32(0) || (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd == -int32(1) {
  10047. return int32(m_EINVAL)
  10048. }
  10049. /*
  10050. * Check remembered descriptor.
  10051. */
  10052. if libc.Xfstat(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd, bp) == -int32(1) {
  10053. return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  10054. }
  10055. if (*(*Tstat)(unsafe.Pointer(bp))).Fst_dev != (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_dev || (*(*Tstat)(unsafe.Pointer(bp))).Fst_ino != (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_ino {
  10056. return int32(m_EINVAL)
  10057. }
  10058. return 0
  10059. }
  10060. func _pidfile_read(tls *libc.TLS, path uintptr, pidptr uintptr) (r int32) {
  10061. bp := tls.Alloc(32)
  10062. defer tls.Free(32)
  10063. var error1, fd, i int32
  10064. var _ /* buf at bp+0 */ [16]int8
  10065. var _ /* endptr at bp+16 */ uintptr
  10066. _, _, _ = error1, fd, i
  10067. fd = libc.Xopen(tls, path, m_O_RDONLY1, 0)
  10068. if fd == -int32(1) {
  10069. return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  10070. }
  10071. i = libc.Xread(tls, fd, bp, libc.Uint32FromInt64(16)-libc.Uint32FromInt32(1))
  10072. error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) /* Remember errno in case close() wants to change it. */
  10073. libc.Xclose(tls, fd)
  10074. if i == -int32(1) {
  10075. return error1
  10076. } else {
  10077. if i == 0 {
  10078. return int32(m_EAGAIN)
  10079. }
  10080. }
  10081. (*(*[16]int8)(unsafe.Pointer(bp)))[i] = int8('\000')
  10082. *(*Tpid_t)(unsafe.Pointer(pidptr)) = int32(libc.Xstrtol(tls, bp, bp+16, int32(10)))
  10083. if *(*uintptr)(unsafe.Pointer(bp + 16)) != bp+uintptr(i) {
  10084. return int32(m_EINVAL)
  10085. }
  10086. return 0
  10087. }
  10088. func Xpidfile_open(tls *libc.TLS, path uintptr, mode Tmode_t, pidptr uintptr) (r uintptr) {
  10089. bp := tls.Alloc(176)
  10090. defer tls.Free(176)
  10091. var count, error1, fd, len1, v2 int32
  10092. var pfh uintptr
  10093. var v3 bool
  10094. var _ /* rqtp at bp+144 */ Ttimespec
  10095. var _ /* sb at bp+0 */ Tstat
  10096. _, _, _, _, _, _, _ = count, error1, fd, len1, pfh, v2, v3
  10097. pfh = libc.Xmalloc(tls, uint32(24))
  10098. if pfh == libc.UintptrFromInt32(0) {
  10099. return libc.UintptrFromInt32(0)
  10100. }
  10101. if path == libc.UintptrFromInt32(0) {
  10102. len1 = libc.Xasprintf(tls, pfh+4, __ccgo_ts+304, libc.VaList(bp+168, Xgetprogname(tls)))
  10103. if len1 < 0 {
  10104. libc.Xfree(tls, pfh)
  10105. return libc.UintptrFromInt32(0)
  10106. }
  10107. } else {
  10108. (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path = libc.Xstrdup(tls, path)
  10109. }
  10110. /*
  10111. * Open the PID file and obtain exclusive lock.
  10112. * We truncate PID file here only to remove old PID immediately,
  10113. * PID file will be truncated again in pidfile_write(), so
  10114. * pidfile_write() can be called multiple times.
  10115. */
  10116. fd = Xflopen(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path, libc.Int32FromInt32(m_O_WRONLY1)|libc.Int32FromInt32(m_O_CREAT3)|libc.Int32FromInt32(m_O_TRUNC3)|libc.Int32FromInt32(m_O_NONBLOCK3), libc.VaList(bp+168, mode))
  10117. if fd == -int32(1) {
  10118. if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EAGAIN) {
  10119. if pidptr == libc.UintptrFromInt32(0) {
  10120. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EEXIST)
  10121. } else {
  10122. count = int32(20)
  10123. (*(*Ttimespec)(unsafe.Pointer(bp + 144))).Ftv_sec = 0
  10124. (*(*Ttimespec)(unsafe.Pointer(bp + 144))).Ftv_nsec = int32(5000000)
  10125. for {
  10126. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = _pidfile_read(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path, pidptr)
  10127. if v3 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != int32(m_EAGAIN); !v3 {
  10128. count--
  10129. v2 = count
  10130. }
  10131. if v3 || v2 == 0 {
  10132. break
  10133. }
  10134. libc.Xnanosleep(tls, bp+144, uintptr(0))
  10135. goto _1
  10136. _1:
  10137. }
  10138. if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EAGAIN) {
  10139. *(*Tpid_t)(unsafe.Pointer(pidptr)) = -int32(1)
  10140. }
  10141. if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == 0 || *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EAGAIN) {
  10142. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EEXIST)
  10143. }
  10144. }
  10145. }
  10146. error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  10147. libc.Xfree(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path)
  10148. libc.Xfree(tls, pfh)
  10149. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
  10150. return libc.UintptrFromInt32(0)
  10151. }
  10152. /*
  10153. * Remember file information, so in pidfile_write() we are sure we write
  10154. * to the proper descriptor.
  10155. */
  10156. if libc.Xfstat(tls, fd, bp) == -int32(1) {
  10157. error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  10158. libc.Xunlink(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path)
  10159. libc.Xfree(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path)
  10160. libc.Xclose(tls, fd)
  10161. libc.Xfree(tls, pfh)
  10162. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
  10163. return libc.UintptrFromInt32(0)
  10164. }
  10165. (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd = fd
  10166. (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_dev = (*(*Tstat)(unsafe.Pointer(bp))).Fst_dev
  10167. (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_ino = (*(*Tstat)(unsafe.Pointer(bp))).Fst_ino
  10168. return pfh
  10169. }
  10170. func Xpidfile_write(tls *libc.TLS, pfh uintptr) (r int32) {
  10171. bp := tls.Alloc(32)
  10172. defer tls.Free(32)
  10173. var error1, fd int32
  10174. var _ /* pidstr at bp+0 */ [16]int8
  10175. _, _ = error1, fd
  10176. /*
  10177. * Check remembered descriptor, so we don't overwrite some other
  10178. * file if pidfile was closed and descriptor reused.
  10179. */
  10180. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = _pidfile_verify(tls, pfh)
  10181. if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != 0 {
  10182. /*
  10183. * Don't close descriptor, because we are not sure if it's ours.
  10184. */
  10185. return -int32(1)
  10186. }
  10187. fd = (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd
  10188. /*
  10189. * Truncate PID file, so multiple calls of pidfile_write() are allowed.
  10190. */
  10191. if libc.Xftruncate(tls, fd, 0) == -int32(1) {
  10192. error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  10193. __pidfile_remove(tls, pfh, 0)
  10194. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
  10195. return -int32(1)
  10196. }
  10197. libc.X__builtin_snprintf(tls, bp, uint32(16), __ccgo_ts+320, libc.VaList(bp+24, libc.Xgetpid(tls)))
  10198. if libc.Xpwrite(tls, fd, bp, libc.Xstrlen(tls, bp), 0) != libc.Int32FromUint32(libc.Xstrlen(tls, bp)) {
  10199. error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  10200. __pidfile_remove(tls, pfh, 0)
  10201. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
  10202. return -int32(1)
  10203. }
  10204. return 0
  10205. }
  10206. func Xpidfile_close(tls *libc.TLS, pfh uintptr) (r int32) {
  10207. var error1 int32
  10208. _ = error1
  10209. error1 = _pidfile_verify(tls, pfh)
  10210. if error1 != 0 {
  10211. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
  10212. return -int32(1)
  10213. }
  10214. if libc.Xclose(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd) == -int32(1) {
  10215. error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  10216. }
  10217. libc.Xfree(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path)
  10218. libc.Xfree(tls, pfh)
  10219. if error1 != 0 {
  10220. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
  10221. return -int32(1)
  10222. }
  10223. return 0
  10224. }
  10225. func __pidfile_remove(tls *libc.TLS, pfh uintptr, freeit int32) (r int32) {
  10226. var error1 int32
  10227. _ = error1
  10228. error1 = _pidfile_verify(tls, pfh)
  10229. if error1 != 0 {
  10230. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
  10231. return -int32(1)
  10232. }
  10233. if libc.Xunlink(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path) == -int32(1) {
  10234. error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  10235. }
  10236. if libc.Xclose(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd) == -int32(1) {
  10237. if error1 == 0 {
  10238. error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  10239. }
  10240. }
  10241. if freeit != 0 {
  10242. libc.Xfree(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path)
  10243. libc.Xfree(tls, pfh)
  10244. } else {
  10245. (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd = -int32(1)
  10246. }
  10247. if error1 != 0 {
  10248. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
  10249. return -int32(1)
  10250. }
  10251. return 0
  10252. }
  10253. func Xpidfile_remove(tls *libc.TLS, pfh uintptr) (r int32) {
  10254. return __pidfile_remove(tls, pfh, int32(1))
  10255. }
  10256. func Xpidfile_fileno(tls *libc.TLS, pfh uintptr) (r int32) {
  10257. if pfh == libc.UintptrFromInt32(0) || (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd == -int32(1) {
  10258. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  10259. return -int32(1)
  10260. }
  10261. return (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd
  10262. }
  10263. func Xgetprogname(tls *libc.TLS) (r uintptr) {
  10264. if libc.Xprogram_invocation_short_name == libc.UintptrFromInt32(0) {
  10265. libc.Xprogram_invocation_short_name = libc.Xprogram_invocation_short_name
  10266. }
  10267. return libc.Xprogram_invocation_short_name
  10268. }
  10269. func Xsetprogname(tls *libc.TLS, progname uintptr) {
  10270. var i Tsize_t
  10271. _ = i
  10272. i = libc.Xstrlen(tls, progname)
  10273. for {
  10274. if !(i > uint32(0)) {
  10275. break
  10276. }
  10277. if int32(*(*int8)(unsafe.Pointer(progname + uintptr(i-uint32(1))))) == int32('/') {
  10278. libc.Xprogram_invocation_short_name = progname + uintptr(i)
  10279. return
  10280. }
  10281. goto _1
  10282. _1:
  10283. ;
  10284. i--
  10285. }
  10286. libc.Xprogram_invocation_short_name = progname
  10287. }
  10288. const m_GID_SZ = 251
  10289. const m_GNMLEN = 32
  10290. const m_GNM_SZ = 251
  10291. const m_INVALID = 2
  10292. const m_UID_SZ = 317
  10293. const m_UNMLEN = 32
  10294. const m_UNM_SZ = 317
  10295. const m_VALID = 1
  10296. const m__PW_BUF_LEN = 1024
  10297. type Tgroup = struct {
  10298. Fgr_name uintptr
  10299. Fgr_passwd uintptr
  10300. Fgr_gid Tgid_t
  10301. Fgr_mem uintptr
  10302. }
  10303. type Tpasswd = struct {
  10304. Fpw_name uintptr
  10305. Fpw_passwd uintptr
  10306. Fpw_uid Tuid_t
  10307. Fpw_gid Tgid_t
  10308. Fpw_gecos uintptr
  10309. Fpw_dir uintptr
  10310. Fpw_shell uintptr
  10311. }
  10312. /*
  10313. * Constants and data structures used to implement group and password file
  10314. * caches. Name lengths have been chosen to be as large as those supported
  10315. * by the passwd and group files as well as the standard archive formats.
  10316. * CACHE SIZES MUST BE PRIME
  10317. */
  10318. /*
  10319. * Node structures used in the user, group, uid, and gid caches.
  10320. */
  10321. type TUIDC = struct {
  10322. Fvalid int32
  10323. Fname [32]int8
  10324. Fuid Tuid_t
  10325. }
  10326. /*
  10327. * Constants and data structures used to implement group and password file
  10328. * caches. Name lengths have been chosen to be as large as those supported
  10329. * by the passwd and group files as well as the standard archive formats.
  10330. * CACHE SIZES MUST BE PRIME
  10331. */
  10332. /*
  10333. * Node structures used in the user, group, uid, and gid caches.
  10334. */
  10335. type Tuidc = TUIDC
  10336. type TGIDC = struct {
  10337. Fvalid int32
  10338. Fname [32]int8
  10339. Fgid Tgid_t
  10340. }
  10341. type Tgidc = TGIDC
  10342. /*
  10343. * Routines that control user, group, uid and gid caches.
  10344. * Traditional passwd/group cache routines perform quite poorly with
  10345. * archives. The chances of hitting a valid lookup with an archive is quite a
  10346. * bit worse than with files already resident on the file system. These misses
  10347. * create a MAJOR performance cost. To adress this problem, these routines
  10348. * cache both hits and misses.
  10349. */
  10350. var _uidtb uintptr /* uid to name cache */
  10351. var _gidtb uintptr /* gid to name cache */
  10352. var _usrtb uintptr /* user name to uid cache */
  10353. var _grptb uintptr /* group name to gid cache */
  10354. func _st_hash(tls *libc.TLS, name uintptr, len1 Tsize_t, tabsz int32) (r Tu_int) {
  10355. var key Tu_int
  10356. var v1 Tsize_t
  10357. var v2 uintptr
  10358. _, _, _ = key, v1, v2
  10359. key = uint32(0)
  10360. for {
  10361. v1 = len1
  10362. len1--
  10363. if !(v1 != 0) {
  10364. break
  10365. }
  10366. v2 = name
  10367. name++
  10368. key += libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(v2)))
  10369. key = key<<libc.Int32FromInt32(8) | key>>libc.Int32FromInt32(24)
  10370. }
  10371. return key % libc.Uint32FromInt32(tabsz)
  10372. }
  10373. // C documentation
  10374. //
  10375. // /*
  10376. // * uidtb_start
  10377. // * creates an an empty uidtb
  10378. // * Return:
  10379. // * 0 if ok, -1 otherwise
  10380. // */
  10381. func _uidtb_start(tls *libc.TLS) (r int32) {
  10382. var v1 uintptr
  10383. _ = v1
  10384. if _uidtb != libc.UintptrFromInt32(0) {
  10385. return 0
  10386. }
  10387. if _fail != 0 {
  10388. return -int32(1)
  10389. }
  10390. v1 = libc.Xcalloc(tls, uint32(m_UID_SZ), uint32(4))
  10391. _uidtb = v1
  10392. if v1 == libc.UintptrFromInt32(0) {
  10393. _fail++
  10394. return -int32(1)
  10395. }
  10396. return 0
  10397. }
  10398. var _fail int32
  10399. // C documentation
  10400. //
  10401. // /*
  10402. // * gidtb_start
  10403. // * creates an an empty gidtb
  10404. // * Return:
  10405. // * 0 if ok, -1 otherwise
  10406. // */
  10407. func _gidtb_start(tls *libc.TLS) (r int32) {
  10408. var v1 uintptr
  10409. _ = v1
  10410. if _gidtb != libc.UintptrFromInt32(0) {
  10411. return 0
  10412. }
  10413. if _fail1 != 0 {
  10414. return -int32(1)
  10415. }
  10416. v1 = libc.Xcalloc(tls, uint32(m_GID_SZ), uint32(4))
  10417. _gidtb = v1
  10418. if v1 == libc.UintptrFromInt32(0) {
  10419. _fail1++
  10420. return -int32(1)
  10421. }
  10422. return 0
  10423. }
  10424. var _fail1 int32
  10425. // C documentation
  10426. //
  10427. // /*
  10428. // * usrtb_start
  10429. // * creates an an empty usrtb
  10430. // * Return:
  10431. // * 0 if ok, -1 otherwise
  10432. // */
  10433. func _usrtb_start(tls *libc.TLS) (r int32) {
  10434. var v1 uintptr
  10435. _ = v1
  10436. if _usrtb != libc.UintptrFromInt32(0) {
  10437. return 0
  10438. }
  10439. if _fail2 != 0 {
  10440. return -int32(1)
  10441. }
  10442. v1 = libc.Xcalloc(tls, uint32(m_UNM_SZ), uint32(4))
  10443. _usrtb = v1
  10444. if v1 == libc.UintptrFromInt32(0) {
  10445. _fail2++
  10446. return -int32(1)
  10447. }
  10448. return 0
  10449. }
  10450. var _fail2 int32
  10451. // C documentation
  10452. //
  10453. // /*
  10454. // * grptb_start
  10455. // * creates an an empty grptb
  10456. // * Return:
  10457. // * 0 if ok, -1 otherwise
  10458. // */
  10459. func _grptb_start(tls *libc.TLS) (r int32) {
  10460. var v1 uintptr
  10461. _ = v1
  10462. if _grptb != libc.UintptrFromInt32(0) {
  10463. return 0
  10464. }
  10465. if _fail3 != 0 {
  10466. return -int32(1)
  10467. }
  10468. v1 = libc.Xcalloc(tls, uint32(m_GNM_SZ), uint32(4))
  10469. _grptb = v1
  10470. if v1 == libc.UintptrFromInt32(0) {
  10471. _fail3++
  10472. return -int32(1)
  10473. }
  10474. return 0
  10475. }
  10476. var _fail3 int32
  10477. // C documentation
  10478. //
  10479. // /*
  10480. // * user_from_uid()
  10481. // * caches the name (if any) for the uid. If noname clear, we always
  10482. // * return the stored name (if valid or invalid match).
  10483. // * We use a simple hash table.
  10484. // * Return:
  10485. // * Pointer to stored name (or a empty string)
  10486. // */
  10487. func Xuser_from_uid(tls *libc.TLS, uid Tuid_t, noname int32) (r uintptr) {
  10488. bp := tls.Alloc(1072)
  10489. defer tls.Free(1072)
  10490. var pptr, ptr, v1 uintptr
  10491. var _ /* pw at bp+28 */ uintptr
  10492. var _ /* pwbuf at bp+32 */ [1024]int8
  10493. var _ /* pwstore at bp+0 */ Tpasswd
  10494. _, _, _ = pptr, ptr, v1
  10495. *(*uintptr)(unsafe.Pointer(bp + 28)) = libc.UintptrFromInt32(0)
  10496. ptr = libc.UintptrFromInt32(0)
  10497. if _uidtb != libc.UintptrFromInt32(0) || _uidtb_start(tls) == 0 {
  10498. /*
  10499. * see if we have this uid cached
  10500. */
  10501. pptr = _uidtb + uintptr(uid%libc.Uint32FromInt32(m_UID_SZ))*4
  10502. ptr = *(*uintptr)(unsafe.Pointer(pptr))
  10503. if ptr != libc.UintptrFromInt32(0) && (*TUIDC)(unsafe.Pointer(ptr)).Fvalid > 0 && (*TUIDC)(unsafe.Pointer(ptr)).Fuid == uid {
  10504. /*
  10505. * have an entry for this uid
  10506. */
  10507. if !(noname != 0) || (*TUIDC)(unsafe.Pointer(ptr)).Fvalid == int32(m_VALID) {
  10508. return ptr + 4
  10509. }
  10510. return libc.UintptrFromInt32(0)
  10511. }
  10512. if ptr == libc.UintptrFromInt32(0) {
  10513. v1 = libc.Xmalloc(tls, uint32(40))
  10514. ptr = v1
  10515. *(*uintptr)(unsafe.Pointer(pptr)) = v1
  10516. }
  10517. }
  10518. libc.Xgetpwuid_r(tls, uid, bp, bp+32, uint32(1024), bp+28)
  10519. if *(*uintptr)(unsafe.Pointer(bp + 28)) == libc.UintptrFromInt32(0) {
  10520. /*
  10521. * no match for this uid in the local password file
  10522. * a string that is the uid in numeric format
  10523. */
  10524. if ptr == libc.UintptrFromInt32(0) {
  10525. return libc.UintptrFromInt32(0)
  10526. }
  10527. (*TUIDC)(unsafe.Pointer(ptr)).Fuid = uid
  10528. libc.X__builtin_snprintf(tls, ptr+4, uint32(m_UNMLEN), __ccgo_ts+320, libc.VaList(bp+1064, uid))
  10529. (*TUIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_INVALID)
  10530. if noname != 0 {
  10531. return libc.UintptrFromInt32(0)
  10532. }
  10533. } else {
  10534. /*
  10535. * there is an entry for this uid in the password file
  10536. */
  10537. if ptr == libc.UintptrFromInt32(0) {
  10538. return (*Tpasswd)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)))).Fpw_name
  10539. }
  10540. (*TUIDC)(unsafe.Pointer(ptr)).Fuid = uid
  10541. Xstrlcpy(tls, ptr+4, (*Tpasswd)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)))).Fpw_name, uint32(32))
  10542. (*TUIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_VALID)
  10543. }
  10544. return ptr + 4
  10545. }
  10546. // C documentation
  10547. //
  10548. // /*
  10549. // * group_from_gid()
  10550. // * caches the name (if any) for the gid. If noname clear, we always
  10551. // * return the stored name (if valid or invalid match).
  10552. // * We use a simple hash table.
  10553. // * Return:
  10554. // * Pointer to stored name (or a empty string)
  10555. // */
  10556. func Xgroup_from_gid(tls *libc.TLS, gid Tgid_t, noname int32) (r uintptr) {
  10557. bp := tls.Alloc(1872)
  10558. defer tls.Free(1872)
  10559. var pptr, ptr, v1 uintptr
  10560. var _ /* gr at bp+16 */ uintptr
  10561. var _ /* grbuf at bp+20 */ [1824]int8
  10562. var _ /* grstore at bp+0 */ Tgroup
  10563. _, _, _ = pptr, ptr, v1
  10564. *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0)
  10565. ptr = libc.UintptrFromInt32(0)
  10566. if _gidtb != libc.UintptrFromInt32(0) || _gidtb_start(tls) == 0 {
  10567. /*
  10568. * see if we have this gid cached
  10569. */
  10570. pptr = _gidtb + uintptr(gid%libc.Uint32FromInt32(m_GID_SZ))*4
  10571. ptr = *(*uintptr)(unsafe.Pointer(pptr))
  10572. if ptr != libc.UintptrFromInt32(0) && (*TGIDC)(unsafe.Pointer(ptr)).Fvalid > 0 && (*TGIDC)(unsafe.Pointer(ptr)).Fgid == gid {
  10573. /*
  10574. * have an entry for this gid
  10575. */
  10576. if !(noname != 0) || (*TGIDC)(unsafe.Pointer(ptr)).Fvalid == int32(m_VALID) {
  10577. return ptr + 4
  10578. }
  10579. return libc.UintptrFromInt32(0)
  10580. }
  10581. if ptr == libc.UintptrFromInt32(0) {
  10582. v1 = libc.Xmalloc(tls, uint32(40))
  10583. ptr = v1
  10584. *(*uintptr)(unsafe.Pointer(pptr)) = v1
  10585. }
  10586. }
  10587. libc.Xgetgrgid_r(tls, gid, bp, bp+20, uint32(1824), bp+16)
  10588. if *(*uintptr)(unsafe.Pointer(bp + 16)) == libc.UintptrFromInt32(0) {
  10589. /*
  10590. * no match for this gid in the local group file, put in
  10591. * a string that is the gid in numeric format
  10592. */
  10593. if ptr == libc.UintptrFromInt32(0) {
  10594. return libc.UintptrFromInt32(0)
  10595. }
  10596. (*TGIDC)(unsafe.Pointer(ptr)).Fgid = gid
  10597. libc.X__builtin_snprintf(tls, ptr+4, uint32(m_GNMLEN), __ccgo_ts+320, libc.VaList(bp+1856, gid))
  10598. (*TGIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_INVALID)
  10599. if noname != 0 {
  10600. return libc.UintptrFromInt32(0)
  10601. }
  10602. } else {
  10603. /*
  10604. * there is an entry for this group in the group file
  10605. */
  10606. if ptr == libc.UintptrFromInt32(0) {
  10607. return (*Tgroup)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fgr_name
  10608. }
  10609. (*TGIDC)(unsafe.Pointer(ptr)).Fgid = gid
  10610. Xstrlcpy(tls, ptr+4, (*Tgroup)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fgr_name, uint32(32))
  10611. (*TGIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_VALID)
  10612. }
  10613. return ptr + 4
  10614. }
  10615. // C documentation
  10616. //
  10617. // /*
  10618. // * uid_from_user()
  10619. // * caches the uid for a given user name. We use a simple hash table.
  10620. // * Return:
  10621. // * 0 if the user name is found (filling in uid), -1 otherwise
  10622. // */
  10623. func Xuid_from_user(tls *libc.TLS, name uintptr, uid uintptr) (r int32) {
  10624. bp := tls.Alloc(1056)
  10625. defer tls.Free(1056)
  10626. var namelen, v1 Tsize_t
  10627. var pptr, ptr, v3 uintptr
  10628. var v2 bool
  10629. var v4 Tuid_t
  10630. var _ /* pw at bp+28 */ uintptr
  10631. var _ /* pwbuf at bp+32 */ [1024]int8
  10632. var _ /* pwstore at bp+0 */ Tpasswd
  10633. _, _, _, _, _, _, _ = namelen, pptr, ptr, v1, v2, v3, v4
  10634. *(*uintptr)(unsafe.Pointer(bp + 28)) = libc.UintptrFromInt32(0)
  10635. ptr = libc.UintptrFromInt32(0)
  10636. /*
  10637. * return -1 for mangled names
  10638. */
  10639. if v2 = name == libc.UintptrFromInt32(0); !v2 {
  10640. v1 = libc.Xstrlen(tls, name)
  10641. namelen = v1
  10642. }
  10643. if v2 || v1 == uint32(0) {
  10644. return -int32(1)
  10645. }
  10646. if _usrtb != libc.UintptrFromInt32(0) || _usrtb_start(tls) == 0 {
  10647. /*
  10648. * look up in hash table, if found and valid return the uid,
  10649. * if found and invalid, return a -1
  10650. */
  10651. pptr = _usrtb + uintptr(_st_hash(tls, name, namelen, int32(m_UNM_SZ)))*4
  10652. ptr = *(*uintptr)(unsafe.Pointer(pptr))
  10653. if ptr != libc.UintptrFromInt32(0) && (*TUIDC)(unsafe.Pointer(ptr)).Fvalid > 0 && libc.Xstrcmp(tls, name, ptr+4) == 0 {
  10654. if (*TUIDC)(unsafe.Pointer(ptr)).Fvalid == int32(m_INVALID) {
  10655. return -int32(1)
  10656. }
  10657. *(*Tuid_t)(unsafe.Pointer(uid)) = (*TUIDC)(unsafe.Pointer(ptr)).Fuid
  10658. return 0
  10659. }
  10660. if ptr == libc.UintptrFromInt32(0) {
  10661. v3 = libc.Xmalloc(tls, uint32(40))
  10662. ptr = v3
  10663. *(*uintptr)(unsafe.Pointer(pptr)) = v3
  10664. }
  10665. }
  10666. /*
  10667. * no match, look it up, if no match store it as an invalid entry,
  10668. * or store the matching uid
  10669. */
  10670. libc.Xgetpwnam_r(tls, name, bp, bp+32, uint32(1024), bp+28)
  10671. if ptr == libc.UintptrFromInt32(0) {
  10672. if *(*uintptr)(unsafe.Pointer(bp + 28)) == libc.UintptrFromInt32(0) {
  10673. return -int32(1)
  10674. }
  10675. *(*Tuid_t)(unsafe.Pointer(uid)) = (*Tpasswd)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)))).Fpw_uid
  10676. return 0
  10677. }
  10678. Xstrlcpy(tls, ptr+4, name, uint32(32))
  10679. if *(*uintptr)(unsafe.Pointer(bp + 28)) == libc.UintptrFromInt32(0) {
  10680. (*TUIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_INVALID)
  10681. return -int32(1)
  10682. }
  10683. (*TUIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_VALID)
  10684. v4 = (*Tpasswd)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)))).Fpw_uid
  10685. (*TUIDC)(unsafe.Pointer(ptr)).Fuid = v4
  10686. *(*Tuid_t)(unsafe.Pointer(uid)) = v4
  10687. return 0
  10688. }
  10689. // C documentation
  10690. //
  10691. // /*
  10692. // * gid_from_group()
  10693. // * caches the gid for a given group name. We use a simple hash table.
  10694. // * Return:
  10695. // * 0 if the group name is found (filling in gid), -1 otherwise
  10696. // */
  10697. func Xgid_from_group(tls *libc.TLS, name uintptr, gid uintptr) (r int32) {
  10698. bp := tls.Alloc(1856)
  10699. defer tls.Free(1856)
  10700. var namelen, v1 Tsize_t
  10701. var pptr, ptr, v3 uintptr
  10702. var v2 bool
  10703. var v4 Tgid_t
  10704. var _ /* gr at bp+16 */ uintptr
  10705. var _ /* grbuf at bp+20 */ [1824]int8
  10706. var _ /* grstore at bp+0 */ Tgroup
  10707. _, _, _, _, _, _, _ = namelen, pptr, ptr, v1, v2, v3, v4
  10708. *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0)
  10709. ptr = libc.UintptrFromInt32(0)
  10710. /*
  10711. * return -1 for mangled names
  10712. */
  10713. if v2 = name == libc.UintptrFromInt32(0); !v2 {
  10714. v1 = libc.Xstrlen(tls, name)
  10715. namelen = v1
  10716. }
  10717. if v2 || v1 == uint32(0) {
  10718. return -int32(1)
  10719. }
  10720. if _grptb != libc.UintptrFromInt32(0) || _grptb_start(tls) == 0 {
  10721. /*
  10722. * look up in hash table, if found and valid return the uid,
  10723. * if found and invalid, return a -1
  10724. */
  10725. pptr = _grptb + uintptr(_st_hash(tls, name, namelen, int32(m_GID_SZ)))*4
  10726. ptr = *(*uintptr)(unsafe.Pointer(pptr))
  10727. if ptr != libc.UintptrFromInt32(0) && (*TGIDC)(unsafe.Pointer(ptr)).Fvalid > 0 && libc.Xstrcmp(tls, name, ptr+4) == 0 {
  10728. if (*TGIDC)(unsafe.Pointer(ptr)).Fvalid == int32(m_INVALID) {
  10729. return -int32(1)
  10730. }
  10731. *(*Tgid_t)(unsafe.Pointer(gid)) = (*TGIDC)(unsafe.Pointer(ptr)).Fgid
  10732. return 0
  10733. }
  10734. if ptr == libc.UintptrFromInt32(0) {
  10735. v3 = libc.Xmalloc(tls, uint32(40))
  10736. ptr = v3
  10737. *(*uintptr)(unsafe.Pointer(pptr)) = v3
  10738. }
  10739. }
  10740. /*
  10741. * no match, look it up, if no match store it as an invalid entry,
  10742. * or store the matching gid
  10743. */
  10744. libc.Xgetgrnam_r(tls, name, bp, bp+20, uint32(1824), bp+16)
  10745. if ptr == libc.UintptrFromInt32(0) {
  10746. if *(*uintptr)(unsafe.Pointer(bp + 16)) == libc.UintptrFromInt32(0) {
  10747. return -int32(1)
  10748. }
  10749. *(*Tgid_t)(unsafe.Pointer(gid)) = (*Tgroup)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fgr_gid
  10750. return 0
  10751. }
  10752. Xstrlcpy(tls, ptr+4, name, uint32(32))
  10753. if *(*uintptr)(unsafe.Pointer(bp + 16)) == libc.UintptrFromInt32(0) {
  10754. (*TGIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_INVALID)
  10755. return -int32(1)
  10756. }
  10757. (*TGIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_VALID)
  10758. v4 = (*Tgroup)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fgr_gid
  10759. (*TGIDC)(unsafe.Pointer(ptr)).Fgid = v4
  10760. *(*Tgid_t)(unsafe.Pointer(gid)) = v4
  10761. return 0
  10762. }
  10763. const m_SIZE = 512
  10764. const m_THRESHOLD1 = 20
  10765. type Tstack = struct {
  10766. Fsa uintptr
  10767. Fsn int32
  10768. Fsi int32
  10769. }
  10770. func Xradixsort(tls *libc.TLS, a uintptr, n int32, tab uintptr, endch uint32) (r int32) {
  10771. bp := tls.Alloc(256)
  10772. defer tls.Free(256)
  10773. var c uint32
  10774. var tr uintptr
  10775. var _ /* tr0 at bp+0 */ [256]uint8
  10776. _, _ = c, tr
  10777. if tab == libc.UintptrFromInt32(0) {
  10778. tr = bp
  10779. c = uint32(0)
  10780. for {
  10781. if !(c < endch) {
  10782. break
  10783. }
  10784. (*(*[256]uint8)(unsafe.Pointer(bp)))[c] = uint8(c + uint32(1))
  10785. goto _1
  10786. _1:
  10787. ;
  10788. c++
  10789. }
  10790. (*(*[256]uint8)(unsafe.Pointer(bp)))[c] = uint8(0)
  10791. c++
  10792. for {
  10793. if !(c < uint32(256)) {
  10794. break
  10795. }
  10796. (*(*[256]uint8)(unsafe.Pointer(bp)))[c] = uint8(c)
  10797. goto _2
  10798. _2:
  10799. ;
  10800. c++
  10801. }
  10802. endch = uint32(0)
  10803. } else {
  10804. endch = uint32(*(*uint8)(unsafe.Pointer(tab + uintptr(endch))))
  10805. tr = tab
  10806. if endch != uint32(0) && endch != uint32(255) {
  10807. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  10808. return -int32(1)
  10809. }
  10810. }
  10811. _r_sort_a(tls, a, n, 0, tr, endch)
  10812. return 0
  10813. }
  10814. func Xsradixsort(tls *libc.TLS, a uintptr, n int32, tab uintptr, endch uint32) (r int32) {
  10815. bp := tls.Alloc(256)
  10816. defer tls.Free(256)
  10817. var c uint32
  10818. var ta, tr uintptr
  10819. var _ /* tr0 at bp+0 */ [256]uint8
  10820. _, _, _ = c, ta, tr
  10821. if a == libc.UintptrFromInt32(0) {
  10822. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EFAULT)
  10823. return -int32(1)
  10824. }
  10825. if tab == libc.UintptrFromInt32(0) {
  10826. tr = bp
  10827. c = uint32(0)
  10828. for {
  10829. if !(c < endch) {
  10830. break
  10831. }
  10832. (*(*[256]uint8)(unsafe.Pointer(bp)))[c] = uint8(c + uint32(1))
  10833. goto _1
  10834. _1:
  10835. ;
  10836. c++
  10837. }
  10838. (*(*[256]uint8)(unsafe.Pointer(bp)))[c] = uint8(0)
  10839. c++
  10840. for {
  10841. if !(c < uint32(256)) {
  10842. break
  10843. }
  10844. (*(*[256]uint8)(unsafe.Pointer(bp)))[c] = uint8(c)
  10845. goto _2
  10846. _2:
  10847. ;
  10848. c++
  10849. }
  10850. endch = uint32(0)
  10851. } else {
  10852. endch = uint32(*(*uint8)(unsafe.Pointer(tab + uintptr(endch))))
  10853. tr = tab
  10854. if endch != uint32(0) && endch != uint32(255) {
  10855. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  10856. return -int32(1)
  10857. }
  10858. }
  10859. if n < int32(m_THRESHOLD1) {
  10860. _simplesort(tls, a, n, 0, tr, endch)
  10861. } else {
  10862. ta = Xreallocarray(tls, libc.UintptrFromInt32(0), libc.Uint32FromInt32(n), uint32(4))
  10863. if ta == libc.UintptrFromInt32(0) {
  10864. return -int32(1)
  10865. }
  10866. _r_sort_b(tls, a, ta, n, 0, tr, endch)
  10867. libc.Xfree(tls, ta)
  10868. }
  10869. return 0
  10870. }
  10871. // C documentation
  10872. //
  10873. // /* Unstable, in-place sort. */
  10874. func _r_sort_a(tls *libc.TLS, a uintptr, n int32, i int32, tr uintptr, endch uint32) {
  10875. bp := tls.Alloc(7168)
  10876. defer tls.Free(7168)
  10877. var aj, ak, an, cp, r, sp, sp0, sp1, t, v1, v10, v12, v15, v16, v17, v2, v4, v6, v7, v9 uintptr
  10878. var bigc, c, v18, v5, v8 uint32
  10879. var temp Tstack
  10880. var _ /* s at bp+0 */ [512]Tstack
  10881. var _ /* top at bp+6144 */ [256]uintptr
  10882. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aj, ak, an, bigc, c, cp, r, sp, sp0, sp1, t, temp, v1, v10, v12, v15, v16, v17, v18, v2, v4, v5, v6, v7, v8, v9
  10883. /* Set up stack. */
  10884. sp = bp
  10885. (*Tstack)(unsafe.Pointer(sp)).Fsa = a
  10886. (*Tstack)(unsafe.Pointer(sp)).Fsn = n
  10887. v1 = sp
  10888. sp += 12
  10889. (*Tstack)(unsafe.Pointer(v1)).Fsi = i
  10890. for !(bp >= sp) {
  10891. sp -= 12
  10892. v2 = sp
  10893. a = (*Tstack)(unsafe.Pointer(v2)).Fsa
  10894. n = (*Tstack)(unsafe.Pointer(sp)).Fsn
  10895. i = (*Tstack)(unsafe.Pointer(sp)).Fsi
  10896. if n < int32(m_THRESHOLD1) {
  10897. _simplesort(tls, a, n, i, tr, endch)
  10898. continue
  10899. }
  10900. an = a + uintptr(n)*4
  10901. /* Make character histogram. */
  10902. if _nc == uint32(0) {
  10903. _bmin = uint32(255) /* First occupied bin, excluding eos. */
  10904. ak = a
  10905. for {
  10906. if !(ak < an) {
  10907. break
  10908. }
  10909. v4 = ak
  10910. ak += 4
  10911. c = uint32(*(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(v4)) + uintptr(i)))))))
  10912. v6 = uintptr(unsafe.Pointer(&_count)) + uintptr(c)*4
  10913. *(*uint32)(unsafe.Pointer(v6))++
  10914. v5 = *(*uint32)(unsafe.Pointer(v6))
  10915. if v5 == uint32(1) && c != endch {
  10916. if c < _bmin {
  10917. _bmin = c
  10918. }
  10919. _nc++
  10920. }
  10921. goto _3
  10922. _3:
  10923. }
  10924. if sp+uintptr(_nc)*12 > bp+uintptr(m_SIZE)*12 { /* Get more stack. */
  10925. _r_sort_a(tls, a, n, i, tr, endch)
  10926. continue
  10927. }
  10928. }
  10929. /*
  10930. * Special case: if all strings have the same
  10931. * character at position i, move on to the next
  10932. * character.
  10933. */
  10934. if _nc == uint32(1) && _count[_bmin] == libc.Uint32FromInt32(n) {
  10935. (*Tstack)(unsafe.Pointer(sp)).Fsa = a
  10936. (*Tstack)(unsafe.Pointer(sp)).Fsn = n
  10937. v7 = sp
  10938. sp += 12
  10939. (*Tstack)(unsafe.Pointer(v7)).Fsi = i + libc.Int32FromInt32(1)
  10940. v8 = libc.Uint32FromInt32(0)
  10941. _count[_bmin] = v8
  10942. _nc = v8
  10943. continue
  10944. }
  10945. /*
  10946. * Set top[]; push incompletely sorted bins onto stack.
  10947. * top[] = pointers to last out-of-place element in bins.
  10948. * count[] = counts of elements in bins.
  10949. * Before permuting: top[c-1] + count[c] = top[c];
  10950. * during deal: top[c] counts down to top[c-1].
  10951. */
  10952. v9 = sp
  10953. sp1 = v9
  10954. sp0 = v9 /* Stack position of biggest bin. */
  10955. bigc = uint32(2) /* Size of biggest bin. */
  10956. if endch == uint32(0) { /* Special case: set top[eos]. */
  10957. v10 = a + uintptr(_count[0])*4
  10958. ak = v10
  10959. (*(*[256]uintptr)(unsafe.Pointer(bp + 6144)))[0] = v10
  10960. } else {
  10961. ak = a
  10962. (*(*[256]uintptr)(unsafe.Pointer(bp + 6144)))[int32(255)] = an
  10963. }
  10964. cp = uintptr(unsafe.Pointer(&_count)) + uintptr(_bmin)*4
  10965. for {
  10966. if !(_nc > uint32(0)) {
  10967. break
  10968. }
  10969. for *(*uint32)(unsafe.Pointer(cp)) == uint32(0) { /* Find next non-empty pile. */
  10970. cp += 4
  10971. }
  10972. if *(*uint32)(unsafe.Pointer(cp)) > uint32(1) {
  10973. if *(*uint32)(unsafe.Pointer(cp)) > bigc {
  10974. bigc = *(*uint32)(unsafe.Pointer(cp))
  10975. sp1 = sp
  10976. }
  10977. (*Tstack)(unsafe.Pointer(sp)).Fsa = ak
  10978. (*Tstack)(unsafe.Pointer(sp)).Fsn = libc.Int32FromUint32(*(*uint32)(unsafe.Pointer(cp)))
  10979. v12 = sp
  10980. sp += 12
  10981. (*Tstack)(unsafe.Pointer(v12)).Fsi = i + libc.Int32FromInt32(1)
  10982. }
  10983. ak += uintptr(*(*uint32)(unsafe.Pointer(cp))) * 4
  10984. (*(*[256]uintptr)(unsafe.Pointer(bp + 6144)))[(int32(cp)-t__predefined_ptrdiff_t(uintptr(unsafe.Pointer(&_count))))/4] = ak
  10985. _nc--
  10986. goto _11
  10987. _11:
  10988. ;
  10989. cp += 4
  10990. }
  10991. temp = *(*Tstack)(unsafe.Pointer(sp0))
  10992. *(*Tstack)(unsafe.Pointer(sp0)) = *(*Tstack)(unsafe.Pointer(sp1))
  10993. *(*Tstack)(unsafe.Pointer(sp1)) = temp /* Play it safe -- biggest bin last. */
  10994. /*
  10995. * Permute misplacements home. Already home: everything
  10996. * before aj, and in bin[c], items from top[c] on.
  10997. * Inner loop:
  10998. * r = next element to put in place;
  10999. * ak = top[r[i]] = location to put the next element.
  11000. * aj = bottom of 1st disordered bin.
  11001. * Outer loop:
  11002. * Once the 1st disordered bin is done, ie. aj >= ak,
  11003. * aj<-aj + count[c] connects the bins in a linked list;
  11004. * reset count[c].
  11005. */
  11006. aj = a
  11007. for {
  11008. if !(aj < an) {
  11009. break
  11010. }
  11011. r = *(*uintptr)(unsafe.Pointer(aj))
  11012. for {
  11013. v18 = uint32(*(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(r + uintptr(i)))))))
  11014. c = v18
  11015. v17 = bp + 6144 + uintptr(v18)*4
  11016. *(*uintptr)(unsafe.Pointer(v17)) -= 4
  11017. v16 = *(*uintptr)(unsafe.Pointer(v17))
  11018. v15 = v16
  11019. ak = v15
  11020. if !(aj < v15) {
  11021. break
  11022. }
  11023. t = *(*uintptr)(unsafe.Pointer(ak))
  11024. *(*uintptr)(unsafe.Pointer(ak)) = r
  11025. r = t
  11026. goto _14
  11027. _14:
  11028. }
  11029. goto _13
  11030. _13:
  11031. ;
  11032. *(*uintptr)(unsafe.Pointer(aj)) = r
  11033. aj += uintptr(_count[c]) * 4
  11034. _count[c] = libc.Uint32FromInt32(0)
  11035. }
  11036. }
  11037. }
  11038. var _count [256]uint32
  11039. var _nc uint32
  11040. var _bmin uint32
  11041. // C documentation
  11042. //
  11043. // /* Stable sort, requiring additional memory. */
  11044. func _r_sort_b(tls *libc.TLS, a uintptr, ta uintptr, n int32, i int32, tr uintptr, endch uint32) {
  11045. bp := tls.Alloc(7168)
  11046. defer tls.Free(7168)
  11047. var ai, ak, cp, sp, sp0, sp1, v1, v11, v13, v14, v16, v17, v18, v2, v4, v6, v7, v8 uintptr
  11048. var bigc, c, v10, v5 uint32
  11049. var temp Tstack
  11050. var _ /* s at bp+0 */ [512]Tstack
  11051. var _ /* top at bp+6144 */ [256]uintptr
  11052. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = ai, ak, bigc, c, cp, sp, sp0, sp1, temp, v1, v10, v11, v13, v14, v16, v17, v18, v2, v4, v5, v6, v7, v8
  11053. sp = bp
  11054. (*Tstack)(unsafe.Pointer(sp)).Fsa = a
  11055. (*Tstack)(unsafe.Pointer(sp)).Fsn = n
  11056. v1 = sp
  11057. sp += 12
  11058. (*Tstack)(unsafe.Pointer(v1)).Fsi = i
  11059. for !(bp >= sp) {
  11060. sp -= 12
  11061. v2 = sp
  11062. a = (*Tstack)(unsafe.Pointer(v2)).Fsa
  11063. n = (*Tstack)(unsafe.Pointer(sp)).Fsn
  11064. i = (*Tstack)(unsafe.Pointer(sp)).Fsi
  11065. if n < int32(m_THRESHOLD1) {
  11066. _simplesort(tls, a, n, i, tr, endch)
  11067. continue
  11068. }
  11069. if _nc1 == uint32(0) {
  11070. _bmin1 = uint32(255)
  11071. ak = a + uintptr(n)*4
  11072. for {
  11073. ak -= 4
  11074. v4 = ak
  11075. if !(v4 >= a) {
  11076. break
  11077. }
  11078. c = uint32(*(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ak)) + uintptr(i)))))))
  11079. v6 = uintptr(unsafe.Pointer(&_count1)) + uintptr(c)*4
  11080. *(*uint32)(unsafe.Pointer(v6))++
  11081. v5 = *(*uint32)(unsafe.Pointer(v6))
  11082. if v5 == uint32(1) && c != endch {
  11083. if c < _bmin1 {
  11084. _bmin1 = c
  11085. }
  11086. _nc1++
  11087. }
  11088. goto _3
  11089. _3:
  11090. }
  11091. if sp+uintptr(_nc1)*12 > bp+uintptr(m_SIZE)*12 {
  11092. _r_sort_b(tls, a, ta, n, i, tr, endch)
  11093. continue
  11094. }
  11095. }
  11096. v7 = sp
  11097. sp1 = v7
  11098. sp0 = v7
  11099. bigc = uint32(2)
  11100. if endch == uint32(0) {
  11101. v8 = a + uintptr(_count1[0])*4
  11102. ak = v8
  11103. (*(*[256]uintptr)(unsafe.Pointer(bp + 6144)))[0] = v8
  11104. _count1[0] = uint32(0)
  11105. } else {
  11106. ak = a
  11107. (*(*[256]uintptr)(unsafe.Pointer(bp + 6144)))[int32(255)] = a + uintptr(n)*4
  11108. _count1[int32(255)] = uint32(0)
  11109. }
  11110. cp = uintptr(unsafe.Pointer(&_count1)) + uintptr(_bmin1)*4
  11111. for {
  11112. if !(_nc1 > uint32(0)) {
  11113. break
  11114. }
  11115. for *(*uint32)(unsafe.Pointer(cp)) == uint32(0) {
  11116. cp += 4
  11117. }
  11118. v10 = *(*uint32)(unsafe.Pointer(cp))
  11119. c = v10
  11120. if v10 > uint32(1) {
  11121. if c > bigc {
  11122. bigc = c
  11123. sp1 = sp
  11124. }
  11125. (*Tstack)(unsafe.Pointer(sp)).Fsa = ak
  11126. (*Tstack)(unsafe.Pointer(sp)).Fsn = libc.Int32FromUint32(c)
  11127. v11 = sp
  11128. sp += 12
  11129. (*Tstack)(unsafe.Pointer(v11)).Fsi = i + libc.Int32FromInt32(1)
  11130. }
  11131. ak += uintptr(c) * 4
  11132. (*(*[256]uintptr)(unsafe.Pointer(bp + 6144)))[(int32(cp)-t__predefined_ptrdiff_t(uintptr(unsafe.Pointer(&_count1))))/4] = ak
  11133. *(*uint32)(unsafe.Pointer(cp)) = uint32(0) /* Reset count[]. */
  11134. _nc1--
  11135. goto _9
  11136. _9:
  11137. ;
  11138. cp += 4
  11139. }
  11140. temp = *(*Tstack)(unsafe.Pointer(sp0))
  11141. *(*Tstack)(unsafe.Pointer(sp0)) = *(*Tstack)(unsafe.Pointer(sp1))
  11142. *(*Tstack)(unsafe.Pointer(sp1)) = temp
  11143. ak = ta + uintptr(n)*4
  11144. ai = a + uintptr(n)*4
  11145. for {
  11146. if !(ak > ta) {
  11147. break
  11148. } /* Copy to temp. */
  11149. ak -= 4
  11150. v13 = ak
  11151. ai -= 4
  11152. v14 = ai
  11153. *(*uintptr)(unsafe.Pointer(v13)) = *(*uintptr)(unsafe.Pointer(v14))
  11154. goto _12
  11155. _12:
  11156. }
  11157. ak = ta + uintptr(n)*4
  11158. for {
  11159. ak -= 4
  11160. v16 = ak
  11161. if !(v16 >= ta) {
  11162. break
  11163. } /* Deal to piles. */
  11164. v18 = bp + 6144 + uintptr(*(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ak)) + uintptr(i)))))))*4
  11165. *(*uintptr)(unsafe.Pointer(v18)) -= 4
  11166. v17 = *(*uintptr)(unsafe.Pointer(v18))
  11167. *(*uintptr)(unsafe.Pointer(v17)) = *(*uintptr)(unsafe.Pointer(ak))
  11168. goto _15
  11169. _15:
  11170. }
  11171. }
  11172. }
  11173. var _count1 [256]uint32
  11174. var _nc1 uint32
  11175. var _bmin1 uint32
  11176. // C documentation
  11177. //
  11178. // /* insertion sort */
  11179. func _simplesort(tls *libc.TLS, a uintptr, n int32, b int32, tr uintptr, endch uint32) {
  11180. var ai, ak, s, t uintptr
  11181. var ch, v5 uint8
  11182. var v2 int32
  11183. _, _, _, _, _, _, _ = ai, ak, ch, s, t, v2, v5
  11184. ak = a + uintptr(1)*4
  11185. for {
  11186. n--
  11187. v2 = n
  11188. if !(v2 >= int32(1)) {
  11189. break
  11190. }
  11191. ai = ak
  11192. for {
  11193. if !(ai > a) {
  11194. break
  11195. }
  11196. s = *(*uintptr)(unsafe.Pointer(ai)) + uintptr(b)
  11197. t = *(*uintptr)(unsafe.Pointer(ai + uintptr(-libc.Int32FromInt32(1))*4)) + uintptr(b)
  11198. for {
  11199. v5 = *(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(s)))))
  11200. ch = v5
  11201. if !(uint32(v5) != endch) {
  11202. break
  11203. }
  11204. if libc.Int32FromUint8(ch) != libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(t)))))) {
  11205. break
  11206. }
  11207. goto _4
  11208. _4:
  11209. ;
  11210. s++
  11211. t++
  11212. }
  11213. if libc.Int32FromUint8(ch) >= libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(t)))))) {
  11214. break
  11215. }
  11216. s = *(*uintptr)(unsafe.Pointer(ai))
  11217. *(*uintptr)(unsafe.Pointer(ai)) = *(*uintptr)(unsafe.Pointer(ai + uintptr(-libc.Int32FromInt32(1))*4))
  11218. *(*uintptr)(unsafe.Pointer(ai + uintptr(-libc.Int32FromInt32(1))*4)) = s
  11219. goto _3
  11220. _3:
  11221. ;
  11222. ai -= 4
  11223. }
  11224. goto _1
  11225. _1:
  11226. ;
  11227. ak += 4
  11228. }
  11229. }
  11230. const m_B0 = 0000000
  11231. const m_B1000000 = 0010010
  11232. const m_B110 = 0000003
  11233. const m_B115200 = 0010002
  11234. const m_B1152000 = 0010011
  11235. const m_B1200 = 0000011
  11236. const m_B134 = 0000004
  11237. const m_B150 = 0000005
  11238. const m_B1500000 = 0010012
  11239. const m_B1800 = 0000012
  11240. const m_B19200 = 0000016
  11241. const m_B200 = 0000006
  11242. const m_B2000000 = 0010013
  11243. const m_B230400 = 0010003
  11244. const m_B2400 = 0000013
  11245. const m_B2500000 = 0010014
  11246. const m_B300 = 0000007
  11247. const m_B3000000 = 0010015
  11248. const m_B3500000 = 0010016
  11249. const m_B38400 = 0000017
  11250. const m_B4000000 = 0010017
  11251. const m_B460800 = 0010004
  11252. const m_B4800 = 0000014
  11253. const m_B50 = 0000001
  11254. const m_B500000 = 0010005
  11255. const m_B57600 = 0010001
  11256. const m_B576000 = 0010006
  11257. const m_B600 = 0000010
  11258. const m_B75 = 0000002
  11259. const m_B921600 = 0010007
  11260. const m_B9600 = 0000015
  11261. const m_BRKINT = 0000002
  11262. const m_BS0 = 0000000
  11263. const m_BS1 = 0020000
  11264. const m_BSDLY = 0020000
  11265. const m_CBAUD = 0010017
  11266. const m_CBAUDEX = 0010000
  11267. const m_CIBAUD = 002003600000
  11268. const m_CLOCAL = 0004000
  11269. const m_CMSPAR = 010000000000
  11270. const m_CR0 = 0000000
  11271. const m_CR1 = 0001000
  11272. const m_CR2 = 0002000
  11273. const m_CR3 = 0003000
  11274. const m_CRDLY = 0003000
  11275. const m_CREAD = 0000200
  11276. const m_CRTSCTS = 020000000000
  11277. const m_CS5 = 0000000
  11278. const m_CS6 = 0000020
  11279. const m_CS7 = 0000040
  11280. const m_CS8 = 0000060
  11281. const m_CSIZE = 0000060
  11282. const m_CSTOPB = 0000100
  11283. const m_ECHO = 8
  11284. const m_ECHOCTL = 0001000
  11285. const m_ECHOE = 0000020
  11286. const m_ECHOK = 0000040
  11287. const m_ECHOKE = 0004000
  11288. const m_ECHONL = 64
  11289. const m_ECHOPRT = 0002000
  11290. const m_EXTA = 0000016
  11291. const m_EXTB = 0000017
  11292. const m_EXTPROC = 0200000
  11293. const m_FF0 = 0000000
  11294. const m_FF1 = 0100000
  11295. const m_FFDLY = 0100000
  11296. const m_FLUSHO = 0010000
  11297. const m_HUPCL = 0002000
  11298. const m_ICANON = 0000002
  11299. const m_ICRNL = 0000400
  11300. const m_IEXTEN = 0100000
  11301. const m_IGNBRK = 0000001
  11302. const m_IGNCR = 0000200
  11303. const m_IGNPAR = 0000004
  11304. const m_IMAXBEL = 0020000
  11305. const m_INLCR = 0000100
  11306. const m_INPCK = 0000020
  11307. const m_ISIG = 0000001
  11308. const m_ISTRIP = 0000040
  11309. const m_IUCLC = 0001000
  11310. const m_IUTF8 = 0040000
  11311. const m_IXANY = 0004000
  11312. const m_IXOFF = 0010000
  11313. const m_IXON = 0002000
  11314. const m_NCCS = 32
  11315. const m_NL0 = 0000000
  11316. const m_NL1 = 0000400
  11317. const m_NLDLY = 0000400
  11318. const m_NOFLSH = 0000200
  11319. const m_OCRNL = 0000010
  11320. const m_OFDEL = 0000200
  11321. const m_OFILL = 0000100
  11322. const m_OLCUC = 0000002
  11323. const m_ONLCR = 0000004
  11324. const m_ONLRET = 0000040
  11325. const m_ONOCR = 0000020
  11326. const m_OPOST = 0000001
  11327. const m_O_CREAT4 = 0100
  11328. const m_O_NONBLOCK4 = 04000
  11329. const m_O_RDONLY2 = 00
  11330. const m_O_RDWR1 = 2
  11331. const m_O_TRUNC4 = 01000
  11332. const m_O_WRONLY2 = 01
  11333. const m_PARENB = 0000400
  11334. const m_PARMRK = 0000010
  11335. const m_PARODD = 0001000
  11336. const m_PENDIN = 0040000
  11337. const m_RPP_ECHO_OFF = 0x00
  11338. const m_RPP_ECHO_ON = 1
  11339. const m_RPP_FORCELOWER = 4
  11340. const m_RPP_FORCEUPPER = 8
  11341. const m_RPP_REQUIRE_TTY = 2
  11342. const m_RPP_SEVENBIT = 16
  11343. const m_RPP_STDIN = 32
  11344. const m_TAB0 = 0000000
  11345. const m_TAB1 = 0004000
  11346. const m_TAB2 = 0010000
  11347. const m_TAB3 = 0014000
  11348. const m_TABDLY = 0014000
  11349. const m_TCIFLUSH = 0
  11350. const m_TCIOFF = 2
  11351. const m_TCIOFLUSH = 2
  11352. const m_TCION = 3
  11353. const m_TCOFLUSH = 1
  11354. const m_TCOOFF = 0
  11355. const m_TCOON = 1
  11356. const m_TCSADRAIN = 1
  11357. const m_TCSAFLUSH = 2
  11358. const m_TCSANOW = 0
  11359. const m_TCSASOFT = 0
  11360. const m_TOSTOP = 0000400
  11361. const m_VDISCARD = 13
  11362. const m_VEOF = 4
  11363. const m_VEOL = 11
  11364. const m_VEOL2 = 16
  11365. const m_VERASE = 2
  11366. const m_VINTR = 0
  11367. const m_VKILL = 3
  11368. const m_VLNEXT = 15
  11369. const m_VMIN = 6
  11370. const m_VQUIT = 1
  11371. const m_VREPRINT = 12
  11372. const m_VSTART = 8
  11373. const m_VSTOP = 9
  11374. const m_VSUSP = 10
  11375. const m_VSWTC = 7
  11376. const m_VT0 = 0000000
  11377. const m_VT1 = 0040000
  11378. const m_VTDLY = 0040000
  11379. const m_VTIME = 5
  11380. const m_VWERASE = 14
  11381. const m_XCASE = 0000004
  11382. const m_XTABS = 0014000
  11383. const m__PATH_BSHELL = "/bin/sh"
  11384. const m__PATH_CONSOLE = "/dev/console"
  11385. const m__PATH_DEFPATH = "/usr/local/bin:/bin:/usr/bin"
  11386. const m__PATH_DEV = "/dev/"
  11387. const m__PATH_DEVNULL = "/dev/null"
  11388. const m__PATH_KLOG = "/proc/kmsg"
  11389. const m__PATH_LASTLOG = "/var/log/lastlog"
  11390. const m__PATH_MAILDIR = "/var/mail"
  11391. const m__PATH_MAN = "/usr/share/man"
  11392. const m__PATH_MNTTAB = "/etc/fstab"
  11393. const m__PATH_MOUNTED = "/etc/mtab"
  11394. const m__PATH_NOLOGIN = "/etc/nologin"
  11395. const m__PATH_SENDMAIL = "/usr/sbin/sendmail"
  11396. const m__PATH_SHADOW = "/etc/shadow"
  11397. const m__PATH_SHELLS = "/etc/shells"
  11398. const m__PATH_STDPATH = "/bin:/usr/bin:/sbin:/usr/sbin"
  11399. const m__PATH_TMP = "/tmp/"
  11400. const m__PATH_TTY = "/dev/tty"
  11401. const m__PATH_UTMP = "/dev/null/utmp"
  11402. const m__PATH_VARDB = "/var/lib/misc/"
  11403. const m__PATH_VARRUN = "/var/run/"
  11404. const m__PATH_VARTMP = "/var/tmp/"
  11405. const m__PATH_VI = "/usr/bin/vi"
  11406. const m__PATH_WTMP = "/dev/null/wtmp"
  11407. type Twinsize = struct {
  11408. Fws_row uint16
  11409. Fws_col uint16
  11410. Fws_xpixel uint16
  11411. Fws_ypixel uint16
  11412. }
  11413. type Tcc_t = uint8
  11414. type Tspeed_t = uint32
  11415. type Ttcflag_t = uint32
  11416. type Ttermios = struct {
  11417. Fc_iflag Ttcflag_t
  11418. Fc_oflag Ttcflag_t
  11419. Fc_cflag Ttcflag_t
  11420. Fc_lflag Ttcflag_t
  11421. Fc_line Tcc_t
  11422. Fc_cc [32]Tcc_t
  11423. F__c_ispeed Tspeed_t
  11424. F__c_ospeed Tspeed_t
  11425. }
  11426. var _signo [65]Tsig_atomic_t
  11427. func Xreadpassphrase(tls *libc.TLS, prompt uintptr, buf uintptr, bufsiz Tsize_t, flags int32) (r uintptr) {
  11428. bp := tls.Alloc(1536)
  11429. defer tls.Free(1536)
  11430. var end, p, v6, v8 uintptr
  11431. var i, input, need_restart, output, save_errno, sigttou, v2, v3 int32
  11432. var nr, v5 Tssize_t
  11433. var v4 bool
  11434. var _ /* ch at bp+0 */ int8
  11435. var _ /* oterm at bp+64 */ Ttermios
  11436. var _ /* sa at bp+124 */ Tsigaction
  11437. var _ /* savealrm at bp+264 */ Tsigaction
  11438. var _ /* savehup at bp+544 */ Tsigaction
  11439. var _ /* saveint at bp+404 */ Tsigaction
  11440. var _ /* savepipe at bp+1384 */ Tsigaction
  11441. var _ /* savequit at bp+684 */ Tsigaction
  11442. var _ /* saveterm at bp+824 */ Tsigaction
  11443. var _ /* savetstp at bp+964 */ Tsigaction
  11444. var _ /* savettin at bp+1104 */ Tsigaction
  11445. var _ /* savettou at bp+1244 */ Tsigaction
  11446. var _ /* term at bp+4 */ Ttermios
  11447. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = end, i, input, need_restart, nr, output, p, save_errno, sigttou, v2, v3, v4, v5, v6, v8
  11448. /* I suppose we could alloc on demand in this case (XXX). */
  11449. if bufsiz == uint32(0) {
  11450. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  11451. return libc.UintptrFromInt32(0)
  11452. }
  11453. goto restart
  11454. restart:
  11455. ;
  11456. i = 0
  11457. for {
  11458. if !(i < int32(m__NSIG)) {
  11459. break
  11460. }
  11461. libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_signo))+uintptr(i)*4, 0)
  11462. goto _1
  11463. _1:
  11464. ;
  11465. i++
  11466. }
  11467. nr = -int32(1)
  11468. save_errno = 0
  11469. need_restart = 0
  11470. /*
  11471. * Read and write to /dev/tty if available. If not, read from
  11472. * stdin and write to stderr unless a tty is required.
  11473. */
  11474. if v4 = flags&int32(m_RPP_STDIN) != 0; !v4 {
  11475. v3 = libc.Xopen(tls, __ccgo_ts+323, int32(m_O_RDWR1), 0)
  11476. output = v3
  11477. v2 = v3
  11478. input = v2
  11479. }
  11480. if v4 || v2 == -int32(1) {
  11481. if flags&int32(m_RPP_REQUIRE_TTY) != 0 {
  11482. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOTTY)
  11483. return libc.UintptrFromInt32(0)
  11484. }
  11485. input = m_STDIN_FILENO
  11486. output = int32(m_STDERR_FILENO)
  11487. }
  11488. /*
  11489. * Turn off echo if possible.
  11490. * If we are using a tty but are not the foreground pgrp this will
  11491. * generate SIGTTOU, so do it *before* installing the signal handlers.
  11492. */
  11493. if input != m_STDIN_FILENO && libc.Xtcgetattr(tls, input, bp+64) == 0 {
  11494. libc.Xmemcpy(tls, bp+4, bp+64, uint32(60))
  11495. if !(flags&libc.Int32FromInt32(m_RPP_ECHO_ON) != 0) {
  11496. (*(*Ttermios)(unsafe.Pointer(bp + 4))).Fc_lflag &= libc.Uint32FromInt32(^(libc.Int32FromInt32(m_ECHO) | libc.Int32FromInt32(m_ECHONL)))
  11497. }
  11498. libc.Xtcsetattr(tls, input, libc.Int32FromInt32(m_TCSAFLUSH)|libc.Int32FromInt32(m_TCSASOFT), bp+4)
  11499. } else {
  11500. libc.Xmemset(tls, bp+4, 0, uint32(60))
  11501. (*(*Ttermios)(unsafe.Pointer(bp + 4))).Fc_lflag |= uint32(m_ECHO)
  11502. libc.Xmemset(tls, bp+64, 0, uint32(60))
  11503. (*(*Ttermios)(unsafe.Pointer(bp + 64))).Fc_lflag |= uint32(m_ECHO)
  11504. }
  11505. /*
  11506. * Catch signals that would otherwise cause the user to end
  11507. * up with echo turned off in the shell. Don't worry about
  11508. * things like SIGXCPU and SIGVTALRM for now.
  11509. */
  11510. libc.Xsigemptyset(tls, bp+124+4)
  11511. (*(*Tsigaction)(unsafe.Pointer(bp + 124))).Fsa_flags = 0 /* don't restart system calls */
  11512. *(*uintptr)(unsafe.Pointer(bp + 124)) = __ccgo_fp(_handler)
  11513. libc.Xsigaction(tls, int32(m_SIGALRM), bp+124, bp+264)
  11514. libc.Xsigaction(tls, int32(m_SIGHUP), bp+124, bp+544)
  11515. libc.Xsigaction(tls, int32(m_SIGINT), bp+124, bp+404)
  11516. libc.Xsigaction(tls, int32(m_SIGPIPE), bp+124, bp+1384)
  11517. libc.Xsigaction(tls, int32(m_SIGQUIT), bp+124, bp+684)
  11518. libc.Xsigaction(tls, int32(m_SIGTERM), bp+124, bp+824)
  11519. libc.Xsigaction(tls, int32(m_SIGTSTP), bp+124, bp+964)
  11520. libc.Xsigaction(tls, int32(m_SIGTTIN), bp+124, bp+1104)
  11521. libc.Xsigaction(tls, int32(m_SIGTTOU), bp+124, bp+1244)
  11522. if !(flags&libc.Int32FromInt32(m_RPP_STDIN) != 0) {
  11523. libc.Xwrite(tls, output, prompt, libc.Xstrlen(tls, prompt))
  11524. }
  11525. end = buf + uintptr(bufsiz) - uintptr(1)
  11526. p = buf
  11527. for {
  11528. v5 = libc.Xread(tls, input, bp, uint32(1))
  11529. nr = v5
  11530. if !(v5 == int32(1) && int32(*(*int8)(unsafe.Pointer(bp))) != int32('\n') && int32(*(*int8)(unsafe.Pointer(bp))) != int32('\r')) {
  11531. break
  11532. }
  11533. if p < end {
  11534. if flags&int32(m_RPP_SEVENBIT) != 0 {
  11535. *(*int8)(unsafe.Pointer(bp)) = int8(int32(*(*int8)(unsafe.Pointer(bp))) & libc.Int32FromInt32(0x7f))
  11536. }
  11537. if libc.BoolInt32(uint32(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(bp))))|uint32(32)-uint32('a') < uint32(26)) != 0 {
  11538. if flags&int32(m_RPP_FORCELOWER) != 0 {
  11539. *(*int8)(unsafe.Pointer(bp)) = int8(libc.Xtolower(tls, libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(bp))))))
  11540. }
  11541. if flags&int32(m_RPP_FORCEUPPER) != 0 {
  11542. *(*int8)(unsafe.Pointer(bp)) = int8(libc.Xtoupper(tls, libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(bp))))))
  11543. }
  11544. }
  11545. v6 = p
  11546. p++
  11547. *(*int8)(unsafe.Pointer(v6)) = *(*int8)(unsafe.Pointer(bp))
  11548. }
  11549. }
  11550. *(*int8)(unsafe.Pointer(p)) = int8('\000')
  11551. save_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  11552. if !((*(*Ttermios)(unsafe.Pointer(bp + 4))).Fc_lflag&libc.Uint32FromInt32(m_ECHO) != 0) {
  11553. libc.Xwrite(tls, output, __ccgo_ts+332, uint32(1))
  11554. }
  11555. /* Restore old terminal settings and signals. */
  11556. if libc.Xmemcmp(tls, bp+4, bp+64, uint32(60)) != 0 {
  11557. sigttou = libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_signo)) + libc.UintptrFromInt32(m_SIGTTOU)*4)
  11558. /* Ignore SIGTTOU generated when we are not the fg pgrp. */
  11559. for libc.Xtcsetattr(tls, input, libc.Int32FromInt32(m_TCSAFLUSH)|libc.Int32FromInt32(m_TCSASOFT), bp+64) == -int32(1) && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EINTR) && !(libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_signo))+libc.UintptrFromInt32(m_SIGTTOU)*4) != 0) {
  11560. continue
  11561. }
  11562. libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_signo))+22*4, sigttou)
  11563. }
  11564. libc.Xsigaction(tls, int32(m_SIGALRM), bp+264, libc.UintptrFromInt32(0))
  11565. libc.Xsigaction(tls, int32(m_SIGHUP), bp+544, libc.UintptrFromInt32(0))
  11566. libc.Xsigaction(tls, int32(m_SIGINT), bp+404, libc.UintptrFromInt32(0))
  11567. libc.Xsigaction(tls, int32(m_SIGQUIT), bp+684, libc.UintptrFromInt32(0))
  11568. libc.Xsigaction(tls, int32(m_SIGPIPE), bp+1384, libc.UintptrFromInt32(0))
  11569. libc.Xsigaction(tls, int32(m_SIGTERM), bp+824, libc.UintptrFromInt32(0))
  11570. libc.Xsigaction(tls, int32(m_SIGTSTP), bp+964, libc.UintptrFromInt32(0))
  11571. libc.Xsigaction(tls, int32(m_SIGTTIN), bp+1104, libc.UintptrFromInt32(0))
  11572. libc.Xsigaction(tls, int32(m_SIGTTOU), bp+1244, libc.UintptrFromInt32(0))
  11573. if input != m_STDIN_FILENO {
  11574. libc.Xclose(tls, input)
  11575. }
  11576. /*
  11577. * If we were interrupted by a signal, resend it to ourselves
  11578. * now that we have restored the signal handlers.
  11579. */
  11580. i = 0
  11581. for {
  11582. if !(i < int32(m__NSIG)) {
  11583. break
  11584. }
  11585. if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_signo))+uintptr(i)*4) != 0 {
  11586. libc.Xkill(tls, libc.Xgetpid(tls), i)
  11587. switch i {
  11588. case int32(m_SIGTSTP):
  11589. fallthrough
  11590. case int32(m_SIGTTIN):
  11591. fallthrough
  11592. case int32(m_SIGTTOU):
  11593. need_restart = int32(1)
  11594. }
  11595. }
  11596. goto _7
  11597. _7:
  11598. ;
  11599. i++
  11600. }
  11601. if need_restart != 0 {
  11602. goto restart
  11603. }
  11604. if save_errno != 0 {
  11605. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = save_errno
  11606. }
  11607. if nr == -int32(1) {
  11608. v8 = libc.UintptrFromInt32(0)
  11609. } else {
  11610. v8 = buf
  11611. }
  11612. return v8
  11613. }
  11614. func _handler(tls *libc.TLS, s int32) {
  11615. libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_signo))+uintptr(s)*4, int32(1))
  11616. }
  11617. const m_UINT32_MAX1 = 4294967295
  11618. /*
  11619. * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
  11620. * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
  11621. */
  11622. func Xreallocarray(tls *libc.TLS, optr uintptr, nmemb Tsize_t, size Tsize_t) (r uintptr) {
  11623. if (nmemb >= libc.Uint32FromInt32(1)<<(libc.Uint32FromInt64(4)*libc.Uint32FromInt32(4)) || size >= libc.Uint32FromInt32(1)<<(libc.Uint32FromInt64(4)*libc.Uint32FromInt32(4))) && nmemb > uint32(0) && uint32(0xffffffff)/nmemb < size {
  11624. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOMEM)
  11625. return libc.UintptrFromInt32(0)
  11626. }
  11627. return libc.Xrealloc(tls, optr, size*nmemb)
  11628. }
  11629. const m_UINT32_MAX2 = "0xffffffffu"
  11630. func Xreallocf(tls *libc.TLS, ptr uintptr, size Tsize_t) (r uintptr) {
  11631. var nptr uintptr
  11632. _ = nptr
  11633. nptr = libc.Xrealloc(tls, ptr, size)
  11634. /*
  11635. * When the System V compatibility option (malloc "V" flag) is
  11636. * in effect, realloc(ptr, 0) frees the memory and returns NULL.
  11637. * So, to avoid double free, call free() only when size != 0.
  11638. * realloc(ptr, 0) can't fail when ptr != NULL.
  11639. */
  11640. if !(nptr != 0) && ptr != 0 && size != uint32(0) {
  11641. libc.Xfree(tls, ptr)
  11642. }
  11643. return nptr
  11644. }
  11645. const m_UINT32_MAX3 = 4294967295
  11646. /*
  11647. * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
  11648. * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
  11649. */
  11650. func Xrecallocarray(tls *libc.TLS, ptr uintptr, oldnmemb Tsize_t, newnmemb Tsize_t, size Tsize_t) (r uintptr) {
  11651. var d, newsize, oldsize Tsize_t
  11652. var newptr uintptr
  11653. _, _, _, _ = d, newptr, newsize, oldsize
  11654. if ptr == libc.UintptrFromInt32(0) {
  11655. return libc.Xcalloc(tls, newnmemb, size)
  11656. }
  11657. if (newnmemb >= libc.Uint32FromInt32(1)<<(libc.Uint32FromInt64(4)*libc.Uint32FromInt32(4)) || size >= libc.Uint32FromInt32(1)<<(libc.Uint32FromInt64(4)*libc.Uint32FromInt32(4))) && newnmemb > uint32(0) && uint32(0xffffffff)/newnmemb < size {
  11658. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOMEM)
  11659. return libc.UintptrFromInt32(0)
  11660. }
  11661. newsize = newnmemb * size
  11662. if (oldnmemb >= libc.Uint32FromInt32(1)<<(libc.Uint32FromInt64(4)*libc.Uint32FromInt32(4)) || size >= libc.Uint32FromInt32(1)<<(libc.Uint32FromInt64(4)*libc.Uint32FromInt32(4))) && oldnmemb > uint32(0) && uint32(0xffffffff)/oldnmemb < size {
  11663. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  11664. return libc.UintptrFromInt32(0)
  11665. }
  11666. oldsize = oldnmemb * size
  11667. /*
  11668. * Don't bother too much if we're shrinking just a bit,
  11669. * we do not shrink for series of small steps, oh well.
  11670. */
  11671. if newsize <= oldsize {
  11672. d = oldsize - newsize
  11673. if d < oldsize/uint32(2) && d < libc.Uint32FromInt32(libc.Xgetpagesize(tls)) {
  11674. libc.Xmemset(tls, ptr+uintptr(newsize), 0, d)
  11675. return ptr
  11676. }
  11677. }
  11678. newptr = libc.Xmalloc(tls, newsize)
  11679. if newptr == libc.UintptrFromInt32(0) {
  11680. return libc.UintptrFromInt32(0)
  11681. }
  11682. if newsize > oldsize {
  11683. libc.Xmemcpy(tls, newptr, ptr, oldsize)
  11684. libc.Xmemset(tls, newptr+uintptr(oldsize), 0, newsize-oldsize)
  11685. } else {
  11686. libc.Xmemcpy(tls, newptr, ptr, newsize)
  11687. }
  11688. Xexplicit_bzero(tls, ptr, oldsize)
  11689. libc.Xfree(tls, ptr)
  11690. return newptr
  11691. }
  11692. const m_CMD2_CLR = 1
  11693. const m_CMD2_GBITS = 4
  11694. const m_CMD2_OBITS = 8
  11695. const m_CMD2_SET = 2
  11696. const m_CMD2_UBITS = 16
  11697. const m_SET_LEN = 6
  11698. const m_SET_LEN_INCR = 4
  11699. const m_S_IFDIR1 = 16384
  11700. const m_S_IRGRP1 = 32
  11701. const m_S_IROTH1 = 4
  11702. const m_S_IRUSR1 = 256
  11703. const m_S_IRWXG1 = 56
  11704. const m_S_IRWXO1 = 7
  11705. const m_S_IRWXU1 = 448
  11706. const m_S_ISGID1 = 1024
  11707. const m_S_ISUID1 = 2048
  11708. const m_S_ISVTX1 = 512
  11709. const m_S_IWGRP1 = 16
  11710. const m_S_IWOTH1 = 2
  11711. const m_S_IWUSR1 = 128
  11712. const m_S_IXGRP1 = 8
  11713. const m_S_IXOTH1 = 1
  11714. const m_S_IXUSR1 = 64
  11715. const m_UINT32_MAX4 = "0xffffffffu"
  11716. const m___LONG_MAX1 = 2147483647
  11717. type TBITCMD = struct {
  11718. Fcmd int8
  11719. Fcmd2 int8
  11720. Fbits Tmode_t
  11721. }
  11722. type Tbitcmd = TBITCMD
  11723. // C documentation
  11724. //
  11725. // /*
  11726. // * Given the old mode and an array of bitcmd structures, apply the operations
  11727. // * described in the bitcmd structures to the old mode, and return the new mode.
  11728. // * Note that there is no '=' command; a strict assignment is just a '-' (clear
  11729. // * bits) followed by a '+' (set bits).
  11730. // */
  11731. func Xgetmode(tls *libc.TLS, bbox uintptr, omode Tmode_t) (r Tmode_t) {
  11732. var clrval, newmode, value Tmode_t
  11733. var set uintptr
  11734. var v11 uint32
  11735. _, _, _, _, _ = clrval, newmode, set, value, v11
  11736. set = bbox
  11737. newmode = omode
  11738. value = uint32(0)
  11739. for {
  11740. switch int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd) {
  11741. case int32('u'):
  11742. goto _2
  11743. case int32('g'):
  11744. goto _3
  11745. case int32('o'):
  11746. goto _4
  11747. case int32('+'):
  11748. goto _5
  11749. case int32('-'):
  11750. goto _6
  11751. case int32('X'):
  11752. goto _7
  11753. default:
  11754. goto _8
  11755. case int32('\000'):
  11756. goto _9
  11757. }
  11758. goto _10
  11759. /*
  11760. * When copying the user, group or other bits around, we "know"
  11761. * where the bits are in the mode so that we can do shifts to
  11762. * copy them around. If we don't use shifts, it gets real
  11763. * grundgy with lots of single bit checks and bit sets.
  11764. */
  11765. _2:
  11766. ;
  11767. value = newmode & uint32(m_S_IRWXU1) >> int32(6)
  11768. goto common
  11769. _3:
  11770. ;
  11771. value = newmode & uint32(m_S_IRWXG1) >> int32(3)
  11772. goto common
  11773. _4:
  11774. ;
  11775. value = newmode & uint32(m_S_IRWXO1)
  11776. goto common
  11777. common:
  11778. ;
  11779. if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_CLR) != 0 {
  11780. if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_SET) != 0 {
  11781. v11 = uint32(m_S_IRWXO1)
  11782. } else {
  11783. v11 = value
  11784. }
  11785. clrval = v11
  11786. if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_UBITS) != 0 {
  11787. newmode &= ^(clrval << libc.Int32FromInt32(6) & (*TBITCMD)(unsafe.Pointer(set)).Fbits)
  11788. }
  11789. if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_GBITS) != 0 {
  11790. newmode &= ^(clrval << libc.Int32FromInt32(3) & (*TBITCMD)(unsafe.Pointer(set)).Fbits)
  11791. }
  11792. if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_OBITS) != 0 {
  11793. newmode &= ^(clrval & (*TBITCMD)(unsafe.Pointer(set)).Fbits)
  11794. }
  11795. }
  11796. if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_SET) != 0 {
  11797. if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_UBITS) != 0 {
  11798. newmode |= value << libc.Int32FromInt32(6) & (*TBITCMD)(unsafe.Pointer(set)).Fbits
  11799. }
  11800. if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_GBITS) != 0 {
  11801. newmode |= value << libc.Int32FromInt32(3) & (*TBITCMD)(unsafe.Pointer(set)).Fbits
  11802. }
  11803. if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_OBITS) != 0 {
  11804. newmode |= value & (*TBITCMD)(unsafe.Pointer(set)).Fbits
  11805. }
  11806. }
  11807. goto _10
  11808. _5:
  11809. ;
  11810. newmode |= (*TBITCMD)(unsafe.Pointer(set)).Fbits
  11811. goto _10
  11812. _6:
  11813. ;
  11814. newmode &= ^(*TBITCMD)(unsafe.Pointer(set)).Fbits
  11815. goto _10
  11816. _7:
  11817. ;
  11818. if omode&libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IFDIR1)|libc.Int32FromInt32(m_S_IXUSR1)|libc.Int32FromInt32(m_S_IXGRP1)|libc.Int32FromInt32(m_S_IXOTH1)) != 0 {
  11819. newmode |= (*TBITCMD)(unsafe.Pointer(set)).Fbits
  11820. }
  11821. goto _10
  11822. _9:
  11823. ;
  11824. _8:
  11825. ;
  11826. return newmode
  11827. _10:
  11828. ;
  11829. goto _1
  11830. _1:
  11831. ;
  11832. set += 8
  11833. }
  11834. return r
  11835. }
  11836. func Xsetmode(tls *libc.TLS, p uintptr) (r uintptr) {
  11837. bp := tls.Alloc(272)
  11838. defer tls.Free(272)
  11839. var endset, newset, newset1, newset2, newset3, newset4, newset5, saveset, set, v5 uintptr
  11840. var equalopdone, lval, serrno, setlen int32
  11841. var mask, perm, permXbits, who, v1 Tmode_t
  11842. var op, v4 int8
  11843. var setdiff, setdiff1, setdiff2, setdiff3, setdiff4, setdiff5 Tptrdiff_t
  11844. var _ /* ep at bp+0 */ uintptr
  11845. var _ /* signset at bp+4 */ Tsigset_t
  11846. var _ /* sigoset at bp+132 */ Tsigset_t
  11847. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = endset, equalopdone, lval, mask, newset, newset1, newset2, newset3, newset4, newset5, op, perm, permXbits, saveset, serrno, set, setdiff, setdiff1, setdiff2, setdiff3, setdiff4, setdiff5, setlen, who, v1, v4, v5
  11848. equalopdone = 0
  11849. if !(*(*int8)(unsafe.Pointer(p)) != 0) {
  11850. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  11851. return libc.UintptrFromInt32(0)
  11852. }
  11853. /*
  11854. * Get a copy of the mask for the permissions that are mask relative.
  11855. * Flip the bits, we want what's not set. Since it's possible that
  11856. * the caller is opening files inside a signal handler, protect them
  11857. * as best we can.
  11858. */
  11859. libc.Xsigfillset(tls, bp+4)
  11860. libc.Xsigprocmask(tls, m_SIG_BLOCK, bp+4, bp+132)
  11861. v1 = libc.Xumask(tls, uint32(0))
  11862. mask = v1
  11863. libc.Xumask(tls, v1)
  11864. mask = ^mask
  11865. libc.Xsigprocmask(tls, int32(m_SIG_SETMASK), bp+132, libc.UintptrFromInt32(0))
  11866. setlen = libc.Int32FromInt32(m_SET_LEN) + libc.Int32FromInt32(2)
  11867. set = Xreallocarray(tls, libc.UintptrFromInt32(0), libc.Uint32FromInt32(setlen), uint32(8))
  11868. if set == libc.UintptrFromInt32(0) {
  11869. return libc.UintptrFromInt32(0)
  11870. }
  11871. saveset = set
  11872. endset = set + uintptr(setlen-libc.Int32FromInt32(2))*8
  11873. /*
  11874. * If an absolute number, get it and return; disallow non-octal digits
  11875. * or illegal bits.
  11876. */
  11877. if libc.BoolInt32(uint32(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(p))))-uint32('0') < uint32(10)) != 0 {
  11878. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
  11879. lval = libc.Xstrtol(tls, p, bp, int32(8))
  11880. if *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) != 0 {
  11881. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  11882. goto out
  11883. }
  11884. if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_ERANGE) && (lval == int32(0x7fffffff) || lval == -libc.Int32FromInt32(0x7fffffff)-libc.Int32FromInt32(1)) {
  11885. goto out
  11886. }
  11887. if lval&int32(^(libc.Int32FromInt32(m_S_ISUID1)|libc.Int32FromInt32(m_S_ISGID1)|libc.Int32FromInt32(m_S_IRWXU1)|libc.Int32FromInt32(m_S_IRWXG1)|libc.Int32FromInt32(m_S_IRWXO1)|libc.Int32FromInt32(m_S_ISVTX1))) != 0 {
  11888. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  11889. goto out
  11890. }
  11891. perm = libc.Uint32FromInt32(lval)
  11892. if set >= endset {
  11893. setdiff = (int32(set) - int32(saveset)) / 8
  11894. setlen += int32(m_SET_LEN_INCR)
  11895. newset = Xreallocarray(tls, saveset, libc.Uint32FromInt32(setlen), uint32(8))
  11896. if newset == libc.UintptrFromInt32(0) {
  11897. goto out
  11898. }
  11899. set = newset + uintptr(setdiff)*8
  11900. saveset = newset
  11901. endset = newset + uintptr(setlen-libc.Int32FromInt32(2))*8
  11902. }
  11903. set = _addcmd(tls, set, libc.Uint32FromInt32(libc.Int32FromUint8('=')), libc.Uint32FromInt32(libc.Int32FromInt32(m_S_ISUID1)|libc.Int32FromInt32(m_S_ISGID1)|libc.Int32FromInt32(m_S_IRWXU1)|libc.Int32FromInt32(m_S_IRWXG1)|libc.Int32FromInt32(m_S_IRWXO1)|libc.Int32FromInt32(m_S_ISVTX1)), perm, mask)
  11904. (*TBITCMD)(unsafe.Pointer(set)).Fcmd = 0
  11905. return saveset
  11906. }
  11907. /*
  11908. * Build list of structures to set/clear/copy bits as described by
  11909. * each clause of the symbolic mode.
  11910. */
  11911. for {
  11912. /* First, find out which bits might be modified. */
  11913. who = uint32(0)
  11914. for {
  11915. switch int32(*(*int8)(unsafe.Pointer(p))) {
  11916. case int32('a'):
  11917. who |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_ISUID1) | libc.Int32FromInt32(m_S_ISGID1) | libc.Int32FromInt32(m_S_IRWXU1) | libc.Int32FromInt32(m_S_IRWXG1) | libc.Int32FromInt32(m_S_IRWXO1))
  11918. case int32('u'):
  11919. who |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_ISUID1) | libc.Int32FromInt32(m_S_IRWXU1))
  11920. case int32('g'):
  11921. who |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_ISGID1) | libc.Int32FromInt32(m_S_IRWXG1))
  11922. case int32('o'):
  11923. who |= uint32(m_S_IRWXO1)
  11924. default:
  11925. goto getop
  11926. }
  11927. goto _3
  11928. _3:
  11929. ;
  11930. p++
  11931. }
  11932. goto getop
  11933. getop:
  11934. ;
  11935. v5 = p
  11936. p++
  11937. v4 = *(*int8)(unsafe.Pointer(v5))
  11938. op = v4
  11939. if int32(v4) != int32('+') && int32(op) != int32('-') && int32(op) != int32('=') {
  11940. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  11941. goto out
  11942. }
  11943. if int32(op) == int32('=') {
  11944. equalopdone = 0
  11945. }
  11946. who &= libc.Uint32FromInt32(^libc.Int32FromInt32(m_S_ISVTX1))
  11947. perm = uint32(0)
  11948. permXbits = libc.Uint32FromInt32(0)
  11949. for {
  11950. switch int32(*(*int8)(unsafe.Pointer(p))) {
  11951. case int32('r'):
  11952. perm |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IRUSR1) | libc.Int32FromInt32(m_S_IRGRP1) | libc.Int32FromInt32(m_S_IROTH1))
  11953. case int32('s'):
  11954. /*
  11955. * If specific bits where requested and
  11956. * only "other" bits ignore set-id.
  11957. */
  11958. if who == uint32(0) || who&libc.Uint32FromInt32(^libc.Int32FromInt32(m_S_IRWXO1)) != 0 {
  11959. perm |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_ISUID1) | libc.Int32FromInt32(m_S_ISGID1))
  11960. }
  11961. case int32('t'):
  11962. /*
  11963. * If specific bits where requested and
  11964. * only "other" bits ignore set-id.
  11965. */
  11966. if who == uint32(0) || who&libc.Uint32FromInt32(^libc.Int32FromInt32(m_S_IRWXO1)) != 0 {
  11967. who |= uint32(m_S_ISVTX1)
  11968. perm |= uint32(m_S_ISVTX1)
  11969. }
  11970. case int32('w'):
  11971. perm |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IWUSR1) | libc.Int32FromInt32(m_S_IWGRP1) | libc.Int32FromInt32(m_S_IWOTH1))
  11972. case int32('X'):
  11973. permXbits = libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXUSR1) | libc.Int32FromInt32(m_S_IXGRP1) | libc.Int32FromInt32(m_S_IXOTH1))
  11974. case int32('x'):
  11975. perm |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXUSR1) | libc.Int32FromInt32(m_S_IXGRP1) | libc.Int32FromInt32(m_S_IXOTH1))
  11976. case int32('u'):
  11977. fallthrough
  11978. case int32('g'):
  11979. fallthrough
  11980. case int32('o'):
  11981. /*
  11982. * When ever we hit 'u', 'g', or 'o', we have
  11983. * to flush out any partial mode that we have,
  11984. * and then do the copying of the mode bits.
  11985. */
  11986. if perm != 0 {
  11987. if set >= endset {
  11988. setdiff1 = (int32(set) - int32(saveset)) / 8
  11989. setlen += int32(m_SET_LEN_INCR)
  11990. newset1 = Xreallocarray(tls, saveset, libc.Uint32FromInt32(setlen), uint32(8))
  11991. if newset1 == libc.UintptrFromInt32(0) {
  11992. goto out
  11993. }
  11994. set = newset1 + uintptr(setdiff1)*8
  11995. saveset = newset1
  11996. endset = newset1 + uintptr(setlen-libc.Int32FromInt32(2))*8
  11997. }
  11998. set = _addcmd(tls, set, libc.Uint32FromInt8(op), who, perm, mask)
  11999. perm = uint32(0)
  12000. }
  12001. if int32(op) == int32('=') {
  12002. equalopdone = int32(1)
  12003. }
  12004. if int32(op) == int32('+') && permXbits != 0 {
  12005. if set >= endset {
  12006. setdiff2 = (int32(set) - int32(saveset)) / 8
  12007. setlen += int32(m_SET_LEN_INCR)
  12008. newset2 = Xreallocarray(tls, saveset, libc.Uint32FromInt32(setlen), uint32(8))
  12009. if newset2 == libc.UintptrFromInt32(0) {
  12010. goto out
  12011. }
  12012. set = newset2 + uintptr(setdiff2)*8
  12013. saveset = newset2
  12014. endset = newset2 + uintptr(setlen-libc.Int32FromInt32(2))*8
  12015. }
  12016. set = _addcmd(tls, set, libc.Uint32FromInt32(libc.Int32FromUint8('X')), who, permXbits, mask)
  12017. permXbits = uint32(0)
  12018. }
  12019. if set >= endset {
  12020. setdiff3 = (int32(set) - int32(saveset)) / 8
  12021. setlen += int32(m_SET_LEN_INCR)
  12022. newset3 = Xreallocarray(tls, saveset, libc.Uint32FromInt32(setlen), uint32(8))
  12023. if newset3 == libc.UintptrFromInt32(0) {
  12024. goto out
  12025. }
  12026. set = newset3 + uintptr(setdiff3)*8
  12027. saveset = newset3
  12028. endset = newset3 + uintptr(setlen-libc.Int32FromInt32(2))*8
  12029. }
  12030. set = _addcmd(tls, set, libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(p))), who, libc.Uint32FromInt8(op), mask)
  12031. default:
  12032. /*
  12033. * Add any permissions that we haven't already
  12034. * done.
  12035. */
  12036. if perm != 0 || int32(op) == int32('=') && !(equalopdone != 0) {
  12037. if int32(op) == int32('=') {
  12038. equalopdone = int32(1)
  12039. }
  12040. if set >= endset {
  12041. setdiff4 = (int32(set) - int32(saveset)) / 8
  12042. setlen += int32(m_SET_LEN_INCR)
  12043. newset4 = Xreallocarray(tls, saveset, libc.Uint32FromInt32(setlen), uint32(8))
  12044. if newset4 == libc.UintptrFromInt32(0) {
  12045. goto out
  12046. }
  12047. set = newset4 + uintptr(setdiff4)*8
  12048. saveset = newset4
  12049. endset = newset4 + uintptr(setlen-libc.Int32FromInt32(2))*8
  12050. }
  12051. set = _addcmd(tls, set, libc.Uint32FromInt8(op), who, perm, mask)
  12052. perm = uint32(0)
  12053. }
  12054. if permXbits != 0 {
  12055. if set >= endset {
  12056. setdiff5 = (int32(set) - int32(saveset)) / 8
  12057. setlen += int32(m_SET_LEN_INCR)
  12058. newset5 = Xreallocarray(tls, saveset, libc.Uint32FromInt32(setlen), uint32(8))
  12059. if newset5 == libc.UintptrFromInt32(0) {
  12060. goto out
  12061. }
  12062. set = newset5 + uintptr(setdiff5)*8
  12063. saveset = newset5
  12064. endset = newset5 + uintptr(setlen-libc.Int32FromInt32(2))*8
  12065. }
  12066. set = _addcmd(tls, set, libc.Uint32FromInt32(libc.Int32FromUint8('X')), who, permXbits, mask)
  12067. permXbits = uint32(0)
  12068. }
  12069. goto apply
  12070. }
  12071. goto _6
  12072. _6:
  12073. ;
  12074. p++
  12075. }
  12076. goto apply
  12077. apply:
  12078. ;
  12079. if !(*(*int8)(unsafe.Pointer(p)) != 0) {
  12080. break
  12081. }
  12082. if int32(*(*int8)(unsafe.Pointer(p))) != int32(',') {
  12083. goto getop
  12084. }
  12085. p++
  12086. goto _2
  12087. _2:
  12088. }
  12089. (*TBITCMD)(unsafe.Pointer(set)).Fcmd = 0
  12090. _compress_mode(tls, saveset)
  12091. return saveset
  12092. goto out
  12093. out:
  12094. ;
  12095. serrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  12096. libc.Xfree(tls, saveset)
  12097. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = serrno
  12098. return libc.UintptrFromInt32(0)
  12099. }
  12100. func _addcmd(tls *libc.TLS, set uintptr, op Tmode_t, who Tmode_t, oparg Tmode_t, mask Tmode_t) (r uintptr) {
  12101. var v1, v2 uint32
  12102. var v3, v4, v5 int32
  12103. var p6, p7, p8 uintptr
  12104. _, _, _, _, _, _, _, _ = v1, v2, v3, v4, v5, p6, p7, p8
  12105. switch op {
  12106. case uint32('='):
  12107. (*TBITCMD)(unsafe.Pointer(set)).Fcmd = int8('-')
  12108. if who != 0 {
  12109. v1 = who
  12110. } else {
  12111. v1 = libc.Uint32FromInt32(libc.Int32FromInt32(m_S_ISUID1) | libc.Int32FromInt32(m_S_ISGID1) | libc.Int32FromInt32(m_S_IRWXU1) | libc.Int32FromInt32(m_S_IRWXG1) | libc.Int32FromInt32(m_S_IRWXO1))
  12112. }
  12113. (*TBITCMD)(unsafe.Pointer(set)).Fbits = v1
  12114. set += 8
  12115. op = uint32('+')
  12116. /* FALLTHROUGH */
  12117. fallthrough
  12118. case uint32('+'):
  12119. fallthrough
  12120. case uint32('-'):
  12121. fallthrough
  12122. case uint32('X'):
  12123. (*TBITCMD)(unsafe.Pointer(set)).Fcmd = libc.Int8FromUint32(op)
  12124. if who != 0 {
  12125. v2 = who
  12126. } else {
  12127. v2 = mask
  12128. }
  12129. (*TBITCMD)(unsafe.Pointer(set)).Fbits = v2 & oparg
  12130. case uint32('u'):
  12131. fallthrough
  12132. case uint32('g'):
  12133. fallthrough
  12134. case uint32('o'):
  12135. (*TBITCMD)(unsafe.Pointer(set)).Fcmd = libc.Int8FromUint32(op)
  12136. if who != 0 {
  12137. if who&uint32(m_S_IRUSR1) != 0 {
  12138. v3 = int32(m_CMD2_UBITS)
  12139. } else {
  12140. v3 = 0
  12141. }
  12142. if who&uint32(m_S_IRGRP1) != 0 {
  12143. v4 = int32(m_CMD2_GBITS)
  12144. } else {
  12145. v4 = 0
  12146. }
  12147. if who&uint32(m_S_IROTH1) != 0 {
  12148. v5 = int32(m_CMD2_OBITS)
  12149. } else {
  12150. v5 = 0
  12151. }
  12152. (*TBITCMD)(unsafe.Pointer(set)).Fcmd2 = int8(v3 | v4 | v5)
  12153. (*TBITCMD)(unsafe.Pointer(set)).Fbits = libc.Uint32FromInt32(^libc.Int32FromInt32(0))
  12154. } else {
  12155. (*TBITCMD)(unsafe.Pointer(set)).Fcmd2 = int8(libc.Int32FromInt32(m_CMD2_UBITS) | libc.Int32FromInt32(m_CMD2_GBITS) | libc.Int32FromInt32(m_CMD2_OBITS))
  12156. (*TBITCMD)(unsafe.Pointer(set)).Fbits = mask
  12157. }
  12158. if oparg == uint32('+') {
  12159. p6 = set + 1
  12160. *(*int8)(unsafe.Pointer(p6)) = int8(int32(*(*int8)(unsafe.Pointer(p6))) | libc.Int32FromInt32(m_CMD2_SET))
  12161. } else {
  12162. if oparg == uint32('-') {
  12163. p7 = set + 1
  12164. *(*int8)(unsafe.Pointer(p7)) = int8(int32(*(*int8)(unsafe.Pointer(p7))) | libc.Int32FromInt32(m_CMD2_CLR))
  12165. } else {
  12166. if oparg == uint32('=') {
  12167. p8 = set + 1
  12168. *(*int8)(unsafe.Pointer(p8)) = int8(int32(*(*int8)(unsafe.Pointer(p8))) | (libc.Int32FromInt32(m_CMD2_SET) | libc.Int32FromInt32(m_CMD2_CLR)))
  12169. }
  12170. }
  12171. }
  12172. break
  12173. }
  12174. return set + libc.UintptrFromInt32(1)*8
  12175. }
  12176. // C documentation
  12177. //
  12178. // /*
  12179. // * Given an array of bitcmd structures, compress by compacting consecutive
  12180. // * '+', '-' and 'X' commands into at most 3 commands, one of each. The 'u',
  12181. // * 'g' and 'o' commands continue to be separate. They could probably be
  12182. // * compacted, but it's not worth the effort.
  12183. // */
  12184. func _compress_mode(tls *libc.TLS, set uintptr) {
  12185. var Xbits, clrbits, op, setbits, v2, v6, v7, v8 int32
  12186. var nset, v3, v4 uintptr
  12187. _, _, _, _, _, _, _, _, _, _, _ = Xbits, clrbits, nset, op, setbits, v2, v3, v4, v6, v7, v8
  12188. nset = set
  12189. for {
  12190. /* Copy over any 'u', 'g' and 'o' commands. */
  12191. for {
  12192. v2 = int32((*TBITCMD)(unsafe.Pointer(nset)).Fcmd)
  12193. op = v2
  12194. if !(v2 != int32('+') && op != int32('-') && op != int32('X')) {
  12195. break
  12196. }
  12197. v3 = set
  12198. set += 8
  12199. v4 = nset
  12200. nset += 8
  12201. *(*TBITCMD)(unsafe.Pointer(v3)) = *(*TBITCMD)(unsafe.Pointer(v4))
  12202. if !(op != 0) {
  12203. return
  12204. }
  12205. }
  12206. v7 = libc.Int32FromInt32(0)
  12207. Xbits = v7
  12208. v6 = v7
  12209. clrbits = v6
  12210. setbits = v6
  12211. for {
  12212. v8 = int32((*TBITCMD)(unsafe.Pointer(nset)).Fcmd)
  12213. op = v8
  12214. if v8 == int32('-') {
  12215. clrbits = int32(uint32(clrbits) | (*TBITCMD)(unsafe.Pointer(nset)).Fbits)
  12216. setbits = int32(uint32(setbits) & ^(*TBITCMD)(unsafe.Pointer(nset)).Fbits)
  12217. Xbits = int32(uint32(Xbits) & ^(*TBITCMD)(unsafe.Pointer(nset)).Fbits)
  12218. } else {
  12219. if op == int32('+') {
  12220. setbits = int32(uint32(setbits) | (*TBITCMD)(unsafe.Pointer(nset)).Fbits)
  12221. clrbits = int32(uint32(clrbits) & ^(*TBITCMD)(unsafe.Pointer(nset)).Fbits)
  12222. Xbits = int32(uint32(Xbits) & ^(*TBITCMD)(unsafe.Pointer(nset)).Fbits)
  12223. } else {
  12224. if op == int32('X') {
  12225. Xbits = int32(uint32(Xbits) | (*TBITCMD)(unsafe.Pointer(nset)).Fbits&libc.Uint32FromInt32(^setbits))
  12226. } else {
  12227. break
  12228. }
  12229. }
  12230. }
  12231. goto _5
  12232. _5:
  12233. ;
  12234. nset += 8
  12235. }
  12236. if clrbits != 0 {
  12237. (*TBITCMD)(unsafe.Pointer(set)).Fcmd = int8('-')
  12238. (*TBITCMD)(unsafe.Pointer(set)).Fcmd2 = 0
  12239. (*TBITCMD)(unsafe.Pointer(set)).Fbits = libc.Uint32FromInt32(clrbits)
  12240. set += 8
  12241. }
  12242. if setbits != 0 {
  12243. (*TBITCMD)(unsafe.Pointer(set)).Fcmd = int8('+')
  12244. (*TBITCMD)(unsafe.Pointer(set)).Fcmd2 = 0
  12245. (*TBITCMD)(unsafe.Pointer(set)).Fbits = libc.Uint32FromInt32(setbits)
  12246. set += 8
  12247. }
  12248. if Xbits != 0 {
  12249. (*TBITCMD)(unsafe.Pointer(set)).Fcmd = int8('X')
  12250. (*TBITCMD)(unsafe.Pointer(set)).Fcmd2 = 0
  12251. (*TBITCMD)(unsafe.Pointer(set)).Fbits = libc.Uint32FromInt32(Xbits)
  12252. set += 8
  12253. }
  12254. goto _1
  12255. _1:
  12256. }
  12257. }
  12258. const m_SPT_MAXTITLE = 255
  12259. const m_S_IFDIR2 = 0040000
  12260. const m_S_IRGRP2 = 0040
  12261. const m_S_IROTH2 = 0004
  12262. const m_S_IRUSR2 = 0400
  12263. const m_S_IRWXG2 = 0070
  12264. const m_S_IRWXO2 = 0007
  12265. const m_S_IRWXU2 = 0700
  12266. const m_S_ISGID2 = 02000
  12267. const m_S_ISUID2 = 04000
  12268. const m_S_ISVTX2 = 01000
  12269. const m_S_IWGRP2 = 0020
  12270. const m_S_IWOTH2 = 0002
  12271. const m_S_IWUSR2 = 0200
  12272. const m_S_IXGRP2 = 0010
  12273. const m_S_IXOTH2 = 0001
  12274. const m_S_IXUSR2 = 0100
  12275. const m___LONG_MAX2 = 0x7fffffff
  12276. const m___bool_true_false_are_defined = 1
  12277. const m_bool = "_Bool"
  12278. const m_false = 0
  12279. const m_true = 1
  12280. /*
  12281. * Copyright © 2015 Guillem Jover <guillem@hadrons.org>
  12282. *
  12283. * Redistribution and use in source and binary forms, with or without
  12284. * modification, are permitted provided that the following conditions
  12285. * are met:
  12286. * 1. Redistributions of source code must retain the above copyright
  12287. * notice, this list of conditions and the following disclaimer.
  12288. * 2. Redistributions in binary form must reproduce the above copyright
  12289. * notice, this list of conditions and the following disclaimer in the
  12290. * documentation and/or other materials provided with the distribution.
  12291. * 3. The name of the author may not be used to endorse or promote products
  12292. * derived from this software without specific prior written permission.
  12293. *
  12294. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  12295. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  12296. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  12297. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  12298. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  12299. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  12300. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  12301. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  12302. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  12303. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  12304. */
  12305. /*
  12306. * Copyright © 2004-2006, 2009-2011 Guillem Jover <guillem@hadrons.org>
  12307. *
  12308. * Redistribution and use in source and binary forms, with or without
  12309. * modification, are permitted provided that the following conditions
  12310. * are met:
  12311. * 1. Redistributions of source code must retain the above copyright
  12312. * notice, this list of conditions and the following disclaimer.
  12313. * 2. Redistributions in binary form must reproduce the above copyright
  12314. * notice, this list of conditions and the following disclaimer in the
  12315. * documentation and/or other materials provided with the distribution.
  12316. * 3. The name of the author may not be used to endorse or promote products
  12317. * derived from this software without specific prior written permission.
  12318. *
  12319. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  12320. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  12321. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  12322. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  12323. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  12324. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  12325. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  12326. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  12327. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  12328. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  12329. */
  12330. /* Clang expands this to 1 if an identifier is *not* reserved. */
  12331. /*
  12332. * Some libc implementations do not have a <sys/cdefs.h>, in particular
  12333. * musl, try to handle this gracefully.
  12334. */
  12335. /* Copyright (C) 1992-2022 Free Software Foundation, Inc.
  12336. Copyright The GNU Toolchain Authors.
  12337. This file is part of the GNU C Library.
  12338. The GNU C Library is free software; you can redistribute it and/or
  12339. modify it under the terms of the GNU Lesser General Public
  12340. License as published by the Free Software Foundation; either
  12341. version 2.1 of the License, or (at your option) any later version.
  12342. The GNU C Library is distributed in the hope that it will be useful,
  12343. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12344. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12345. Lesser General Public License for more details.
  12346. You should have received a copy of the GNU Lesser General Public
  12347. License along with the GNU C Library; if not, see
  12348. <https://www.gnu.org/licenses/>. */
  12349. var _SPT struct {
  12350. Farg0 uintptr
  12351. Fbase uintptr
  12352. Fend uintptr
  12353. Fnul uintptr
  12354. Fwarned uint8
  12355. Freset uint8
  12356. Ferror1 int32
  12357. }
  12358. func _spt_min(tls *libc.TLS, a Tsize_t, b Tsize_t) (r Tsize_t) {
  12359. var v1 uint32
  12360. _ = v1
  12361. if a < b {
  12362. v1 = a
  12363. } else {
  12364. v1 = b
  12365. }
  12366. return v1
  12367. }
  12368. // C documentation
  12369. //
  12370. // /*
  12371. // * For discussion on the portability of the various methods, see
  12372. // * https://lists.freebsd.org/pipermail/freebsd-stable/2008-June/043136.html
  12373. // */
  12374. func _spt_clearenv(tls *libc.TLS) (r int32) {
  12375. return libc.Xclearenv(tls)
  12376. }
  12377. func _spt_copyenv(tls *libc.TLS, envc int32, envp uintptr) (r int32) {
  12378. var envcopy, eq uintptr
  12379. var envsize, error1, i int32
  12380. _, _, _, _, _ = envcopy, envsize, eq, error1, i
  12381. if libc.Xenviron != envp {
  12382. return 0
  12383. }
  12384. /* Make a copy of the old environ array of pointers, in case
  12385. * clearenv() or setenv() is implemented to free the internal
  12386. * environ array, because we will need to access the old environ
  12387. * contents to make the new copy. */
  12388. envsize = libc.Int32FromUint32(libc.Uint32FromInt32(envc+libc.Int32FromInt32(1)) * uint32(4))
  12389. envcopy = libc.Xmalloc(tls, libc.Uint32FromInt32(envsize))
  12390. if envcopy == libc.UintptrFromInt32(0) {
  12391. return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  12392. }
  12393. libc.Xmemcpy(tls, envcopy, envp, libc.Uint32FromInt32(envsize))
  12394. error1 = _spt_clearenv(tls)
  12395. if error1 != 0 {
  12396. libc.Xenviron = envp
  12397. libc.Xfree(tls, envcopy)
  12398. return error1
  12399. }
  12400. i = 0
  12401. for {
  12402. if !(*(*uintptr)(unsafe.Pointer(envcopy + uintptr(i)*4)) != 0) {
  12403. break
  12404. }
  12405. eq = libc.Xstrchr(tls, *(*uintptr)(unsafe.Pointer(envcopy + uintptr(i)*4)), int32('='))
  12406. if eq == libc.UintptrFromInt32(0) {
  12407. goto _1
  12408. }
  12409. *(*int8)(unsafe.Pointer(eq)) = int8('\000')
  12410. if libc.Xsetenv(tls, *(*uintptr)(unsafe.Pointer(envcopy + uintptr(i)*4)), eq+uintptr(1), int32(1)) < 0 {
  12411. error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  12412. }
  12413. *(*int8)(unsafe.Pointer(eq)) = int8('=')
  12414. if error1 != 0 {
  12415. /* Because the old environ might not be available
  12416. * anymore we will make do with the shallow copy. */
  12417. libc.Xenviron = envcopy
  12418. return error1
  12419. }
  12420. goto _1
  12421. _1:
  12422. ;
  12423. i++
  12424. }
  12425. /* Dispose of the shallow copy, now that we've finished transfering
  12426. * the old environment. */
  12427. libc.Xfree(tls, envcopy)
  12428. return 0
  12429. }
  12430. func _spt_copyargs(tls *libc.TLS, argc int32, argv uintptr) (r int32) {
  12431. var i int32
  12432. var tmp uintptr
  12433. _, _ = i, tmp
  12434. i = int32(1)
  12435. for {
  12436. if !(i < argc || i >= argc && *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) != 0) {
  12437. break
  12438. }
  12439. if *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) == libc.UintptrFromInt32(0) {
  12440. goto _1
  12441. }
  12442. tmp = libc.Xstrdup(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))
  12443. if tmp == libc.UintptrFromInt32(0) {
  12444. return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  12445. }
  12446. *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) = tmp
  12447. goto _1
  12448. _1:
  12449. ;
  12450. i++
  12451. }
  12452. return 0
  12453. }
  12454. func Xsetproctitle_init(tls *libc.TLS, argc int32, argv uintptr, envp uintptr) {
  12455. var base, end, nul, tmp uintptr
  12456. var envc, error1, i int32
  12457. _, _, _, _, _, _, _ = base, end, envc, error1, i, nul, tmp
  12458. /* Try to make sure we got called with main() arguments. */
  12459. if argc < 0 {
  12460. return
  12461. }
  12462. base = *(*uintptr)(unsafe.Pointer(argv))
  12463. if base == libc.UintptrFromInt32(0) {
  12464. return
  12465. }
  12466. nul = base + uintptr(libc.Xstrlen(tls, base))
  12467. end = nul + uintptr(1)
  12468. i = 0
  12469. for {
  12470. if !(i < argc || i >= argc && *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) != 0) {
  12471. break
  12472. }
  12473. if *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) == libc.UintptrFromInt32(0) || *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) != end {
  12474. goto _1
  12475. }
  12476. end = *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) + uintptr(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))) + uintptr(1)
  12477. goto _1
  12478. _1:
  12479. ;
  12480. i++
  12481. }
  12482. i = 0
  12483. for {
  12484. if !(*(*uintptr)(unsafe.Pointer(envp + uintptr(i)*4)) != 0) {
  12485. break
  12486. }
  12487. if *(*uintptr)(unsafe.Pointer(envp + uintptr(i)*4)) != end {
  12488. goto _2
  12489. }
  12490. end = *(*uintptr)(unsafe.Pointer(envp + uintptr(i)*4)) + uintptr(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(envp + uintptr(i)*4)))) + uintptr(1)
  12491. goto _2
  12492. _2:
  12493. ;
  12494. i++
  12495. }
  12496. envc = i
  12497. _SPT.Farg0 = libc.Xstrdup(tls, *(*uintptr)(unsafe.Pointer(argv)))
  12498. if _SPT.Farg0 == libc.UintptrFromInt32(0) {
  12499. _SPT.Ferror1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  12500. return
  12501. }
  12502. tmp = libc.Xstrdup(tls, Xgetprogname(tls))
  12503. if tmp == libc.UintptrFromInt32(0) {
  12504. _SPT.Ferror1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  12505. return
  12506. }
  12507. Xsetprogname(tls, tmp)
  12508. error1 = _spt_copyenv(tls, envc, envp)
  12509. if error1 != 0 {
  12510. _SPT.Ferror1 = error1
  12511. return
  12512. }
  12513. error1 = _spt_copyargs(tls, argc, argv)
  12514. if error1 != 0 {
  12515. _SPT.Ferror1 = error1
  12516. return
  12517. }
  12518. _SPT.Fnul = nul
  12519. _SPT.Fbase = base
  12520. _SPT.Fend = end
  12521. }
  12522. func Xsetproctitle_impl(tls *libc.TLS, fmt uintptr, va uintptr) {
  12523. bp := tls.Alloc(272)
  12524. defer tls.Free(272)
  12525. var ap Tva_list
  12526. var len1 int32
  12527. var nul, v1 uintptr
  12528. var _ /* buf at bp+0 */ [256]int8
  12529. _, _, _, _ = ap, len1, nul, v1
  12530. if _SPT.Fbase == libc.UintptrFromInt32(0) {
  12531. if !(_SPT.Fwarned != 0) {
  12532. libc.Xwarnx(tls, __ccgo_ts+334, 0)
  12533. _SPT.Fwarned = uint8(m_true)
  12534. }
  12535. return
  12536. }
  12537. if fmt != 0 {
  12538. if int32(*(*int8)(unsafe.Pointer(fmt))) == int32('-') {
  12539. /* Skip program name prefix. */
  12540. fmt++
  12541. len1 = 0
  12542. } else {
  12543. /* Print program name heading for grep. */
  12544. libc.X__builtin_snprintf(tls, bp, uint32(256), __ccgo_ts+14, libc.VaList(bp+264, Xgetprogname(tls)))
  12545. len1 = libc.Int32FromUint32(libc.Xstrlen(tls, bp))
  12546. }
  12547. ap = va
  12548. len1 += libc.X__builtin_vsnprintf(tls, bp+uintptr(len1), uint32(256)-libc.Uint32FromInt32(len1), fmt, ap)
  12549. _ = ap
  12550. } else {
  12551. len1 = libc.X__builtin_snprintf(tls, bp, uint32(256), __ccgo_ts+432, libc.VaList(bp+264, _SPT.Farg0))
  12552. }
  12553. if len1 <= 0 {
  12554. _SPT.Ferror1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  12555. return
  12556. }
  12557. if !(_SPT.Freset != 0) {
  12558. libc.Xmemset(tls, _SPT.Fbase, 0, libc.Uint32FromInt32(int32(_SPT.Fend)-int32(_SPT.Fbase)))
  12559. _SPT.Freset = uint8(m_true)
  12560. } else {
  12561. libc.Xmemset(tls, _SPT.Fbase, 0, _spt_min(tls, uint32(256), libc.Uint32FromInt32(int32(_SPT.Fend)-int32(_SPT.Fbase))))
  12562. }
  12563. len1 = libc.Int32FromUint32(_spt_min(tls, libc.Uint32FromInt32(len1), _spt_min(tls, uint32(256), libc.Uint32FromInt32(int32(_SPT.Fend)-int32(_SPT.Fbase)))-uint32(1)))
  12564. libc.Xmemcpy(tls, _SPT.Fbase, bp, libc.Uint32FromInt32(len1))
  12565. nul = _SPT.Fbase + uintptr(len1)
  12566. if nul < _SPT.Fnul {
  12567. *(*int8)(unsafe.Pointer(_SPT.Fnul)) = int8('.')
  12568. } else {
  12569. if nul == _SPT.Fnul && nul+1 < _SPT.Fend {
  12570. *(*int8)(unsafe.Pointer(_SPT.Fnul)) = int8(' ')
  12571. nul++
  12572. v1 = nul
  12573. *(*int8)(unsafe.Pointer(v1)) = int8('\000')
  12574. }
  12575. }
  12576. }
  12577. // C documentation
  12578. //
  12579. // /*
  12580. // * Appends src to string dst of size dsize (unlike strncat, dsize is the
  12581. // * full size of dst, not space left). At most dsize-1 characters
  12582. // * will be copied. Always NUL terminates (unless dsize <= strlen(dst)).
  12583. // * Returns strlen(src) + MIN(dsize, strlen(initial dst)).
  12584. // * If retval >= dsize, truncation occurred.
  12585. // */
  12586. func Xstrlcat(tls *libc.TLS, dst uintptr, src uintptr, dsize Tsize_t) (r Tsize_t) {
  12587. var dlen, n, v1, v2 Tsize_t
  12588. var odst, osrc, v3 uintptr
  12589. _, _, _, _, _, _, _ = dlen, n, odst, osrc, v1, v2, v3
  12590. odst = dst
  12591. osrc = src
  12592. n = dsize
  12593. /* Find the end of dst and adjust bytes left but don't go past end. */
  12594. for {
  12595. v1 = n
  12596. n--
  12597. if !(v1 != uint32(0) && int32(*(*int8)(unsafe.Pointer(dst))) != int32('\000')) {
  12598. break
  12599. }
  12600. dst++
  12601. }
  12602. dlen = libc.Uint32FromInt32(int32(dst) - int32(odst))
  12603. n = dsize - dlen
  12604. v2 = n
  12605. n--
  12606. if v2 == uint32(0) {
  12607. return dlen + libc.Xstrlen(tls, src)
  12608. }
  12609. for int32(*(*int8)(unsafe.Pointer(src))) != int32('\000') {
  12610. if n != uint32(0) {
  12611. v3 = dst
  12612. dst++
  12613. *(*int8)(unsafe.Pointer(v3)) = *(*int8)(unsafe.Pointer(src))
  12614. n--
  12615. }
  12616. src++
  12617. }
  12618. *(*int8)(unsafe.Pointer(dst)) = int8('\000')
  12619. return dlen + libc.Uint32FromInt32(int32(src)-int32(osrc)) /* count does not include NUL */
  12620. }
  12621. // C documentation
  12622. //
  12623. // /*
  12624. // * Copy string src to buffer dst of size dsize. At most dsize-1
  12625. // * chars will be copied. Always NUL terminates (unless dsize == 0).
  12626. // * Returns strlen(src); if retval >= dsize, truncation occurred.
  12627. // */
  12628. func Xstrlcpy(tls *libc.TLS, dst uintptr, src uintptr, dsize Tsize_t) (r Tsize_t) {
  12629. var nleft, v1 Tsize_t
  12630. var osrc, v3, v4, v5 uintptr
  12631. var v2 int8
  12632. _, _, _, _, _, _, _ = nleft, osrc, v1, v2, v3, v4, v5
  12633. osrc = src
  12634. nleft = dsize
  12635. /* Copy as many bytes as will fit. */
  12636. if nleft != uint32(0) {
  12637. for {
  12638. nleft--
  12639. v1 = nleft
  12640. if !(v1 != uint32(0)) {
  12641. break
  12642. }
  12643. v3 = src
  12644. src++
  12645. v2 = *(*int8)(unsafe.Pointer(v3))
  12646. v4 = dst
  12647. dst++
  12648. *(*int8)(unsafe.Pointer(v4)) = v2
  12649. if int32(v2) == int32('\000') {
  12650. break
  12651. }
  12652. }
  12653. }
  12654. /* Not enough room in dst, add NUL and traverse rest of src. */
  12655. if nleft == uint32(0) {
  12656. if dsize != uint32(0) {
  12657. *(*int8)(unsafe.Pointer(dst)) = int8('\000')
  12658. } /* NUL-terminate dst */
  12659. for {
  12660. v5 = src
  12661. src++
  12662. if !(*(*int8)(unsafe.Pointer(v5)) != 0) {
  12663. break
  12664. }
  12665. }
  12666. }
  12667. return libc.Uint32FromInt32(int32(src) - int32(osrc) - libc.Int32FromInt32(1)) /* count does not include NUL */
  12668. }
  12669. const m__SL_CHUNKSIZE = 20
  12670. type TStringList = struct {
  12671. Fsl_str uintptr
  12672. Fsl_max Tsize_t
  12673. Fsl_cur Tsize_t
  12674. }
  12675. type T_stringlist = TStringList
  12676. // C documentation
  12677. //
  12678. // /*
  12679. // * sl_init(): Initialize a string list
  12680. // */
  12681. func Xsl_init(tls *libc.TLS) (r uintptr) {
  12682. var sl uintptr
  12683. _ = sl
  12684. sl = libc.Xmalloc(tls, uint32(12))
  12685. if sl == libc.UintptrFromInt32(0) {
  12686. return libc.UintptrFromInt32(0)
  12687. }
  12688. (*TStringList)(unsafe.Pointer(sl)).Fsl_cur = uint32(0)
  12689. (*TStringList)(unsafe.Pointer(sl)).Fsl_max = uint32(m__SL_CHUNKSIZE)
  12690. (*TStringList)(unsafe.Pointer(sl)).Fsl_str = Xreallocarray(tls, libc.UintptrFromInt32(0), (*TStringList)(unsafe.Pointer(sl)).Fsl_max, uint32(4))
  12691. if (*TStringList)(unsafe.Pointer(sl)).Fsl_str == libc.UintptrFromInt32(0) {
  12692. libc.Xfree(tls, sl)
  12693. sl = libc.UintptrFromInt32(0)
  12694. }
  12695. return sl
  12696. }
  12697. // C documentation
  12698. //
  12699. // /*
  12700. // * sl_add(): Add an item to the string list
  12701. // */
  12702. func Xsl_add(tls *libc.TLS, sl uintptr, name uintptr) (r int32) {
  12703. var new1, v2 uintptr
  12704. var v1 Tsize_t
  12705. _, _, _ = new1, v1, v2
  12706. if (*TStringList)(unsafe.Pointer(sl)).Fsl_cur == (*TStringList)(unsafe.Pointer(sl)).Fsl_max-uint32(1) {
  12707. new1 = Xreallocarray(tls, (*TStringList)(unsafe.Pointer(sl)).Fsl_str, (*TStringList)(unsafe.Pointer(sl)).Fsl_max+libc.Uint32FromInt32(m__SL_CHUNKSIZE), uint32(4))
  12708. if new1 == libc.UintptrFromInt32(0) {
  12709. return -int32(1)
  12710. }
  12711. *(*Tsize_t)(unsafe.Pointer(sl + 4)) += uint32(m__SL_CHUNKSIZE)
  12712. (*TStringList)(unsafe.Pointer(sl)).Fsl_str = new1
  12713. }
  12714. v2 = sl + 8
  12715. v1 = *(*Tsize_t)(unsafe.Pointer(v2))
  12716. *(*Tsize_t)(unsafe.Pointer(v2))++
  12717. *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(v1)*4)) = name
  12718. return 0
  12719. }
  12720. // C documentation
  12721. //
  12722. // /*
  12723. // * sl_free(): Free a stringlist
  12724. // */
  12725. func Xsl_free(tls *libc.TLS, sl uintptr, all int32) {
  12726. var i Tsize_t
  12727. _ = i
  12728. if sl == libc.UintptrFromInt32(0) {
  12729. return
  12730. }
  12731. if (*TStringList)(unsafe.Pointer(sl)).Fsl_str != 0 {
  12732. if all != 0 {
  12733. i = uint32(0)
  12734. for {
  12735. if !(i < (*TStringList)(unsafe.Pointer(sl)).Fsl_cur) {
  12736. break
  12737. }
  12738. libc.Xfree(tls, *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(i)*4)))
  12739. goto _1
  12740. _1:
  12741. ;
  12742. i++
  12743. }
  12744. }
  12745. libc.Xfree(tls, (*TStringList)(unsafe.Pointer(sl)).Fsl_str)
  12746. }
  12747. libc.Xfree(tls, sl)
  12748. }
  12749. // C documentation
  12750. //
  12751. // /*
  12752. // * sl_find(): Find a name in the string list
  12753. // */
  12754. func Xsl_find(tls *libc.TLS, sl uintptr, name uintptr) (r uintptr) {
  12755. var i Tsize_t
  12756. _ = i
  12757. i = uint32(0)
  12758. for {
  12759. if !(i < (*TStringList)(unsafe.Pointer(sl)).Fsl_cur) {
  12760. break
  12761. }
  12762. if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(i)*4)), name) == 0 {
  12763. return *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(i)*4))
  12764. }
  12765. goto _1
  12766. _1:
  12767. ;
  12768. i++
  12769. }
  12770. return libc.UintptrFromInt32(0)
  12771. }
  12772. func Xsl_delete(tls *libc.TLS, sl uintptr, name uintptr, all int32) (r int32) {
  12773. var i, j, v3 Tsize_t
  12774. var v4 uintptr
  12775. _, _, _, _ = i, j, v3, v4
  12776. i = uint32(0)
  12777. for {
  12778. if !(i < (*TStringList)(unsafe.Pointer(sl)).Fsl_cur) {
  12779. break
  12780. }
  12781. if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(i)*4)), name) == 0 {
  12782. if all != 0 {
  12783. libc.Xfree(tls, *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(i)*4)))
  12784. }
  12785. j = i + uint32(1)
  12786. for {
  12787. if !(j < (*TStringList)(unsafe.Pointer(sl)).Fsl_cur) {
  12788. break
  12789. }
  12790. *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(j-uint32(1))*4)) = *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(j)*4))
  12791. goto _2
  12792. _2:
  12793. ;
  12794. j++
  12795. }
  12796. v4 = sl + 8
  12797. *(*Tsize_t)(unsafe.Pointer(v4))--
  12798. v3 = *(*Tsize_t)(unsafe.Pointer(v4))
  12799. *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(v3)*4)) = libc.UintptrFromInt32(0)
  12800. return 0
  12801. }
  12802. goto _1
  12803. _1:
  12804. ;
  12805. i++
  12806. }
  12807. return -int32(1)
  12808. }
  12809. const m_S_IFBLK1 = 24576
  12810. const m_S_IFCHR1 = 8192
  12811. const m_S_IFDIR3 = 16384
  12812. const m_S_IFIFO1 = 4096
  12813. const m_S_IFLNK1 = 40960
  12814. const m_S_IFMT1 = 61440
  12815. const m_S_IFREG1 = 32768
  12816. const m_S_IFSOCK1 = 49152
  12817. const m_S_IRGRP3 = 32
  12818. const m_S_IROTH3 = 4
  12819. const m_S_IRUSR3 = 256
  12820. const m_S_ISGID3 = 1024
  12821. const m_S_ISUID3 = 2048
  12822. const m_S_ISVTX3 = 512
  12823. const m_S_IWGRP3 = 16
  12824. const m_S_IWOTH3 = 2
  12825. const m_S_IWUSR3 = 128
  12826. const m_S_IXGRP3 = 8
  12827. const m_S_IXOTH3 = 1
  12828. const m_S_IXUSR3 = 64
  12829. func Xstrmode(tls *libc.TLS, mode Tmode_t, p uintptr) {
  12830. var v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v4, v5, v6, v7, v8, v9 uintptr
  12831. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v4, v5, v6, v7, v8, v9
  12832. /* print type */
  12833. switch mode & libc.Uint32FromInt32(m_S_IFMT1) {
  12834. case uint32(m_S_IFDIR3): /* directory */
  12835. v1 = p
  12836. p++
  12837. *(*int8)(unsafe.Pointer(v1)) = int8('d')
  12838. case uint32(m_S_IFCHR1): /* character special */
  12839. v2 = p
  12840. p++
  12841. *(*int8)(unsafe.Pointer(v2)) = int8('c')
  12842. case uint32(m_S_IFBLK1): /* block special */
  12843. v3 = p
  12844. p++
  12845. *(*int8)(unsafe.Pointer(v3)) = int8('b')
  12846. case uint32(m_S_IFREG1): /* regular */
  12847. v4 = p
  12848. p++
  12849. *(*int8)(unsafe.Pointer(v4)) = int8('-')
  12850. case uint32(m_S_IFLNK1): /* symbolic link */
  12851. v5 = p
  12852. p++
  12853. *(*int8)(unsafe.Pointer(v5)) = int8('l')
  12854. case uint32(m_S_IFSOCK1): /* socket */
  12855. v6 = p
  12856. p++
  12857. *(*int8)(unsafe.Pointer(v6)) = int8('s')
  12858. case uint32(m_S_IFIFO1): /* fifo */
  12859. v7 = p
  12860. p++
  12861. *(*int8)(unsafe.Pointer(v7)) = int8('p')
  12862. default: /* unknown */
  12863. v8 = p
  12864. p++
  12865. *(*int8)(unsafe.Pointer(v8)) = int8('?')
  12866. break
  12867. }
  12868. /* usr */
  12869. if mode&uint32(m_S_IRUSR3) != 0 {
  12870. v9 = p
  12871. p++
  12872. *(*int8)(unsafe.Pointer(v9)) = int8('r')
  12873. } else {
  12874. v10 = p
  12875. p++
  12876. *(*int8)(unsafe.Pointer(v10)) = int8('-')
  12877. }
  12878. if mode&uint32(m_S_IWUSR3) != 0 {
  12879. v11 = p
  12880. p++
  12881. *(*int8)(unsafe.Pointer(v11)) = int8('w')
  12882. } else {
  12883. v12 = p
  12884. p++
  12885. *(*int8)(unsafe.Pointer(v12)) = int8('-')
  12886. }
  12887. switch mode & libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXUSR3)|libc.Int32FromInt32(m_S_ISUID3)) {
  12888. case uint32(0):
  12889. v13 = p
  12890. p++
  12891. *(*int8)(unsafe.Pointer(v13)) = int8('-')
  12892. case uint32(m_S_IXUSR3):
  12893. v14 = p
  12894. p++
  12895. *(*int8)(unsafe.Pointer(v14)) = int8('x')
  12896. case uint32(m_S_ISUID3):
  12897. v15 = p
  12898. p++
  12899. *(*int8)(unsafe.Pointer(v15)) = int8('S')
  12900. case libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXUSR3) | libc.Int32FromInt32(m_S_ISUID3)):
  12901. v16 = p
  12902. p++
  12903. *(*int8)(unsafe.Pointer(v16)) = int8('s')
  12904. break
  12905. }
  12906. /* group */
  12907. if mode&uint32(m_S_IRGRP3) != 0 {
  12908. v17 = p
  12909. p++
  12910. *(*int8)(unsafe.Pointer(v17)) = int8('r')
  12911. } else {
  12912. v18 = p
  12913. p++
  12914. *(*int8)(unsafe.Pointer(v18)) = int8('-')
  12915. }
  12916. if mode&uint32(m_S_IWGRP3) != 0 {
  12917. v19 = p
  12918. p++
  12919. *(*int8)(unsafe.Pointer(v19)) = int8('w')
  12920. } else {
  12921. v20 = p
  12922. p++
  12923. *(*int8)(unsafe.Pointer(v20)) = int8('-')
  12924. }
  12925. switch mode & libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXGRP3)|libc.Int32FromInt32(m_S_ISGID3)) {
  12926. case uint32(0):
  12927. v21 = p
  12928. p++
  12929. *(*int8)(unsafe.Pointer(v21)) = int8('-')
  12930. case uint32(m_S_IXGRP3):
  12931. v22 = p
  12932. p++
  12933. *(*int8)(unsafe.Pointer(v22)) = int8('x')
  12934. case uint32(m_S_ISGID3):
  12935. v23 = p
  12936. p++
  12937. *(*int8)(unsafe.Pointer(v23)) = int8('S')
  12938. case libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXGRP3) | libc.Int32FromInt32(m_S_ISGID3)):
  12939. v24 = p
  12940. p++
  12941. *(*int8)(unsafe.Pointer(v24)) = int8('s')
  12942. break
  12943. }
  12944. /* other */
  12945. if mode&uint32(m_S_IROTH3) != 0 {
  12946. v25 = p
  12947. p++
  12948. *(*int8)(unsafe.Pointer(v25)) = int8('r')
  12949. } else {
  12950. v26 = p
  12951. p++
  12952. *(*int8)(unsafe.Pointer(v26)) = int8('-')
  12953. }
  12954. if mode&uint32(m_S_IWOTH3) != 0 {
  12955. v27 = p
  12956. p++
  12957. *(*int8)(unsafe.Pointer(v27)) = int8('w')
  12958. } else {
  12959. v28 = p
  12960. p++
  12961. *(*int8)(unsafe.Pointer(v28)) = int8('-')
  12962. }
  12963. switch mode & libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXOTH3)|libc.Int32FromInt32(m_S_ISVTX3)) {
  12964. case uint32(0):
  12965. v29 = p
  12966. p++
  12967. *(*int8)(unsafe.Pointer(v29)) = int8('-')
  12968. case uint32(m_S_IXOTH3):
  12969. v30 = p
  12970. p++
  12971. *(*int8)(unsafe.Pointer(v30)) = int8('x')
  12972. case uint32(m_S_ISVTX3):
  12973. v31 = p
  12974. p++
  12975. *(*int8)(unsafe.Pointer(v31)) = int8('T')
  12976. case libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXOTH3) | libc.Int32FromInt32(m_S_ISVTX3)):
  12977. v32 = p
  12978. p++
  12979. *(*int8)(unsafe.Pointer(v32)) = int8('t')
  12980. break
  12981. }
  12982. v33 = p
  12983. p++
  12984. *(*int8)(unsafe.Pointer(v33)) = int8(' ') /* will be a '+' if ACL's implemented */
  12985. *(*int8)(unsafe.Pointer(p)) = int8('\000')
  12986. }
  12987. // C documentation
  12988. //
  12989. // /*
  12990. // * Find the first occurrence of find in s, where the search is limited to the
  12991. // * first slen characters of s.
  12992. // */
  12993. func Xstrnstr(tls *libc.TLS, s uintptr, find uintptr, slen Tsize_t) (r uintptr) {
  12994. var c, sc, v1, v4 int8
  12995. var len1, v3 Tsize_t
  12996. var v2, v5 uintptr
  12997. var v6 bool
  12998. _, _, _, _, _, _, _, _, _ = c, len1, sc, v1, v2, v3, v4, v5, v6
  12999. v2 = find
  13000. find++
  13001. v1 = *(*int8)(unsafe.Pointer(v2))
  13002. c = v1
  13003. if int32(v1) != int32('\000') {
  13004. len1 = libc.Xstrlen(tls, find)
  13005. for cond := true; cond; cond = libc.Xstrncmp(tls, s, find, len1) != 0 {
  13006. for cond := true; cond; cond = int32(sc) != int32(c) {
  13007. v3 = slen
  13008. slen--
  13009. if v6 = v3 < uint32(1); !v6 {
  13010. v5 = s
  13011. s++
  13012. v4 = *(*int8)(unsafe.Pointer(v5))
  13013. sc = v4
  13014. }
  13015. if v6 || int32(v4) == int32('\000') {
  13016. return libc.UintptrFromInt32(0)
  13017. }
  13018. }
  13019. if len1 > slen {
  13020. return libc.UintptrFromInt32(0)
  13021. }
  13022. }
  13023. s--
  13024. }
  13025. return s
  13026. }
  13027. func Xstrtoi(tls *libc.TLS, nptr uintptr, endptr uintptr, base int32, lo Tintmax_t, hi Tintmax_t, rstatus uintptr) (r Tintmax_t) {
  13028. bp := tls.Alloc(16)
  13029. defer tls.Free(16)
  13030. var im Tintmax_t
  13031. var serrno int32
  13032. var _ /* ep at bp+0 */ uintptr
  13033. var _ /* rep at bp+4 */ int32
  13034. _, _ = im, serrno
  13035. /* endptr may be NULL */
  13036. if endptr == libc.UintptrFromInt32(0) {
  13037. endptr = bp
  13038. }
  13039. if rstatus == libc.UintptrFromInt32(0) {
  13040. rstatus = bp + 4
  13041. }
  13042. serrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  13043. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
  13044. im = libc.Xstrtoimax(tls, nptr, endptr, base)
  13045. *(*int32)(unsafe.Pointer(rstatus)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  13046. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = serrno
  13047. if *(*int32)(unsafe.Pointer(rstatus)) == 0 {
  13048. /* No digits were found */
  13049. if nptr == *(*uintptr)(unsafe.Pointer(endptr)) {
  13050. *(*int32)(unsafe.Pointer(rstatus)) = int32(m_ECANCELED)
  13051. } else {
  13052. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(endptr))))) != int32('\000') {
  13053. *(*int32)(unsafe.Pointer(rstatus)) = int32(m_EOPNOTSUPP)
  13054. }
  13055. }
  13056. }
  13057. if im < lo {
  13058. if *(*int32)(unsafe.Pointer(rstatus)) == 0 {
  13059. *(*int32)(unsafe.Pointer(rstatus)) = int32(m_ERANGE)
  13060. }
  13061. return lo
  13062. }
  13063. if im > hi {
  13064. if *(*int32)(unsafe.Pointer(rstatus)) == 0 {
  13065. *(*int32)(unsafe.Pointer(rstatus)) = int32(m_ERANGE)
  13066. }
  13067. return hi
  13068. }
  13069. return im
  13070. }
  13071. const m_S_IFBLK2 = 0060000
  13072. const m_S_IFCHR2 = 0020000
  13073. const m_S_IFDIR4 = 0040000
  13074. const m_S_IFIFO2 = 0010000
  13075. const m_S_IFLNK2 = 0120000
  13076. const m_S_IFMT2 = 0170000
  13077. const m_S_IFREG2 = 0100000
  13078. const m_S_IFSOCK2 = 0140000
  13079. const m_S_IRGRP4 = 0040
  13080. const m_S_IROTH4 = 0004
  13081. const m_S_IRUSR4 = 0400
  13082. const m_S_ISGID4 = 02000
  13083. const m_S_ISUID4 = 04000
  13084. const m_S_ISVTX4 = 01000
  13085. const m_S_IWGRP4 = 0020
  13086. const m_S_IWOTH4 = 0002
  13087. const m_S_IWUSR4 = 0200
  13088. const m_S_IXGRP4 = 0010
  13089. const m_S_IXOTH4 = 0001
  13090. const m_S_IXUSR4 = 0100
  13091. func Xstrtonum(tls *libc.TLS, nptr uintptr, minval int64, maxval int64, errstr uintptr) (r int64) {
  13092. bp := tls.Alloc(16)
  13093. defer tls.Free(16)
  13094. var rv int64
  13095. var v1 uintptr
  13096. var _ /* e at bp+0 */ int32
  13097. var _ /* resp at bp+4 */ uintptr
  13098. _, _ = rv, v1
  13099. if errstr == libc.UintptrFromInt32(0) {
  13100. errstr = bp + 4
  13101. }
  13102. rv = Xstrtoi(tls, nptr, libc.UintptrFromInt32(0), int32(10), minval, maxval, bp)
  13103. if *(*int32)(unsafe.Pointer(bp)) == 0 {
  13104. *(*uintptr)(unsafe.Pointer(errstr)) = libc.UintptrFromInt32(0)
  13105. return rv
  13106. }
  13107. if *(*int32)(unsafe.Pointer(bp)) == int32(m_ERANGE) {
  13108. if rv == maxval {
  13109. v1 = __ccgo_ts + 435
  13110. } else {
  13111. v1 = __ccgo_ts + 445
  13112. }
  13113. *(*uintptr)(unsafe.Pointer(errstr)) = v1
  13114. } else {
  13115. *(*uintptr)(unsafe.Pointer(errstr)) = __ccgo_ts + 455
  13116. }
  13117. return 0
  13118. }
  13119. func Xstrtou(tls *libc.TLS, nptr uintptr, endptr uintptr, base int32, lo Tuintmax_t, hi Tuintmax_t, rstatus uintptr) (r Tuintmax_t) {
  13120. bp := tls.Alloc(16)
  13121. defer tls.Free(16)
  13122. var im Tuintmax_t
  13123. var serrno int32
  13124. var _ /* ep at bp+0 */ uintptr
  13125. var _ /* rep at bp+4 */ int32
  13126. _, _ = im, serrno
  13127. /* endptr may be NULL */
  13128. if endptr == libc.UintptrFromInt32(0) {
  13129. endptr = bp
  13130. }
  13131. if rstatus == libc.UintptrFromInt32(0) {
  13132. rstatus = bp + 4
  13133. }
  13134. serrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  13135. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
  13136. im = libc.Xstrtoumax(tls, nptr, endptr, base)
  13137. *(*int32)(unsafe.Pointer(rstatus)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  13138. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = serrno
  13139. if *(*int32)(unsafe.Pointer(rstatus)) == 0 {
  13140. /* No digits were found */
  13141. if nptr == *(*uintptr)(unsafe.Pointer(endptr)) {
  13142. *(*int32)(unsafe.Pointer(rstatus)) = int32(m_ECANCELED)
  13143. } else {
  13144. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(endptr))))) != int32('\000') {
  13145. *(*int32)(unsafe.Pointer(rstatus)) = int32(m_EOPNOTSUPP)
  13146. }
  13147. }
  13148. }
  13149. if im < lo {
  13150. if *(*int32)(unsafe.Pointer(rstatus)) == 0 {
  13151. *(*int32)(unsafe.Pointer(rstatus)) = int32(m_ERANGE)
  13152. }
  13153. return lo
  13154. }
  13155. if im > hi {
  13156. if *(*int32)(unsafe.Pointer(rstatus)) == 0 {
  13157. *(*int32)(unsafe.Pointer(rstatus)) = int32(m_ERANGE)
  13158. }
  13159. return hi
  13160. }
  13161. return im
  13162. }
  13163. // C documentation
  13164. //
  13165. // /*
  13166. // * Convert a 32 bit representation of time_t into time_t. XXX needs to
  13167. // * implement the 50-year rule to handle post-2038 conversions.
  13168. // */
  13169. func X_time32_to_time(tls *libc.TLS, t32 Tint32_t) (r Ttime_t) {
  13170. return int64(t32)
  13171. }
  13172. // C documentation
  13173. //
  13174. // /*
  13175. // * Convert time_t to a 32 bit representation. If time_t is 64 bits we can
  13176. // * simply chop it down. The resulting 32 bit representation can be
  13177. // * converted back to a temporally local 64 bit time_t using time32_to_time.
  13178. // */
  13179. func X_time_to_time32(tls *libc.TLS, t Ttime_t) (r Tint32_t) {
  13180. return int32(t)
  13181. }
  13182. // C documentation
  13183. //
  13184. // /*
  13185. // * Convert a 64 bit representation of time_t into time_t. If time_t is
  13186. // * represented as 32 bits we can simply chop it and not support times
  13187. // * past 2038.
  13188. // */
  13189. func X_time64_to_time(tls *libc.TLS, t64 Tint64_t) (r Ttime_t) {
  13190. return t64
  13191. }
  13192. // C documentation
  13193. //
  13194. // /*
  13195. // * Convert time_t to a 64 bit representation. If time_t is represented
  13196. // * as 32 bits we simply sign-extend and do not support times past 2038.
  13197. // */
  13198. func X_time_to_time64(tls *libc.TLS, t Ttime_t) (r Tint64_t) {
  13199. return t
  13200. }
  13201. // C documentation
  13202. //
  13203. // /*
  13204. // * Convert to/from 'long'. Depending on the sizeof(long) this may or
  13205. // * may not require using the 50-year rule.
  13206. // */
  13207. func X_time_to_long(tls *libc.TLS, t Ttime_t) (r int32) {
  13208. if uint32(4) == uint32(8) {
  13209. return int32(X_time_to_time64(tls, t))
  13210. }
  13211. return int32(t)
  13212. }
  13213. func X_long_to_time(tls *libc.TLS, tlong int32) (r Ttime_t) {
  13214. if uint32(4) == uint32(4) {
  13215. return X_time32_to_time(tls, tlong)
  13216. }
  13217. return int64(tlong)
  13218. }
  13219. // C documentation
  13220. //
  13221. // /*
  13222. // * Convert to/from 'int'. Depending on the sizeof(int) this may or
  13223. // * may not require using the 50-year rule.
  13224. // */
  13225. func X_time_to_int(tls *libc.TLS, t Ttime_t) (r int32) {
  13226. if uint32(4) == uint32(8) {
  13227. return int32(X_time_to_time64(tls, t))
  13228. }
  13229. return int32(t)
  13230. }
  13231. func X_int_to_time(tls *libc.TLS, tint int32) (r Ttime_t) {
  13232. if uint32(4) == uint32(4) {
  13233. return X_time32_to_time(tls, tint)
  13234. }
  13235. return int64(tint)
  13236. }
  13237. const m_S_AMP = 13
  13238. const m_S_CTRL = 4
  13239. const m_S_EATCRNL = 12
  13240. const m_S_GROUND = 0
  13241. const m_S_HEX = 7
  13242. const m_S_HEX1 = 8
  13243. const m_S_HEX2 = 9
  13244. const m_S_META = 2
  13245. const m_S_META1 = 3
  13246. const m_S_MIME1 = 10
  13247. const m_S_MIME2 = 11
  13248. const m_S_NUMBER = 14
  13249. const m_S_OCTAL2 = 5
  13250. const m_S_OCTAL3 = 6
  13251. const m_S_START = 1
  13252. const m_S_STRING = 15
  13253. const m_UNVIS_END = "_VIS_END"
  13254. const m_UNVIS_NOCHAR = 3
  13255. const m_UNVIS_VALID = 1
  13256. const m_UNVIS_VALIDPUSH = 2
  13257. const m_VIS_CSTYLE = 0x0002
  13258. const m_VIS_DQ = 0x8000
  13259. const m_VIS_GLOB = 0x1000
  13260. const m_VIS_HTTP1808 = 128
  13261. const m_VIS_HTTP1866 = 512
  13262. const m_VIS_HTTPSTYLE = 0x0080
  13263. const m_VIS_MIMESTYLE = 256
  13264. const m_VIS_NL = 0x0010
  13265. const m_VIS_NOESCAPE = 1024
  13266. const m_VIS_NOLOCALE = 0x4000
  13267. const m_VIS_NOSLASH = 0x0040
  13268. const m_VIS_OCTAL = 0x0001
  13269. const m_VIS_SAFE = 0x0020
  13270. const m_VIS_SHELL = 0x2000
  13271. const m_VIS_SP = 0x0004
  13272. const m_VIS_TAB = 0x0008
  13273. const m__VIS_END = 2048
  13274. /*
  13275. * Copyright © 2015 Guillem Jover <guillem@hadrons.org>
  13276. *
  13277. * Redistribution and use in source and binary forms, with or without
  13278. * modification, are permitted provided that the following conditions
  13279. * are met:
  13280. * 1. Redistributions of source code must retain the above copyright
  13281. * notice, this list of conditions and the following disclaimer.
  13282. * 2. Redistributions in binary form must reproduce the above copyright
  13283. * notice, this list of conditions and the following disclaimer in the
  13284. * documentation and/or other materials provided with the distribution.
  13285. * 3. The name of the author may not be used to endorse or promote products
  13286. * derived from this software without specific prior written permission.
  13287. *
  13288. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  13289. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  13290. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  13291. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  13292. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  13293. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  13294. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  13295. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  13296. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  13297. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  13298. */
  13299. /*
  13300. * Copyright © 2004-2006, 2009-2011 Guillem Jover <guillem@hadrons.org>
  13301. *
  13302. * Redistribution and use in source and binary forms, with or without
  13303. * modification, are permitted provided that the following conditions
  13304. * are met:
  13305. * 1. Redistributions of source code must retain the above copyright
  13306. * notice, this list of conditions and the following disclaimer.
  13307. * 2. Redistributions in binary form must reproduce the above copyright
  13308. * notice, this list of conditions and the following disclaimer in the
  13309. * documentation and/or other materials provided with the distribution.
  13310. * 3. The name of the author may not be used to endorse or promote products
  13311. * derived from this software without specific prior written permission.
  13312. *
  13313. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  13314. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  13315. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  13316. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  13317. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  13318. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  13319. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  13320. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  13321. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  13322. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  13323. */
  13324. /* Clang expands this to 1 if an identifier is *not* reserved. */
  13325. /*
  13326. * Some libc implementations do not have a <sys/cdefs.h>, in particular
  13327. * musl, try to handle this gracefully.
  13328. */
  13329. /* Copyright (C) 1992-2022 Free Software Foundation, Inc.
  13330. Copyright The GNU Toolchain Authors.
  13331. This file is part of the GNU C Library.
  13332. The GNU C Library is free software; you can redistribute it and/or
  13333. modify it under the terms of the GNU Lesser General Public
  13334. License as published by the Free Software Foundation; either
  13335. version 2.1 of the License, or (at your option) any later version.
  13336. The GNU C Library is distributed in the hope that it will be useful,
  13337. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13338. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13339. Lesser General Public License for more details.
  13340. You should have received a copy of the GNU Lesser General Public
  13341. License along with the GNU C Library; if not, see
  13342. <https://www.gnu.org/licenses/>. */
  13343. /*
  13344. * decode driven by state machine
  13345. */
  13346. // C documentation
  13347. //
  13348. // /*
  13349. // * RFC 1866
  13350. // */
  13351. type Tnv = struct {
  13352. Fname [7]int8
  13353. Fvalue Tuint8_t
  13354. }
  13355. /*
  13356. * Copyright © 2015 Guillem Jover <guillem@hadrons.org>
  13357. *
  13358. * Redistribution and use in source and binary forms, with or without
  13359. * modification, are permitted provided that the following conditions
  13360. * are met:
  13361. * 1. Redistributions of source code must retain the above copyright
  13362. * notice, this list of conditions and the following disclaimer.
  13363. * 2. Redistributions in binary form must reproduce the above copyright
  13364. * notice, this list of conditions and the following disclaimer in the
  13365. * documentation and/or other materials provided with the distribution.
  13366. * 3. The name of the author may not be used to endorse or promote products
  13367. * derived from this software without specific prior written permission.
  13368. *
  13369. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  13370. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  13371. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  13372. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  13373. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  13374. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  13375. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  13376. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  13377. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  13378. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  13379. */
  13380. /*
  13381. * Copyright © 2004-2006, 2009-2011 Guillem Jover <guillem@hadrons.org>
  13382. *
  13383. * Redistribution and use in source and binary forms, with or without
  13384. * modification, are permitted provided that the following conditions
  13385. * are met:
  13386. * 1. Redistributions of source code must retain the above copyright
  13387. * notice, this list of conditions and the following disclaimer.
  13388. * 2. Redistributions in binary form must reproduce the above copyright
  13389. * notice, this list of conditions and the following disclaimer in the
  13390. * documentation and/or other materials provided with the distribution.
  13391. * 3. The name of the author may not be used to endorse or promote products
  13392. * derived from this software without specific prior written permission.
  13393. *
  13394. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  13395. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  13396. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  13397. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  13398. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  13399. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  13400. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  13401. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  13402. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  13403. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  13404. */
  13405. /* Clang expands this to 1 if an identifier is *not* reserved. */
  13406. /*
  13407. * Some libc implementations do not have a <sys/cdefs.h>, in particular
  13408. * musl, try to handle this gracefully.
  13409. */
  13410. /* Copyright (C) 1992-2022 Free Software Foundation, Inc.
  13411. Copyright The GNU Toolchain Authors.
  13412. This file is part of the GNU C Library.
  13413. The GNU C Library is free software; you can redistribute it and/or
  13414. modify it under the terms of the GNU Lesser General Public
  13415. License as published by the Free Software Foundation; either
  13416. version 2.1 of the License, or (at your option) any later version.
  13417. The GNU C Library is distributed in the hope that it will be useful,
  13418. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13419. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13420. Lesser General Public License for more details.
  13421. You should have received a copy of the GNU Lesser General Public
  13422. License along with the GNU C Library; if not, see
  13423. <https://www.gnu.org/licenses/>. */
  13424. /*
  13425. * decode driven by state machine
  13426. */
  13427. // C documentation
  13428. //
  13429. // /*
  13430. // * RFC 1866
  13431. // */
  13432. var _nv = [100]Tnv{
  13433. 0: {
  13434. Fname: [7]int8{'A', 'E', 'l', 'i', 'g'},
  13435. Fvalue: uint8(198),
  13436. },
  13437. 1: {
  13438. Fname: [7]int8{'A', 'a', 'c', 'u', 't', 'e'},
  13439. Fvalue: uint8(193),
  13440. },
  13441. 2: {
  13442. Fname: [7]int8{'A', 'c', 'i', 'r', 'c'},
  13443. Fvalue: uint8(194),
  13444. },
  13445. 3: {
  13446. Fname: [7]int8{'A', 'g', 'r', 'a', 'v', 'e'},
  13447. Fvalue: uint8(192),
  13448. },
  13449. 4: {
  13450. Fname: [7]int8{'A', 'r', 'i', 'n', 'g'},
  13451. Fvalue: uint8(197),
  13452. },
  13453. 5: {
  13454. Fname: [7]int8{'A', 't', 'i', 'l', 'd', 'e'},
  13455. Fvalue: uint8(195),
  13456. },
  13457. 6: {
  13458. Fname: [7]int8{'A', 'u', 'm', 'l'},
  13459. Fvalue: uint8(196),
  13460. },
  13461. 7: {
  13462. Fname: [7]int8{'C', 'c', 'e', 'd', 'i', 'l'},
  13463. Fvalue: uint8(199),
  13464. },
  13465. 8: {
  13466. Fname: [7]int8{'E', 'T', 'H'},
  13467. Fvalue: uint8(208),
  13468. },
  13469. 9: {
  13470. Fname: [7]int8{'E', 'a', 'c', 'u', 't', 'e'},
  13471. Fvalue: uint8(201),
  13472. },
  13473. 10: {
  13474. Fname: [7]int8{'E', 'c', 'i', 'r', 'c'},
  13475. Fvalue: uint8(202),
  13476. },
  13477. 11: {
  13478. Fname: [7]int8{'E', 'g', 'r', 'a', 'v', 'e'},
  13479. Fvalue: uint8(200),
  13480. },
  13481. 12: {
  13482. Fname: [7]int8{'E', 'u', 'm', 'l'},
  13483. Fvalue: uint8(203),
  13484. },
  13485. 13: {
  13486. Fname: [7]int8{'I', 'a', 'c', 'u', 't', 'e'},
  13487. Fvalue: uint8(205),
  13488. },
  13489. 14: {
  13490. Fname: [7]int8{'I', 'c', 'i', 'r', 'c'},
  13491. Fvalue: uint8(206),
  13492. },
  13493. 15: {
  13494. Fname: [7]int8{'I', 'g', 'r', 'a', 'v', 'e'},
  13495. Fvalue: uint8(204),
  13496. },
  13497. 16: {
  13498. Fname: [7]int8{'I', 'u', 'm', 'l'},
  13499. Fvalue: uint8(207),
  13500. },
  13501. 17: {
  13502. Fname: [7]int8{'N', 't', 'i', 'l', 'd', 'e'},
  13503. Fvalue: uint8(209),
  13504. },
  13505. 18: {
  13506. Fname: [7]int8{'O', 'a', 'c', 'u', 't', 'e'},
  13507. Fvalue: uint8(211),
  13508. },
  13509. 19: {
  13510. Fname: [7]int8{'O', 'c', 'i', 'r', 'c'},
  13511. Fvalue: uint8(212),
  13512. },
  13513. 20: {
  13514. Fname: [7]int8{'O', 'g', 'r', 'a', 'v', 'e'},
  13515. Fvalue: uint8(210),
  13516. },
  13517. 21: {
  13518. Fname: [7]int8{'O', 's', 'l', 'a', 's', 'h'},
  13519. Fvalue: uint8(216),
  13520. },
  13521. 22: {
  13522. Fname: [7]int8{'O', 't', 'i', 'l', 'd', 'e'},
  13523. Fvalue: uint8(213),
  13524. },
  13525. 23: {
  13526. Fname: [7]int8{'O', 'u', 'm', 'l'},
  13527. Fvalue: uint8(214),
  13528. },
  13529. 24: {
  13530. Fname: [7]int8{'T', 'H', 'O', 'R', 'N'},
  13531. Fvalue: uint8(222),
  13532. },
  13533. 25: {
  13534. Fname: [7]int8{'U', 'a', 'c', 'u', 't', 'e'},
  13535. Fvalue: uint8(218),
  13536. },
  13537. 26: {
  13538. Fname: [7]int8{'U', 'c', 'i', 'r', 'c'},
  13539. Fvalue: uint8(219),
  13540. },
  13541. 27: {
  13542. Fname: [7]int8{'U', 'g', 'r', 'a', 'v', 'e'},
  13543. Fvalue: uint8(217),
  13544. },
  13545. 28: {
  13546. Fname: [7]int8{'U', 'u', 'm', 'l'},
  13547. Fvalue: uint8(220),
  13548. },
  13549. 29: {
  13550. Fname: [7]int8{'Y', 'a', 'c', 'u', 't', 'e'},
  13551. Fvalue: uint8(221),
  13552. },
  13553. 30: {
  13554. Fname: [7]int8{'a', 'a', 'c', 'u', 't', 'e'},
  13555. Fvalue: uint8(225),
  13556. },
  13557. 31: {
  13558. Fname: [7]int8{'a', 'c', 'i', 'r', 'c'},
  13559. Fvalue: uint8(226),
  13560. },
  13561. 32: {
  13562. Fname: [7]int8{'a', 'c', 'u', 't', 'e'},
  13563. Fvalue: uint8(180),
  13564. },
  13565. 33: {
  13566. Fname: [7]int8{'a', 'e', 'l', 'i', 'g'},
  13567. Fvalue: uint8(230),
  13568. },
  13569. 34: {
  13570. Fname: [7]int8{'a', 'g', 'r', 'a', 'v', 'e'},
  13571. Fvalue: uint8(224),
  13572. },
  13573. 35: {
  13574. Fname: [7]int8{'a', 'm', 'p'},
  13575. Fvalue: uint8(38),
  13576. },
  13577. 36: {
  13578. Fname: [7]int8{'a', 'r', 'i', 'n', 'g'},
  13579. Fvalue: uint8(229),
  13580. },
  13581. 37: {
  13582. Fname: [7]int8{'a', 't', 'i', 'l', 'd', 'e'},
  13583. Fvalue: uint8(227),
  13584. },
  13585. 38: {
  13586. Fname: [7]int8{'a', 'u', 'm', 'l'},
  13587. Fvalue: uint8(228),
  13588. },
  13589. 39: {
  13590. Fname: [7]int8{'b', 'r', 'v', 'b', 'a', 'r'},
  13591. Fvalue: uint8(166),
  13592. },
  13593. 40: {
  13594. Fname: [7]int8{'c', 'c', 'e', 'd', 'i', 'l'},
  13595. Fvalue: uint8(231),
  13596. },
  13597. 41: {
  13598. Fname: [7]int8{'c', 'e', 'd', 'i', 'l'},
  13599. Fvalue: uint8(184),
  13600. },
  13601. 42: {
  13602. Fname: [7]int8{'c', 'e', 'n', 't'},
  13603. Fvalue: uint8(162),
  13604. },
  13605. 43: {
  13606. Fname: [7]int8{'c', 'o', 'p', 'y'},
  13607. Fvalue: uint8(169),
  13608. },
  13609. 44: {
  13610. Fname: [7]int8{'c', 'u', 'r', 'r', 'e', 'n'},
  13611. Fvalue: uint8(164),
  13612. },
  13613. 45: {
  13614. Fname: [7]int8{'d', 'e', 'g'},
  13615. Fvalue: uint8(176),
  13616. },
  13617. 46: {
  13618. Fname: [7]int8{'d', 'i', 'v', 'i', 'd', 'e'},
  13619. Fvalue: uint8(247),
  13620. },
  13621. 47: {
  13622. Fname: [7]int8{'e', 'a', 'c', 'u', 't', 'e'},
  13623. Fvalue: uint8(233),
  13624. },
  13625. 48: {
  13626. Fname: [7]int8{'e', 'c', 'i', 'r', 'c'},
  13627. Fvalue: uint8(234),
  13628. },
  13629. 49: {
  13630. Fname: [7]int8{'e', 'g', 'r', 'a', 'v', 'e'},
  13631. Fvalue: uint8(232),
  13632. },
  13633. 50: {
  13634. Fname: [7]int8{'e', 't', 'h'},
  13635. Fvalue: uint8(240),
  13636. },
  13637. 51: {
  13638. Fname: [7]int8{'e', 'u', 'm', 'l'},
  13639. Fvalue: uint8(235),
  13640. },
  13641. 52: {
  13642. Fname: [7]int8{'f', 'r', 'a', 'c', '1', '2'},
  13643. Fvalue: uint8(189),
  13644. },
  13645. 53: {
  13646. Fname: [7]int8{'f', 'r', 'a', 'c', '1', '4'},
  13647. Fvalue: uint8(188),
  13648. },
  13649. 54: {
  13650. Fname: [7]int8{'f', 'r', 'a', 'c', '3', '4'},
  13651. Fvalue: uint8(190),
  13652. },
  13653. 55: {
  13654. Fname: [7]int8{'g', 't'},
  13655. Fvalue: uint8(62),
  13656. },
  13657. 56: {
  13658. Fname: [7]int8{'i', 'a', 'c', 'u', 't', 'e'},
  13659. Fvalue: uint8(237),
  13660. },
  13661. 57: {
  13662. Fname: [7]int8{'i', 'c', 'i', 'r', 'c'},
  13663. Fvalue: uint8(238),
  13664. },
  13665. 58: {
  13666. Fname: [7]int8{'i', 'e', 'x', 'c', 'l'},
  13667. Fvalue: uint8(161),
  13668. },
  13669. 59: {
  13670. Fname: [7]int8{'i', 'g', 'r', 'a', 'v', 'e'},
  13671. Fvalue: uint8(236),
  13672. },
  13673. 60: {
  13674. Fname: [7]int8{'i', 'q', 'u', 'e', 's', 't'},
  13675. Fvalue: uint8(191),
  13676. },
  13677. 61: {
  13678. Fname: [7]int8{'i', 'u', 'm', 'l'},
  13679. Fvalue: uint8(239),
  13680. },
  13681. 62: {
  13682. Fname: [7]int8{'l', 'a', 'q', 'u', 'o'},
  13683. Fvalue: uint8(171),
  13684. },
  13685. 63: {
  13686. Fname: [7]int8{'l', 't'},
  13687. Fvalue: uint8(60),
  13688. },
  13689. 64: {
  13690. Fname: [7]int8{'m', 'a', 'c', 'r'},
  13691. Fvalue: uint8(175),
  13692. },
  13693. 65: {
  13694. Fname: [7]int8{'m', 'i', 'c', 'r', 'o'},
  13695. Fvalue: uint8(181),
  13696. },
  13697. 66: {
  13698. Fname: [7]int8{'m', 'i', 'd', 'd', 'o', 't'},
  13699. Fvalue: uint8(183),
  13700. },
  13701. 67: {
  13702. Fname: [7]int8{'n', 'b', 's', 'p'},
  13703. Fvalue: uint8(160),
  13704. },
  13705. 68: {
  13706. Fname: [7]int8{'n', 'o', 't'},
  13707. Fvalue: uint8(172),
  13708. },
  13709. 69: {
  13710. Fname: [7]int8{'n', 't', 'i', 'l', 'd', 'e'},
  13711. Fvalue: uint8(241),
  13712. },
  13713. 70: {
  13714. Fname: [7]int8{'o', 'a', 'c', 'u', 't', 'e'},
  13715. Fvalue: uint8(243),
  13716. },
  13717. 71: {
  13718. Fname: [7]int8{'o', 'c', 'i', 'r', 'c'},
  13719. Fvalue: uint8(244),
  13720. },
  13721. 72: {
  13722. Fname: [7]int8{'o', 'g', 'r', 'a', 'v', 'e'},
  13723. Fvalue: uint8(242),
  13724. },
  13725. 73: {
  13726. Fname: [7]int8{'o', 'r', 'd', 'f'},
  13727. Fvalue: uint8(170),
  13728. },
  13729. 74: {
  13730. Fname: [7]int8{'o', 'r', 'd', 'm'},
  13731. Fvalue: uint8(186),
  13732. },
  13733. 75: {
  13734. Fname: [7]int8{'o', 's', 'l', 'a', 's', 'h'},
  13735. Fvalue: uint8(248),
  13736. },
  13737. 76: {
  13738. Fname: [7]int8{'o', 't', 'i', 'l', 'd', 'e'},
  13739. Fvalue: uint8(245),
  13740. },
  13741. 77: {
  13742. Fname: [7]int8{'o', 'u', 'm', 'l'},
  13743. Fvalue: uint8(246),
  13744. },
  13745. 78: {
  13746. Fname: [7]int8{'p', 'a', 'r', 'a'},
  13747. Fvalue: uint8(182),
  13748. },
  13749. 79: {
  13750. Fname: [7]int8{'p', 'l', 'u', 's', 'm', 'n'},
  13751. Fvalue: uint8(177),
  13752. },
  13753. 80: {
  13754. Fname: [7]int8{'p', 'o', 'u', 'n', 'd'},
  13755. Fvalue: uint8(163),
  13756. },
  13757. 81: {
  13758. Fname: [7]int8{'q', 'u', 'o', 't'},
  13759. Fvalue: uint8(34),
  13760. },
  13761. 82: {
  13762. Fname: [7]int8{'r', 'a', 'q', 'u', 'o'},
  13763. Fvalue: uint8(187),
  13764. },
  13765. 83: {
  13766. Fname: [7]int8{'r', 'e', 'g'},
  13767. Fvalue: uint8(174),
  13768. },
  13769. 84: {
  13770. Fname: [7]int8{'s', 'e', 'c', 't'},
  13771. Fvalue: uint8(167),
  13772. },
  13773. 85: {
  13774. Fname: [7]int8{'s', 'h', 'y'},
  13775. Fvalue: uint8(173),
  13776. },
  13777. 86: {
  13778. Fname: [7]int8{'s', 'u', 'p', '1'},
  13779. Fvalue: uint8(185),
  13780. },
  13781. 87: {
  13782. Fname: [7]int8{'s', 'u', 'p', '2'},
  13783. Fvalue: uint8(178),
  13784. },
  13785. 88: {
  13786. Fname: [7]int8{'s', 'u', 'p', '3'},
  13787. Fvalue: uint8(179),
  13788. },
  13789. 89: {
  13790. Fname: [7]int8{'s', 'z', 'l', 'i', 'g'},
  13791. Fvalue: uint8(223),
  13792. },
  13793. 90: {
  13794. Fname: [7]int8{'t', 'h', 'o', 'r', 'n'},
  13795. Fvalue: uint8(254),
  13796. },
  13797. 91: {
  13798. Fname: [7]int8{'t', 'i', 'm', 'e', 's'},
  13799. Fvalue: uint8(215),
  13800. },
  13801. 92: {
  13802. Fname: [7]int8{'u', 'a', 'c', 'u', 't', 'e'},
  13803. Fvalue: uint8(250),
  13804. },
  13805. 93: {
  13806. Fname: [7]int8{'u', 'c', 'i', 'r', 'c'},
  13807. Fvalue: uint8(251),
  13808. },
  13809. 94: {
  13810. Fname: [7]int8{'u', 'g', 'r', 'a', 'v', 'e'},
  13811. Fvalue: uint8(249),
  13812. },
  13813. 95: {
  13814. Fname: [7]int8{'u', 'm', 'l'},
  13815. Fvalue: uint8(168),
  13816. },
  13817. 96: {
  13818. Fname: [7]int8{'u', 'u', 'm', 'l'},
  13819. Fvalue: uint8(252),
  13820. },
  13821. 97: {
  13822. Fname: [7]int8{'y', 'a', 'c', 'u', 't', 'e'},
  13823. Fvalue: uint8(253),
  13824. },
  13825. 98: {
  13826. Fname: [7]int8{'y', 'e', 'n'},
  13827. Fvalue: uint8(165),
  13828. },
  13829. 99: {
  13830. Fname: [7]int8{'y', 'u', 'm', 'l'},
  13831. Fvalue: uint8(255),
  13832. },
  13833. }
  13834. // C documentation
  13835. //
  13836. // /*
  13837. // * unvis - decode characters previously encoded by vis
  13838. // */
  13839. func Xunvis(tls *libc.TLS, cp uintptr, c int32, astate uintptr, flag int32) (r int32) {
  13840. var ia, is, lc, st, uc uint8
  13841. var v22, v23, v24, v25, v26 int32
  13842. var p19, p20, p21, p28 uintptr
  13843. _, _, _, _, _, _, _, _, _, _, _, _, _, _ = ia, is, lc, st, uc, v22, v23, v24, v25, v26, p19, p20, p21, p28
  13844. uc = libc.Uint8FromInt32(c)
  13845. /*
  13846. * Bottom 8 bits of astate hold the state machine state.
  13847. * Top 8 bits hold the current character in the http 1866 nv string decoding
  13848. */
  13849. st = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(astate)) & libc.Int32FromInt32(0xff))
  13850. if flag&int32(m__VIS_END) != 0 {
  13851. switch libc.Int32FromUint8(st) {
  13852. case int32(m_S_OCTAL2):
  13853. fallthrough
  13854. case int32(m_S_OCTAL3):
  13855. fallthrough
  13856. case int32(m_S_HEX2):
  13857. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  13858. return int32(m_UNVIS_VALID)
  13859. case m_S_GROUND:
  13860. return int32(m_UNVIS_NOCHAR)
  13861. default:
  13862. return -int32(1)
  13863. }
  13864. }
  13865. switch libc.Int32FromUint8(st) {
  13866. case m_S_GROUND:
  13867. goto _1
  13868. case int32(m_S_START):
  13869. goto _2
  13870. case int32(m_S_META):
  13871. goto _3
  13872. case int32(m_S_META1):
  13873. goto _4
  13874. case int32(m_S_CTRL):
  13875. goto _5
  13876. case int32(m_S_OCTAL2):
  13877. goto _6
  13878. case int32(m_S_OCTAL3):
  13879. goto _7
  13880. case int32(m_S_HEX):
  13881. goto _8
  13882. case int32(m_S_HEX1):
  13883. goto _9
  13884. case int32(m_S_HEX2):
  13885. goto _10
  13886. case int32(m_S_MIME1):
  13887. goto _11
  13888. case int32(m_S_MIME2):
  13889. goto _12
  13890. case int32(m_S_EATCRNL):
  13891. goto _13
  13892. case int32(m_S_AMP):
  13893. goto _14
  13894. case int32(m_S_STRING):
  13895. goto _15
  13896. case int32(m_S_NUMBER):
  13897. goto _16
  13898. default:
  13899. goto _17
  13900. }
  13901. goto _18
  13902. _1:
  13903. ;
  13904. *(*int8)(unsafe.Pointer(cp)) = 0
  13905. if flag&int32(m_VIS_NOESCAPE) == 0 && c == int32('\\') {
  13906. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_START)))
  13907. return int32(m_UNVIS_NOCHAR)
  13908. }
  13909. if flag&int32(m_VIS_HTTP1808) != 0 && c == int32('%') {
  13910. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_HEX1)))
  13911. return int32(m_UNVIS_NOCHAR)
  13912. }
  13913. if flag&int32(m_VIS_HTTP1866) != 0 && c == int32('&') {
  13914. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_AMP)))
  13915. return int32(m_UNVIS_NOCHAR)
  13916. }
  13917. if flag&int32(m_VIS_MIMESTYLE) != 0 && c == int32('=') {
  13918. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_MIME1)))
  13919. return int32(m_UNVIS_NOCHAR)
  13920. }
  13921. *(*int8)(unsafe.Pointer(cp)) = int8(c)
  13922. return int32(m_UNVIS_VALID)
  13923. _2:
  13924. ;
  13925. switch c {
  13926. case int32('\\'):
  13927. *(*int8)(unsafe.Pointer(cp)) = int8(c)
  13928. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  13929. return int32(m_UNVIS_VALID)
  13930. case int32('0'):
  13931. fallthrough
  13932. case int32('1'):
  13933. fallthrough
  13934. case int32('2'):
  13935. fallthrough
  13936. case int32('3'):
  13937. fallthrough
  13938. case int32('4'):
  13939. fallthrough
  13940. case int32('5'):
  13941. fallthrough
  13942. case int32('6'):
  13943. fallthrough
  13944. case int32('7'):
  13945. *(*int8)(unsafe.Pointer(cp)) = int8(c - libc.Int32FromUint8('0'))
  13946. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_OCTAL2)))
  13947. return int32(m_UNVIS_NOCHAR)
  13948. case int32('M'):
  13949. *(*int8)(unsafe.Pointer(cp)) = libc.Int8FromInt32(0200)
  13950. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_META)))
  13951. return int32(m_UNVIS_NOCHAR)
  13952. case int32('^'):
  13953. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_CTRL)))
  13954. return int32(m_UNVIS_NOCHAR)
  13955. case int32('n'):
  13956. *(*int8)(unsafe.Pointer(cp)) = int8('\n')
  13957. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  13958. return int32(m_UNVIS_VALID)
  13959. case int32('r'):
  13960. *(*int8)(unsafe.Pointer(cp)) = int8('\r')
  13961. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  13962. return int32(m_UNVIS_VALID)
  13963. case int32('b'):
  13964. *(*int8)(unsafe.Pointer(cp)) = int8('\b')
  13965. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  13966. return int32(m_UNVIS_VALID)
  13967. case int32('a'):
  13968. *(*int8)(unsafe.Pointer(cp)) = int8('\007')
  13969. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  13970. return int32(m_UNVIS_VALID)
  13971. case int32('v'):
  13972. *(*int8)(unsafe.Pointer(cp)) = int8('\v')
  13973. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  13974. return int32(m_UNVIS_VALID)
  13975. case int32('t'):
  13976. *(*int8)(unsafe.Pointer(cp)) = int8('\t')
  13977. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  13978. return int32(m_UNVIS_VALID)
  13979. case int32('f'):
  13980. *(*int8)(unsafe.Pointer(cp)) = int8('\f')
  13981. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  13982. return int32(m_UNVIS_VALID)
  13983. case int32('s'):
  13984. *(*int8)(unsafe.Pointer(cp)) = int8(' ')
  13985. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  13986. return int32(m_UNVIS_VALID)
  13987. case int32('E'):
  13988. *(*int8)(unsafe.Pointer(cp)) = int8('\033')
  13989. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  13990. return int32(m_UNVIS_VALID)
  13991. case int32('x'):
  13992. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_HEX)))
  13993. return int32(m_UNVIS_NOCHAR)
  13994. case int32('\n'):
  13995. /*
  13996. * hidden newline
  13997. */
  13998. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  13999. return int32(m_UNVIS_NOCHAR)
  14000. case int32('$'):
  14001. /*
  14002. * hidden marker
  14003. */
  14004. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  14005. return int32(m_UNVIS_NOCHAR)
  14006. default:
  14007. if libc.BoolInt32(libc.Uint32FromInt32(c)-uint32(0x21) < uint32(0x5e)) != 0 {
  14008. *(*int8)(unsafe.Pointer(cp)) = int8(c)
  14009. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  14010. return int32(m_UNVIS_VALID)
  14011. }
  14012. }
  14013. goto bad
  14014. _3:
  14015. ;
  14016. if c == int32('-') {
  14017. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_META1)))
  14018. } else {
  14019. if c == int32('^') {
  14020. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_CTRL)))
  14021. } else {
  14022. goto bad
  14023. }
  14024. }
  14025. return int32(m_UNVIS_NOCHAR)
  14026. _4:
  14027. ;
  14028. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  14029. p19 = cp
  14030. *(*int8)(unsafe.Pointer(p19)) = int8(int32(*(*int8)(unsafe.Pointer(p19))) | c)
  14031. return int32(m_UNVIS_VALID)
  14032. _5:
  14033. ;
  14034. if c == int32('?') {
  14035. p20 = cp
  14036. *(*int8)(unsafe.Pointer(p20)) = int8(int32(*(*int8)(unsafe.Pointer(p20))) | libc.Int32FromInt32(0177))
  14037. } else {
  14038. p21 = cp
  14039. *(*int8)(unsafe.Pointer(p21)) = int8(int32(*(*int8)(unsafe.Pointer(p21))) | c&libc.Int32FromInt32(037))
  14040. }
  14041. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  14042. return int32(m_UNVIS_VALID)
  14043. _6:
  14044. ; /* second possible octal digit */
  14045. if libc.Int32FromUint8(uc) >= int32('0') && libc.Int32FromUint8(uc) <= int32('7') {
  14046. /*
  14047. * yes - and maybe a third
  14048. */
  14049. *(*int8)(unsafe.Pointer(cp)) = int8(int32(*(*int8)(unsafe.Pointer(cp)))<<int32(3) + (c - int32('0')))
  14050. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_OCTAL3)))
  14051. return int32(m_UNVIS_NOCHAR)
  14052. }
  14053. /*
  14054. * no - done with current sequence, push back passed char
  14055. */
  14056. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  14057. return int32(m_UNVIS_VALIDPUSH)
  14058. _7:
  14059. ; /* third possible octal digit */
  14060. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  14061. if libc.Int32FromUint8(uc) >= int32('0') && libc.Int32FromUint8(uc) <= int32('7') {
  14062. *(*int8)(unsafe.Pointer(cp)) = int8(int32(*(*int8)(unsafe.Pointer(cp)))<<int32(3) + (c - int32('0')))
  14063. return int32(m_UNVIS_VALID)
  14064. }
  14065. /*
  14066. * we were done, push back passed char
  14067. */
  14068. return int32(m_UNVIS_VALIDPUSH)
  14069. _8:
  14070. ;
  14071. if !(libc.Xisxdigit(tls, libc.Int32FromUint8(uc)) != 0) {
  14072. goto bad
  14073. }
  14074. /*FALLTHROUGH*/
  14075. _9:
  14076. ;
  14077. if libc.Xisxdigit(tls, libc.Int32FromUint8(uc)) != 0 {
  14078. if libc.BoolInt32(uint32(uc)-uint32('0') < uint32(10)) != 0 {
  14079. v22 = libc.Int32FromUint8(uc) - int32('0')
  14080. } else {
  14081. v22 = libc.Xtolower(tls, libc.Int32FromUint8(uc)) - int32('a') + int32(10)
  14082. }
  14083. *(*int8)(unsafe.Pointer(cp)) = int8(v22)
  14084. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_HEX2)))
  14085. return int32(m_UNVIS_NOCHAR)
  14086. }
  14087. /*
  14088. * no - done with current sequence, push back passed char
  14089. */
  14090. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  14091. return int32(m_UNVIS_VALIDPUSH)
  14092. _10:
  14093. ;
  14094. *(*int32)(unsafe.Pointer(astate)) = m_S_GROUND
  14095. if libc.Xisxdigit(tls, libc.Int32FromUint8(uc)) != 0 {
  14096. if libc.BoolInt32(uint32(uc)-uint32('0') < uint32(10)) != 0 {
  14097. v23 = libc.Int32FromUint8(uc) - int32('0')
  14098. } else {
  14099. v23 = libc.Xtolower(tls, libc.Int32FromUint8(uc)) - int32('a') + int32(10)
  14100. }
  14101. *(*int8)(unsafe.Pointer(cp)) = int8(v23 | int32(*(*int8)(unsafe.Pointer(cp)))<<int32(4))
  14102. return int32(m_UNVIS_VALID)
  14103. }
  14104. return int32(m_UNVIS_VALIDPUSH)
  14105. _11:
  14106. ;
  14107. if libc.Int32FromUint8(uc) == int32('\n') || libc.Int32FromUint8(uc) == int32('\r') {
  14108. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_EATCRNL)))
  14109. return int32(m_UNVIS_NOCHAR)
  14110. }
  14111. if libc.Xisxdigit(tls, libc.Int32FromUint8(uc)) != 0 && (libc.BoolInt32(uint32(uc)-uint32('0') < uint32(10)) != 0 || libc.BoolInt32(uint32(uc)-uint32('A') < uint32(26)) != 0) {
  14112. if libc.BoolInt32(uint32(uc)-uint32('0') < uint32(10)) != 0 {
  14113. v24 = libc.Int32FromUint8(uc) - int32('0')
  14114. } else {
  14115. v24 = libc.Int32FromUint8(uc) - int32('A') + int32(10)
  14116. }
  14117. *(*int8)(unsafe.Pointer(cp)) = int8(v24)
  14118. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_MIME2)))
  14119. return int32(m_UNVIS_NOCHAR)
  14120. }
  14121. goto bad
  14122. _12:
  14123. ;
  14124. if libc.Xisxdigit(tls, libc.Int32FromUint8(uc)) != 0 && (libc.BoolInt32(uint32(uc)-uint32('0') < uint32(10)) != 0 || libc.BoolInt32(uint32(uc)-uint32('A') < uint32(26)) != 0) {
  14125. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  14126. if libc.BoolInt32(uint32(uc)-uint32('0') < uint32(10)) != 0 {
  14127. v25 = libc.Int32FromUint8(uc) - int32('0')
  14128. } else {
  14129. v25 = libc.Int32FromUint8(uc) - int32('A') + int32(10)
  14130. }
  14131. *(*int8)(unsafe.Pointer(cp)) = int8(v25 | int32(*(*int8)(unsafe.Pointer(cp)))<<int32(4))
  14132. return int32(m_UNVIS_VALID)
  14133. }
  14134. goto bad
  14135. _13:
  14136. ;
  14137. switch libc.Int32FromUint8(uc) {
  14138. case int32('\r'):
  14139. fallthrough
  14140. case int32('\n'):
  14141. return int32(m_UNVIS_NOCHAR)
  14142. case int32('='):
  14143. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_MIME1)))
  14144. return int32(m_UNVIS_NOCHAR)
  14145. default:
  14146. *(*int8)(unsafe.Pointer(cp)) = libc.Int8FromUint8(uc)
  14147. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  14148. return int32(m_UNVIS_VALID)
  14149. }
  14150. _14:
  14151. ;
  14152. *(*int8)(unsafe.Pointer(cp)) = 0
  14153. if libc.Int32FromUint8(uc) == int32('#') {
  14154. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_NUMBER)))
  14155. return int32(m_UNVIS_NOCHAR)
  14156. }
  14157. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_STRING)))
  14158. /*FALLTHROUGH*/
  14159. _15:
  14160. ;
  14161. ia = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(cp))) /* index in the array */
  14162. is = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(astate))) >> libc.Int32FromInt32(24)) /* index in the string */
  14163. if libc.Int32FromUint8(is) == 0 {
  14164. v26 = 0
  14165. } else {
  14166. v26 = int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_nv)) + uintptr(ia)*8 + uintptr(libc.Int32FromUint8(is)-int32(1)))))
  14167. }
  14168. lc = libc.Uint8FromInt32(v26) /* last character */
  14169. if libc.Int32FromUint8(uc) == int32(';') {
  14170. uc = uint8('\000')
  14171. }
  14172. for {
  14173. if !(uint32(ia) < libc.Uint32FromInt64(800)/libc.Uint32FromInt64(8)) {
  14174. break
  14175. }
  14176. if libc.Int32FromUint8(is) != 0 && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_nv)) + uintptr(ia)*8 + uintptr(libc.Int32FromUint8(is)-int32(1))))) != libc.Int32FromUint8(lc) {
  14177. goto bad
  14178. }
  14179. if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_nv)) + uintptr(ia)*8 + uintptr(is)))) == libc.Int32FromUint8(uc) {
  14180. break
  14181. }
  14182. goto _27
  14183. _27:
  14184. ;
  14185. ia++
  14186. }
  14187. if uint32(ia) == libc.Uint32FromInt64(800)/libc.Uint32FromInt64(8) {
  14188. goto bad
  14189. }
  14190. if libc.Int32FromUint8(uc) != 0 {
  14191. *(*int8)(unsafe.Pointer(cp)) = libc.Int8FromUint8(ia)
  14192. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromUint8(is)+libc.Int32FromInt32(1))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_STRING)))
  14193. return int32(m_UNVIS_NOCHAR)
  14194. }
  14195. *(*int8)(unsafe.Pointer(cp)) = libc.Int8FromUint8(_nv[ia].Fvalue)
  14196. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  14197. return int32(m_UNVIS_VALID)
  14198. _16:
  14199. ;
  14200. if libc.Int32FromUint8(uc) == int32(';') {
  14201. return int32(m_UNVIS_VALID)
  14202. }
  14203. if !(libc.BoolInt32(uint32(uc)-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0) {
  14204. goto bad
  14205. }
  14206. p28 = cp
  14207. *(*int8)(unsafe.Pointer(p28)) = int8(int32(*(*int8)(unsafe.Pointer(p28))) + (int32(*(*int8)(unsafe.Pointer(cp)))*libc.Int32FromInt32(10) + libc.Int32FromUint8(uc) - libc.Int32FromUint8('0')))
  14208. return int32(m_UNVIS_NOCHAR)
  14209. _17:
  14210. ;
  14211. goto bad
  14212. bad:
  14213. ;
  14214. /*
  14215. * decoder in unknown state - (probably uninitialized)
  14216. */
  14217. *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
  14218. return -int32(1)
  14219. _18:
  14220. ;
  14221. return r
  14222. }
  14223. /*
  14224. * strnunvisx - decode src into dst
  14225. *
  14226. * Number of chars decoded into dst is returned, -1 on error.
  14227. * Dst is null terminated.
  14228. */
  14229. func Xstrnunvisx(tls *libc.TLS, dst uintptr, dlen Tsize_t, src uintptr, flag int32) (r int32) {
  14230. bp := tls.Alloc(16)
  14231. defer tls.Free(16)
  14232. var c, v1 int8
  14233. var start, v14, v16, v18, v2 uintptr
  14234. var v13, v15, v17, v19 Tsize_t
  14235. var _ /* state at bp+4 */ int32
  14236. var _ /* t at bp+0 */ int8
  14237. _, _, _, _, _, _, _, _, _, _, _ = c, start, v1, v13, v14, v15, v16, v17, v18, v19, v2
  14238. *(*int8)(unsafe.Pointer(bp)) = int8('\000')
  14239. start = dst
  14240. *(*int32)(unsafe.Pointer(bp + 4)) = 0
  14241. for {
  14242. v2 = src
  14243. src++
  14244. v1 = *(*int8)(unsafe.Pointer(v2))
  14245. c = v1
  14246. if !(int32(v1) != int32('\000')) {
  14247. break
  14248. }
  14249. goto again
  14250. again:
  14251. ;
  14252. switch Xunvis(tls, bp, int32(c), bp+4, flag) {
  14253. case int32(m_UNVIS_VALID):
  14254. goto _3
  14255. case int32(m_UNVIS_VALIDPUSH):
  14256. goto _4
  14257. case int32(m_UNVIS_NOCHAR):
  14258. goto _5
  14259. case 0:
  14260. goto _6
  14261. case -int32(1):
  14262. goto _7
  14263. default:
  14264. goto _8
  14265. }
  14266. goto _9
  14267. _3:
  14268. ;
  14269. _12:
  14270. ;
  14271. v13 = dlen
  14272. dlen--
  14273. if v13 == uint32(0) {
  14274. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOSPC)
  14275. return -int32(1)
  14276. }
  14277. goto _11
  14278. _11:
  14279. ;
  14280. if 0 != 0 {
  14281. goto _12
  14282. }
  14283. goto _10
  14284. _10:
  14285. ;
  14286. v14 = dst
  14287. dst++
  14288. *(*int8)(unsafe.Pointer(v14)) = *(*int8)(unsafe.Pointer(bp))
  14289. goto _9
  14290. _4:
  14291. ;
  14292. v15 = dlen
  14293. dlen--
  14294. if v15 == uint32(0) {
  14295. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOSPC)
  14296. return -int32(1)
  14297. }
  14298. v16 = dst
  14299. dst++
  14300. *(*int8)(unsafe.Pointer(v16)) = *(*int8)(unsafe.Pointer(bp))
  14301. goto again
  14302. _6:
  14303. ;
  14304. _5:
  14305. ;
  14306. goto _9
  14307. _7:
  14308. ;
  14309. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  14310. return -int32(1)
  14311. _8:
  14312. ;
  14313. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
  14314. return -int32(1)
  14315. _9:
  14316. }
  14317. if Xunvis(tls, bp, int32(c), bp+4, int32(m__VIS_END)) == int32(m_UNVIS_VALID) {
  14318. v17 = dlen
  14319. dlen--
  14320. if v17 == uint32(0) {
  14321. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOSPC)
  14322. return -int32(1)
  14323. }
  14324. v18 = dst
  14325. dst++
  14326. *(*int8)(unsafe.Pointer(v18)) = *(*int8)(unsafe.Pointer(bp))
  14327. }
  14328. v19 = dlen
  14329. dlen--
  14330. if v19 == uint32(0) {
  14331. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOSPC)
  14332. return -int32(1)
  14333. }
  14334. *(*int8)(unsafe.Pointer(dst)) = int8('\000')
  14335. return int32(dst) - int32(start)
  14336. }
  14337. func Xstrunvisx(tls *libc.TLS, dst uintptr, src uintptr, flag int32) (r int32) {
  14338. return Xstrnunvisx(tls, dst, libc.Uint32FromInt32(^libc.Int32FromInt32(0)), src, flag)
  14339. }
  14340. func Xstrunvis(tls *libc.TLS, dst uintptr, src uintptr) (r int32) {
  14341. return Xstrnunvisx(tls, dst, libc.Uint32FromInt32(^libc.Int32FromInt32(0)), src, 0)
  14342. }
  14343. func Xstrnunvis_openbsd(tls *libc.TLS, dst uintptr, src uintptr, dlen Tsize_t) (r Tssize_t) {
  14344. return Xstrnunvisx(tls, dst, dlen, src, 0)
  14345. }
  14346. func Xstrnunvis_netbsd(tls *libc.TLS, dst uintptr, dlen Tsize_t, src uintptr) (r int32) {
  14347. return Xstrnunvisx(tls, dst, dlen, src, 0)
  14348. }
  14349. const m_MAXEXTRAS = 30
  14350. const m_VIS_CSTYLE1 = 2
  14351. const m_VIS_DQ1 = 32768
  14352. const m_VIS_GLOB1 = 4096
  14353. const m_VIS_HTTP18081 = 0x0080
  14354. const m_VIS_HTTP18661 = 0x0200
  14355. const m_VIS_HTTPSTYLE1 = 128
  14356. const m_VIS_NL1 = 16
  14357. const m_VIS_NOESCAPE1 = 0x0400
  14358. const m_VIS_NOLOCALE1 = 16384
  14359. const m_VIS_NOSLASH1 = 64
  14360. const m_VIS_OCTAL1 = 1
  14361. const m_VIS_SAFE1 = 32
  14362. const m_VIS_SHELL1 = 8192
  14363. const m_VIS_SP1 = 4
  14364. const m_VIS_TAB1 = 8
  14365. const m__VIS_END1 = 0x0800
  14366. type Twctrans_t = uintptr
  14367. /* Keep it simple for now, no locale stuff */
  14368. var _char_shell = [19]Twchar_t{'\'', '`', '"', ';', '&', '<', '>', '(', ')', '|', '{', '}', ']', '\\', '$', '!', '^', '~'}
  14369. var _char_glob = [5]Twchar_t{'*', '?', '[', '#'}
  14370. /*
  14371. * On NetBSD and glibc MB_LEN_MAX is currently > 8 which does not fit on any
  14372. * integer integral type and it is probably wrong, since currently the maximum
  14373. * number of bytes and character needs is 6. Until this is fixed, the
  14374. * loops below are using sizeof(uint64_t) - 1 instead of MB_LEN_MAX, and
  14375. * the assertion is commented out.
  14376. */
  14377. // C documentation
  14378. //
  14379. // /*
  14380. // * This is do_hvis, for HTTP style (RFC 1808)
  14381. // */
  14382. func _do_hvis(tls *libc.TLS, dst uintptr, c Twint_t, flags int32, nextc Twint_t, extra uintptr) (r uintptr) {
  14383. var v1, v2, v3 uintptr
  14384. _, _, _ = v1, v2, v3
  14385. if libc.Xiswalnum(tls, c) != 0 || c == uint32('$') || c == uint32('-') || c == uint32('_') || c == uint32('.') || c == uint32('+') || c == uint32('!') || c == uint32('*') || c == uint32('\'') || c == uint32('(') || c == uint32(')') || c == uint32(',') {
  14386. dst = _do_svis(tls, dst, c, flags, nextc, extra)
  14387. } else {
  14388. v1 = dst
  14389. dst += 4
  14390. *(*Twchar_t)(unsafe.Pointer(v1)) = int32('%')
  14391. v2 = dst
  14392. dst += 4
  14393. *(*Twchar_t)(unsafe.Pointer(v2)) = *(*t__predefined_wchar_t)(unsafe.Pointer(__ccgo_ts + 463 + uintptr(c>>int32(4)&uint32(0xf))*4))
  14394. v3 = dst
  14395. dst += 4
  14396. *(*Twchar_t)(unsafe.Pointer(v3)) = *(*t__predefined_wchar_t)(unsafe.Pointer(__ccgo_ts + 463 + uintptr(c&uint32(0xf))*4))
  14397. }
  14398. return dst
  14399. }
  14400. // C documentation
  14401. //
  14402. // /*
  14403. // * This is do_mvis, for Quoted-Printable MIME (RFC 2045)
  14404. // * NB: No handling of long lines or CRLF.
  14405. // */
  14406. func _do_mvis(tls *libc.TLS, dst uintptr, c Twint_t, flags int32, nextc Twint_t, extra uintptr) (r uintptr) {
  14407. var v1, v2, v3 uintptr
  14408. _, _, _ = v1, v2, v3
  14409. if c != uint32('\n') && (libc.Xiswspace(tls, c) != 0 && (nextc == uint32('\r') || nextc == uint32('\n')) || !(libc.Xiswspace(tls, c) != 0) && (c < uint32(33) || c > uint32(60) && c < uint32(62) || c > uint32(126)) || libc.Xwcschr(tls, __ccgo_ts+531, libc.Int32FromUint32(c)) != libc.UintptrFromInt32(0)) {
  14410. v1 = dst
  14411. dst += 4
  14412. *(*Twchar_t)(unsafe.Pointer(v1)) = int32('=')
  14413. v2 = dst
  14414. dst += 4
  14415. *(*Twchar_t)(unsafe.Pointer(v2)) = *(*t__predefined_wchar_t)(unsafe.Pointer(__ccgo_ts + 583 + uintptr(c>>int32(4)&uint32(0xf))*4))
  14416. v3 = dst
  14417. dst += 4
  14418. *(*Twchar_t)(unsafe.Pointer(v3)) = *(*t__predefined_wchar_t)(unsafe.Pointer(__ccgo_ts + 583 + uintptr(c&uint32(0xf))*4))
  14419. } else {
  14420. dst = _do_svis(tls, dst, c, flags, nextc, extra)
  14421. }
  14422. return dst
  14423. }
  14424. // C documentation
  14425. //
  14426. // /*
  14427. // * Output single byte of multibyte character.
  14428. // */
  14429. func _do_mbyte(tls *libc.TLS, dst uintptr, c Twint_t, flags int32, nextc Twint_t, iswextra int32) (r uintptr) {
  14430. var v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v4, v5, v6, v7, v8, v9 uintptr
  14431. var v21 int32
  14432. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v4, v5, v6, v7, v8, v9
  14433. if flags&int32(m_VIS_CSTYLE1) != 0 {
  14434. switch c {
  14435. case uint32('\n'):
  14436. v1 = dst
  14437. dst += 4
  14438. *(*Twchar_t)(unsafe.Pointer(v1)) = int32('\\')
  14439. v2 = dst
  14440. dst += 4
  14441. *(*Twchar_t)(unsafe.Pointer(v2)) = int32('n')
  14442. return dst
  14443. case uint32('\r'):
  14444. v3 = dst
  14445. dst += 4
  14446. *(*Twchar_t)(unsafe.Pointer(v3)) = int32('\\')
  14447. v4 = dst
  14448. dst += 4
  14449. *(*Twchar_t)(unsafe.Pointer(v4)) = int32('r')
  14450. return dst
  14451. case uint32('\b'):
  14452. v5 = dst
  14453. dst += 4
  14454. *(*Twchar_t)(unsafe.Pointer(v5)) = int32('\\')
  14455. v6 = dst
  14456. dst += 4
  14457. *(*Twchar_t)(unsafe.Pointer(v6)) = int32('b')
  14458. return dst
  14459. case uint32('\a'):
  14460. v7 = dst
  14461. dst += 4
  14462. *(*Twchar_t)(unsafe.Pointer(v7)) = int32('\\')
  14463. v8 = dst
  14464. dst += 4
  14465. *(*Twchar_t)(unsafe.Pointer(v8)) = int32('a')
  14466. return dst
  14467. case uint32('\v'):
  14468. v9 = dst
  14469. dst += 4
  14470. *(*Twchar_t)(unsafe.Pointer(v9)) = int32('\\')
  14471. v10 = dst
  14472. dst += 4
  14473. *(*Twchar_t)(unsafe.Pointer(v10)) = int32('v')
  14474. return dst
  14475. case uint32('\t'):
  14476. v11 = dst
  14477. dst += 4
  14478. *(*Twchar_t)(unsafe.Pointer(v11)) = int32('\\')
  14479. v12 = dst
  14480. dst += 4
  14481. *(*Twchar_t)(unsafe.Pointer(v12)) = int32('t')
  14482. return dst
  14483. case uint32('\f'):
  14484. v13 = dst
  14485. dst += 4
  14486. *(*Twchar_t)(unsafe.Pointer(v13)) = int32('\\')
  14487. v14 = dst
  14488. dst += 4
  14489. *(*Twchar_t)(unsafe.Pointer(v14)) = int32('f')
  14490. return dst
  14491. case uint32(' '):
  14492. v15 = dst
  14493. dst += 4
  14494. *(*Twchar_t)(unsafe.Pointer(v15)) = int32('\\')
  14495. v16 = dst
  14496. dst += 4
  14497. *(*Twchar_t)(unsafe.Pointer(v16)) = int32('s')
  14498. return dst
  14499. case uint32('\000'):
  14500. v17 = dst
  14501. dst += 4
  14502. *(*Twchar_t)(unsafe.Pointer(v17)) = int32('\\')
  14503. v18 = dst
  14504. dst += 4
  14505. *(*Twchar_t)(unsafe.Pointer(v18)) = int32('0')
  14506. if libc.Int32FromUint8(uint8(nextc)) >= int32('0') && libc.Int32FromUint8(uint8(nextc)) <= int32('7') {
  14507. v19 = dst
  14508. dst += 4
  14509. *(*Twchar_t)(unsafe.Pointer(v19)) = int32('0')
  14510. v20 = dst
  14511. dst += 4
  14512. *(*Twchar_t)(unsafe.Pointer(v20)) = int32('0')
  14513. }
  14514. return dst
  14515. /* We cannot encode these characters in VIS_CSTYLE
  14516. * because they special meaning */
  14517. fallthrough
  14518. case uint32('n'):
  14519. fallthrough
  14520. case uint32('r'):
  14521. fallthrough
  14522. case uint32('b'):
  14523. fallthrough
  14524. case uint32('a'):
  14525. fallthrough
  14526. case uint32('v'):
  14527. fallthrough
  14528. case uint32('t'):
  14529. fallthrough
  14530. case uint32('f'):
  14531. fallthrough
  14532. case uint32('s'):
  14533. fallthrough
  14534. case uint32('0'):
  14535. fallthrough
  14536. case uint32('M'):
  14537. fallthrough
  14538. case uint32('^'):
  14539. fallthrough
  14540. case uint32('$'): /* vis(1) -l */
  14541. default:
  14542. if flags&int32(m_VIS_NOLOCALE1) != 0 {
  14543. v21 = libc.BoolInt32(c-uint32(0x21) < uint32(0x5e))
  14544. } else {
  14545. v21 = libc.Xiswgraph(tls, c)
  14546. }
  14547. if v21 != 0 && !(libc.Int32FromUint8(uint8(c)) >= int32('0') && libc.Int32FromUint8(uint8(c)) <= int32('7')) {
  14548. v22 = dst
  14549. dst += 4
  14550. *(*Twchar_t)(unsafe.Pointer(v22)) = int32('\\')
  14551. v23 = dst
  14552. dst += 4
  14553. *(*Twchar_t)(unsafe.Pointer(v23)) = libc.Int32FromUint32(c)
  14554. return dst
  14555. }
  14556. }
  14557. }
  14558. if iswextra != 0 || uint32(c&libc.Uint32FromInt32(0177)) == uint32(' ') || flags&int32(m_VIS_OCTAL1) != 0 {
  14559. v24 = dst
  14560. dst += 4
  14561. *(*Twchar_t)(unsafe.Pointer(v24)) = int32('\\')
  14562. v25 = dst
  14563. dst += 4
  14564. *(*Twchar_t)(unsafe.Pointer(v25)) = libc.Int32FromUint8(uint8(uint32(uint8(c))>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(03))) + int32('0')
  14565. v26 = dst
  14566. dst += 4
  14567. *(*Twchar_t)(unsafe.Pointer(v26)) = libc.Int32FromUint8(uint8(uint32(uint8(c))>>libc.Int32FromInt32(3)&libc.Uint32FromInt32(07))) + int32('0')
  14568. v27 = dst
  14569. dst += 4
  14570. *(*Twchar_t)(unsafe.Pointer(v27)) = libc.Int32FromUint32(uint32(c&libc.Uint32FromInt32(07)) + uint32('0'))
  14571. } else {
  14572. if flags&int32(m_VIS_NOSLASH1) == 0 {
  14573. v28 = dst
  14574. dst += 4
  14575. *(*Twchar_t)(unsafe.Pointer(v28)) = int32('\\')
  14576. }
  14577. if c&uint32(0200) != 0 {
  14578. c &= uint32(0177)
  14579. v29 = dst
  14580. dst += 4
  14581. *(*Twchar_t)(unsafe.Pointer(v29)) = int32('M')
  14582. }
  14583. if libc.Xiswcntrl(tls, c) != 0 {
  14584. v30 = dst
  14585. dst += 4
  14586. *(*Twchar_t)(unsafe.Pointer(v30)) = int32('^')
  14587. if c == uint32(0177) {
  14588. v31 = dst
  14589. dst += 4
  14590. *(*Twchar_t)(unsafe.Pointer(v31)) = int32('?')
  14591. } else {
  14592. v32 = dst
  14593. dst += 4
  14594. *(*Twchar_t)(unsafe.Pointer(v32)) = libc.Int32FromUint32(c + uint32('@'))
  14595. }
  14596. } else {
  14597. v33 = dst
  14598. dst += 4
  14599. *(*Twchar_t)(unsafe.Pointer(v33)) = int32('-')
  14600. v34 = dst
  14601. dst += 4
  14602. *(*Twchar_t)(unsafe.Pointer(v34)) = libc.Int32FromUint32(c)
  14603. }
  14604. }
  14605. return dst
  14606. }
  14607. // C documentation
  14608. //
  14609. // /*
  14610. // * This is do_vis, the central code of vis.
  14611. // * dst: Pointer to the destination buffer
  14612. // * c: Character to encode
  14613. // * flags: Flags word
  14614. // * nextc: The character following 'c'
  14615. // * extra: Pointer to the list of extra characters to be
  14616. // * backslash-protected.
  14617. // */
  14618. func _do_svis(tls *libc.TLS, dst uintptr, c Twint_t, flags int32, nextc Twint_t, extra uintptr) (r uintptr) {
  14619. var bmsk, wmsk Tuint64_t
  14620. var i, iswextra, shft, v1 int32
  14621. var v2 bool
  14622. var v3 uintptr
  14623. _, _, _, _, _, _, _, _ = bmsk, i, iswextra, shft, wmsk, v1, v2, v3
  14624. iswextra = libc.BoolInt32(libc.Xwcschr(tls, extra, libc.Int32FromUint32(c)) != libc.UintptrFromInt32(0))
  14625. if v2 = !(iswextra != 0); v2 {
  14626. if flags&int32(m_VIS_NOLOCALE1) != 0 {
  14627. v1 = libc.BoolInt32(c-uint32(0x21) < uint32(0x5e))
  14628. } else {
  14629. v1 = libc.Xiswgraph(tls, c)
  14630. }
  14631. }
  14632. if v2 && (v1 != 0 || (c == uint32(' ') || c == uint32('\t') || c == uint32('\n')) || flags&int32(m_VIS_SAFE1) != 0 && (c == uint32('\b') || c == uint32('\a') || c == uint32('\r'))) {
  14633. v3 = dst
  14634. dst += 4
  14635. *(*Twchar_t)(unsafe.Pointer(v3)) = libc.Int32FromUint32(c)
  14636. return dst
  14637. }
  14638. /* See comment in istrsenvisx() output loop, below. */
  14639. wmsk = uint64(0)
  14640. i = libc.Int32FromUint32(libc.Uint32FromInt64(8) - libc.Uint32FromInt32(1))
  14641. for {
  14642. if !(i >= 0) {
  14643. break
  14644. }
  14645. shft = i * int32(m_CHAR_BIT)
  14646. bmsk = libc.Uint64FromInt64(0xff) << shft
  14647. wmsk |= bmsk
  14648. if uint64(c)&wmsk != 0 || i == 0 {
  14649. dst = _do_mbyte(tls, dst, uint32(uint64(c)&bmsk>>shft), flags, nextc, iswextra)
  14650. }
  14651. goto _4
  14652. _4:
  14653. ;
  14654. i--
  14655. }
  14656. return dst
  14657. }
  14658. type Tvisfun_t = uintptr
  14659. // C documentation
  14660. //
  14661. // /*
  14662. // * Return the appropriate encoding function depending on the flags given.
  14663. // */
  14664. func _getvisfun(tls *libc.TLS, flags int32) (r Tvisfun_t) {
  14665. if flags&int32(m_VIS_HTTPSTYLE1) != 0 {
  14666. return __ccgo_fp(_do_hvis)
  14667. }
  14668. if flags&int32(m_VIS_MIMESTYLE) != 0 {
  14669. return __ccgo_fp(_do_mvis)
  14670. }
  14671. return __ccgo_fp(_do_svis)
  14672. }
  14673. // C documentation
  14674. //
  14675. // /*
  14676. // * Expand list of extra characters to not visually encode.
  14677. // */
  14678. func _makeextralist(tls *libc.TLS, flags int32, src uintptr) (r uintptr) {
  14679. var d, dst, s, v1, v10, v11, v12, v13, v4, v5, v7, v8, v9 uintptr
  14680. var i, len1 Tsize_t
  14681. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = d, dst, i, len1, s, v1, v10, v11, v12, v13, v4, v5, v7, v8, v9
  14682. len1 = libc.Xstrlen(tls, src)
  14683. v1 = libc.Xcalloc(tls, len1+uint32(m_MAXEXTRAS), uint32(4))
  14684. dst = v1
  14685. if v1 == libc.UintptrFromInt32(0) {
  14686. return libc.UintptrFromInt32(0)
  14687. }
  14688. if flags&int32(m_VIS_NOLOCALE1) != 0 || libc.Xmbstowcs(tls, dst, src, len1) == libc.Uint32FromInt32(-libc.Int32FromInt32(1)) {
  14689. i = uint32(0)
  14690. for {
  14691. if !(i < len1) {
  14692. break
  14693. }
  14694. *(*Twchar_t)(unsafe.Pointer(dst + uintptr(i)*4)) = libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(src + uintptr(i)))))
  14695. goto _2
  14696. _2:
  14697. ;
  14698. i++
  14699. }
  14700. d = dst + uintptr(len1)*4
  14701. } else {
  14702. d = dst + uintptr(libc.Xwcslen(tls, dst))*4
  14703. }
  14704. if flags&int32(m_VIS_GLOB1) != 0 {
  14705. s = uintptr(unsafe.Pointer(&_char_glob))
  14706. for {
  14707. if !(*(*Twchar_t)(unsafe.Pointer(s)) != 0) {
  14708. break
  14709. }
  14710. goto _3
  14711. goto _3
  14712. _3:
  14713. ;
  14714. v4 = d
  14715. d += 4
  14716. v5 = s
  14717. s += 4
  14718. *(*Twchar_t)(unsafe.Pointer(v4)) = *(*Twchar_t)(unsafe.Pointer(v5))
  14719. }
  14720. }
  14721. if flags&int32(m_VIS_SHELL1) != 0 {
  14722. s = uintptr(unsafe.Pointer(&_char_shell))
  14723. for {
  14724. if !(*(*Twchar_t)(unsafe.Pointer(s)) != 0) {
  14725. break
  14726. }
  14727. goto _6
  14728. goto _6
  14729. _6:
  14730. ;
  14731. v7 = d
  14732. d += 4
  14733. v8 = s
  14734. s += 4
  14735. *(*Twchar_t)(unsafe.Pointer(v7)) = *(*Twchar_t)(unsafe.Pointer(v8))
  14736. }
  14737. }
  14738. if flags&int32(m_VIS_SP1) != 0 {
  14739. v9 = d
  14740. d += 4
  14741. *(*Twchar_t)(unsafe.Pointer(v9)) = int32(' ')
  14742. }
  14743. if flags&int32(m_VIS_TAB1) != 0 {
  14744. v10 = d
  14745. d += 4
  14746. *(*Twchar_t)(unsafe.Pointer(v10)) = int32('\t')
  14747. }
  14748. if flags&int32(m_VIS_NL1) != 0 {
  14749. v11 = d
  14750. d += 4
  14751. *(*Twchar_t)(unsafe.Pointer(v11)) = int32('\n')
  14752. }
  14753. if flags&int32(m_VIS_DQ1) != 0 {
  14754. v12 = d
  14755. d += 4
  14756. *(*Twchar_t)(unsafe.Pointer(v12)) = int32('"')
  14757. }
  14758. if flags&int32(m_VIS_NOSLASH1) == 0 {
  14759. v13 = d
  14760. d += 4
  14761. *(*Twchar_t)(unsafe.Pointer(v13)) = int32('\\')
  14762. }
  14763. *(*Twchar_t)(unsafe.Pointer(d)) = int32('\000')
  14764. return dst
  14765. }
  14766. // C documentation
  14767. //
  14768. // /*
  14769. // * istrsenvisx()
  14770. // * The main internal function.
  14771. // * All user-visible functions call this one.
  14772. // */
  14773. func _istrsenvisx(tls *libc.TLS, mbdstp uintptr, dlen uintptr, mbsrc uintptr, mblength Tsize_t, flags int32, mbextra uintptr, cerr_ptr uintptr) (r int32) {
  14774. var bmsk, wmsk Tuint64_t
  14775. var c Twint_t
  14776. var cerr, clen, error1, i, shft, v12, v6 int32
  14777. var dst, extra, mbdst, mdst, pdst, psrc, src, start, v1, v2, v3, v4, v5, v8 uintptr
  14778. var f Tvisfun_t
  14779. var len1, olen Tsize_t
  14780. var maxolen, mbslength Tssize_t
  14781. var v9 uint32
  14782. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bmsk, c, cerr, clen, dst, error1, extra, f, i, len1, maxolen, mbdst, mbslength, mdst, olen, pdst, psrc, shft, src, start, wmsk, v1, v12, v2, v3, v4, v5, v6, v8, v9
  14783. clen = 0
  14784. error1 = -int32(1)
  14785. mbslength = libc.Int32FromUint32(mblength)
  14786. /*
  14787. * When inputing a single character, must also read in the
  14788. * next character for nextc, the look-ahead character.
  14789. */
  14790. if mbslength == int32(1) {
  14791. mbslength++
  14792. }
  14793. /*
  14794. * Input (mbsrc) is a char string considered to be multibyte
  14795. * characters. The input loop will read this string pulling
  14796. * one character, possibly multiple bytes, from mbsrc and
  14797. * converting each to wchar_t in src.
  14798. *
  14799. * The vis conversion will be done using the wide char
  14800. * wchar_t string.
  14801. *
  14802. * This will then be converted back to a multibyte string to
  14803. * return to the caller.
  14804. */
  14805. /* Allocate space for the wide char strings */
  14806. v2 = libc.UintptrFromInt32(0)
  14807. extra = v2
  14808. v1 = v2
  14809. pdst = v1
  14810. psrc = v1
  14811. mdst = libc.UintptrFromInt32(0)
  14812. v3 = libc.Xcalloc(tls, libc.Uint32FromInt32(mbslength+int32(1)), uint32(4))
  14813. psrc = v3
  14814. if v3 == libc.UintptrFromInt32(0) {
  14815. return -int32(1)
  14816. }
  14817. v4 = libc.Xcalloc(tls, libc.Uint32FromInt32(int32(16)*mbslength+int32(1)), uint32(4))
  14818. pdst = v4
  14819. if v4 == libc.UintptrFromInt32(0) {
  14820. goto out
  14821. }
  14822. if *(*uintptr)(unsafe.Pointer(mbdstp)) == libc.UintptrFromInt32(0) {
  14823. v5 = libc.Xcalloc(tls, libc.Uint32FromInt32(int32(16)*mbslength+int32(1)), uint32(1))
  14824. mdst = v5
  14825. if v5 == libc.UintptrFromInt32(0) {
  14826. goto out
  14827. }
  14828. *(*uintptr)(unsafe.Pointer(mbdstp)) = mdst
  14829. }
  14830. mbdst = *(*uintptr)(unsafe.Pointer(mbdstp))
  14831. dst = pdst
  14832. src = psrc
  14833. if flags&int32(m_VIS_NOLOCALE1) != 0 {
  14834. /* Do one byte at a time conversion */
  14835. cerr = int32(1)
  14836. } else {
  14837. /* Use caller's multibyte conversion error flag. */
  14838. if cerr_ptr != 0 {
  14839. v6 = *(*int32)(unsafe.Pointer(cerr_ptr))
  14840. } else {
  14841. v6 = 0
  14842. }
  14843. cerr = v6
  14844. }
  14845. /*
  14846. * Input loop.
  14847. * Handle up to mblength characters (not bytes). We do not
  14848. * stop at NULs because we may be processing a block of data
  14849. * that includes NULs.
  14850. */
  14851. for mbslength > 0 {
  14852. /* Convert one multibyte character to wchar_t. */
  14853. if !(cerr != 0) {
  14854. clen = libc.Xmbtowc(tls, src, mbsrc, uint32(m_MB_LEN_MAX))
  14855. }
  14856. if cerr != 0 || clen < 0 {
  14857. /* Conversion error, process as a byte instead. */
  14858. *(*Twchar_t)(unsafe.Pointer(src)) = libc.Int32FromUint32(uint32(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(mbsrc)))))
  14859. clen = int32(1)
  14860. cerr = int32(1)
  14861. }
  14862. if clen == 0 {
  14863. /*
  14864. * NUL in input gives 0 return value. process
  14865. * as single NUL byte and keep going.
  14866. */
  14867. clen = int32(1)
  14868. }
  14869. /* Advance buffer character pointer. */
  14870. src += 4
  14871. /* Advance input pointer by number of bytes read. */
  14872. mbsrc += uintptr(clen)
  14873. /* Decrement input byte count. */
  14874. mbslength -= clen
  14875. }
  14876. len1 = libc.Uint32FromInt32((int32(src) - int32(psrc)) / 4)
  14877. src = psrc
  14878. /*
  14879. * In the single character input case, we will have actually
  14880. * processed two characters, c and nextc. Reset len back to
  14881. * just a single character.
  14882. */
  14883. if mblength < len1 {
  14884. len1 = mblength
  14885. }
  14886. /* Convert extra argument to list of characters for this mode. */
  14887. extra = _makeextralist(tls, flags, mbextra)
  14888. if !(extra != 0) {
  14889. if dlen != 0 && *(*Tsize_t)(unsafe.Pointer(dlen)) == uint32(0) {
  14890. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOSPC)
  14891. goto out
  14892. }
  14893. *(*int8)(unsafe.Pointer(mbdst)) = int8('\000') /* can't create extra, return "" */
  14894. error1 = 0
  14895. goto out
  14896. }
  14897. /* Look up which processing function to call. */
  14898. f = _getvisfun(tls, flags)
  14899. /*
  14900. * Main processing loop.
  14901. * Call do_Xvis processing function one character at a time
  14902. * with next character available for look-ahead.
  14903. */
  14904. start = dst
  14905. for {
  14906. if !(len1 > uint32(0)) {
  14907. break
  14908. }
  14909. v8 = src
  14910. src += 4
  14911. c = libc.Uint32FromInt32(*(*Twchar_t)(unsafe.Pointer(v8)))
  14912. dst = (*(*func(*libc.TLS, uintptr, Twint_t, int32, Twint_t, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{f})))(tls, dst, c, flags, libc.Uint32FromInt32(*(*Twchar_t)(unsafe.Pointer(src))), extra)
  14913. if dst == libc.UintptrFromInt32(0) {
  14914. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOSPC)
  14915. goto out
  14916. }
  14917. goto _7
  14918. _7:
  14919. ;
  14920. len1--
  14921. }
  14922. /* Terminate the string in the buffer. */
  14923. *(*Twchar_t)(unsafe.Pointer(dst)) = int32('\000')
  14924. /*
  14925. * Output loop.
  14926. * Convert wchar_t string back to multibyte output string.
  14927. * If we have hit a multi-byte conversion error on input,
  14928. * output byte-by-byte here. Else use wctomb().
  14929. */
  14930. len1 = libc.Xwcslen(tls, start)
  14931. if dlen != 0 {
  14932. v9 = *(*Tsize_t)(unsafe.Pointer(dlen))
  14933. } else {
  14934. v9 = libc.Xwcslen(tls, start)*uint32(m_MB_LEN_MAX) + uint32(1)
  14935. }
  14936. maxolen = libc.Int32FromUint32(v9)
  14937. olen = uint32(0)
  14938. dst = start
  14939. for {
  14940. if !(len1 > uint32(0)) {
  14941. break
  14942. }
  14943. if !(cerr != 0) {
  14944. clen = libc.Xwctomb(tls, mbdst, *(*Twchar_t)(unsafe.Pointer(dst)))
  14945. }
  14946. if cerr != 0 || clen < 0 {
  14947. /*
  14948. * Conversion error, process as a byte(s) instead.
  14949. * Examine each byte and higher-order bytes for
  14950. * data. E.g.,
  14951. * 0x000000000000a264 -> a2 64
  14952. * 0x000000001f00a264 -> 1f 00 a2 64
  14953. */
  14954. clen = 0
  14955. wmsk = uint64(0)
  14956. i = libc.Int32FromUint32(libc.Uint32FromInt64(8) - libc.Uint32FromInt32(1))
  14957. for {
  14958. if !(i >= 0) {
  14959. break
  14960. }
  14961. shft = i * int32(m_CHAR_BIT)
  14962. bmsk = libc.Uint64FromInt64(0xff) << shft
  14963. wmsk |= bmsk
  14964. if libc.Uint64FromInt32(*(*Twchar_t)(unsafe.Pointer(dst)))&wmsk != 0 || i == 0 {
  14965. v12 = clen
  14966. clen++
  14967. *(*int8)(unsafe.Pointer(mbdst + uintptr(v12))) = libc.Int8FromUint64(libc.Uint64FromInt32(*(*Twchar_t)(unsafe.Pointer(dst))) & bmsk >> shft)
  14968. }
  14969. goto _11
  14970. _11:
  14971. ;
  14972. i--
  14973. }
  14974. cerr = int32(1)
  14975. }
  14976. /* If this character would exceed our output limit, stop. */
  14977. if olen+libc.Uint32FromInt32(clen) > libc.Uint32FromInt32(maxolen) {
  14978. break
  14979. }
  14980. /* Advance output pointer by number of bytes written. */
  14981. mbdst += uintptr(clen)
  14982. /* Advance buffer character pointer. */
  14983. dst += 4
  14984. /* Incrment output character count. */
  14985. olen += libc.Uint32FromInt32(clen)
  14986. goto _10
  14987. _10:
  14988. ;
  14989. len1--
  14990. }
  14991. /* Terminate the output string. */
  14992. *(*int8)(unsafe.Pointer(mbdst)) = int8('\000')
  14993. if flags&int32(m_VIS_NOLOCALE1) != 0 {
  14994. /* Pass conversion error flag out. */
  14995. if cerr_ptr != 0 {
  14996. *(*int32)(unsafe.Pointer(cerr_ptr)) = cerr
  14997. }
  14998. }
  14999. libc.Xfree(tls, extra)
  15000. libc.Xfree(tls, pdst)
  15001. libc.Xfree(tls, psrc)
  15002. return libc.Int32FromUint32(olen)
  15003. goto out
  15004. out:
  15005. ;
  15006. libc.Xfree(tls, extra)
  15007. libc.Xfree(tls, pdst)
  15008. libc.Xfree(tls, psrc)
  15009. libc.Xfree(tls, mdst)
  15010. return error1
  15011. }
  15012. func _istrsenvisxna(tls *libc.TLS, _mbdst uintptr, dlen uintptr, mbsrc uintptr, mblength Tsize_t, flags int32, mbextra uintptr, cerr_ptr uintptr) (r int32) {
  15013. bp := tls.Alloc(16)
  15014. defer tls.Free(16)
  15015. *(*uintptr)(unsafe.Pointer(bp)) = _mbdst
  15016. return _istrsenvisx(tls, bp, dlen, mbsrc, mblength, flags, mbextra, cerr_ptr)
  15017. }
  15018. func _istrsenvisxl(tls *libc.TLS, mbdst uintptr, dlen uintptr, mbsrc uintptr, flags int32, mbextra uintptr, cerr_ptr uintptr) (r int32) {
  15019. var v1 uint32
  15020. _ = v1
  15021. if mbsrc != libc.UintptrFromInt32(0) {
  15022. v1 = libc.Xstrlen(tls, mbsrc)
  15023. } else {
  15024. v1 = uint32(0)
  15025. }
  15026. return _istrsenvisxna(tls, mbdst, dlen, mbsrc, v1, flags, mbextra, cerr_ptr)
  15027. }
  15028. /*
  15029. * The "svis" variants all take an "extra" arg that is a pointer
  15030. * to a NUL-terminated list of characters to be encoded, too.
  15031. * These functions are useful e. g. to encode strings in such a
  15032. * way so that they are not interpreted by a shell.
  15033. */
  15034. func Xsvis(tls *libc.TLS, _mbdst uintptr, c int32, flags int32, nextc int32, mbextra uintptr) (r uintptr) {
  15035. bp := tls.Alloc(16)
  15036. defer tls.Free(16)
  15037. *(*uintptr)(unsafe.Pointer(bp)) = _mbdst
  15038. var ret int32
  15039. var _ /* cc at bp+4 */ [2]int8
  15040. _ = ret
  15041. (*(*[2]int8)(unsafe.Pointer(bp + 4)))[0] = int8(c)
  15042. (*(*[2]int8)(unsafe.Pointer(bp + 4)))[int32(1)] = int8(nextc)
  15043. ret = _istrsenvisx(tls, bp, libc.UintptrFromInt32(0), bp+4, uint32(1), flags, mbextra, libc.UintptrFromInt32(0))
  15044. if ret < 0 {
  15045. return libc.UintptrFromInt32(0)
  15046. }
  15047. return *(*uintptr)(unsafe.Pointer(bp)) + uintptr(ret)
  15048. }
  15049. func Xsnvis(tls *libc.TLS, _mbdst uintptr, _dlen Tsize_t, c int32, flags int32, nextc int32, mbextra uintptr) (r uintptr) {
  15050. bp := tls.Alloc(16)
  15051. defer tls.Free(16)
  15052. *(*uintptr)(unsafe.Pointer(bp)) = _mbdst
  15053. *(*Tsize_t)(unsafe.Pointer(bp + 4)) = _dlen
  15054. var ret int32
  15055. var _ /* cc at bp+8 */ [2]int8
  15056. _ = ret
  15057. (*(*[2]int8)(unsafe.Pointer(bp + 8)))[0] = int8(c)
  15058. (*(*[2]int8)(unsafe.Pointer(bp + 8)))[int32(1)] = int8(nextc)
  15059. ret = _istrsenvisx(tls, bp, bp+4, bp+8, uint32(1), flags, mbextra, libc.UintptrFromInt32(0))
  15060. if ret < 0 {
  15061. return libc.UintptrFromInt32(0)
  15062. }
  15063. return *(*uintptr)(unsafe.Pointer(bp)) + uintptr(ret)
  15064. }
  15065. func Xstrsvis(tls *libc.TLS, mbdst uintptr, mbsrc uintptr, flags int32, mbextra uintptr) (r int32) {
  15066. return _istrsenvisxl(tls, mbdst, libc.UintptrFromInt32(0), mbsrc, flags, mbextra, libc.UintptrFromInt32(0))
  15067. }
  15068. func Xstrsnvis(tls *libc.TLS, mbdst uintptr, _dlen Tsize_t, mbsrc uintptr, flags int32, mbextra uintptr) (r int32) {
  15069. bp := tls.Alloc(16)
  15070. defer tls.Free(16)
  15071. *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
  15072. return _istrsenvisxl(tls, mbdst, bp, mbsrc, flags, mbextra, libc.UintptrFromInt32(0))
  15073. }
  15074. func Xstrsvisx(tls *libc.TLS, mbdst uintptr, mbsrc uintptr, len1 Tsize_t, flags int32, mbextra uintptr) (r int32) {
  15075. return _istrsenvisxna(tls, mbdst, libc.UintptrFromInt32(0), mbsrc, len1, flags, mbextra, libc.UintptrFromInt32(0))
  15076. }
  15077. func Xstrsnvisx(tls *libc.TLS, mbdst uintptr, _dlen Tsize_t, mbsrc uintptr, len1 Tsize_t, flags int32, mbextra uintptr) (r int32) {
  15078. bp := tls.Alloc(16)
  15079. defer tls.Free(16)
  15080. *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
  15081. return _istrsenvisxna(tls, mbdst, bp, mbsrc, len1, flags, mbextra, libc.UintptrFromInt32(0))
  15082. }
  15083. func Xstrsenvisx(tls *libc.TLS, mbdst uintptr, _dlen Tsize_t, mbsrc uintptr, len1 Tsize_t, flags int32, mbextra uintptr, cerr_ptr uintptr) (r int32) {
  15084. bp := tls.Alloc(16)
  15085. defer tls.Free(16)
  15086. *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
  15087. return _istrsenvisxna(tls, mbdst, bp, mbsrc, len1, flags, mbextra, cerr_ptr)
  15088. }
  15089. // C documentation
  15090. //
  15091. // /*
  15092. // * vis - visually encode characters
  15093. // */
  15094. func Xvis(tls *libc.TLS, _mbdst uintptr, c int32, flags int32, nextc int32) (r uintptr) {
  15095. bp := tls.Alloc(16)
  15096. defer tls.Free(16)
  15097. *(*uintptr)(unsafe.Pointer(bp)) = _mbdst
  15098. var ret int32
  15099. var _ /* cc at bp+4 */ [2]int8
  15100. _ = ret
  15101. (*(*[2]int8)(unsafe.Pointer(bp + 4)))[0] = int8(c)
  15102. (*(*[2]int8)(unsafe.Pointer(bp + 4)))[int32(1)] = int8(nextc)
  15103. ret = _istrsenvisx(tls, bp, libc.UintptrFromInt32(0), bp+4, uint32(1), flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
  15104. if ret < 0 {
  15105. return libc.UintptrFromInt32(0)
  15106. }
  15107. return *(*uintptr)(unsafe.Pointer(bp)) + uintptr(ret)
  15108. }
  15109. func Xnvis(tls *libc.TLS, _mbdst uintptr, _dlen Tsize_t, c int32, flags int32, nextc int32) (r uintptr) {
  15110. bp := tls.Alloc(16)
  15111. defer tls.Free(16)
  15112. *(*uintptr)(unsafe.Pointer(bp)) = _mbdst
  15113. *(*Tsize_t)(unsafe.Pointer(bp + 4)) = _dlen
  15114. var ret int32
  15115. var _ /* cc at bp+8 */ [2]int8
  15116. _ = ret
  15117. (*(*[2]int8)(unsafe.Pointer(bp + 8)))[0] = int8(c)
  15118. (*(*[2]int8)(unsafe.Pointer(bp + 8)))[int32(1)] = int8(nextc)
  15119. ret = _istrsenvisx(tls, bp, bp+4, bp+8, uint32(1), flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
  15120. if ret < 0 {
  15121. return libc.UintptrFromInt32(0)
  15122. }
  15123. return *(*uintptr)(unsafe.Pointer(bp)) + uintptr(ret)
  15124. }
  15125. /*
  15126. * strvis - visually encode characters from src into dst
  15127. *
  15128. * Dst must be 4 times the size of src to account for possible
  15129. * expansion. The length of dst, not including the trailing NULL,
  15130. * is returned.
  15131. */
  15132. func Xstrvis(tls *libc.TLS, mbdst uintptr, mbsrc uintptr, flags int32) (r int32) {
  15133. return _istrsenvisxl(tls, mbdst, libc.UintptrFromInt32(0), mbsrc, flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
  15134. }
  15135. func Xstrnvis_openbsd(tls *libc.TLS, mbdst uintptr, mbsrc uintptr, _dlen Tsize_t, flags int32) (r int32) {
  15136. bp := tls.Alloc(16)
  15137. defer tls.Free(16)
  15138. *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
  15139. return _istrsenvisxl(tls, mbdst, bp, mbsrc, flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
  15140. }
  15141. func Xstrnvis_netbsd(tls *libc.TLS, mbdst uintptr, _dlen Tsize_t, mbsrc uintptr, flags int32) (r int32) {
  15142. bp := tls.Alloc(16)
  15143. defer tls.Free(16)
  15144. *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
  15145. return _istrsenvisxl(tls, mbdst, bp, mbsrc, flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
  15146. }
  15147. func Xstravis(tls *libc.TLS, mbdstp uintptr, mbsrc uintptr, flags int32) (r int32) {
  15148. var v1 uint32
  15149. _ = v1
  15150. *(*uintptr)(unsafe.Pointer(mbdstp)) = libc.UintptrFromInt32(0)
  15151. if mbsrc != libc.UintptrFromInt32(0) {
  15152. v1 = libc.Xstrlen(tls, mbsrc)
  15153. } else {
  15154. v1 = uint32(0)
  15155. }
  15156. return _istrsenvisx(tls, mbdstp, libc.UintptrFromInt32(0), mbsrc, v1, flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
  15157. }
  15158. /*
  15159. * strvisx - visually encode characters from src into dst
  15160. *
  15161. * Dst must be 4 times the size of src to account for possible
  15162. * expansion. The length of dst, not including the trailing NULL,
  15163. * is returned.
  15164. *
  15165. * Strvisx encodes exactly len characters from src into dst.
  15166. * This is useful for encoding a block of data.
  15167. */
  15168. func Xstrvisx(tls *libc.TLS, mbdst uintptr, mbsrc uintptr, len1 Tsize_t, flags int32) (r int32) {
  15169. return _istrsenvisxna(tls, mbdst, libc.UintptrFromInt32(0), mbsrc, len1, flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
  15170. }
  15171. func Xstrnvisx(tls *libc.TLS, mbdst uintptr, _dlen Tsize_t, mbsrc uintptr, len1 Tsize_t, flags int32) (r int32) {
  15172. bp := tls.Alloc(16)
  15173. defer tls.Free(16)
  15174. *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
  15175. return _istrsenvisxna(tls, mbdst, bp, mbsrc, len1, flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
  15176. }
  15177. func Xstrenvisx(tls *libc.TLS, mbdst uintptr, _dlen Tsize_t, mbsrc uintptr, len1 Tsize_t, flags int32, cerr_ptr uintptr) (r int32) {
  15178. bp := tls.Alloc(16)
  15179. defer tls.Free(16)
  15180. *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
  15181. return _istrsenvisxna(tls, mbdst, bp, mbsrc, len1, flags, __ccgo_ts+53, cerr_ptr)
  15182. }
  15183. // C documentation
  15184. //
  15185. // /*
  15186. // * Appends src to string dst of size siz (unlike wcsncat, siz is the
  15187. // * full size of dst, not space left). At most siz-1 characters
  15188. // * will be copied. Always NUL terminates (unless siz == 0).
  15189. // * Returns wcslen(initial dst) + wcslen(src); if retval >= siz,
  15190. // * truncation occurred.
  15191. // */
  15192. func Xwcslcat(tls *libc.TLS, dst uintptr, src uintptr, siz Tsize_t) (r Tsize_t) {
  15193. var d, s, v3 uintptr
  15194. var dlen, n, v1 Tsize_t
  15195. var v2 bool
  15196. _, _, _, _, _, _, _ = d, dlen, n, s, v1, v2, v3
  15197. d = dst
  15198. s = src
  15199. n = siz
  15200. /* Find the end of dst and adjust bytes left but don't go past end */
  15201. for {
  15202. if v2 = *(*Twchar_t)(unsafe.Pointer(d)) != int32('\000'); v2 {
  15203. v1 = n
  15204. n--
  15205. }
  15206. if !(v2 && v1 != uint32(0)) {
  15207. break
  15208. }
  15209. d += 4
  15210. }
  15211. dlen = libc.Uint32FromInt32((int32(d) - int32(dst)) / 4)
  15212. n = siz - dlen
  15213. if n == uint32(0) {
  15214. return dlen + libc.Xwcslen(tls, s)
  15215. }
  15216. for *(*Twchar_t)(unsafe.Pointer(s)) != int32('\000') {
  15217. if n != uint32(1) {
  15218. v3 = d
  15219. d += 4
  15220. *(*Twchar_t)(unsafe.Pointer(v3)) = *(*Twchar_t)(unsafe.Pointer(s))
  15221. n--
  15222. }
  15223. s += 4
  15224. }
  15225. *(*Twchar_t)(unsafe.Pointer(d)) = int32('\000')
  15226. return dlen + libc.Uint32FromInt32((int32(s)-int32(src))/4) /* count does not include NUL */
  15227. }
  15228. // C documentation
  15229. //
  15230. // /*
  15231. // * Copy src to string dst of size siz. At most siz-1 characters
  15232. // * will be copied. Always NUL terminates (unless siz == 0).
  15233. // * Returns wcslen(src); if retval >= siz, truncation occurred.
  15234. // */
  15235. func Xwcslcpy(tls *libc.TLS, dst uintptr, src uintptr, siz Tsize_t) (r Tsize_t) {
  15236. var d, s, v6, v7, v8 uintptr
  15237. var n, v1, v3 Tsize_t
  15238. var v2 bool
  15239. var v5 Twchar_t
  15240. _, _, _, _, _, _, _, _, _, _ = d, n, s, v1, v2, v3, v5, v6, v7, v8
  15241. d = dst
  15242. s = src
  15243. n = siz
  15244. /* Copy as many bytes as will fit */
  15245. if v2 = n != uint32(0); v2 {
  15246. n--
  15247. v1 = n
  15248. }
  15249. if v2 && v1 != uint32(0) {
  15250. for {
  15251. v6 = s
  15252. s += 4
  15253. v5 = *(*Twchar_t)(unsafe.Pointer(v6))
  15254. v7 = d
  15255. d += 4
  15256. *(*Twchar_t)(unsafe.Pointer(v7)) = v5
  15257. if v5 == 0 {
  15258. break
  15259. }
  15260. goto _4
  15261. _4:
  15262. ;
  15263. n--
  15264. v3 = n
  15265. if !(v3 != uint32(0)) {
  15266. break
  15267. }
  15268. }
  15269. }
  15270. /* Not enough room in dst, add NUL and traverse rest of src */
  15271. if n == uint32(0) {
  15272. if siz != uint32(0) {
  15273. *(*Twchar_t)(unsafe.Pointer(d)) = int32('\000')
  15274. } /* NUL-terminate dst */
  15275. for {
  15276. v8 = s
  15277. s += 4
  15278. if !(*(*Twchar_t)(unsafe.Pointer(v8)) != 0) {
  15279. break
  15280. }
  15281. }
  15282. }
  15283. return libc.Uint32FromInt32((int32(s)-int32(src))/4 - libc.Int32FromInt32(1)) /* count does not include NUL */
  15284. }
  15285. const m_CTL_MAXNAME = 10
  15286. const m_ECHO1 = 0000010
  15287. const m_ECHONL1 = 0000100
  15288. const m_ELFMAG01 = 0x7f
  15289. const m_ELFMAG11 = 'E'
  15290. const m_ELFMAG21 = 'L'
  15291. const m_ELFMAG31 = 'F'
  15292. const m_FIOASYNC = 0x5452
  15293. const m_FIOCLEX = 0x5451
  15294. const m_FIOGETOWN = 0x8903
  15295. const m_FIONBIO = 0x5421
  15296. const m_FIONCLEX = 0x5450
  15297. const m_FIONREAD = 0x541B
  15298. const m_FIOQSIZE = 0x5460
  15299. const m_FIOSETOWN = 0x8901
  15300. const m_GRND_INSECURE = 0x0004
  15301. const m_GRND_NONBLOCK = 1
  15302. const m_GRND_RANDOM = 0x0002
  15303. const m_IOCSIZE_SHIFT = "_IOC_SIZESHIFT"
  15304. const m_MAP_ANON2 = 32
  15305. const m_MAP_PRIVATE2 = 2
  15306. const m_MNT_DETACH = 2
  15307. const m_MNT_EXPIRE = 4
  15308. const m_MNT_FORCE = 1
  15309. const m_MS_BIND = 4096
  15310. const m_MS_DIRSYNC = 128
  15311. const m_MS_MANDLOCK = 64
  15312. const m_MS_MGC_MSK = 0xffff0000
  15313. const m_MS_MGC_VAL = 0xc0ed0000
  15314. const m_MS_MOVE = 8192
  15315. const m_MS_NOATIME = 1024
  15316. const m_MS_NODEV = 4
  15317. const m_MS_NODIRATIME = 2048
  15318. const m_MS_NOEXEC = 8
  15319. const m_MS_NOSUID = 2
  15320. const m_MS_NOSYMFOLLOW = 256
  15321. const m_MS_RDONLY = 1
  15322. const m_MS_REC = 16384
  15323. const m_MS_REMOUNT = 32
  15324. const m_MS_SILENT = 32768
  15325. const m_MS_SYNCHRONOUS = 16
  15326. const m_N_6PACK = 7
  15327. const m_N_AX25 = 5
  15328. const m_N_CAIF = 20
  15329. const m_N_GIGASET_M101 = 16
  15330. const m_N_GSM0710 = 21
  15331. const m_N_HCI = 15
  15332. const m_N_HDLC = 13
  15333. const m_N_IRDA = 11
  15334. const m_N_MASC = 8
  15335. const m_N_MOUSE = 2
  15336. const m_N_NCI = 25
  15337. const m_N_NULL = 27
  15338. const m_N_PPP = 3
  15339. const m_N_PPS = 18
  15340. const m_N_PROFIBUS_FDL = 10
  15341. const m_N_R3964 = 9
  15342. const m_N_SLCAN = 17
  15343. const m_N_SLIP = 1
  15344. const m_N_SMSBLOCK = 12
  15345. const m_N_SPEAKUP = 26
  15346. const m_N_STRIP = 4
  15347. const m_N_SYNC_PPP = 14
  15348. const m_N_TI_WL = 22
  15349. const m_N_TRACEROUTER = 24
  15350. const m_N_TRACESINK = 23
  15351. const m_N_TTY = 0
  15352. const m_N_V253 = 19
  15353. const m_N_X25 = 6
  15354. const m_O_CLOEXEC1 = 524288
  15355. const m_O_NOFOLLOW1 = 131072
  15356. const m_O_RDONLY3 = 0
  15357. const m_O_RDWR2 = 02
  15358. const m_REPEAT = 5
  15359. const m_SHA256_BLOCK_LENGTH = 64
  15360. const m_SHA256_DIGEST_LENGTH = 32
  15361. const m_SHA384_BLOCK_LENGTH = 128
  15362. const m_SHA384_DIGEST_LENGTH = 48
  15363. const m_SHA384_Data = "SHA384Data"
  15364. const m_SHA384_End = "SHA384End"
  15365. const m_SHA384_File = "SHA384File"
  15366. const m_SHA384_FileChunk = "SHA384FileChunk"
  15367. const m_SHA384_Final = "SHA384Final"
  15368. const m_SHA384_Init = "SHA384Init"
  15369. const m_SHA384_Update = "SHA384Update"
  15370. const m_SHA512_BLOCK_LENGTH = 128
  15371. const m_SHA512_DIGEST_LENGTH = 64
  15372. const m_SHA512_Data = "SHA512Data"
  15373. const m_SHA512_End = "SHA512End"
  15374. const m_SHA512_File = "SHA512File"
  15375. const m_SHA512_FileChunk = "SHA512FileChunk"
  15376. const m_SHA512_Final = "SHA512Final"
  15377. const m_SHA512_Init = "SHA512Init"
  15378. const m_SHA512_Update = "SHA512Update"
  15379. const m_SHN_ABS1 = 0xfff1
  15380. const m_SHN_COMMON1 = 0xfff2
  15381. const m_SIOCADDDLCI = 0x8980
  15382. const m_SIOCADDMULTI = 0x8931
  15383. const m_SIOCADDRT = 0x890B
  15384. const m_SIOCATMARK = 0x8905
  15385. const m_SIOCDARP = 0x8953
  15386. const m_SIOCDELDLCI = 0x8981
  15387. const m_SIOCDELMULTI = 0x8932
  15388. const m_SIOCDELRT = 0x890C
  15389. const m_SIOCDEVPRIVATE = 0x89F0
  15390. const m_SIOCDIFADDR = 0x8936
  15391. const m_SIOCDRARP = 0x8960
  15392. const m_SIOCGARP = 0x8954
  15393. const m_SIOCGIFADDR = 0x8915
  15394. const m_SIOCGIFBR = 0x8940
  15395. const m_SIOCGIFBRDADDR = 0x8919
  15396. const m_SIOCGIFCONF = 0x8912
  15397. const m_SIOCGIFCOUNT = 0x8938
  15398. const m_SIOCGIFDSTADDR = 0x8917
  15399. const m_SIOCGIFENCAP = 0x8925
  15400. const m_SIOCGIFFLAGS = 0x8913
  15401. const m_SIOCGIFHWADDR = 0x8927
  15402. const m_SIOCGIFINDEX = 0x8933
  15403. const m_SIOCGIFMAP = 0x8970
  15404. const m_SIOCGIFMEM = 0x891f
  15405. const m_SIOCGIFMETRIC = 0x891d
  15406. const m_SIOCGIFMTU = 0x8921
  15407. const m_SIOCGIFNAME = 0x8910
  15408. const m_SIOCGIFNETMASK = 0x891b
  15409. const m_SIOCGIFPFLAGS = 0x8935
  15410. const m_SIOCGIFSLAVE = 0x8929
  15411. const m_SIOCGIFTXQLEN = 0x8942
  15412. const m_SIOCGPGRP = 0x8904
  15413. const m_SIOCGRARP = 0x8961
  15414. const m_SIOCPROTOPRIVATE = 0x89E0
  15415. const m_SIOCRTMSG = 0x890D
  15416. const m_SIOCSARP = 0x8955
  15417. const m_SIOCSIFADDR = 0x8916
  15418. const m_SIOCSIFBR = 0x8941
  15419. const m_SIOCSIFBRDADDR = 0x891a
  15420. const m_SIOCSIFDSTADDR = 0x8918
  15421. const m_SIOCSIFENCAP = 0x8926
  15422. const m_SIOCSIFFLAGS = 0x8914
  15423. const m_SIOCSIFHWADDR = 0x8924
  15424. const m_SIOCSIFHWBROADCAST = 0x8937
  15425. const m_SIOCSIFLINK = 0x8911
  15426. const m_SIOCSIFMAP = 0x8971
  15427. const m_SIOCSIFMEM = 0x8920
  15428. const m_SIOCSIFMETRIC = 0x891e
  15429. const m_SIOCSIFMTU = 0x8922
  15430. const m_SIOCSIFNAME = 0x8923
  15431. const m_SIOCSIFNETMASK = 0x891c
  15432. const m_SIOCSIFPFLAGS = 0x8934
  15433. const m_SIOCSIFSLAVE = 0x8930
  15434. const m_SIOCSIFTXQLEN = 0x8943
  15435. const m_SIOCSPGRP = 0x8902
  15436. const m_SIOCSRARP = 0x8962
  15437. const m_SIOGIFINDEX = "SIOCGIFINDEX"
  15438. const m_ST_APPEND = 256
  15439. const m_ST_IMMUTABLE = 512
  15440. const m_ST_MANDLOCK = 64
  15441. const m_ST_NOATIME = 1024
  15442. const m_ST_NODEV = 4
  15443. const m_ST_NODIRATIME = 2048
  15444. const m_ST_NOEXEC = 8
  15445. const m_ST_NOSUID = 2
  15446. const m_ST_RDONLY = 1
  15447. const m_ST_RELATIME = 4096
  15448. const m_ST_SYNCHRONOUS = 16
  15449. const m_ST_WRITE = 128
  15450. const m_S_IFCHR3 = 8192
  15451. const m_S_IFIFO3 = 4096
  15452. const m_S_IFMT3 = 61440
  15453. const m_S_IFREG3 = 32768
  15454. const m_S_IFSOCK3 = 49152
  15455. const m_TCFLSH = 0x540B
  15456. const m_TCGETA = 0x5405
  15457. const m_TCGETS = 0x5401
  15458. const m_TCGETX = 0x5432
  15459. const m_TCSBRK = 0x5409
  15460. const m_TCSBRKP = 0x5425
  15461. const m_TCSETA = 0x5406
  15462. const m_TCSETAF = 0x5408
  15463. const m_TCSETAW = 0x5407
  15464. const m_TCSETS = 0x5402
  15465. const m_TCSETSF = 0x5404
  15466. const m_TCSETSW = 0x5403
  15467. const m_TCSETX = 0x5433
  15468. const m_TCSETXF = 0x5434
  15469. const m_TCSETXW = 0x5435
  15470. const m_TCXONC = 0x540A
  15471. const m_TIOCCBRK = 0x5428
  15472. const m_TIOCCONS = 0x541D
  15473. const m_TIOCEXCL = 0x540C
  15474. const m_TIOCGDEV = 0x80045432
  15475. const m_TIOCGETD = 0x5424
  15476. const m_TIOCGEXCL = 0x80045440
  15477. const m_TIOCGICOUNT = 0x545D
  15478. const m_TIOCGISO7816 = 0x80285442
  15479. const m_TIOCGLCKTRMIOS = 0x5456
  15480. const m_TIOCGPGRP = 0x540F
  15481. const m_TIOCGPKT = 0x80045438
  15482. const m_TIOCGPTLCK = 0x80045439
  15483. const m_TIOCGPTN = 0x80045430
  15484. const m_TIOCGPTPEER = 0x5441
  15485. const m_TIOCGRS485 = 0x542E
  15486. const m_TIOCGSERIAL = 0x541E
  15487. const m_TIOCGSID = 0x5429
  15488. const m_TIOCGSOFTCAR = 0x5419
  15489. const m_TIOCGWINSZ = 0x5413
  15490. const m_TIOCINQ = "FIONREAD"
  15491. const m_TIOCLINUX = 0x541C
  15492. const m_TIOCMBIC = 0x5417
  15493. const m_TIOCMBIS = 0x5416
  15494. const m_TIOCMGET = 0x5415
  15495. const m_TIOCMIWAIT = 0x545C
  15496. const m_TIOCMSET = 0x5418
  15497. const m_TIOCM_CAR = 0x040
  15498. const m_TIOCM_CD = "TIOCM_CAR"
  15499. const m_TIOCM_CTS = 0x020
  15500. const m_TIOCM_DSR = 0x100
  15501. const m_TIOCM_DTR = 0x002
  15502. const m_TIOCM_LE = 0x001
  15503. const m_TIOCM_LOOP = 0x8000
  15504. const m_TIOCM_OUT1 = 0x2000
  15505. const m_TIOCM_OUT2 = 0x4000
  15506. const m_TIOCM_RI = "TIOCM_RNG"
  15507. const m_TIOCM_RNG = 0x080
  15508. const m_TIOCM_RTS = 0x004
  15509. const m_TIOCM_SR = 0x010
  15510. const m_TIOCM_ST = 0x008
  15511. const m_TIOCNOTTY = 0x5422
  15512. const m_TIOCNXCL = 0x540D
  15513. const m_TIOCOUTQ = 0x5411
  15514. const m_TIOCPKT = 0x5420
  15515. const m_TIOCPKT_DATA = 0
  15516. const m_TIOCPKT_DOSTOP = 32
  15517. const m_TIOCPKT_FLUSHREAD = 1
  15518. const m_TIOCPKT_FLUSHWRITE = 2
  15519. const m_TIOCPKT_IOCTL = 64
  15520. const m_TIOCPKT_NOSTOP = 16
  15521. const m_TIOCPKT_START = 8
  15522. const m_TIOCPKT_STOP = 4
  15523. const m_TIOCSBRK = 0x5427
  15524. const m_TIOCSCTTY = 0x540E
  15525. const m_TIOCSERCONFIG = 0x5453
  15526. const m_TIOCSERGETLSR = 0x5459
  15527. const m_TIOCSERGETMULTI = 0x545A
  15528. const m_TIOCSERGSTRUCT = 0x5458
  15529. const m_TIOCSERGWILD = 0x5454
  15530. const m_TIOCSERSETMULTI = 0x545B
  15531. const m_TIOCSERSWILD = 0x5455
  15532. const m_TIOCSER_TEMT = 1
  15533. const m_TIOCSETD = 0x5423
  15534. const m_TIOCSIG = 0x40045436
  15535. const m_TIOCSISO7816 = 0xc0285443
  15536. const m_TIOCSLCKTRMIOS = 0x5457
  15537. const m_TIOCSPGRP = 0x5410
  15538. const m_TIOCSPTLCK = 0x40045431
  15539. const m_TIOCSRS485 = 0x542F
  15540. const m_TIOCSSERIAL = 0x541F
  15541. const m_TIOCSSOFTCAR = 0x541A
  15542. const m_TIOCSTI = 0x5412
  15543. const m_TIOCSWINSZ = 0x5414
  15544. const m_TIOCVHANGUP = 0x5437
  15545. const m_UMOUNT_NOFOLLOW = 8
  15546. const m__IOC_DIRBITS = 2
  15547. const m__IOC_NONE = 0
  15548. const m__IOC_NRBITS = 8
  15549. const m__IOC_NRSHIFT = 0
  15550. const m__IOC_READ = 2
  15551. const m__IOC_SIZEBITS = 14
  15552. const m__IOC_TYPEBITS = 8
  15553. const m__IOC_WRITE = 1
  15554. const m__POSIX_C_SOURCE = 199309
  15555. const m___BITS_PER_LONG = 32
  15556. const m___bitwise__ = "__bitwise"
  15557. type t__s8 = int8
  15558. type t__u8 = uint8
  15559. type t__s16 = int16
  15560. type t__u16 = uint16
  15561. type t__s32 = int32
  15562. type t__u32 = uint32
  15563. type t__s64 = int64
  15564. type t__u64 = uint64
  15565. type t__kernel_fd_set = struct {
  15566. Ffds_bits [32]uint32
  15567. }
  15568. type t__kernel_sighandler_t = uintptr
  15569. type t__kernel_key_t = int32
  15570. type t__kernel_mqd_t = int32
  15571. type t__kernel_mode_t = uint16
  15572. type t__kernel_ipc_pid_t = uint16
  15573. type t__kernel_uid_t = uint16
  15574. type t__kernel_gid_t = uint16
  15575. type t__kernel_old_dev_t = uint16
  15576. type t__kernel_long_t = int32
  15577. type t__kernel_ulong_t = uint32
  15578. type t__kernel_ino_t = uint32
  15579. type t__kernel_pid_t = int32
  15580. type t__kernel_suseconds_t = int32
  15581. type t__kernel_daddr_t = int32
  15582. type t__kernel_uid32_t = uint32
  15583. type t__kernel_gid32_t = uint32
  15584. type t__kernel_old_uid_t = uint16
  15585. type t__kernel_old_gid_t = uint16
  15586. type t__kernel_size_t = uint32
  15587. type t__kernel_ssize_t = int32
  15588. type t__kernel_ptrdiff_t = int32
  15589. type t__kernel_fsid_t = struct {
  15590. Fval [2]int32
  15591. }
  15592. type t__kernel_off_t = int32
  15593. type t__kernel_loff_t = int64
  15594. type t__kernel_old_time_t = int32
  15595. type t__kernel_time_t = int32
  15596. type t__kernel_time64_t = int64
  15597. type t__kernel_clock_t = int32
  15598. type t__kernel_timer_t = int32
  15599. type t__kernel_clockid_t = int32
  15600. type t__kernel_caddr_t = uintptr
  15601. type t__kernel_uid16_t = uint16
  15602. type t__kernel_gid16_t = uint16
  15603. type t__le16 = uint16
  15604. type t__be16 = uint16
  15605. type t__le32 = uint32
  15606. type t__be32 = uint32
  15607. type t__le64 = uint64
  15608. type t__be64 = uint64
  15609. type t__sum16 = uint16
  15610. type t__wsum = uint32
  15611. type t__poll_t = uint32
  15612. type t__sysctl_args = struct {
  15613. Fname uintptr
  15614. Fnlen int32
  15615. Foldval uintptr
  15616. Foldlenp uintptr
  15617. Fnewval uintptr
  15618. Fnewlen Tsize_t
  15619. F__unused [4]uint32
  15620. }
  15621. const _CTL_KERN = 1
  15622. const _CTL_VM = 2
  15623. const _CTL_NET = 3
  15624. const _CTL_PROC = 4
  15625. const _CTL_FS = 5
  15626. const _CTL_DEBUG = 6
  15627. const _CTL_DEV = 7
  15628. const _CTL_BUS = 8
  15629. const _CTL_ABI = 9
  15630. const _CTL_CPU = 10
  15631. const _CTL_ARLAN = 254
  15632. const _CTL_S390DBF = 5677
  15633. const _CTL_SUNRPC = 7249
  15634. const _CTL_PM = 9899
  15635. const _CTL_FRV = 9898
  15636. const _CTL_BUS_ISA = 1
  15637. const _INOTIFY_MAX_USER_INSTANCES = 1
  15638. const _INOTIFY_MAX_USER_WATCHES = 2
  15639. const _INOTIFY_MAX_QUEUED_EVENTS = 3
  15640. const _KERN_OSTYPE = 1
  15641. const _KERN_OSRELEASE = 2
  15642. const _KERN_OSREV = 3
  15643. const _KERN_VERSION = 4
  15644. const _KERN_SECUREMASK = 5
  15645. const _KERN_PROF = 6
  15646. const _KERN_NODENAME = 7
  15647. const _KERN_DOMAINNAME = 8
  15648. const _KERN_PANIC = 15
  15649. const _KERN_REALROOTDEV = 16
  15650. const _KERN_SPARC_REBOOT = 21
  15651. const _KERN_CTLALTDEL = 22
  15652. const _KERN_PRINTK = 23
  15653. const _KERN_NAMETRANS = 24
  15654. const _KERN_PPC_HTABRECLAIM = 25
  15655. const _KERN_PPC_ZEROPAGED = 26
  15656. const _KERN_PPC_POWERSAVE_NAP = 27
  15657. const _KERN_MODPROBE = 28
  15658. const _KERN_SG_BIG_BUFF = 29
  15659. const _KERN_ACCT = 30
  15660. const _KERN_PPC_L2CR = 31
  15661. const _KERN_RTSIGNR = 32
  15662. const _KERN_RTSIGMAX = 33
  15663. const _KERN_SHMMAX = 34
  15664. const _KERN_MSGMAX = 35
  15665. const _KERN_MSGMNB = 36
  15666. const _KERN_MSGPOOL = 37
  15667. const _KERN_SYSRQ = 38
  15668. const _KERN_MAX_THREADS = 39
  15669. const _KERN_RANDOM = 40
  15670. const _KERN_SHMALL = 41
  15671. const _KERN_MSGMNI = 42
  15672. const _KERN_SEM = 43
  15673. const _KERN_SPARC_STOP_A = 44
  15674. const _KERN_SHMMNI = 45
  15675. const _KERN_OVERFLOWUID = 46
  15676. const _KERN_OVERFLOWGID = 47
  15677. const _KERN_SHMPATH = 48
  15678. const _KERN_HOTPLUG = 49
  15679. const _KERN_IEEE_EMULATION_WARNINGS = 50
  15680. const _KERN_S390_USER_DEBUG_LOGGING = 51
  15681. const _KERN_CORE_USES_PID = 52
  15682. const _KERN_TAINTED = 53
  15683. const _KERN_CADPID = 54
  15684. const _KERN_PIDMAX = 55
  15685. const _KERN_CORE_PATTERN = 56
  15686. const _KERN_PANIC_ON_OOPS = 57
  15687. const _KERN_HPPA_PWRSW = 58
  15688. const _KERN_HPPA_UNALIGNED = 59
  15689. const _KERN_PRINTK_RATELIMIT = 60
  15690. const _KERN_PRINTK_RATELIMIT_BURST = 61
  15691. const _KERN_PTY = 62
  15692. const _KERN_NGROUPS_MAX = 63
  15693. const _KERN_SPARC_SCONS_PWROFF = 64
  15694. const _KERN_HZ_TIMER = 65
  15695. const _KERN_UNKNOWN_NMI_PANIC = 66
  15696. const _KERN_BOOTLOADER_TYPE = 67
  15697. const _KERN_RANDOMIZE = 68
  15698. const _KERN_SETUID_DUMPABLE = 69
  15699. const _KERN_SPIN_RETRY = 70
  15700. const _KERN_ACPI_VIDEO_FLAGS = 71
  15701. const _KERN_IA64_UNALIGNED = 72
  15702. const _KERN_COMPAT_LOG = 73
  15703. const _KERN_MAX_LOCK_DEPTH = 74
  15704. const _KERN_NMI_WATCHDOG = 75
  15705. const _KERN_PANIC_ON_NMI = 76
  15706. const _KERN_PANIC_ON_WARN = 77
  15707. const _KERN_PANIC_PRINT = 78
  15708. const _VM_UNUSED1 = 1
  15709. const _VM_UNUSED2 = 2
  15710. const _VM_UNUSED3 = 3
  15711. const _VM_UNUSED4 = 4
  15712. const _VM_OVERCOMMIT_MEMORY = 5
  15713. const _VM_UNUSED5 = 6
  15714. const _VM_UNUSED7 = 7
  15715. const _VM_UNUSED8 = 8
  15716. const _VM_UNUSED9 = 9
  15717. const _VM_PAGE_CLUSTER = 10
  15718. const _VM_DIRTY_BACKGROUND = 11
  15719. const _VM_DIRTY_RATIO = 12
  15720. const _VM_DIRTY_WB_CS = 13
  15721. const _VM_DIRTY_EXPIRE_CS = 14
  15722. const _VM_NR_PDFLUSH_THREADS = 15
  15723. const _VM_OVERCOMMIT_RATIO = 16
  15724. const _VM_PAGEBUF = 17
  15725. const _VM_HUGETLB_PAGES = 18
  15726. const _VM_SWAPPINESS = 19
  15727. const _VM_LOWMEM_RESERVE_RATIO = 20
  15728. const _VM_MIN_FREE_KBYTES = 21
  15729. const _VM_MAX_MAP_COUNT = 22
  15730. const _VM_LAPTOP_MODE = 23
  15731. const _VM_BLOCK_DUMP = 24
  15732. const _VM_HUGETLB_GROUP = 25
  15733. const _VM_VFS_CACHE_PRESSURE = 26
  15734. const _VM_LEGACY_VA_LAYOUT = 27
  15735. const _VM_SWAP_TOKEN_TIMEOUT = 28
  15736. const _VM_DROP_PAGECACHE = 29
  15737. const _VM_PERCPU_PAGELIST_FRACTION = 30
  15738. const _VM_ZONE_RECLAIM_MODE = 31
  15739. const _VM_MIN_UNMAPPED = 32
  15740. const _VM_PANIC_ON_OOM = 33
  15741. const _VM_VDSO_ENABLED = 34
  15742. const _VM_MIN_SLAB = 35
  15743. const _NET_CORE = 1
  15744. const _NET_ETHER = 2
  15745. const _NET_802 = 3
  15746. const _NET_UNIX = 4
  15747. const _NET_IPV4 = 5
  15748. const _NET_IPX = 6
  15749. const _NET_ATALK = 7
  15750. const _NET_NETROM = 8
  15751. const _NET_AX25 = 9
  15752. const _NET_BRIDGE = 10
  15753. const _NET_ROSE = 11
  15754. const _NET_IPV6 = 12
  15755. const _NET_X25 = 13
  15756. const _NET_TR = 14
  15757. const _NET_DECNET = 15
  15758. const _NET_ECONET = 16
  15759. const _NET_SCTP = 17
  15760. const _NET_LLC = 18
  15761. const _NET_NETFILTER = 19
  15762. const _NET_DCCP = 20
  15763. const _NET_IRDA = 412
  15764. const _RANDOM_POOLSIZE = 1
  15765. const _RANDOM_ENTROPY_COUNT = 2
  15766. const _RANDOM_READ_THRESH = 3
  15767. const _RANDOM_WRITE_THRESH = 4
  15768. const _RANDOM_BOOT_ID = 5
  15769. const _RANDOM_UUID = 6
  15770. const _PTY_MAX = 1
  15771. const _PTY_NR = 2
  15772. const _BUS_ISA_MEM_BASE = 1
  15773. const _BUS_ISA_PORT_BASE = 2
  15774. const _BUS_ISA_PORT_SHIFT = 3
  15775. const _NET_CORE_WMEM_MAX = 1
  15776. const _NET_CORE_RMEM_MAX = 2
  15777. const _NET_CORE_WMEM_DEFAULT = 3
  15778. const _NET_CORE_RMEM_DEFAULT = 4
  15779. const _NET_CORE_MAX_BACKLOG = 6
  15780. const _NET_CORE_FASTROUTE = 7
  15781. const _NET_CORE_MSG_COST = 8
  15782. const _NET_CORE_MSG_BURST = 9
  15783. const _NET_CORE_OPTMEM_MAX = 10
  15784. const _NET_CORE_HOT_LIST_LENGTH = 11
  15785. const _NET_CORE_DIVERT_VERSION = 12
  15786. const _NET_CORE_NO_CONG_THRESH = 13
  15787. const _NET_CORE_NO_CONG = 14
  15788. const _NET_CORE_LO_CONG = 15
  15789. const _NET_CORE_MOD_CONG = 16
  15790. const _NET_CORE_DEV_WEIGHT = 17
  15791. const _NET_CORE_SOMAXCONN = 18
  15792. const _NET_CORE_BUDGET = 19
  15793. const _NET_CORE_AEVENT_ETIME = 20
  15794. const _NET_CORE_AEVENT_RSEQTH = 21
  15795. const _NET_CORE_WARNINGS = 22
  15796. const _NET_UNIX_DESTROY_DELAY = 1
  15797. const _NET_UNIX_DELETE_DELAY = 2
  15798. const _NET_UNIX_MAX_DGRAM_QLEN = 3
  15799. const _NET_NF_CONNTRACK_MAX = 1
  15800. const _NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT = 2
  15801. const _NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV = 3
  15802. const _NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED = 4
  15803. const _NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT = 5
  15804. const _NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT = 6
  15805. const _NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK = 7
  15806. const _NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT = 8
  15807. const _NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE = 9
  15808. const _NET_NF_CONNTRACK_UDP_TIMEOUT = 10
  15809. const _NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM = 11
  15810. const _NET_NF_CONNTRACK_ICMP_TIMEOUT = 12
  15811. const _NET_NF_CONNTRACK_GENERIC_TIMEOUT = 13
  15812. const _NET_NF_CONNTRACK_BUCKETS = 14
  15813. const _NET_NF_CONNTRACK_LOG_INVALID = 15
  15814. const _NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS = 16
  15815. const _NET_NF_CONNTRACK_TCP_LOOSE = 17
  15816. const _NET_NF_CONNTRACK_TCP_BE_LIBERAL = 18
  15817. const _NET_NF_CONNTRACK_TCP_MAX_RETRANS = 19
  15818. const _NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED = 20
  15819. const _NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT = 21
  15820. const _NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED = 22
  15821. const _NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED = 23
  15822. const _NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT = 24
  15823. const _NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD = 25
  15824. const _NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT = 26
  15825. const _NET_NF_CONNTRACK_COUNT = 27
  15826. const _NET_NF_CONNTRACK_ICMPV6_TIMEOUT = 28
  15827. const _NET_NF_CONNTRACK_FRAG6_TIMEOUT = 29
  15828. const _NET_NF_CONNTRACK_FRAG6_LOW_THRESH = 30
  15829. const _NET_NF_CONNTRACK_FRAG6_HIGH_THRESH = 31
  15830. const _NET_NF_CONNTRACK_CHECKSUM = 32
  15831. const _NET_IPV4_FORWARD = 8
  15832. const _NET_IPV4_DYNADDR = 9
  15833. const _NET_IPV4_CONF = 16
  15834. const _NET_IPV4_NEIGH = 17
  15835. const _NET_IPV4_ROUTE = 18
  15836. const _NET_IPV4_FIB_HASH = 19
  15837. const _NET_IPV4_NETFILTER = 20
  15838. const _NET_IPV4_TCP_TIMESTAMPS = 33
  15839. const _NET_IPV4_TCP_WINDOW_SCALING = 34
  15840. const _NET_IPV4_TCP_SACK = 35
  15841. const _NET_IPV4_TCP_RETRANS_COLLAPSE = 36
  15842. const _NET_IPV4_DEFAULT_TTL = 37
  15843. const _NET_IPV4_AUTOCONFIG = 38
  15844. const _NET_IPV4_NO_PMTU_DISC = 39
  15845. const _NET_IPV4_TCP_SYN_RETRIES = 40
  15846. const _NET_IPV4_IPFRAG_HIGH_THRESH = 41
  15847. const _NET_IPV4_IPFRAG_LOW_THRESH = 42
  15848. const _NET_IPV4_IPFRAG_TIME = 43
  15849. const _NET_IPV4_TCP_MAX_KA_PROBES = 44
  15850. const _NET_IPV4_TCP_KEEPALIVE_TIME = 45
  15851. const _NET_IPV4_TCP_KEEPALIVE_PROBES = 46
  15852. const _NET_IPV4_TCP_RETRIES1 = 47
  15853. const _NET_IPV4_TCP_RETRIES2 = 48
  15854. const _NET_IPV4_TCP_FIN_TIMEOUT = 49
  15855. const _NET_IPV4_IP_MASQ_DEBUG = 50
  15856. const _NET_TCP_SYNCOOKIES = 51
  15857. const _NET_TCP_STDURG = 52
  15858. const _NET_TCP_RFC1337 = 53
  15859. const _NET_TCP_SYN_TAILDROP = 54
  15860. const _NET_TCP_MAX_SYN_BACKLOG = 55
  15861. const _NET_IPV4_LOCAL_PORT_RANGE = 56
  15862. const _NET_IPV4_ICMP_ECHO_IGNORE_ALL = 57
  15863. const _NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS = 58
  15864. const _NET_IPV4_ICMP_SOURCEQUENCH_RATE = 59
  15865. const _NET_IPV4_ICMP_DESTUNREACH_RATE = 60
  15866. const _NET_IPV4_ICMP_TIMEEXCEED_RATE = 61
  15867. const _NET_IPV4_ICMP_PARAMPROB_RATE = 62
  15868. const _NET_IPV4_ICMP_ECHOREPLY_RATE = 63
  15869. const _NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES = 64
  15870. const _NET_IPV4_IGMP_MAX_MEMBERSHIPS = 65
  15871. const _NET_TCP_TW_RECYCLE = 66
  15872. const _NET_IPV4_ALWAYS_DEFRAG = 67
  15873. const _NET_IPV4_TCP_KEEPALIVE_INTVL = 68
  15874. const _NET_IPV4_INET_PEER_THRESHOLD = 69
  15875. const _NET_IPV4_INET_PEER_MINTTL = 70
  15876. const _NET_IPV4_INET_PEER_MAXTTL = 71
  15877. const _NET_IPV4_INET_PEER_GC_MINTIME = 72
  15878. const _NET_IPV4_INET_PEER_GC_MAXTIME = 73
  15879. const _NET_TCP_ORPHAN_RETRIES = 74
  15880. const _NET_TCP_ABORT_ON_OVERFLOW = 75
  15881. const _NET_TCP_SYNACK_RETRIES = 76
  15882. const _NET_TCP_MAX_ORPHANS = 77
  15883. const _NET_TCP_MAX_TW_BUCKETS = 78
  15884. const _NET_TCP_FACK = 79
  15885. const _NET_TCP_REORDERING = 80
  15886. const _NET_TCP_ECN = 81
  15887. const _NET_TCP_DSACK = 82
  15888. const _NET_TCP_MEM = 83
  15889. const _NET_TCP_WMEM = 84
  15890. const _NET_TCP_RMEM = 85
  15891. const _NET_TCP_APP_WIN = 86
  15892. const _NET_TCP_ADV_WIN_SCALE = 87
  15893. const _NET_IPV4_NONLOCAL_BIND = 88
  15894. const _NET_IPV4_ICMP_RATELIMIT = 89
  15895. const _NET_IPV4_ICMP_RATEMASK = 90
  15896. const _NET_TCP_TW_REUSE = 91
  15897. const _NET_TCP_FRTO = 92
  15898. const _NET_TCP_LOW_LATENCY = 93
  15899. const _NET_IPV4_IPFRAG_SECRET_INTERVAL = 94
  15900. const _NET_IPV4_IGMP_MAX_MSF = 96
  15901. const _NET_TCP_NO_METRICS_SAVE = 97
  15902. const _NET_TCP_DEFAULT_WIN_SCALE = 105
  15903. const _NET_TCP_MODERATE_RCVBUF = 106
  15904. const _NET_TCP_TSO_WIN_DIVISOR = 107
  15905. const _NET_TCP_BIC_BETA = 108
  15906. const _NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR = 109
  15907. const _NET_TCP_CONG_CONTROL = 110
  15908. const _NET_TCP_ABC = 111
  15909. const _NET_IPV4_IPFRAG_MAX_DIST = 112
  15910. const _NET_TCP_MTU_PROBING = 113
  15911. const _NET_TCP_BASE_MSS = 114
  15912. const _NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS = 115
  15913. const _NET_TCP_DMA_COPYBREAK = 116
  15914. const _NET_TCP_SLOW_START_AFTER_IDLE = 117
  15915. const _NET_CIPSOV4_CACHE_ENABLE = 118
  15916. const _NET_CIPSOV4_CACHE_BUCKET_SIZE = 119
  15917. const _NET_CIPSOV4_RBM_OPTFMT = 120
  15918. const _NET_CIPSOV4_RBM_STRICTVALID = 121
  15919. const _NET_TCP_AVAIL_CONG_CONTROL = 122
  15920. const _NET_TCP_ALLOWED_CONG_CONTROL = 123
  15921. const _NET_TCP_MAX_SSTHRESH = 124
  15922. const _NET_TCP_FRTO_RESPONSE = 125
  15923. const _NET_IPV4_ROUTE_FLUSH = 1
  15924. const _NET_IPV4_ROUTE_MIN_DELAY = 2
  15925. const _NET_IPV4_ROUTE_MAX_DELAY = 3
  15926. const _NET_IPV4_ROUTE_GC_THRESH = 4
  15927. const _NET_IPV4_ROUTE_MAX_SIZE = 5
  15928. const _NET_IPV4_ROUTE_GC_MIN_INTERVAL = 6
  15929. const _NET_IPV4_ROUTE_GC_TIMEOUT = 7
  15930. const _NET_IPV4_ROUTE_GC_INTERVAL = 8
  15931. const _NET_IPV4_ROUTE_REDIRECT_LOAD = 9
  15932. const _NET_IPV4_ROUTE_REDIRECT_NUMBER = 10
  15933. const _NET_IPV4_ROUTE_REDIRECT_SILENCE = 11
  15934. const _NET_IPV4_ROUTE_ERROR_COST = 12
  15935. const _NET_IPV4_ROUTE_ERROR_BURST = 13
  15936. const _NET_IPV4_ROUTE_GC_ELASTICITY = 14
  15937. const _NET_IPV4_ROUTE_MTU_EXPIRES = 15
  15938. const _NET_IPV4_ROUTE_MIN_PMTU = 16
  15939. const _NET_IPV4_ROUTE_MIN_ADVMSS = 17
  15940. const _NET_IPV4_ROUTE_SECRET_INTERVAL = 18
  15941. const _NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS = 19
  15942. const _NET_PROTO_CONF_ALL = -2
  15943. const _NET_PROTO_CONF_DEFAULT = -3
  15944. const _NET_IPV4_CONF_FORWARDING = 1
  15945. const _NET_IPV4_CONF_MC_FORWARDING = 2
  15946. const _NET_IPV4_CONF_PROXY_ARP = 3
  15947. const _NET_IPV4_CONF_ACCEPT_REDIRECTS = 4
  15948. const _NET_IPV4_CONF_SECURE_REDIRECTS = 5
  15949. const _NET_IPV4_CONF_SEND_REDIRECTS = 6
  15950. const _NET_IPV4_CONF_SHARED_MEDIA = 7
  15951. const _NET_IPV4_CONF_RP_FILTER = 8
  15952. const _NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE = 9
  15953. const _NET_IPV4_CONF_BOOTP_RELAY = 10
  15954. const _NET_IPV4_CONF_LOG_MARTIANS = 11
  15955. const _NET_IPV4_CONF_TAG = 12
  15956. const _NET_IPV4_CONF_ARPFILTER = 13
  15957. const _NET_IPV4_CONF_MEDIUM_ID = 14
  15958. const _NET_IPV4_CONF_NOXFRM = 15
  15959. const _NET_IPV4_CONF_NOPOLICY = 16
  15960. const _NET_IPV4_CONF_FORCE_IGMP_VERSION = 17
  15961. const _NET_IPV4_CONF_ARP_ANNOUNCE = 18
  15962. const _NET_IPV4_CONF_ARP_IGNORE = 19
  15963. const _NET_IPV4_CONF_PROMOTE_SECONDARIES = 20
  15964. const _NET_IPV4_CONF_ARP_ACCEPT = 21
  15965. const _NET_IPV4_CONF_ARP_NOTIFY = 22
  15966. const _NET_IPV4_CONF_ARP_EVICT_NOCARRIER = 23
  15967. const _NET_IPV4_NF_CONNTRACK_MAX = 1
  15968. const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT = 2
  15969. const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV = 3
  15970. const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED = 4
  15971. const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT = 5
  15972. const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT = 6
  15973. const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK = 7
  15974. const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT = 8
  15975. const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE = 9
  15976. const _NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT = 10
  15977. const _NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM = 11
  15978. const _NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT = 12
  15979. const _NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT = 13
  15980. const _NET_IPV4_NF_CONNTRACK_BUCKETS = 14
  15981. const _NET_IPV4_NF_CONNTRACK_LOG_INVALID = 15
  15982. const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS = 16
  15983. const _NET_IPV4_NF_CONNTRACK_TCP_LOOSE = 17
  15984. const _NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL = 18
  15985. const _NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS = 19
  15986. const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED = 20
  15987. const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT = 21
  15988. const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED = 22
  15989. const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED = 23
  15990. const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT = 24
  15991. const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD = 25
  15992. const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT = 26
  15993. const _NET_IPV4_NF_CONNTRACK_COUNT = 27
  15994. const _NET_IPV4_NF_CONNTRACK_CHECKSUM = 28
  15995. const _NET_IPV6_CONF = 16
  15996. const _NET_IPV6_NEIGH = 17
  15997. const _NET_IPV6_ROUTE = 18
  15998. const _NET_IPV6_ICMP = 19
  15999. const _NET_IPV6_BINDV6ONLY = 20
  16000. const _NET_IPV6_IP6FRAG_HIGH_THRESH = 21
  16001. const _NET_IPV6_IP6FRAG_LOW_THRESH = 22
  16002. const _NET_IPV6_IP6FRAG_TIME = 23
  16003. const _NET_IPV6_IP6FRAG_SECRET_INTERVAL = 24
  16004. const _NET_IPV6_MLD_MAX_MSF = 25
  16005. const _NET_IPV6_ROUTE_FLUSH = 1
  16006. const _NET_IPV6_ROUTE_GC_THRESH = 2
  16007. const _NET_IPV6_ROUTE_MAX_SIZE = 3
  16008. const _NET_IPV6_ROUTE_GC_MIN_INTERVAL = 4
  16009. const _NET_IPV6_ROUTE_GC_TIMEOUT = 5
  16010. const _NET_IPV6_ROUTE_GC_INTERVAL = 6
  16011. const _NET_IPV6_ROUTE_GC_ELASTICITY = 7
  16012. const _NET_IPV6_ROUTE_MTU_EXPIRES = 8
  16013. const _NET_IPV6_ROUTE_MIN_ADVMSS = 9
  16014. const _NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS = 10
  16015. const _NET_IPV6_FORWARDING = 1
  16016. const _NET_IPV6_HOP_LIMIT = 2
  16017. const _NET_IPV6_MTU = 3
  16018. const _NET_IPV6_ACCEPT_RA = 4
  16019. const _NET_IPV6_ACCEPT_REDIRECTS = 5
  16020. const _NET_IPV6_AUTOCONF = 6
  16021. const _NET_IPV6_DAD_TRANSMITS = 7
  16022. const _NET_IPV6_RTR_SOLICITS = 8
  16023. const _NET_IPV6_RTR_SOLICIT_INTERVAL = 9
  16024. const _NET_IPV6_RTR_SOLICIT_DELAY = 10
  16025. const _NET_IPV6_USE_TEMPADDR = 11
  16026. const _NET_IPV6_TEMP_VALID_LFT = 12
  16027. const _NET_IPV6_TEMP_PREFERED_LFT = 13
  16028. const _NET_IPV6_REGEN_MAX_RETRY = 14
  16029. const _NET_IPV6_MAX_DESYNC_FACTOR = 15
  16030. const _NET_IPV6_MAX_ADDRESSES = 16
  16031. const _NET_IPV6_FORCE_MLD_VERSION = 17
  16032. const _NET_IPV6_ACCEPT_RA_DEFRTR = 18
  16033. const _NET_IPV6_ACCEPT_RA_PINFO = 19
  16034. const _NET_IPV6_ACCEPT_RA_RTR_PREF = 20
  16035. const _NET_IPV6_RTR_PROBE_INTERVAL = 21
  16036. const _NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN = 22
  16037. const _NET_IPV6_PROXY_NDP = 23
  16038. const _NET_IPV6_ACCEPT_SOURCE_ROUTE = 25
  16039. const _NET_IPV6_ACCEPT_RA_FROM_LOCAL = 26
  16040. const _NET_IPV6_ACCEPT_RA_RT_INFO_MIN_PLEN = 27
  16041. const _NET_IPV6_RA_DEFRTR_METRIC = 28
  16042. const ___NET_IPV6_MAX = 29
  16043. const _NET_IPV6_ICMP_RATELIMIT = 1
  16044. const _NET_IPV6_ICMP_ECHO_IGNORE_ALL = 2
  16045. const _NET_NEIGH_MCAST_SOLICIT = 1
  16046. const _NET_NEIGH_UCAST_SOLICIT = 2
  16047. const _NET_NEIGH_APP_SOLICIT = 3
  16048. const _NET_NEIGH_RETRANS_TIME = 4
  16049. const _NET_NEIGH_REACHABLE_TIME = 5
  16050. const _NET_NEIGH_DELAY_PROBE_TIME = 6
  16051. const _NET_NEIGH_GC_STALE_TIME = 7
  16052. const _NET_NEIGH_UNRES_QLEN = 8
  16053. const _NET_NEIGH_PROXY_QLEN = 9
  16054. const _NET_NEIGH_ANYCAST_DELAY = 10
  16055. const _NET_NEIGH_PROXY_DELAY = 11
  16056. const _NET_NEIGH_LOCKTIME = 12
  16057. const _NET_NEIGH_GC_INTERVAL = 13
  16058. const _NET_NEIGH_GC_THRESH1 = 14
  16059. const _NET_NEIGH_GC_THRESH2 = 15
  16060. const _NET_NEIGH_GC_THRESH3 = 16
  16061. const _NET_NEIGH_RETRANS_TIME_MS = 17
  16062. const _NET_NEIGH_REACHABLE_TIME_MS = 18
  16063. const _NET_NEIGH_INTERVAL_PROBE_TIME_MS = 19
  16064. const _NET_DCCP_DEFAULT = 1
  16065. const _NET_IPX_PPROP_BROADCASTING = 1
  16066. const _NET_IPX_FORWARDING = 2
  16067. const _NET_LLC2 = 1
  16068. const _NET_LLC_STATION = 2
  16069. const _NET_LLC2_TIMEOUT = 1
  16070. const _NET_LLC_STATION_ACK_TIMEOUT = 1
  16071. const _NET_LLC2_ACK_TIMEOUT = 1
  16072. const _NET_LLC2_P_TIMEOUT = 2
  16073. const _NET_LLC2_REJ_TIMEOUT = 3
  16074. const _NET_LLC2_BUSY_TIMEOUT = 4
  16075. const _NET_ATALK_AARP_EXPIRY_TIME = 1
  16076. const _NET_ATALK_AARP_TICK_TIME = 2
  16077. const _NET_ATALK_AARP_RETRANSMIT_LIMIT = 3
  16078. const _NET_ATALK_AARP_RESOLVE_TIME = 4
  16079. const _NET_NETROM_DEFAULT_PATH_QUALITY = 1
  16080. const _NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER = 2
  16081. const _NET_NETROM_NETWORK_TTL_INITIALISER = 3
  16082. const _NET_NETROM_TRANSPORT_TIMEOUT = 4
  16083. const _NET_NETROM_TRANSPORT_MAXIMUM_TRIES = 5
  16084. const _NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY = 6
  16085. const _NET_NETROM_TRANSPORT_BUSY_DELAY = 7
  16086. const _NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE = 8
  16087. const _NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT = 9
  16088. const _NET_NETROM_ROUTING_CONTROL = 10
  16089. const _NET_NETROM_LINK_FAILS_COUNT = 11
  16090. const _NET_NETROM_RESET = 12
  16091. const _NET_AX25_IP_DEFAULT_MODE = 1
  16092. const _NET_AX25_DEFAULT_MODE = 2
  16093. const _NET_AX25_BACKOFF_TYPE = 3
  16094. const _NET_AX25_CONNECT_MODE = 4
  16095. const _NET_AX25_STANDARD_WINDOW = 5
  16096. const _NET_AX25_EXTENDED_WINDOW = 6
  16097. const _NET_AX25_T1_TIMEOUT = 7
  16098. const _NET_AX25_T2_TIMEOUT = 8
  16099. const _NET_AX25_T3_TIMEOUT = 9
  16100. const _NET_AX25_IDLE_TIMEOUT = 10
  16101. const _NET_AX25_N2 = 11
  16102. const _NET_AX25_PACLEN = 12
  16103. const _NET_AX25_PROTOCOL = 13
  16104. const _NET_AX25_DAMA_SLAVE_TIMEOUT = 14
  16105. const _NET_ROSE_RESTART_REQUEST_TIMEOUT = 1
  16106. const _NET_ROSE_CALL_REQUEST_TIMEOUT = 2
  16107. const _NET_ROSE_RESET_REQUEST_TIMEOUT = 3
  16108. const _NET_ROSE_CLEAR_REQUEST_TIMEOUT = 4
  16109. const _NET_ROSE_ACK_HOLD_BACK_TIMEOUT = 5
  16110. const _NET_ROSE_ROUTING_CONTROL = 6
  16111. const _NET_ROSE_LINK_FAIL_TIMEOUT = 7
  16112. const _NET_ROSE_MAX_VCS = 8
  16113. const _NET_ROSE_WINDOW_SIZE = 9
  16114. const _NET_ROSE_NO_ACTIVITY_TIMEOUT = 10
  16115. const _NET_X25_RESTART_REQUEST_TIMEOUT = 1
  16116. const _NET_X25_CALL_REQUEST_TIMEOUT = 2
  16117. const _NET_X25_RESET_REQUEST_TIMEOUT = 3
  16118. const _NET_X25_CLEAR_REQUEST_TIMEOUT = 4
  16119. const _NET_X25_ACK_HOLD_BACK_TIMEOUT = 5
  16120. const _NET_X25_FORWARD = 6
  16121. const _NET_TR_RIF_TIMEOUT = 1
  16122. const _NET_DECNET_NODE_TYPE = 1
  16123. const _NET_DECNET_NODE_ADDRESS = 2
  16124. const _NET_DECNET_NODE_NAME = 3
  16125. const _NET_DECNET_DEFAULT_DEVICE = 4
  16126. const _NET_DECNET_TIME_WAIT = 5
  16127. const _NET_DECNET_DN_COUNT = 6
  16128. const _NET_DECNET_DI_COUNT = 7
  16129. const _NET_DECNET_DR_COUNT = 8
  16130. const _NET_DECNET_DST_GC_INTERVAL = 9
  16131. const _NET_DECNET_CONF = 10
  16132. const _NET_DECNET_NO_FC_MAX_CWND = 11
  16133. const _NET_DECNET_MEM = 12
  16134. const _NET_DECNET_RMEM = 13
  16135. const _NET_DECNET_WMEM = 14
  16136. const _NET_DECNET_DEBUG_LEVEL = 255
  16137. const _NET_DECNET_CONF_LOOPBACK = -2
  16138. const _NET_DECNET_CONF_DDCMP = -3
  16139. const _NET_DECNET_CONF_PPP = -4
  16140. const _NET_DECNET_CONF_X25 = -5
  16141. const _NET_DECNET_CONF_GRE = -6
  16142. const _NET_DECNET_CONF_ETHER = -7
  16143. const _NET_DECNET_CONF_DEV_PRIORITY = 1
  16144. const _NET_DECNET_CONF_DEV_T1 = 2
  16145. const _NET_DECNET_CONF_DEV_T2 = 3
  16146. const _NET_DECNET_CONF_DEV_T3 = 4
  16147. const _NET_DECNET_CONF_DEV_FORWARDING = 5
  16148. const _NET_DECNET_CONF_DEV_BLKSIZE = 6
  16149. const _NET_DECNET_CONF_DEV_STATE = 7
  16150. const _NET_SCTP_RTO_INITIAL = 1
  16151. const _NET_SCTP_RTO_MIN = 2
  16152. const _NET_SCTP_RTO_MAX = 3
  16153. const _NET_SCTP_RTO_ALPHA = 4
  16154. const _NET_SCTP_RTO_BETA = 5
  16155. const _NET_SCTP_VALID_COOKIE_LIFE = 6
  16156. const _NET_SCTP_ASSOCIATION_MAX_RETRANS = 7
  16157. const _NET_SCTP_PATH_MAX_RETRANS = 8
  16158. const _NET_SCTP_MAX_INIT_RETRANSMITS = 9
  16159. const _NET_SCTP_HB_INTERVAL = 10
  16160. const _NET_SCTP_PRESERVE_ENABLE = 11
  16161. const _NET_SCTP_MAX_BURST = 12
  16162. const _NET_SCTP_ADDIP_ENABLE = 13
  16163. const _NET_SCTP_PRSCTP_ENABLE = 14
  16164. const _NET_SCTP_SNDBUF_POLICY = 15
  16165. const _NET_SCTP_SACK_TIMEOUT = 16
  16166. const _NET_SCTP_RCVBUF_POLICY = 17
  16167. const _NET_BRIDGE_NF_CALL_ARPTABLES = 1
  16168. const _NET_BRIDGE_NF_CALL_IPTABLES = 2
  16169. const _NET_BRIDGE_NF_CALL_IP6TABLES = 3
  16170. const _NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4
  16171. const _NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5
  16172. const _FS_NRINODE = 1
  16173. const _FS_STATINODE = 2
  16174. const _FS_MAXINODE = 3
  16175. const _FS_NRDQUOT = 4
  16176. const _FS_MAXDQUOT = 5
  16177. const _FS_NRFILE = 6
  16178. const _FS_MAXFILE = 7
  16179. const _FS_DENTRY = 8
  16180. const _FS_NRSUPER = 9
  16181. const _FS_MAXSUPER = 10
  16182. const _FS_OVERFLOWUID = 11
  16183. const _FS_OVERFLOWGID = 12
  16184. const _FS_LEASES = 13
  16185. const _FS_DIR_NOTIFY = 14
  16186. const _FS_LEASE_TIME = 15
  16187. const _FS_DQSTATS = 16
  16188. const _FS_XFS = 17
  16189. const _FS_AIO_NR = 18
  16190. const _FS_AIO_MAX_NR = 19
  16191. const _FS_INOTIFY = 20
  16192. const _FS_OCFS2 = 988
  16193. const _FS_DQ_LOOKUPS = 1
  16194. const _FS_DQ_DROPS = 2
  16195. const _FS_DQ_READS = 3
  16196. const _FS_DQ_WRITES = 4
  16197. const _FS_DQ_CACHE_HITS = 5
  16198. const _FS_DQ_ALLOCATED = 6
  16199. const _FS_DQ_FREE = 7
  16200. const _FS_DQ_SYNCS = 8
  16201. const _FS_DQ_WARNINGS = 9
  16202. const _DEV_CDROM = 1
  16203. const _DEV_HWMON = 2
  16204. const _DEV_PARPORT = 3
  16205. const _DEV_RAID = 4
  16206. const _DEV_MAC_HID = 5
  16207. const _DEV_SCSI = 6
  16208. const _DEV_IPMI = 7
  16209. const _DEV_CDROM_INFO = 1
  16210. const _DEV_CDROM_AUTOCLOSE = 2
  16211. const _DEV_CDROM_AUTOEJECT = 3
  16212. const _DEV_CDROM_DEBUG = 4
  16213. const _DEV_CDROM_LOCK = 5
  16214. const _DEV_CDROM_CHECK_MEDIA = 6
  16215. const _DEV_PARPORT_DEFAULT = -3
  16216. const _DEV_RAID_SPEED_LIMIT_MIN = 1
  16217. const _DEV_RAID_SPEED_LIMIT_MAX = 2
  16218. const _DEV_PARPORT_DEFAULT_TIMESLICE = 1
  16219. const _DEV_PARPORT_DEFAULT_SPINTIME = 2
  16220. const _DEV_PARPORT_SPINTIME = 1
  16221. const _DEV_PARPORT_BASE_ADDR = 2
  16222. const _DEV_PARPORT_IRQ = 3
  16223. const _DEV_PARPORT_DMA = 4
  16224. const _DEV_PARPORT_MODES = 5
  16225. const _DEV_PARPORT_DEVICES = 6
  16226. const _DEV_PARPORT_AUTOPROBE = 16
  16227. const _DEV_PARPORT_DEVICES_ACTIVE = -3
  16228. const _DEV_PARPORT_DEVICE_TIMESLICE = 1
  16229. const _DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES = 1
  16230. const _DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES = 2
  16231. const _DEV_MAC_HID_MOUSE_BUTTON_EMULATION = 3
  16232. const _DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE = 4
  16233. const _DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE = 5
  16234. const _DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES = 6
  16235. const _DEV_SCSI_LOGGING_LEVEL = 1
  16236. const _DEV_IPMI_POWEROFF_POWERCYCLE = 1
  16237. const _ABI_DEFHANDLER_COFF = 1
  16238. const _ABI_DEFHANDLER_ELF = 2
  16239. const _ABI_DEFHANDLER_LCALL7 = 3
  16240. const _ABI_DEFHANDLER_LIBCSO = 4
  16241. const _ABI_TRACE = 5
  16242. const _ABI_FAKE_UTSNAME = 6
  16243. type Tstatvfs = struct {
  16244. Ff_bsize uint32
  16245. Ff_frsize uint32
  16246. Ff_blocks Tfsblkcnt_t
  16247. Ff_bfree Tfsblkcnt_t
  16248. Ff_bavail Tfsblkcnt_t
  16249. Ff_files Tfsfilcnt_t
  16250. Ff_ffree Tfsfilcnt_t
  16251. Ff_favail Tfsfilcnt_t
  16252. Ff_fsid uint32
  16253. F__ccgo60 uint32
  16254. Ff_flag uint32
  16255. Ff_namemax uint32
  16256. Ff_type uint32
  16257. F__reserved [5]int32
  16258. }
  16259. type TElf_Symndx = uint32
  16260. type Tdl_phdr_info = struct {
  16261. Fdlpi_addr TElf32_Addr
  16262. Fdlpi_name uintptr
  16263. Fdlpi_phdr uintptr
  16264. Fdlpi_phnum TElf32_Half
  16265. Fdlpi_adds uint64
  16266. Fdlpi_subs uint64
  16267. Fdlpi_tls_modid Tsize_t
  16268. Fdlpi_tls_data uintptr
  16269. }
  16270. type Tlink_map = struct {
  16271. Fl_addr TElf32_Addr
  16272. Fl_name uintptr
  16273. Fl_ld uintptr
  16274. Fl_next uintptr
  16275. Fl_prev uintptr
  16276. }
  16277. type Tr_debug = struct {
  16278. Fr_version int32
  16279. Fr_map uintptr
  16280. Fr_brk TElf32_Addr
  16281. Fr_state int32
  16282. Fr_ldbase TElf32_Addr
  16283. }
  16284. const _RT_CONSISTENT = 0
  16285. const _RT_ADD = 1
  16286. const _RT_DELETE = 2
  16287. type TSHA2_CTX = struct {
  16288. Fstate struct {
  16289. Fst64 [0][8]Tuint64_t
  16290. Fst32 [8]Tuint32_t
  16291. F__ccgo_pad2 [32]byte
  16292. }
  16293. Fbitcount [2]Tuint64_t
  16294. Fbuffer [128]Tuint8_t
  16295. }
  16296. type T_SHA2_CTX = TSHA2_CTX
  16297. type TSHA512_CTX = struct {
  16298. Fstate struct {
  16299. Fst64 [0][8]Tuint64_t
  16300. Fst32 [8]Tuint32_t
  16301. F__ccgo_pad2 [32]byte
  16302. }
  16303. Fbitcount [2]Tuint64_t
  16304. Fbuffer [128]Tuint8_t
  16305. }
  16306. type TSHA384_CTX = struct {
  16307. Fstate struct {
  16308. Fst64 [0][8]Tuint64_t
  16309. Fst32 [8]Tuint32_t
  16310. F__ccgo_pad2 [32]byte
  16311. }
  16312. Fbitcount [2]Tuint64_t
  16313. Fbuffer [128]Tuint8_t
  16314. }
  16315. type Trand_pool_info = struct {
  16316. Fentropy_count int32
  16317. Fbuf_size int32
  16318. }
  16319. type Tfsid_t = struct {
  16320. F__val [2]int32
  16321. }
  16322. type t__fsid_t = Tfsid_t
  16323. type Tstatfs = struct {
  16324. Ff_type uint32
  16325. Ff_bsize uint32
  16326. Ff_blocks Tfsblkcnt_t
  16327. Ff_bfree Tfsblkcnt_t
  16328. Ff_bavail Tfsblkcnt_t
  16329. Ff_files Tfsfilcnt_t
  16330. Ff_ffree Tfsfilcnt_t
  16331. Ff_fsid Tfsid_t
  16332. Ff_namelen uint32
  16333. Ff_frsize uint32
  16334. Ff_flags uint32
  16335. Ff_spare [4]uint32
  16336. }
  16337. func Xgetentropy(tls *libc.TLS, buf uintptr, len1 Tsize_t) (r int32) {
  16338. var ret int32
  16339. _ = ret
  16340. ret = -int32(1)
  16341. if len1 > uint32(256) {
  16342. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EIO)
  16343. return -int32(1)
  16344. }
  16345. /*
  16346. * Try descriptor-less getrandom(), in non-blocking mode.
  16347. *
  16348. * The design of Linux getrandom is broken. It has an
  16349. * uninitialized phase coupled with blocking behaviour, which
  16350. * is unacceptable from within a library at boot time without
  16351. * possible recovery. See http://bugs.python.org/issue26839#msg267745
  16352. */
  16353. ret = _getentropy_getrandom(tls, buf, len1)
  16354. if ret != -int32(1) {
  16355. return ret
  16356. }
  16357. /*
  16358. * Try to get entropy with /dev/urandom
  16359. *
  16360. * This can fail if the process is inside a chroot or if file
  16361. * descriptors are exhausted.
  16362. */
  16363. ret = _getentropy_urandom(tls, buf, len1)
  16364. if ret != -int32(1) {
  16365. return ret
  16366. }
  16367. /*
  16368. * Try to use sysctl CTL_KERN, KERN_RANDOM, RANDOM_UUID.
  16369. * sysctl is a failsafe API, so it guarantees a result. This
  16370. * should work inside a chroot, or when file descriptors are
  16371. * exhausted.
  16372. *
  16373. * However this can fail if the Linux kernel removes support
  16374. * for sysctl. Starting in 2007, there have been efforts to
  16375. * deprecate the sysctl API/ABI, and push callers towards use
  16376. * of the chroot-unavailable fd-using /proc mechanism --
  16377. * essentially the same problems as /dev/urandom.
  16378. *
  16379. * Numerous setbacks have been encountered in their deprecation
  16380. * schedule, so as of June 2014 the kernel ABI still exists on
  16381. * most Linux architectures. The sysctl() stub in libc is missing
  16382. * on some systems. There are also reports that some kernels
  16383. * spew messages to the console.
  16384. */
  16385. ret = _getentropy_sysctl(tls, buf, len1)
  16386. if ret != -int32(1) {
  16387. return ret
  16388. }
  16389. /*
  16390. * Entropy collection via /dev/urandom and sysctl have failed.
  16391. *
  16392. * No other API exists for collecting entropy. See the large
  16393. * comment block above.
  16394. *
  16395. * We have very few options:
  16396. * - Even syslog_r is unsafe to call at this low level, so
  16397. * there is no way to alert the user or program.
  16398. * - Cannot call abort() because some systems have unsafe
  16399. * corefiles.
  16400. * - Could raise(SIGKILL) resulting in silent program termination.
  16401. * - Return EIO, to hint that arc4random's stir function
  16402. * should raise(SIGKILL)
  16403. * - Do the best under the circumstances....
  16404. *
  16405. * This code path exists to bring light to the issue that Linux
  16406. * still does not provide a failsafe API for entropy collection.
  16407. *
  16408. * We hope this demonstrates that Linux should either retain their
  16409. * sysctl ABI, or consider providing a new failsafe API which
  16410. * works in a chroot or when file descriptors are exhausted.
  16411. */
  16412. ret = _getentropy_fallback(tls, buf, len1)
  16413. if ret != -int32(1) {
  16414. return ret
  16415. }
  16416. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EIO)
  16417. return ret
  16418. }
  16419. // C documentation
  16420. //
  16421. // /*
  16422. // * Basic sanity checking; wish we could do better.
  16423. // */
  16424. func _gotdata(tls *libc.TLS, buf uintptr, len1 Tsize_t) (r int32) {
  16425. var any_set int8
  16426. var i Tsize_t
  16427. _, _ = any_set, i
  16428. any_set = 0
  16429. i = uint32(0)
  16430. for {
  16431. if !(i < len1) {
  16432. break
  16433. }
  16434. any_set = int8(int32(any_set) | int32(*(*int8)(unsafe.Pointer(buf + uintptr(i)))))
  16435. goto _1
  16436. _1:
  16437. ;
  16438. i++
  16439. }
  16440. if int32(any_set) == 0 {
  16441. return -int32(1)
  16442. }
  16443. return 0
  16444. }
  16445. func _getentropy_getrandom(tls *libc.TLS, buf uintptr, len1 Tsize_t) (r int32) {
  16446. bp := tls.Alloc(32)
  16447. defer tls.Free(32)
  16448. var pre_errno, ret int32
  16449. _, _ = pre_errno, ret
  16450. pre_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  16451. if len1 > uint32(256) {
  16452. return -int32(1)
  16453. }
  16454. for cond := true; cond; cond = ret == -int32(1) && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EINTR) {
  16455. ret = int32(libc.Xsyscall(tls, int32(m_SYS_getrandom), libc.VaList(bp+8, buf, len1, int32(m_GRND_NONBLOCK))))
  16456. }
  16457. if ret != libc.Int32FromUint32(len1) {
  16458. return -int32(1)
  16459. }
  16460. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = pre_errno
  16461. return 0
  16462. }
  16463. func _getentropy_urandom(tls *libc.TLS, buf uintptr, len1 Tsize_t) (r int32) {
  16464. bp := tls.Alloc(176)
  16465. defer tls.Free(176)
  16466. var fd, flags, save_errno int32
  16467. var i, wanted Tsize_t
  16468. var ret Tssize_t
  16469. var _ /* cnt at bp+144 */ int32
  16470. var _ /* st at bp+0 */ Tstat
  16471. _, _, _, _, _, _ = fd, flags, i, ret, save_errno, wanted
  16472. save_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  16473. goto start
  16474. start:
  16475. ;
  16476. flags = m_O_RDONLY3
  16477. flags |= int32(m_O_NOFOLLOW1)
  16478. flags |= int32(m_O_CLOEXEC1)
  16479. fd = libc.Xopen(tls, __ccgo_ts+651, flags, libc.VaList(bp+160, 0))
  16480. if fd == -int32(1) {
  16481. if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EINTR) {
  16482. goto start
  16483. }
  16484. goto nodevrandom
  16485. }
  16486. /* Lightly verify that the device node looks sane */
  16487. if libc.Xfstat(tls, fd, bp) == -int32(1) || !((*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&libc.Uint32FromInt32(m_S_IFMT3) == libc.Uint32FromInt32(m_S_IFCHR3)) {
  16488. libc.Xclose(tls, fd)
  16489. goto nodevrandom
  16490. }
  16491. if libc.Xioctl(tls, fd, libc.Int32FromUint32(libc.Uint32FromUint32(2)<<(libc.Int32FromInt32(m__IOC_NRSHIFT)+libc.Int32FromInt32(m__IOC_NRBITS)+libc.Int32FromInt32(m__IOC_TYPEBITS)+libc.Int32FromInt32(m__IOC_SIZEBITS))|libc.Uint32FromInt32(libc.Int32FromUint8('R')<<(libc.Int32FromInt32(m__IOC_NRSHIFT)+libc.Int32FromInt32(m__IOC_NRBITS)))|libc.Uint32FromInt32(libc.Int32FromInt32(0x00)<<libc.Int32FromInt32(m__IOC_NRSHIFT))|libc.Uint32FromInt64(4)<<(libc.Int32FromInt32(m__IOC_NRSHIFT)+libc.Int32FromInt32(m__IOC_NRBITS)+libc.Int32FromInt32(m__IOC_TYPEBITS))), libc.VaList(bp+160, bp+144)) == -int32(1) {
  16492. libc.Xclose(tls, fd)
  16493. goto nodevrandom
  16494. }
  16495. i = uint32(0)
  16496. for {
  16497. if !(i < len1) {
  16498. break
  16499. }
  16500. wanted = len1 - i
  16501. ret = libc.Xread(tls, fd, buf+uintptr(i), wanted)
  16502. if ret == -int32(1) {
  16503. if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EAGAIN) || *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EINTR) {
  16504. goto _1
  16505. }
  16506. libc.Xclose(tls, fd)
  16507. goto nodevrandom
  16508. }
  16509. i += libc.Uint32FromInt32(ret)
  16510. goto _1
  16511. _1:
  16512. }
  16513. libc.Xclose(tls, fd)
  16514. if _gotdata(tls, buf, len1) == 0 {
  16515. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = save_errno
  16516. return 0 /* satisfied */
  16517. }
  16518. goto nodevrandom
  16519. nodevrandom:
  16520. ;
  16521. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EIO)
  16522. return -int32(1)
  16523. }
  16524. func _getentropy_sysctl(tls *libc.TLS, buf uintptr, len1 Tsize_t) (r int32) {
  16525. bp := tls.Alloc(64)
  16526. defer tls.Free(64)
  16527. var i Tsize_t
  16528. var save_errno int32
  16529. var v2 uint32
  16530. var _ /* args at bp+4 */ t__sysctl_args
  16531. var _ /* chunk at bp+0 */ Tsize_t
  16532. _, _, _ = i, save_errno, v2
  16533. save_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  16534. i = uint32(0)
  16535. for {
  16536. if !(i < len1) {
  16537. break
  16538. }
  16539. if len1-i < libc.Uint32FromInt32(libc.Int32FromInt32(16)) {
  16540. v2 = len1 - i
  16541. } else {
  16542. v2 = libc.Uint32FromInt32(libc.Int32FromInt32(16))
  16543. }
  16544. *(*Tsize_t)(unsafe.Pointer(bp)) = v2
  16545. /* SYS__sysctl because some systems already removed sysctl() */
  16546. *(*t__sysctl_args)(unsafe.Pointer(bp + 4)) = t__sysctl_args{
  16547. Fname: uintptr(unsafe.Pointer(&_mib)),
  16548. Fnlen: int32(3),
  16549. Foldval: buf + uintptr(i),
  16550. Foldlenp: bp,
  16551. }
  16552. if libc.Xsyscall(tls, int32(m_SYS__sysctl), libc.VaList(bp+56, bp+4)) != 0 {
  16553. goto sysctlfailed
  16554. }
  16555. i += *(*Tsize_t)(unsafe.Pointer(bp))
  16556. goto _1
  16557. _1:
  16558. }
  16559. if _gotdata(tls, buf, len1) == 0 {
  16560. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = save_errno
  16561. return 0 /* satisfied */
  16562. }
  16563. goto sysctlfailed
  16564. sysctlfailed:
  16565. ;
  16566. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EIO)
  16567. return -int32(1)
  16568. }
  16569. var _mib = [3]int32{
  16570. 0: int32(_CTL_KERN),
  16571. 1: int32(_KERN_RANDOM),
  16572. 2: int32(_RANDOM_UUID),
  16573. }
  16574. var _cl = [6]int32{
  16575. 1: int32(m_CLOCK_MONOTONIC),
  16576. 2: int32(m_CLOCK_MONOTONIC_RAW),
  16577. 3: int32(m_CLOCK_TAI),
  16578. 4: int32(m_CLOCK_PROCESS_CPUTIME_ID),
  16579. 5: int32(m_CLOCK_THREAD_CPUTIME_ID),
  16580. }
  16581. func _getentropy_phdr(tls *libc.TLS, info uintptr, size Tsize_t, data uintptr) (r int32) {
  16582. var ctx uintptr
  16583. _ = ctx
  16584. ctx = data
  16585. libmd.XSHA512Update(tls, ctx, info, uint32(4))
  16586. return 0
  16587. }
  16588. func _getentropy_fallback(tls *libc.TLS, buf uintptr, len1 Tsize_t) (r int32) {
  16589. bp := tls.Alloc(1216)
  16590. defer tls.Free(1216)
  16591. var faster, j, pgs, repeat, save_errno, v13, v14, v16, v18, v19, v3, v9 int32
  16592. var i, ii, m, mo Tsize_t
  16593. var v11 uintptr
  16594. var v17 Toff_t
  16595. var v20, v21 uint32
  16596. var v5, v6, v7, v8 Tpid_t
  16597. var _ /* ctx at bp+524 */ TSHA512_CTX
  16598. var _ /* e at bp+64 */ int32
  16599. var _ /* mm at bp+1120 */ [12]struct {
  16600. Fnpg Tsize_t
  16601. Fp uintptr
  16602. }
  16603. var _ /* off at bp+1112 */ Toff_t
  16604. var _ /* p at bp+736 */ uintptr
  16605. var _ /* pid at bp+732 */ Tpid_t
  16606. var _ /* results at bp+0 */ [64]Tuint8_t
  16607. var _ /* ru at bp+100 */ Trusage
  16608. var _ /* sigset at bp+252 */ Tsigset_t
  16609. var _ /* ss at bp+740 */ Tsockaddr_storage
  16610. var _ /* ssl at bp+1108 */ Tsocklen_t
  16611. var _ /* st at bp+380 */ Tstat
  16612. var _ /* stfs at bp+1024 */ Tstatfs
  16613. var _ /* stvfs at bp+868 */ Tstatvfs
  16614. var _ /* tios at bp+964 */ Ttermios
  16615. var _ /* ts at bp+68 */ Ttimespec
  16616. var _ /* tv at bp+84 */ Ttimeval
  16617. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = faster, i, ii, j, m, mo, pgs, repeat, save_errno, v11, v13, v14, v16, v17, v18, v19, v20, v21, v3, v5, v6, v7, v8, v9
  16618. save_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
  16619. pgs = libc.Xgetpagesize(tls)
  16620. faster = 0
  16621. *(*Tpid_t)(unsafe.Pointer(bp + 732)) = libc.Xgetpid(tls)
  16622. if _lastpid == *(*Tpid_t)(unsafe.Pointer(bp + 732)) {
  16623. faster = int32(1)
  16624. repeat = int32(2)
  16625. } else {
  16626. faster = 0
  16627. _lastpid = *(*Tpid_t)(unsafe.Pointer(bp + 732))
  16628. repeat = int32(m_REPEAT)
  16629. }
  16630. i = uint32(0)
  16631. for {
  16632. if !(i < len1) {
  16633. break
  16634. }
  16635. libmd.XSHA512Init(tls, bp+524)
  16636. j = 0
  16637. for {
  16638. if !(j < repeat) {
  16639. break
  16640. }
  16641. v3 = libc.Xgettimeofday(tls, bp+84, libc.UintptrFromInt32(0))
  16642. *(*int32)(unsafe.Pointer(bp + 64)) = v3
  16643. if v3 == -int32(1) {
  16644. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16645. } else {
  16646. libmd.XSHA512Update(tls, bp+524, bp+84, uint32(16))
  16647. }
  16648. if *(*int32)(unsafe.Pointer(bp + 64)) != -int32(1) {
  16649. _cnt += int32((*(*Ttimeval)(unsafe.Pointer(bp + 84))).Ftv_sec)
  16650. _cnt += int32((*(*Ttimeval)(unsafe.Pointer(bp + 84))).Ftv_usec)
  16651. }
  16652. _dl_iterate_phdr(tls, __ccgo_fp(_getentropy_phdr), bp+524)
  16653. ii = uint32(0)
  16654. for {
  16655. if !(ii < libc.Uint32FromInt64(24)/libc.Uint32FromInt64(4)) {
  16656. break
  16657. }
  16658. if libc.Xclock_gettime(tls, _cl[ii], bp+68) == -int32(1) {
  16659. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16660. } else {
  16661. libmd.XSHA512Update(tls, bp+524, bp+68, uint32(16))
  16662. }
  16663. goto _4
  16664. _4:
  16665. ;
  16666. ii++
  16667. }
  16668. v5 = libc.Xgetpid(tls)
  16669. *(*Tpid_t)(unsafe.Pointer(bp + 732)) = v5
  16670. if v5 == -int32(1) {
  16671. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16672. } else {
  16673. libmd.XSHA512Update(tls, bp+524, bp+732, uint32(4))
  16674. }
  16675. v6 = libc.Xgetsid(tls, *(*Tpid_t)(unsafe.Pointer(bp + 732)))
  16676. *(*Tpid_t)(unsafe.Pointer(bp + 732)) = v6
  16677. if v6 == -int32(1) {
  16678. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16679. } else {
  16680. libmd.XSHA512Update(tls, bp+524, bp+732, uint32(4))
  16681. }
  16682. v7 = libc.Xgetppid(tls)
  16683. *(*Tpid_t)(unsafe.Pointer(bp + 732)) = v7
  16684. if v7 == -int32(1) {
  16685. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16686. } else {
  16687. libmd.XSHA512Update(tls, bp+524, bp+732, uint32(4))
  16688. }
  16689. v8 = libc.Xgetpgid(tls, 0)
  16690. *(*Tpid_t)(unsafe.Pointer(bp + 732)) = v8
  16691. if v8 == -int32(1) {
  16692. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16693. } else {
  16694. libmd.XSHA512Update(tls, bp+524, bp+732, uint32(4))
  16695. }
  16696. v9 = libc.Xgetpriority(tls, 0, uint32(0))
  16697. *(*int32)(unsafe.Pointer(bp + 64)) = v9
  16698. if v9 == -int32(1) {
  16699. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16700. } else {
  16701. libmd.XSHA512Update(tls, bp+524, bp+64, uint32(4))
  16702. }
  16703. if !(faster != 0) {
  16704. (*(*Ttimespec)(unsafe.Pointer(bp + 68))).Ftv_sec = 0
  16705. (*(*Ttimespec)(unsafe.Pointer(bp + 68))).Ftv_nsec = int32(1)
  16706. libc.Xnanosleep(tls, bp+68, libc.UintptrFromInt32(0))
  16707. }
  16708. if libc.Xsigpending(tls, bp+252) == -int32(1) {
  16709. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16710. } else {
  16711. libmd.XSHA512Update(tls, bp+524, bp+252, uint32(128))
  16712. }
  16713. if libc.Xsigprocmask(tls, m_SIG_BLOCK, libc.UintptrFromInt32(0), bp+252) == -int32(1) {
  16714. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16715. } else {
  16716. libmd.XSHA512Update(tls, bp+524, bp+252, uint32(128))
  16717. }
  16718. libmd.XSHA512Update(tls, bp+524, __ccgo_fp(Xgetentropy), uint32(4)) /* an addr in this library */
  16719. libmd.XSHA512Update(tls, bp+524, __ccgo_fp(libc.Xprintf), uint32(4)) /* an addr in libc */
  16720. *(*uintptr)(unsafe.Pointer(bp + 736)) = bp + 736
  16721. libmd.XSHA512Update(tls, bp+524, bp+736, uint32(4)) /* an addr on stack */
  16722. *(*uintptr)(unsafe.Pointer(bp + 736)) = libc.X__errno_location(tls)
  16723. libmd.XSHA512Update(tls, bp+524, bp+736, uint32(4)) /* the addr of errno */
  16724. if i == uint32(0) {
  16725. /*
  16726. * Prime-sized mappings encourage fragmentation;
  16727. * thus exposing some address entropy.
  16728. */
  16729. *(*[12]struct {
  16730. Fnpg Tsize_t
  16731. Fp uintptr
  16732. })(unsafe.Pointer(bp + 1120)) = [12]struct {
  16733. Fnpg Tsize_t
  16734. Fp uintptr
  16735. }{
  16736. 0: {
  16737. Fnpg: uint32(17),
  16738. Fp: uintptr(-libc.Int32FromInt32(1)),
  16739. },
  16740. 1: {
  16741. Fnpg: uint32(3),
  16742. Fp: uintptr(-libc.Int32FromInt32(1)),
  16743. },
  16744. 2: {
  16745. Fnpg: uint32(11),
  16746. Fp: uintptr(-libc.Int32FromInt32(1)),
  16747. },
  16748. 3: {
  16749. Fnpg: uint32(2),
  16750. Fp: uintptr(-libc.Int32FromInt32(1)),
  16751. },
  16752. 4: {
  16753. Fnpg: uint32(5),
  16754. Fp: uintptr(-libc.Int32FromInt32(1)),
  16755. },
  16756. 5: {
  16757. Fnpg: uint32(3),
  16758. Fp: uintptr(-libc.Int32FromInt32(1)),
  16759. },
  16760. 6: {
  16761. Fnpg: uint32(7),
  16762. Fp: uintptr(-libc.Int32FromInt32(1)),
  16763. },
  16764. 7: {
  16765. Fnpg: uint32(1),
  16766. Fp: uintptr(-libc.Int32FromInt32(1)),
  16767. },
  16768. 8: {
  16769. Fnpg: uint32(57),
  16770. Fp: uintptr(-libc.Int32FromInt32(1)),
  16771. },
  16772. 9: {
  16773. Fnpg: uint32(3),
  16774. Fp: uintptr(-libc.Int32FromInt32(1)),
  16775. },
  16776. 10: {
  16777. Fnpg: uint32(131),
  16778. Fp: uintptr(-libc.Int32FromInt32(1)),
  16779. },
  16780. 11: {
  16781. Fnpg: uint32(1),
  16782. Fp: uintptr(-libc.Int32FromInt32(1)),
  16783. },
  16784. }
  16785. m = uint32(0)
  16786. for {
  16787. if !(m < libc.Uint32FromInt64(96)/libc.Uint32FromInt64(8)) {
  16788. break
  16789. }
  16790. v11 = libc.Xmmap(tls, libc.UintptrFromInt32(0), (*(*[12]struct {
  16791. Fnpg Tsize_t
  16792. Fp uintptr
  16793. })(unsafe.Pointer(bp + 1120)))[m].Fnpg*libc.Uint32FromInt32(pgs), libc.Int32FromInt32(m_PROT_READ)|libc.Int32FromInt32(m_PROT_WRITE), libc.Int32FromInt32(m_MAP_PRIVATE2)|libc.Int32FromInt32(m_MAP_ANON2), -int32(1), libc.Int64FromInt32(0))
  16794. (*(*[12]struct {
  16795. Fnpg Tsize_t
  16796. Fp uintptr
  16797. })(unsafe.Pointer(bp + 1120)))[m].Fp = v11
  16798. if v11 != 0 {
  16799. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16800. } else {
  16801. libmd.XSHA512Update(tls, bp+524, bp+1120+uintptr(m)*8+4, uint32(4))
  16802. }
  16803. if (*(*[12]struct {
  16804. Fnpg Tsize_t
  16805. Fp uintptr
  16806. })(unsafe.Pointer(bp + 1120)))[m].Fp != uintptr(-libc.Int32FromInt32(1)) {
  16807. /* Touch some memory... */
  16808. *(*uintptr)(unsafe.Pointer(bp + 736)) = (*(*[12]struct {
  16809. Fnpg Tsize_t
  16810. Fp uintptr
  16811. })(unsafe.Pointer(bp + 1120)))[m].Fp
  16812. mo = libc.Uint32FromInt32(_cnt) % ((*(*[12]struct {
  16813. Fnpg Tsize_t
  16814. Fp uintptr
  16815. })(unsafe.Pointer(bp + 1120)))[m].Fnpg*libc.Uint32FromInt32(pgs) - uint32(1))
  16816. *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 736)) + uintptr(mo))) = int8(1)
  16817. _cnt += int32((*(*[12]struct {
  16818. Fnpg Tsize_t
  16819. Fp uintptr
  16820. })(unsafe.Pointer(bp + 1120)))[m].Fp) / pgs
  16821. }
  16822. /* Check cnts and times... */
  16823. ii = uint32(0)
  16824. for {
  16825. if !(ii < libc.Uint32FromInt64(24)/libc.Uint32FromInt64(4)) {
  16826. break
  16827. }
  16828. v13 = libc.Xclock_gettime(tls, _cl[ii], bp+68)
  16829. *(*int32)(unsafe.Pointer(bp + 64)) = v13
  16830. if v13 == -int32(1) {
  16831. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16832. } else {
  16833. libmd.XSHA512Update(tls, bp+524, bp+68, uint32(16))
  16834. }
  16835. if *(*int32)(unsafe.Pointer(bp + 64)) != -int32(1) {
  16836. _cnt += (*(*Ttimespec)(unsafe.Pointer(bp + 68))).Ftv_nsec
  16837. }
  16838. goto _12
  16839. _12:
  16840. ;
  16841. ii++
  16842. }
  16843. v14 = libc.Xgetrusage(tls, m_RUSAGE_SELF, bp+100)
  16844. *(*int32)(unsafe.Pointer(bp + 64)) = v14
  16845. if v14 == -int32(1) {
  16846. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16847. } else {
  16848. libmd.XSHA512Update(tls, bp+524, bp+100, uint32(152))
  16849. }
  16850. if *(*int32)(unsafe.Pointer(bp + 64)) != -int32(1) {
  16851. _cnt += int32((*(*Trusage)(unsafe.Pointer(bp + 100))).Fru_utime.Ftv_sec)
  16852. _cnt += int32((*(*Trusage)(unsafe.Pointer(bp + 100))).Fru_utime.Ftv_usec)
  16853. }
  16854. goto _10
  16855. _10:
  16856. ;
  16857. m++
  16858. }
  16859. m = uint32(0)
  16860. for {
  16861. if !(m < libc.Uint32FromInt64(96)/libc.Uint32FromInt64(8)) {
  16862. break
  16863. }
  16864. if (*(*[12]struct {
  16865. Fnpg Tsize_t
  16866. Fp uintptr
  16867. })(unsafe.Pointer(bp + 1120)))[m].Fp != uintptr(-libc.Int32FromInt32(1)) {
  16868. libc.Xmunmap(tls, (*(*[12]struct {
  16869. Fnpg Tsize_t
  16870. Fp uintptr
  16871. })(unsafe.Pointer(bp + 1120)))[m].Fp, (*(*[12]struct {
  16872. Fnpg Tsize_t
  16873. Fp uintptr
  16874. })(unsafe.Pointer(bp + 1120)))[m].Fnpg*libc.Uint32FromInt32(pgs))
  16875. }
  16876. (*(*[12]struct {
  16877. Fnpg Tsize_t
  16878. Fp uintptr
  16879. })(unsafe.Pointer(bp + 1120)))[m].Fp = uintptr(-libc.Int32FromInt32(1))
  16880. goto _15
  16881. _15:
  16882. ;
  16883. m++
  16884. }
  16885. if libc.Xstat(tls, __ccgo_ts+664, bp+380) == -int32(1) {
  16886. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16887. } else {
  16888. libmd.XSHA512Update(tls, bp+524, bp+380, uint32(144))
  16889. }
  16890. if libc.Xstatvfs(tls, __ccgo_ts+664, bp+868) == -int32(1) {
  16891. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16892. } else {
  16893. libmd.XSHA512Update(tls, bp+524, bp+868, uint32(96))
  16894. }
  16895. if _statfs(tls, __ccgo_ts+664, bp+1024) == -int32(1) {
  16896. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16897. } else {
  16898. libmd.XSHA512Update(tls, bp+524, bp+1024, uint32(84))
  16899. }
  16900. if libc.Xstat(tls, __ccgo_ts+666, bp+380) == -int32(1) {
  16901. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16902. } else {
  16903. libmd.XSHA512Update(tls, bp+524, bp+380, uint32(144))
  16904. }
  16905. if libc.Xstatvfs(tls, __ccgo_ts+666, bp+868) == -int32(1) {
  16906. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16907. } else {
  16908. libmd.XSHA512Update(tls, bp+524, bp+868, uint32(96))
  16909. }
  16910. if _statfs(tls, __ccgo_ts+666, bp+1024) == -int32(1) {
  16911. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16912. } else {
  16913. libmd.XSHA512Update(tls, bp+524, bp+1024, uint32(84))
  16914. }
  16915. v16 = libc.Xfstat(tls, 0, bp+380)
  16916. *(*int32)(unsafe.Pointer(bp + 64)) = v16
  16917. if v16 == -int32(1) {
  16918. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16919. } else {
  16920. libmd.XSHA512Update(tls, bp+524, bp+380, uint32(144))
  16921. }
  16922. if *(*int32)(unsafe.Pointer(bp + 64)) == -int32(1) {
  16923. if (*(*Tstat)(unsafe.Pointer(bp + 380))).Fst_mode&uint32(m_S_IFMT3) == uint32(m_S_IFREG3) || (*(*Tstat)(unsafe.Pointer(bp + 380))).Fst_mode&uint32(m_S_IFMT3) == uint32(m_S_IFIFO3) || (*(*Tstat)(unsafe.Pointer(bp + 380))).Fst_mode&uint32(m_S_IFMT3) == uint32(m_S_IFSOCK3) {
  16924. if libc.Xfstatvfs(tls, 0, bp+868) == -int32(1) {
  16925. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16926. } else {
  16927. libmd.XSHA512Update(tls, bp+524, bp+868, uint32(96))
  16928. }
  16929. if libc.Xfstatfs(tls, 0, bp+1024) == -int32(1) {
  16930. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16931. } else {
  16932. libmd.XSHA512Update(tls, bp+524, bp+1024, uint32(84))
  16933. }
  16934. v17 = libc.Xlseek(tls, 0, libc.Int64FromInt32(0), int32(1))
  16935. *(*Toff_t)(unsafe.Pointer(bp + 1112)) = v17
  16936. if v17 < 0 {
  16937. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16938. } else {
  16939. libmd.XSHA512Update(tls, bp+524, bp+1112, uint32(8))
  16940. }
  16941. }
  16942. if (*(*Tstat)(unsafe.Pointer(bp + 380))).Fst_mode&uint32(m_S_IFMT3) == uint32(m_S_IFCHR3) {
  16943. if libc.Xtcgetattr(tls, 0, bp+964) == -int32(1) {
  16944. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16945. } else {
  16946. libmd.XSHA512Update(tls, bp+524, bp+964, uint32(60))
  16947. }
  16948. } else {
  16949. if (*(*Tstat)(unsafe.Pointer(bp + 380))).Fst_mode&uint32(m_S_IFMT3) == uint32(m_S_IFSOCK3) {
  16950. libc.Xmemset(tls, bp+740, 0, uint32(128))
  16951. *(*Tsocklen_t)(unsafe.Pointer(bp + 1108)) = uint32(128)
  16952. if libc.Xgetpeername(tls, 0, bp+740, bp+1108) == -int32(1) {
  16953. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16954. } else {
  16955. libmd.XSHA512Update(tls, bp+524, bp+740, uint32(128))
  16956. }
  16957. }
  16958. }
  16959. }
  16960. v18 = libc.Xgetrusage(tls, -int32(1), bp+100)
  16961. *(*int32)(unsafe.Pointer(bp + 64)) = v18
  16962. if v18 == -int32(1) {
  16963. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16964. } else {
  16965. libmd.XSHA512Update(tls, bp+524, bp+100, uint32(152))
  16966. }
  16967. if *(*int32)(unsafe.Pointer(bp + 64)) != -int32(1) {
  16968. _cnt += int32((*(*Trusage)(unsafe.Pointer(bp + 100))).Fru_utime.Ftv_sec)
  16969. _cnt += int32((*(*Trusage)(unsafe.Pointer(bp + 100))).Fru_utime.Ftv_usec)
  16970. }
  16971. } else {
  16972. /* Subsequent hashes absorb previous result */
  16973. libmd.XSHA512Update(tls, bp+524, bp, uint32(64))
  16974. }
  16975. v19 = libc.Xgettimeofday(tls, bp+84, libc.UintptrFromInt32(0))
  16976. *(*int32)(unsafe.Pointer(bp + 64)) = v19
  16977. if v19 == -int32(1) {
  16978. libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
  16979. } else {
  16980. libmd.XSHA512Update(tls, bp+524, bp+84, uint32(16))
  16981. }
  16982. if *(*int32)(unsafe.Pointer(bp + 64)) != -int32(1) {
  16983. _cnt += int32((*(*Ttimeval)(unsafe.Pointer(bp + 84))).Ftv_sec)
  16984. _cnt += int32((*(*Ttimeval)(unsafe.Pointer(bp + 84))).Ftv_usec)
  16985. }
  16986. libmd.XSHA512Update(tls, bp+524, uintptr(unsafe.Pointer(&_cnt)), uint32(4))
  16987. goto _2
  16988. _2:
  16989. ;
  16990. j++
  16991. }
  16992. /* Not as random as you think but we take what we are given */
  16993. *(*uintptr)(unsafe.Pointer(bp + 736)) = uintptr(libc.Int32FromUint32(libc.Xgetauxval(tls, uint32(m_AT_RANDOM))))
  16994. if *(*uintptr)(unsafe.Pointer(bp + 736)) != 0 {
  16995. libmd.XSHA512Update(tls, bp+524, *(*uintptr)(unsafe.Pointer(bp + 736)), libc.Uint32FromInt32(libc.Int32FromInt32(16)))
  16996. }
  16997. *(*uintptr)(unsafe.Pointer(bp + 736)) = uintptr(libc.Int32FromUint32(libc.Xgetauxval(tls, uint32(m_AT_SYSINFO_EHDR))))
  16998. if *(*uintptr)(unsafe.Pointer(bp + 736)) != 0 {
  16999. libmd.XSHA512Update(tls, bp+524, *(*uintptr)(unsafe.Pointer(bp + 736)), libc.Uint32FromInt32(pgs))
  17000. }
  17001. *(*uintptr)(unsafe.Pointer(bp + 736)) = uintptr(libc.Int32FromUint32(libc.Xgetauxval(tls, uint32(m_AT_BASE))))
  17002. if *(*uintptr)(unsafe.Pointer(bp + 736)) != 0 {
  17003. libmd.XSHA512Update(tls, bp+524, bp+736, uint32(4))
  17004. }
  17005. libmd.XSHA512Final(tls, bp, bp+524)
  17006. if libc.Uint32FromInt64(64) < len1-i {
  17007. v20 = libc.Uint32FromInt64(64)
  17008. } else {
  17009. v20 = len1 - i
  17010. }
  17011. libc.Xmemcpy(tls, buf+uintptr(i), bp, v20)
  17012. if libc.Uint32FromInt64(64) < len1-i {
  17013. v21 = libc.Uint32FromInt64(64)
  17014. } else {
  17015. v21 = len1 - i
  17016. }
  17017. i += v21
  17018. goto _1
  17019. _1:
  17020. }
  17021. Xexplicit_bzero(tls, bp+524, uint32(208))
  17022. Xexplicit_bzero(tls, bp, uint32(64))
  17023. if _gotdata(tls, buf, len1) == 0 {
  17024. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = save_errno
  17025. return 0 /* satisfied */
  17026. }
  17027. *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EIO)
  17028. return -int32(1)
  17029. }
  17030. var _cnt int32
  17031. var _lastpid Tpid_t
  17032. func __ccgo_fp(f interface{}) uintptr {
  17033. type iface [2]uintptr
  17034. return (*iface)(unsafe.Pointer(&f))[1]
  17035. }
  17036. var Xoptreset int32
  17037. var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data
  17038. var __ccgo_ts1 = "/proc/self/fd\x00%s: \x00: \x00%s\n\x00diouxX\x00DOU\x00aAeEfFgG\x00#'0- +\x00\x00BLOCKSIZE\x00G\x00K\x00M\x00%s: unknown blocksize\x00maximum blocksize is %ldG\x00minimum blocksize is 512\x00%ld%s-blocks\x00B\x00\x00Ki\x00Mi\x00Gi\x00Ti\x00Pi\x00Ei\x00\x00\x00\x00Ki\x00Mi\x00Gi\x00Ti\x00Pi\x00Ei\x00B\x00\x00k\x00\x00M\x00\x00G\x00\x00T\x00\x00P\x00\x00E\x00\x00\x00\x00k\x00\x00M\x00\x00G\x00\x00T\x00\x00P\x00\x00E\x00B\x00\x00K\x00\x00M\x00\x00G\x00\x00T\x00\x00P\x00\x00E\x00\x00\x00\x00K\x00\x00M\x00\x00G\x00\x00T\x00\x00P\x00\x00E\x00 \x00%d%s%d%s%s%s\x00%lld%s%s%s\x00/var/run/%s.pid\x00%u\x00/dev/tty\x00\n\x00setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.\x00%s\x00too large\x00too small\x00invalid\x000\x00\x00\x001\x00\x00\x002\x00\x00\x003\x00\x00\x004\x00\x00\x005\x00\x00\x006\x00\x00\x007\x00\x00\x008\x00\x00\x009\x00\x00\x00a\x00\x00\x00b\x00\x00\x00c\x00\x00\x00d\x00\x00\x00e\x00\x00\x00f\x00\x00\x00\x00\x00\x00\x00#\x00\x00\x00$\x00\x00\x00@\x00\x00\x00[\x00\x00\x00\\\x00\x00\x00]\x00\x00\x00^\x00\x00\x00`\x00\x00\x00{\x00\x00\x00|\x00\x00\x00}\x00\x00\x00~\x00\x00\x00\x00\x00\x00\x000\x00\x00\x001\x00\x00\x002\x00\x00\x003\x00\x00\x004\x00\x00\x005\x00\x00\x006\x00\x00\x007\x00\x00\x008\x00\x00\x009\x00\x00\x00A\x00\x00\x00B\x00\x00\x00C\x00\x00\x00D\x00\x00\x00E\x00\x00\x00F\x00\x00\x00\x00\x00\x00\x00/dev/urandom\x00.\x00/\x00"