| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746 |
- // 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.
- //go:build linux && 386
- package libbsd
- import (
- "reflect"
- "unsafe"
- "modernc.org/libc"
- "modernc.org/libmd"
- )
- var _ reflect.Type
- var _ unsafe.Pointer
- const m_ARG_MAX = 131072
- const m_AT_EACCESS = 0x200
- const m_AT_EMPTY_PATH = 0x1000
- const m_AT_NO_AUTOMOUNT = 0x800
- const m_AT_RECURSIVE = 0x8000
- const m_AT_REMOVEDIR = 0x200
- const m_AT_STATX_DONT_SYNC = 0x4000
- const m_AT_STATX_FORCE_SYNC = 0x2000
- const m_AT_STATX_SYNC_AS_STAT = 0x0000
- const m_AT_STATX_SYNC_TYPE = 0x6000
- const m_AT_SYMLINK_FOLLOW = 0x400
- const m_AT_SYMLINK_NOFOLLOW = 0x100
- const m_BC_BASE_MAX = 99
- const m_BC_DIM_MAX = 2048
- const m_BC_SCALE_MAX = 99
- const m_BC_STRING_MAX = 1000
- const m_BIG_ENDIAN = "__BIG_ENDIAN"
- const m_BLOCKSZ = 64
- const m_BUFSIZ = 1024
- const m_BUS_ADRALN = 1
- const m_BUS_ADRERR = 2
- const m_BUS_MCEERR_AO = 5
- const m_BUS_MCEERR_AR = 4
- const m_BUS_OBJERR = 3
- const m_BYTE_ORDER = "__BYTE_ORDER"
- const m_CANBSIZ = 255
- const m_CHARCLASS_NAME_MAX = 14
- const m_CHAR_BIT = 8
- const m_CHAR_MAX = 255
- const m_CHAR_MIN = 0
- const m_CLD_CONTINUED = 6
- const m_CLD_DUMPED = 3
- const m_CLD_EXITED = 1
- const m_CLD_KILLED = 2
- const m_CLD_STOPPED = 5
- const m_CLD_TRAPPED = 4
- const m_CLOCKS_PER_SEC = 1000000
- const m_CLOCK_BOOTTIME = 7
- const m_CLOCK_BOOTTIME_ALARM = 9
- const m_CLOCK_MONOTONIC = 1
- const m_CLOCK_MONOTONIC_COARSE = 6
- const m_CLOCK_MONOTONIC_RAW = 4
- const m_CLOCK_PROCESS_CPUTIME_ID = 2
- const m_CLOCK_REALTIME = 0
- const m_CLOCK_REALTIME_ALARM = 8
- const m_CLOCK_REALTIME_COARSE = 5
- const m_CLOCK_SGI_CYCLE = 10
- const m_CLOCK_TAI = 11
- const m_CLOCK_THREAD_CPUTIME_ID = 3
- const m_CLONE_CHILD_CLEARTID = 0x00200000
- const m_CLONE_CHILD_SETTID = 0x01000000
- const m_CLONE_DETACHED = 0x00400000
- const m_CLONE_FILES = 0x00000400
- const m_CLONE_FS = 0x00000200
- const m_CLONE_IO = 0x80000000
- const m_CLONE_NEWCGROUP = 0x02000000
- const m_CLONE_NEWIPC = 0x08000000
- const m_CLONE_NEWNET = 0x40000000
- const m_CLONE_NEWNS = 0x00020000
- const m_CLONE_NEWPID = 0x20000000
- const m_CLONE_NEWTIME = 0x00000080
- const m_CLONE_NEWUSER = 0x10000000
- const m_CLONE_NEWUTS = 0x04000000
- const m_CLONE_PARENT = 0x00008000
- const m_CLONE_PARENT_SETTID = 0x00100000
- const m_CLONE_PIDFD = 0x00001000
- const m_CLONE_PTRACE = 0x00002000
- const m_CLONE_SETTLS = 0x00080000
- const m_CLONE_SIGHAND = 0x00000800
- const m_CLONE_SYSVSEM = 0x00040000
- const m_CLONE_THREAD = 0x00010000
- const m_CLONE_UNTRACED = 0x00800000
- const m_CLONE_VFORK = 0x00004000
- const m_CLONE_VM = 0x00000100
- const m_COLL_WEIGHTS_MAX = 2
- const m_CPU_SETSIZE = 1024
- const m_CSIGNAL = 0x000000ff
- const m_DELAYTIMER_MAX = 0x7fffffff
- const m_DEV_BSIZE = 512
- const m_DN_ACCESS = 0x00000001
- const m_DN_ATTRIB = 0x00000020
- const m_DN_CREATE = 0x00000004
- const m_DN_DELETE = 0x00000008
- const m_DN_MODIFY = 0x00000002
- const m_DN_MULTISHOT = 0x80000000
- const m_DN_RENAME = 0x00000010
- const m_EXIT_FAILURE = 1
- const m_EXIT_SUCCESS = 0
- const m_EXPR_NEST_MAX = 32
- const m_FALLOC_FL_KEEP_SIZE = 1
- const m_FALLOC_FL_PUNCH_HOLE = 2
- const m_FAPPEND = "O_APPEND"
- const m_FASYNC = "O_ASYNC"
- const m_FD_CLOEXEC = 1
- const m_FD_SETSIZE = 1024
- const m_FFSYNC = "O_SYNC"
- const m_FILENAME_MAX = 4096
- const m_FILESIZEBITS = 64
- const m_FNDELAY = "O_NDELAY"
- const m_FNONBLOCK = "O_NONBLOCK"
- const m_FOPEN_MAX = 1000
- const m_FPARSELN_UNESCALL = 0x0f
- const m_FPARSELN_UNESCCOMM = 0x04
- const m_FPARSELN_UNESCCONT = 0x02
- const m_FPARSELN_UNESCESC = 0x01
- const m_FPARSELN_UNESCREST = 0x08
- const m_FPE_FLTDIV = 3
- const m_FPE_FLTINV = 7
- const m_FPE_FLTOVF = 4
- const m_FPE_FLTRES = 6
- const m_FPE_FLTSUB = 8
- const m_FPE_FLTUND = 5
- const m_FPE_INTDIV = 1
- const m_FPE_INTOVF = 2
- const m_F_ADD_SEALS = 1033
- const m_F_CANCELLK = 1029
- const m_F_DUPFD = 0
- const m_F_DUPFD_CLOEXEC = 1030
- const m_F_GETFD = 1
- const m_F_GETFL = 3
- const m_F_GETLEASE = 1025
- const m_F_GETLK = 12
- const m_F_GETOWN = 9
- const m_F_GETOWNER_UIDS = 17
- const m_F_GETOWN_EX = 16
- const m_F_GETPIPE_SZ = 1032
- const m_F_GETSIG = 11
- const m_F_GET_FILE_RW_HINT = 1037
- const m_F_GET_RW_HINT = 1035
- const m_F_GET_SEALS = 1034
- const m_F_LOCK = 1
- const m_F_NOTIFY = 1026
- const m_F_OFD_GETLK = 36
- const m_F_OFD_SETLK = 37
- const m_F_OFD_SETLKW = 38
- const m_F_OK = 0
- const m_F_OWNER_GID = 2
- const m_F_OWNER_PGRP = 2
- const m_F_OWNER_PID = 1
- const m_F_OWNER_TID = 0
- const m_F_RDLCK = 0
- const m_F_SEAL_FUTURE_WRITE = 0x0010
- const m_F_SEAL_GROW = 0x0004
- const m_F_SEAL_SEAL = 0x0001
- const m_F_SEAL_SHRINK = 0x0002
- const m_F_SEAL_WRITE = 0x0008
- const m_F_SETFD = 2
- const m_F_SETFL = 4
- const m_F_SETLEASE = 1024
- const m_F_SETLK = 13
- const m_F_SETLKW = 14
- const m_F_SETOWN = 8
- const m_F_SETOWN_EX = 15
- const m_F_SETPIPE_SZ = 1031
- const m_F_SETSIG = 10
- const m_F_SET_FILE_RW_HINT = 1038
- const m_F_SET_RW_HINT = 1036
- const m_F_TEST = 3
- const m_F_TLOCK = 2
- const m_F_ULOCK = 0
- const m_F_UNLCK = 2
- const m_F_WRLCK = 1
- const m_HAVE_CLEARENV = 1
- const m_HAVE_CONFIG_H = 1
- const m_HAVE_DIRENT_H = 1
- const m_HAVE_DIRFD = 1
- const m_HAVE_DLFCN_H = 1
- const m_HAVE_FOPENCOOKIE = 1
- const m_HAVE_GETAUXVAL = 1
- const m_HAVE_GETENTROPY = 1
- const m_HAVE_GETLINE = 1
- const m_HAVE_GRP_H = 1
- const m_HAVE_INTTYPES_H = 1
- const m_HAVE_PROGRAM_INVOCATION_SHORT_NAME = 1
- const m_HAVE_PWD_H = 1
- const m_HAVE_STDINT_H = 1
- const m_HAVE_STDIO_H = 1
- const m_HAVE_STDLIB_H = 1
- const m_HAVE_STRINGS_H = 1
- const m_HAVE_STRING_H = 1
- const m_HAVE_SYSCONF = 1
- const m_HAVE_SYS_DIR_H = 1
- const m_HAVE_SYS_STAT_H = 1
- const m_HAVE_SYS_TYPES_H = 1
- const m_HAVE_TYPEOF = 1
- const m_HAVE_UNISTD_H = 1
- const m_HAVE_WCHAR_H = 1
- const m_HAVE___FPURGE = 1
- const m_HAVE___PROGNAME = 1
- const m_HN_AUTOSCALE = 0x20
- const m_HN_B = 0x04
- const m_HN_DECIMAL = 0x01
- const m_HN_DIVISOR_1000 = 0x08
- const m_HN_GETSCALE = 0x10
- const m_HN_IEC_PREFIXES = 0x10
- const m_HN_NOSPACE = 0x02
- const m_HOST_NAME_MAX = 255
- const m_ILL_BADSTK = 8
- const m_ILL_COPROC = 7
- const m_ILL_ILLADR = 3
- const m_ILL_ILLOPC = 1
- const m_ILL_ILLOPN = 2
- const m_ILL_ILLTRP = 4
- const m_ILL_PRVOPC = 5
- const m_ILL_PRVREG = 6
- const m_INT16_MAX = 0x7fff
- const m_INT32_MAX = 0x7fffffff
- const m_INT64_MAX = 0x7fffffffffffffff
- const m_INT8_MAX = 0x7f
- const m_INTMAX_MAX = "INT64_MAX"
- const m_INTMAX_MIN = "INT64_MIN"
- const m_INTPTR_MAX = "INT32_MAX"
- const m_INTPTR_MIN = "INT32_MIN"
- const m_INT_FAST16_MAX = "INT32_MAX"
- const m_INT_FAST16_MIN = "INT32_MIN"
- const m_INT_FAST32_MAX = "INT32_MAX"
- const m_INT_FAST32_MIN = "INT32_MIN"
- const m_INT_FAST64_MAX = "INT64_MAX"
- const m_INT_FAST64_MIN = "INT64_MIN"
- const m_INT_FAST8_MAX = "INT8_MAX"
- const m_INT_FAST8_MIN = "INT8_MIN"
- const m_INT_LEAST16_MAX = "INT16_MAX"
- const m_INT_LEAST16_MIN = "INT16_MIN"
- const m_INT_LEAST32_MAX = "INT32_MAX"
- const m_INT_LEAST32_MIN = "INT32_MIN"
- const m_INT_LEAST64_MAX = "INT64_MAX"
- const m_INT_LEAST64_MIN = "INT64_MIN"
- const m_INT_LEAST8_MAX = "INT8_MAX"
- const m_INT_LEAST8_MIN = "INT8_MIN"
- const m_INT_MAX = 0x7fffffff
- const m_IOV_MAX = 1024
- const m_ITIMER_PROF = 2
- const m_ITIMER_REAL = 0
- const m_ITIMER_VIRTUAL = 1
- const m_IVSZ = 8
- const m_KEYSZ = 32
- const m_LIBBSD_DISABLE_DEPRECATED = 1
- const m_LIBBSD_OVERLAY = 1
- const m_LINE_MAX = 4096
- const m_LITTLE_ENDIAN = "__LITTLE_ENDIAN"
- const m_LLONG_MAX = 0x7fffffffffffffff
- const m_LOGIN_NAME_MAX = 256
- const m_LONG_BIT = 32
- const m_LONG_MAX = "__LONG_MAX"
- const m_LT_OBJDIR = ".libs/"
- const m_L_INCR = 1
- const m_L_SET = 0
- const m_L_XTND = 2
- const m_L_ctermid = 20
- const m_L_cuserid = 20
- const m_L_tmpnam = 20
- const m_MADV_COLD = 20
- const m_MADV_DODUMP = 17
- const m_MADV_DOFORK = 11
- const m_MADV_DONTDUMP = 16
- const m_MADV_DONTFORK = 10
- const m_MADV_DONTNEED = 4
- const m_MADV_FREE = 8
- const m_MADV_HUGEPAGE = 14
- const m_MADV_HWPOISON = 100
- const m_MADV_KEEPONFORK = 19
- const m_MADV_MERGEABLE = 12
- const m_MADV_NOHUGEPAGE = 15
- const m_MADV_NORMAL = 0
- const m_MADV_PAGEOUT = 21
- const m_MADV_RANDOM = 1
- const m_MADV_REMOVE = 9
- const m_MADV_SEQUENTIAL = 2
- const m_MADV_SOFT_OFFLINE = 101
- const m_MADV_UNMERGEABLE = 13
- const m_MADV_WILLNEED = 3
- const m_MADV_WIPEONFORK = 18
- const m_MAP_32BIT = 0x40
- const m_MAP_ANON = 32
- const m_MAP_ANONYMOUS = "MAP_ANON"
- const m_MAP_DENYWRITE = 0x0800
- const m_MAP_EXECUTABLE = 0x1000
- const m_MAP_FILE = 0
- const m_MAP_FIXED = 0x10
- const m_MAP_FIXED_NOREPLACE = 0x100000
- const m_MAP_GROWSDOWN = 0x0100
- const m_MAP_HUGETLB = 0x40000
- const m_MAP_HUGE_MASK = 0x3f
- const m_MAP_HUGE_SHIFT = 26
- const m_MAP_LOCKED = 0x2000
- const m_MAP_NONBLOCK = 0x10000
- const m_MAP_NORESERVE = 0x4000
- const m_MAP_POPULATE = 0x8000
- const m_MAP_PRIVATE = 2
- const m_MAP_SHARED = 0x01
- const m_MAP_SHARED_VALIDATE = 0x03
- const m_MAP_STACK = 0x20000
- const m_MAP_SYNC = 0x80000
- const m_MAP_TYPE = 0x0f
- const m_MAXHOSTNAMELEN = 64
- const m_MAXNAMLEN = 255
- const m_MAXPATHLEN = 4096
- const m_MAXSYMLINKS = 20
- const m_MAX_HANDLE_SZ = 128
- const m_MB_LEN_MAX = 4
- const m_MCL_CURRENT = 1
- const m_MCL_FUTURE = 2
- const m_MCL_ONFAULT = 4
- const m_MFD_ALLOW_SEALING = 0x0002
- const m_MFD_CLOEXEC = 0x0001
- const m_MFD_HUGETLB = 0x0004
- const m_MINSIGSTKSZ = 2048
- const m_MLOCK_ONFAULT = 0x01
- const m_MQ_PRIO_MAX = 32768
- const m_MREMAP_DONTUNMAP = 4
- const m_MREMAP_FIXED = 2
- const m_MREMAP_MAYMOVE = 1
- const m_MS_ASYNC = 1
- const m_MS_INVALIDATE = 2
- const m_MS_SYNC = 4
- const m_NAME_MAX = 255
- const m_NBBY = 8
- const m_NCARGS = 131072
- const m_NDEBUG = 1
- const m_NGROUPS = 32
- const m_NGROUPS_MAX = 32
- const m_NL_ARGMAX = 9
- const m_NL_LANGMAX = 32
- const m_NL_MSGMAX = 32767
- const m_NL_NMAX = 16
- const m_NL_SETMAX = 255
- const m_NL_TEXTMAX = 2048
- const m_NOFILE = 256
- const m_NSIG = "_NSIG"
- const m_NZERO = 20
- const m_O_APPEND = 02000
- const m_O_ASYNC = 020000
- const m_O_CLOEXEC = 02000000
- const m_O_CREAT = 0100
- const m_O_DIRECT = 040000
- const m_O_DIRECTORY = 0200000
- const m_O_DSYNC = 010000
- const m_O_EXCL = 0200
- const m_O_EXEC = "O_PATH"
- const m_O_LARGEFILE = 0100000
- const m_O_NDELAY = "O_NONBLOCK"
- const m_O_NOATIME = 01000000
- const m_O_NOCTTY = 0400
- const m_O_NOFOLLOW = 0400000
- const m_O_NONBLOCK = 04000
- const m_O_PATH = 010000000
- const m_O_RDONLY = 00
- const m_O_RDWR = 02
- const m_O_RSYNC = 04010000
- const m_O_SEARCH = "O_PATH"
- const m_O_SYNC = 04010000
- const m_O_TMPFILE = 020200000
- const m_O_TRUNC = 01000
- const m_O_TTY_INIT = 0
- const m_O_WRONLY = 01
- const m_PACKAGE = "libbsd"
- const m_PACKAGE_BUGREPORT = "libbsd@lists.freedesktop.org"
- const m_PACKAGE_NAME = "libbsd"
- const m_PACKAGE_STRING = "libbsd 0.11.7"
- const m_PACKAGE_TARNAME = "libbsd"
- const m_PACKAGE_URL = ""
- const m_PACKAGE_VERSION = "0.11.7"
- const m_PAGESIZE = 4096
- const m_PAGE_SIZE = "PAGESIZE"
- const m_PATH_MAX = 4096
- const m_PDP_ENDIAN = "__PDP_ENDIAN"
- const m_PIC = 1
- const m_PIPE_BUF = 4096
- const m_POLL_ERR = 4
- const m_POLL_HUP = 6
- const m_POLL_IN = 1
- const m_POLL_MSG = 3
- const m_POLL_OUT = 2
- const m_POLL_PRI = 5
- const m_POSIX_CLOSE_RESTART = 0
- const m_POSIX_FADV_DONTNEED = 4
- const m_POSIX_FADV_NOREUSE = 5
- const m_POSIX_FADV_NORMAL = 0
- const m_POSIX_FADV_RANDOM = 1
- const m_POSIX_FADV_SEQUENTIAL = 2
- const m_POSIX_FADV_WILLNEED = 3
- const m_POSIX_MADV_DONTNEED = 4
- const m_POSIX_MADV_NORMAL = 0
- const m_POSIX_MADV_RANDOM = 1
- const m_POSIX_MADV_SEQUENTIAL = 2
- const m_POSIX_MADV_WILLNEED = 3
- const m_PRIO_MAX = 20
- const m_PRIO_PGRP = 1
- const m_PRIO_PROCESS = 0
- const m_PRIO_USER = 2
- const m_PROT_EXEC = 4
- const m_PROT_GROWSDOWN = 0x01000000
- const m_PROT_GROWSUP = 0x02000000
- const m_PROT_NONE = 0
- const m_PROT_READ = 1
- const m_PROT_WRITE = 2
- const m_PTHREAD_CANCEL_ASYNCHRONOUS = 1
- const m_PTHREAD_CANCEL_DEFERRED = 0
- const m_PTHREAD_CANCEL_DISABLE = 1
- const m_PTHREAD_CANCEL_ENABLE = 0
- const m_PTHREAD_CANCEL_MASKED = 2
- const m_PTHREAD_CREATE_DETACHED = 1
- const m_PTHREAD_CREATE_JOINABLE = 0
- const m_PTHREAD_DESTRUCTOR_ITERATIONS = 4
- const m_PTHREAD_EXPLICIT_SCHED = 1
- const m_PTHREAD_INHERIT_SCHED = 0
- const m_PTHREAD_KEYS_MAX = 128
- const m_PTHREAD_MUTEX_DEFAULT = 0
- const m_PTHREAD_MUTEX_ERRORCHECK = 2
- const m_PTHREAD_MUTEX_NORMAL = 0
- const m_PTHREAD_MUTEX_RECURSIVE = 1
- const m_PTHREAD_MUTEX_ROBUST = 1
- const m_PTHREAD_MUTEX_STALLED = 0
- const m_PTHREAD_ONCE_INIT = 0
- const m_PTHREAD_PRIO_INHERIT = 1
- const m_PTHREAD_PRIO_NONE = 0
- const m_PTHREAD_PRIO_PROTECT = 2
- const m_PTHREAD_PROCESS_PRIVATE = 0
- const m_PTHREAD_PROCESS_SHARED = 1
- const m_PTHREAD_SCOPE_PROCESS = 1
- const m_PTHREAD_SCOPE_SYSTEM = 0
- const m_PTHREAD_STACK_MIN = 2048
- const m_PTRDIFF_MAX = "INT32_MAX"
- const m_PTRDIFF_MIN = "INT32_MIN"
- const m_P_tmpdir = "/tmp"
- const m_RAND_MAX = 0x7fffffff
- const m_RE_DUP_MAX = 255
- const m_RLIMIT_AS = 9
- const m_RLIMIT_CORE = 4
- const m_RLIMIT_CPU = 0
- const m_RLIMIT_DATA = 2
- const m_RLIMIT_FSIZE = 1
- const m_RLIMIT_LOCKS = 10
- const m_RLIMIT_MEMLOCK = 8
- const m_RLIMIT_MSGQUEUE = 12
- const m_RLIMIT_NICE = 13
- const m_RLIMIT_NLIMITS = 16
- const m_RLIMIT_NOFILE = 7
- const m_RLIMIT_NPROC = 6
- const m_RLIMIT_RSS = 5
- const m_RLIMIT_RTPRIO = 14
- const m_RLIMIT_RTTIME = 15
- const m_RLIMIT_SIGPENDING = 11
- const m_RLIMIT_STACK = 3
- const m_RLIM_NLIMITS = "RLIMIT_NLIMITS"
- const m_RLIM_SAVED_CUR = "RLIM_INFINITY"
- const m_RLIM_SAVED_MAX = "RLIM_INFINITY"
- const m_RUSAGE_SELF = 0
- const m_RUSAGE_THREAD = 1
- const m_RWF_WRITE_LIFE_NOT_SET = 0
- const m_RWH_WRITE_LIFE_EXTREME = 5
- const m_RWH_WRITE_LIFE_LONG = 4
- const m_RWH_WRITE_LIFE_MEDIUM = 3
- const m_RWH_WRITE_LIFE_NONE = 1
- const m_RWH_WRITE_LIFE_SHORT = 2
- const m_R_OK = 4
- const m_SA_EXPOSE_TAGBITS = 0x00000800
- const m_SA_NOCLDSTOP = 1
- const m_SA_NOCLDWAIT = 2
- const m_SA_NODEFER = 0x40000000
- const m_SA_NOMASK = "SA_NODEFER"
- const m_SA_ONESHOT = "SA_RESETHAND"
- const m_SA_ONSTACK = 0x08000000
- const m_SA_RESETHAND = 0x80000000
- const m_SA_RESTART = 0x10000000
- const m_SA_RESTORER = 0x04000000
- const m_SA_SIGINFO = 4
- const m_SA_UNSUPPORTED = 0x00000400
- const m_SCHAR_MAX = 127
- const m_SCHED_BATCH = 3
- const m_SCHED_DEADLINE = 6
- const m_SCHED_FIFO = 1
- const m_SCHED_IDLE = 5
- const m_SCHED_OTHER = 0
- const m_SCHED_RESET_ON_FORK = 0x40000000
- const m_SCHED_RR = 2
- const m_SEEK_DATA = 3
- const m_SEEK_HOLE = 4
- const m_SEGV_ACCERR = 2
- const m_SEGV_BNDERR = 3
- const m_SEGV_MAPERR = 1
- const m_SEGV_MTEAERR = 8
- const m_SEGV_MTESERR = 9
- const m_SEGV_PKUERR = 4
- const m_SEM_NSEMS_MAX = 256
- const m_SEM_VALUE_MAX = 0x7fffffff
- const m_SHRT_MAX = 0x7fff
- const m_SIGABRT = 6
- const m_SIGALRM = 14
- const m_SIGBUS = 7
- const m_SIGCHLD = 17
- const m_SIGCONT = 18
- const m_SIGEV_NONE = 1
- const m_SIGEV_SIGNAL = 0
- const m_SIGEV_THREAD = 2
- const m_SIGEV_THREAD_ID = 4
- const m_SIGFPE = 8
- const m_SIGHUP = 1
- const m_SIGILL = 4
- const m_SIGINT = 2
- const m_SIGIO = 29
- const m_SIGIOT = "SIGABRT"
- const m_SIGKILL = 9
- const m_SIGPIPE = 13
- const m_SIGPOLL = 29
- const m_SIGPROF = 27
- const m_SIGPWR = 30
- const m_SIGQUIT = 3
- const m_SIGSEGV = 11
- const m_SIGSTKFLT = 16
- const m_SIGSTKSZ = 8192
- const m_SIGSTOP = 19
- const m_SIGSYS = 31
- const m_SIGTERM = 15
- const m_SIGTRAP = 5
- const m_SIGTSTP = 20
- const m_SIGTTIN = 21
- const m_SIGTTOU = 22
- const m_SIGUNUSED = "SIGSYS"
- const m_SIGURG = 23
- const m_SIGUSR1 = 10
- const m_SIGUSR2 = 12
- const m_SIGVTALRM = 26
- const m_SIGWINCH = 28
- const m_SIGXCPU = 24
- const m_SIGXFSZ = 25
- const m_SIG_ATOMIC_MAX = "INT32_MAX"
- const m_SIG_ATOMIC_MIN = "INT32_MIN"
- const m_SIG_BLOCK = 0
- const m_SIG_SETMASK = 2
- const m_SIG_UNBLOCK = 1
- const m_SIZE_MAX = "UINT32_MAX"
- const m_SI_KERNEL = 128
- const m_SI_USER = 0
- const m_SPLICE_F_GIFT = 8
- const m_SPLICE_F_MORE = 4
- const m_SPLICE_F_MOVE = 1
- const m_SPLICE_F_NONBLOCK = 2
- const m_SSIZE_MAX = "LONG_MAX"
- const m_SS_DISABLE = 2
- const m_SS_FLAG_BITS = "SS_AUTODISARM"
- const m_SS_ONSTACK = 1
- const m_STATX_ALL = 0xfff
- const m_STATX_ATIME = 0x20
- const m_STATX_BASIC_STATS = 0x7ff
- const m_STATX_BLOCKS = 0x400
- const m_STATX_BTIME = 0x800
- const m_STATX_CTIME = 0x80
- const m_STATX_GID = 0x10
- const m_STATX_INO = 0x100
- const m_STATX_MODE = 2
- const m_STATX_MTIME = 0x40
- const m_STATX_NLINK = 4
- const m_STATX_SIZE = 0x200
- const m_STATX_TYPE = 1
- const m_STATX_UID = 8
- const m_STDC_HEADERS = 1
- const m_STDERR_FILENO = 2
- const m_STDIN_FILENO = 0
- const m_STDOUT_FILENO = 1
- const m_SYMLOOP_MAX = 40
- const m_SYNC_FILE_RANGE_WAIT_AFTER = 4
- const m_SYNC_FILE_RANGE_WAIT_BEFORE = 1
- const m_SYNC_FILE_RANGE_WRITE = 2
- const m_SYS_SECCOMP = 1
- const m_SYS_USER_DISPATCH = 2
- const m_S_IEXEC = "S_IXUSR"
- const m_S_IFBLK = 0060000
- const m_S_IFCHR = 0020000
- const m_S_IFDIR = 0040000
- const m_S_IFIFO = 0010000
- const m_S_IFLNK = 0120000
- const m_S_IFMT = 0170000
- const m_S_IFREG = 0100000
- const m_S_IFSOCK = 0140000
- const m_S_IREAD = "S_IRUSR"
- const m_S_IRGRP = 0040
- const m_S_IROTH = 0004
- const m_S_IRUSR = 0400
- const m_S_IRWXG = 0070
- const m_S_IRWXO = 0007
- const m_S_IRWXU = 0700
- const m_S_ISGID = 02000
- const m_S_ISTXT = "S_ISVTX"
- const m_S_ISUID = 04000
- const m_S_ISVTX = 01000
- const m_S_IWGRP = 0020
- const m_S_IWOTH = 0002
- const m_S_IWRITE = "S_IWUSR"
- const m_S_IWUSR = 0200
- const m_S_IXGRP = 0010
- const m_S_IXOTH = 0001
- const m_S_IXUSR = 0100
- const m_TIMER_ABSTIME = 1
- const m_TIME_UTC = 1
- const m_TMP_MAX = 10000
- const m_TRAP_BRANCH = 3
- const m_TRAP_BRKPT = 1
- const m_TRAP_HWBKPT = 4
- const m_TRAP_TRACE = 2
- const m_TRAP_UNK = 5
- const m_TTY_NAME_MAX = 32
- const m_TZNAME_MAX = 6
- const m_UCHAR_MAX = 255
- const m_UINT16_MAX = 0xffff
- const m_UINT32_MAX = "0xffffffffu"
- const m_UINT64_MAX = "0xffffffffffffffffu"
- const m_UINT8_MAX = 0xff
- const m_UINTMAX_MAX = "UINT64_MAX"
- const m_UINTPTR_MAX = "UINT32_MAX"
- const m_UINT_FAST16_MAX = "UINT32_MAX"
- const m_UINT_FAST32_MAX = "UINT32_MAX"
- const m_UINT_FAST64_MAX = "UINT64_MAX"
- const m_UINT_FAST8_MAX = "UINT8_MAX"
- const m_UINT_LEAST16_MAX = "UINT16_MAX"
- const m_UINT_LEAST32_MAX = "UINT32_MAX"
- const m_UINT_LEAST64_MAX = "UINT64_MAX"
- const m_UINT_LEAST8_MAX = "UINT8_MAX"
- const m_UINT_MAX = 0xffffffff
- const m_USHRT_MAX = 0xffff
- const m_UTIME_NOW = 0x3fffffff
- const m_UTIME_OMIT = 0x3ffffffe
- const m_VERSION = "0.11.7"
- const m_WINT_MAX = "UINT32_MAX"
- const m_WINT_MIN = 0
- const m_WNOHANG = 1
- const m_WORD_BIT = 32
- const m_WUNTRACED = 2
- const m_W_OK = 2
- const m_X_OK = 1
- const m__ALL_SOURCE = 1
- const m__CS_GNU_LIBC_VERSION = 2
- const m__CS_GNU_LIBPTHREAD_VERSION = 3
- const m__CS_PATH = 0
- const m__CS_POSIX_V5_WIDTH_RESTRICTED_ENVS = 4
- const m__CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116
- const m__CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117
- const m__CS_POSIX_V6_ILP32_OFF32_LIBS = 1118
- const m__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 1119
- const m__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120
- const m__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121
- const m__CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122
- const m__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123
- const m__CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124
- const m__CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125
- const m__CS_POSIX_V6_LP64_OFF64_LIBS = 1126
- const m__CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127
- const m__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128
- const m__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129
- const m__CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130
- const m__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131
- const m__CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 1
- const m__CS_POSIX_V7_ILP32_OFF32_CFLAGS = 1132
- const m__CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 1133
- const m__CS_POSIX_V7_ILP32_OFF32_LIBS = 1134
- const m__CS_POSIX_V7_ILP32_OFF32_LINTFLAGS = 1135
- const m__CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 1136
- const m__CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 1137
- const m__CS_POSIX_V7_ILP32_OFFBIG_LIBS = 1138
- const m__CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139
- const m__CS_POSIX_V7_LP64_OFF64_CFLAGS = 1140
- const m__CS_POSIX_V7_LP64_OFF64_LDFLAGS = 1141
- const m__CS_POSIX_V7_LP64_OFF64_LIBS = 1142
- const m__CS_POSIX_V7_LP64_OFF64_LINTFLAGS = 1143
- const m__CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 1144
- const m__CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 1145
- const m__CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 1146
- const m__CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147
- const m__CS_POSIX_V7_THREADS_CFLAGS = 1150
- const m__CS_POSIX_V7_THREADS_LDFLAGS = 1151
- const m__CS_POSIX_V7_WIDTH_RESTRICTED_ENVS = 5
- const m__CS_V6_ENV = 1148
- const m__CS_V7_ENV = 1149
- const m__DARWIN_C_SOURCE = 1
- const m__FILE_OFFSET_BITS = 64
- const m__GNU_SOURCE = 1
- const m__HPUX_ALT_XOPEN_SOCKET_API = 1
- const m__ILP32 = 1
- const m__IOFBF = 0
- const m__IOLBF = 1
- const m__IONBF = 2
- const m__NETBSD_SOURCE = 1
- const m__NSIG = 65
- const m__OPENBSD_SOURCE = 1
- const m__PC_2_SYMLINKS = 20
- const m__PC_ALLOC_SIZE_MIN = 18
- const m__PC_ASYNC_IO = 10
- const m__PC_CHOWN_RESTRICTED = 6
- const m__PC_FILESIZEBITS = 13
- const m__PC_LINK_MAX = 0
- const m__PC_MAX_CANON = 1
- const m__PC_MAX_INPUT = 2
- const m__PC_NAME_MAX = 3
- const m__PC_NO_TRUNC = 7
- const m__PC_PATH_MAX = 4
- const m__PC_PIPE_BUF = 5
- const m__PC_PRIO_IO = 11
- const m__PC_REC_INCR_XFER_SIZE = 14
- const m__PC_REC_MAX_XFER_SIZE = 15
- const m__PC_REC_MIN_XFER_SIZE = 16
- const m__PC_REC_XFER_ALIGN = 17
- const m__PC_SOCK_MAXBUF = 12
- const m__PC_SYMLINK_MAX = 19
- const m__PC_SYNC_IO = 9
- const m__PC_VDISABLE = 8
- const m__POSIX2_BC_BASE_MAX = 99
- const m__POSIX2_BC_DIM_MAX = 2048
- const m__POSIX2_BC_SCALE_MAX = 99
- const m__POSIX2_BC_STRING_MAX = 1000
- const m__POSIX2_CHARCLASS_NAME_MAX = 14
- const m__POSIX2_COLL_WEIGHTS_MAX = 2
- const m__POSIX2_C_BIND = "_POSIX_VERSION"
- const m__POSIX2_EXPR_NEST_MAX = 32
- const m__POSIX2_LINE_MAX = 2048
- const m__POSIX2_RE_DUP_MAX = 255
- const m__POSIX2_VERSION = "_POSIX_VERSION"
- const m__POSIX_ADVISORY_INFO = "_POSIX_VERSION"
- const m__POSIX_AIO_LISTIO_MAX = 2
- const m__POSIX_AIO_MAX = 1
- const m__POSIX_ARG_MAX = 4096
- const m__POSIX_ASYNCHRONOUS_IO = "_POSIX_VERSION"
- const m__POSIX_BARRIERS = "_POSIX_VERSION"
- const m__POSIX_CHILD_MAX = 25
- const m__POSIX_CHOWN_RESTRICTED = 1
- const m__POSIX_CLOCKRES_MIN = 20000000
- const m__POSIX_CLOCK_SELECTION = "_POSIX_VERSION"
- const m__POSIX_CPUTIME = "_POSIX_VERSION"
- const m__POSIX_DELAYTIMER_MAX = 32
- const m__POSIX_FSYNC = "_POSIX_VERSION"
- const m__POSIX_HOST_NAME_MAX = 255
- const m__POSIX_IPV6 = "_POSIX_VERSION"
- const m__POSIX_JOB_CONTROL = 1
- const m__POSIX_LINK_MAX = 8
- const m__POSIX_LOGIN_NAME_MAX = 9
- const m__POSIX_MAPPED_FILES = "_POSIX_VERSION"
- const m__POSIX_MAX_CANON = 255
- const m__POSIX_MAX_INPUT = 255
- const m__POSIX_MEMLOCK = "_POSIX_VERSION"
- const m__POSIX_MEMLOCK_RANGE = "_POSIX_VERSION"
- const m__POSIX_MEMORY_PROTECTION = "_POSIX_VERSION"
- const m__POSIX_MESSAGE_PASSING = "_POSIX_VERSION"
- const m__POSIX_MONOTONIC_CLOCK = "_POSIX_VERSION"
- const m__POSIX_MQ_OPEN_MAX = 8
- const m__POSIX_MQ_PRIO_MAX = 32
- const m__POSIX_NAME_MAX = 14
- const m__POSIX_NGROUPS_MAX = 8
- const m__POSIX_NO_TRUNC = 1
- const m__POSIX_OPEN_MAX = 20
- const m__POSIX_PATH_MAX = 256
- const m__POSIX_PIPE_BUF = 512
- const m__POSIX_PTHREAD_SEMANTICS = 1
- const m__POSIX_RAW_SOCKETS = "_POSIX_VERSION"
- const m__POSIX_READER_WRITER_LOCKS = "_POSIX_VERSION"
- const m__POSIX_REALTIME_SIGNALS = "_POSIX_VERSION"
- const m__POSIX_REGEXP = 1
- const m__POSIX_RE_DUP_MAX = 255
- const m__POSIX_RTSIG_MAX = 8
- const m__POSIX_SAVED_IDS = 1
- const m__POSIX_SEMAPHORES = "_POSIX_VERSION"
- const m__POSIX_SEM_NSEMS_MAX = 256
- const m__POSIX_SEM_VALUE_MAX = 32767
- const m__POSIX_SHARED_MEMORY_OBJECTS = "_POSIX_VERSION"
- const m__POSIX_SHELL = 1
- const m__POSIX_SIGQUEUE_MAX = 32
- const m__POSIX_SPAWN = "_POSIX_VERSION"
- const m__POSIX_SPIN_LOCKS = "_POSIX_VERSION"
- const m__POSIX_SSIZE_MAX = 32767
- const m__POSIX_SS_REPL_MAX = 4
- const m__POSIX_STREAM_MAX = 8
- const m__POSIX_SYMLINK_MAX = 255
- const m__POSIX_SYMLOOP_MAX = 8
- const m__POSIX_THREADS = "_POSIX_VERSION"
- const m__POSIX_THREAD_ATTR_STACKADDR = "_POSIX_VERSION"
- const m__POSIX_THREAD_ATTR_STACKSIZE = "_POSIX_VERSION"
- const m__POSIX_THREAD_CPUTIME = "_POSIX_VERSION"
- const m__POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4
- const m__POSIX_THREAD_KEYS_MAX = 128
- const m__POSIX_THREAD_PRIORITY_SCHEDULING = "_POSIX_VERSION"
- const m__POSIX_THREAD_PROCESS_SHARED = "_POSIX_VERSION"
- const m__POSIX_THREAD_SAFE_FUNCTIONS = "_POSIX_VERSION"
- const m__POSIX_THREAD_THREADS_MAX = 64
- const m__POSIX_TIMEOUTS = "_POSIX_VERSION"
- const m__POSIX_TIMERS = "_POSIX_VERSION"
- const m__POSIX_TIMER_MAX = 32
- const m__POSIX_TRACE_EVENT_NAME_MAX = 30
- const m__POSIX_TRACE_NAME_MAX = 8
- const m__POSIX_TRACE_SYS_MAX = 8
- const m__POSIX_TRACE_USER_EVENT_MAX = 32
- const m__POSIX_TTY_NAME_MAX = 9
- const m__POSIX_TZNAME_MAX = 6
- const m__POSIX_V6_ILP32_OFFBIG = 1
- const m__POSIX_V7_ILP32_OFFBIG = 1
- const m__POSIX_VDISABLE = 0
- const m__POSIX_VERSION = 200809
- const m__REDIR_TIME64 = 1
- const m__SC_2_CHAR_TERM = 95
- const m__SC_2_C_BIND = 47
- const m__SC_2_C_DEV = 48
- const m__SC_2_FORT_DEV = 49
- const m__SC_2_FORT_RUN = 50
- const m__SC_2_LOCALEDEF = 52
- const m__SC_2_PBS = 168
- const m__SC_2_PBS_ACCOUNTING = 169
- const m__SC_2_PBS_CHECKPOINT = 175
- const m__SC_2_PBS_LOCATE = 170
- const m__SC_2_PBS_MESSAGE = 171
- const m__SC_2_PBS_TRACK = 172
- const m__SC_2_SW_DEV = 51
- const m__SC_2_UPE = 97
- const m__SC_2_VERSION = 46
- const m__SC_ADVISORY_INFO = 132
- const m__SC_AIO_LISTIO_MAX = 23
- const m__SC_AIO_MAX = 24
- const m__SC_AIO_PRIO_DELTA_MAX = 25
- const m__SC_ARG_MAX = 0
- const m__SC_ASYNCHRONOUS_IO = 12
- const m__SC_ATEXIT_MAX = 87
- const m__SC_AVPHYS_PAGES = 86
- const m__SC_BARRIERS = 133
- const m__SC_BC_BASE_MAX = 36
- const m__SC_BC_DIM_MAX = 37
- const m__SC_BC_SCALE_MAX = 38
- const m__SC_BC_STRING_MAX = 39
- const m__SC_CHILD_MAX = 1
- const m__SC_CLK_TCK = 2
- const m__SC_CLOCK_SELECTION = 137
- const m__SC_COLL_WEIGHTS_MAX = 40
- const m__SC_CPUTIME = 138
- const m__SC_DELAYTIMER_MAX = 26
- const m__SC_EXPR_NEST_MAX = 42
- const m__SC_FSYNC = 15
- const m__SC_GETGR_R_SIZE_MAX = 69
- const m__SC_GETPW_R_SIZE_MAX = 70
- const m__SC_HOST_NAME_MAX = 180
- const m__SC_IOV_MAX = 60
- const m__SC_IPV6 = 235
- const m__SC_JOB_CONTROL = 7
- const m__SC_LINE_MAX = 43
- const m__SC_LOGIN_NAME_MAX = 71
- const m__SC_MAPPED_FILES = 16
- const m__SC_MEMLOCK = 17
- const m__SC_MEMLOCK_RANGE = 18
- const m__SC_MEMORY_PROTECTION = 19
- const m__SC_MESSAGE_PASSING = 20
- const m__SC_MINSIGSTKSZ = 249
- const m__SC_MONOTONIC_CLOCK = 149
- const m__SC_MQ_OPEN_MAX = 27
- const m__SC_MQ_PRIO_MAX = 28
- const m__SC_NGROUPS_MAX = 3
- const m__SC_NPROCESSORS_CONF = 83
- const m__SC_NPROCESSORS_ONLN = 84
- const m__SC_NZERO = 109
- const m__SC_OPEN_MAX = 4
- const m__SC_PAGESIZE = 30
- const m__SC_PAGE_SIZE = 30
- const m__SC_PASS_MAX = 88
- const m__SC_PHYS_PAGES = 85
- const m__SC_PRIORITIZED_IO = 13
- const m__SC_PRIORITY_SCHEDULING = 10
- const m__SC_RAW_SOCKETS = 236
- const m__SC_READER_WRITER_LOCKS = 153
- const m__SC_REALTIME_SIGNALS = 9
- const m__SC_REGEXP = 155
- const m__SC_RE_DUP_MAX = 44
- const m__SC_RTSIG_MAX = 31
- const m__SC_SAVED_IDS = 8
- const m__SC_SEMAPHORES = 21
- const m__SC_SEM_NSEMS_MAX = 32
- const m__SC_SEM_VALUE_MAX = 33
- const m__SC_SHARED_MEMORY_OBJECTS = 22
- const m__SC_SHELL = 157
- const m__SC_SIGQUEUE_MAX = 34
- const m__SC_SIGSTKSZ = 250
- const m__SC_SPAWN = 159
- const m__SC_SPIN_LOCKS = 154
- const m__SC_SPORADIC_SERVER = 160
- const m__SC_SS_REPL_MAX = 241
- const m__SC_STREAMS = 174
- const m__SC_STREAM_MAX = 5
- const m__SC_SYMLOOP_MAX = 173
- const m__SC_SYNCHRONIZED_IO = 14
- const m__SC_THREADS = 67
- const m__SC_THREAD_ATTR_STACKADDR = 77
- const m__SC_THREAD_ATTR_STACKSIZE = 78
- const m__SC_THREAD_CPUTIME = 139
- const m__SC_THREAD_DESTRUCTOR_ITERATIONS = 73
- const m__SC_THREAD_KEYS_MAX = 74
- const m__SC_THREAD_PRIORITY_SCHEDULING = 79
- const m__SC_THREAD_PRIO_INHERIT = 80
- const m__SC_THREAD_PRIO_PROTECT = 81
- const m__SC_THREAD_PROCESS_SHARED = 82
- const m__SC_THREAD_ROBUST_PRIO_INHERIT = 247
- const m__SC_THREAD_ROBUST_PRIO_PROTECT = 248
- const m__SC_THREAD_SAFE_FUNCTIONS = 68
- const m__SC_THREAD_SPORADIC_SERVER = 161
- const m__SC_THREAD_STACK_MIN = 75
- const m__SC_THREAD_THREADS_MAX = 76
- const m__SC_TIMEOUTS = 164
- const m__SC_TIMERS = 11
- const m__SC_TIMER_MAX = 35
- const m__SC_TRACE = 181
- const m__SC_TRACE_EVENT_FILTER = 182
- const m__SC_TRACE_EVENT_NAME_MAX = 242
- const m__SC_TRACE_INHERIT = 183
- const m__SC_TRACE_LOG = 184
- const m__SC_TRACE_NAME_MAX = 243
- const m__SC_TRACE_SYS_MAX = 244
- const m__SC_TRACE_USER_EVENT_MAX = 245
- const m__SC_TTY_NAME_MAX = 72
- const m__SC_TYPED_MEMORY_OBJECTS = 165
- const m__SC_TZNAME_MAX = 6
- const m__SC_UIO_MAXIOV = 60
- const m__SC_V6_ILP32_OFF32 = 176
- const m__SC_V6_ILP32_OFFBIG = 177
- const m__SC_V6_LP64_OFF64 = 178
- const m__SC_V6_LPBIG_OFFBIG = 179
- const m__SC_V7_ILP32_OFF32 = 237
- const m__SC_V7_ILP32_OFFBIG = 238
- const m__SC_V7_LP64_OFF64 = 239
- const m__SC_V7_LPBIG_OFFBIG = 240
- const m__SC_VERSION = 29
- const m__SC_XBS5_ILP32_OFF32 = 125
- const m__SC_XBS5_ILP32_OFFBIG = 126
- const m__SC_XBS5_LP64_OFF64 = 127
- const m__SC_XBS5_LPBIG_OFFBIG = 128
- const m__SC_XOPEN_CRYPT = 92
- const m__SC_XOPEN_ENH_I18N = 93
- const m__SC_XOPEN_LEGACY = 129
- const m__SC_XOPEN_REALTIME = 130
- const m__SC_XOPEN_REALTIME_THREADS = 131
- const m__SC_XOPEN_SHM = 94
- const m__SC_XOPEN_STREAMS = 246
- const m__SC_XOPEN_UNIX = 91
- const m__SC_XOPEN_VERSION = 89
- const m__SC_XOPEN_XCU_VERSION = 90
- const m__SC_XOPEN_XPG2 = 98
- const m__SC_XOPEN_XPG3 = 99
- const m__SC_XOPEN_XPG4 = 100
- const m__STDC_PREDEF_H = 1
- const m__SYS_CDEFS_H = 1
- const m__TANDEM_SOURCE = 1
- const m__XOPEN_ENH_I18N = 1
- const m__XOPEN_IOV_MAX = 16
- const m__XOPEN_NAME_MAX = 255
- const m__XOPEN_PATH_MAX = 1024
- const m__XOPEN_UNIX = 1
- const m__XOPEN_VERSION = 700
- const m___ATOMIC_ACQUIRE = 2
- const m___ATOMIC_ACQ_REL = 4
- const m___ATOMIC_CONSUME = 1
- const m___ATOMIC_HLE_ACQUIRE = 65536
- const m___ATOMIC_HLE_RELEASE = 131072
- const m___ATOMIC_RELAXED = 0
- const m___ATOMIC_RELEASE = 3
- const m___ATOMIC_SEQ_CST = 5
- const m___BIGGEST_ALIGNMENT__ = 16
- const m___BIG_ENDIAN = 4321
- const m___BYTE_ORDER = 1234
- const m___BYTE_ORDER__ = "__ORDER_LITTLE_ENDIAN__"
- const m___CCGO__ = 1
- const m___CHAR_BIT__ = 8
- const m___DBL_DECIMAL_DIG__ = 17
- const m___DBL_DIG__ = 15
- const m___DBL_HAS_DENORM__ = 1
- const m___DBL_HAS_INFINITY__ = 1
- const m___DBL_HAS_QUIET_NAN__ = 1
- const m___DBL_IS_IEC_60559__ = 2
- const m___DBL_MANT_DIG__ = 53
- const m___DBL_MAX_10_EXP__ = 308
- const m___DBL_MAX_EXP__ = 1024
- const m___DEC128_EPSILON__ = 1e-33
- const m___DEC128_MANT_DIG__ = 34
- const m___DEC128_MAX_EXP__ = 6145
- const m___DEC128_MAX__ = "9.999999999999999999999999999999999E6144"
- const m___DEC128_MIN__ = 1e-6143
- const m___DEC128_SUBNORMAL_MIN__ = 0.000000000000000000000000000000001e-6143
- const m___DEC32_EPSILON__ = 1e-6
- const m___DEC32_MANT_DIG__ = 7
- const m___DEC32_MAX_EXP__ = 97
- const m___DEC32_MAX__ = 9.999999e96
- const m___DEC32_MIN__ = 1e-95
- const m___DEC32_SUBNORMAL_MIN__ = 0.000001e-95
- const m___DEC64_EPSILON__ = 1e-15
- const m___DEC64_MANT_DIG__ = 16
- const m___DEC64_MAX_EXP__ = 385
- const m___DEC64_MAX__ = "9.999999999999999E384"
- const m___DEC64_MIN__ = 1e-383
- const m___DEC64_SUBNORMAL_MIN__ = 0.000000000000001e-383
- const m___DECIMAL_BID_FORMAT__ = 1
- const m___DECIMAL_DIG__ = 17
- const m___DEC_EVAL_METHOD__ = 2
- const m___ELF__ = 1
- const m___EXTENSIONS__ = 1
- const m___FINITE_MATH_ONLY__ = 0
- const m___FLOAT_WORD_ORDER__ = "__ORDER_LITTLE_ENDIAN__"
- const m___FLT128_DECIMAL_DIG__ = 36
- const m___FLT128_DENORM_MIN__ = 6.47517511943802511092443895822764655e-4966
- const m___FLT128_DIG__ = 33
- const m___FLT128_EPSILON__ = 1.92592994438723585305597794258492732e-34
- const m___FLT128_HAS_DENORM__ = 1
- const m___FLT128_HAS_INFINITY__ = 1
- const m___FLT128_HAS_QUIET_NAN__ = 1
- const m___FLT128_IS_IEC_60559__ = 2
- const m___FLT128_MANT_DIG__ = 113
- const m___FLT128_MAX_10_EXP__ = 4932
- const m___FLT128_MAX_EXP__ = 16384
- const m___FLT128_MAX__ = "1.18973149535723176508575932662800702e+4932"
- const m___FLT128_MIN__ = 3.36210314311209350626267781732175260e-4932
- const m___FLT128_NORM_MAX__ = "1.18973149535723176508575932662800702e+4932"
- const m___FLT32X_DECIMAL_DIG__ = 17
- const m___FLT32X_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324
- const m___FLT32X_DIG__ = 15
- const m___FLT32X_EPSILON__ = 2.22044604925031308084726333618164062e-16
- const m___FLT32X_HAS_DENORM__ = 1
- const m___FLT32X_HAS_INFINITY__ = 1
- const m___FLT32X_HAS_QUIET_NAN__ = 1
- const m___FLT32X_IS_IEC_60559__ = 2
- const m___FLT32X_MANT_DIG__ = 53
- const m___FLT32X_MAX_10_EXP__ = 308
- const m___FLT32X_MAX_EXP__ = 1024
- const m___FLT32X_MAX__ = 1.79769313486231570814527423731704357e+308
- const m___FLT32X_MIN__ = 2.22507385850720138309023271733240406e-308
- const m___FLT32X_NORM_MAX__ = 1.79769313486231570814527423731704357e+308
- const m___FLT32_DECIMAL_DIG__ = 9
- const m___FLT32_DENORM_MIN__ = 1.40129846432481707092372958328991613e-45
- const m___FLT32_DIG__ = 6
- const m___FLT32_EPSILON__ = 1.19209289550781250000000000000000000e-7
- const m___FLT32_HAS_DENORM__ = 1
- const m___FLT32_HAS_INFINITY__ = 1
- const m___FLT32_HAS_QUIET_NAN__ = 1
- const m___FLT32_IS_IEC_60559__ = 2
- const m___FLT32_MANT_DIG__ = 24
- const m___FLT32_MAX_10_EXP__ = 38
- const m___FLT32_MAX_EXP__ = 128
- const m___FLT32_MAX__ = 3.40282346638528859811704183484516925e+38
- const m___FLT32_MIN__ = 1.17549435082228750796873653722224568e-38
- const m___FLT32_NORM_MAX__ = 3.40282346638528859811704183484516925e+38
- const m___FLT64X_DECIMAL_DIG__ = 36
- const m___FLT64X_DENORM_MIN__ = 6.47517511943802511092443895822764655e-4966
- const m___FLT64X_DIG__ = 33
- const m___FLT64X_EPSILON__ = 1.92592994438723585305597794258492732e-34
- const m___FLT64X_HAS_DENORM__ = 1
- const m___FLT64X_HAS_INFINITY__ = 1
- const m___FLT64X_HAS_QUIET_NAN__ = 1
- const m___FLT64X_IS_IEC_60559__ = 2
- const m___FLT64X_MANT_DIG__ = 113
- const m___FLT64X_MAX_10_EXP__ = 4932
- const m___FLT64X_MAX_EXP__ = 16384
- const m___FLT64X_MAX__ = "1.18973149535723176508575932662800702e+4932"
- const m___FLT64X_MIN__ = 3.36210314311209350626267781732175260e-4932
- const m___FLT64X_NORM_MAX__ = "1.18973149535723176508575932662800702e+4932"
- const m___FLT64_DECIMAL_DIG__ = 17
- const m___FLT64_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324
- const m___FLT64_DIG__ = 15
- const m___FLT64_EPSILON__ = 2.22044604925031308084726333618164062e-16
- const m___FLT64_HAS_DENORM__ = 1
- const m___FLT64_HAS_INFINITY__ = 1
- const m___FLT64_HAS_QUIET_NAN__ = 1
- const m___FLT64_IS_IEC_60559__ = 2
- const m___FLT64_MANT_DIG__ = 53
- const m___FLT64_MAX_10_EXP__ = 308
- const m___FLT64_MAX_EXP__ = 1024
- const m___FLT64_MAX__ = 1.79769313486231570814527423731704357e+308
- const m___FLT64_MIN__ = 2.22507385850720138309023271733240406e-308
- const m___FLT64_NORM_MAX__ = 1.79769313486231570814527423731704357e+308
- const m___FLT_DECIMAL_DIG__ = 9
- const m___FLT_DENORM_MIN__ = 1.40129846432481707092372958328991613e-45
- const m___FLT_DIG__ = 6
- const m___FLT_EPSILON__ = 1.19209289550781250000000000000000000e-7
- const m___FLT_EVAL_METHOD_TS_18661_3__ = 2
- const m___FLT_EVAL_METHOD__ = 2
- const m___FLT_HAS_DENORM__ = 1
- const m___FLT_HAS_INFINITY__ = 1
- const m___FLT_HAS_QUIET_NAN__ = 1
- const m___FLT_IS_IEC_60559__ = 2
- const m___FLT_MANT_DIG__ = 24
- const m___FLT_MAX_10_EXP__ = 38
- const m___FLT_MAX_EXP__ = 128
- const m___FLT_MAX__ = 3.40282346638528859811704183484516925e+38
- const m___FLT_MIN__ = 1.17549435082228750796873653722224568e-38
- const m___FLT_NORM_MAX__ = 3.40282346638528859811704183484516925e+38
- const m___FLT_RADIX__ = 2
- const m___FUNCTION__ = "__func__"
- const m___GCC_ASM_FLAG_OUTPUTS__ = 1
- const m___GCC_ATOMIC_BOOL_LOCK_FREE = 2
- const m___GCC_ATOMIC_CHAR16_T_LOCK_FREE = 2
- const m___GCC_ATOMIC_CHAR32_T_LOCK_FREE = 2
- const m___GCC_ATOMIC_CHAR_LOCK_FREE = 2
- const m___GCC_ATOMIC_INT_LOCK_FREE = 2
- const m___GCC_ATOMIC_LLONG_LOCK_FREE = 2
- const m___GCC_ATOMIC_LONG_LOCK_FREE = 2
- const m___GCC_ATOMIC_POINTER_LOCK_FREE = 2
- const m___GCC_ATOMIC_SHORT_LOCK_FREE = 2
- const m___GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1
- const m___GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2
- const m___GCC_CONSTRUCTIVE_SIZE = 64
- const m___GCC_DESTRUCTIVE_SIZE = 64
- const m___GCC_HAVE_DWARF2_CFI_ASM = 1
- const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = 1
- const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 = 1
- const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = 1
- const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1
- const m___GCC_IEC_559 = 2
- const m___GCC_IEC_559_COMPLEX = 2
- const m___GNUC_EXECUTION_CHARSET_NAME = "UTF-8"
- const m___GNUC_MINOR__ = 2
- const m___GNUC_PATCHLEVEL__ = 0
- const m___GNUC_STDC_INLINE__ = 1
- const m___GNUC_WIDE_EXECUTION_CHARSET_NAME = "UTF-32LE"
- const m___GNUC__ = 12
- const m___GXX_ABI_VERSION = 1017
- const m___HAVE_GENERIC_SELECTION = 0
- const m___HAVE_SPECULATION_SAFE_VALUE = 1
- const m___ILP32__ = 1
- const m___INT16_MAX__ = 0x7fff
- const m___INT32_MAX__ = 0x7fffffff
- const m___INT32_TYPE__ = "int"
- const m___INT64_MAX__ = 0x7fffffffffffffff
- const m___INT8_MAX__ = 0x7f
- const m___INTMAX_MAX__ = 0x7fffffffffffffff
- const m___INTMAX_WIDTH__ = 64
- const m___INTPTR_MAX__ = 0x7fffffff
- const m___INTPTR_TYPE__ = "int"
- const m___INTPTR_WIDTH__ = 32
- const m___INT_FAST16_MAX__ = 0x7fffffff
- const m___INT_FAST16_TYPE__ = "int"
- const m___INT_FAST16_WIDTH__ = 32
- const m___INT_FAST32_MAX__ = 0x7fffffff
- const m___INT_FAST32_TYPE__ = "int"
- const m___INT_FAST32_WIDTH__ = 32
- const m___INT_FAST64_MAX__ = 0x7fffffffffffffff
- const m___INT_FAST64_WIDTH__ = 64
- const m___INT_FAST8_MAX__ = 0x7f
- const m___INT_FAST8_WIDTH__ = 8
- const m___INT_LEAST16_MAX__ = 0x7fff
- const m___INT_LEAST16_WIDTH__ = 16
- const m___INT_LEAST32_MAX__ = 0x7fffffff
- const m___INT_LEAST32_TYPE__ = "int"
- const m___INT_LEAST32_WIDTH__ = 32
- const m___INT_LEAST64_MAX__ = 0x7fffffffffffffff
- const m___INT_LEAST64_WIDTH__ = 64
- const m___INT_LEAST8_MAX__ = 0x7f
- const m___INT_LEAST8_WIDTH__ = 8
- const m___INT_MAX__ = 0x7fffffff
- const m___INT_WIDTH__ = 32
- const m___LAHF_SAHF__ = 1
- const m___LDBL_DECIMAL_DIG__ = 17
- const m___LDBL_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324
- const m___LDBL_DIG__ = 15
- const m___LDBL_EPSILON__ = 2.22044604925031308084726333618164062e-16
- const m___LDBL_HAS_DENORM__ = 1
- const m___LDBL_HAS_INFINITY__ = 1
- const m___LDBL_HAS_QUIET_NAN__ = 1
- const m___LDBL_IS_IEC_60559__ = 2
- const m___LDBL_MANT_DIG__ = 53
- const m___LDBL_MAX_10_EXP__ = 308
- const m___LDBL_MAX_EXP__ = 1024
- const m___LDBL_MAX__ = 1.79769313486231570814527423731704357e+308
- const m___LDBL_MIN__ = 2.22507385850720138309023271733240406e-308
- const m___LDBL_NORM_MAX__ = 1.79769313486231570814527423731704357e+308
- const m___LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = 0
- const m___LITTLE_ENDIAN = 1234
- const m___LONG_DOUBLE_64__ = 1
- const m___LONG_LONG_MAX__ = 0x7fffffffffffffff
- const m___LONG_LONG_WIDTH__ = 64
- const m___LONG_MAX = 0x7fffffff
- const m___LONG_MAX__ = 0x7fffffff
- const m___LONG_WIDTH__ = 32
- const m___NO_INLINE__ = 1
- const m___ORDER_BIG_ENDIAN__ = 4321
- const m___ORDER_LITTLE_ENDIAN__ = 1234
- const m___ORDER_PDP_ENDIAN__ = 3412
- const m___PDP_ENDIAN = 3412
- const m___PIC__ = 2
- const m___PIE__ = 2
- const m___PRAGMA_REDEFINE_EXTNAME = 1
- const m___PRETTY_FUNCTION__ = "__func__"
- const m___PTRDIFF_MAX__ = 0x7fffffff
- const m___PTRDIFF_TYPE__ = "int"
- const m___PTRDIFF_WIDTH__ = 32
- const m___REENTRANT = 1
- const m___SCHAR_MAX__ = 0x7f
- const m___SCHAR_WIDTH__ = 8
- const m___SEG_FS = 1
- const m___SEG_GS = 1
- const m___SHRT_MAX__ = 0x7fff
- const m___SHRT_WIDTH__ = 16
- const m___SIG_ATOMIC_MAX__ = 0x7fffffff
- const m___SIG_ATOMIC_TYPE__ = "int"
- const m___SIG_ATOMIC_WIDTH__ = 32
- const m___SIZEOF_DOUBLE__ = 8
- const m___SIZEOF_FLOAT128__ = 16
- const m___SIZEOF_FLOAT80__ = 12
- const m___SIZEOF_FLOAT__ = 4
- const m___SIZEOF_INT__ = 4
- const m___SIZEOF_LONG_DOUBLE__ = 8
- const m___SIZEOF_LONG_LONG__ = 8
- const m___SIZEOF_LONG__ = 4
- const m___SIZEOF_POINTER__ = 4
- const m___SIZEOF_PTRDIFF_T__ = 4
- const m___SIZEOF_SHORT__ = 2
- const m___SIZEOF_SIZE_T__ = 4
- const m___SIZEOF_WCHAR_T__ = 4
- const m___SIZEOF_WINT_T__ = 4
- const m___SIZE_MAX__ = 0xffffffff
- const m___SIZE_WIDTH__ = 32
- const m___STDC_HOSTED__ = 1
- const m___STDC_IEC_559_COMPLEX__ = 1
- const m___STDC_IEC_559__ = 1
- const m___STDC_IEC_60559_BFP__ = 201404
- const m___STDC_IEC_60559_COMPLEX__ = 201404
- const m___STDC_ISO_10646__ = 201706
- const m___STDC_UTF_16__ = 1
- const m___STDC_UTF_32__ = 1
- const m___STDC_VERSION__ = 201710
- const m___STDC_WANT_IEC_60559_ATTRIBS_EXT__ = 1
- const m___STDC_WANT_IEC_60559_BFP_EXT__ = 1
- const m___STDC_WANT_IEC_60559_DFP_EXT__ = 1
- const m___STDC_WANT_IEC_60559_FUNCS_EXT__ = 1
- const m___STDC_WANT_IEC_60559_TYPES_EXT__ = 1
- const m___STDC_WANT_LIB_EXT2__ = 1
- const m___STDC_WANT_MATH_SPEC_FUNCS__ = 1
- const m___STDC__ = 1
- const m___UINT16_MAX__ = 0xffff
- const m___UINT32_MAX__ = 0xffffffff
- const m___UINT64_MAX__ = "0xffffffffffffffffU"
- const m___UINT8_MAX__ = 0xff
- const m___UINTMAX_MAX__ = "0xffffffffffffffffU"
- const m___UINTPTR_MAX__ = 0xffffffff
- const m___UINT_FAST16_MAX__ = 0xffffffff
- const m___UINT_FAST32_MAX__ = 0xffffffff
- const m___UINT_FAST64_MAX__ = "0xffffffffffffffffU"
- const m___UINT_FAST8_MAX__ = 0xff
- const m___UINT_LEAST16_MAX__ = 0xffff
- const m___UINT_LEAST32_MAX__ = 0xffffffff
- const m___UINT_LEAST64_MAX__ = "0xffffffffffffffffU"
- const m___UINT_LEAST8_MAX__ = 0xff
- const m___USE_TIME_BITS64 = 1
- const m___VERSION__ = "12.2.0"
- const m___WCHAR_MAX__ = 0x7fffffff
- const m___WCHAR_WIDTH__ = 32
- const m___WINT_MAX__ = 0xffffffff
- const m___WINT_MIN__ = 0
- const m___WINT_WIDTH__ = 32
- const m___WORDSIZE = 32
- const m___WORDSIZE32_PTRDIFF_LONG = 0
- const m___WORDSIZE32_SIZE_ULONG = 0
- const m___WORDSIZE_TIME64_COMPAT32 = 1
- const m___code_model_32__ = 1
- const m___glibc_c99_flexarr_available = 1
- const m___gnu_linux__ = 1
- const m___i386 = 1
- const m___i386__ = 1
- const m___i686 = 1
- const m___i686__ = 1
- const m___inline = "inline"
- const m___linux = 1
- const m___linux__ = 1
- const m___pentiumpro = 1
- const m___pentiumpro__ = 1
- const m___pic__ = 2
- const m___pie__ = 2
- const m___restrict = "restrict"
- const m___tm_gmtoff = "tm_gmtoff"
- const m___tm_zone = "tm_zone"
- const m___ucontext = "ucontext"
- const m___unix = 1
- const m___unix__ = 1
- const m_alloca = "__builtin_alloca"
- const m_i386 = 1
- const m_inline = "__inline"
- const m_linux = 1
- const m_loff_t = "off_t"
- const m_prlimit64 = "prlimit"
- const m_unix = 1
- type t__builtin_va_list = uintptr
- type t__predefined_size_t = uint32
- type t__predefined_wchar_t = int32
- type t__predefined_ptrdiff_t = int32
- type Tsize_t = uint32
- type Tssize_t = int32
- type Tmode_t = uint32
- type Toff_t = int64
- type Tpid_t = int32
- type Tiovec = struct {
- Fiov_base uintptr
- Fiov_len Tsize_t
- }
- type Tflock = struct {
- Fl_type int16
- Fl_whence int16
- Fl_start Toff_t
- Fl_len Toff_t
- Fl_pid Tpid_t
- }
- type Tfile_handle = struct {
- Fhandle_bytes uint32
- Fhandle_type int32
- }
- type Tf_owner_ex = struct {
- Ftype1 int32
- Fpid Tpid_t
- }
- type Ttime_t = int64
- type Tclock_t = int32
- type Ttimespec = struct {
- Ftv_sec Ttime_t
- Ftv_nsec int32
- F__ccgo12 uint32
- }
- type Tuid_t = uint32
- type Tpthread_t = uintptr
- type Tsigset_t = struct {
- F__bits [32]uint32
- }
- type t__sigset_t = Tsigset_t
- type Tpthread_attr_t = struct {
- F__u struct {
- F__vi [0][9]int32
- F__s [0][9]uint32
- F__i [9]int32
- }
- }
- type Tstack_t = struct {
- Fss_sp uintptr
- Fss_flags int32
- Fss_size Tsize_t
- }
- type Tsigaltstack = Tstack_t
- const _REG_GS = 0
- const _REG_FS = 1
- const _REG_ES = 2
- const _REG_DS = 3
- const _REG_EDI = 4
- const _REG_ESI = 5
- const _REG_EBP = 6
- const _REG_ESP = 7
- const _REG_EBX = 8
- const _REG_EDX = 9
- const _REG_ECX = 10
- const _REG_EAX = 11
- const _REG_TRAPNO = 12
- const _REG_ERR = 13
- const _REG_EIP = 14
- const _REG_CS = 15
- const _REG_EFL = 16
- const _REG_UESP = 17
- const _REG_SS = 18
- type Tgreg_t = int32
- type Tgregset_t = [19]int32
- type Tfpregset_t = uintptr
- type T_fpstate = struct {
- Fcw uint32
- Fsw uint32
- Ftag uint32
- Fipoff uint32
- Fcssel uint32
- Fdataoff uint32
- Fdatasel uint32
- F_st [8]struct {
- Fsignificand [4]uint16
- Fexponent uint16
- }
- Fstatus uint32
- }
- type Tsigcontext = struct {
- Fgs uint16
- F__gsh uint16
- Ffs uint16
- F__fsh uint16
- Fes uint16
- F__esh uint16
- Fds uint16
- F__dsh uint16
- Fedi uint32
- Fesi uint32
- Febp uint32
- Fesp uint32
- Febx uint32
- Fedx uint32
- Fecx uint32
- Feax uint32
- Ftrapno uint32
- Ferr uint32
- Feip uint32
- Fcs uint16
- F__csh uint16
- Feflags uint32
- Fesp_at_signal uint32
- Fss uint16
- F__ssh uint16
- Ffpstate uintptr
- Foldmask uint32
- Fcr2 uint32
- }
- type Tmcontext_t = struct {
- Fgregs Tgregset_t
- Ffpregs Tfpregset_t
- Foldmask uint32
- Fcr2 uint32
- }
- type Tucontext_t = struct {
- Fuc_flags uint32
- Fuc_link uintptr
- Fuc_stack Tstack_t
- Fuc_mcontext Tmcontext_t
- Fuc_sigmask Tsigset_t
- F__fpregs_mem [28]uint32
- }
- type Tucontext = Tucontext_t
- type Tsigval = struct {
- Fsival_ptr [0]uintptr
- Fsival_int int32
- }
- type Tsiginfo_t = struct {
- Fsi_signo int32
- Fsi_errno int32
- Fsi_code int32
- F__si_fields struct {
- F__si_common [0]struct {
- F__first struct {
- F__timer [0]struct {
- Fsi_timerid int32
- Fsi_overrun int32
- }
- F__piduid struct {
- Fsi_pid Tpid_t
- Fsi_uid Tuid_t
- }
- }
- F__second struct {
- F__sigchld [0]struct {
- Fsi_status int32
- Fsi_utime Tclock_t
- Fsi_stime Tclock_t
- }
- Fsi_value Tsigval
- F__ccgo_pad2 [8]byte
- }
- }
- F__sigfault [0]struct {
- Fsi_addr uintptr
- Fsi_addr_lsb int16
- F__first struct {
- Fsi_pkey [0]uint32
- F__addr_bnd struct {
- Fsi_lower uintptr
- Fsi_upper uintptr
- }
- }
- }
- F__sigpoll [0]struct {
- Fsi_band int32
- Fsi_fd int32
- }
- F__sigsys [0]struct {
- Fsi_call_addr uintptr
- Fsi_syscall int32
- Fsi_arch uint32
- }
- F__pad [116]int8
- }
- }
- type Tsigaction = struct {
- F__sa_handler struct {
- Fsa_sigaction [0]uintptr
- Fsa_handler uintptr
- }
- Fsa_mask Tsigset_t
- Fsa_flags int32
- Fsa_restorer uintptr
- }
- type Tsigevent = struct {
- Fsigev_value Tsigval
- Fsigev_signo int32
- Fsigev_notify int32
- F__sev_fields struct {
- Fsigev_notify_thread_id [0]Tpid_t
- F__sev_thread [0]struct {
- Fsigev_notify_function uintptr
- Fsigev_notify_attributes uintptr
- }
- F__pad [52]int8
- }
- }
- type Tsig_t = uintptr
- type Tsighandler_t = uintptr
- type Tsig_atomic_t = int32
- type Tuintptr_t = uint32
- type Tintptr_t = int32
- type Tint8_t = int8
- type Tint16_t = int16
- type Tint32_t = int32
- type Tint64_t = int64
- type Tintmax_t = int64
- type Tuint8_t = uint8
- type Tuint16_t = uint16
- type Tuint32_t = uint32
- type Tuint64_t = uint64
- type Tuintmax_t = uint64
- type Tint_fast8_t = int8
- type Tint_fast64_t = int64
- type Tint_least8_t = int8
- type Tint_least16_t = int16
- type Tint_least32_t = int32
- type Tint_least64_t = int64
- type Tuint_fast8_t = uint8
- type Tuint_fast64_t = uint64
- type Tuint_least8_t = uint8
- type Tuint_least16_t = uint16
- type Tuint_least32_t = uint32
- type Tuint_least64_t = uint64
- type Tint_fast16_t = int32
- type Tint_fast32_t = int32
- type Tuint_fast16_t = uint32
- type Tuint_fast32_t = uint32
- type Twchar_t = int32
- type Tdiv_t = struct {
- Fquot int32
- Frem int32
- }
- type Tldiv_t = struct {
- Fquot int32
- Frem int32
- }
- type Tlldiv_t = struct {
- Fquot int64
- Frem int64
- }
- type Tregister_t = int32
- type Tsuseconds_t = int64
- type Tu_int64_t = uint64
- type Tnlink_t = uint32
- type Tino_t = uint64
- type Tdev_t = uint64
- type Tblksize_t = int32
- type Tblkcnt_t = int64
- type Tfsblkcnt_t = uint64
- type Tfsfilcnt_t = uint64
- type Ttimer_t = uintptr
- type Tclockid_t = int32
- type Tid_t = uint32
- type Tgid_t = uint32
- type Tkey_t = int32
- type Tuseconds_t = uint32
- type Tpthread_once_t = int32
- type Tpthread_key_t = uint32
- type Tpthread_spinlock_t = int32
- type Tpthread_mutexattr_t = struct {
- F__attr uint32
- }
- type Tpthread_condattr_t = struct {
- F__attr uint32
- }
- type Tpthread_barrierattr_t = struct {
- F__attr uint32
- }
- type Tpthread_rwlockattr_t = struct {
- F__attr [2]uint32
- }
- type Tpthread_mutex_t = struct {
- F__u struct {
- F__vi [0][6]int32
- F__p [0][6]uintptr
- F__i [6]int32
- }
- F__ccgo_room int32
- }
- type Tpthread_cond_t = struct {
- F__u struct {
- F__vi [0][12]int32
- F__p [0][12]uintptr
- F__i [12]int32
- }
- }
- type Tpthread_rwlock_t = struct {
- F__u struct {
- F__vi [0][8]int32
- F__p [0][8]uintptr
- F__i [8]int32
- }
- }
- type Tpthread_barrier_t = struct {
- F__u struct {
- F__vi [0][5]int32
- F__p [0][5]uintptr
- F__i [5]int32
- }
- }
- type Tu_int8_t = uint8
- type Tu_int16_t = uint16
- type Tu_int32_t = uint32
- type Tcaddr_t = uintptr
- type Tu_char = uint8
- type Tu_short = uint16
- type Tushort = uint16
- type Tu_int = uint32
- type Tuint = uint32
- type Tu_long = uint32
- type Tulong = uint32
- type Tquad_t = int64
- type Tu_quad_t = uint64
- type Ttimeval = struct {
- Ftv_sec Ttime_t
- Ftv_usec Tsuseconds_t
- }
- type Tfd_mask = uint32
- type Tfd_set = struct {
- Ffds_bits [32]uint32
- }
- type Tva_list = uintptr
- type t__isoc_va_list = uintptr
- type Tfpos_t = struct {
- F__lldata [0]int64
- F__align [0]float64
- F__opaque [16]int8
- }
- type T_G_fpos64_t = Tfpos_t
- type Tcookie_io_functions_t = struct {
- Fread uintptr
- Fwrite uintptr
- Fseek uintptr
- Fclose1 uintptr
- }
- type T_IO_cookie_io_functions_t = Tcookie_io_functions_t
- type Tstat = struct {
- Fst_dev Tdev_t
- F__st_dev_padding int32
- F__st_ino_truncated int32
- Fst_mode Tmode_t
- Fst_nlink Tnlink_t
- Fst_uid Tuid_t
- Fst_gid Tgid_t
- Fst_rdev Tdev_t
- F__st_rdev_padding int32
- Fst_size Toff_t
- Fst_blksize Tblksize_t
- Fst_blocks Tblkcnt_t
- F__st_atim32 struct {
- Ftv_sec int32
- Ftv_nsec int32
- }
- F__st_mtim32 struct {
- Ftv_sec int32
- Ftv_nsec int32
- }
- F__st_ctim32 struct {
- Ftv_sec int32
- Ftv_nsec int32
- }
- Fst_ino Tino_t
- Fst_atim Ttimespec
- Fst_mtim Ttimespec
- Fst_ctim Ttimespec
- }
- type Tstatx_timestamp = struct {
- Ftv_sec Tint64_t
- Ftv_nsec Tuint32_t
- F__pad Tuint32_t
- }
- type Tstatx = struct {
- Fstx_mask Tuint32_t
- Fstx_blksize Tuint32_t
- Fstx_attributes Tuint64_t
- Fstx_nlink Tuint32_t
- Fstx_uid Tuint32_t
- Fstx_gid Tuint32_t
- Fstx_mode Tuint16_t
- F__pad0 [1]Tuint16_t
- Fstx_ino Tuint64_t
- Fstx_size Tuint64_t
- Fstx_blocks Tuint64_t
- Fstx_attributes_mask Tuint64_t
- Fstx_atime Tstatx_timestamp
- Fstx_btime Tstatx_timestamp
- Fstx_ctime Tstatx_timestamp
- Fstx_mtime Tstatx_timestamp
- Fstx_rdev_major Tuint32_t
- Fstx_rdev_minor Tuint32_t
- Fstx_dev_major Tuint32_t
- Fstx_dev_minor Tuint32_t
- F__pad1 [14]Tuint64_t
- }
- type Tlocale_t = uintptr
- type Titimerval = struct {
- Fit_interval Ttimeval
- Fit_value Ttimeval
- }
- type Ttimezone = struct {
- Ftz_minuteswest int32
- Ftz_dsttime int32
- }
- type Tu8 = uint8
- type Tu32 = uint32
- type Tchacha_ctx = struct {
- Finput [16]Tu32
- }
- var _sigma = [16]int8{'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'}
- var _tau = [16]int8{'e', 'x', 'p', 'a', 'n', 'd', ' ', '1', '6', '-', 'b', 'y', 't', 'e', ' ', 'k'}
- func _chacha_keysetup(tls *libc.TLS, x uintptr, k uintptr, kbits Tu32) {
- var constants uintptr
- _ = constants
- *(*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)
- *(*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)
- *(*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)
- *(*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)
- if kbits == uint32(256) {
- k += uintptr(16)
- constants = uintptr(unsafe.Pointer(&_sigma))
- } else {
- constants = uintptr(unsafe.Pointer(&_tau))
- }
- *(*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)
- *(*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)
- *(*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)
- *(*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)
- *(*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)
- *(*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)
- *(*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)
- *(*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)
- }
- func _chacha_ivsetup(tls *libc.TLS, x uintptr, iv uintptr) {
- *(*Tu32)(unsafe.Pointer(x + 12*4)) = uint32(0)
- *(*Tu32)(unsafe.Pointer(x + 13*4)) = uint32(0)
- *(*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)
- *(*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)
- }
- func _chacha_encrypt_bytes(tls *libc.TLS, x uintptr, m uintptr, c uintptr, bytes Tu32) {
- bp := tls.Alloc(64)
- defer tls.Free(64)
- var ctarget uintptr
- var i uint32
- 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
- var _ /* tmp at bp+0 */ [64]Tu8
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- ctarget = libc.UintptrFromInt32(0)
- if !(bytes != 0) {
- return
- }
- j0 = *(*Tu32)(unsafe.Pointer(x))
- j1 = *(*Tu32)(unsafe.Pointer(x + 1*4))
- j2 = *(*Tu32)(unsafe.Pointer(x + 2*4))
- j3 = *(*Tu32)(unsafe.Pointer(x + 3*4))
- j4 = *(*Tu32)(unsafe.Pointer(x + 4*4))
- j5 = *(*Tu32)(unsafe.Pointer(x + 5*4))
- j6 = *(*Tu32)(unsafe.Pointer(x + 6*4))
- j7 = *(*Tu32)(unsafe.Pointer(x + 7*4))
- j8 = *(*Tu32)(unsafe.Pointer(x + 8*4))
- j9 = *(*Tu32)(unsafe.Pointer(x + 9*4))
- j10 = *(*Tu32)(unsafe.Pointer(x + 10*4))
- j11 = *(*Tu32)(unsafe.Pointer(x + 11*4))
- j12 = *(*Tu32)(unsafe.Pointer(x + 12*4))
- j13 = *(*Tu32)(unsafe.Pointer(x + 13*4))
- j14 = *(*Tu32)(unsafe.Pointer(x + 14*4))
- j15 = *(*Tu32)(unsafe.Pointer(x + 15*4))
- for {
- if bytes < uint32(64) {
- i = uint32(0)
- for {
- if !(i < bytes) {
- break
- }
- (*(*[64]Tu8)(unsafe.Pointer(bp)))[i] = *(*Tu8)(unsafe.Pointer(m + uintptr(i)))
- goto _2
- _2:
- ;
- i++
- }
- m = bp
- ctarget = c
- c = bp
- }
- x0 = j0
- x1 = j1
- x2 = j2
- x3 = j3
- x4 = j4
- x5 = j5
- x6 = j6
- x7 = j7
- x8 = j8
- x9 = j9
- x10 = j10
- x11 = j11
- x12 = j12
- x13 = j13
- x14 = j14
- x15 = j15
- i = uint32(20)
- for {
- if !(i > uint32(0)) {
- break
- }
- x0 = (x0 + x4) & libc.Uint32FromUint32(0xFFFFFFFF)
- x12 = (x12^x0)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x12^x0)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
- x8 = (x8 + x12) & libc.Uint32FromUint32(0xFFFFFFFF)
- x4 = (x4^x8)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x4^x8)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
- x0 = (x0 + x4) & libc.Uint32FromUint32(0xFFFFFFFF)
- x12 = (x12^x0)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x12^x0)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
- x8 = (x8 + x12) & libc.Uint32FromUint32(0xFFFFFFFF)
- x4 = (x4^x8)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x4^x8)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
- x1 = (x1 + x5) & libc.Uint32FromUint32(0xFFFFFFFF)
- x13 = (x13^x1)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x13^x1)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
- x9 = (x9 + x13) & libc.Uint32FromUint32(0xFFFFFFFF)
- x5 = (x5^x9)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x5^x9)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
- x1 = (x1 + x5) & libc.Uint32FromUint32(0xFFFFFFFF)
- x13 = (x13^x1)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x13^x1)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
- x9 = (x9 + x13) & libc.Uint32FromUint32(0xFFFFFFFF)
- x5 = (x5^x9)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x5^x9)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
- x2 = (x2 + x6) & libc.Uint32FromUint32(0xFFFFFFFF)
- x14 = (x14^x2)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x14^x2)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
- x10 = (x10 + x14) & libc.Uint32FromUint32(0xFFFFFFFF)
- x6 = (x6^x10)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x6^x10)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
- x2 = (x2 + x6) & libc.Uint32FromUint32(0xFFFFFFFF)
- x14 = (x14^x2)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x14^x2)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
- x10 = (x10 + x14) & libc.Uint32FromUint32(0xFFFFFFFF)
- x6 = (x6^x10)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x6^x10)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
- x3 = (x3 + x7) & libc.Uint32FromUint32(0xFFFFFFFF)
- x15 = (x15^x3)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x15^x3)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
- x11 = (x11 + x15) & libc.Uint32FromUint32(0xFFFFFFFF)
- x7 = (x7^x11)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x7^x11)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
- x3 = (x3 + x7) & libc.Uint32FromUint32(0xFFFFFFFF)
- x15 = (x15^x3)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x15^x3)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
- x11 = (x11 + x15) & libc.Uint32FromUint32(0xFFFFFFFF)
- x7 = (x7^x11)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x7^x11)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
- x0 = (x0 + x5) & libc.Uint32FromUint32(0xFFFFFFFF)
- x15 = (x15^x0)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x15^x0)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
- x10 = (x10 + x15) & libc.Uint32FromUint32(0xFFFFFFFF)
- x5 = (x5^x10)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x5^x10)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
- x0 = (x0 + x5) & libc.Uint32FromUint32(0xFFFFFFFF)
- x15 = (x15^x0)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x15^x0)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
- x10 = (x10 + x15) & libc.Uint32FromUint32(0xFFFFFFFF)
- x5 = (x5^x10)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x5^x10)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
- x1 = (x1 + x6) & libc.Uint32FromUint32(0xFFFFFFFF)
- x12 = (x12^x1)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x12^x1)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
- x11 = (x11 + x12) & libc.Uint32FromUint32(0xFFFFFFFF)
- x6 = (x6^x11)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x6^x11)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
- x1 = (x1 + x6) & libc.Uint32FromUint32(0xFFFFFFFF)
- x12 = (x12^x1)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x12^x1)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
- x11 = (x11 + x12) & libc.Uint32FromUint32(0xFFFFFFFF)
- x6 = (x6^x11)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x6^x11)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
- x2 = (x2 + x7) & libc.Uint32FromUint32(0xFFFFFFFF)
- x13 = (x13^x2)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x13^x2)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
- x8 = (x8 + x13) & libc.Uint32FromUint32(0xFFFFFFFF)
- x7 = (x7^x8)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x7^x8)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
- x2 = (x2 + x7) & libc.Uint32FromUint32(0xFFFFFFFF)
- x13 = (x13^x2)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x13^x2)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
- x8 = (x8 + x13) & libc.Uint32FromUint32(0xFFFFFFFF)
- x7 = (x7^x8)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x7^x8)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
- x3 = (x3 + x4) & libc.Uint32FromUint32(0xFFFFFFFF)
- x14 = (x14^x3)<<libc.Int32FromInt32(16)&libc.Uint32FromUint32(0xFFFFFFFF) | (x14^x3)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(16))
- x9 = (x9 + x14) & libc.Uint32FromUint32(0xFFFFFFFF)
- x4 = (x4^x9)<<libc.Int32FromInt32(12)&libc.Uint32FromUint32(0xFFFFFFFF) | (x4^x9)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(12))
- x3 = (x3 + x4) & libc.Uint32FromUint32(0xFFFFFFFF)
- x14 = (x14^x3)<<libc.Int32FromInt32(8)&libc.Uint32FromUint32(0xFFFFFFFF) | (x14^x3)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(8))
- x9 = (x9 + x14) & libc.Uint32FromUint32(0xFFFFFFFF)
- x4 = (x4^x9)<<libc.Int32FromInt32(7)&libc.Uint32FromUint32(0xFFFFFFFF) | (x4^x9)>>(libc.Int32FromInt32(32)-libc.Int32FromInt32(7))
- goto _3
- _3:
- ;
- i -= uint32(2)
- }
- x0 = (x0 + j0) & libc.Uint32FromUint32(0xFFFFFFFF)
- x1 = (x1 + j1) & libc.Uint32FromUint32(0xFFFFFFFF)
- x2 = (x2 + j2) & libc.Uint32FromUint32(0xFFFFFFFF)
- x3 = (x3 + j3) & libc.Uint32FromUint32(0xFFFFFFFF)
- x4 = (x4 + j4) & libc.Uint32FromUint32(0xFFFFFFFF)
- x5 = (x5 + j5) & libc.Uint32FromUint32(0xFFFFFFFF)
- x6 = (x6 + j6) & libc.Uint32FromUint32(0xFFFFFFFF)
- x7 = (x7 + j7) & libc.Uint32FromUint32(0xFFFFFFFF)
- x8 = (x8 + j8) & libc.Uint32FromUint32(0xFFFFFFFF)
- x9 = (x9 + j9) & libc.Uint32FromUint32(0xFFFFFFFF)
- x10 = (x10 + j10) & libc.Uint32FromUint32(0xFFFFFFFF)
- x11 = (x11 + j11) & libc.Uint32FromUint32(0xFFFFFFFF)
- x12 = (x12 + j12) & libc.Uint32FromUint32(0xFFFFFFFF)
- x13 = (x13 + j13) & libc.Uint32FromUint32(0xFFFFFFFF)
- x14 = (x14 + j14) & libc.Uint32FromUint32(0xFFFFFFFF)
- x15 = (x15 + j15) & libc.Uint32FromUint32(0xFFFFFFFF)
- j12 = (j12 + libc.Uint32FromInt32(libc.Int32FromInt32(1))) & libc.Uint32FromUint32(0xFFFFFFFF)
- if !(j12 != 0) {
- j13 = (j13 + libc.Uint32FromInt32(libc.Int32FromInt32(1))) & libc.Uint32FromUint32(0xFFFFFFFF)
- }
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(0))) = uint8(uint32(uint8(x0)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(0) + 1)) = uint8(uint32(uint8(x0>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(0) + 2)) = uint8(uint32(uint8(x0>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(0) + 3)) = uint8(uint32(uint8(x0>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(4))) = uint8(uint32(uint8(x1)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(4) + 1)) = uint8(uint32(uint8(x1>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(4) + 2)) = uint8(uint32(uint8(x1>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(4) + 3)) = uint8(uint32(uint8(x1>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(8))) = uint8(uint32(uint8(x2)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(8) + 1)) = uint8(uint32(uint8(x2>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(8) + 2)) = uint8(uint32(uint8(x2>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(8) + 3)) = uint8(uint32(uint8(x2>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(12))) = uint8(uint32(uint8(x3)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(12) + 1)) = uint8(uint32(uint8(x3>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(12) + 2)) = uint8(uint32(uint8(x3>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(12) + 3)) = uint8(uint32(uint8(x3>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(16))) = uint8(uint32(uint8(x4)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(16) + 1)) = uint8(uint32(uint8(x4>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(16) + 2)) = uint8(uint32(uint8(x4>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(16) + 3)) = uint8(uint32(uint8(x4>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(20))) = uint8(uint32(uint8(x5)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(20) + 1)) = uint8(uint32(uint8(x5>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(20) + 2)) = uint8(uint32(uint8(x5>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(20) + 3)) = uint8(uint32(uint8(x5>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(24))) = uint8(uint32(uint8(x6)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(24) + 1)) = uint8(uint32(uint8(x6>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(24) + 2)) = uint8(uint32(uint8(x6>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(24) + 3)) = uint8(uint32(uint8(x6>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(28))) = uint8(uint32(uint8(x7)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(28) + 1)) = uint8(uint32(uint8(x7>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(28) + 2)) = uint8(uint32(uint8(x7>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(28) + 3)) = uint8(uint32(uint8(x7>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(32))) = uint8(uint32(uint8(x8)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(32) + 1)) = uint8(uint32(uint8(x8>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(32) + 2)) = uint8(uint32(uint8(x8>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(32) + 3)) = uint8(uint32(uint8(x8>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(36))) = uint8(uint32(uint8(x9)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(36) + 1)) = uint8(uint32(uint8(x9>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(36) + 2)) = uint8(uint32(uint8(x9>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(36) + 3)) = uint8(uint32(uint8(x9>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(40))) = uint8(uint32(uint8(x10)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(40) + 1)) = uint8(uint32(uint8(x10>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(40) + 2)) = uint8(uint32(uint8(x10>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(40) + 3)) = uint8(uint32(uint8(x10>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(44))) = uint8(uint32(uint8(x11)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(44) + 1)) = uint8(uint32(uint8(x11>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(44) + 2)) = uint8(uint32(uint8(x11>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(44) + 3)) = uint8(uint32(uint8(x11>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(48))) = uint8(uint32(uint8(x12)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(48) + 1)) = uint8(uint32(uint8(x12>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(48) + 2)) = uint8(uint32(uint8(x12>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(48) + 3)) = uint8(uint32(uint8(x12>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(52))) = uint8(uint32(uint8(x13)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(52) + 1)) = uint8(uint32(uint8(x13>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(52) + 2)) = uint8(uint32(uint8(x13>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(52) + 3)) = uint8(uint32(uint8(x13>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(56))) = uint8(uint32(uint8(x14)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(56) + 1)) = uint8(uint32(uint8(x14>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(56) + 2)) = uint8(uint32(uint8(x14>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(56) + 3)) = uint8(uint32(uint8(x14>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(60))) = uint8(uint32(uint8(x15)) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(60) + 1)) = uint8(uint32(uint8(x15>>libc.Int32FromInt32(8))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(60) + 2)) = uint8(uint32(uint8(x15>>libc.Int32FromInt32(16))) & libc.Uint32FromUint32(0xFF))
- *(*Tu8)(unsafe.Pointer(c + libc.UintptrFromInt32(60) + 3)) = uint8(uint32(uint8(x15>>libc.Int32FromInt32(24))) & libc.Uint32FromUint32(0xFF))
- if bytes <= uint32(64) {
- if bytes < uint32(64) {
- i = uint32(0)
- for {
- if !(i < bytes) {
- break
- }
- *(*Tu8)(unsafe.Pointer(ctarget + uintptr(i))) = *(*Tu8)(unsafe.Pointer(c + uintptr(i)))
- goto _4
- _4:
- ;
- i++
- }
- }
- *(*Tu32)(unsafe.Pointer(x + 12*4)) = j12
- *(*Tu32)(unsafe.Pointer(x + 13*4)) = j13
- return
- }
- bytes -= uint32(64)
- c += uintptr(64)
- goto _1
- _1:
- }
- }
- // C documentation
- //
- // /* Marked MAP_INHERIT_ZERO, so zero'd out in fork children. */
- type T_rs = struct {
- Frs_have Tsize_t
- Frs_count Tsize_t
- }
- // C documentation
- //
- // /* Marked MAP_INHERIT_ZERO, so zero'd out in fork children. */
- var _rs uintptr
- // C documentation
- //
- // /* Maybe be preserved in fork children, if _rs_allocate() decides. */
- type T_rsx = struct {
- Frs_chacha Tchacha_ctx
- Frs_buf [1024]uint8
- }
- // C documentation
- //
- // /* Maybe be preserved in fork children, if _rs_allocate() decides. */
- var _rsx uintptr
- type Trlim_t = uint64
- type Trlimit = struct {
- Frlim_cur Trlim_t
- Frlim_max Trlim_t
- }
- type Trusage = struct {
- Fru_utime Ttimeval
- Fru_stime Ttimeval
- Fru_maxrss int32
- Fru_ixrss int32
- Fru_idrss int32
- Fru_isrss int32
- Fru_minflt int32
- Fru_majflt int32
- Fru_nswap int32
- Fru_inblock int32
- Fru_oublock int32
- Fru_msgsnd int32
- Fru_msgrcv int32
- Fru_nsignals int32
- Fru_nvcsw int32
- Fru_nivcsw int32
- F__reserved [16]int32
- }
- type Tsched_param = struct {
- Fsched_priority int32
- F__reserved1 int32
- F__reserved2 [4]int32
- F__reserved3 int32
- }
- type Tcpu_set_t = struct {
- F__bits [32]uint32
- }
- type Ttm = struct {
- Ftm_sec int32
- Ftm_min int32
- Ftm_hour int32
- Ftm_mday int32
- Ftm_mon int32
- Ftm_year int32
- Ftm_wday int32
- Ftm_yday int32
- Ftm_isdst int32
- Ftm_gmtoff int32
- Ftm_zone uintptr
- }
- type Titimerspec = struct {
- Fit_interval Ttimespec
- Fit_value Ttimespec
- }
- type t__ptcb = struct {
- F__f uintptr
- F__x uintptr
- F__next uintptr
- }
- type Tcpu_set_t1 = struct {
- F__bits [32]uint32
- }
- var _arc4random_mtx = Tpthread_mutex_t{}
- var __rs_forked Tsig_atomic_t
- func __rs_init(tls *libc.TLS, buf uintptr, n Tsize_t) {
- var v1, v2, v3, v6 uintptr
- var v4 int32
- _, _, _, _, _ = v1, v2, v3, v4, v6
- if n < libc.Uint32FromInt32(libc.Int32FromInt32(m_KEYSZ)+libc.Int32FromInt32(m_IVSZ)) {
- return
- }
- if _rs == libc.UintptrFromInt32(0) {
- v1 = uintptr(unsafe.Pointer(&_rs))
- v2 = uintptr(unsafe.Pointer(&_rsx))
- 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)
- *(*uintptr)(unsafe.Pointer(v1)) = v3
- if v3 == uintptr(-libc.Int32FromInt32(1)) {
- v4 = -int32(1)
- goto _5
- }
- 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)
- *(*uintptr)(unsafe.Pointer(v2)) = v6
- if v6 == uintptr(-libc.Int32FromInt32(1)) {
- libc.Xmunmap(tls, *(*uintptr)(unsafe.Pointer(v1)), uint32(8))
- *(*uintptr)(unsafe.Pointer(v1)) = libc.UintptrFromInt32(0)
- v4 = -int32(1)
- goto _5
- }
- libc.Xpthread_atfork(tls, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), __ccgo_fp(__rs_forkhandler))
- v4 = 0
- goto _5
- _5:
- if v4 == -int32(1) {
- libc.X_exit(tls, int32(1))
- }
- }
- _chacha_keysetup(tls, _rsx, buf, libc.Uint32FromInt32(libc.Int32FromInt32(m_KEYSZ)*libc.Int32FromInt32(8)))
- _chacha_ivsetup(tls, _rsx, buf+uintptr(m_KEYSZ))
- }
- func __rs_rekey(tls *libc.TLS, dat uintptr, datlen Tsize_t) {
- var i, m Tsize_t
- var v1 uint32
- var p3 uintptr
- _, _, _, _ = i, m, v1, p3
- /* fill rs_buf with the keystream */
- _chacha_encrypt_bytes(tls, _rsx, _rsx+64, _rsx+64, uint32(1024))
- /* mix in optional user provided data */
- if dat != 0 {
- if datlen < libc.Uint32FromInt32(libc.Int32FromInt32(m_KEYSZ)+libc.Int32FromInt32(m_IVSZ)) {
- v1 = datlen
- } else {
- v1 = libc.Uint32FromInt32(libc.Int32FromInt32(m_KEYSZ) + libc.Int32FromInt32(m_IVSZ))
- }
- m = v1
- i = uint32(0)
- for {
- if !(i < m) {
- break
- }
- p3 = _rsx + 64 + uintptr(i)
- *(*uint8)(unsafe.Pointer(p3)) = uint8(int32(*(*uint8)(unsafe.Pointer(p3))) ^ libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(dat + uintptr(i)))))
- goto _2
- _2:
- ;
- i++
- }
- }
- /* immediately reinit for backtracking resistance */
- __rs_init(tls, _rsx+64, libc.Uint32FromInt32(libc.Int32FromInt32(m_KEYSZ)+libc.Int32FromInt32(m_IVSZ)))
- libc.Xmemset(tls, _rsx+64, 0, libc.Uint32FromInt32(libc.Int32FromInt32(m_KEYSZ)+libc.Int32FromInt32(m_IVSZ)))
- (*T_rs)(unsafe.Pointer(_rs)).Frs_have = libc.Uint32FromInt64(1024) - libc.Uint32FromInt32(m_KEYSZ) - libc.Uint32FromInt32(m_IVSZ)
- }
- func __rs_stir(tls *libc.TLS) {
- bp := tls.Alloc(48)
- defer tls.Free(48)
- var _ /* rekey_fuzz at bp+40 */ Tuint32_t
- var _ /* rnd at bp+0 */ [40]uint8
- *(*Tuint32_t)(unsafe.Pointer(bp + 40)) = uint32(0)
- if Xgetentropy(tls, bp, uint32(40)) == -int32(1) {
- libc.Xraise(tls, int32(m_SIGKILL))
- }
- if !(_rs != 0) {
- __rs_init(tls, bp, uint32(40))
- } else {
- __rs_rekey(tls, bp, uint32(40))
- }
- Xexplicit_bzero(tls, bp, uint32(40)) /* discard source seed */
- /* invalidate rs_buf */
- (*T_rs)(unsafe.Pointer(_rs)).Frs_have = uint32(0)
- libc.Xmemset(tls, _rsx+64, 0, uint32(1024))
- /* rekey interval should not be predictable */
- _chacha_encrypt_bytes(tls, _rsx, bp+40, bp+40, uint32(4))
- (*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))
- }
- func __rs_stir_if_needed(tls *libc.TLS, len1 Tsize_t) {
- __rs_forkdetect(tls)
- if !(_rs != 0) || (*T_rs)(unsafe.Pointer(_rs)).Frs_count <= len1 {
- __rs_stir(tls)
- }
- if (*T_rs)(unsafe.Pointer(_rs)).Frs_count <= len1 {
- (*T_rs)(unsafe.Pointer(_rs)).Frs_count = uint32(0)
- } else {
- *(*Tsize_t)(unsafe.Pointer(_rs + 4)) -= len1
- }
- }
- func __rs_random_buf(tls *libc.TLS, _buf uintptr, n Tsize_t) {
- var buf, keystream uintptr
- var m Tsize_t
- var v1 uint32
- _, _, _, _ = buf, keystream, m, v1
- buf = _buf
- __rs_stir_if_needed(tls, n)
- for n > uint32(0) {
- if (*T_rs)(unsafe.Pointer(_rs)).Frs_have > uint32(0) {
- if n < (*T_rs)(unsafe.Pointer(_rs)).Frs_have {
- v1 = n
- } else {
- v1 = (*T_rs)(unsafe.Pointer(_rs)).Frs_have
- }
- m = v1
- keystream = _rsx + 64 + uintptr(1024) - uintptr((*T_rs)(unsafe.Pointer(_rs)).Frs_have)
- libc.Xmemcpy(tls, buf, keystream, m)
- libc.Xmemset(tls, keystream, 0, m)
- buf += uintptr(m)
- n -= m
- *(*Tsize_t)(unsafe.Pointer(_rs)) -= m
- }
- if (*T_rs)(unsafe.Pointer(_rs)).Frs_have == uint32(0) {
- __rs_rekey(tls, libc.UintptrFromInt32(0), uint32(0))
- }
- }
- }
- func __rs_random_u32(tls *libc.TLS, val uintptr) {
- var keystream uintptr
- _ = keystream
- __rs_stir_if_needed(tls, uint32(4))
- if (*T_rs)(unsafe.Pointer(_rs)).Frs_have < uint32(4) {
- __rs_rekey(tls, libc.UintptrFromInt32(0), uint32(0))
- }
- keystream = _rsx + 64 + uintptr(1024) - uintptr((*T_rs)(unsafe.Pointer(_rs)).Frs_have)
- libc.Xmemcpy(tls, val, keystream, uint32(4))
- libc.Xmemset(tls, keystream, 0, uint32(4))
- *(*Tsize_t)(unsafe.Pointer(_rs)) -= uint32(4)
- }
- func Xarc4random_stir(tls *libc.TLS) {
- libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
- __rs_stir(tls)
- libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
- }
- func Xarc4random_addrandom(tls *libc.TLS, dat uintptr, datlen int32) {
- libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
- __rs_stir_if_needed(tls, libc.Uint32FromInt32(datlen))
- __rs_rekey(tls, dat, libc.Uint32FromInt32(datlen))
- libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
- }
- func Xarc4random(tls *libc.TLS) (r Tuint32_t) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var _ /* val at bp+0 */ Tuint32_t
- libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
- __rs_random_u32(tls, bp)
- libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
- return *(*Tuint32_t)(unsafe.Pointer(bp))
- }
- func Xarc4random_buf(tls *libc.TLS, buf uintptr, n Tsize_t) {
- libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
- __rs_random_buf(tls, buf, n)
- libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&_arc4random_mtx)))
- }
- // C documentation
- //
- // /*
- // * Calculate a uniformly distributed random number less than upper_bound
- // * avoiding "modulo bias".
- // *
- // * Uniformity is achieved by generating new random numbers until the one
- // * returned is outside the range [0, 2**32 % upper_bound). This
- // * guarantees the selected random number will be inside
- // * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound)
- // * after reduction modulo upper_bound.
- // */
- func Xarc4random_uniform(tls *libc.TLS, upper_bound Tuint32_t) (r1 Tuint32_t) {
- var min, r Tuint32_t
- _, _ = min, r
- if upper_bound < uint32(2) {
- return uint32(0)
- }
- /* 2**32 % x == (2**32 - x) % x */
- min = -upper_bound % upper_bound
- /*
- * This could theoretically loop forever but each retry has
- * p > 0.5 (worst case, usually far better) of selecting a
- * number inside the range we need, so it should rarely need
- * to re-roll.
- */
- for {
- r = Xarc4random(tls)
- if r >= min {
- break
- }
- goto _1
- _1:
- }
- return r % upper_bound
- }
- const m_SEEK_CUR = 1
- const m_SEEK_END = 2
- const m_SEEK_SET = 0
- const m_no_argument = 0
- const m_optional_argument = 2
- const m_required_argument = 1
- type Toption = struct {
- Fname uintptr
- Fhas_arg int32
- Fflag uintptr
- Fval int32
- }
- func Xbsd_getopt(tls *libc.TLS, argc int32, argv uintptr, shortopts uintptr) (r int32) {
- if Xoptreset == int32(1) {
- Xoptreset = 0
- libc.Xoptind = 0
- }
- /*
- * Make sure we are using the system getopt() and not a possible
- * overlay macro.
- */
- return libc.Xgetopt(tls, argc, argv, shortopts)
- }
- const m_DT_BLK = 6
- const m_DT_CHR = 2
- const m_DT_DIR = 4
- const m_DT_FIFO = 1
- const m_DT_LNK = 10
- const m_DT_REG = 8
- const m_DT_SOCK = 12
- const m_DT_UNKNOWN = 0
- const m_DT_WHT = 14
- const m_E2BIG = 7
- const m_EACCES = 13
- const m_EADDRINUSE = 98
- const m_EADDRNOTAVAIL = 99
- const m_EADV = 68
- const m_EAFNOSUPPORT = 97
- const m_EAGAIN = 11
- const m_EALREADY = 114
- const m_EBADE = 52
- const m_EBADF = 9
- const m_EBADFD = 77
- const m_EBADMSG = 74
- const m_EBADR = 53
- const m_EBADRQC = 56
- const m_EBADSLT = 57
- const m_EBFONT = 59
- const m_EBUSY = 16
- const m_ECANCELED = 125
- const m_ECHILD = 10
- const m_ECHRNG = 44
- const m_ECOMM = 70
- const m_ECONNABORTED = 103
- const m_ECONNREFUSED = 111
- const m_ECONNRESET = 104
- const m_EDEADLK = 35
- const m_EDEADLOCK = "EDEADLK"
- const m_EDESTADDRREQ = 89
- const m_EDOM = 33
- const m_EDOTDOT = 73
- const m_EDQUOT = 122
- const m_EEXIST = 17
- const m_EFAULT = 14
- const m_EFBIG = 27
- const m_EHOSTDOWN = 112
- const m_EHOSTUNREACH = 113
- const m_EHWPOISON = 133
- const m_EIDRM = 43
- const m_EILSEQ = 84
- const m_EINPROGRESS = 115
- const m_EINTR = 4
- const m_EINVAL = 22
- const m_EIO = 5
- const m_EISCONN = 106
- const m_EISDIR = 21
- const m_EISNAM = 120
- const m_EKEYEXPIRED = 127
- const m_EKEYREJECTED = 129
- const m_EKEYREVOKED = 128
- const m_EL2HLT = 51
- const m_EL2NSYNC = 45
- const m_EL3HLT = 46
- const m_EL3RST = 47
- const m_ELIBACC = 79
- const m_ELIBBAD = 80
- const m_ELIBEXEC = 83
- const m_ELIBMAX = 82
- const m_ELIBSCN = 81
- const m_ELNRNG = 48
- const m_ELOOP = 40
- const m_EMEDIUMTYPE = 124
- const m_EMFILE = 24
- const m_EMLINK = 31
- const m_EMSGSIZE = 90
- const m_EMULTIHOP = 72
- const m_ENAMETOOLONG = 36
- const m_ENAVAIL = 119
- const m_ENETDOWN = 100
- const m_ENETRESET = 102
- const m_ENETUNREACH = 101
- const m_ENFILE = 23
- const m_ENOANO = 55
- const m_ENOBUFS = 105
- const m_ENOCSI = 50
- const m_ENODATA = 61
- const m_ENODEV = 19
- const m_ENOENT = 2
- const m_ENOEXEC = 8
- const m_ENOKEY = 126
- const m_ENOLCK = 37
- const m_ENOLINK = 67
- const m_ENOMEDIUM = 123
- const m_ENOMEM = 12
- const m_ENOMSG = 42
- const m_ENONET = 64
- const m_ENOPKG = 65
- const m_ENOPROTOOPT = 92
- const m_ENOSPC = 28
- const m_ENOSR = 63
- const m_ENOSTR = 60
- const m_ENOSYS = 38
- const m_ENOTBLK = 15
- const m_ENOTCONN = 107
- const m_ENOTDIR = 20
- const m_ENOTEMPTY = 39
- const m_ENOTNAM = 118
- const m_ENOTRECOVERABLE = 131
- const m_ENOTSOCK = 88
- const m_ENOTSUP = "EOPNOTSUPP"
- const m_ENOTTY = 25
- const m_ENOTUNIQ = 76
- const m_ENXIO = 6
- const m_EOPNOTSUPP = 95
- const m_EOVERFLOW = 75
- const m_EOWNERDEAD = 130
- const m_EPERM = 1
- const m_EPFNOSUPPORT = 96
- const m_EPIPE = 32
- const m_EPROTO = 71
- const m_EPROTONOSUPPORT = 93
- const m_EPROTOTYPE = 91
- const m_ERANGE = 34
- const m_EREMCHG = 78
- const m_EREMOTE = 66
- const m_EREMOTEIO = 121
- const m_ERESTART = 85
- const m_ERFKILL = 132
- const m_EROFS = 30
- const m_ESHUTDOWN = 108
- const m_ESOCKTNOSUPPORT = 94
- const m_ESPIPE = 29
- const m_ESRCH = 3
- const m_ESRMNT = 69
- const m_ESTALE = 116
- const m_ESTRPIPE = 86
- const m_ETIME = 62
- const m_ETIMEDOUT = 110
- const m_ETOOMANYREFS = 109
- const m_ETXTBSY = 26
- const m_EUCLEAN = 117
- const m_EUNATCH = 49
- const m_EUSERS = 87
- const m_EWOULDBLOCK = "EAGAIN"
- const m_EXDEV = 18
- const m_EXFULL = 54
- const m_INT_MAX1 = 2147483647
- const m_OPEN_MAX = 256
- const m_SYS__llseek = 140
- const m_SYS__newselect = 142
- const m_SYS__sysctl = 149
- const m_SYS_accept4 = 364
- const m_SYS_access = 33
- const m_SYS_acct = 51
- const m_SYS_add_key = 286
- const m_SYS_adjtimex = 124
- const m_SYS_afs_syscall = 137
- const m_SYS_alarm = 27
- const m_SYS_arch_prctl = 384
- const m_SYS_bdflush = 134
- const m_SYS_bind = 361
- const m_SYS_bpf = 357
- const m_SYS_break = 17
- const m_SYS_brk = 45
- const m_SYS_cachestat = 451
- const m_SYS_capget = 184
- const m_SYS_capset = 185
- const m_SYS_chdir = 12
- const m_SYS_chmod = 15
- const m_SYS_chown = 182
- const m_SYS_chown32 = 212
- const m_SYS_chroot = 61
- const m_SYS_clock_adjtime = 343
- const m_SYS_clock_adjtime64 = 405
- const m_SYS_clock_getres_time64 = 406
- const m_SYS_clock_gettime64 = 403
- const m_SYS_clock_nanosleep_time64 = 407
- const m_SYS_clock_settime64 = 404
- const m_SYS_clone = 120
- const m_SYS_clone3 = 435
- const m_SYS_close = 6
- const m_SYS_close_range = 436
- const m_SYS_connect = 362
- const m_SYS_copy_file_range = 377
- const m_SYS_creat = 8
- const m_SYS_create_module = 127
- const m_SYS_delete_module = 129
- const m_SYS_dup = 41
- const m_SYS_dup2 = 63
- const m_SYS_dup3 = 330
- const m_SYS_epoll_create = 254
- const m_SYS_epoll_create1 = 329
- const m_SYS_epoll_ctl = 255
- const m_SYS_epoll_pwait = 319
- const m_SYS_epoll_pwait2 = 441
- const m_SYS_epoll_wait = 256
- const m_SYS_eventfd = 323
- const m_SYS_eventfd2 = 328
- const m_SYS_execve = 11
- const m_SYS_execveat = 358
- const m_SYS_exit = 1
- const m_SYS_exit_group = 252
- const m_SYS_faccessat = 307
- const m_SYS_faccessat2 = 439
- const m_SYS_fadvise64 = 250
- const m_SYS_fadvise64_64 = 272
- const m_SYS_fallocate = 324
- const m_SYS_fanotify_init = 338
- const m_SYS_fanotify_mark = 339
- const m_SYS_fchdir = 133
- const m_SYS_fchmod = 94
- const m_SYS_fchmodat = 306
- const m_SYS_fchmodat2 = 452
- const m_SYS_fchown = 95
- const m_SYS_fchown32 = 207
- const m_SYS_fchownat = 298
- const m_SYS_fcntl = 55
- const m_SYS_fcntl64 = 221
- const m_SYS_fdatasync = 148
- const m_SYS_fgetxattr = 231
- const m_SYS_finit_module = 350
- const m_SYS_flistxattr = 234
- const m_SYS_flock = 143
- const m_SYS_fork = 2
- const m_SYS_fremovexattr = 237
- const m_SYS_fsconfig = 431
- const m_SYS_fsetxattr = 228
- const m_SYS_fsmount = 432
- const m_SYS_fsopen = 430
- const m_SYS_fspick = 433
- const m_SYS_fstat = 108
- const m_SYS_fstat64 = 197
- const m_SYS_fstatat64 = 300
- const m_SYS_fstatfs = 100
- const m_SYS_fstatfs64 = 269
- const m_SYS_fsync = 118
- const m_SYS_ftime = 35
- const m_SYS_ftruncate = 93
- const m_SYS_ftruncate64 = 194
- const m_SYS_futex = 240
- const m_SYS_futex_time64 = 422
- const m_SYS_futex_waitv = 449
- const m_SYS_futimesat = 299
- const m_SYS_get_kernel_syms = 130
- const m_SYS_get_mempolicy = 275
- const m_SYS_get_robust_list = 312
- const m_SYS_get_thread_area = 244
- const m_SYS_getcpu = 318
- const m_SYS_getcwd = 183
- const m_SYS_getdents = 141
- const m_SYS_getdents64 = 220
- const m_SYS_getegid = 50
- const m_SYS_getegid32 = 202
- const m_SYS_geteuid = 49
- const m_SYS_geteuid32 = 201
- const m_SYS_getgid = 47
- const m_SYS_getgid32 = 200
- const m_SYS_getgroups = 80
- const m_SYS_getgroups32 = 205
- const m_SYS_getitimer = 105
- const m_SYS_getpeername = 368
- const m_SYS_getpgid = 132
- const m_SYS_getpgrp = 65
- const m_SYS_getpid = 20
- const m_SYS_getpmsg = 188
- const m_SYS_getppid = 64
- const m_SYS_getpriority = 96
- const m_SYS_getrandom = 355
- const m_SYS_getresgid = 171
- const m_SYS_getresgid32 = 211
- const m_SYS_getresuid = 165
- const m_SYS_getresuid32 = 209
- const m_SYS_getrlimit = 76
- const m_SYS_getrusage = 77
- const m_SYS_getsid = 147
- const m_SYS_getsockname = 367
- const m_SYS_getsockopt = 365
- const m_SYS_gettid = 224
- const m_SYS_gettimeofday_time32 = 78
- const m_SYS_getuid = 24
- const m_SYS_getuid32 = 199
- const m_SYS_getxattr = 229
- const m_SYS_gtty = 32
- const m_SYS_idle = 112
- const m_SYS_init_module = 128
- const m_SYS_inotify_add_watch = 292
- const m_SYS_inotify_init = 291
- const m_SYS_inotify_init1 = 332
- const m_SYS_inotify_rm_watch = 293
- const m_SYS_io_cancel = 249
- const m_SYS_io_destroy = 246
- const m_SYS_io_getevents = 247
- const m_SYS_io_pgetevents = 385
- const m_SYS_io_pgetevents_time64 = 416
- const m_SYS_io_setup = 245
- const m_SYS_io_submit = 248
- const m_SYS_io_uring_enter = 426
- const m_SYS_io_uring_register = 427
- const m_SYS_io_uring_setup = 425
- const m_SYS_ioctl = 54
- const m_SYS_ioperm = 101
- const m_SYS_iopl = 110
- const m_SYS_ioprio_get = 290
- const m_SYS_ioprio_set = 289
- const m_SYS_ipc = 117
- const m_SYS_kcmp = 349
- const m_SYS_kexec_load = 283
- const m_SYS_keyctl = 288
- const m_SYS_kill = 37
- const m_SYS_landlock_add_rule = 445
- const m_SYS_landlock_create_ruleset = 444
- const m_SYS_landlock_restrict_self = 446
- const m_SYS_lchown = 16
- const m_SYS_lchown32 = 198
- const m_SYS_lgetxattr = 230
- const m_SYS_link = 9
- const m_SYS_linkat = 303
- const m_SYS_listen = 363
- const m_SYS_listxattr = 232
- const m_SYS_llistxattr = 233
- const m_SYS_lock = 53
- const m_SYS_lookup_dcookie = 253
- const m_SYS_lremovexattr = 236
- const m_SYS_lseek = 19
- const m_SYS_lsetxattr = 227
- const m_SYS_lstat = 107
- const m_SYS_lstat64 = 196
- const m_SYS_madvise = 219
- const m_SYS_mbind = 274
- const m_SYS_membarrier = 375
- const m_SYS_memfd_create = 356
- const m_SYS_memfd_secret = 447
- const m_SYS_migrate_pages = 294
- const m_SYS_mincore = 218
- const m_SYS_mkdir = 39
- const m_SYS_mkdirat = 296
- const m_SYS_mknod = 14
- const m_SYS_mknodat = 297
- const m_SYS_mlock = 150
- const m_SYS_mlock2 = 376
- const m_SYS_mlockall = 152
- const m_SYS_mmap = 90
- const m_SYS_mmap2 = 192
- const m_SYS_modify_ldt = 123
- const m_SYS_mount = 21
- const m_SYS_mount_setattr = 442
- const m_SYS_move_mount = 429
- const m_SYS_move_pages = 317
- const m_SYS_mprotect = 125
- const m_SYS_mpx = 56
- const m_SYS_mq_open = 277
- const m_SYS_mq_timedreceive_time64 = 419
- const m_SYS_mq_timedsend_time64 = 418
- const m_SYS_mremap = 163
- const m_SYS_msgctl = 402
- const m_SYS_msgget = 399
- const m_SYS_msgrcv = 401
- const m_SYS_msgsnd = 400
- const m_SYS_msync = 144
- const m_SYS_munlock = 151
- const m_SYS_munlockall = 153
- const m_SYS_munmap = 91
- const m_SYS_name_to_handle_at = 341
- const m_SYS_nanosleep = 162
- const m_SYS_nfsservctl = 169
- const m_SYS_nice = 34
- const m_SYS_oldfstat = 28
- const m_SYS_oldlstat = 84
- const m_SYS_oldolduname = 59
- const m_SYS_oldstat = 18
- const m_SYS_olduname = 109
- const m_SYS_open = 5
- const m_SYS_open_by_handle_at = 342
- const m_SYS_open_tree = 428
- const m_SYS_openat = 295
- const m_SYS_openat2 = 437
- const m_SYS_pause = 29
- const m_SYS_perf_event_open = 336
- const m_SYS_personality = 136
- const m_SYS_pidfd_getfd = 438
- const m_SYS_pidfd_open = 434
- const m_SYS_pidfd_send_signal = 424
- const m_SYS_pipe = 42
- const m_SYS_pipe2 = 331
- const m_SYS_pivot_root = 217
- const m_SYS_pkey_alloc = 381
- const m_SYS_pkey_free = 382
- const m_SYS_pkey_mprotect = 380
- const m_SYS_poll = 168
- const m_SYS_ppoll = 309
- const m_SYS_ppoll_time64 = 414
- const m_SYS_prctl = 172
- const m_SYS_pread64 = 180
- const m_SYS_preadv = 333
- const m_SYS_preadv2 = 378
- const m_SYS_prlimit64 = 340
- const m_SYS_process_madvise = 440
- const m_SYS_process_mrelease = 448
- const m_SYS_process_vm_readv = 347
- const m_SYS_process_vm_writev = 348
- const m_SYS_prof = 44
- const m_SYS_profil = 98
- const m_SYS_pselect6 = 308
- const m_SYS_pselect6_time64 = 413
- const m_SYS_ptrace = 26
- const m_SYS_putpmsg = 189
- const m_SYS_pwrite64 = 181
- const m_SYS_pwritev = 334
- const m_SYS_pwritev2 = 379
- const m_SYS_query_module = 167
- const m_SYS_quotactl = 131
- const m_SYS_read = 3
- const m_SYS_readahead = 225
- const m_SYS_readdir = 89
- const m_SYS_readlink = 85
- const m_SYS_readlinkat = 305
- const m_SYS_readv = 145
- const m_SYS_reboot = 88
- const m_SYS_recvfrom = 371
- const m_SYS_recvmmsg = 337
- const m_SYS_recvmmsg_time64 = 417
- const m_SYS_recvmsg = 372
- const m_SYS_remap_file_pages = 257
- const m_SYS_removexattr = 235
- const m_SYS_rename = 38
- const m_SYS_renameat = 302
- const m_SYS_renameat2 = 353
- const m_SYS_request_key = 287
- const m_SYS_restart_syscall = 0
- const m_SYS_rmdir = 40
- const m_SYS_rseq = 386
- const m_SYS_rt_sigaction = 174
- const m_SYS_rt_sigpending = 176
- const m_SYS_rt_sigprocmask = 175
- const m_SYS_rt_sigqueueinfo = 178
- const m_SYS_rt_sigreturn = 173
- const m_SYS_rt_sigsuspend = 179
- const m_SYS_rt_sigtimedwait = 177
- const m_SYS_rt_sigtimedwait_time64 = 421
- const m_SYS_rt_tgsigqueueinfo = 335
- const m_SYS_sched_get_priority_max = 159
- const m_SYS_sched_get_priority_min = 160
- const m_SYS_sched_getaffinity = 242
- const m_SYS_sched_getattr = 352
- const m_SYS_sched_getparam = 155
- const m_SYS_sched_getscheduler = 157
- const m_SYS_sched_rr_get_interval = 161
- const m_SYS_sched_rr_get_interval_time64 = 423
- const m_SYS_sched_setaffinity = 241
- const m_SYS_sched_setattr = 351
- const m_SYS_sched_setparam = 154
- const m_SYS_sched_setscheduler = 156
- const m_SYS_sched_yield = 158
- const m_SYS_seccomp = 354
- const m_SYS_select = 82
- const m_SYS_semctl = 394
- const m_SYS_semget = 393
- const m_SYS_semtimedop_time64 = 420
- const m_SYS_sendfile = 187
- const m_SYS_sendfile64 = 239
- const m_SYS_sendmmsg = 345
- const m_SYS_sendmsg = 370
- const m_SYS_sendto = 369
- const m_SYS_set_mempolicy = 276
- const m_SYS_set_mempolicy_home_node = 450
- const m_SYS_set_robust_list = 311
- const m_SYS_set_thread_area = 243
- const m_SYS_set_tid_address = 258
- const m_SYS_setdomainname = 121
- const m_SYS_setfsgid = 139
- const m_SYS_setfsgid32 = 216
- const m_SYS_setfsuid = 138
- const m_SYS_setfsuid32 = 215
- const m_SYS_setgid = 46
- const m_SYS_setgid32 = 214
- const m_SYS_setgroups = 81
- const m_SYS_setgroups32 = 206
- const m_SYS_sethostname = 74
- const m_SYS_setitimer = 104
- const m_SYS_setns = 346
- const m_SYS_setpgid = 57
- const m_SYS_setpriority = 97
- const m_SYS_setregid = 71
- const m_SYS_setregid32 = 204
- const m_SYS_setresgid = 170
- const m_SYS_setresgid32 = 210
- const m_SYS_setresuid = 164
- const m_SYS_setresuid32 = 208
- const m_SYS_setreuid = 70
- const m_SYS_setreuid32 = 203
- const m_SYS_setrlimit = 75
- const m_SYS_setsid = 66
- const m_SYS_setsockopt = 366
- const m_SYS_settimeofday_time32 = 79
- const m_SYS_setuid = 23
- const m_SYS_setuid32 = 213
- const m_SYS_setxattr = 226
- const m_SYS_sgetmask = 68
- const m_SYS_shmat = 397
- const m_SYS_shmctl = 396
- const m_SYS_shmdt = 398
- const m_SYS_shmget = 395
- const m_SYS_shutdown = 373
- const m_SYS_sigaction = 67
- const m_SYS_sigaltstack = 186
- const m_SYS_signal = 48
- const m_SYS_signalfd = 321
- const m_SYS_signalfd4 = 327
- const m_SYS_sigpending = 73
- const m_SYS_sigprocmask = 126
- const m_SYS_sigreturn = 119
- const m_SYS_sigsuspend = 72
- const m_SYS_socket = 359
- const m_SYS_socketcall = 102
- const m_SYS_socketpair = 360
- const m_SYS_splice = 313
- const m_SYS_ssetmask = 69
- const m_SYS_stat = 106
- const m_SYS_stat64 = 195
- const m_SYS_statfs = 99
- const m_SYS_statfs64 = 268
- const m_SYS_statx = 383
- const m_SYS_stime = 25
- const m_SYS_stty = 31
- const m_SYS_swapoff = 115
- const m_SYS_swapon = 87
- const m_SYS_symlink = 83
- const m_SYS_symlinkat = 304
- const m_SYS_sync = 36
- const m_SYS_sync_file_range = 314
- const m_SYS_syncfs = 344
- const m_SYS_sysfs = 135
- const m_SYS_sysinfo = 116
- const m_SYS_syslog = 103
- const m_SYS_tee = 315
- const m_SYS_tgkill = 270
- const m_SYS_time = 13
- const m_SYS_timer_create = 259
- const m_SYS_timer_gettime64 = 408
- const m_SYS_timer_settime64 = 409
- const m_SYS_timerfd_create = 322
- const m_SYS_timerfd_gettime32 = 326
- const m_SYS_timerfd_gettime64 = 410
- const m_SYS_timerfd_settime32 = 325
- const m_SYS_timerfd_settime64 = 411
- const m_SYS_times = 43
- const m_SYS_tkill = 238
- const m_SYS_truncate = 92
- const m_SYS_truncate64 = 193
- const m_SYS_ugetrlimit = 191
- const m_SYS_ulimit = 58
- const m_SYS_umask = 60
- const m_SYS_umount = 22
- const m_SYS_umount2 = 52
- const m_SYS_uname = 122
- const m_SYS_unlink = 10
- const m_SYS_unlinkat = 301
- const m_SYS_unshare = 310
- const m_SYS_uselib = 86
- const m_SYS_userfaultfd = 374
- const m_SYS_ustat = 62
- const m_SYS_utime = 30
- const m_SYS_utimensat = 320
- const m_SYS_utimensat_time64 = 412
- const m_SYS_utimes = 271
- const m_SYS_vfork = 190
- const m_SYS_vhangup = 111
- const m_SYS_vm86 = 166
- const m_SYS_vm86old = 113
- const m_SYS_vmsplice = 316
- const m_SYS_vserver = 273
- const m_SYS_wait4 = 114
- const m_SYS_waitid = 284
- const m_SYS_waitpid = 7
- const m_SYS_write = 4
- const m_SYS_writev = 146
- const m_UINT_MAX1 = 4294967295
- const m___NR__llseek = 140
- const m___NR__newselect = 142
- const m___NR__sysctl = 149
- const m___NR_accept4 = 364
- const m___NR_access = 33
- const m___NR_acct = 51
- const m___NR_add_key = 286
- const m___NR_adjtimex = 124
- const m___NR_afs_syscall = 137
- const m___NR_alarm = 27
- const m___NR_arch_prctl = 384
- const m___NR_bdflush = 134
- const m___NR_bind = 361
- const m___NR_bpf = 357
- const m___NR_break = 17
- const m___NR_brk = 45
- const m___NR_cachestat = 451
- const m___NR_capget = 184
- const m___NR_capset = 185
- const m___NR_chdir = 12
- const m___NR_chmod = 15
- const m___NR_chown = 182
- const m___NR_chown32 = 212
- const m___NR_chroot = 61
- const m___NR_clock_adjtime = 343
- const m___NR_clock_adjtime64 = 405
- const m___NR_clock_getres_time64 = 406
- const m___NR_clock_gettime64 = 403
- const m___NR_clock_nanosleep_time64 = 407
- const m___NR_clock_settime64 = 404
- const m___NR_clone = 120
- const m___NR_clone3 = 435
- const m___NR_close = 6
- const m___NR_close_range = 436
- const m___NR_connect = 362
- const m___NR_copy_file_range = 377
- const m___NR_creat = 8
- const m___NR_create_module = 127
- const m___NR_delete_module = 129
- const m___NR_dup = 41
- const m___NR_dup2 = 63
- const m___NR_dup3 = 330
- const m___NR_epoll_create = 254
- const m___NR_epoll_create1 = 329
- const m___NR_epoll_ctl = 255
- const m___NR_epoll_pwait = 319
- const m___NR_epoll_pwait2 = 441
- const m___NR_epoll_wait = 256
- const m___NR_eventfd = 323
- const m___NR_eventfd2 = 328
- const m___NR_execve = 11
- const m___NR_execveat = 358
- const m___NR_exit = 1
- const m___NR_exit_group = 252
- const m___NR_faccessat = 307
- const m___NR_faccessat2 = 439
- const m___NR_fadvise64 = 250
- const m___NR_fadvise64_64 = 272
- const m___NR_fallocate = 324
- const m___NR_fanotify_init = 338
- const m___NR_fanotify_mark = 339
- const m___NR_fchdir = 133
- const m___NR_fchmod = 94
- const m___NR_fchmodat = 306
- const m___NR_fchmodat2 = 452
- const m___NR_fchown = 95
- const m___NR_fchown32 = 207
- const m___NR_fchownat = 298
- const m___NR_fcntl = 55
- const m___NR_fcntl64 = 221
- const m___NR_fdatasync = 148
- const m___NR_fgetxattr = 231
- const m___NR_finit_module = 350
- const m___NR_flistxattr = 234
- const m___NR_flock = 143
- const m___NR_fork = 2
- const m___NR_fremovexattr = 237
- const m___NR_fsconfig = 431
- const m___NR_fsetxattr = 228
- const m___NR_fsmount = 432
- const m___NR_fsopen = 430
- const m___NR_fspick = 433
- const m___NR_fstat = 108
- const m___NR_fstat64 = 197
- const m___NR_fstatat64 = 300
- const m___NR_fstatfs = 100
- const m___NR_fstatfs64 = 269
- const m___NR_fsync = 118
- const m___NR_ftime = 35
- const m___NR_ftruncate = 93
- const m___NR_ftruncate64 = 194
- const m___NR_futex = 240
- const m___NR_futex_time64 = 422
- const m___NR_futex_waitv = 449
- const m___NR_futimesat = 299
- const m___NR_get_kernel_syms = 130
- const m___NR_get_mempolicy = 275
- const m___NR_get_robust_list = 312
- const m___NR_get_thread_area = 244
- const m___NR_getcpu = 318
- const m___NR_getcwd = 183
- const m___NR_getdents = 141
- const m___NR_getdents64 = 220
- const m___NR_getegid = 50
- const m___NR_getegid32 = 202
- const m___NR_geteuid = 49
- const m___NR_geteuid32 = 201
- const m___NR_getgid = 47
- const m___NR_getgid32 = 200
- const m___NR_getgroups = 80
- const m___NR_getgroups32 = 205
- const m___NR_getitimer = 105
- const m___NR_getpeername = 368
- const m___NR_getpgid = 132
- const m___NR_getpgrp = 65
- const m___NR_getpid = 20
- const m___NR_getpmsg = 188
- const m___NR_getppid = 64
- const m___NR_getpriority = 96
- const m___NR_getrandom = 355
- const m___NR_getresgid = 171
- const m___NR_getresgid32 = 211
- const m___NR_getresuid = 165
- const m___NR_getresuid32 = 209
- const m___NR_getrlimit = 76
- const m___NR_getrusage = 77
- const m___NR_getsid = 147
- const m___NR_getsockname = 367
- const m___NR_getsockopt = 365
- const m___NR_gettid = 224
- const m___NR_gettimeofday_time32 = 78
- const m___NR_getuid = 24
- const m___NR_getuid32 = 199
- const m___NR_getxattr = 229
- const m___NR_gtty = 32
- const m___NR_idle = 112
- const m___NR_init_module = 128
- const m___NR_inotify_add_watch = 292
- const m___NR_inotify_init = 291
- const m___NR_inotify_init1 = 332
- const m___NR_inotify_rm_watch = 293
- const m___NR_io_cancel = 249
- const m___NR_io_destroy = 246
- const m___NR_io_getevents = 247
- const m___NR_io_pgetevents = 385
- const m___NR_io_pgetevents_time64 = 416
- const m___NR_io_setup = 245
- const m___NR_io_submit = 248
- const m___NR_io_uring_enter = 426
- const m___NR_io_uring_register = 427
- const m___NR_io_uring_setup = 425
- const m___NR_ioctl = 54
- const m___NR_ioperm = 101
- const m___NR_iopl = 110
- const m___NR_ioprio_get = 290
- const m___NR_ioprio_set = 289
- const m___NR_ipc = 117
- const m___NR_kcmp = 349
- const m___NR_kexec_load = 283
- const m___NR_keyctl = 288
- const m___NR_kill = 37
- const m___NR_landlock_add_rule = 445
- const m___NR_landlock_create_ruleset = 444
- const m___NR_landlock_restrict_self = 446
- const m___NR_lchown = 16
- const m___NR_lchown32 = 198
- const m___NR_lgetxattr = 230
- const m___NR_link = 9
- const m___NR_linkat = 303
- const m___NR_listen = 363
- const m___NR_listxattr = 232
- const m___NR_llistxattr = 233
- const m___NR_lock = 53
- const m___NR_lookup_dcookie = 253
- const m___NR_lremovexattr = 236
- const m___NR_lseek = 19
- const m___NR_lsetxattr = 227
- const m___NR_lstat = 107
- const m___NR_lstat64 = 196
- const m___NR_madvise = 219
- const m___NR_mbind = 274
- const m___NR_membarrier = 375
- const m___NR_memfd_create = 356
- const m___NR_memfd_secret = 447
- const m___NR_migrate_pages = 294
- const m___NR_mincore = 218
- const m___NR_mkdir = 39
- const m___NR_mkdirat = 296
- const m___NR_mknod = 14
- const m___NR_mknodat = 297
- const m___NR_mlock = 150
- const m___NR_mlock2 = 376
- const m___NR_mlockall = 152
- const m___NR_mmap = 90
- const m___NR_mmap2 = 192
- const m___NR_modify_ldt = 123
- const m___NR_mount = 21
- const m___NR_mount_setattr = 442
- const m___NR_move_mount = 429
- const m___NR_move_pages = 317
- const m___NR_mprotect = 125
- const m___NR_mpx = 56
- const m___NR_mq_open = 277
- const m___NR_mq_timedreceive_time64 = 419
- const m___NR_mq_timedsend_time64 = 418
- const m___NR_mremap = 163
- const m___NR_msgctl = 402
- const m___NR_msgget = 399
- const m___NR_msgrcv = 401
- const m___NR_msgsnd = 400
- const m___NR_msync = 144
- const m___NR_munlock = 151
- const m___NR_munlockall = 153
- const m___NR_munmap = 91
- const m___NR_name_to_handle_at = 341
- const m___NR_nanosleep = 162
- const m___NR_nfsservctl = 169
- const m___NR_nice = 34
- const m___NR_oldfstat = 28
- const m___NR_oldlstat = 84
- const m___NR_oldolduname = 59
- const m___NR_oldstat = 18
- const m___NR_olduname = 109
- const m___NR_open = 5
- const m___NR_open_by_handle_at = 342
- const m___NR_open_tree = 428
- const m___NR_openat = 295
- const m___NR_openat2 = 437
- const m___NR_pause = 29
- const m___NR_perf_event_open = 336
- const m___NR_personality = 136
- const m___NR_pidfd_getfd = 438
- const m___NR_pidfd_open = 434
- const m___NR_pidfd_send_signal = 424
- const m___NR_pipe = 42
- const m___NR_pipe2 = 331
- const m___NR_pivot_root = 217
- const m___NR_pkey_alloc = 381
- const m___NR_pkey_free = 382
- const m___NR_pkey_mprotect = 380
- const m___NR_poll = 168
- const m___NR_ppoll = 309
- const m___NR_ppoll_time64 = 414
- const m___NR_prctl = 172
- const m___NR_pread64 = 180
- const m___NR_preadv = 333
- const m___NR_preadv2 = 378
- const m___NR_prlimit64 = 340
- const m___NR_process_madvise = 440
- const m___NR_process_mrelease = 448
- const m___NR_process_vm_readv = 347
- const m___NR_process_vm_writev = 348
- const m___NR_prof = 44
- const m___NR_profil = 98
- const m___NR_pselect6 = 308
- const m___NR_pselect6_time64 = 413
- const m___NR_ptrace = 26
- const m___NR_putpmsg = 189
- const m___NR_pwrite64 = 181
- const m___NR_pwritev = 334
- const m___NR_pwritev2 = 379
- const m___NR_query_module = 167
- const m___NR_quotactl = 131
- const m___NR_read = 3
- const m___NR_readahead = 225
- const m___NR_readdir = 89
- const m___NR_readlink = 85
- const m___NR_readlinkat = 305
- const m___NR_readv = 145
- const m___NR_reboot = 88
- const m___NR_recvfrom = 371
- const m___NR_recvmmsg = 337
- const m___NR_recvmmsg_time64 = 417
- const m___NR_recvmsg = 372
- const m___NR_remap_file_pages = 257
- const m___NR_removexattr = 235
- const m___NR_rename = 38
- const m___NR_renameat = 302
- const m___NR_renameat2 = 353
- const m___NR_request_key = 287
- const m___NR_restart_syscall = 0
- const m___NR_rmdir = 40
- const m___NR_rseq = 386
- const m___NR_rt_sigaction = 174
- const m___NR_rt_sigpending = 176
- const m___NR_rt_sigprocmask = 175
- const m___NR_rt_sigqueueinfo = 178
- const m___NR_rt_sigreturn = 173
- const m___NR_rt_sigsuspend = 179
- const m___NR_rt_sigtimedwait = 177
- const m___NR_rt_sigtimedwait_time64 = 421
- const m___NR_rt_tgsigqueueinfo = 335
- const m___NR_sched_get_priority_max = 159
- const m___NR_sched_get_priority_min = 160
- const m___NR_sched_getaffinity = 242
- const m___NR_sched_getattr = 352
- const m___NR_sched_getparam = 155
- const m___NR_sched_getscheduler = 157
- const m___NR_sched_rr_get_interval = 161
- const m___NR_sched_rr_get_interval_time64 = 423
- const m___NR_sched_setaffinity = 241
- const m___NR_sched_setattr = 351
- const m___NR_sched_setparam = 154
- const m___NR_sched_setscheduler = 156
- const m___NR_sched_yield = 158
- const m___NR_seccomp = 354
- const m___NR_select = 82
- const m___NR_semctl = 394
- const m___NR_semget = 393
- const m___NR_semtimedop_time64 = 420
- const m___NR_sendfile = 187
- const m___NR_sendfile64 = 239
- const m___NR_sendmmsg = 345
- const m___NR_sendmsg = 370
- const m___NR_sendto = 369
- const m___NR_set_mempolicy = 276
- const m___NR_set_mempolicy_home_node = 450
- const m___NR_set_robust_list = 311
- const m___NR_set_thread_area = 243
- const m___NR_set_tid_address = 258
- const m___NR_setdomainname = 121
- const m___NR_setfsgid = 139
- const m___NR_setfsgid32 = 216
- const m___NR_setfsuid = 138
- const m___NR_setfsuid32 = 215
- const m___NR_setgid = 46
- const m___NR_setgid32 = 214
- const m___NR_setgroups = 81
- const m___NR_setgroups32 = 206
- const m___NR_sethostname = 74
- const m___NR_setitimer = 104
- const m___NR_setns = 346
- const m___NR_setpgid = 57
- const m___NR_setpriority = 97
- const m___NR_setregid = 71
- const m___NR_setregid32 = 204
- const m___NR_setresgid = 170
- const m___NR_setresgid32 = 210
- const m___NR_setresuid = 164
- const m___NR_setresuid32 = 208
- const m___NR_setreuid = 70
- const m___NR_setreuid32 = 203
- const m___NR_setrlimit = 75
- const m___NR_setsid = 66
- const m___NR_setsockopt = 366
- const m___NR_settimeofday_time32 = 79
- const m___NR_setuid = 23
- const m___NR_setuid32 = 213
- const m___NR_setxattr = 226
- const m___NR_sgetmask = 68
- const m___NR_shmat = 397
- const m___NR_shmctl = 396
- const m___NR_shmdt = 398
- const m___NR_shmget = 395
- const m___NR_shutdown = 373
- const m___NR_sigaction = 67
- const m___NR_sigaltstack = 186
- const m___NR_signal = 48
- const m___NR_signalfd = 321
- const m___NR_signalfd4 = 327
- const m___NR_sigpending = 73
- const m___NR_sigprocmask = 126
- const m___NR_sigreturn = 119
- const m___NR_sigsuspend = 72
- const m___NR_socket = 359
- const m___NR_socketcall = 102
- const m___NR_socketpair = 360
- const m___NR_splice = 313
- const m___NR_ssetmask = 69
- const m___NR_stat = 106
- const m___NR_stat64 = 195
- const m___NR_statfs = 99
- const m___NR_statfs64 = 268
- const m___NR_statx = 383
- const m___NR_stime = 25
- const m___NR_stty = 31
- const m___NR_swapoff = 115
- const m___NR_swapon = 87
- const m___NR_symlink = 83
- const m___NR_symlinkat = 304
- const m___NR_sync = 36
- const m___NR_sync_file_range = 314
- const m___NR_syncfs = 344
- const m___NR_sysfs = 135
- const m___NR_sysinfo = 116
- const m___NR_syslog = 103
- const m___NR_tee = 315
- const m___NR_tgkill = 270
- const m___NR_time = 13
- const m___NR_timer_create = 259
- const m___NR_timer_gettime64 = 408
- const m___NR_timer_settime64 = 409
- const m___NR_timerfd_create = 322
- const m___NR_timerfd_gettime32 = 326
- const m___NR_timerfd_gettime64 = 410
- const m___NR_timerfd_settime32 = 325
- const m___NR_timerfd_settime64 = 411
- const m___NR_times = 43
- const m___NR_tkill = 238
- const m___NR_truncate = 92
- const m___NR_truncate64 = 193
- const m___NR_ugetrlimit = 191
- const m___NR_ulimit = 58
- const m___NR_umask = 60
- const m___NR_umount = 22
- const m___NR_umount2 = 52
- const m___NR_uname = 122
- const m___NR_unlink = 10
- const m___NR_unlinkat = 301
- const m___NR_unshare = 310
- const m___NR_uselib = 86
- const m___NR_userfaultfd = 374
- const m___NR_ustat = 62
- const m___NR_utime = 30
- const m___NR_utimensat = 320
- const m___NR_utimensat_time64 = 412
- const m___NR_utimes = 271
- const m___NR_vfork = 190
- const m___NR_vhangup = 111
- const m___NR_vm86 = 166
- const m___NR_vm86old = 113
- const m___NR_vmsplice = 316
- const m___NR_vserver = 273
- const m___NR_wait4 = 114
- const m___NR_waitid = 284
- const m___NR_waitpid = 7
- const m___NR_write = 4
- const m___NR_writev = 146
- const m_d_fileno = "d_ino"
- type Tdirent = struct {
- Fd_ino Tino_t
- Fd_off Toff_t
- Fd_reclen uint16
- Fd_type uint8
- Fd_name [256]int8
- }
- func _closefrom_close(tls *libc.TLS, fd int32) {
- libc.Xclose(tls, fd)
- }
- func _sys_close_range(tls *libc.TLS, fd uint32, max_fd uint32, flags uint32) (r int32) {
- bp := tls.Alloc(32)
- defer tls.Free(32)
- return int32(libc.Xsyscall(tls, int32(m_SYS_close_range), libc.VaList(bp+8, fd, max_fd, flags)))
- }
- // C documentation
- //
- // /*
- // * Close all file descriptors greater than or equal to lowfd.
- // * This is the expensive (fallback) method.
- // */
- func _closefrom_fallback(tls *libc.TLS, lowfd int32) {
- var fd, maxfd int32
- _, _ = fd, maxfd
- /*
- * Fall back on sysconf(_SC_OPEN_MAX) or getdtablesize(). This is
- * equivalent to checking the RLIMIT_NOFILE soft limit. It is
- * possible for there to be open file descriptors past this limit
- * but there is not much we can do about that since the hard limit
- * may be RLIM_INFINITY (LLONG_MAX or ULLONG_MAX on modern systems).
- */
- maxfd = libc.Xsysconf(tls, int32(m__SC_OPEN_MAX))
- if maxfd < int32(m_OPEN_MAX) {
- maxfd = int32(m_OPEN_MAX)
- }
- /* Make sure we did not get RLIM_INFINITY as the upper limit. */
- if maxfd > int32(m_INT_MAX1) {
- maxfd = int32(m_INT_MAX1)
- }
- fd = lowfd
- for {
- if !(fd < maxfd) {
- break
- }
- _closefrom_close(tls, fd)
- goto _1
- _1:
- ;
- fd++
- }
- }
- func _closefrom_procfs(tls *libc.TLS, lowfd int32) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var dent, dirp, fd_array, path, ptr, v1 uintptr
- var fd, fd_array_size, fd_array_used, i, ret, v2 int32
- var _ /* errstr at bp+0 */ uintptr
- _, _, _, _, _, _, _, _, _, _, _, _ = dent, dirp, fd, fd_array, fd_array_size, fd_array_used, i, path, ptr, ret, v1, v2
- fd_array = libc.UintptrFromInt32(0)
- fd_array_used = 0
- fd_array_size = 0
- ret = 0
- /* Use /proc/self/fd (or /dev/fd on macOS) if it exists. */
- path = __ccgo_ts
- dirp = libc.Xopendir(tls, path)
- if dirp == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- for {
- v1 = libc.Xreaddir(tls, dirp)
- dent = v1
- if !(v1 != libc.UintptrFromInt32(0)) {
- break
- }
- fd = int32(Xstrtonum(tls, dent+19, int64(lowfd), int64(m_INT_MAX1), bp))
- if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) || fd == libc.Xdirfd(tls, dirp) {
- continue
- }
- if fd_array_used >= fd_array_size {
- if fd_array_size > 0 {
- fd_array_size *= int32(2)
- } else {
- fd_array_size = int32(32)
- }
- ptr = Xreallocarray(tls, fd_array, libc.Uint32FromInt32(fd_array_size), uint32(4))
- if ptr == libc.UintptrFromInt32(0) {
- ret = -int32(1)
- break
- }
- fd_array = ptr
- }
- v2 = fd_array_used
- fd_array_used++
- *(*int32)(unsafe.Pointer(fd_array + uintptr(v2)*4)) = fd
- }
- i = 0
- for {
- if !(i < fd_array_used) {
- break
- }
- _closefrom_close(tls, *(*int32)(unsafe.Pointer(fd_array + uintptr(i)*4)))
- goto _3
- _3:
- ;
- i++
- }
- libc.Xfree(tls, fd_array)
- libc.Xclosedir(tls, dirp)
- return ret
- }
- // C documentation
- //
- // /*
- // * Close all file descriptors greater than or equal to lowfd.
- // * We try the fast way first, falling back on the slow method.
- // */
- func Xclosefrom(tls *libc.TLS, lowfd int32) {
- if lowfd < 0 {
- lowfd = 0
- }
- /* Try the fast methods first, if possible. */
- if _sys_close_range(tls, libc.Uint32FromInt32(lowfd), uint32(0xffffffff), uint32(0)) == 0 {
- return
- }
- if _closefrom_procfs(tls, lowfd) != -int32(1) {
- return
- }
- /* Do things the slow way. */
- _closefrom_fallback(tls, lowfd)
- }
- const m_INT64_MAX1 = 9223372036854775807
- func Xdehumanize_number(tls *libc.TLS, buf uintptr, num uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var rc, sign, v1, v2 int32
- var rmax Tuint64_t
- var _ /* rval at bp+0 */ Tuint64_t
- _, _, _, _, _ = rc, rmax, sign, v1, v2
- sign = +libc.Int32FromInt32(1)
- /* The current expand_number() implementation uses bit shifts, so
- * we cannot pass negative numbers, preserve the sign and apply it
- * later. */
- for {
- v1 = int32(*(*int8)(unsafe.Pointer(buf)))
- v2 = libc.BoolInt32(v1 == int32(' ') || libc.Uint32FromInt32(v1)-uint32('\t') < uint32(5))
- goto _3
- _3:
- if !(v2 != 0) {
- break
- }
- buf++
- }
- if int32(*(*int8)(unsafe.Pointer(buf))) == int32('-') {
- sign = -int32(1)
- buf++
- }
- rc = Xexpand_number(tls, buf, bp)
- if rc < 0 {
- return rc
- }
- /* The sign has been stripped, so rval has the absolute value.
- * Error out, regardless of the sign, if rval is greater than
- * abs(INT64_MIN) (== INT64_MAX + 1), or if the sign is positive
- * and the value has overflown by one (INT64_MAX + 1). */
- rmax = libc.Uint64FromInt64(libc.Int64FromInt64(m_INT64_MAX1)) + libc.Uint64FromUint64(1)
- if *(*Tuint64_t)(unsafe.Pointer(bp)) > rmax || *(*Tuint64_t)(unsafe.Pointer(bp)) == rmax && sign == +libc.Int32FromInt32(1) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ERANGE)
- return -int32(1)
- }
- *(*Tint64_t)(unsafe.Pointer(num)) = libc.Int64FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) * libc.Uint64FromInt32(sign))
- return 0
- }
- const m_INT64_MAX2 = 0x7fffffffffffffff
- /*
- * Copyright © 2004-2005, 2009, 2011-2013 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- func Xvwarnc(tls *libc.TLS, code int32, format uintptr, ap Tva_list) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+14, libc.VaList(bp+8, Xgetprogname(tls)))
- if format != 0 {
- libc.Xvfprintf(tls, libc.Xstderr, format, ap)
- libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+19, 0)
- }
- libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+22, libc.VaList(bp+8, libc.Xstrerror(tls, code)))
- }
- func Xwarnc(tls *libc.TLS, code int32, format uintptr, va uintptr) {
- var ap Tva_list
- _ = ap
- ap = va
- Xvwarnc(tls, code, format, ap)
- _ = ap
- }
- func Xverrc(tls *libc.TLS, status int32, code int32, format uintptr, ap Tva_list) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+14, libc.VaList(bp+8, Xgetprogname(tls)))
- if format != 0 {
- libc.Xvfprintf(tls, libc.Xstderr, format, ap)
- libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+19, 0)
- }
- libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+22, libc.VaList(bp+8, libc.Xstrerror(tls, code)))
- libc.Xexit(tls, status)
- }
- func Xerrc(tls *libc.TLS, status int32, code int32, format uintptr, va uintptr) {
- var ap Tva_list
- _ = ap
- ap = va
- Xverrc(tls, status, code, format, ap)
- _ = ap
- }
- const m_PRIX16 = "X"
- const m_PRIX32 = "X"
- const m_PRIX8 = "X"
- const m_PRIXFAST16 = "X"
- const m_PRIXFAST32 = "X"
- const m_PRIXFAST8 = "X"
- const m_PRIXLEAST16 = "X"
- const m_PRIXLEAST32 = "X"
- const m_PRIXLEAST8 = "X"
- const m_PRId16 = "d"
- const m_PRId32 = "d"
- const m_PRId8 = "d"
- const m_PRIdFAST16 = "d"
- const m_PRIdFAST32 = "d"
- const m_PRIdFAST8 = "d"
- const m_PRIdLEAST16 = "d"
- const m_PRIdLEAST32 = "d"
- const m_PRIdLEAST8 = "d"
- const m_PRIi16 = "i"
- const m_PRIi32 = "i"
- const m_PRIi8 = "i"
- const m_PRIiFAST16 = "i"
- const m_PRIiFAST32 = "i"
- const m_PRIiFAST8 = "i"
- const m_PRIiLEAST16 = "i"
- const m_PRIiLEAST32 = "i"
- const m_PRIiLEAST8 = "i"
- const m_PRIo16 = "o"
- const m_PRIo32 = "o"
- const m_PRIo8 = "o"
- const m_PRIoFAST16 = "o"
- const m_PRIoFAST32 = "o"
- const m_PRIoFAST8 = "o"
- const m_PRIoLEAST16 = "o"
- const m_PRIoLEAST32 = "o"
- const m_PRIoLEAST8 = "o"
- const m_PRIu16 = "u"
- const m_PRIu32 = "u"
- const m_PRIu8 = "u"
- const m_PRIuFAST16 = "u"
- const m_PRIuFAST32 = "u"
- const m_PRIuFAST8 = "u"
- const m_PRIuLEAST16 = "u"
- const m_PRIuLEAST32 = "u"
- const m_PRIuLEAST8 = "u"
- const m_PRIx16 = "x"
- const m_PRIx32 = "x"
- const m_PRIx8 = "x"
- const m_PRIxFAST16 = "x"
- const m_PRIxFAST32 = "x"
- const m_PRIxFAST8 = "x"
- const m_PRIxLEAST16 = "x"
- const m_PRIxLEAST32 = "x"
- const m_PRIxLEAST8 = "x"
- const m_SCNd16 = "hd"
- const m_SCNd32 = "d"
- const m_SCNd8 = "hhd"
- const m_SCNdFAST16 = "d"
- const m_SCNdFAST32 = "d"
- const m_SCNdFAST8 = "hhd"
- const m_SCNdLEAST16 = "hd"
- const m_SCNdLEAST32 = "d"
- const m_SCNdLEAST8 = "hhd"
- const m_SCNi16 = "hi"
- const m_SCNi32 = "i"
- const m_SCNi8 = "hhi"
- const m_SCNiFAST16 = "i"
- const m_SCNiFAST32 = "i"
- const m_SCNiFAST8 = "hhi"
- const m_SCNiLEAST16 = "hi"
- const m_SCNiLEAST32 = "i"
- const m_SCNiLEAST8 = "hhi"
- const m_SCNo16 = "ho"
- const m_SCNo32 = "o"
- const m_SCNo8 = "hho"
- const m_SCNoFAST16 = "o"
- const m_SCNoFAST32 = "o"
- const m_SCNoFAST8 = "hho"
- const m_SCNoLEAST16 = "ho"
- const m_SCNoLEAST32 = "o"
- const m_SCNoLEAST8 = "hho"
- const m_SCNu16 = "hu"
- const m_SCNu32 = "u"
- const m_SCNu8 = "hhu"
- const m_SCNuFAST16 = "u"
- const m_SCNuFAST32 = "u"
- const m_SCNuFAST8 = "hhu"
- const m_SCNuLEAST16 = "hu"
- const m_SCNuLEAST32 = "u"
- const m_SCNuLEAST8 = "hhu"
- const m_SCNx16 = "hx"
- const m_SCNx32 = "x"
- const m_SCNx8 = "hhx"
- const m_SCNxFAST16 = "x"
- const m_SCNxFAST32 = "x"
- const m_SCNxFAST8 = "hhx"
- const m_SCNxLEAST16 = "hx"
- const m_SCNxLEAST32 = "x"
- const m_SCNxLEAST8 = "hhx"
- const m___PRI64 = "ll"
- const m___PRIPTR = ""
- type Timaxdiv_t = struct {
- Fquot Tintmax_t
- Frem Tintmax_t
- }
- /* Values for humanize_number(3)'s flags parameter. */
- /* Values for humanize_number(3)'s scale parameter. */
- /*
- * fparseln() specific operation flags.
- */
- // C documentation
- //
- // /*
- // * Convert an expression of the following forms to a uint64_t.
- // * 1) A positive decimal number.
- // * 2) A positive decimal number followed by a 'b' or 'B' (mult by 1).
- // * 3) A positive decimal number followed by a 'k' or 'K' (mult by 1 << 10).
- // * 4) A positive decimal number followed by a 'm' or 'M' (mult by 1 << 20).
- // * 5) A positive decimal number followed by a 'g' or 'G' (mult by 1 << 30).
- // * 6) A positive decimal number followed by a 't' or 'T' (mult by 1 << 40).
- // * 7) A positive decimal number followed by a 'p' or 'P' (mult by 1 << 50).
- // * 8) A positive decimal number followed by a 'e' or 'E' (mult by 1 << 60).
- // */
- func Xexpand_number(tls *libc.TLS, buf uintptr, num uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var number Tuint64_t
- var shift uint32
- var _ /* endptr at bp+0 */ uintptr
- _, _ = number, shift
- number = libc.Xstrtoumax(tls, buf, bp, 0)
- if *(*uintptr)(unsafe.Pointer(bp)) == buf {
- /* No valid digits. */
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return -int32(1)
- }
- switch libc.Xtolower(tls, libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))) {
- case int32('e'):
- shift = uint32(60)
- case int32('p'):
- shift = uint32(50)
- case int32('t'):
- shift = uint32(40)
- case int32('g'):
- shift = uint32(30)
- case int32('m'):
- shift = uint32(20)
- case int32('k'):
- shift = uint32(10)
- case int32('b'):
- fallthrough
- case int32('\000'): /* No unit. */
- *(*Tuint64_t)(unsafe.Pointer(num)) = number
- return 0
- default:
- /* Unrecognized unit. */
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return -int32(1)
- }
- if number<<shift>>shift != number {
- /* Overflow */
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ERANGE)
- return -int32(1)
- }
- *(*Tuint64_t)(unsafe.Pointer(num)) = number << shift
- return 0
- }
- func X__explicit_bzero_hook(tls *libc.TLS, buf uintptr, len1 Tsize_t) {
- }
- func Xexplicit_bzero(tls *libc.TLS, buf uintptr, len1 Tsize_t) {
- libc.Xmemset(tls, buf, 0, len1)
- X__explicit_bzero_hook(tls, buf, len1)
- }
- const m_FILEBUF_POOL_ITEMS = 32
- /*
- * Copyright © 2015 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /*
- * Copyright © 2004-2006, 2009-2011 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /* Clang expands this to 1 if an identifier is *not* reserved. */
- /*
- * Some libc implementations do not have a <sys/cdefs.h>, in particular
- * musl, try to handle this gracefully.
- */
- /* Copyright (C) 1992-2022 Free Software Foundation, Inc.
- Copyright The GNU Toolchain Authors.
- This file is part of the GNU C Library.
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
- type Tfilebuf = struct {
- Ffp uintptr
- Fbuf uintptr
- Flen1 Tsize_t
- }
- var _fb_pool [32]Tfilebuf
- var _fb_pool_cur int32
- func Xfgetln(tls *libc.TLS, stream uintptr, len1 uintptr) (r uintptr) {
- var fb uintptr
- var nread Tssize_t
- _, _ = fb, nread
- libc.Xflockfile(tls, stream)
- /* Try to diminish the possibility of several fgetln() calls being
- * used on different streams, by using a pool of buffers per file. */
- fb = uintptr(unsafe.Pointer(&_fb_pool)) + uintptr(_fb_pool_cur)*12
- if (*Tfilebuf)(unsafe.Pointer(fb)).Ffp != stream && (*Tfilebuf)(unsafe.Pointer(fb)).Ffp != libc.UintptrFromInt32(0) {
- _fb_pool_cur++
- _fb_pool_cur %= int32(m_FILEBUF_POOL_ITEMS)
- fb = uintptr(unsafe.Pointer(&_fb_pool)) + uintptr(_fb_pool_cur)*12
- }
- (*Tfilebuf)(unsafe.Pointer(fb)).Ffp = stream
- nread = libc.Xgetline(tls, fb+4, fb+8, stream)
- libc.Xfunlockfile(tls, stream)
- /* Note: the getdelim/getline API ensures nread != 0. */
- if nread == -int32(1) {
- *(*Tsize_t)(unsafe.Pointer(len1)) = uint32(0)
- return libc.UintptrFromInt32(0)
- } else {
- *(*Tsize_t)(unsafe.Pointer(len1)) = libc.Uint32FromInt32(nread)
- return (*Tfilebuf)(unsafe.Pointer(fb)).Fbuf
- }
- return r
- }
- 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', '.'}
- func Xfreezero(tls *libc.TLS, ptr uintptr, sz Tsize_t) {
- /* This is legal. */
- if ptr == libc.UintptrFromInt32(0) {
- return
- }
- Xexplicit_bzero(tls, ptr, sz)
- libc.Xfree(tls, ptr)
- }
- const m_FILEWBUF_INIT_LEN = 128
- const m_FILEWBUF_POOL_ITEMS = 32
- type Twint_t = uint32
- type Twctype_t = uint32
- type Tmbstate_t = struct {
- F__opaque1 uint32
- F__opaque2 uint32
- }
- type t__mbstate_t = Tmbstate_t
- type Tmax_align_t = struct {
- F__ll int64
- F__ld float64
- }
- type Tptrdiff_t = int32
- /*
- * Copyright © 2015 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /*
- * Copyright © 2004-2006, 2009-2011 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /* Clang expands this to 1 if an identifier is *not* reserved. */
- /*
- * Some libc implementations do not have a <sys/cdefs.h>, in particular
- * musl, try to handle this gracefully.
- */
- /* Copyright (C) 1992-2022 Free Software Foundation, Inc.
- Copyright The GNU Toolchain Authors.
- This file is part of the GNU C Library.
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
- type Tfilewbuf = struct {
- Ffp uintptr
- Fwbuf uintptr
- Flen1 Tsize_t
- }
- var _fb_pool1 [32]Tfilewbuf
- var _fb_pool_cur1 int32
- func Xfgetwln(tls *libc.TLS, stream uintptr, lenp uintptr) (r uintptr) {
- var fb, wp, v3 uintptr
- var wc, v1 Twint_t
- var wused, v2 Tsize_t
- _, _, _, _, _, _, _ = fb, wc, wp, wused, v1, v2, v3
- wused = uint32(0)
- /* Try to diminish the possibility of several fgetwln() calls being
- * used on different streams, by using a pool of buffers per file. */
- fb = uintptr(unsafe.Pointer(&_fb_pool1)) + uintptr(_fb_pool_cur1)*12
- if (*Tfilewbuf)(unsafe.Pointer(fb)).Ffp != stream && (*Tfilewbuf)(unsafe.Pointer(fb)).Ffp != libc.UintptrFromInt32(0) {
- _fb_pool_cur1++
- _fb_pool_cur1 %= int32(m_FILEWBUF_POOL_ITEMS)
- fb = uintptr(unsafe.Pointer(&_fb_pool1)) + uintptr(_fb_pool_cur1)*12
- }
- (*Tfilewbuf)(unsafe.Pointer(fb)).Ffp = stream
- for {
- v1 = libc.Xfgetwc(tls, stream)
- wc = v1
- if !(v1 != uint32(0xffffffff)) {
- break
- }
- if !((*Tfilewbuf)(unsafe.Pointer(fb)).Flen1 != 0) || wused >= (*Tfilewbuf)(unsafe.Pointer(fb)).Flen1 {
- if (*Tfilewbuf)(unsafe.Pointer(fb)).Flen1 != 0 {
- *(*Tsize_t)(unsafe.Pointer(fb + 8)) *= uint32(2)
- } else {
- (*Tfilewbuf)(unsafe.Pointer(fb)).Flen1 = uint32(m_FILEWBUF_INIT_LEN)
- }
- wp = Xreallocarray(tls, (*Tfilewbuf)(unsafe.Pointer(fb)).Fwbuf, (*Tfilewbuf)(unsafe.Pointer(fb)).Flen1, uint32(4))
- if wp == libc.UintptrFromInt32(0) {
- wused = uint32(0)
- break
- }
- (*Tfilewbuf)(unsafe.Pointer(fb)).Fwbuf = wp
- }
- v2 = wused
- wused++
- *(*Twchar_t)(unsafe.Pointer((*Tfilewbuf)(unsafe.Pointer(fb)).Fwbuf + uintptr(v2)*4)) = libc.Int32FromUint32(wc)
- if wc == uint32('\n') {
- break
- }
- }
- *(*Tsize_t)(unsafe.Pointer(lenp)) = wused
- if wused != 0 {
- v3 = (*Tfilewbuf)(unsafe.Pointer(fb)).Fwbuf
- } else {
- v3 = libc.UintptrFromInt32(0)
- }
- return v3
- }
- // C documentation
- //
- // /* XXX: Ideally we'd recommend getwline(3), but unfortunately even though it
- // * was part of the ISO/IEC TR 24731-2:2010 draft, it did not make it into C11
- // * and is not widely implemented. */
- 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', '.'}
- const m_LOCK_EX = 2
- const m_LOCK_NB = 4
- const m_LOCK_SH = 1
- const m_LOCK_UN = 8
- const m_O_CREAT1 = 64
- const m_O_NONBLOCK1 = 2048
- const m_O_TRUNC1 = 512
- /* Values for humanize_number(3)'s flags parameter. */
- /* Values for humanize_number(3)'s scale parameter. */
- /*
- * fparseln() specific operation flags.
- */
- // C documentation
- //
- // /*
- // * Reliably open and lock a file.
- // *
- // * Please do not modify this code without first reading the revision history
- // * and discussing your changes with <des@freebsd.org>. Don't be fooled by the
- // * code's apparent simplicity; there would be no need for this function if it
- // * was easy to get right.
- // */
- func _vflopenat(tls *libc.TLS, dirfd int32, path uintptr, flags int32, ap Tva_list) (r int32) {
- bp := tls.Alloc(304)
- defer tls.Free(304)
- var fd, operation, serrno, trunc, v2 int32
- var mode Tmode_t
- var _ /* fsb at bp+144 */ Tstat
- var _ /* sb at bp+0 */ Tstat
- _, _, _, _, _, _ = fd, mode, operation, serrno, trunc, v2
- mode = uint32(0)
- if flags&int32(m_O_CREAT1) != 0 {
- mode = libc.Uint32FromInt32(libc.VaInt32(&ap)) /* mode_t promoted to int */
- }
- operation = int32(m_LOCK_EX)
- if flags&int32(m_O_NONBLOCK1) != 0 {
- operation |= int32(m_LOCK_NB)
- }
- trunc = flags & int32(m_O_TRUNC1)
- flags &= ^libc.Int32FromInt32(m_O_TRUNC1)
- for {
- v2 = libc.Xopenat(tls, dirfd, path, flags, libc.VaList(bp+296, mode))
- fd = v2
- if v2 == -int32(1) {
- /* non-existent or no access */
- return -int32(1)
- }
- if libc.Xflock(tls, fd, operation) == -int32(1) {
- /* unsupported or interrupted */
- serrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- libc.Xclose(tls, fd)
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = serrno
- return -int32(1)
- }
- if libc.Xfstatat(tls, dirfd, path, bp, 0) == -int32(1) {
- /* disappeared from under our feet */
- libc.Xclose(tls, fd)
- goto _1
- }
- if libc.Xfstat(tls, fd, bp+144) == -int32(1) {
- /* can't happen [tm] */
- serrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- libc.Xclose(tls, fd)
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = serrno
- return -int32(1)
- }
- 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 {
- /* changed under our feet */
- libc.Xclose(tls, fd)
- goto _1
- }
- if trunc != 0 && libc.Xftruncate(tls, fd, 0) != 0 {
- /* can't happen [tm] */
- serrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- libc.Xclose(tls, fd)
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = serrno
- return -int32(1)
- }
- /*
- * The following change is provided as a specific example to
- * avoid.
- */
- return fd
- goto _1
- _1:
- }
- return r
- }
- func Xflopen(tls *libc.TLS, path uintptr, flags int32, va uintptr) (r int32) {
- var ap Tva_list
- var ret int32
- _, _ = ap, ret
- ap = va
- ret = _vflopenat(tls, -int32(100), path, flags, ap)
- _ = ap
- return ret
- }
- func Xflopenat(tls *libc.TLS, dirfd int32, path uintptr, flags int32, va uintptr) (r int32) {
- var ap Tva_list
- var ret int32
- _, _ = ap, ret
- ap = va
- ret = _vflopenat(tls, dirfd, path, flags, ap)
- _ = ap
- return ret
- }
- type ___e_fmtcheck_types = int32
- const _FMTCHECK_START = 0
- const _FMTCHECK_SHORT = 1
- const _FMTCHECK_INT = 2
- const _FMTCHECK_WINTT = 3
- const _FMTCHECK_LONG = 4
- const _FMTCHECK_QUAD = 5
- const _FMTCHECK_INTMAXT = 6
- const _FMTCHECK_PTRDIFFT = 7
- const _FMTCHECK_SIZET = 8
- const _FMTCHECK_POINTER = 9
- const _FMTCHECK_CHARPOINTER = 10
- const _FMTCHECK_SHORTPOINTER = 11
- const _FMTCHECK_INTPOINTER = 12
- const _FMTCHECK_LONGPOINTER = 13
- const _FMTCHECK_QUADPOINTER = 14
- const _FMTCHECK_INTMAXTPOINTER = 15
- const _FMTCHECK_PTRDIFFTPOINTER = 16
- const _FMTCHECK_SIZETPOINTER = 17
- const _FMTCHECK_DOUBLE = 18
- const _FMTCHECK_LONGDOUBLE = 19
- const _FMTCHECK_STRING = 20
- const _FMTCHECK_WSTRING = 21
- const _FMTCHECK_WIDTH = 22
- const _FMTCHECK_PRECISION = 23
- const _FMTCHECK_DONE = 24
- const _FMTCHECK_UNKNOWN = 25
- type TEFT = int32
- type _e_modifier = int32
- const _MOD_NONE = 0
- const _MOD_CHAR = 1
- const _MOD_SHORT = 2
- const _MOD_LONG = 3
- const _MOD_QUAD = 4
- const _MOD_INTMAXT = 5
- const _MOD_LONGDOUBLE = 6
- const _MOD_PTRDIFFT = 7
- const _MOD_SIZET = 8
- func _get_next_format_from_precision(tls *libc.TLS, pf uintptr) (r TEFT) {
- var f uintptr
- var modifier _e_modifier
- _, _ = f, modifier
- f = *(*uintptr)(unsafe.Pointer(pf))
- switch int32(*(*int8)(unsafe.Pointer(f))) {
- case int32('h'):
- f++
- if !(*(*int8)(unsafe.Pointer(f)) != 0) {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- }
- if int32(*(*int8)(unsafe.Pointer(f))) == int32('h') {
- f++
- modifier = int32(_MOD_CHAR)
- } else {
- modifier = int32(_MOD_SHORT)
- }
- case int32('j'):
- f++
- modifier = int32(_MOD_INTMAXT)
- case int32('l'):
- f++
- if !(*(*int8)(unsafe.Pointer(f)) != 0) {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- }
- if int32(*(*int8)(unsafe.Pointer(f))) == int32('l') {
- f++
- modifier = int32(_MOD_QUAD)
- } else {
- modifier = int32(_MOD_LONG)
- }
- case int32('q'):
- f++
- modifier = int32(_MOD_QUAD)
- case int32('t'):
- f++
- modifier = int32(_MOD_PTRDIFFT)
- case int32('z'):
- f++
- modifier = int32(_MOD_SIZET)
- case int32('L'):
- f++
- modifier = int32(_MOD_LONGDOUBLE)
- default:
- modifier = int32(_MOD_NONE)
- break
- }
- if !(*(*int8)(unsafe.Pointer(f)) != 0) {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- }
- if libc.Xstrchr(tls, __ccgo_ts+26, int32(*(*int8)(unsafe.Pointer(f)))) != 0 {
- switch modifier {
- case int32(_MOD_LONG):
- goto _1
- case int32(_MOD_QUAD):
- goto _2
- case int32(_MOD_INTMAXT):
- goto _3
- case int32(_MOD_PTRDIFFT):
- goto _4
- case int32(_MOD_SIZET):
- goto _5
- case int32(_MOD_NONE):
- goto _6
- case int32(_MOD_SHORT):
- goto _7
- case int32(_MOD_CHAR):
- goto _8
- default:
- goto _9
- }
- goto _10
- _1:
- ;
- _13:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_LONG)
- goto _12
- _12:
- ;
- if 0 != 0 {
- goto _13
- }
- goto _11
- _11:
- ;
- _2:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_QUAD)
- _3:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_INTMAXT)
- _4:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_PTRDIFFT)
- _5:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_SIZET)
- _8:
- ;
- _7:
- ;
- _6:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_INT)
- _9:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- _10:
- }
- if int32(*(*int8)(unsafe.Pointer(f))) == int32('n') {
- switch modifier {
- case int32(_MOD_CHAR):
- goto _14
- case int32(_MOD_SHORT):
- goto _15
- case int32(_MOD_LONG):
- goto _16
- case int32(_MOD_QUAD):
- goto _17
- case int32(_MOD_INTMAXT):
- goto _18
- case int32(_MOD_PTRDIFFT):
- goto _19
- case int32(_MOD_SIZET):
- goto _20
- case int32(_MOD_NONE):
- goto _21
- default:
- goto _22
- }
- goto _23
- _14:
- ;
- _26:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_CHARPOINTER)
- goto _25
- _25:
- ;
- if 0 != 0 {
- goto _26
- }
- goto _24
- _24:
- ;
- _15:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_SHORTPOINTER)
- _16:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_LONGPOINTER)
- _17:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_QUADPOINTER)
- _18:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_INTMAXTPOINTER)
- _19:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_PTRDIFFTPOINTER)
- _20:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_SIZETPOINTER)
- _21:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_INTPOINTER)
- _22:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- _23:
- }
- if libc.Xstrchr(tls, __ccgo_ts+33, int32(*(*int8)(unsafe.Pointer(f)))) != 0 {
- if modifier != int32(_MOD_NONE) {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- }
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_LONG)
- }
- if libc.Xstrchr(tls, __ccgo_ts+37, int32(*(*int8)(unsafe.Pointer(f)))) != 0 {
- switch modifier {
- case int32(_MOD_LONGDOUBLE):
- goto _27
- case int32(_MOD_NONE):
- goto _28
- case int32(_MOD_LONG):
- goto _29
- default:
- goto _30
- }
- goto _31
- _27:
- ;
- _34:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_LONGDOUBLE)
- goto _33
- _33:
- ;
- if 0 != 0 {
- goto _34
- }
- goto _32
- _32:
- ;
- _29:
- ;
- _28:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_DOUBLE)
- _30:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- _31:
- }
- if int32(*(*int8)(unsafe.Pointer(f))) == int32('c') {
- switch modifier {
- case int32(_MOD_LONG):
- goto _35
- case int32(_MOD_NONE):
- goto _36
- default:
- goto _37
- }
- goto _38
- _35:
- ;
- _41:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_WINTT)
- goto _40
- _40:
- ;
- if 0 != 0 {
- goto _41
- }
- goto _39
- _39:
- ;
- _36:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_INT)
- _37:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- _38:
- }
- if int32(*(*int8)(unsafe.Pointer(f))) == int32('C') {
- if modifier != int32(_MOD_NONE) {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- }
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_WINTT)
- }
- if int32(*(*int8)(unsafe.Pointer(f))) == int32('s') {
- switch modifier {
- case int32(_MOD_LONG):
- goto _42
- case int32(_MOD_NONE):
- goto _43
- default:
- goto _44
- }
- goto _45
- _42:
- ;
- _48:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_WSTRING)
- goto _47
- _47:
- ;
- if 0 != 0 {
- goto _48
- }
- goto _46
- _46:
- ;
- _43:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_STRING)
- _44:
- ;
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- _45:
- }
- if int32(*(*int8)(unsafe.Pointer(f))) == int32('S') {
- if modifier != int32(_MOD_NONE) {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- }
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_WSTRING)
- }
- if int32(*(*int8)(unsafe.Pointer(f))) == int32('p') {
- if modifier != int32(_MOD_NONE) {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- }
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_POINTER)
- }
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- /*NOTREACHED*/
- return r
- }
- func _get_next_format_from_width(tls *libc.TLS, pf uintptr) (r TEFT) {
- var f uintptr
- _ = f
- f = *(*uintptr)(unsafe.Pointer(pf))
- if int32(*(*int8)(unsafe.Pointer(f))) == int32('.') {
- f++
- if int32(*(*int8)(unsafe.Pointer(f))) == int32('*') {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_PRECISION)
- }
- /* eat any precision (empty is allowed) */
- for libc.BoolInt32(uint32(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(f))))-uint32('0') < uint32(10)) != 0 {
- f++
- }
- if !(*(*int8)(unsafe.Pointer(f)) != 0) {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- }
- }
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return _get_next_format_from_precision(tls, pf)
- /*NOTREACHED*/
- return r
- }
- func _get_next_format(tls *libc.TLS, pf uintptr, eft TEFT) (r TEFT) {
- var f uintptr
- var infmt int32
- _, _ = f, infmt
- if eft == int32(_FMTCHECK_WIDTH) {
- *(*uintptr)(unsafe.Pointer(pf))++
- return _get_next_format_from_width(tls, pf)
- } else {
- if eft == int32(_FMTCHECK_PRECISION) {
- *(*uintptr)(unsafe.Pointer(pf))++
- return _get_next_format_from_precision(tls, pf)
- }
- }
- f = *(*uintptr)(unsafe.Pointer(pf))
- infmt = 0
- for !(infmt != 0) {
- f = libc.Xstrchr(tls, f, int32('%'))
- if f == libc.UintptrFromInt32(0) {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_DONE)
- }
- f++
- if !(*(*int8)(unsafe.Pointer(f)) != 0) {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- }
- if int32(*(*int8)(unsafe.Pointer(f))) != int32('%') {
- infmt = int32(1)
- } else {
- f++
- }
- }
- /* Eat any of the flags */
- for *(*int8)(unsafe.Pointer(f)) != 0 && libc.Xstrchr(tls, __ccgo_ts+46, int32(*(*int8)(unsafe.Pointer(f)))) != 0 {
- f++
- }
- if int32(*(*int8)(unsafe.Pointer(f))) == int32('*') {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_WIDTH)
- }
- /* eat any width */
- for libc.BoolInt32(uint32(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(f))))-uint32('0') < uint32(10)) != 0 {
- f++
- }
- if !(*(*int8)(unsafe.Pointer(f)) != 0) {
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return int32(_FMTCHECK_UNKNOWN)
- }
- *(*uintptr)(unsafe.Pointer(pf)) = f
- return _get_next_format_from_width(tls, pf)
- /*NOTREACHED*/
- return r
- }
- func Xfmtcheck(tls *libc.TLS, f1 uintptr, f2 uintptr) (r uintptr) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var f1t, f2t, v1 TEFT
- var _ /* f1p at bp+0 */ uintptr
- var _ /* f2p at bp+4 */ uintptr
- _, _, _ = f1t, f2t, v1
- if !(f1 != 0) {
- return f2
- }
- *(*uintptr)(unsafe.Pointer(bp)) = f1
- f1t = int32(_FMTCHECK_START)
- *(*uintptr)(unsafe.Pointer(bp + 4)) = f2
- f2t = int32(_FMTCHECK_START)
- for {
- v1 = _get_next_format(tls, bp, f1t)
- f1t = v1
- if !(v1 != int32(_FMTCHECK_DONE)) {
- break
- }
- if f1t == int32(_FMTCHECK_UNKNOWN) {
- return f2
- }
- f2t = _get_next_format(tls, bp+4, f2t)
- if f1t != f2t {
- return f2
- }
- }
- return f1
- }
- const m_FPARSELN_UNESCALL1 = 15
- const m_FPARSELN_UNESCCOMM1 = 4
- const m_FPARSELN_UNESCCONT1 = 2
- const m_FPARSELN_UNESCESC1 = 1
- const m_FPARSELN_UNESCREST1 = 8
- const m_static_assert = "_Static_assert"
- // C documentation
- //
- // /* isescaped():
- // * Return true if the character in *p that belongs to a string
- // * that starts in *sp, is escaped by the escape character esc.
- // */
- func _isescaped(tls *libc.TLS, sp uintptr, p uintptr, esc int32) (r int32) {
- var cp, v2 uintptr
- var ne Tsize_t
- _, _, _ = cp, ne, v2
- /* No escape character */
- if esc == int32('\000') {
- return 0
- }
- /* Count the number of escape characters that precede ours */
- ne = uint32(0)
- cp = p
- for {
- cp--
- v2 = cp
- if !(v2 >= sp && int32(*(*int8)(unsafe.Pointer(cp))) == esc) {
- break
- }
- goto _1
- goto _1
- _1:
- ;
- ne++
- }
- /* Return true if odd number of escape characters */
- return libc.BoolInt32(ne&uint32(1) != uint32(0))
- }
- // C documentation
- //
- // /* fparseln():
- // * Read a line from a file parsing continuations ending in * and eliminating trailing newlines, or comments starting with
- // * the comment char.
- // */
- func Xfparseln(tls *libc.TLS, fp uintptr, size uintptr, lineno uintptr, str uintptr, flags int32) (r uintptr) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var buf, cp, v2, v3, v4, v5, v6, v7, v8, v9 uintptr
- var cnt, skipesc int32
- var com, con, esc, nl int8
- var len1 Tsize_t
- var s Tssize_t
- var _ /* ptr at bp+4 */ uintptr
- var _ /* ptrlen at bp+0 */ Tsize_t
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = buf, cnt, com, con, cp, esc, len1, nl, s, skipesc, v2, v3, v4, v5, v6, v7, v8, v9
- len1 = uint32(0)
- buf = libc.UintptrFromInt32(0)
- *(*Tsize_t)(unsafe.Pointer(bp)) = uint32(0)
- *(*uintptr)(unsafe.Pointer(bp + 4)) = libc.UintptrFromInt32(0)
- cnt = int32(1)
- if str == libc.UintptrFromInt32(0) {
- str = uintptr(unsafe.Pointer(&_dstr))
- }
- esc = *(*int8)(unsafe.Pointer(str))
- con = *(*int8)(unsafe.Pointer(str + 1))
- com = *(*int8)(unsafe.Pointer(str + 2))
- /*
- * XXX: it would be cool to be able to specify the newline character,
- * getdelim(3) does let us, but supporting it would diverge from BSDs.
- */
- nl = int8('\n')
- libc.Xflockfile(tls, fp)
- for cnt != 0 {
- cnt = 0
- if lineno != 0 {
- *(*Tsize_t)(unsafe.Pointer(lineno))++
- }
- s = libc.Xgetline(tls, bp+4, bp, fp)
- if s < 0 {
- break
- }
- if s != 0 && com != 0 { /* Check and eliminate comments */
- cp = *(*uintptr)(unsafe.Pointer(bp + 4))
- for {
- if !(cp < *(*uintptr)(unsafe.Pointer(bp + 4))+uintptr(s)) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(cp))) == int32(com) && !(_isescaped(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), cp, int32(esc)) != 0) {
- s = int32(cp) - int32(*(*uintptr)(unsafe.Pointer(bp + 4)))
- cnt = libc.BoolInt32(s == 0 && buf == libc.UintptrFromInt32(0))
- break
- }
- goto _1
- _1:
- ;
- cp++
- }
- }
- if s != 0 && nl != 0 { /* Check and eliminate newlines */
- cp = *(*uintptr)(unsafe.Pointer(bp + 4)) + uintptr(s-int32(1))
- if int32(*(*int8)(unsafe.Pointer(cp))) == int32(nl) {
- s--
- } /* forget newline */
- }
- if s != 0 && con != 0 { /* Check and eliminate continuations */
- cp = *(*uintptr)(unsafe.Pointer(bp + 4)) + uintptr(s-int32(1))
- if int32(*(*int8)(unsafe.Pointer(cp))) == int32(con) && !(_isescaped(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), cp, int32(esc)) != 0) {
- s-- /* forget continuation char */
- cnt = int32(1)
- }
- }
- if s == 0 {
- /*
- * nothing to add, skip realloc except in case
- * we need a minimal buf to return an empty line
- */
- if cnt != 0 || buf != libc.UintptrFromInt32(0) {
- continue
- }
- }
- v2 = libc.Xrealloc(tls, buf, len1+libc.Uint32FromInt32(s)+uint32(1))
- cp = v2
- if v2 == libc.UintptrFromInt32(0) {
- libc.Xfunlockfile(tls, fp)
- libc.Xfree(tls, buf)
- libc.Xfree(tls, *(*uintptr)(unsafe.Pointer(bp + 4)))
- return libc.UintptrFromInt32(0)
- }
- buf = cp
- libc.Xmemcpy(tls, buf+uintptr(len1), *(*uintptr)(unsafe.Pointer(bp + 4)), libc.Uint32FromInt32(s))
- len1 += libc.Uint32FromInt32(s)
- *(*int8)(unsafe.Pointer(buf + uintptr(len1))) = int8('\000')
- }
- libc.Xfunlockfile(tls, fp)
- libc.Xfree(tls, *(*uintptr)(unsafe.Pointer(bp + 4)))
- if flags&int32(m_FPARSELN_UNESCALL1) != 0 && esc != 0 && buf != libc.UintptrFromInt32(0) && libc.Xstrchr(tls, buf, int32(esc)) != libc.UintptrFromInt32(0) {
- v3 = buf
- cp = v3
- *(*uintptr)(unsafe.Pointer(bp + 4)) = v3
- for int32(*(*int8)(unsafe.Pointer(cp))) != int32('\000') {
- for int32(*(*int8)(unsafe.Pointer(cp))) != int32('\000') && int32(*(*int8)(unsafe.Pointer(cp))) != int32(esc) {
- v4 = *(*uintptr)(unsafe.Pointer(bp + 4))
- *(*uintptr)(unsafe.Pointer(bp + 4))++
- v5 = cp
- cp++
- *(*int8)(unsafe.Pointer(v4)) = *(*int8)(unsafe.Pointer(v5))
- }
- if int32(*(*int8)(unsafe.Pointer(cp))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(cp + 1))) == int32('\000') {
- break
- }
- skipesc = 0
- if int32(*(*int8)(unsafe.Pointer(cp + 1))) == int32(com) {
- skipesc += flags & int32(m_FPARSELN_UNESCCOMM1)
- }
- if int32(*(*int8)(unsafe.Pointer(cp + 1))) == int32(con) {
- skipesc += flags & int32(m_FPARSELN_UNESCCONT1)
- }
- if int32(*(*int8)(unsafe.Pointer(cp + 1))) == int32(esc) {
- skipesc += flags & int32(m_FPARSELN_UNESCESC1)
- }
- 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) {
- skipesc = flags & int32(m_FPARSELN_UNESCREST1)
- }
- if skipesc != 0 {
- cp++
- } else {
- v6 = *(*uintptr)(unsafe.Pointer(bp + 4))
- *(*uintptr)(unsafe.Pointer(bp + 4))++
- v7 = cp
- cp++
- *(*int8)(unsafe.Pointer(v6)) = *(*int8)(unsafe.Pointer(v7))
- }
- v8 = *(*uintptr)(unsafe.Pointer(bp + 4))
- *(*uintptr)(unsafe.Pointer(bp + 4))++
- v9 = cp
- cp++
- *(*int8)(unsafe.Pointer(v8)) = *(*int8)(unsafe.Pointer(v9))
- }
- *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))) = int8('\000')
- len1 = libc.Xstrlen(tls, buf)
- }
- if size != 0 {
- *(*Tsize_t)(unsafe.Pointer(size)) = len1
- }
- return buf
- }
- var _dstr = [3]int8{
- 0: int8('\\'),
- 1: int8('\\'),
- 2: int8('#'),
- }
- const m_FSETLOCKING_BYCALLER = 2
- const m_FSETLOCKING_INTERNAL = 1
- const m_FSETLOCKING_QUERY = 0
- func Xfpurge(tls *libc.TLS, fp uintptr) (r int32) {
- if fp == libc.UintptrFromInt32(0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EBADF)
- return -int32(1)
- }
- libc.X__fpurge(tls, fp)
- return 0
- }
- const m_FPARSELN_UNESCALL2 = 0x0f
- const m_FPARSELN_UNESCCOMM2 = 0x04
- const m_FPARSELN_UNESCCONT2 = 0x02
- const m_FPARSELN_UNESCESC2 = 0x01
- const m_FPARSELN_UNESCREST2 = 0x08
- const m_KB = 1024
- const m_MAXB = "GB"
- func Xgetbsize(tls *libc.TLS, headerlenp uintptr, blocksizep uintptr) (r uintptr) {
- bp := tls.Alloc(32)
- defer tls.Free(32)
- var blocksize, max, mul, n, v15, v16, v17, v4 int32
- var form, p, v3 uintptr
- var _ /* ep at bp+0 */ uintptr
- _, _, _, _, _, _, _, _, _, _, _ = blocksize, form, max, mul, n, p, v15, v16, v17, v3, v4
- form = __ccgo_ts + 53
- v3 = libc.Xgetenv(tls, __ccgo_ts+54)
- p = v3
- if !(v3 != libc.UintptrFromInt32(0) && int32(*(*int8)(unsafe.Pointer(p))) != int32('\000')) {
- goto _1
- }
- v4 = libc.Xstrtol(tls, p, bp, int32(10))
- n = v4
- if v4 < 0 {
- goto underflow
- }
- if n == 0 {
- n = int32(1)
- }
- if *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) != 0 && *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)) != 0 {
- goto fmterr
- }
- switch int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) {
- case int32('g'):
- goto _5
- case int32('G'):
- goto _6
- case int32('k'):
- goto _7
- case int32('K'):
- goto _8
- case int32('m'):
- goto _9
- case int32('M'):
- goto _10
- case int32('\000'):
- goto _11
- default:
- goto _12
- }
- goto _13
- _6:
- ;
- _5:
- ;
- form = __ccgo_ts + 64
- max = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) / (libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024))
- mul = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024)
- goto _13
- _8:
- ;
- _7:
- ;
- form = __ccgo_ts + 66
- max = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) / libc.Int32FromInt32(1024)
- mul = int32(1024)
- goto _13
- _10:
- ;
- _9:
- ;
- form = __ccgo_ts + 68
- max = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) / (libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024))
- mul = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024)
- goto _13
- _11:
- ;
- max = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024)
- mul = int32(1)
- goto _13
- _12:
- ;
- goto fmterr
- fmterr:
- ;
- libc.Xwarnx(tls, __ccgo_ts+70, libc.VaList(bp+16, p))
- n = int32(512)
- max = libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024) * libc.Int32FromInt32(1024)
- mul = int32(1)
- goto _13
- _13:
- ;
- if n > max {
- 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))))
- n = max
- }
- v15 = n * mul
- blocksize = v15
- if !(v15 < int32(512)) {
- goto _14
- }
- goto underflow
- underflow:
- ;
- libc.Xwarnx(tls, __ccgo_ts+118, 0)
- form = __ccgo_ts + 53
- v16 = libc.Int32FromInt32(512)
- n = v16
- blocksize = v16
- _14:
- ;
- goto _2
- _1:
- ;
- v17 = libc.Int32FromInt32(512)
- n = v17
- blocksize = v17
- _2:
- ;
- libc.X__builtin_snprintf(tls, uintptr(unsafe.Pointer(&_header)), uint32(20), __ccgo_ts+143, libc.VaList(bp+16, n, form))
- *(*int32)(unsafe.Pointer(headerlenp)) = libc.Int32FromUint32(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&_header))))
- *(*int32)(unsafe.Pointer(blocksizep)) = blocksize
- return uintptr(unsafe.Pointer(&_header))
- }
- var _header [20]int8
- const m_AF_ALG = "PF_ALG"
- const m_AF_APPLETALK = "PF_APPLETALK"
- const m_AF_ASH = "PF_ASH"
- const m_AF_ATMPVC = "PF_ATMPVC"
- const m_AF_ATMSVC = "PF_ATMSVC"
- const m_AF_AX25 = "PF_AX25"
- const m_AF_BLUETOOTH = "PF_BLUETOOTH"
- const m_AF_BRIDGE = "PF_BRIDGE"
- const m_AF_CAIF = "PF_CAIF"
- const m_AF_CAN = "PF_CAN"
- const m_AF_DECnet = "PF_DECnet"
- const m_AF_ECONET = "PF_ECONET"
- const m_AF_FILE = "AF_LOCAL"
- const m_AF_IB = "PF_IB"
- const m_AF_IEEE802154 = "PF_IEEE802154"
- const m_AF_INET = "PF_INET"
- const m_AF_INET6 = "PF_INET6"
- const m_AF_IPX = "PF_IPX"
- const m_AF_IRDA = "PF_IRDA"
- const m_AF_ISDN = "PF_ISDN"
- const m_AF_IUCV = "PF_IUCV"
- const m_AF_KCM = "PF_KCM"
- const m_AF_KEY = "PF_KEY"
- const m_AF_LLC = "PF_LLC"
- const m_AF_LOCAL = "PF_LOCAL"
- const m_AF_MAX = "PF_MAX"
- const m_AF_MPLS = "PF_MPLS"
- const m_AF_NETBEUI = "PF_NETBEUI"
- const m_AF_NETLINK = "PF_NETLINK"
- const m_AF_NETROM = "PF_NETROM"
- const m_AF_NFC = "PF_NFC"
- const m_AF_PACKET = "PF_PACKET"
- const m_AF_PHONET = "PF_PHONET"
- const m_AF_PPPOX = "PF_PPPOX"
- const m_AF_QIPCRTR = "PF_QIPCRTR"
- const m_AF_RDS = "PF_RDS"
- const m_AF_ROSE = "PF_ROSE"
- const m_AF_ROUTE = "PF_ROUTE"
- const m_AF_RXRPC = "PF_RXRPC"
- const m_AF_SECURITY = "PF_SECURITY"
- const m_AF_SMC = "PF_SMC"
- const m_AF_SNA = "PF_SNA"
- const m_AF_TIPC = "PF_TIPC"
- const m_AF_UNIX = "AF_LOCAL"
- const m_AF_UNSPEC = "PF_UNSPEC"
- const m_AF_VSOCK = "PF_VSOCK"
- const m_AF_WANPIPE = "PF_WANPIPE"
- const m_AF_X25 = "PF_X25"
- const m_AF_XDP = "PF_XDP"
- const m_INT_MAX2 = 0x7fffffff
- const m_MSG_BATCH = 0x40000
- const m_MSG_CMSG_CLOEXEC = 0x40000000
- const m_MSG_CONFIRM = 0x0800
- const m_MSG_CTRUNC = 0x0008
- const m_MSG_DONTROUTE = 0x0004
- const m_MSG_DONTWAIT = 0x0040
- const m_MSG_EOR = 0x0080
- const m_MSG_ERRQUEUE = 0x2000
- const m_MSG_FASTOPEN = 0x20000000
- const m_MSG_FIN = 0x0200
- const m_MSG_MORE = 0x8000
- const m_MSG_NOSIGNAL = 0x4000
- const m_MSG_OOB = 0x0001
- const m_MSG_PEEK = 0x0002
- const m_MSG_PROXY = 0x0010
- const m_MSG_RST = 0x1000
- const m_MSG_SYN = 0x0400
- const m_MSG_TRUNC = 0x0020
- const m_MSG_WAITALL = 0x0100
- const m_MSG_WAITFORONE = 0x10000
- const m_MSG_ZEROCOPY = 0x4000000
- const m_PF_ALG = 38
- const m_PF_APPLETALK = 5
- const m_PF_ASH = 18
- const m_PF_ATMPVC = 8
- const m_PF_ATMSVC = 20
- const m_PF_AX25 = 3
- const m_PF_BLUETOOTH = 31
- const m_PF_BRIDGE = 7
- const m_PF_CAIF = 37
- const m_PF_CAN = 29
- const m_PF_DECnet = 12
- const m_PF_ECONET = 19
- const m_PF_FILE = "PF_LOCAL"
- const m_PF_IB = 27
- const m_PF_IEEE802154 = 36
- const m_PF_INET = 2
- const m_PF_INET6 = 10
- const m_PF_IPX = 4
- const m_PF_IRDA = 23
- const m_PF_ISDN = 34
- const m_PF_IUCV = 32
- const m_PF_KCM = 41
- const m_PF_KEY = 15
- const m_PF_LLC = 26
- const m_PF_LOCAL = 1
- const m_PF_MAX = 45
- const m_PF_MPLS = 28
- const m_PF_NETBEUI = 13
- const m_PF_NETLINK = 16
- const m_PF_NETROM = 6
- const m_PF_NFC = 39
- const m_PF_PACKET = 17
- const m_PF_PHONET = 35
- const m_PF_PPPOX = 24
- const m_PF_QIPCRTR = 42
- const m_PF_RDS = 21
- const m_PF_ROSE = 11
- const m_PF_ROUTE = "PF_NETLINK"
- const m_PF_RXRPC = 33
- const m_PF_SECURITY = 14
- const m_PF_SMC = 43
- const m_PF_SNA = 22
- const m_PF_TIPC = 30
- const m_PF_UNIX = "PF_LOCAL"
- const m_PF_UNSPEC = 0
- const m_PF_VSOCK = 40
- const m_PF_WANPIPE = 25
- const m_PF_X25 = 9
- const m_PF_XDP = 44
- const m_SCM_CREDENTIALS = 0x02
- const m_SCM_RIGHTS = 0x01
- const m_SCM_TIMESTAMP = "SO_TIMESTAMP"
- const m_SCM_TIMESTAMPING = "SO_TIMESTAMPING"
- const m_SCM_TIMESTAMPING_OPT_STATS = 54
- const m_SCM_TIMESTAMPING_PKTINFO = 58
- const m_SCM_TIMESTAMPNS = "SO_TIMESTAMPNS"
- const m_SCM_TXTIME = "SO_TXTIME"
- const m_SCM_WIFI_STATUS = "SO_WIFI_STATUS"
- const m_SHUT_RD = 0
- const m_SHUT_RDWR = 2
- const m_SHUT_WR = 1
- const m_SOCK_CLOEXEC = 02000000
- const m_SOCK_DCCP = 6
- const m_SOCK_DGRAM = 2
- const m_SOCK_NONBLOCK = 04000
- const m_SOCK_PACKET = 10
- const m_SOCK_RAW = 3
- const m_SOCK_RDM = 4
- const m_SOCK_SEQPACKET = 5
- const m_SOCK_STREAM = 1
- const m_SOL_AAL = 265
- const m_SOL_ALG = 279
- const m_SOL_ATM = 264
- const m_SOL_BLUETOOTH = 274
- const m_SOL_CAIF = 278
- const m_SOL_DCCP = 269
- const m_SOL_DECNET = 261
- const m_SOL_ICMPV6 = 58
- const m_SOL_IP = 0
- const m_SOL_IPV6 = 41
- const m_SOL_IRDA = 266
- const m_SOL_IUCV = 277
- const m_SOL_KCM = 281
- const m_SOL_LLC = 268
- const m_SOL_NETBEUI = 267
- const m_SOL_NETLINK = 270
- const m_SOL_NFC = 280
- const m_SOL_PACKET = 263
- const m_SOL_PNPIPE = 275
- const m_SOL_PPPOL2TP = 273
- const m_SOL_RAW = 255
- const m_SOL_RDS = 276
- const m_SOL_RXRPC = 272
- const m_SOL_SOCKET = 1
- const m_SOL_TIPC = 271
- const m_SOL_TLS = 282
- const m_SOL_X25 = 262
- const m_SOL_XDP = 283
- const m_SOMAXCONN = 128
- const m_SO_ACCEPTCONN = 30
- const m_SO_ATTACH_BPF = 50
- const m_SO_ATTACH_FILTER = 26
- const m_SO_ATTACH_REUSEPORT_CBPF = 51
- const m_SO_ATTACH_REUSEPORT_EBPF = 52
- const m_SO_BINDTODEVICE = 25
- const m_SO_BINDTOIFINDEX = 62
- const m_SO_BPF_EXTENSIONS = 48
- const m_SO_BROADCAST = 6
- const m_SO_BSDCOMPAT = 14
- const m_SO_BUSY_POLL = 46
- const m_SO_BUSY_POLL_BUDGET = 70
- const m_SO_CNX_ADVICE = 53
- const m_SO_COOKIE = 57
- const m_SO_DEBUG = 1
- const m_SO_DETACH_BPF = "SO_DETACH_FILTER"
- const m_SO_DETACH_FILTER = 27
- const m_SO_DETACH_REUSEPORT_BPF = 68
- const m_SO_DOMAIN = 39
- const m_SO_DONTROUTE = 5
- const m_SO_ERROR = 4
- const m_SO_GET_FILTER = "SO_ATTACH_FILTER"
- const m_SO_INCOMING_CPU = 49
- const m_SO_INCOMING_NAPI_ID = 56
- const m_SO_KEEPALIVE = 9
- const m_SO_LINGER = 13
- const m_SO_LOCK_FILTER = 44
- const m_SO_MARK = 36
- const m_SO_MAX_PACING_RATE = 47
- const m_SO_MEMINFO = 55
- const m_SO_NOFCS = 43
- const m_SO_NO_CHECK = 11
- const m_SO_OOBINLINE = 10
- const m_SO_PASSCRED = 16
- const m_SO_PASSSEC = 34
- const m_SO_PEEK_OFF = 42
- const m_SO_PEERCRED = 17
- const m_SO_PEERGROUPS = 59
- const m_SO_PEERNAME = 28
- const m_SO_PEERSEC = 31
- const m_SO_PREFER_BUSY_POLL = 69
- const m_SO_PRIORITY = 12
- const m_SO_PROTOCOL = 38
- const m_SO_RCVBUF = 8
- const m_SO_RCVBUFFORCE = 33
- const m_SO_RCVLOWAT = 18
- const m_SO_RCVTIMEO = 66
- const m_SO_REUSEADDR = 2
- const m_SO_REUSEPORT = 15
- const m_SO_RXQ_OVFL = 40
- const m_SO_SECURITY_AUTHENTICATION = 22
- const m_SO_SECURITY_ENCRYPTION_NETWORK = 24
- const m_SO_SECURITY_ENCRYPTION_TRANSPORT = 23
- const m_SO_SELECT_ERR_QUEUE = 45
- const m_SO_SNDBUF = 7
- const m_SO_SNDBUFFORCE = 32
- const m_SO_SNDLOWAT = 19
- const m_SO_SNDTIMEO = 67
- const m_SO_TIMESTAMP = 63
- const m_SO_TIMESTAMPING = 65
- const m_SO_TIMESTAMPNS = 64
- const m_SO_TXTIME = 61
- const m_SO_TYPE = 3
- const m_SO_WIFI_STATUS = 41
- const m_SO_ZEROCOPY = 60
- const m_UINT_MAX2 = 0xffffffff
- type Tsocklen_t = uint32
- type Tsa_family_t = uint16
- type Tmsghdr = struct {
- Fmsg_name uintptr
- Fmsg_namelen Tsocklen_t
- Fmsg_iov uintptr
- Fmsg_iovlen int32
- Fmsg_control uintptr
- Fmsg_controllen Tsocklen_t
- Fmsg_flags int32
- }
- type Tcmsghdr = struct {
- Fcmsg_len Tsocklen_t
- Fcmsg_level int32
- Fcmsg_type int32
- }
- type Tucred = struct {
- Fpid Tpid_t
- Fuid Tuid_t
- Fgid Tgid_t
- }
- type Tmmsghdr = struct {
- Fmsg_hdr Tmsghdr
- Fmsg_len uint32
- }
- type Tlinger = struct {
- Fl_onoff int32
- Fl_linger int32
- }
- type Tsockaddr = struct {
- Fsa_family Tsa_family_t
- Fsa_data [14]int8
- }
- type Tsockaddr_storage = struct {
- Fss_family Tsa_family_t
- F__ss_padding [122]int8
- F__ss_align uint32
- }
- type Tsockaddr_un = struct {
- Fsun_family Tsa_family_t
- Fsun_path [108]int8
- }
- // C documentation
- //
- // /* Linux and OpenBSD */
- func Xgetpeereid(tls *libc.TLS, s int32, euid uintptr, egid uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var ret int32
- var _ /* cred at bp+0 */ Tucred
- var _ /* credlen at bp+12 */ Tsocklen_t
- _ = ret
- *(*Tsocklen_t)(unsafe.Pointer(bp + 12)) = uint32(12)
- ret = libc.Xgetsockopt(tls, s, int32(m_SOL_SOCKET), int32(m_SO_PEERCRED), bp, bp+12)
- if ret != 0 {
- return ret
- }
- *(*Tuid_t)(unsafe.Pointer(euid)) = (*(*Tucred)(unsafe.Pointer(bp))).Fuid
- *(*Tgid_t)(unsafe.Pointer(egid)) = (*(*Tucred)(unsafe.Pointer(bp))).Fgid
- return 0
- }
- /*
- * Swap two areas of size number of bytes. Although qsort(3) permits random
- * blocks of memory to be sorted, sorting pointers is almost certainly the
- * common case (and, were it not, could easily be made so). Regardless, it
- * isn't worth optimizing; the SWAP's get sped up by the cache, and pointer
- * arithmetic gets lost in the time required for comparison function calls.
- */
- /* Copy one block of size size to another. */
- /*
- * Build the list into a heap, where a heap is defined such that for
- * the records K1 ... KN, Kj/2 >= Kj for 1 <= j/2 <= j <= N.
- *
- * There are two cases. If j == nmemb, select largest of Ki and Kj. If
- * j < nmemb, select largest of Ki, Kj and Kj+1.
- */
- /*
- * Select the top of the heap and 'heapify'. Since by far the most expensive
- * action is the call to the compar function, a considerable optimization
- * in the average case can be achieved due to the fact that k, the displaced
- * element, is usually quite small, so it would be preferable to first
- * heapify, always maintaining the invariant that the larger child is copied
- * over its parent's record.
- *
- * Then, starting from the *bottom* of the heap, finding k's correct place,
- * again maintaining the invariant. As a result of the invariant no element
- * is 'lost' when k is assigned its correct place in the heap.
- *
- * The time savings from this optimization are on the order of 15-20% for the
- * average case. See Knuth, Vol. 3, page 158, problem 18.
- *
- * XXX Don't break the #define SELECT line, below. Reiser cpp gets upset.
- */
- // C documentation
- //
- // /*
- // * Heapsort -- Knuth, Vol. 3, page 145. Runs in O (N lg N), both average
- // * and worst. While heapsort is faster than the worst case of quicksort,
- // * the BSD quicksort does median selection so that the chance of finding
- // * a data set that will trigger the worst case is nonexistent. Heapsort's
- // * only advantage over quicksort is that it requires little additional memory.
- // */
- func Xheapsort(tls *libc.TLS, vbase uintptr, nmemb Tsize_t, size Tsize_t, compar uintptr) (r int32) {
- var base, k, p, t, tmp1, tmp2, v1, v12, v13, v16, v17, v22, v23, v27, v28, v31, v32, v8, v9 uintptr
- var cnt, i, j, l, v10, v14, v19, v20, v25, v29, v3, v5, v6 Tsize_t
- var tmp int8
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- if nmemb <= uint32(1) {
- return 0
- }
- if !(size != 0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return -int32(1)
- }
- v1 = libc.Xmalloc(tls, size)
- k = v1
- if v1 == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- /*
- * Items are numbered from 1 to nmemb, so offset from size bytes
- * below the starting address.
- */
- base = vbase - uintptr(size)
- l = nmemb/uint32(2) + uint32(1)
- for {
- l--
- v3 = l
- if !(v3 != 0) {
- break
- }
- i = l
- for {
- v5 = i * libc.Uint32FromInt32(2)
- j = v5
- if !(v5 <= nmemb) {
- break
- }
- p = base + uintptr(j*size)
- if j < nmemb && (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, p, p+uintptr(size)) < 0 {
- p += uintptr(size)
- j++
- }
- t = base + uintptr(i*size)
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, p, t) <= 0 {
- break
- }
- cnt = size
- for {
- tmp = *(*int8)(unsafe.Pointer(t))
- v8 = t
- t++
- *(*int8)(unsafe.Pointer(v8)) = *(*int8)(unsafe.Pointer(p))
- v9 = p
- p++
- *(*int8)(unsafe.Pointer(v9)) = tmp
- goto _7
- _7:
- ;
- cnt--
- v6 = cnt
- if !(v6 != 0) {
- break
- }
- }
- goto _4
- _4:
- ;
- i = j
- }
- goto _2
- _2:
- }
- /*
- * For each element of the heap, save the largest element into its
- * final slot, save the displaced element (k), then recreate the
- * heap.
- */
- for nmemb > uint32(1) {
- cnt = size
- tmp1 = k
- tmp2 = base + uintptr(nmemb*size)
- for {
- v12 = tmp1
- tmp1++
- v13 = tmp2
- tmp2++
- *(*int8)(unsafe.Pointer(v12)) = *(*int8)(unsafe.Pointer(v13))
- goto _11
- _11:
- ;
- cnt--
- v10 = cnt
- if !(v10 != 0) {
- break
- }
- }
- cnt = size
- tmp1 = base + uintptr(nmemb*size)
- tmp2 = base + uintptr(size)
- for {
- v16 = tmp1
- tmp1++
- v17 = tmp2
- tmp2++
- *(*int8)(unsafe.Pointer(v16)) = *(*int8)(unsafe.Pointer(v17))
- goto _15
- _15:
- ;
- cnt--
- v14 = cnt
- if !(v14 != 0) {
- break
- }
- }
- nmemb--
- i = uint32(1)
- for {
- v19 = i * libc.Uint32FromInt32(2)
- j = v19
- if !(v19 <= nmemb) {
- break
- }
- p = base + uintptr(j*size)
- if j < nmemb && (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, p, p+uintptr(size)) < 0 {
- p += uintptr(size)
- j++
- }
- t = base + uintptr(i*size)
- cnt = size
- tmp1 = t
- tmp2 = p
- for {
- v22 = tmp1
- tmp1++
- v23 = tmp2
- tmp2++
- *(*int8)(unsafe.Pointer(v22)) = *(*int8)(unsafe.Pointer(v23))
- goto _21
- _21:
- ;
- cnt--
- v20 = cnt
- if !(v20 != 0) {
- break
- }
- }
- goto _18
- _18:
- ;
- i = j
- }
- for {
- j = i
- i = j / uint32(2)
- p = base + uintptr(j*size)
- t = base + uintptr(i*size)
- if j == uint32(1) || (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, k, t) < 0 {
- cnt = size
- tmp1 = p
- tmp2 = k
- for {
- v27 = tmp1
- tmp1++
- v28 = tmp2
- tmp2++
- *(*int8)(unsafe.Pointer(v27)) = *(*int8)(unsafe.Pointer(v28))
- goto _26
- _26:
- ;
- cnt--
- v25 = cnt
- if !(v25 != 0) {
- break
- }
- }
- break
- }
- cnt = size
- tmp1 = p
- tmp2 = t
- for {
- v31 = tmp1
- tmp1++
- v32 = tmp2
- tmp2++
- *(*int8)(unsafe.Pointer(v31)) = *(*int8)(unsafe.Pointer(v32))
- goto _30
- _30:
- ;
- cnt--
- v29 = cnt
- if !(v29 != 0) {
- break
- }
- }
- goto _24
- _24:
- }
- }
- libc.Xfree(tls, k)
- return 0
- }
- const m_HN_AUTOSCALE1 = 32
- const m_HN_B1 = 4
- const m_HN_DECIMAL1 = 1
- const m_HN_DIVISOR_10001 = 8
- const m_HN_GETSCALE1 = 16
- const m_HN_IEC_PREFIXES1 = 16
- const m_HN_NOSPACE1 = 2
- const m_LC_ALL = 6
- const m_LC_ALL_MASK = 0x7fffffff
- const m_LC_COLLATE = 3
- const m_LC_CTYPE = 0
- const m_LC_MESSAGES = 5
- const m_LC_MONETARY = 4
- const m_LC_NUMERIC = 1
- const m_LC_TIME = 2
- type Tlconv = struct {
- Fdecimal_point uintptr
- Fthousands_sep uintptr
- Fgrouping uintptr
- Fint_curr_symbol uintptr
- Fcurrency_symbol uintptr
- Fmon_decimal_point uintptr
- Fmon_thousands_sep uintptr
- Fmon_grouping uintptr
- Fpositive_sign uintptr
- Fnegative_sign uintptr
- Fint_frac_digits int8
- Ffrac_digits int8
- Fp_cs_precedes int8
- Fp_sep_by_space int8
- Fn_cs_precedes int8
- Fn_sep_by_space int8
- Fp_sign_posn int8
- Fn_sign_posn int8
- Fint_p_cs_precedes int8
- Fint_p_sep_by_space int8
- Fint_n_cs_precedes int8
- Fint_n_sep_by_space int8
- Fint_p_sign_posn int8
- Fint_n_sign_posn int8
- }
- /*
- * Copyright (c) 1996 Peter Wemm <peter@FreeBSD.org>.
- * All rights reserved.
- * Copyright (c) 2002 Networks Associates Technology, Inc.
- * All rights reserved.
- *
- * Portions of this software were developed for the FreeBSD Project by
- * ThinkSec AS and NAI Labs, the Security Research Division of Network
- * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
- * ("CBOSS"), as part of the DARPA CHATS research program.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, is permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libutil/libutil.h,v 1.47 2008/04/23 00:49:12 scf Exp $
- */
- var _maxscale = int32(6)
- func Xhumanize_number(tls *libc.TLS, buf uintptr, len1 Tsize_t, quotient Tint64_t, suffix uintptr, scale int32, flags int32) (r1 int32) {
- bp := tls.Alloc(64)
- defer tls.Free(64)
- var baselen Tsize_t
- var divisor, max Tint64_t
- var divisordeccut, i, r, remainder, s1, s2, sign, v2 int32
- var prefixes, sep uintptr
- _, _, _, _, _, _, _, _, _, _, _, _, _ = baselen, divisor, divisordeccut, i, max, prefixes, r, remainder, s1, s2, sep, sign, v2
- /* Since so many callers don't check -1, NUL terminate the buffer */
- if len1 > uint32(0) {
- *(*int8)(unsafe.Pointer(buf)) = int8('\000')
- }
- /* validate args */
- if buf == libc.UintptrFromInt32(0) || suffix == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- if scale < 0 {
- return -int32(1)
- } else {
- if scale > _maxscale && scale & ^(libc.Int32FromInt32(m_HN_AUTOSCALE1)|libc.Int32FromInt32(m_HN_GETSCALE1)) != 0 {
- return -int32(1)
- }
- }
- if flags&int32(m_HN_DIVISOR_10001) != 0 && flags&int32(m_HN_IEC_PREFIXES1) != 0 {
- return -int32(1)
- }
- /* setup parameters */
- remainder = 0
- if flags&int32(m_HN_IEC_PREFIXES1) != 0 {
- baselen = uint32(2)
- /*
- * Use the prefixes for power of two recommended by
- * the International Electrotechnical Commission
- * (IEC) in IEC 80000-3 (i.e. Ki, Mi, Gi...).
- *
- * HN_IEC_PREFIXES implies a divisor of 1024 here
- * (use of HN_DIVISOR_1000 would have triggered
- * an assertion earlier).
- */
- divisor = int64(1024)
- divisordeccut = int32(973) /* ceil(.95 * 1024) */
- if flags&int32(m_HN_B1) != 0 {
- prefixes = __ccgo_ts + 156
- } else {
- prefixes = __ccgo_ts + 177
- }
- } else {
- baselen = uint32(1)
- if flags&int32(m_HN_DIVISOR_10001) != 0 {
- divisor = int64(1000)
- divisordeccut = int32(950)
- if flags&int32(m_HN_B1) != 0 {
- prefixes = __ccgo_ts + 198
- } else {
- prefixes = __ccgo_ts + 218
- }
- } else {
- divisor = int64(1024)
- divisordeccut = int32(973) /* ceil(.95 * 1024) */
- if flags&int32(m_HN_B1) != 0 {
- prefixes = __ccgo_ts + 238
- } else {
- prefixes = __ccgo_ts + 258
- }
- }
- }
- if quotient < 0 {
- sign = -int32(1)
- quotient = -quotient
- baselen += uint32(2) /* sign, digit */
- } else {
- sign = int32(1)
- baselen += uint32(1) /* digit */
- }
- if flags&int32(m_HN_NOSPACE1) != 0 {
- sep = __ccgo_ts + 53
- } else {
- sep = __ccgo_ts + 278
- baselen++
- }
- baselen += libc.Xstrlen(tls, suffix)
- /* Check if enough room for `x y' + suffix + `\0' */
- if len1 < baselen+uint32(1) {
- return -int32(1)
- }
- if scale&(libc.Int32FromInt32(m_HN_AUTOSCALE1)|libc.Int32FromInt32(m_HN_GETSCALE1)) != 0 {
- /* See if there is additional columns can be used. */
- max = int64(1)
- i = libc.Int32FromUint32(len1 - baselen)
- for {
- v2 = i
- i--
- if !(v2 > 0) {
- break
- }
- max *= int64(10)
- goto _1
- _1:
- }
- /*
- * Divide the number until it fits the given column.
- * If there will be an overflow by the rounding below,
- * divide once more.
- */
- i = 0
- for {
- if !((quotient >= max || quotient == max-int64(1) && (remainder >= divisordeccut || int64(remainder) >= divisor/int64(2))) && i < _maxscale) {
- break
- }
- remainder = int32(quotient % divisor)
- quotient /= divisor
- goto _3
- _3:
- ;
- i++
- }
- if scale&int32(m_HN_GETSCALE1) != 0 {
- return i
- }
- } else {
- i = 0
- for {
- if !(i < scale && i < _maxscale) {
- break
- }
- remainder = int32(quotient % divisor)
- quotient /= divisor
- goto _4
- _4:
- ;
- i++
- }
- }
- /* If a value <= 9.9 after rounding and ... */
- /*
- * XXX - should we make sure there is enough space for the decimal
- * place and if not, don't do HN_DECIMAL?
- */
- if (quotient == int64(9) && remainder < divisordeccut || quotient < int64(9)) && i > 0 && flags&int32(m_HN_DECIMAL1) != 0 {
- s1 = int32(int64(int32(quotient)) + (int64(remainder*int32(10))+divisor/int64(2))/divisor/int64(10))
- s2 = int32((int64(remainder*int32(10)) + divisor/int64(2)) / divisor % int64(10))
- 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))
- } else {
- 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))
- }
- return r
- }
- const m_HN_AUTOSCALE2 = 0x20
- const m_HN_B2 = 0x04
- const m_HN_DECIMAL2 = 0x01
- const m_HN_DIVISOR_10002 = 0x08
- const m_HN_GETSCALE2 = 0x10
- const m_HN_IEC_PREFIXES2 = 0x10
- const m_HN_NOSPACE2 = 0x02
- const m_INET6_ADDRSTRLEN = 46
- const m_INET_ADDRSTRLEN = 16
- const m_IN_CLASSA_MAX = 128
- const m_IN_CLASSA_NET = 0xff000000
- const m_IN_CLASSA_NSHIFT = 24
- const m_IN_CLASSB_MAX = 65536
- const m_IN_CLASSB_NET = 0xffff0000
- const m_IN_CLASSB_NSHIFT = 16
- const m_IN_CLASSC_NET = 0xffffff00
- const m_IN_CLASSC_NSHIFT = 8
- const m_IN_LOOPBACKNET = 127
- const m_IPPORT_RESERVED = 1024
- const m_IPPROTO_AH = 51
- const m_IPPROTO_BEETPH = 94
- const m_IPPROTO_COMP = 108
- const m_IPPROTO_DCCP = 33
- const m_IPPROTO_DSTOPTS = 60
- const m_IPPROTO_EGP = 8
- const m_IPPROTO_ENCAP = 98
- const m_IPPROTO_ESP = 50
- const m_IPPROTO_ETHERNET = 143
- const m_IPPROTO_FRAGMENT = 44
- const m_IPPROTO_GRE = 47
- const m_IPPROTO_HOPOPTS = 0
- const m_IPPROTO_ICMP = 1
- const m_IPPROTO_ICMPV6 = 58
- const m_IPPROTO_IDP = 22
- const m_IPPROTO_IGMP = 2
- const m_IPPROTO_IP = 0
- const m_IPPROTO_IPIP = 4
- const m_IPPROTO_IPV6 = 41
- const m_IPPROTO_MAX = 263
- const m_IPPROTO_MH = 135
- const m_IPPROTO_MPLS = 137
- const m_IPPROTO_MPTCP = 262
- const m_IPPROTO_MTP = 92
- const m_IPPROTO_NONE = 59
- const m_IPPROTO_PIM = 103
- const m_IPPROTO_PUP = 12
- const m_IPPROTO_RAW = 255
- const m_IPPROTO_ROUTING = 43
- const m_IPPROTO_RSVP = 46
- const m_IPPROTO_SCTP = 132
- const m_IPPROTO_TCP = 6
- const m_IPPROTO_TP = 29
- const m_IPPROTO_UDP = 17
- const m_IPPROTO_UDPLITE = 136
- const m_IPV6_2292DSTOPTS = 4
- const m_IPV6_2292HOPLIMIT = 8
- const m_IPV6_2292HOPOPTS = 3
- const m_IPV6_2292PKTINFO = 2
- const m_IPV6_2292PKTOPTIONS = 6
- const m_IPV6_2292RTHDR = 5
- const m_IPV6_ADDRFORM = 1
- const m_IPV6_ADDR_PREFERENCES = 72
- const m_IPV6_ADD_MEMBERSHIP = "IPV6_JOIN_GROUP"
- const m_IPV6_AUTHHDR = 10
- const m_IPV6_AUTOFLOWLABEL = 70
- const m_IPV6_CHECKSUM = 7
- const m_IPV6_DONTFRAG = 62
- const m_IPV6_DROP_MEMBERSHIP = "IPV6_LEAVE_GROUP"
- const m_IPV6_DSTOPTS = 59
- const m_IPV6_FREEBIND = 78
- const m_IPV6_HDRINCL = 36
- const m_IPV6_HOPLIMIT = 52
- const m_IPV6_HOPOPTS = 54
- const m_IPV6_IPSEC_POLICY = 34
- const m_IPV6_JOIN_ANYCAST = 27
- const m_IPV6_JOIN_GROUP = 20
- const m_IPV6_LEAVE_ANYCAST = 28
- const m_IPV6_LEAVE_GROUP = 21
- const m_IPV6_MINHOPCOUNT = 73
- const m_IPV6_MTU = 24
- const m_IPV6_MTU_DISCOVER = 23
- const m_IPV6_MULTICAST_ALL = 29
- const m_IPV6_MULTICAST_HOPS = 18
- const m_IPV6_MULTICAST_IF = 17
- const m_IPV6_MULTICAST_LOOP = 19
- const m_IPV6_NEXTHOP = 9
- const m_IPV6_ORIGDSTADDR = 74
- const m_IPV6_PATHMTU = 61
- const m_IPV6_PKTINFO = 50
- const m_IPV6_PMTUDISC_DO = 2
- const m_IPV6_PMTUDISC_DONT = 0
- const m_IPV6_PMTUDISC_INTERFACE = 4
- const m_IPV6_PMTUDISC_OMIT = 5
- const m_IPV6_PMTUDISC_PROBE = 3
- const m_IPV6_PMTUDISC_WANT = 1
- const m_IPV6_PREFER_SRC_CGA = 0x0008
- const m_IPV6_PREFER_SRC_COA = 0x0004
- const m_IPV6_PREFER_SRC_HOME = 0x0400
- const m_IPV6_PREFER_SRC_NONCGA = 0x0800
- const m_IPV6_PREFER_SRC_PUBLIC = 0x0002
- const m_IPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x0100
- const m_IPV6_PREFER_SRC_TMP = 0x0001
- const m_IPV6_RECVDSTOPTS = 58
- const m_IPV6_RECVERR = 25
- const m_IPV6_RECVFRAGSIZE = 77
- const m_IPV6_RECVHOPLIMIT = 51
- const m_IPV6_RECVHOPOPTS = 53
- const m_IPV6_RECVORIGDSTADDR = "IPV6_ORIGDSTADDR"
- const m_IPV6_RECVPATHMTU = 60
- const m_IPV6_RECVPKTINFO = 49
- const m_IPV6_RECVRTHDR = 56
- const m_IPV6_RECVTCLASS = 66
- const m_IPV6_ROUTER_ALERT = 22
- const m_IPV6_ROUTER_ALERT_ISOLATE = 30
- const m_IPV6_RTHDR = 57
- const m_IPV6_RTHDRDSTOPTS = 55
- const m_IPV6_RTHDR_LOOSE = 0
- const m_IPV6_RTHDR_STRICT = 1
- const m_IPV6_RTHDR_TYPE_0 = 0
- const m_IPV6_RXDSTOPTS = "IPV6_DSTOPTS"
- const m_IPV6_RXHOPOPTS = "IPV6_HOPOPTS"
- const m_IPV6_TCLASS = 67
- const m_IPV6_TRANSPARENT = 75
- const m_IPV6_UNICAST_HOPS = 16
- const m_IPV6_UNICAST_IF = 76
- const m_IPV6_V6ONLY = 26
- const m_IPV6_XFRM_POLICY = 35
- const m_IP_ADD_MEMBERSHIP = 35
- const m_IP_ADD_SOURCE_MEMBERSHIP = 39
- const m_IP_BIND_ADDRESS_NO_PORT = 24
- const m_IP_BLOCK_SOURCE = 38
- const m_IP_CHECKSUM = 23
- const m_IP_DEFAULT_MULTICAST_LOOP = 1
- const m_IP_DEFAULT_MULTICAST_TTL = 1
- const m_IP_DROP_MEMBERSHIP = 36
- const m_IP_DROP_SOURCE_MEMBERSHIP = 40
- const m_IP_FREEBIND = 15
- const m_IP_HDRINCL = 3
- const m_IP_IPSEC_POLICY = 16
- const m_IP_MAX_MEMBERSHIPS = 20
- const m_IP_MINTTL = 21
- const m_IP_MSFILTER = 41
- const m_IP_MTU = 14
- const m_IP_MTU_DISCOVER = 10
- const m_IP_MULTICAST_ALL = 49
- const m_IP_MULTICAST_IF = 32
- const m_IP_MULTICAST_LOOP = 34
- const m_IP_MULTICAST_TTL = 33
- const m_IP_NODEFRAG = 22
- const m_IP_OPTIONS = 4
- const m_IP_ORIGDSTADDR = 20
- const m_IP_PASSSEC = 18
- const m_IP_PKTINFO = 8
- const m_IP_PKTOPTIONS = 9
- const m_IP_PMTUDISC = 10
- const m_IP_PMTUDISC_DO = 2
- const m_IP_PMTUDISC_DONT = 0
- const m_IP_PMTUDISC_INTERFACE = 4
- const m_IP_PMTUDISC_OMIT = 5
- const m_IP_PMTUDISC_PROBE = 3
- const m_IP_PMTUDISC_WANT = 1
- const m_IP_RECVERR = 11
- const m_IP_RECVERR_RFC4884 = 26
- const m_IP_RECVFRAGSIZE = 25
- const m_IP_RECVOPTS = 6
- const m_IP_RECVORIGDSTADDR = "IP_ORIGDSTADDR"
- const m_IP_RECVRETOPTS = "IP_RETOPTS"
- const m_IP_RECVTOS = 13
- const m_IP_RECVTTL = 12
- const m_IP_RETOPTS = 7
- const m_IP_ROUTER_ALERT = 5
- const m_IP_TOS = 1
- const m_IP_TRANSPARENT = 19
- const m_IP_TTL = 2
- const m_IP_UNBLOCK_SOURCE = 37
- const m_IP_UNICAST_IF = 50
- const m_IP_XFRM_POLICY = 17
- const m_MCAST_BLOCK_SOURCE = 43
- const m_MCAST_EXCLUDE = 0
- const m_MCAST_INCLUDE = 1
- const m_MCAST_JOIN_GROUP = 42
- const m_MCAST_JOIN_SOURCE_GROUP = 46
- const m_MCAST_LEAVE_GROUP = 45
- const m_MCAST_LEAVE_SOURCE_GROUP = 47
- const m_MCAST_MSFILTER = 48
- const m_MCAST_UNBLOCK_SOURCE = 44
- const m___UAPI_DEF_IN6_ADDR = 0
- const m___UAPI_DEF_IN6_ADDR_ALT = 0
- const m___UAPI_DEF_IN6_PKTINFO = 0
- const m___UAPI_DEF_IN_ADDR = 0
- const m___UAPI_DEF_IN_CLASS = 0
- const m___UAPI_DEF_IN_IPPROTO = 0
- const m___UAPI_DEF_IN_PKTINFO = 0
- const m___UAPI_DEF_IP6_MTUINFO = 0
- const m___UAPI_DEF_IPPROTO_V6 = 0
- const m___UAPI_DEF_IPV6_MREQ = 0
- const m___UAPI_DEF_IPV6_OPTIONS = 0
- const m___UAPI_DEF_IP_MREQ = 0
- const m___UAPI_DEF_SOCKADDR_IN = 0
- const m___UAPI_DEF_SOCKADDR_IN6 = 0
- type Tin_port_t = uint16
- type Tin_addr_t = uint32
- type Tin_addr = struct {
- Fs_addr Tin_addr_t
- }
- type Tsockaddr_in = struct {
- Fsin_family Tsa_family_t
- Fsin_port Tin_port_t
- Fsin_addr Tin_addr
- Fsin_zero [8]Tuint8_t
- }
- type Tin6_addr = struct {
- F__in6_union struct {
- F__s6_addr16 [0][8]Tuint16_t
- F__s6_addr32 [0][4]Tuint32_t
- F__s6_addr [16]Tuint8_t
- }
- }
- type Tsockaddr_in6 = struct {
- Fsin6_family Tsa_family_t
- Fsin6_port Tin_port_t
- Fsin6_flowinfo Tuint32_t
- Fsin6_addr Tin6_addr
- Fsin6_scope_id Tuint32_t
- }
- type Tipv6_mreq = struct {
- Fipv6mr_multiaddr Tin6_addr
- Fipv6mr_interface uint32
- }
- type Tip_opts = struct {
- Fip_dst Tin_addr
- Fip_opts [40]int8
- }
- type Tip_mreq = struct {
- Fimr_multiaddr Tin_addr
- Fimr_interface Tin_addr
- }
- type Tip_mreqn = struct {
- Fimr_multiaddr Tin_addr
- Fimr_address Tin_addr
- Fimr_ifindex int32
- }
- type Tip_mreq_source = struct {
- Fimr_multiaddr Tin_addr
- Fimr_interface Tin_addr
- Fimr_sourceaddr Tin_addr
- }
- type Tip_msfilter = struct {
- Fimsf_multiaddr Tin_addr
- Fimsf_interface Tin_addr
- Fimsf_fmode Tuint32_t
- Fimsf_numsrc Tuint32_t
- Fimsf_slist [1]Tin_addr
- }
- type Tgroup_req = struct {
- Fgr_interface Tuint32_t
- Fgr_group Tsockaddr_storage
- }
- type Tgroup_source_req = struct {
- Fgsr_interface Tuint32_t
- Fgsr_group Tsockaddr_storage
- Fgsr_source Tsockaddr_storage
- }
- type Tgroup_filter = struct {
- Fgf_interface Tuint32_t
- Fgf_group Tsockaddr_storage
- Fgf_fmode Tuint32_t
- Fgf_numsrc Tuint32_t
- Fgf_slist [1]Tsockaddr_storage
- }
- type Tin_pktinfo = struct {
- Fipi_ifindex int32
- Fipi_spec_dst Tin_addr
- Fipi_addr Tin_addr
- }
- type Tin6_pktinfo = struct {
- Fipi6_addr Tin6_addr
- Fipi6_ifindex uint32
- }
- type Tip6_mtuinfo = struct {
- Fip6m_addr Tsockaddr_in6
- Fip6m_mtu Tuint32_t
- }
- // C documentation
- //
- // /*
- // * static int
- // * inet_net_pton(af, src, dst, size)
- // * convert network number from presentation to network format.
- // * accepts hex octets, hex strings, decimal octets, and /CIDR.
- // * "size" is in bytes and describes "dst".
- // * return:
- // * number of bits, either imputed classfully or specified with /CIDR,
- // * or -1 if some failure occurred (check errno). ENOENT means it was
- // * not a valid network specification.
- // * author:
- // * Paul Vixie (ISC), June 1996
- // */
- func Xinet_net_pton(tls *libc.TLS, af int32, src uintptr, dst uintptr, size Tsize_t) (r int32) {
- switch af {
- case int32(m_PF_INET):
- return _inet_net_pton_ipv4(tls, src, dst, size)
- default:
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EAFNOSUPPORT)
- return -int32(1)
- }
- return r
- }
- // C documentation
- //
- // /*
- // * static int
- // * inet_net_pton_ipv4(src, dst, size)
- // * convert IPv4 network number from presentation to network format.
- // * accepts hex octets, hex strings, decimal octets, and /CIDR.
- // * "size" is in bytes and describes "dst".
- // * return:
- // * number of bits, either imputed classfully or specified with /CIDR,
- // * or -1 if some failure occurred (check errno). ENOENT means it was
- // * not an IPv4 network specification.
- // * note:
- // * network byte order assumed. this means 192.5.5.240/28 has
- // * 0x11110000 in its fourth octet.
- // * author:
- // * Paul Vixie (ISC), June 1996
- // */
- func _inet_net_pton_ipv4(tls *libc.TLS, src uintptr, dst uintptr, size Tsize_t) (r int32) {
- var bits, ch, dirty, n, tmp, v10, v17, v2, v5 int32
- var odst, v1, v11, v14, v15, v16, v18, v21, v3, v8, p4, p6 uintptr
- var v13, v20, v7 Tsize_t
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bits, ch, dirty, n, odst, tmp, v1, v10, v11, v13, v14, v15, v16, v17, v18, v2, v20, v21, v3, v5, v7, v8, p4, p6
- odst = dst
- v1 = src
- src++
- ch = int32(*(*int8)(unsafe.Pointer(v1)))
- 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 {
- /* Hexadecimal: Eat nybble string. */
- if size <= uint32(0) {
- goto emsgsize
- }
- *(*uint8)(unsafe.Pointer(dst)) = uint8(0)
- dirty = libc.Int32FromInt32(0)
- src++ /* skip x or X. */
- for {
- v3 = src
- src++
- v2 = int32(*(*int8)(unsafe.Pointer(v3)))
- ch = v2
- if !(v2 != int32('\000') && libc.BoolInt32(libc.Uint32FromInt32(ch) < uint32(128)) != 0 && libc.Xisxdigit(tls, ch) != 0) {
- break
- }
- if libc.BoolInt32(libc.Uint32FromInt32(ch)-uint32('A') < uint32(26)) != 0 {
- ch = libc.Xtolower(tls, ch)
- }
- n = int32(libc.Xstrchr(tls, uintptr(unsafe.Pointer(&_xdigits)), ch)) - t__predefined_ptrdiff_t(uintptr(unsafe.Pointer(&_xdigits)))
- p4 = dst
- *(*uint8)(unsafe.Pointer(p4)) = uint8(int32(*(*uint8)(unsafe.Pointer(p4))) | n)
- v5 = dirty
- dirty++
- if !(v5 != 0) {
- p6 = dst
- *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) << libc.Int32FromInt32(4))
- } else {
- v7 = size
- size--
- if v7 > uint32(0) {
- dst++
- v8 = dst
- *(*uint8)(unsafe.Pointer(v8)) = uint8(0)
- dirty = libc.Int32FromInt32(0)
- } else {
- goto emsgsize
- }
- }
- }
- if dirty != 0 {
- size--
- }
- } else {
- if libc.BoolInt32(libc.Uint32FromInt32(ch) < uint32(128)) != 0 && libc.BoolInt32(libc.Uint32FromInt32(ch)-uint32('0') < uint32(10)) != 0 {
- /* Decimal: eat dotted digit string. */
- for {
- tmp = 0
- for {
- n = int32(libc.Xstrchr(tls, uintptr(unsafe.Pointer(&_digits)), ch)) - t__predefined_ptrdiff_t(uintptr(unsafe.Pointer(&_digits)))
- tmp *= int32(10)
- tmp += n
- if tmp > int32(255) {
- goto enoent
- }
- goto _12
- _12:
- ;
- v11 = src
- src++
- v10 = int32(*(*int8)(unsafe.Pointer(v11)))
- ch = v10
- if !(v10 != int32('\000') && libc.BoolInt32(libc.Uint32FromInt32(ch) < uint32(128)) != 0 && libc.BoolInt32(libc.Uint32FromInt32(ch)-uint32('0') < uint32(10)) != 0) {
- break
- }
- }
- v13 = size
- size--
- if v13 <= uint32(0) {
- goto emsgsize
- }
- v14 = dst
- dst++
- *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(tmp)
- if ch == int32('\000') || ch == int32('/') {
- break
- }
- if ch != int32('.') {
- goto enoent
- }
- v15 = src
- src++
- ch = int32(*(*int8)(unsafe.Pointer(v15)))
- if !(libc.BoolInt32(libc.Uint32FromInt32(ch) < libc.Uint32FromInt32(128)) != 0) || !(libc.BoolInt32(libc.Uint32FromInt32(ch)-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0) {
- goto enoent
- }
- goto _9
- _9:
- }
- } else {
- goto enoent
- }
- }
- bits = -int32(1)
- 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 {
- /* CIDR width specifier. Nothing can follow it. */
- v16 = src
- src++
- ch = int32(*(*int8)(unsafe.Pointer(v16))) /* Skip over the /. */
- bits = 0
- for {
- n = int32(libc.Xstrchr(tls, uintptr(unsafe.Pointer(&_digits)), ch)) - t__predefined_ptrdiff_t(uintptr(unsafe.Pointer(&_digits)))
- bits *= int32(10)
- bits += n
- goto _19
- _19:
- ;
- v18 = src
- src++
- v17 = int32(*(*int8)(unsafe.Pointer(v18)))
- ch = v17
- if !(v17 != int32('\000') && libc.BoolInt32(libc.Uint32FromInt32(ch) < uint32(128)) != 0 && libc.BoolInt32(libc.Uint32FromInt32(ch)-uint32('0') < uint32(10)) != 0) {
- break
- }
- }
- if ch != int32('\000') {
- goto enoent
- }
- if bits > int32(32) {
- goto emsgsize
- }
- }
- /* Firey death and destruction unless we prefetched EOS. */
- if ch != int32('\000') {
- goto enoent
- }
- /* If nothing was written to the destination, we found no address. */
- if dst == odst {
- goto enoent
- }
- /* If no CIDR spec was given, infer width from net class. */
- if bits == -int32(1) {
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(odst))) >= int32(240) { /* Class E */
- bits = int32(32)
- } else {
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(odst))) >= int32(224) { /* Class D */
- bits = int32(4)
- } else {
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(odst))) >= int32(192) { /* Class C */
- bits = int32(24)
- } else {
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(odst))) >= int32(128) { /* Class B */
- bits = int32(16)
- } else { /* Class A */
- bits = int32(8)
- }
- }
- }
- }
- /* If imputed mask is narrower than specified octets, widen. */
- if bits < (int32(dst)-int32(odst))*int32(8) {
- bits = (int32(dst) - int32(odst)) * int32(8)
- }
- }
- /* Extend network to cover the actual mask. */
- for bits > (int32(dst)-int32(odst))*int32(8) {
- v20 = size
- size--
- if v20 <= uint32(0) {
- goto emsgsize
- }
- v21 = dst
- dst++
- *(*uint8)(unsafe.Pointer(v21)) = uint8('\000')
- }
- return bits
- goto enoent
- enoent:
- ;
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOENT)
- return -int32(1)
- goto emsgsize
- emsgsize:
- ;
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EMSGSIZE)
- return -int32(1)
- }
- var _xdigits = [17]int8{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}
- var _digits = [11]int8{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
- const m_MD5_BLOCK_LENGTH = 64
- const m_MD5_DIGEST_LENGTH = 16
- type TMD5_CTX = struct {
- Fstate [4]Tuint32_t
- Fcount Tuint64_t
- Fbuffer [64]Tuint8_t
- }
- type TMD5Context = TMD5_CTX
- /* Avoid polluting the namespace. Even though this makes this usage
- * implementation-specific, defining it unconditionally should not be
- * a problem, and better than possibly breaking unexpecting code. */
- /*
- * Copyright © 2015 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /*
- * Copyright © 2004-2006, 2009-2011 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /* Clang expands this to 1 if an identifier is *not* reserved. */
- /*
- * Some libc implementations do not have a <sys/cdefs.h>, in particular
- * musl, try to handle this gracefully.
- */
- /* Copyright (C) 1992-2022 Free Software Foundation, Inc.
- Copyright The GNU Toolchain Authors.
- This file is part of the GNU C Library.
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
- /* We are almost always included from features.h. */
- /* The GNU libc does not support any K&R compilers or the traditional mode
- of ISO C compilers anymore. Check for some of the combinations not
- supported anymore. */
- /* Some user header file might have defined this before. */
- /* Compilers that lack __has_attribute may object to
- #if defined __has_attribute && __has_attribute (...)
- even though they do not need to evaluate the right-hand side of the &&.
- Similarly for __has_builtin, etc. */
- /* All functions, except those with callbacks or those that
- synchronize memory, are leaf functions. */
- /* GCC can always grok prototypes. For C++ programs we add throw()
- to help it optimize the function calls. But this only works with
- gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions
- as non-throwing using a function attribute since programs can use
- the -fexceptions options for C code as well. */
- /* These two macros are not used in glibc anymore. They are kept here
- only because some other projects expect the macros to be defined. */
- /* For these things, GCC behaves the ANSI way normally,
- and the non-ANSI way under -traditional. */
- /* This is not a typedef so `const __ptr_t' does the right thing. */
- /* C++ needs to know that types and declarations are C, not C++. */
- /* Fortify support. */
- /* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */
- /* Support for flexible arrays.
- Headers that should use flexible arrays only if they're "real"
- (e.g. only if they won't affect sizeof()) should test
- #if __glibc_c99_flexarr_available. */
- /* __asm__ ("xyz") is used throughout the headers to rename functions
- at the assembly language level. This is wrapped by the __REDIRECT
- macro, in order to support compilers that can do this some other
- way. When compilers don't support asm-names at all, we have to do
- preprocessor tricks instead (which don't have exactly the right
- semantics, but it's the best we can do).
- Example:
- int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
- /*
- #elif __SOME_OTHER_COMPILER__
- # define __REDIRECT(name, proto, alias) name proto; _Pragma("let " #name " = " #alias)
- */
- /* GCC and clang have various useful declarations that can be made with
- the '__attribute__' syntax. All of the ways we use this do fine if
- they are omitted for compilers that don't understand it. */
- /* At some point during the gcc 2.96 development the `malloc' attribute
- for functions was introduced. We don't want to use it unconditionally
- (although this would be possible) since it generates warnings. */
- /* Tell the compiler which arguments to an allocation function
- indicate the size of the allocation. */
- /* Tell the compiler which argument to an allocation function
- indicates the alignment of the allocation. */
- /* At some point during the gcc 2.96 development the `pure' attribute
- for functions was introduced. We don't want to use it unconditionally
- (although this would be possible) since it generates warnings. */
- /* This declaration tells the compiler that the value is constant. */
- /* At some point during the gcc 3.1 development the `used' attribute
- for functions was introduced. We don't want to use it unconditionally
- (although this would be possible) since it generates warnings. */
- /* Since version 3.2, gcc allows marking deprecated functions. */
- /* Since version 4.5, gcc also allows one to specify the message printed
- when a deprecated function is used. clang claims to be gcc 4.2, but
- may also support this feature. */
- /* At some point during the gcc 2.8 development the `format_arg' attribute
- for functions was introduced. We don't want to use it unconditionally
- (although this would be possible) since it generates warnings.
- If several `format_arg' attributes are given for the same function, in
- gcc-3.0 and older, all but the last one are ignored. In newer gccs,
- all designated arguments are considered. */
- /* At some point during the gcc 2.97 development the `strfmon' format
- attribute for functions was introduced. We don't want to use it
- unconditionally (although this would be possible) since it
- generates warnings. */
- /* The nonnull function attribute marks pointer parameters that
- must not be NULL. This has the name __nonnull in glibc,
- and __attribute_nonnull__ in files shared with Gnulib to avoid
- collision with a different __nonnull in DragonFlyBSD 5.9. */
- /* The returns_nonnull function attribute marks the return type of the function
- as always being non-null. */
- /* If fortification mode, we warn about unused results of certain
- function calls which can lead to problems. */
- /* Forces a function to be always inlined. */
- /* Associate error messages with the source location of the call site rather
- than with the source location inside the function. */
- /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
- inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__
- or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions
- older than 4.3 may define these macros and still not guarantee GNU inlining
- semantics.
- clang++ identifies itself as gcc-4.2, but has support for GNU inlining
- semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and
- __GNUC_GNU_INLINE__ macro definitions. */
- /* GCC 4.3 and above allow passing all anonymous arguments of an
- __extern_always_inline function to some other vararg function. */
- /* It is possible to compile containing GCC extensions even if GCC is
- run in pedantic mode if the uses are carefully marked using the
- `__extension__' keyword. But this is not generally available before
- version 2.8. */
- /* __restrict is known in EGCS 1.2 and above, and in clang.
- It works also in C++ mode (outside of arrays), but only when spelled
- as '__restrict', not 'restrict'. */
- /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
- array_name[restrict]
- GCC 3.1 and clang support this.
- This syntax is not usable in C++ mode. */
- /* Undefine (also defined in libc-symbols.h). */
- /* Gnulib avoids including these, as they don't work on non-glibc or
- older glibc platforms. */
- /* Determine the wordsize from the preprocessor defines. */
- /* Properties of long double type. ldbl-96 version.
- Copyright (C) 2016-2022 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
- /* long double is distinct from double, so there is nothing to
- define here. */
- /* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is
- intended for use in preprocessor macros.
- Note: MESSAGE must be a _single_ string; concatenation of string
- literals is not supported. */
- /* Generic selection (ISO C11) is a C-only feature, available in GCC
- since version 4.9. Previous versions do not provide generic
- selection, even though they might set __STDC_VERSION__ to 201112L,
- when in -std=c11 mode. Thus, we must check for !defined __GNUC__
- when testing __STDC_VERSION__ for generic selection support.
- On the other hand, Clang also defines __GNUC__, so a clang-specific
- check is required to enable the use of generic selection. */
- /* Specify that a function such as setjmp or vfork may return
- twice. */
- /*
- * On non-glibc based systems, we cannot unconditionally use the
- * __GLIBC_PREREQ macro as it gets expanded before evaluation.
- */
- /*
- * Some kFreeBSD headers expect those macros to be set for sanity checks.
- */
- /* Linux headers define a struct with a member names __unused.
- * Debian bugs: #522773 (linux), #522774 (libc).
- * Disable for now. */
- /*
- * Return the number of elements in a statically-allocated array,
- * __x.
- */
- /*
- * We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
- * require it.
- */
- /*
- * Given the pointer x to the member m of the struct s, return
- * a pointer to the containing structure. When using GCC, we first
- * assign pointer x to a local variable, to check that its type is
- * compatible with member m.
- */
- func Xlibbsd_MD5Init(tls *libc.TLS, context uintptr) {
- libmd.XMD5Init(tls, context)
- }
- 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', '.'}
- func Xlibbsd_MD5Update(tls *libc.TLS, context uintptr, data uintptr, len1 Tsize_t) {
- libmd.XMD5Update(tls, context, data, len1)
- }
- 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', '.'}
- func Xlibbsd_MD5Pad(tls *libc.TLS, context uintptr) {
- libmd.XMD5Pad(tls, context)
- }
- 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', '.'}
- func Xlibbsd_MD5Final(tls *libc.TLS, digest uintptr, context uintptr) {
- libmd.XMD5Final(tls, digest, context)
- }
- 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', '.'}
- func Xlibbsd_MD5Transform(tls *libc.TLS, state uintptr, block uintptr) {
- libmd.XMD5Transform(tls, state, block)
- }
- 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', '.'}
- func Xlibbsd_MD5End(tls *libc.TLS, context uintptr, buf uintptr) (r uintptr) {
- return libmd.XMD5End(tls, context, buf)
- }
- 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', '.'}
- func Xlibbsd_MD5File(tls *libc.TLS, filename uintptr, buf uintptr) (r uintptr) {
- return libmd.XMD5File(tls, filename, buf)
- }
- 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', '.'}
- func Xlibbsd_MD5FileChunk(tls *libc.TLS, filename uintptr, buf uintptr, offset Toff_t, length Toff_t) (r uintptr) {
- return libmd.XMD5FileChunk(tls, filename, buf, offset, length)
- }
- 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', '.'}
- func Xlibbsd_MD5Data(tls *libc.TLS, data uintptr, len1 Tsize_t, buf uintptr) (r uintptr) {
- return libmd.XMD5Data(tls, data, len1, buf)
- }
- 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', '.'}
- const m_THRESHOLD = 16
- /*
- * Find the next possible pointer head. (Trickery for forcing an array
- * to do double duty as a linked list when objects do not align with word
- * boundaries.
- */
- /* Assumption: PSIZE is a power of 2. */
- // C documentation
- //
- // /*
- // * Arguments are as for qsort.
- // */
- func Xmergesort(tls *libc.TLS, base uintptr, nmemb Tsize_t, size Tsize_t, cmp uintptr) (r int32) {
- 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
- var big, iflag, sense, v2 int32
- var i, v8 Tsize_t
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- if size < libc.Uint32FromInt64(4)/libc.Uint32FromInt32(2) { /* Pointers must fit into 2 * size. */
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return -int32(1)
- }
- if nmemb == uint32(0) {
- return 0
- }
- /*
- * XXX
- * Stupid subtraction for the Cray.
- */
- iflag = 0
- if !(size%libc.Uint32FromInt64(4) != 0) && !(libc.Uint32FromInt32(int32(base)-int32(libc.UintptrFromInt32(0)))%libc.Uint32FromInt64(4) != 0) {
- iflag = int32(1)
- }
- v1 = libc.Xmalloc(tls, nmemb*size+uint32(4))
- list2 = v1
- if v1 == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- list1 = base
- _setup(tls, list1, list2, nmemb, size, cmp)
- last = list2 + uintptr(nmemb*size)
- v2 = libc.Int32FromInt32(0)
- big = v2
- i = libc.Uint32FromInt32(v2)
- 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 {
- l2 = list1
- 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)))
- v4 = list2
- p2 = v4
- tp2 = v4
- for {
- if !(p2 != last) {
- break
- }
- 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)))))
- f1 = l2
- v5 = list1 + uintptr(int32(p2)-int32(list2))
- l1 = v5
- f2 = v5
- if p2 != last {
- 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)))))
- }
- l2 = list1 + uintptr(int32(p2)-int32(list2))
- for f1 < l1 && f2 < l2 {
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, f1, f2) <= 0 {
- q = f2
- b = f1
- t = l1
- sense = -int32(1)
- } else {
- q = f1
- b = f2
- t = l2
- sense = 0
- }
- if !!(big != 0) {
- goto _6
- } /* here i = 0 */
- for {
- b += uintptr(size)
- if !(b < t && (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, q, b) > sense) {
- break
- }
- i++
- v8 = i
- if v8 == uint32(6) {
- big = int32(1)
- goto EXPONENTIAL
- }
- }
- goto _7
- _6:
- ;
- goto EXPONENTIAL
- EXPONENTIAL:
- ;
- i = size
- for {
- v10 = b + uintptr(i)
- p = v10
- if v10 >= t {
- v11 = t - uintptr(size)
- p = v11
- if v11 > b && (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, q, p) <= sense {
- t = p
- } else {
- b = p
- }
- break
- } else {
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, q, p) <= sense {
- t = p
- if i == size {
- big = 0
- }
- goto FASTCASE
- } else {
- b = p
- }
- }
- goto _9
- _9:
- ;
- i <<= uint32(1)
- }
- for t > b+uintptr(size) {
- i = libc.Uint32FromInt32(int32(t)-int32(b)) / size >> int32(1) * size
- v12 = b + uintptr(i)
- p = v12
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, q, v12) <= sense {
- t = p
- } else {
- b = p
- }
- }
- goto COPY
- goto FASTCASE
- FASTCASE:
- ;
- for i > size {
- i >>= uint32(1)
- v13 = b + uintptr(i)
- p = v13
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, q, v13) <= sense {
- t = p
- } else {
- b = p
- }
- }
- goto COPY
- COPY:
- ;
- b = t
- _7:
- ;
- i = size
- if q == f1 {
- if iflag != 0 {
- for cond := true; cond; cond = f2 < b {
- *(*int32)(unsafe.Pointer(tp2)) = *(*int32)(unsafe.Pointer(f2))
- f2 += uintptr(4)
- tp2 += uintptr(4)
- }
- for {
- *(*int32)(unsafe.Pointer(tp2)) = *(*int32)(unsafe.Pointer(f1))
- f1 += uintptr(4)
- tp2 += uintptr(4)
- goto _14
- _14:
- ;
- i -= uint32(4)
- if !(i != 0) {
- break
- }
- }
- } else {
- for cond := true; cond; cond = f2 < b {
- v15 = tp2
- tp2++
- v16 = f2
- f2++
- *(*uint8)(unsafe.Pointer(v15)) = *(*uint8)(unsafe.Pointer(v16))
- }
- for {
- v18 = tp2
- tp2++
- v19 = f1
- f1++
- *(*uint8)(unsafe.Pointer(v18)) = *(*uint8)(unsafe.Pointer(v19))
- goto _17
- _17:
- ;
- i -= uint32(1)
- if !(i != 0) {
- break
- }
- }
- }
- } else {
- if iflag != 0 {
- for cond := true; cond; cond = f1 < b {
- *(*int32)(unsafe.Pointer(tp2)) = *(*int32)(unsafe.Pointer(f1))
- f1 += uintptr(4)
- tp2 += uintptr(4)
- }
- for {
- *(*int32)(unsafe.Pointer(tp2)) = *(*int32)(unsafe.Pointer(f2))
- f2 += uintptr(4)
- tp2 += uintptr(4)
- goto _20
- _20:
- ;
- i -= uint32(4)
- if !(i != 0) {
- break
- }
- }
- } else {
- for cond := true; cond; cond = f1 < b {
- v21 = tp2
- tp2++
- v22 = f1
- f1++
- *(*uint8)(unsafe.Pointer(v21)) = *(*uint8)(unsafe.Pointer(v22))
- }
- for {
- v24 = tp2
- tp2++
- v25 = f2
- f2++
- *(*uint8)(unsafe.Pointer(v24)) = *(*uint8)(unsafe.Pointer(v25))
- goto _23
- _23:
- ;
- i -= uint32(1)
- if !(i != 0) {
- break
- }
- }
- }
- }
- }
- if f2 < l2 {
- if iflag != 0 {
- for cond := true; cond; cond = f2 < l2 {
- *(*int32)(unsafe.Pointer(tp2)) = *(*int32)(unsafe.Pointer(f2))
- f2 += uintptr(4)
- tp2 += uintptr(4)
- }
- } else {
- for cond := true; cond; cond = f2 < l2 {
- v26 = tp2
- tp2++
- v27 = f2
- f2++
- *(*uint8)(unsafe.Pointer(v26)) = *(*uint8)(unsafe.Pointer(v27))
- }
- }
- } else {
- if f1 < l1 {
- if iflag != 0 {
- for cond := true; cond; cond = f1 < l1 {
- *(*int32)(unsafe.Pointer(tp2)) = *(*int32)(unsafe.Pointer(f1))
- f1 += uintptr(4)
- tp2 += uintptr(4)
- }
- } else {
- for cond := true; cond; cond = f1 < l1 {
- v28 = tp2
- tp2++
- v29 = f1
- f1++
- *(*uint8)(unsafe.Pointer(v28)) = *(*uint8)(unsafe.Pointer(v29))
- }
- }
- }
- }
- *(*uintptr)(unsafe.Pointer(p1)) = l2
- goto _3
- _3:
- ;
- 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)))
- }
- tp2 = list1 /* swap list1, list2 */
- list1 = list2
- list2 = tp2
- last = list2 + uintptr(nmemb*size)
- }
- if base == list2 {
- libc.Xmemmove(tls, list2, list1, nmemb*size)
- list2 = list1
- }
- libc.Xfree(tls, list2)
- return 0
- }
- // C documentation
- //
- // /*
- // * Optional hybrid natural/pairwise first pass. Eats up list1 in runs of
- // * increasing order, list2 in a corresponding linked list. Checks for runs
- // * when THRESHOLD/2 pairs compare with same sense. (Only used when NATURAL
- // * is defined. Otherwise simple pairwise merging is used.)
- // */
- func _setup(tls *libc.TLS, list1 uintptr, list2 uintptr, n Tsize_t, size Tsize_t, cmp uintptr) {
- var f1, f2, l2, last, p2, s, v10, v13, v14, v17, v18, v19, v20, v4, v7, v8 uintptr
- var i, length, sense, size2, tmp, v11, v15, v5 int32
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = f1, f2, i, l2, last, length, p2, s, sense, size2, tmp, v10, v11, v13, v14, v15, v17, v18, v19, v20, v4, v5, v7, v8
- size2 = libc.Int32FromUint32(size * uint32(2))
- if n <= uint32(5) {
- _insertionsort(tls, list1, n, size, cmp)
- *(*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)
- return
- }
- /*
- * Avoid running pointers out of bounds; limit n to evens
- * for simplicity.
- */
- i = libc.Int32FromUint32(uint32(4) + n&uint32(1))
- _insertionsort(tls, list1+uintptr((n-libc.Uint32FromInt32(i))*size), libc.Uint32FromInt32(i), size, cmp)
- last = list1 + uintptr(size*(n-libc.Uint32FromInt32(i)))
- *(*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)
- p2 = list2
- f1 = list1
- sense = libc.BoolInt32((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, f1, f1+uintptr(size)) > 0)
- for {
- if !(f1 < last) {
- break
- }
- length = int32(2)
- /* Find pairs with same sense. */
- f2 = f1 + uintptr(size2)
- for {
- if !(f2 < last) {
- break
- }
- if libc.BoolInt32((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, f2, f2+uintptr(size)) > 0) != sense {
- break
- }
- length += int32(2)
- goto _2
- _2:
- ;
- f2 += uintptr(size2)
- }
- if length < int32(m_THRESHOLD) { /* Pairwise merge */
- for {
- v4 = uintptr(int32(f1+uintptr(size2))-int32(list1)) + list2
- *(*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
- p2 = v4
- if sense > 0 {
- s = f1 + uintptr(size)
- i = libc.Int32FromUint32(size)
- for {
- tmp = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(f1)))
- v7 = f1
- f1++
- *(*uint8)(unsafe.Pointer(v7)) = *(*uint8)(unsafe.Pointer(s))
- v8 = s
- s++
- *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(tmp)
- goto _6
- _6:
- ;
- i--
- v5 = i
- if !(v5 != 0) {
- break
- }
- }
- f1 -= uintptr(size)
- }
- goto _3
- _3:
- ;
- f1 += uintptr(size2)
- if !(f1 < f2) {
- break
- }
- }
- } else { /* Natural merge */
- l2 = f2
- f2 = f1 + uintptr(size2)
- for {
- if !(f2 < l2) {
- break
- }
- if libc.BoolInt32((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, f2-uintptr(size), f2) > 0) != sense {
- v10 = uintptr(int32(f2)-int32(list1)) + list2
- *(*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
- p2 = v10
- if sense > 0 {
- s = f2 - uintptr(size)
- for cond := true; cond; cond = f1 < s {
- i = libc.Int32FromUint32(size)
- for {
- tmp = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(f1)))
- v13 = f1
- f1++
- *(*uint8)(unsafe.Pointer(v13)) = *(*uint8)(unsafe.Pointer(s))
- v14 = s
- s++
- *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(tmp)
- goto _12
- _12:
- ;
- i--
- v11 = i
- if !(v11 != 0) {
- break
- }
- }
- s -= uintptr(size2)
- }
- }
- f1 = f2
- }
- goto _9
- _9:
- ;
- f2 += uintptr(size2)
- }
- if sense > 0 {
- s = f2 - uintptr(size)
- for cond := true; cond; cond = f1 < s {
- i = libc.Int32FromUint32(size)
- for {
- tmp = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(f1)))
- v17 = f1
- f1++
- *(*uint8)(unsafe.Pointer(v17)) = *(*uint8)(unsafe.Pointer(s))
- v18 = s
- s++
- *(*uint8)(unsafe.Pointer(v18)) = libc.Uint8FromInt32(tmp)
- goto _16
- _16:
- ;
- i--
- v15 = i
- if !(v15 != 0) {
- break
- }
- }
- s -= uintptr(size2)
- }
- }
- f1 = f2
- if f2 < last || (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, f2-uintptr(size), f2) > 0 {
- v19 = uintptr(int32(f2)-int32(list1)) + list2
- *(*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
- p2 = v19
- } else {
- v20 = list2 + uintptr(n*size)
- *(*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
- p2 = v20
- }
- }
- goto _1
- _1:
- ;
- sense = libc.BoolInt32(!(sense != 0))
- }
- }
- // C documentation
- //
- // /*
- // * This is to avoid out-of-bounds addresses in sorting the
- // * last 4 elements.
- // */
- func _insertionsort(tls *libc.TLS, a uintptr, n Tsize_t, size Tsize_t, cmp uintptr) {
- var ai, s, t, u, v6, v7 uintptr
- var i, v4 int32
- var tmp uint8
- var v2 Tsize_t
- _, _, _, _, _, _, _, _, _, _ = ai, i, s, t, tmp, u, v2, v4, v6, v7
- ai = a + uintptr(size)
- for {
- n--
- v2 = n
- if !(v2 >= uint32(1)) {
- break
- }
- t = ai
- for {
- if !(t > a) {
- break
- }
- u = t - uintptr(size)
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, u, t) <= 0 {
- break
- }
- s = t
- i = libc.Int32FromUint32(size)
- for {
- tmp = *(*uint8)(unsafe.Pointer(u))
- v6 = u
- u++
- *(*uint8)(unsafe.Pointer(v6)) = *(*uint8)(unsafe.Pointer(s))
- v7 = s
- s++
- *(*uint8)(unsafe.Pointer(v7)) = tmp
- goto _5
- _5:
- ;
- i--
- v4 = i
- if !(v4 != 0) {
- break
- }
- }
- u -= uintptr(size)
- goto _3
- _3:
- ;
- t -= uintptr(size)
- }
- goto _1
- _1:
- ;
- ai += uintptr(size)
- }
- }
- const m_AT_BASE = 7
- const m_AT_BASE_PLATFORM = 24
- const m_AT_CLKTCK = 17
- const m_AT_DCACHEBSIZE = 19
- const m_AT_EGID = 14
- const m_AT_ENTRY = 9
- const m_AT_EUID = 12
- const m_AT_EXECFD = 2
- const m_AT_EXECFN = 31
- const m_AT_FLAGS = 8
- const m_AT_FPUCW = 18
- const m_AT_GID = 13
- const m_AT_HWCAP = 16
- const m_AT_HWCAP2 = 26
- const m_AT_ICACHEBSIZE = 20
- const m_AT_IGNORE = 1
- const m_AT_IGNOREPPC = 22
- const m_AT_L1D_CACHEGEOMETRY = 43
- const m_AT_L1D_CACHESHAPE = 35
- const m_AT_L1D_CACHESIZE = 42
- const m_AT_L1I_CACHEGEOMETRY = 41
- const m_AT_L1I_CACHESHAPE = 34
- const m_AT_L1I_CACHESIZE = 40
- const m_AT_L2_CACHEGEOMETRY = 45
- const m_AT_L2_CACHESHAPE = 36
- const m_AT_L2_CACHESIZE = 44
- const m_AT_L3_CACHEGEOMETRY = 47
- const m_AT_L3_CACHESHAPE = 37
- const m_AT_L3_CACHESIZE = 46
- const m_AT_MINSIGSTKSZ = 51
- const m_AT_NOTELF = 10
- const m_AT_NULL = 0
- const m_AT_PAGESZ = 6
- const m_AT_PHDR = 3
- const m_AT_PHENT = 4
- const m_AT_PHNUM = 5
- const m_AT_PLATFORM = 15
- const m_AT_RANDOM = 25
- const m_AT_SECURE = 23
- const m_AT_SYSINFO = 32
- const m_AT_SYSINFO_EHDR = 33
- const m_AT_UCACHEBSIZE = 21
- const m_AT_UID = 11
- const m_AUX_FUNC = 2
- const m_AUX_OBJECT = 1
- const m_BIND_WEAK = 2
- const m_DF_1_CONFALT = 0x00002000
- const m_DF_1_DIRECT = 0x00000100
- const m_DF_1_DISPRELDNE = 0x00008000
- const m_DF_1_DISPRELPND = 0x00010000
- const m_DF_1_EDITED = 0x00200000
- const m_DF_1_ENDFILTEE = 0x00004000
- const m_DF_1_GLOBAL = 0x00000002
- const m_DF_1_GLOBAUDIT = 0x01000000
- const m_DF_1_GROUP = 0x00000004
- const m_DF_1_IGNMULDEF = 0x00040000
- const m_DF_1_INITFIRST = 0x00000020
- const m_DF_1_INTERPOSE = 0x00000400
- const m_DF_1_LOADFLTR = 0x00000010
- const m_DF_1_NODEFLIB = 0x00000800
- const m_DF_1_NODELETE = 0x00000008
- const m_DF_1_NODIRECT = 0x00020000
- const m_DF_1_NODUMP = 0x00001000
- const m_DF_1_NOHDR = 0x00100000
- const m_DF_1_NOKSYMS = 0x00080000
- const m_DF_1_NOOPEN = 0x00000040
- const m_DF_1_NORELOC = 0x00400000
- const m_DF_1_NOW = 0x00000001
- const m_DF_1_ORIGIN = 0x00000080
- const m_DF_1_PIE = 0x08000000
- const m_DF_1_SINGLETON = 0x02000000
- const m_DF_1_STUB = 0x04000000
- const m_DF_1_SYMINTPOSE = 0x00800000
- const m_DF_1_TRANS = 0x00000200
- const m_DF_BIND_NOW = 0x00000008
- const m_DF_ORIGIN = 0x00000001
- const m_DF_P1_GROUPPERM = 0x00000002
- const m_DF_P1_LAZYLOAD = 0x00000001
- const m_DF_STATIC_TLS = 0x00000010
- const m_DF_SYMBOLIC = 0x00000002
- const m_DF_TEXTREL = 0x00000004
- const m_DTF_1_CONFEXP = 0x00000002
- const m_DTF_1_PARINIT = 0x00000001
- const m_DT_ADDRNUM = 11
- const m_DT_ADDRRNGHI = 0x6ffffeff
- const m_DT_ADDRRNGLO = 0x6ffffe00
- const m_DT_ALPHA_NUM = 1
- const m_DT_AUDIT = 0x6ffffefc
- const m_DT_AUXILIARY = 0x7ffffffd
- const m_DT_BIND_NOW = 24
- const m_DT_CHECKSUM = 0x6ffffdf8
- const m_DT_CONFIG = 0x6ffffefa
- const m_DT_DEBUG = 21
- const m_DT_DEPAUDIT = 0x6ffffefb
- const m_DT_ENCODING = 32
- const m_DT_EXTRANUM = 3
- const m_DT_FEATURE_1 = 0x6ffffdfc
- const m_DT_FILTER = 0x7fffffff
- const m_DT_FINI = 13
- const m_DT_FINI_ARRAY = 26
- const m_DT_FINI_ARRAYSZ = 28
- const m_DT_FLAGS = 30
- const m_DT_FLAGS_1 = 0x6ffffffb
- const m_DT_GNU_CONFLICT = 0x6ffffef8
- const m_DT_GNU_CONFLICTSZ = 0x6ffffdf6
- const m_DT_GNU_HASH = 0x6ffffef5
- const m_DT_GNU_LIBLIST = 0x6ffffef9
- const m_DT_GNU_LIBLISTSZ = 0x6ffffdf7
- const m_DT_GNU_PRELINKED = 0x6ffffdf5
- const m_DT_HASH = 4
- const m_DT_HIOS = 0x6ffff000
- const m_DT_HIPROC = 0x7fffffff
- const m_DT_IA_64_NUM = 1
- const m_DT_INIT = 12
- const m_DT_INIT_ARRAY = 25
- const m_DT_INIT_ARRAYSZ = 27
- const m_DT_JMPREL = 23
- const m_DT_LOOS = 0x6000000d
- const m_DT_LOPROC = 0x70000000
- const m_DT_MIPS_AUX_DYNAMIC = 0x70000031
- const m_DT_MIPS_BASE_ADDRESS = 0x70000006
- const m_DT_MIPS_COMPACT_SIZE = 0x7000002f
- const m_DT_MIPS_CONFLICT = 0x70000008
- const m_DT_MIPS_CONFLICTNO = 0x7000000b
- const m_DT_MIPS_CXX_FLAGS = 0x70000022
- const m_DT_MIPS_DELTA_CLASS = 0x70000017
- const m_DT_MIPS_DELTA_CLASSSYM = 0x70000020
- const m_DT_MIPS_DELTA_CLASSSYM_NO = 0x70000021
- const m_DT_MIPS_DELTA_CLASS_NO = 0x70000018
- const m_DT_MIPS_DELTA_INSTANCE = 0x70000019
- const m_DT_MIPS_DELTA_INSTANCE_NO = 0x7000001a
- const m_DT_MIPS_DELTA_RELOC = 0x7000001b
- const m_DT_MIPS_DELTA_RELOC_NO = 0x7000001c
- const m_DT_MIPS_DELTA_SYM = 0x7000001d
- const m_DT_MIPS_DELTA_SYM_NO = 0x7000001e
- const m_DT_MIPS_DYNSTR_ALIGN = 0x7000002b
- const m_DT_MIPS_FLAGS = 0x70000005
- const m_DT_MIPS_GOTSYM = 0x70000013
- const m_DT_MIPS_GP_VALUE = 0x70000030
- const m_DT_MIPS_HIDDEN_GOTIDX = 0x70000027
- const m_DT_MIPS_HIPAGENO = 0x70000014
- const m_DT_MIPS_ICHECKSUM = 0x70000003
- const m_DT_MIPS_INTERFACE = 0x7000002a
- const m_DT_MIPS_INTERFACE_SIZE = 0x7000002c
- const m_DT_MIPS_IVERSION = 0x70000004
- const m_DT_MIPS_LIBLIST = 0x70000009
- const m_DT_MIPS_LIBLISTNO = 0x70000010
- const m_DT_MIPS_LOCALPAGE_GOTIDX = 0x70000025
- const m_DT_MIPS_LOCAL_GOTIDX = 0x70000026
- const m_DT_MIPS_LOCAL_GOTNO = 0x7000000a
- const m_DT_MIPS_MSYM = 0x70000007
- const m_DT_MIPS_NUM = 0x36
- const m_DT_MIPS_OPTIONS = 0x70000029
- const m_DT_MIPS_PERF_SUFFIX = 0x7000002e
- const m_DT_MIPS_PIXIE_INIT = 0x70000023
- const m_DT_MIPS_PLTGOT = 0x70000032
- const m_DT_MIPS_PROTECTED_GOTIDX = 0x70000028
- const m_DT_MIPS_RLD_MAP = 0x70000016
- const m_DT_MIPS_RLD_MAP_REL = 0x70000035
- const m_DT_MIPS_RLD_TEXT_RESOLVE_ADDR = 0x7000002d
- const m_DT_MIPS_RLD_VERSION = 0x70000001
- const m_DT_MIPS_RWPLT = 0x70000034
- const m_DT_MIPS_SYMBOL_LIB = 0x70000024
- const m_DT_MIPS_SYMTABNO = 0x70000011
- const m_DT_MIPS_TIME_STAMP = 0x70000002
- const m_DT_MIPS_UNREFEXTNO = 0x70000012
- const m_DT_MOVEENT = 0x6ffffdfa
- const m_DT_MOVESZ = 0x6ffffdfb
- const m_DT_MOVETAB = 0x6ffffefe
- const m_DT_NEEDED = 1
- const m_DT_NIOS2_GP = 0x70000002
- const m_DT_NULL = 0
- const m_DT_NUM = 38
- const m_DT_PLTGOT = 3
- const m_DT_PLTPAD = 0x6ffffefd
- const m_DT_PLTPADSZ = 0x6ffffdf9
- const m_DT_PLTREL = 20
- const m_DT_PLTRELSZ = 2
- const m_DT_POSFLAG_1 = 0x6ffffdfd
- const m_DT_PPC64_NUM = 4
- const m_DT_PPC_NUM = 2
- const m_DT_PREINIT_ARRAY = 32
- const m_DT_PREINIT_ARRAYSZ = 33
- const m_DT_PROCNUM = "DT_MIPS_NUM"
- const m_DT_REL = 17
- const m_DT_RELA = 7
- const m_DT_RELACOUNT = 0x6ffffff9
- const m_DT_RELAENT = 9
- const m_DT_RELASZ = 8
- const m_DT_RELCOUNT = 0x6ffffffa
- const m_DT_RELENT = 19
- const m_DT_RELR = 36
- const m_DT_RELRENT = 37
- const m_DT_RELRSZ = 35
- const m_DT_RELSZ = 18
- const m_DT_RPATH = 15
- const m_DT_RUNPATH = 29
- const m_DT_SONAME = 14
- const m_DT_SPARC_NUM = 2
- const m_DT_SPARC_REGISTER = 0x70000001
- const m_DT_STRSZ = 10
- const m_DT_STRTAB = 5
- const m_DT_SYMBOLIC = 16
- const m_DT_SYMENT = 11
- const m_DT_SYMINENT = 0x6ffffdff
- const m_DT_SYMINFO = 0x6ffffeff
- const m_DT_SYMINSZ = 0x6ffffdfe
- const m_DT_SYMTAB = 6
- const m_DT_SYMTAB_SHNDX = 34
- const m_DT_TEXTREL = 22
- const m_DT_TLSDESC_GOT = 0x6ffffef7
- const m_DT_TLSDESC_PLT = 0x6ffffef6
- const m_DT_VALNUM = 12
- const m_DT_VALRNGHI = 0x6ffffdff
- const m_DT_VALRNGLO = 0x6ffffd00
- const m_DT_VERDEF = 0x6ffffffc
- const m_DT_VERDEFNUM = 0x6ffffffd
- const m_DT_VERNEED = 0x6ffffffe
- const m_DT_VERNEEDNUM = 0x6fffffff
- const m_DT_VERSIONTAGNUM = 16
- const m_DT_VERSYM = 0x6ffffff0
- const m_EFA_PARISC_1_0 = 0x020b
- const m_EFA_PARISC_1_1 = 0x0210
- const m_EFA_PARISC_2_0 = 0x0214
- const m_EF_ALPHA_32BIT = 1
- const m_EF_ALPHA_CANRELAX = 2
- const m_EF_ARM_ABI_FLOAT_HARD = 0x400
- const m_EF_ARM_ABI_FLOAT_SOFT = 0x200
- const m_EF_ARM_ALIGN8 = 0x40
- const m_EF_ARM_APCS_26 = 0x08
- const m_EF_ARM_APCS_FLOAT = 0x10
- const m_EF_ARM_BE8 = 0x00800000
- const m_EF_ARM_DYNSYMSUSESEGIDX = 0x08
- const m_EF_ARM_EABIMASK = 0xFF000000
- const m_EF_ARM_EABI_UNKNOWN = 0x00000000
- const m_EF_ARM_EABI_VER1 = 0x01000000
- const m_EF_ARM_EABI_VER2 = 0x02000000
- const m_EF_ARM_EABI_VER3 = 0x03000000
- const m_EF_ARM_EABI_VER4 = 0x04000000
- const m_EF_ARM_EABI_VER5 = 0x05000000
- const m_EF_ARM_HASENTRY = 0x02
- const m_EF_ARM_INTERWORK = 0x04
- const m_EF_ARM_LE8 = 0x00400000
- const m_EF_ARM_MAPSYMSFIRST = 0x10
- const m_EF_ARM_MAVERICK_FLOAT = 0x800
- const m_EF_ARM_NEW_ABI = 0x80
- const m_EF_ARM_OLD_ABI = 0x100
- const m_EF_ARM_PIC = 0x20
- const m_EF_ARM_RELEXEC = 0x01
- const m_EF_ARM_SOFT_FLOAT = 0x200
- const m_EF_ARM_SYMSARESORTED = 0x04
- const m_EF_ARM_VFP_FLOAT = 0x400
- const m_EF_CPU32 = 0x00810000
- const m_EF_IA_64_ABI64 = 0x00000010
- const m_EF_IA_64_ARCH = 0xff000000
- const m_EF_IA_64_MASKOS = 0x0000000f
- const m_EF_LARCH_ABI_DOUBLE_FLOAT = 0x03
- const m_EF_LARCH_ABI_MODIFIER_MASK = 0x07
- const m_EF_LARCH_ABI_SINGLE_FLOAT = 0x02
- const m_EF_LARCH_ABI_SOFT_FLOAT = 0x01
- const m_EF_LARCH_OBJABI_V1 = 0x40
- const m_EF_MIPS_64BIT_WHIRL = 16
- const m_EF_MIPS_ABI2 = 32
- const m_EF_MIPS_ABI_ON32 = 64
- const m_EF_MIPS_ARCH = 0xf0000000
- const m_EF_MIPS_ARCH_1 = 0x00000000
- const m_EF_MIPS_ARCH_2 = 0x10000000
- const m_EF_MIPS_ARCH_3 = 0x20000000
- const m_EF_MIPS_ARCH_32 = 0x50000000
- const m_EF_MIPS_ARCH_32R2 = 0x70000000
- const m_EF_MIPS_ARCH_4 = 0x30000000
- const m_EF_MIPS_ARCH_5 = 0x40000000
- const m_EF_MIPS_ARCH_64 = 0x60000000
- const m_EF_MIPS_ARCH_64R2 = 0x80000000
- const m_EF_MIPS_CPIC = 4
- const m_EF_MIPS_FP64 = 512
- const m_EF_MIPS_NAN2008 = 1024
- const m_EF_MIPS_NOREORDER = 1
- const m_EF_MIPS_PIC = 2
- const m_EF_MIPS_XGOT = 8
- const m_EF_PARISC_ARCH = 0x0000ffff
- const m_EF_PARISC_EXT = 0x00020000
- const m_EF_PARISC_LAZYSWAP = 0x00400000
- const m_EF_PARISC_LSB = 0x00040000
- const m_EF_PARISC_NO_KABP = 0x00100000
- const m_EF_PARISC_TRAPNIL = 0x00010000
- const m_EF_PARISC_WIDE = 0x00080000
- const m_EF_PPC64_ABI = 3
- const m_EF_PPC_EMB = 0x80000000
- const m_EF_PPC_RELOCATABLE = 0x00010000
- const m_EF_PPC_RELOCATABLE_LIB = 0x00008000
- const m_EF_SH1 = 0x1
- const m_EF_SH2 = 0x2
- const m_EF_SH2A = 0xd
- const m_EF_SH2A_NOFPU = 0x13
- const m_EF_SH2A_SH3E = 0x18
- const m_EF_SH2A_SH3_NOFPU = 0x16
- const m_EF_SH2A_SH4 = 0x17
- const m_EF_SH2A_SH4_NOFPU = 0x15
- const m_EF_SH2E = 0xb
- const m_EF_SH3 = 0x3
- const m_EF_SH3E = 0x8
- const m_EF_SH3_DSP = 0x5
- const m_EF_SH3_NOMMU = 0x14
- const m_EF_SH4 = 0x9
- const m_EF_SH4A = 0xc
- const m_EF_SH4AL_DSP = 0x6
- const m_EF_SH4A_NOFPU = 0x11
- const m_EF_SH4_NOFPU = 0x10
- const m_EF_SH4_NOMMU_NOFPU = 0x12
- const m_EF_SH_DSP = 0x4
- const m_EF_SH_MACH_MASK = 0x1f
- const m_EF_SH_UNKNOWN = 0x0
- const m_EF_SPARCV9_MM = 3
- const m_EF_SPARCV9_PSO = 1
- const m_EF_SPARCV9_RMO = 2
- const m_EF_SPARCV9_TSO = 0
- const m_EF_SPARC_32PLUS = 0x000100
- const m_EF_SPARC_EXT_MASK = 0xFFFF00
- const m_EF_SPARC_HAL_R1 = 0x000400
- const m_EF_SPARC_LEDATA = 0x800000
- const m_EF_SPARC_SUN_US1 = 0x000200
- const m_EF_SPARC_SUN_US3 = 0x000800
- const m_EI_ABIVERSION = 8
- const m_EI_CLASS = 4
- const m_EI_DATA = 5
- const m_EI_MAG0 = 0
- const m_EI_MAG1 = 1
- const m_EI_MAG2 = 2
- const m_EI_MAG3 = 3
- const m_EI_NIDENT = 16
- const m_EI_OSABI = 7
- const m_EI_PAD = 9
- const m_EI_VERSION = 6
- const m_ELFCLASS32 = 1
- const m_ELFCLASS64 = 2
- const m_ELFCLASSNONE = 0
- const m_ELFCLASSNUM = 3
- const m_ELFCOMPRESS_HIOS = 0x6fffffff
- const m_ELFCOMPRESS_HIPROC = 0x7fffffff
- const m_ELFCOMPRESS_LOOS = 0x60000000
- const m_ELFCOMPRESS_LOPROC = 0x70000000
- const m_ELFCOMPRESS_ZLIB = 1
- const m_ELFCOMPRESS_ZSTD = 2
- const m_ELFDATA2LSB = 1
- const m_ELFDATA2MSB = 2
- const m_ELFDATANONE = 0
- const m_ELFDATANUM = 3
- const m_ELFMAG = "\\177ELF"
- const m_ELFMAG0 = 127
- const m_ELFMAG1 = 69
- const m_ELFMAG2 = 76
- const m_ELFMAG3 = 70
- const m_ELFOSABI_AIX = 7
- const m_ELFOSABI_ARM = 97
- const m_ELFOSABI_FREEBSD = 9
- const m_ELFOSABI_GNU = 3
- const m_ELFOSABI_HPUX = 1
- const m_ELFOSABI_IRIX = 8
- const m_ELFOSABI_LINUX = 3
- const m_ELFOSABI_MODESTO = 11
- const m_ELFOSABI_NETBSD = 2
- const m_ELFOSABI_NONE = 0
- const m_ELFOSABI_OPENBSD = 12
- const m_ELFOSABI_SOLARIS = 6
- const m_ELFOSABI_STANDALONE = 255
- const m_ELFOSABI_SYSV = 0
- const m_ELFOSABI_TRU64 = 10
- const m_ELF_NOTE_ABI = "NT_GNU_ABI_TAG"
- const m_ELF_NOTE_GNU = "GNU"
- const m_ELF_NOTE_OS_FREEBSD = 3
- const m_ELF_NOTE_OS_GNU = 1
- const m_ELF_NOTE_OS_LINUX = 0
- const m_ELF_NOTE_OS_SOLARIS2 = 2
- const m_ELF_NOTE_PAGESIZE_HINT = 1
- const m_ELF_NOTE_SOLARIS = "SUNW Solaris"
- const m_ELF_ST_BIND = "ELF32_ST_BIND"
- const m_ELF_ST_TYPE = "ELF32_ST_TYPE"
- const m_ELF_TARG_CLASS = "ELFCLASS32"
- const m_ELF_TARG_DATA = "ELFDATA2LSB"
- const m_ELF_TARG_MACH = "EM_386"
- const m_ELF_TARG_VER = "EV_CURRENT"
- const m_EM_386 = 3
- const m_EM_56800EX = 200
- const m_EM_68HC05 = 72
- const m_EM_68HC08 = 71
- const m_EM_68HC11 = 70
- const m_EM_68HC12 = 53
- const m_EM_68HC16 = 69
- const m_EM_68K = 4
- const m_EM_78KOR = 199
- const m_EM_8051 = 165
- const m_EM_860 = 7
- const m_EM_88K = 5
- const m_EM_960 = 19
- const m_EM_AARCH64 = 183
- const m_EM_ALPHA = 0x9026
- const m_EM_ALTERA_NIOS2 = 113
- const m_EM_AMDGPU = 224
- const m_EM_ARC = 45
- const m_EM_ARCA = 109
- const m_EM_ARC_A5 = 93
- const m_EM_ARC_COMPACT = 93
- const m_EM_ARC_COMPACT2 = 195
- const m_EM_ARM = 40
- const m_EM_AVR = 83
- const m_EM_AVR32 = 185
- const m_EM_BA1 = 201
- const m_EM_BA2 = 202
- const m_EM_BLACKFIN = 106
- const m_EM_BPF = 247
- const m_EM_C166 = 116
- const m_EM_CDP = 215
- const m_EM_CE = 119
- const m_EM_CLOUDSHIELD = 192
- const m_EM_COGE = 216
- const m_EM_COLDFIRE = 52
- const m_EM_COOL = 217
- const m_EM_COREA_1ST = 193
- const m_EM_COREA_2ND = 194
- const m_EM_CR = 103
- const m_EM_CR16 = 177
- const m_EM_CRAYNV2 = 172
- const m_EM_CRIS = 76
- const m_EM_CRX = 114
- const m_EM_CSKY = 252
- const m_EM_CSR_KALIMBA = 219
- const m_EM_CUDA = 190
- const m_EM_CYPRESS_M8C = 161
- const m_EM_D10V = 85
- const m_EM_D30V = 86
- const m_EM_DSP24 = 136
- const m_EM_DSPIC30F = 118
- const m_EM_DXP = 112
- const m_EM_ECOG16 = 176
- const m_EM_ECOG1X = 168
- const m_EM_ECOG2 = 134
- const m_EM_EMX16 = 212
- const m_EM_EMX8 = 213
- const m_EM_ETPU = 178
- const m_EM_EXCESS = 111
- const m_EM_F2MC16 = 104
- const m_EM_FAKE_ALPHA = 41
- const m_EM_FIREPATH = 78
- const m_EM_FR20 = 37
- const m_EM_FR30 = 84
- const m_EM_FT32 = 222
- const m_EM_FX66 = 66
- const m_EM_H8S = 48
- const m_EM_H8_300 = 46
- const m_EM_H8_300H = 47
- const m_EM_H8_500 = 49
- const m_EM_HUANY = 81
- const m_EM_IA_64 = 50
- const m_EM_IP2K = 101
- const m_EM_JAVELIN = 77
- const m_EM_K10M = 181
- const m_EM_KM32 = 210
- const m_EM_KMX32 = 211
- const m_EM_KVARC = 214
- const m_EM_L10M = 180
- const m_EM_LATTICEMICO32 = 138
- const m_EM_LOONGARCH = 258
- const m_EM_M16C = 117
- const m_EM_M32 = 1
- const m_EM_M32C = 120
- const m_EM_M32R = 88
- const m_EM_MANIK = 171
- const m_EM_MAX = 102
- const m_EM_MAXQ30 = 169
- const m_EM_MCHP_PIC = 204
- const m_EM_MCST_ELBRUS = 175
- const m_EM_ME16 = 59
- const m_EM_METAG = 174
- const m_EM_MICROBLAZE = 189
- const m_EM_MIPS = 8
- const m_EM_MIPS_RS3_LE = 10
- const m_EM_MIPS_X = 51
- const m_EM_MMA = 54
- const m_EM_MMDSP_PLUS = 160
- const m_EM_MMIX = 80
- const m_EM_MN10200 = 90
- const m_EM_MN10300 = 89
- const m_EM_MOXIE = 223
- const m_EM_MSP430 = 105
- const m_EM_NCPU = 56
- const m_EM_NDR1 = 57
- const m_EM_NDS32 = 167
- const m_EM_NONE = 0
- const m_EM_NORC = 218
- const m_EM_NS32K = 97
- const m_EM_NUM = 259
- const m_EM_OPEN8 = 196
- const m_EM_OPENRISC = 92
- const m_EM_OR1K = 92
- const m_EM_PARISC = 15
- const m_EM_PCP = 55
- const m_EM_PDSP = 63
- const m_EM_PJ = 91
- const m_EM_PPC = 20
- const m_EM_PPC64 = 21
- const m_EM_PRISM = 82
- const m_EM_QDSP6 = 164
- const m_EM_R32C = 162
- const m_EM_RCE = 39
- const m_EM_RH32 = 38
- const m_EM_RISCV = 243
- const m_EM_RL78 = 197
- const m_EM_RS08 = 132
- const m_EM_RX = 173
- const m_EM_S370 = 9
- const m_EM_S390 = 22
- const m_EM_SCORE7 = 135
- const m_EM_SEP = 108
- const m_EM_SE_C17 = 139
- const m_EM_SE_C33 = 107
- const m_EM_SH = 42
- const m_EM_SHARC = 133
- const m_EM_SLE9X = 179
- const m_EM_SNP1K = 99
- const m_EM_SPARC = 2
- const m_EM_SPARC32PLUS = 18
- const m_EM_SPARCV9 = 43
- const m_EM_ST100 = 60
- const m_EM_ST19 = 74
- const m_EM_ST200 = 100
- const m_EM_ST7 = 68
- const m_EM_ST9PLUS = 67
- const m_EM_STARCORE = 58
- const m_EM_STM8 = 186
- const m_EM_STXP7X = 166
- const m_EM_SVX = 73
- const m_EM_TILE64 = 187
- const m_EM_TILEGX = 191
- const m_EM_TILEPRO = 188
- const m_EM_TINYJ = 61
- const m_EM_TI_ARP32 = 143
- const m_EM_TI_C2000 = 141
- const m_EM_TI_C5500 = 142
- const m_EM_TI_C6000 = 140
- const m_EM_TI_PRU = 144
- const m_EM_TMM_GPP = 96
- const m_EM_TPC = 98
- const m_EM_TRICORE = 44
- const m_EM_TRIMEDIA = 163
- const m_EM_TSK3000 = 131
- const m_EM_UNICORE = 110
- const m_EM_V800 = 36
- const m_EM_V850 = 87
- const m_EM_VAX = 75
- const m_EM_VIDEOCORE = 95
- const m_EM_VIDEOCORE3 = 137
- const m_EM_VIDEOCORE5 = 198
- const m_EM_VISIUM = 221
- const m_EM_VPP500 = 17
- const m_EM_X86_64 = 62
- const m_EM_XCORE = 203
- const m_EM_XGATE = 115
- const m_EM_XIMO16 = 170
- const m_EM_XTENSA = 94
- const m_EM_Z80 = 220
- const m_EM_ZSP = 79
- const m_ET_CORE = 4
- const m_ET_DYN = 3
- const m_ET_EXEC = 2
- const m_ET_HIOS = 0xfeff
- const m_ET_HIPROC = 0xffff
- const m_ET_LOOS = 0xfe00
- const m_ET_LOPROC = 0xff00
- const m_ET_NONE = 0
- const m_ET_NUM = 5
- const m_ET_REL = 1
- const m_EV_CURRENT = 1
- const m_EV_NONE = 0
- const m_EV_NUM = 2
- const m_E_MIPS_ARCH_1 = 0x00000000
- const m_E_MIPS_ARCH_2 = 0x10000000
- const m_E_MIPS_ARCH_3 = 0x20000000
- const m_E_MIPS_ARCH_32 = 0x50000000
- const m_E_MIPS_ARCH_4 = 0x30000000
- const m_E_MIPS_ARCH_5 = 0x40000000
- const m_E_MIPS_ARCH_64 = 0x60000000
- const m_Elf_Ehdr = "Elf32_Ehdr"
- const m_Elf_Off = "Elf32_Off"
- const m_Elf_Shdr = "Elf32_Shdr"
- const m_Elf_Sword = "Elf32_Sword"
- const m_Elf_Sym = "Elf32_Sym"
- const m_Elf_Word = "Elf32_Word"
- const m_GRP_COMDAT = 0x1
- const m_LITUSE_ALPHA_ADDR = 0
- const m_LITUSE_ALPHA_BASE = 1
- const m_LITUSE_ALPHA_BYTOFF = 2
- const m_LITUSE_ALPHA_JSR = 3
- const m_LITUSE_ALPHA_TLS_GD = 4
- const m_LITUSE_ALPHA_TLS_LDM = 5
- const m_LL_NONE = 0
- const m_MAP_ANON1 = 0x20
- const m_MAP_PRIVATE1 = 0x02
- const m_MIPS_AFL_ASE_DSP = 0x00000001
- const m_MIPS_AFL_ASE_DSPR2 = 0x00000002
- const m_MIPS_AFL_ASE_EVA = 0x00000004
- const m_MIPS_AFL_ASE_MASK = 0x00001fff
- const m_MIPS_AFL_ASE_MCU = 0x00000008
- const m_MIPS_AFL_ASE_MDMX = 0x00000010
- const m_MIPS_AFL_ASE_MICROMIPS = 0x00000800
- const m_MIPS_AFL_ASE_MIPS16 = 0x00000400
- const m_MIPS_AFL_ASE_MIPS3D = 0x00000020
- const m_MIPS_AFL_ASE_MSA = 0x00000200
- const m_MIPS_AFL_ASE_MT = 0x00000040
- const m_MIPS_AFL_ASE_SMARTMIPS = 0x00000080
- const m_MIPS_AFL_ASE_VIRT = 0x00000100
- const m_MIPS_AFL_ASE_XPA = 0x00001000
- const m_MIPS_AFL_EXT_10000 = 11
- const m_MIPS_AFL_EXT_3900 = 10
- const m_MIPS_AFL_EXT_4010 = 8
- const m_MIPS_AFL_EXT_4100 = 9
- const m_MIPS_AFL_EXT_4111 = 13
- const m_MIPS_AFL_EXT_4120 = 14
- const m_MIPS_AFL_EXT_4650 = 7
- const m_MIPS_AFL_EXT_5400 = 15
- const m_MIPS_AFL_EXT_5500 = 16
- const m_MIPS_AFL_EXT_5900 = 6
- const m_MIPS_AFL_EXT_LOONGSON_2E = 17
- const m_MIPS_AFL_EXT_LOONGSON_2F = 18
- const m_MIPS_AFL_EXT_LOONGSON_3A = 4
- const m_MIPS_AFL_EXT_OCTEON = 5
- const m_MIPS_AFL_EXT_OCTEON2 = 2
- const m_MIPS_AFL_EXT_OCTEONP = 3
- const m_MIPS_AFL_EXT_SB1 = 12
- const m_MIPS_AFL_EXT_XLR = 1
- const m_MIPS_AFL_FLAGS1_ODDSPREG = 1
- const m_MIPS_AFL_REG_128 = 0x03
- const m_MIPS_AFL_REG_32 = 0x01
- const m_MIPS_AFL_REG_64 = 0x02
- const m_MIPS_AFL_REG_NONE = 0x00
- const m_NT_386_IOPERM = 0x201
- const m_NT_386_TLS = 0x200
- const m_NT_ARC_V2 = 0x600
- const m_NT_ARM_HW_BREAK = 0x402
- const m_NT_ARM_HW_WATCH = 0x403
- const m_NT_ARM_PACA_KEYS = 0x407
- const m_NT_ARM_PACG_KEYS = 0x408
- const m_NT_ARM_PAC_ENABLED_KEYS = 0x40a
- const m_NT_ARM_PAC_MASK = 0x406
- const m_NT_ARM_SVE = 0x405
- const m_NT_ARM_SYSTEM_CALL = 0x404
- const m_NT_ARM_TAGGED_ADDR_CTRL = 0x409
- const m_NT_ARM_TLS = 0x401
- const m_NT_ARM_VFP = 0x400
- const m_NT_ASRS = 8
- const m_NT_AUXV = 6
- const m_NT_FILE = 0x46494c45
- const m_NT_FPREGSET = 2
- const m_NT_GNU_ABI_TAG = 1
- const m_NT_GNU_BUILD_ID = 3
- const m_NT_GNU_GOLD_VERSION = 4
- const m_NT_GNU_PROPERTY_TYPE_0 = 5
- const m_NT_GWINDOWS = 7
- const m_NT_LOONGARCH_CPUCFG = 0xa00
- const m_NT_LOONGARCH_CSR = 0xa01
- const m_NT_LOONGARCH_LASX = 0xa03
- const m_NT_LOONGARCH_LBT = 0xa04
- const m_NT_LOONGARCH_LSX = 0xa02
- const m_NT_LWPSINFO = 17
- const m_NT_LWPSTATUS = 16
- const m_NT_METAG_CBUF = 0x500
- const m_NT_METAG_RPIPE = 0x501
- const m_NT_METAG_TLS = 0x502
- const m_NT_MIPS_DSP = 0x800
- const m_NT_MIPS_FP_MODE = 0x801
- const m_NT_MIPS_MSA = 0x802
- const m_NT_PLATFORM = 5
- const m_NT_PPC_DSCR = 0x105
- const m_NT_PPC_EBB = 0x106
- const m_NT_PPC_PMU = 0x107
- const m_NT_PPC_PPR = 0x104
- const m_NT_PPC_SPE = 0x101
- const m_NT_PPC_TAR = 0x103
- const m_NT_PPC_TM_CDSCR = 0x10f
- const m_NT_PPC_TM_CFPR = 0x109
- const m_NT_PPC_TM_CGPR = 0x108
- const m_NT_PPC_TM_CPPR = 0x10e
- const m_NT_PPC_TM_CTAR = 0x10d
- const m_NT_PPC_TM_CVMX = 0x10a
- const m_NT_PPC_TM_CVSX = 0x10b
- const m_NT_PPC_TM_SPR = 0x10c
- const m_NT_PPC_VMX = 0x100
- const m_NT_PPC_VSX = 0x102
- const m_NT_PRCRED = 14
- const m_NT_PRFPREG = 2
- const m_NT_PRFPXREG = 20
- const m_NT_PRPSINFO = 3
- const m_NT_PRSTATUS = 1
- const m_NT_PRXFPREG = 0x46e62b7f
- const m_NT_PRXREG = 4
- const m_NT_PSINFO = 13
- const m_NT_PSTATUS = 10
- const m_NT_RISCV_CSR = 0x900
- const m_NT_RISCV_VECTOR = 0x901
- const m_NT_S390_CTRS = 0x304
- const m_NT_S390_GS_BC = 0x30c
- const m_NT_S390_GS_CB = 0x30b
- const m_NT_S390_HIGH_GPRS = 0x300
- const m_NT_S390_LAST_BREAK = 0x306
- const m_NT_S390_PREFIX = 0x305
- const m_NT_S390_RI_CB = 0x30d
- const m_NT_S390_SYSTEM_CALL = 0x307
- const m_NT_S390_TDB = 0x308
- const m_NT_S390_TIMER = 0x301
- const m_NT_S390_TODCMP = 0x302
- const m_NT_S390_TODPREG = 0x303
- const m_NT_S390_VXRS_HIGH = 0x30a
- const m_NT_S390_VXRS_LOW = 0x309
- const m_NT_SIGINFO = 0x53494749
- const m_NT_TASKSTRUCT = 4
- const m_NT_UTSNAME = 15
- const m_NT_VERSION = 1
- const m_NT_VMCOREDD = 0x700
- const m_NT_X86_XSTATE = 0x202
- const m_N_ABS = 2
- const m_N_BSS = 8
- const m_N_COMM = 0x12
- const m_N_DATA = 6
- const m_N_EXT = 1
- const m_N_FN = 30
- const m_N_FORMAT = "%08x"
- const m_N_INDR = 0x0a
- const m_N_SETA = 0x14
- const m_N_SETB = 0x1a
- const m_N_SETD = 0x18
- const m_N_SETT = 0x16
- const m_N_SETV = 0x1c
- const m_N_SIZE = 0x0c
- const m_N_STAB = 0xe0
- const m_N_TEXT = 4
- const m_N_TYPE = 0x1e
- const m_N_UNDF = 0
- const m_N_WARN = 0x1e
- const m_ODK_EXCEPTIONS = 2
- const m_ODK_FILL = 5
- const m_ODK_HWAND = 7
- const m_ODK_HWOR = 8
- const m_ODK_HWPATCH = 4
- const m_ODK_NULL = 0
- const m_ODK_PAD = 3
- const m_ODK_REGINFO = 1
- const m_ODK_TAGS = 6
- const m_OEX_DISMISS = 0x80000
- const m_OEX_FPDBUG = 0x40000
- const m_OEX_FPU_DIV0 = 0x08
- const m_OEX_FPU_INEX = 0x01
- const m_OEX_FPU_INVAL = 0x10
- const m_OEX_FPU_MAX = 0x1f00
- const m_OEX_FPU_MIN = 0x1f
- const m_OEX_FPU_OFLO = 0x04
- const m_OEX_FPU_UFLO = 0x02
- const m_OEX_PAGE0 = 0x10000
- const m_OEX_PRECISEFP = "OEX_FPDBUG"
- const m_OEX_SMM = 0x20000
- const m_OHWA0_R4KEOP_CHECKED = 0x00000001
- const m_OHWA1_R4KEOP_CLEAN = 0x00000002
- const m_OHW_R4KEOP = 0x1
- const m_OHW_R5KCVTL = 0x8
- const m_OHW_R5KEOP = 0x4
- const m_OHW_R8KPFETCH = 0x2
- const m_OPAD_POSTFIX = 0x2
- const m_OPAD_PREFIX = 0x1
- const m_OPAD_SYMBOL = 0x4
- const m_O_CREAT2 = 0100
- const m_O_NONBLOCK2 = 04000
- const m_O_RDONLY1 = 0
- const m_O_TRUNC2 = 01000
- const m_PF_ARM_ABS = 0x40000000
- const m_PF_ARM_PI = 0x20000000
- const m_PF_ARM_SB = 0x10000000
- const m_PF_HP_CODE = 0x01000000
- const m_PF_HP_FAR_SHARED = 0x00200000
- const m_PF_HP_LAZYSWAP = 0x04000000
- const m_PF_HP_MODIFY = 0x02000000
- const m_PF_HP_NEAR_SHARED = 0x00400000
- const m_PF_HP_PAGE_SIZE = 0x00100000
- const m_PF_HP_SBP = 0x08000000
- const m_PF_IA_64_NORECOV = 0x80000000
- const m_PF_MASKOS = 0x0ff00000
- const m_PF_MASKPROC = 0xf0000000
- const m_PF_MIPS_LOCAL = 0x10000000
- const m_PF_PARISC_SBP = 0x08000000
- const m_PN_XNUM = 0xffff
- const m_PPC64_OPT_LOCALENTRY = 4
- const m_PPC64_OPT_MULTI_TOC = 2
- const m_PPC64_OPT_TLS = 1
- const m_PPC_OPT_TLS = 1
- const m_PT_DYNAMIC = 2
- const m_PT_GNU_EH_FRAME = 0x6474e550
- const m_PT_GNU_PROPERTY = 0x6474e553
- const m_PT_GNU_RELRO = 0x6474e552
- const m_PT_GNU_STACK = 0x6474e551
- const m_PT_HIOS = 0x6fffffff
- const m_PT_HIPROC = 0x7fffffff
- const m_PT_HISUNW = 0x6fffffff
- const m_PT_INTERP = 3
- const m_PT_LOAD = 1
- const m_PT_LOOS = 0x60000000
- const m_PT_LOPROC = 0x70000000
- const m_PT_LOSUNW = 0x6ffffffa
- const m_PT_MIPS_ABIFLAGS = 0x70000003
- const m_PT_MIPS_OPTIONS = 0x70000002
- const m_PT_MIPS_REGINFO = 0x70000000
- const m_PT_MIPS_RTPROC = 0x70000001
- const m_PT_NOTE = 4
- const m_PT_NULL = 0
- const m_PT_NUM = 8
- const m_PT_PARISC_ARCHEXT = 0x70000000
- const m_PT_PARISC_UNWIND = 0x70000001
- const m_PT_PHDR = 6
- const m_PT_SHLIB = 5
- const m_PT_SUNWBSS = 0x6ffffffa
- const m_PT_SUNWSTACK = 0x6ffffffb
- const m_PT_TLS = 7
- const m_RHF_NONE = 0
- const m_R_386_16 = 20
- const m_R_386_32 = 1
- const m_R_386_32PLT = 11
- const m_R_386_8 = 22
- const m_R_386_COPY = 5
- const m_R_386_GLOB_DAT = 6
- const m_R_386_GOT32 = 3
- const m_R_386_GOT32X = 43
- const m_R_386_GOTOFF = 9
- const m_R_386_GOTPC = 10
- const m_R_386_IRELATIVE = 42
- const m_R_386_JMP_SLOT = 7
- const m_R_386_NONE = 0
- const m_R_386_NUM = 44
- const m_R_386_PC16 = 21
- const m_R_386_PC32 = 2
- const m_R_386_PC8 = 23
- const m_R_386_PLT32 = 4
- const m_R_386_RELATIVE = 8
- const m_R_386_SIZE32 = 38
- const m_R_386_TLS_DESC = 41
- const m_R_386_TLS_DESC_CALL = 40
- const m_R_386_TLS_DTPMOD32 = 35
- const m_R_386_TLS_DTPOFF32 = 36
- const m_R_386_TLS_GD = 18
- const m_R_386_TLS_GD_32 = 24
- const m_R_386_TLS_GD_CALL = 26
- const m_R_386_TLS_GD_POP = 27
- const m_R_386_TLS_GD_PUSH = 25
- const m_R_386_TLS_GOTDESC = 39
- const m_R_386_TLS_GOTIE = 16
- const m_R_386_TLS_IE = 15
- const m_R_386_TLS_IE_32 = 33
- const m_R_386_TLS_LDM = 19
- const m_R_386_TLS_LDM_32 = 28
- const m_R_386_TLS_LDM_CALL = 30
- const m_R_386_TLS_LDM_POP = 31
- const m_R_386_TLS_LDM_PUSH = 29
- const m_R_386_TLS_LDO_32 = 32
- const m_R_386_TLS_LE = 17
- const m_R_386_TLS_LE_32 = 34
- const m_R_386_TLS_TPOFF = 14
- const m_R_386_TLS_TPOFF32 = 37
- const m_R_390_12 = 2
- const m_R_390_16 = 3
- const m_R_390_20 = 57
- const m_R_390_32 = 4
- const m_R_390_64 = 22
- const m_R_390_8 = 1
- const m_R_390_COPY = 9
- const m_R_390_GLOB_DAT = 10
- const m_R_390_GOT12 = 6
- const m_R_390_GOT16 = 15
- const m_R_390_GOT20 = 58
- const m_R_390_GOT32 = 7
- const m_R_390_GOT64 = 24
- const m_R_390_GOTENT = 26
- const m_R_390_GOTOFF16 = 27
- const m_R_390_GOTOFF32 = 13
- const m_R_390_GOTOFF64 = 28
- const m_R_390_GOTPC = 14
- const m_R_390_GOTPCDBL = 21
- const m_R_390_GOTPLT12 = 29
- const m_R_390_GOTPLT16 = 30
- const m_R_390_GOTPLT20 = 59
- const m_R_390_GOTPLT32 = 31
- const m_R_390_GOTPLT64 = 32
- const m_R_390_GOTPLTENT = 33
- const m_R_390_JMP_SLOT = 11
- const m_R_390_NONE = 0
- const m_R_390_NUM = 61
- const m_R_390_PC16 = 16
- const m_R_390_PC16DBL = 17
- const m_R_390_PC32 = 5
- const m_R_390_PC32DBL = 19
- const m_R_390_PC64 = 23
- const m_R_390_PLT16DBL = 18
- const m_R_390_PLT32 = 8
- const m_R_390_PLT32DBL = 20
- const m_R_390_PLT64 = 25
- const m_R_390_PLTOFF16 = 34
- const m_R_390_PLTOFF32 = 35
- const m_R_390_PLTOFF64 = 36
- const m_R_390_RELATIVE = 12
- const m_R_390_TLS_DTPMOD = 54
- const m_R_390_TLS_DTPOFF = 55
- const m_R_390_TLS_GD32 = 40
- const m_R_390_TLS_GD64 = 41
- const m_R_390_TLS_GDCALL = 38
- const m_R_390_TLS_GOTIE12 = 42
- const m_R_390_TLS_GOTIE20 = 60
- const m_R_390_TLS_GOTIE32 = 43
- const m_R_390_TLS_GOTIE64 = 44
- const m_R_390_TLS_IE32 = 47
- const m_R_390_TLS_IE64 = 48
- const m_R_390_TLS_IEENT = 49
- const m_R_390_TLS_LDCALL = 39
- const m_R_390_TLS_LDM32 = 45
- const m_R_390_TLS_LDM64 = 46
- const m_R_390_TLS_LDO32 = 52
- const m_R_390_TLS_LDO64 = 53
- const m_R_390_TLS_LE32 = 50
- const m_R_390_TLS_LE64 = 51
- const m_R_390_TLS_LOAD = 37
- const m_R_390_TLS_TPOFF = 56
- const m_R_68K_16 = 2
- const m_R_68K_32 = 1
- const m_R_68K_8 = 3
- const m_R_68K_COPY = 19
- const m_R_68K_GLOB_DAT = 20
- const m_R_68K_GOT16 = 8
- const m_R_68K_GOT16O = 11
- const m_R_68K_GOT32 = 7
- const m_R_68K_GOT32O = 10
- const m_R_68K_GOT8 = 9
- const m_R_68K_GOT8O = 12
- const m_R_68K_JMP_SLOT = 21
- const m_R_68K_NONE = 0
- const m_R_68K_NUM = 43
- const m_R_68K_PC16 = 5
- const m_R_68K_PC32 = 4
- const m_R_68K_PC8 = 6
- const m_R_68K_PLT16 = 14
- const m_R_68K_PLT16O = 17
- const m_R_68K_PLT32 = 13
- const m_R_68K_PLT32O = 16
- const m_R_68K_PLT8 = 15
- const m_R_68K_PLT8O = 18
- const m_R_68K_RELATIVE = 22
- const m_R_68K_TLS_DTPMOD32 = 40
- const m_R_68K_TLS_DTPREL32 = 41
- const m_R_68K_TLS_GD16 = 26
- const m_R_68K_TLS_GD32 = 25
- const m_R_68K_TLS_GD8 = 27
- const m_R_68K_TLS_IE16 = 35
- const m_R_68K_TLS_IE32 = 34
- const m_R_68K_TLS_IE8 = 36
- const m_R_68K_TLS_LDM16 = 29
- const m_R_68K_TLS_LDM32 = 28
- const m_R_68K_TLS_LDM8 = 30
- const m_R_68K_TLS_LDO16 = 32
- const m_R_68K_TLS_LDO32 = 31
- const m_R_68K_TLS_LDO8 = 33
- const m_R_68K_TLS_LE16 = 38
- const m_R_68K_TLS_LE32 = 37
- const m_R_68K_TLS_LE8 = 39
- const m_R_68K_TLS_TPREL32 = 42
- const m_R_AARCH64_ABS16 = 259
- const m_R_AARCH64_ABS32 = 258
- const m_R_AARCH64_ABS64 = 257
- const m_R_AARCH64_ADD_ABS_LO12_NC = 277
- const m_R_AARCH64_ADR_GOT_PAGE = 311
- const m_R_AARCH64_ADR_PREL_LO21 = 274
- const m_R_AARCH64_ADR_PREL_PG_HI21 = 275
- const m_R_AARCH64_ADR_PREL_PG_HI21_NC = 276
- const m_R_AARCH64_CALL26 = 283
- const m_R_AARCH64_CONDBR19 = 280
- const m_R_AARCH64_COPY = 1024
- const m_R_AARCH64_GLOB_DAT = 1025
- const m_R_AARCH64_GOTREL32 = 308
- const m_R_AARCH64_GOTREL64 = 307
- const m_R_AARCH64_GOT_LD_PREL19 = 309
- const m_R_AARCH64_JUMP26 = 282
- const m_R_AARCH64_JUMP_SLOT = 1026
- const m_R_AARCH64_LD64_GOTOFF_LO15 = 310
- const m_R_AARCH64_LD64_GOTPAGE_LO15 = 313
- const m_R_AARCH64_LD64_GOT_LO12_NC = 312
- const m_R_AARCH64_LDST128_ABS_LO12_NC = 299
- const m_R_AARCH64_LDST16_ABS_LO12_NC = 284
- const m_R_AARCH64_LDST32_ABS_LO12_NC = 285
- const m_R_AARCH64_LDST64_ABS_LO12_NC = 286
- const m_R_AARCH64_LDST8_ABS_LO12_NC = 278
- const m_R_AARCH64_LD_PREL_LO19 = 273
- const m_R_AARCH64_MOVW_GOTOFF_G0 = 300
- const m_R_AARCH64_MOVW_GOTOFF_G0_NC = 301
- const m_R_AARCH64_MOVW_GOTOFF_G1 = 302
- const m_R_AARCH64_MOVW_GOTOFF_G1_NC = 303
- const m_R_AARCH64_MOVW_GOTOFF_G2 = 304
- const m_R_AARCH64_MOVW_GOTOFF_G2_NC = 305
- const m_R_AARCH64_MOVW_GOTOFF_G3 = 306
- const m_R_AARCH64_MOVW_PREL_G0 = 287
- const m_R_AARCH64_MOVW_PREL_G0_NC = 288
- const m_R_AARCH64_MOVW_PREL_G1 = 289
- const m_R_AARCH64_MOVW_PREL_G1_NC = 290
- const m_R_AARCH64_MOVW_PREL_G2 = 291
- const m_R_AARCH64_MOVW_PREL_G2_NC = 292
- const m_R_AARCH64_MOVW_PREL_G3 = 293
- const m_R_AARCH64_MOVW_SABS_G0 = 270
- const m_R_AARCH64_MOVW_SABS_G1 = 271
- const m_R_AARCH64_MOVW_SABS_G2 = 272
- const m_R_AARCH64_MOVW_UABS_G0 = 263
- const m_R_AARCH64_MOVW_UABS_G0_NC = 264
- const m_R_AARCH64_MOVW_UABS_G1 = 265
- const m_R_AARCH64_MOVW_UABS_G1_NC = 266
- const m_R_AARCH64_MOVW_UABS_G2 = 267
- const m_R_AARCH64_MOVW_UABS_G2_NC = 268
- const m_R_AARCH64_MOVW_UABS_G3 = 269
- const m_R_AARCH64_NONE = 0
- const m_R_AARCH64_P32_ABS32 = 1
- const m_R_AARCH64_P32_COPY = 180
- const m_R_AARCH64_P32_GLOB_DAT = 181
- const m_R_AARCH64_P32_IRELATIVE = 188
- const m_R_AARCH64_P32_JUMP_SLOT = 182
- const m_R_AARCH64_P32_RELATIVE = 183
- const m_R_AARCH64_P32_TLSDESC = 187
- const m_R_AARCH64_P32_TLS_DTPMOD = 184
- const m_R_AARCH64_P32_TLS_DTPREL = 185
- const m_R_AARCH64_P32_TLS_TPREL = 186
- const m_R_AARCH64_PREL16 = 262
- const m_R_AARCH64_PREL32 = 261
- const m_R_AARCH64_PREL64 = 260
- const m_R_AARCH64_RELATIVE = 1027
- const m_R_AARCH64_TLSDESC = 1031
- const m_R_AARCH64_TLSDESC_ADD = 568
- const m_R_AARCH64_TLSDESC_ADD_LO12 = 564
- const m_R_AARCH64_TLSDESC_ADR_PAGE21 = 562
- const m_R_AARCH64_TLSDESC_ADR_PREL21 = 561
- const m_R_AARCH64_TLSDESC_CALL = 569
- const m_R_AARCH64_TLSDESC_LD64_LO12 = 563
- const m_R_AARCH64_TLSDESC_LDR = 567
- const m_R_AARCH64_TLSDESC_LD_PREL19 = 560
- const m_R_AARCH64_TLSDESC_OFF_G0_NC = 566
- const m_R_AARCH64_TLSDESC_OFF_G1 = 565
- const m_R_AARCH64_TLSGD_ADD_LO12_NC = 514
- const m_R_AARCH64_TLSGD_ADR_PAGE21 = 513
- const m_R_AARCH64_TLSGD_ADR_PREL21 = 512
- const m_R_AARCH64_TLSGD_MOVW_G0_NC = 516
- const m_R_AARCH64_TLSGD_MOVW_G1 = 515
- const m_R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 = 541
- const m_R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC = 542
- const m_R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 = 543
- const m_R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC = 540
- const m_R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 = 539
- const m_R_AARCH64_TLSLD_ADD_DTPREL_HI12 = 528
- const m_R_AARCH64_TLSLD_ADD_DTPREL_LO12 = 529
- const m_R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC = 530
- const m_R_AARCH64_TLSLD_ADD_LO12_NC = 519
- const m_R_AARCH64_TLSLD_ADR_PAGE21 = 518
- const m_R_AARCH64_TLSLD_ADR_PREL21 = 517
- const m_R_AARCH64_TLSLD_LDST128_DTPREL_LO12 = 572
- const m_R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC = 573
- const m_R_AARCH64_TLSLD_LDST16_DTPREL_LO12 = 533
- const m_R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC = 534
- const m_R_AARCH64_TLSLD_LDST32_DTPREL_LO12 = 535
- const m_R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC = 536
- const m_R_AARCH64_TLSLD_LDST64_DTPREL_LO12 = 537
- const m_R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC = 538
- const m_R_AARCH64_TLSLD_LDST8_DTPREL_LO12 = 531
- const m_R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC = 532
- const m_R_AARCH64_TLSLD_LD_PREL19 = 522
- const m_R_AARCH64_TLSLD_MOVW_DTPREL_G0 = 526
- const m_R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC = 527
- const m_R_AARCH64_TLSLD_MOVW_DTPREL_G1 = 524
- const m_R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC = 525
- const m_R_AARCH64_TLSLD_MOVW_DTPREL_G2 = 523
- const m_R_AARCH64_TLSLD_MOVW_G0_NC = 521
- const m_R_AARCH64_TLSLD_MOVW_G1 = 520
- const m_R_AARCH64_TLSLE_ADD_TPREL_HI12 = 549
- const m_R_AARCH64_TLSLE_ADD_TPREL_LO12 = 550
- const m_R_AARCH64_TLSLE_ADD_TPREL_LO12_NC = 551
- const m_R_AARCH64_TLSLE_LDST128_TPREL_LO12 = 570
- const m_R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC = 571
- const m_R_AARCH64_TLSLE_LDST16_TPREL_LO12 = 554
- const m_R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC = 555
- const m_R_AARCH64_TLSLE_LDST32_TPREL_LO12 = 556
- const m_R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC = 557
- const m_R_AARCH64_TLSLE_LDST64_TPREL_LO12 = 558
- const m_R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC = 559
- const m_R_AARCH64_TLSLE_LDST8_TPREL_LO12 = 552
- const m_R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC = 553
- const m_R_AARCH64_TLSLE_MOVW_TPREL_G0 = 547
- const m_R_AARCH64_TLSLE_MOVW_TPREL_G0_NC = 548
- const m_R_AARCH64_TLSLE_MOVW_TPREL_G1 = 545
- const m_R_AARCH64_TLSLE_MOVW_TPREL_G1_NC = 546
- const m_R_AARCH64_TLSLE_MOVW_TPREL_G2 = 544
- const m_R_AARCH64_TLS_DTPMOD = 1028
- const m_R_AARCH64_TLS_DTPMOD64 = 1028
- const m_R_AARCH64_TLS_DTPREL = 1029
- const m_R_AARCH64_TLS_DTPREL64 = 1029
- const m_R_AARCH64_TLS_TPREL = 1030
- const m_R_AARCH64_TLS_TPREL64 = 1030
- const m_R_AARCH64_TSTBR14 = 279
- const m_R_ALPHA_BRADDR = 7
- const m_R_ALPHA_COPY = 24
- const m_R_ALPHA_DTPMOD64 = 31
- const m_R_ALPHA_DTPREL16 = 36
- const m_R_ALPHA_DTPREL64 = 33
- const m_R_ALPHA_DTPRELHI = 34
- const m_R_ALPHA_DTPRELLO = 35
- const m_R_ALPHA_GLOB_DAT = 25
- const m_R_ALPHA_GOTDTPREL = 32
- const m_R_ALPHA_GOTTPREL = 37
- const m_R_ALPHA_GPDISP = 6
- const m_R_ALPHA_GPREL16 = 19
- const m_R_ALPHA_GPREL32 = 3
- const m_R_ALPHA_GPRELHIGH = 17
- const m_R_ALPHA_GPRELLOW = 18
- const m_R_ALPHA_HINT = 8
- const m_R_ALPHA_JMP_SLOT = 26
- const m_R_ALPHA_LITERAL = 4
- const m_R_ALPHA_LITUSE = 5
- const m_R_ALPHA_NONE = 0
- const m_R_ALPHA_NUM = 46
- const m_R_ALPHA_REFLONG = 1
- const m_R_ALPHA_REFQUAD = 2
- const m_R_ALPHA_RELATIVE = 27
- const m_R_ALPHA_SREL16 = 9
- const m_R_ALPHA_SREL32 = 10
- const m_R_ALPHA_SREL64 = 11
- const m_R_ALPHA_TLSGD = 29
- const m_R_ALPHA_TLS_GD_HI = 28
- const m_R_ALPHA_TLS_LDM = 30
- const m_R_ALPHA_TPREL16 = 41
- const m_R_ALPHA_TPREL64 = 38
- const m_R_ALPHA_TPRELHI = 39
- const m_R_ALPHA_TPRELLO = 40
- const m_R_ARM_ABS12 = 6
- const m_R_ARM_ABS16 = 5
- const m_R_ARM_ABS32 = 2
- const m_R_ARM_ABS32_NOI = 55
- const m_R_ARM_ABS8 = 8
- const m_R_ARM_ALU_PCREL_15_8 = 33
- const m_R_ARM_ALU_PCREL_23_15 = 34
- const m_R_ARM_ALU_PCREL_7_0 = 32
- const m_R_ARM_ALU_PC_G0 = 58
- const m_R_ARM_ALU_PC_G0_NC = 57
- const m_R_ARM_ALU_PC_G1 = 60
- const m_R_ARM_ALU_PC_G1_NC = 59
- const m_R_ARM_ALU_PC_G2 = 61
- const m_R_ARM_ALU_SBREL_19_12 = 36
- const m_R_ARM_ALU_SBREL_27_20 = 37
- const m_R_ARM_ALU_SB_G0 = 71
- const m_R_ARM_ALU_SB_G0_NC = 70
- const m_R_ARM_ALU_SB_G1 = 73
- const m_R_ARM_ALU_SB_G1_NC = 72
- const m_R_ARM_ALU_SB_G2 = 74
- const m_R_ARM_AMP_VCALL9 = 12
- const m_R_ARM_BASE_ABS = 31
- const m_R_ARM_CALL = 28
- const m_R_ARM_COPY = 20
- const m_R_ARM_GLOB_DAT = 21
- const m_R_ARM_GNU_VTENTRY = 100
- const m_R_ARM_GNU_VTINHERIT = 101
- const m_R_ARM_GOT32 = 26
- const m_R_ARM_GOTOFF = 24
- const m_R_ARM_GOTOFF12 = 98
- const m_R_ARM_GOTPC = 25
- const m_R_ARM_GOTRELAX = 99
- const m_R_ARM_GOT_ABS = 95
- const m_R_ARM_GOT_BREL12 = 97
- const m_R_ARM_GOT_PREL = 96
- const m_R_ARM_IRELATIVE = 160
- const m_R_ARM_JUMP24 = 29
- const m_R_ARM_JUMP_SLOT = 22
- const m_R_ARM_LDC_PC_G0 = 67
- const m_R_ARM_LDC_PC_G1 = 68
- const m_R_ARM_LDC_PC_G2 = 69
- const m_R_ARM_LDC_SB_G0 = 81
- const m_R_ARM_LDC_SB_G1 = 82
- const m_R_ARM_LDC_SB_G2 = 83
- const m_R_ARM_LDRS_PC_G0 = 64
- const m_R_ARM_LDRS_PC_G1 = 65
- const m_R_ARM_LDRS_PC_G2 = 66
- const m_R_ARM_LDRS_SB_G0 = 78
- const m_R_ARM_LDRS_SB_G1 = 79
- const m_R_ARM_LDRS_SB_G2 = 80
- const m_R_ARM_LDR_PC_G1 = 62
- const m_R_ARM_LDR_PC_G2 = 63
- const m_R_ARM_LDR_SBREL_11_0 = 35
- const m_R_ARM_LDR_SB_G0 = 75
- const m_R_ARM_LDR_SB_G1 = 76
- const m_R_ARM_LDR_SB_G2 = 77
- const m_R_ARM_ME_TOO = 128
- const m_R_ARM_MOVT_ABS = 44
- const m_R_ARM_MOVT_BREL = 85
- const m_R_ARM_MOVT_PREL = 46
- const m_R_ARM_MOVW_ABS_NC = 43
- const m_R_ARM_MOVW_BREL = 86
- const m_R_ARM_MOVW_BREL_NC = 84
- const m_R_ARM_MOVW_PREL_NC = 45
- const m_R_ARM_NONE = 0
- const m_R_ARM_NUM = 256
- const m_R_ARM_PC13 = 4
- const m_R_ARM_PC24 = 1
- const m_R_ARM_PLT32 = 27
- const m_R_ARM_PLT32_ABS = 94
- const m_R_ARM_PREL31 = 42
- const m_R_ARM_RABS22 = 253
- const m_R_ARM_RBASE = 255
- const m_R_ARM_REL32 = 3
- const m_R_ARM_REL32_NOI = 56
- const m_R_ARM_RELATIVE = 23
- const m_R_ARM_RPC24 = 254
- const m_R_ARM_RREL32 = 252
- const m_R_ARM_RSBREL32 = 250
- const m_R_ARM_RXPC25 = 249
- const m_R_ARM_SBREL31 = 39
- const m_R_ARM_SBREL32 = 9
- const m_R_ARM_TARGET1 = 38
- const m_R_ARM_TARGET2 = 41
- const m_R_ARM_THM_ABS5 = 7
- const m_R_ARM_THM_ALU_PREL_11_0 = 53
- const m_R_ARM_THM_GOT_BREL12 = 131
- const m_R_ARM_THM_JUMP19 = 51
- const m_R_ARM_THM_JUMP24 = 30
- const m_R_ARM_THM_JUMP6 = 52
- const m_R_ARM_THM_MOVT_ABS = 48
- const m_R_ARM_THM_MOVT_BREL = 88
- const m_R_ARM_THM_MOVT_PREL = 50
- const m_R_ARM_THM_MOVW_ABS_NC = 47
- const m_R_ARM_THM_MOVW_BREL = 89
- const m_R_ARM_THM_MOVW_BREL_NC = 87
- const m_R_ARM_THM_MOVW_PREL_NC = 49
- const m_R_ARM_THM_PC11 = 102
- const m_R_ARM_THM_PC12 = 54
- const m_R_ARM_THM_PC22 = 10
- const m_R_ARM_THM_PC8 = 11
- const m_R_ARM_THM_PC9 = 103
- const m_R_ARM_THM_RPC22 = 251
- const m_R_ARM_THM_SWI8 = 14
- const m_R_ARM_THM_TLS_CALL = 93
- const m_R_ARM_THM_TLS_DESCSEQ = 129
- const m_R_ARM_THM_TLS_DESCSEQ16 = 129
- const m_R_ARM_THM_TLS_DESCSEQ32 = 130
- const m_R_ARM_THM_XPC22 = 16
- const m_R_ARM_TLS_CALL = 91
- const m_R_ARM_TLS_DESC = 13
- const m_R_ARM_TLS_DESCSEQ = 92
- const m_R_ARM_TLS_DTPMOD32 = 17
- const m_R_ARM_TLS_DTPOFF32 = 18
- const m_R_ARM_TLS_GD32 = 104
- const m_R_ARM_TLS_GOTDESC = 90
- const m_R_ARM_TLS_IE12GP = 111
- const m_R_ARM_TLS_IE32 = 107
- const m_R_ARM_TLS_LDM32 = 105
- const m_R_ARM_TLS_LDO12 = 109
- const m_R_ARM_TLS_LDO32 = 106
- const m_R_ARM_TLS_LE12 = 110
- const m_R_ARM_TLS_LE32 = 108
- const m_R_ARM_TLS_TPOFF32 = 19
- const m_R_ARM_V4BX = 40
- const m_R_ARM_XPC25 = 15
- const m_R_BPF_MAP_FD = 1
- const m_R_BPF_NONE = 0
- const m_R_CKCORE_ADDR32 = 1
- const m_R_CKCORE_ADDRGOT = 17
- const m_R_CKCORE_ADDRGOT_HI16 = 36
- const m_R_CKCORE_ADDRGOT_LO16 = 37
- const m_R_CKCORE_ADDRPLT = 18
- const m_R_CKCORE_ADDRPLT_HI16 = 38
- const m_R_CKCORE_ADDRPLT_LO16 = 39
- const m_R_CKCORE_ADDR_HI16 = 24
- const m_R_CKCORE_ADDR_LO16 = 25
- const m_R_CKCORE_COPY = 10
- const m_R_CKCORE_DOFFSET_IMM18 = 44
- const m_R_CKCORE_DOFFSET_IMM18BY2 = 45
- const m_R_CKCORE_DOFFSET_IMM18BY4 = 46
- const m_R_CKCORE_DOFFSET_LO16 = 42
- const m_R_CKCORE_GLOB_DAT = 11
- const m_R_CKCORE_GOT12 = 30
- const m_R_CKCORE_GOT32 = 15
- const m_R_CKCORE_GOTOFF = 13
- const m_R_CKCORE_GOTOFF_HI16 = 28
- const m_R_CKCORE_GOTOFF_LO16 = 29
- const m_R_CKCORE_GOTPC = 14
- const m_R_CKCORE_GOTPC_HI16 = 26
- const m_R_CKCORE_GOTPC_LO16 = 27
- const m_R_CKCORE_GOT_HI16 = 31
- const m_R_CKCORE_GOT_IMM18BY4 = 48
- const m_R_CKCORE_GOT_LO16 = 32
- const m_R_CKCORE_JUMP_SLOT = 12
- const m_R_CKCORE_NONE = 0
- const m_R_CKCORE_PCREL32 = 5
- const m_R_CKCORE_PCRELIMM11BY2 = 3
- const m_R_CKCORE_PCRELIMM8BY4 = 2
- const m_R_CKCORE_PCRELJSR_IMM11BY2 = 6
- const m_R_CKCORE_PCREL_IMM10BY2 = 22
- const m_R_CKCORE_PCREL_IMM10BY4 = 23
- const m_R_CKCORE_PCREL_IMM16BY2 = 20
- const m_R_CKCORE_PCREL_IMM16BY4 = 21
- const m_R_CKCORE_PCREL_IMM18BY2 = 43
- const m_R_CKCORE_PCREL_IMM26BY2 = 19
- const m_R_CKCORE_PCREL_IMM7BY4 = 50
- const m_R_CKCORE_PCREL_JSR_IMM26BY2 = 40
- const m_R_CKCORE_PLT12 = 33
- const m_R_CKCORE_PLT32 = 16
- const m_R_CKCORE_PLT_HI16 = 34
- const m_R_CKCORE_PLT_IMM18BY4 = 49
- const m_R_CKCORE_PLT_LO16 = 35
- const m_R_CKCORE_RELATIVE = 9
- const m_R_CKCORE_TLS_DTPMOD32 = 56
- const m_R_CKCORE_TLS_DTPOFF32 = 57
- const m_R_CKCORE_TLS_GD32 = 53
- const m_R_CKCORE_TLS_IE32 = 52
- const m_R_CKCORE_TLS_LDM32 = 54
- const m_R_CKCORE_TLS_LDO32 = 55
- const m_R_CKCORE_TLS_LE32 = 51
- const m_R_CKCORE_TLS_TPOFF32 = 58
- const m_R_CKCORE_TOFFSET_LO16 = 41
- const m_R_CRIS_16 = 2
- const m_R_CRIS_16_GOT = 13
- const m_R_CRIS_16_GOTPLT = 15
- const m_R_CRIS_16_PCREL = 5
- const m_R_CRIS_32 = 3
- const m_R_CRIS_32_GOT = 14
- const m_R_CRIS_32_GOTPLT = 16
- const m_R_CRIS_32_GOTREL = 17
- const m_R_CRIS_32_PCREL = 6
- const m_R_CRIS_32_PLT_GOTREL = 18
- const m_R_CRIS_32_PLT_PCREL = 19
- const m_R_CRIS_8 = 1
- const m_R_CRIS_8_PCREL = 4
- const m_R_CRIS_COPY = 9
- const m_R_CRIS_GLOB_DAT = 10
- const m_R_CRIS_GNU_VTENTRY = 8
- const m_R_CRIS_GNU_VTINHERIT = 7
- const m_R_CRIS_JUMP_SLOT = 11
- const m_R_CRIS_NONE = 0
- const m_R_CRIS_NUM = 20
- const m_R_CRIS_RELATIVE = 12
- const m_R_IA64_COPY = 0x84
- const m_R_IA64_DIR32LSB = 0x25
- const m_R_IA64_DIR32MSB = 0x24
- const m_R_IA64_DIR64LSB = 0x27
- const m_R_IA64_DIR64MSB = 0x26
- const m_R_IA64_DTPMOD64LSB = 0xa7
- const m_R_IA64_DTPMOD64MSB = 0xa6
- const m_R_IA64_DTPREL14 = 0xb1
- const m_R_IA64_DTPREL22 = 0xb2
- const m_R_IA64_DTPREL32LSB = 0xb5
- const m_R_IA64_DTPREL32MSB = 0xb4
- const m_R_IA64_DTPREL64I = 0xb3
- const m_R_IA64_DTPREL64LSB = 0xb7
- const m_R_IA64_DTPREL64MSB = 0xb6
- const m_R_IA64_FPTR32LSB = 0x45
- const m_R_IA64_FPTR32MSB = 0x44
- const m_R_IA64_FPTR64I = 0x43
- const m_R_IA64_FPTR64LSB = 0x47
- const m_R_IA64_FPTR64MSB = 0x46
- const m_R_IA64_GPREL22 = 0x2a
- const m_R_IA64_GPREL32LSB = 0x2d
- const m_R_IA64_GPREL32MSB = 0x2c
- const m_R_IA64_GPREL64I = 0x2b
- const m_R_IA64_GPREL64LSB = 0x2f
- const m_R_IA64_GPREL64MSB = 0x2e
- const m_R_IA64_IMM14 = 0x21
- const m_R_IA64_IMM22 = 0x22
- const m_R_IA64_IMM64 = 0x23
- const m_R_IA64_IPLTLSB = 0x81
- const m_R_IA64_IPLTMSB = 0x80
- const m_R_IA64_LDXMOV = 0x87
- const m_R_IA64_LTOFF22 = 0x32
- const m_R_IA64_LTOFF22X = 0x86
- const m_R_IA64_LTOFF64I = 0x33
- const m_R_IA64_LTOFF_DTPMOD22 = 0xaa
- const m_R_IA64_LTOFF_DTPREL22 = 0xba
- const m_R_IA64_LTOFF_FPTR22 = 0x52
- const m_R_IA64_LTOFF_FPTR32LSB = 0x55
- const m_R_IA64_LTOFF_FPTR32MSB = 0x54
- const m_R_IA64_LTOFF_FPTR64I = 0x53
- const m_R_IA64_LTOFF_FPTR64LSB = 0x57
- const m_R_IA64_LTOFF_FPTR64MSB = 0x56
- const m_R_IA64_LTOFF_TPREL22 = 0x9a
- const m_R_IA64_LTV32LSB = 0x75
- const m_R_IA64_LTV32MSB = 0x74
- const m_R_IA64_LTV64LSB = 0x77
- const m_R_IA64_LTV64MSB = 0x76
- const m_R_IA64_NONE = 0x00
- const m_R_IA64_PCREL21B = 0x49
- const m_R_IA64_PCREL21BI = 0x79
- const m_R_IA64_PCREL21F = 0x4b
- const m_R_IA64_PCREL21M = 0x4a
- const m_R_IA64_PCREL22 = 0x7a
- const m_R_IA64_PCREL32LSB = 0x4d
- const m_R_IA64_PCREL32MSB = 0x4c
- const m_R_IA64_PCREL60B = 0x48
- const m_R_IA64_PCREL64I = 0x7b
- const m_R_IA64_PCREL64LSB = 0x4f
- const m_R_IA64_PCREL64MSB = 0x4e
- const m_R_IA64_PLTOFF22 = 0x3a
- const m_R_IA64_PLTOFF64I = 0x3b
- const m_R_IA64_PLTOFF64LSB = 0x3f
- const m_R_IA64_PLTOFF64MSB = 0x3e
- const m_R_IA64_REL32LSB = 0x6d
- const m_R_IA64_REL32MSB = 0x6c
- const m_R_IA64_REL64LSB = 0x6f
- const m_R_IA64_REL64MSB = 0x6e
- const m_R_IA64_SECREL32LSB = 0x65
- const m_R_IA64_SECREL32MSB = 0x64
- const m_R_IA64_SECREL64LSB = 0x67
- const m_R_IA64_SECREL64MSB = 0x66
- const m_R_IA64_SEGREL32LSB = 0x5d
- const m_R_IA64_SEGREL32MSB = 0x5c
- const m_R_IA64_SEGREL64LSB = 0x5f
- const m_R_IA64_SEGREL64MSB = 0x5e
- const m_R_IA64_SUB = 0x85
- const m_R_IA64_TPREL14 = 0x91
- const m_R_IA64_TPREL22 = 0x92
- const m_R_IA64_TPREL64I = 0x93
- const m_R_IA64_TPREL64LSB = 0x97
- const m_R_IA64_TPREL64MSB = 0x96
- const m_R_LARCH_32 = 1
- const m_R_LARCH_32_PCREL = 99
- const m_R_LARCH_64 = 2
- const m_R_LARCH_ABS64_HI12 = 70
- const m_R_LARCH_ABS64_LO20 = 69
- const m_R_LARCH_ABS_HI20 = 67
- const m_R_LARCH_ABS_LO12 = 68
- const m_R_LARCH_ADD16 = 48
- const m_R_LARCH_ADD24 = 49
- const m_R_LARCH_ADD32 = 50
- const m_R_LARCH_ADD64 = 51
- const m_R_LARCH_ADD8 = 47
- const m_R_LARCH_B16 = 64
- const m_R_LARCH_B21 = 65
- const m_R_LARCH_B26 = 66
- const m_R_LARCH_COPY = 4
- const m_R_LARCH_GNU_VTENTRY = 58
- const m_R_LARCH_GNU_VTINHERIT = 57
- const m_R_LARCH_GOT64_HI12 = 82
- const m_R_LARCH_GOT64_LO20 = 81
- const m_R_LARCH_GOT64_PC_HI12 = 78
- const m_R_LARCH_GOT64_PC_LO20 = 77
- const m_R_LARCH_GOT_HI20 = 79
- const m_R_LARCH_GOT_LO12 = 80
- const m_R_LARCH_GOT_PC_HI20 = 75
- const m_R_LARCH_GOT_PC_LO12 = 76
- const m_R_LARCH_IRELATIVE = 12
- const m_R_LARCH_JUMP_SLOT = 5
- const m_R_LARCH_MARK_LA = 20
- const m_R_LARCH_MARK_PCREL = 21
- const m_R_LARCH_NONE = 0
- const m_R_LARCH_PCALA64_HI12 = 74
- const m_R_LARCH_PCALA64_LO20 = 73
- const m_R_LARCH_PCALA_HI20 = 71
- const m_R_LARCH_PCALA_LO12 = 72
- const m_R_LARCH_RELATIVE = 3
- const m_R_LARCH_RELAX = 100
- const m_R_LARCH_SOP_ADD = 35
- const m_R_LARCH_SOP_AND = 36
- const m_R_LARCH_SOP_ASSERT = 30
- const m_R_LARCH_SOP_IF_ELSE = 37
- const m_R_LARCH_SOP_NOT = 31
- const m_R_LARCH_SOP_POP_32_S_0_10_10_16_S2 = 45
- const m_R_LARCH_SOP_POP_32_S_0_5_10_16_S2 = 44
- const m_R_LARCH_SOP_POP_32_S_10_12 = 40
- const m_R_LARCH_SOP_POP_32_S_10_16 = 41
- const m_R_LARCH_SOP_POP_32_S_10_16_S2 = 42
- const m_R_LARCH_SOP_POP_32_S_10_5 = 38
- const m_R_LARCH_SOP_POP_32_S_5_20 = 43
- const m_R_LARCH_SOP_POP_32_U = 46
- const m_R_LARCH_SOP_POP_32_U_10_12 = 39
- const m_R_LARCH_SOP_PUSH_ABSOLUTE = 23
- const m_R_LARCH_SOP_PUSH_DUP = 24
- const m_R_LARCH_SOP_PUSH_GPREL = 25
- const m_R_LARCH_SOP_PUSH_PCREL = 22
- const m_R_LARCH_SOP_PUSH_PLT_PCREL = 29
- const m_R_LARCH_SOP_PUSH_TLS_GD = 28
- const m_R_LARCH_SOP_PUSH_TLS_GOT = 27
- const m_R_LARCH_SOP_PUSH_TLS_TPREL = 26
- const m_R_LARCH_SOP_SL = 33
- const m_R_LARCH_SOP_SR = 34
- const m_R_LARCH_SOP_SUB = 32
- const m_R_LARCH_SUB16 = 53
- const m_R_LARCH_SUB24 = 54
- const m_R_LARCH_SUB32 = 55
- const m_R_LARCH_SUB64 = 56
- const m_R_LARCH_SUB8 = 52
- const m_R_LARCH_TLS_DTPMOD32 = 6
- const m_R_LARCH_TLS_DTPMOD64 = 7
- const m_R_LARCH_TLS_DTPREL32 = 8
- const m_R_LARCH_TLS_DTPREL64 = 9
- const m_R_LARCH_TLS_GD_HI20 = 98
- const m_R_LARCH_TLS_GD_PC_HI20 = 97
- const m_R_LARCH_TLS_IE64_HI12 = 94
- const m_R_LARCH_TLS_IE64_LO20 = 93
- const m_R_LARCH_TLS_IE64_PC_HI12 = 90
- const m_R_LARCH_TLS_IE64_PC_LO20 = 89
- const m_R_LARCH_TLS_IE_HI20 = 91
- const m_R_LARCH_TLS_IE_LO12 = 92
- const m_R_LARCH_TLS_IE_PC_HI20 = 87
- const m_R_LARCH_TLS_IE_PC_LO12 = 88
- const m_R_LARCH_TLS_LD_HI20 = 96
- const m_R_LARCH_TLS_LD_PC_HI20 = 95
- const m_R_LARCH_TLS_LE64_HI12 = 86
- const m_R_LARCH_TLS_LE64_LO20 = 85
- const m_R_LARCH_TLS_LE_HI20 = 83
- const m_R_LARCH_TLS_LE_LO12 = 84
- const m_R_LARCH_TLS_TPREL32 = 10
- const m_R_LARCH_TLS_TPREL64 = 11
- const m_R_M32R_10_PCREL = 4
- const m_R_M32R_10_PCREL_RELA = 36
- const m_R_M32R_16 = 1
- const m_R_M32R_16_RELA = 33
- const m_R_M32R_18_PCREL = 5
- const m_R_M32R_18_PCREL_RELA = 37
- const m_R_M32R_24 = 3
- const m_R_M32R_24_RELA = 35
- const m_R_M32R_26_PCREL = 6
- const m_R_M32R_26_PCREL_RELA = 38
- const m_R_M32R_26_PLTREL = 49
- const m_R_M32R_32 = 2
- const m_R_M32R_32_RELA = 34
- const m_R_M32R_COPY = 50
- const m_R_M32R_GLOB_DAT = 51
- const m_R_M32R_GNU_VTENTRY = 12
- const m_R_M32R_GNU_VTINHERIT = 11
- const m_R_M32R_GOT16_HI_SLO = 57
- const m_R_M32R_GOT16_HI_ULO = 56
- const m_R_M32R_GOT16_LO = 58
- const m_R_M32R_GOT24 = 48
- const m_R_M32R_GOTOFF = 54
- const m_R_M32R_GOTOFF_HI_SLO = 63
- const m_R_M32R_GOTOFF_HI_ULO = 62
- const m_R_M32R_GOTOFF_LO = 64
- const m_R_M32R_GOTPC24 = 55
- const m_R_M32R_GOTPC_HI_SLO = 60
- const m_R_M32R_GOTPC_HI_ULO = 59
- const m_R_M32R_GOTPC_LO = 61
- const m_R_M32R_HI16_SLO = 8
- const m_R_M32R_HI16_SLO_RELA = 40
- const m_R_M32R_HI16_ULO = 7
- const m_R_M32R_HI16_ULO_RELA = 39
- const m_R_M32R_JMP_SLOT = 52
- const m_R_M32R_LO16 = 9
- const m_R_M32R_LO16_RELA = 41
- const m_R_M32R_NONE = 0
- const m_R_M32R_NUM = 256
- const m_R_M32R_REL32 = 45
- const m_R_M32R_RELATIVE = 53
- const m_R_M32R_RELA_GNU_VTENTRY = 44
- const m_R_M32R_RELA_GNU_VTINHERIT = 43
- const m_R_M32R_SDA16 = 10
- const m_R_M32R_SDA16_RELA = 42
- const m_R_MICROBLAZE_32 = 1
- const m_R_MICROBLAZE_32_LO = 6
- const m_R_MICROBLAZE_32_PCREL = 2
- const m_R_MICROBLAZE_32_PCREL_LO = 4
- const m_R_MICROBLAZE_32_SYM_OP_SYM = 10
- const m_R_MICROBLAZE_64 = 5
- const m_R_MICROBLAZE_64_NONE = 9
- const m_R_MICROBLAZE_64_PCREL = 3
- const m_R_MICROBLAZE_COPY = 21
- const m_R_MICROBLAZE_GLOB_DAT = 18
- const m_R_MICROBLAZE_GNU_VTENTRY = 12
- const m_R_MICROBLAZE_GNU_VTINHERIT = 11
- const m_R_MICROBLAZE_GOTOFF_32 = 20
- const m_R_MICROBLAZE_GOTOFF_64 = 19
- const m_R_MICROBLAZE_GOTPC_64 = 13
- const m_R_MICROBLAZE_GOT_64 = 14
- const m_R_MICROBLAZE_JUMP_SLOT = 17
- const m_R_MICROBLAZE_NONE = 0
- const m_R_MICROBLAZE_PLT_64 = 15
- const m_R_MICROBLAZE_REL = 16
- const m_R_MICROBLAZE_SRO32 = 7
- const m_R_MICROBLAZE_SRW32 = 8
- const m_R_MICROBLAZE_TLS = 22
- const m_R_MICROBLAZE_TLSDTPMOD32 = 25
- const m_R_MICROBLAZE_TLSDTPREL32 = 26
- const m_R_MICROBLAZE_TLSDTPREL64 = 27
- const m_R_MICROBLAZE_TLSGD = 23
- const m_R_MICROBLAZE_TLSGOTTPREL32 = 28
- const m_R_MICROBLAZE_TLSLD = 24
- const m_R_MICROBLAZE_TLSTPREL32 = 29
- const m_R_MIPS_16 = 1
- const m_R_MIPS_26 = 4
- const m_R_MIPS_32 = 2
- const m_R_MIPS_64 = 18
- const m_R_MIPS_ADD_IMMEDIATE = 34
- const m_R_MIPS_CALL16 = 11
- const m_R_MIPS_CALL_HI16 = 30
- const m_R_MIPS_CALL_LO16 = 31
- const m_R_MIPS_COPY = 126
- const m_R_MIPS_DELETE = 27
- const m_R_MIPS_GLOB_DAT = 51
- const m_R_MIPS_GOT16 = 9
- const m_R_MIPS_GOT_DISP = 19
- const m_R_MIPS_GOT_HI16 = 22
- const m_R_MIPS_GOT_LO16 = 23
- const m_R_MIPS_GOT_OFST = 21
- const m_R_MIPS_GOT_PAGE = 20
- const m_R_MIPS_GPREL16 = 7
- const m_R_MIPS_GPREL32 = 12
- const m_R_MIPS_HI16 = 5
- const m_R_MIPS_HIGHER = 28
- const m_R_MIPS_HIGHEST = 29
- const m_R_MIPS_INSERT_A = 25
- const m_R_MIPS_INSERT_B = 26
- const m_R_MIPS_JALR = 37
- const m_R_MIPS_JUMP_SLOT = 127
- const m_R_MIPS_LITERAL = 8
- const m_R_MIPS_LO16 = 6
- const m_R_MIPS_NONE = 0
- const m_R_MIPS_NUM = 128
- const m_R_MIPS_PC16 = 10
- const m_R_MIPS_PJUMP = 35
- const m_R_MIPS_REL16 = 33
- const m_R_MIPS_REL32 = 3
- const m_R_MIPS_RELGOT = 36
- const m_R_MIPS_SCN_DISP = 32
- const m_R_MIPS_SHIFT5 = 16
- const m_R_MIPS_SHIFT6 = 17
- const m_R_MIPS_SUB = 24
- const m_R_MIPS_TLS_DTPMOD32 = 38
- const m_R_MIPS_TLS_DTPMOD64 = 40
- const m_R_MIPS_TLS_DTPREL32 = 39
- const m_R_MIPS_TLS_DTPREL64 = 41
- const m_R_MIPS_TLS_DTPREL_HI16 = 44
- const m_R_MIPS_TLS_DTPREL_LO16 = 45
- const m_R_MIPS_TLS_GD = 42
- const m_R_MIPS_TLS_GOTTPREL = 46
- const m_R_MIPS_TLS_LDM = 43
- const m_R_MIPS_TLS_TPREL32 = 47
- const m_R_MIPS_TLS_TPREL64 = 48
- const m_R_MIPS_TLS_TPREL_HI16 = 49
- const m_R_MIPS_TLS_TPREL_LO16 = 50
- const m_R_MN10300_16 = 2
- const m_R_MN10300_24 = 9
- const m_R_MN10300_32 = 1
- const m_R_MN10300_8 = 3
- const m_R_MN10300_COPY = 20
- const m_R_MN10300_GLOB_DAT = 21
- const m_R_MN10300_GNU_VTENTRY = 8
- const m_R_MN10300_GNU_VTINHERIT = 7
- const m_R_MN10300_GOT16 = 19
- const m_R_MN10300_GOT24 = 18
- const m_R_MN10300_GOT32 = 17
- const m_R_MN10300_GOTOFF16 = 14
- const m_R_MN10300_GOTOFF24 = 13
- const m_R_MN10300_GOTOFF32 = 12
- const m_R_MN10300_GOTPC16 = 11
- const m_R_MN10300_GOTPC32 = 10
- const m_R_MN10300_JMP_SLOT = 22
- const m_R_MN10300_NONE = 0
- const m_R_MN10300_NUM = 24
- const m_R_MN10300_PCREL16 = 5
- const m_R_MN10300_PCREL32 = 4
- const m_R_MN10300_PCREL8 = 6
- const m_R_MN10300_PLT16 = 16
- const m_R_MN10300_PLT32 = 15
- const m_R_MN10300_RELATIVE = 23
- const m_R_NIOS2_ALIGN = 21
- const m_R_NIOS2_BFD_RELOC_16 = 13
- const m_R_NIOS2_BFD_RELOC_32 = 12
- const m_R_NIOS2_BFD_RELOC_8 = 14
- const m_R_NIOS2_CACHE_OPX = 6
- const m_R_NIOS2_CALL16 = 23
- const m_R_NIOS2_CALL26 = 4
- const m_R_NIOS2_CALL26_NOAT = 41
- const m_R_NIOS2_CALLR = 20
- const m_R_NIOS2_CALL_HA = 45
- const m_R_NIOS2_CALL_LO = 44
- const m_R_NIOS2_CJMP = 19
- const m_R_NIOS2_COPY = 36
- const m_R_NIOS2_GLOB_DAT = 37
- const m_R_NIOS2_GNU_VTENTRY = 17
- const m_R_NIOS2_GNU_VTINHERIT = 16
- const m_R_NIOS2_GOT16 = 22
- const m_R_NIOS2_GOTOFF = 40
- const m_R_NIOS2_GOTOFF_HA = 25
- const m_R_NIOS2_GOTOFF_LO = 24
- const m_R_NIOS2_GOT_HA = 43
- const m_R_NIOS2_GOT_LO = 42
- const m_R_NIOS2_GPREL = 15
- const m_R_NIOS2_HI16 = 9
- const m_R_NIOS2_HIADJ16 = 11
- const m_R_NIOS2_IMM5 = 5
- const m_R_NIOS2_IMM6 = 7
- const m_R_NIOS2_IMM8 = 8
- const m_R_NIOS2_JUMP_SLOT = 38
- const m_R_NIOS2_LO16 = 10
- const m_R_NIOS2_NONE = 0
- const m_R_NIOS2_PCREL16 = 3
- const m_R_NIOS2_PCREL_HA = 27
- const m_R_NIOS2_PCREL_LO = 26
- const m_R_NIOS2_RELATIVE = 39
- const m_R_NIOS2_S16 = 1
- const m_R_NIOS2_TLS_DTPMOD = 33
- const m_R_NIOS2_TLS_DTPREL = 34
- const m_R_NIOS2_TLS_GD16 = 28
- const m_R_NIOS2_TLS_IE16 = 31
- const m_R_NIOS2_TLS_LDM16 = 29
- const m_R_NIOS2_TLS_LDO16 = 30
- const m_R_NIOS2_TLS_LE16 = 32
- const m_R_NIOS2_TLS_TPREL = 35
- const m_R_NIOS2_U16 = 2
- const m_R_NIOS2_UJMP = 18
- const m_R_OR1K_16 = 2
- const m_R_OR1K_16_PCREL = 10
- const m_R_OR1K_32 = 1
- const m_R_OR1K_32_PCREL = 9
- const m_R_OR1K_8 = 3
- const m_R_OR1K_8_PCREL = 11
- const m_R_OR1K_COPY = 18
- const m_R_OR1K_GLOB_DAT = 19
- const m_R_OR1K_GNU_VTENTRY = 7
- const m_R_OR1K_GNU_VTINHERIT = 8
- const m_R_OR1K_GOT16 = 14
- const m_R_OR1K_GOTOFF_HI16 = 16
- const m_R_OR1K_GOTOFF_LO16 = 17
- const m_R_OR1K_GOTPC_HI16 = 12
- const m_R_OR1K_GOTPC_LO16 = 13
- const m_R_OR1K_HI_16_IN_INSN = 5
- const m_R_OR1K_INSN_REL_26 = 6
- const m_R_OR1K_JMP_SLOT = 20
- const m_R_OR1K_LO_16_IN_INSN = 4
- const m_R_OR1K_NONE = 0
- const m_R_OR1K_PLT26 = 15
- const m_R_OR1K_RELATIVE = 21
- const m_R_OR1K_TLS_DTPMOD = 34
- const m_R_OR1K_TLS_DTPOFF = 33
- const m_R_OR1K_TLS_GD_HI16 = 22
- const m_R_OR1K_TLS_GD_LO16 = 23
- const m_R_OR1K_TLS_IE_HI16 = 28
- const m_R_OR1K_TLS_IE_LO16 = 29
- const m_R_OR1K_TLS_LDM_HI16 = 24
- const m_R_OR1K_TLS_LDM_LO16 = 25
- const m_R_OR1K_TLS_LDO_HI16 = 26
- const m_R_OR1K_TLS_LDO_LO16 = 27
- const m_R_OR1K_TLS_LE_HI16 = 30
- const m_R_OR1K_TLS_LE_LO16 = 31
- const m_R_OR1K_TLS_TPOFF = 32
- const m_R_PARISC_COPY = 128
- const m_R_PARISC_DIR14DR = 84
- const m_R_PARISC_DIR14R = 6
- const m_R_PARISC_DIR14WR = 83
- const m_R_PARISC_DIR16DF = 87
- const m_R_PARISC_DIR16F = 85
- const m_R_PARISC_DIR16WF = 86
- const m_R_PARISC_DIR17F = 4
- const m_R_PARISC_DIR17R = 3
- const m_R_PARISC_DIR21L = 2
- const m_R_PARISC_DIR32 = 1
- const m_R_PARISC_DIR64 = 80
- const m_R_PARISC_DPREL14R = 22
- const m_R_PARISC_DPREL21L = 18
- const m_R_PARISC_EPLT = 130
- const m_R_PARISC_FPTR64 = 64
- const m_R_PARISC_GNU_VTENTRY = 232
- const m_R_PARISC_GNU_VTINHERIT = 233
- const m_R_PARISC_GPREL14DR = 92
- const m_R_PARISC_GPREL14R = 30
- const m_R_PARISC_GPREL14WR = 91
- const m_R_PARISC_GPREL16DF = 95
- const m_R_PARISC_GPREL16F = 93
- const m_R_PARISC_GPREL16WF = 94
- const m_R_PARISC_GPREL21L = 26
- const m_R_PARISC_GPREL64 = 88
- const m_R_PARISC_HIRESERVE = 255
- const m_R_PARISC_IPLT = 129
- const m_R_PARISC_LORESERVE = 128
- const m_R_PARISC_LTOFF14DR = 100
- const m_R_PARISC_LTOFF14R = 38
- const m_R_PARISC_LTOFF14WR = 99
- const m_R_PARISC_LTOFF16DF = 103
- const m_R_PARISC_LTOFF16F = 101
- const m_R_PARISC_LTOFF16WF = 102
- const m_R_PARISC_LTOFF21L = 34
- const m_R_PARISC_LTOFF64 = 96
- const m_R_PARISC_LTOFF_FPTR14DR = 124
- const m_R_PARISC_LTOFF_FPTR14R = 62
- const m_R_PARISC_LTOFF_FPTR14WR = 123
- const m_R_PARISC_LTOFF_FPTR16DF = 127
- const m_R_PARISC_LTOFF_FPTR16F = 125
- const m_R_PARISC_LTOFF_FPTR16WF = 126
- const m_R_PARISC_LTOFF_FPTR21L = 58
- const m_R_PARISC_LTOFF_FPTR32 = 57
- const m_R_PARISC_LTOFF_FPTR64 = 120
- const m_R_PARISC_LTOFF_TP14DR = 228
- const m_R_PARISC_LTOFF_TP14F = 167
- const m_R_PARISC_LTOFF_TP14R = 166
- const m_R_PARISC_LTOFF_TP14WR = 227
- const m_R_PARISC_LTOFF_TP16DF = 231
- const m_R_PARISC_LTOFF_TP16F = 229
- const m_R_PARISC_LTOFF_TP16WF = 230
- const m_R_PARISC_LTOFF_TP21L = 162
- const m_R_PARISC_LTOFF_TP64 = 224
- const m_R_PARISC_NONE = 0
- const m_R_PARISC_PCREL14DR = 76
- const m_R_PARISC_PCREL14R = 14
- const m_R_PARISC_PCREL14WR = 75
- const m_R_PARISC_PCREL16DF = 79
- const m_R_PARISC_PCREL16F = 77
- const m_R_PARISC_PCREL16WF = 78
- const m_R_PARISC_PCREL17F = 12
- const m_R_PARISC_PCREL17R = 11
- const m_R_PARISC_PCREL21L = 10
- const m_R_PARISC_PCREL22F = 74
- const m_R_PARISC_PCREL32 = 9
- const m_R_PARISC_PCREL64 = 72
- const m_R_PARISC_PLABEL14R = 70
- const m_R_PARISC_PLABEL21L = 66
- const m_R_PARISC_PLABEL32 = 65
- const m_R_PARISC_PLTOFF14DR = 116
- const m_R_PARISC_PLTOFF14R = 54
- const m_R_PARISC_PLTOFF14WR = 115
- const m_R_PARISC_PLTOFF16DF = 119
- const m_R_PARISC_PLTOFF16F = 117
- const m_R_PARISC_PLTOFF16WF = 118
- const m_R_PARISC_PLTOFF21L = 50
- const m_R_PARISC_SECREL32 = 41
- const m_R_PARISC_SECREL64 = 104
- const m_R_PARISC_SEGBASE = 48
- const m_R_PARISC_SEGREL32 = 49
- const m_R_PARISC_SEGREL64 = 112
- const m_R_PARISC_TLS_DTPMOD32 = 242
- const m_R_PARISC_TLS_DTPMOD64 = 243
- const m_R_PARISC_TLS_DTPOFF32 = 244
- const m_R_PARISC_TLS_DTPOFF64 = 245
- const m_R_PARISC_TLS_GD14R = 235
- const m_R_PARISC_TLS_GD21L = 234
- const m_R_PARISC_TLS_GDCALL = 236
- const m_R_PARISC_TLS_IE14R = "R_PARISC_LTOFF_TP14R"
- const m_R_PARISC_TLS_IE21L = "R_PARISC_LTOFF_TP21L"
- const m_R_PARISC_TLS_LDM14R = 238
- const m_R_PARISC_TLS_LDM21L = 237
- const m_R_PARISC_TLS_LDMCALL = 239
- const m_R_PARISC_TLS_LDO14R = 241
- const m_R_PARISC_TLS_LDO21L = 240
- const m_R_PARISC_TLS_LE14R = "R_PARISC_TPREL14R"
- const m_R_PARISC_TLS_LE21L = "R_PARISC_TPREL21L"
- const m_R_PARISC_TLS_TPREL32 = "R_PARISC_TPREL32"
- const m_R_PARISC_TLS_TPREL64 = "R_PARISC_TPREL64"
- const m_R_PARISC_TPREL14DR = 220
- const m_R_PARISC_TPREL14R = 158
- const m_R_PARISC_TPREL14WR = 219
- const m_R_PARISC_TPREL16DF = 223
- const m_R_PARISC_TPREL16F = 221
- const m_R_PARISC_TPREL16WF = 222
- const m_R_PARISC_TPREL21L = 154
- const m_R_PARISC_TPREL32 = 153
- const m_R_PARISC_TPREL64 = 216
- const m_R_PPC64_ADDR14 = "R_PPC_ADDR14"
- const m_R_PPC64_ADDR14_BRNTAKEN = "R_PPC_ADDR14_BRNTAKEN"
- const m_R_PPC64_ADDR14_BRTAKEN = "R_PPC_ADDR14_BRTAKEN"
- const m_R_PPC64_ADDR16 = "R_PPC_ADDR16"
- const m_R_PPC64_ADDR16_DS = 56
- const m_R_PPC64_ADDR16_HA = "R_PPC_ADDR16_HA"
- const m_R_PPC64_ADDR16_HI = "R_PPC_ADDR16_HI"
- const m_R_PPC64_ADDR16_HIGH = 110
- const m_R_PPC64_ADDR16_HIGHA = 111
- const m_R_PPC64_ADDR16_HIGHER = 39
- const m_R_PPC64_ADDR16_HIGHERA = 40
- const m_R_PPC64_ADDR16_HIGHEST = 41
- const m_R_PPC64_ADDR16_HIGHESTA = 42
- const m_R_PPC64_ADDR16_LO = "R_PPC_ADDR16_LO"
- const m_R_PPC64_ADDR16_LO_DS = 57
- const m_R_PPC64_ADDR24 = "R_PPC_ADDR24"
- const m_R_PPC64_ADDR30 = 37
- const m_R_PPC64_ADDR32 = "R_PPC_ADDR32"
- const m_R_PPC64_ADDR64 = 38
- const m_R_PPC64_COPY = "R_PPC_COPY"
- const m_R_PPC64_DTPMOD64 = 68
- const m_R_PPC64_DTPREL16 = 74
- const m_R_PPC64_DTPREL16_DS = 101
- const m_R_PPC64_DTPREL16_HA = 77
- const m_R_PPC64_DTPREL16_HI = 76
- const m_R_PPC64_DTPREL16_HIGH = 114
- const m_R_PPC64_DTPREL16_HIGHA = 115
- const m_R_PPC64_DTPREL16_HIGHER = 103
- const m_R_PPC64_DTPREL16_HIGHERA = 104
- const m_R_PPC64_DTPREL16_HIGHEST = 105
- const m_R_PPC64_DTPREL16_HIGHESTA = 106
- const m_R_PPC64_DTPREL16_LO = 75
- const m_R_PPC64_DTPREL16_LO_DS = 102
- const m_R_PPC64_DTPREL64 = 78
- const m_R_PPC64_GLOB_DAT = "R_PPC_GLOB_DAT"
- const m_R_PPC64_GOT16 = "R_PPC_GOT16"
- const m_R_PPC64_GOT16_DS = 58
- const m_R_PPC64_GOT16_HA = "R_PPC_GOT16_HA"
- const m_R_PPC64_GOT16_HI = "R_PPC_GOT16_HI"
- const m_R_PPC64_GOT16_LO = "R_PPC_GOT16_LO"
- const m_R_PPC64_GOT16_LO_DS = 59
- const m_R_PPC64_GOT_DTPREL16_DS = 91
- const m_R_PPC64_GOT_DTPREL16_HA = 94
- const m_R_PPC64_GOT_DTPREL16_HI = 93
- const m_R_PPC64_GOT_DTPREL16_LO_DS = 92
- const m_R_PPC64_GOT_TLSGD16 = 79
- const m_R_PPC64_GOT_TLSGD16_HA = 82
- const m_R_PPC64_GOT_TLSGD16_HI = 81
- const m_R_PPC64_GOT_TLSGD16_LO = 80
- const m_R_PPC64_GOT_TLSLD16 = 83
- const m_R_PPC64_GOT_TLSLD16_HA = 86
- const m_R_PPC64_GOT_TLSLD16_HI = 85
- const m_R_PPC64_GOT_TLSLD16_LO = 84
- const m_R_PPC64_GOT_TPREL16_DS = 87
- const m_R_PPC64_GOT_TPREL16_HA = 90
- const m_R_PPC64_GOT_TPREL16_HI = 89
- const m_R_PPC64_GOT_TPREL16_LO_DS = 88
- const m_R_PPC64_IRELATIVE = 248
- const m_R_PPC64_JMP_IREL = 247
- const m_R_PPC64_JMP_SLOT = "R_PPC_JMP_SLOT"
- const m_R_PPC64_NONE = "R_PPC_NONE"
- const m_R_PPC64_PLT16_HA = "R_PPC_PLT16_HA"
- const m_R_PPC64_PLT16_HI = "R_PPC_PLT16_HI"
- const m_R_PPC64_PLT16_LO = "R_PPC_PLT16_LO"
- const m_R_PPC64_PLT16_LO_DS = 60
- const m_R_PPC64_PLT32 = "R_PPC_PLT32"
- const m_R_PPC64_PLT64 = 45
- const m_R_PPC64_PLTGOT16 = 52
- const m_R_PPC64_PLTGOT16_DS = 65
- const m_R_PPC64_PLTGOT16_HA = 55
- const m_R_PPC64_PLTGOT16_HI = 54
- const m_R_PPC64_PLTGOT16_LO = 53
- const m_R_PPC64_PLTGOT16_LO_DS = 66
- const m_R_PPC64_PLTREL32 = "R_PPC_PLTREL32"
- const m_R_PPC64_PLTREL64 = 46
- const m_R_PPC64_REL14 = "R_PPC_REL14"
- const m_R_PPC64_REL14_BRNTAKEN = "R_PPC_REL14_BRNTAKEN"
- const m_R_PPC64_REL14_BRTAKEN = "R_PPC_REL14_BRTAKEN"
- const m_R_PPC64_REL16 = 249
- const m_R_PPC64_REL16_HA = 252
- const m_R_PPC64_REL16_HI = 251
- const m_R_PPC64_REL16_LO = 250
- const m_R_PPC64_REL24 = "R_PPC_REL24"
- const m_R_PPC64_REL32 = "R_PPC_REL32"
- const m_R_PPC64_REL64 = 44
- const m_R_PPC64_RELATIVE = "R_PPC_RELATIVE"
- const m_R_PPC64_SECTOFF = "R_PPC_SECTOFF"
- const m_R_PPC64_SECTOFF_DS = 61
- const m_R_PPC64_SECTOFF_HA = "R_PPC_SECTOFF_HA"
- const m_R_PPC64_SECTOFF_HI = "R_PPC_SECTOFF_HI"
- const m_R_PPC64_SECTOFF_LO = "R_PPC_SECTOFF_LO"
- const m_R_PPC64_SECTOFF_LO_DS = 62
- const m_R_PPC64_TLS = 67
- const m_R_PPC64_TLSGD = 107
- const m_R_PPC64_TLSLD = 108
- const m_R_PPC64_TOC = 51
- const m_R_PPC64_TOC16 = 47
- const m_R_PPC64_TOC16_DS = 63
- const m_R_PPC64_TOC16_HA = 50
- const m_R_PPC64_TOC16_HI = 49
- const m_R_PPC64_TOC16_LO = 48
- const m_R_PPC64_TOC16_LO_DS = 64
- const m_R_PPC64_TOCSAVE = 109
- const m_R_PPC64_TPREL16 = 69
- const m_R_PPC64_TPREL16_DS = 95
- const m_R_PPC64_TPREL16_HA = 72
- const m_R_PPC64_TPREL16_HI = 71
- const m_R_PPC64_TPREL16_HIGH = 112
- const m_R_PPC64_TPREL16_HIGHA = 113
- const m_R_PPC64_TPREL16_HIGHER = 97
- const m_R_PPC64_TPREL16_HIGHERA = 98
- const m_R_PPC64_TPREL16_HIGHEST = 99
- const m_R_PPC64_TPREL16_HIGHESTA = 100
- const m_R_PPC64_TPREL16_LO = 70
- const m_R_PPC64_TPREL16_LO_DS = 96
- const m_R_PPC64_TPREL64 = 73
- const m_R_PPC64_UADDR16 = "R_PPC_UADDR16"
- const m_R_PPC64_UADDR32 = "R_PPC_UADDR32"
- const m_R_PPC64_UADDR64 = 43
- const m_R_PPC_ADDR14 = 7
- const m_R_PPC_ADDR14_BRNTAKEN = 9
- const m_R_PPC_ADDR14_BRTAKEN = 8
- const m_R_PPC_ADDR16 = 3
- const m_R_PPC_ADDR16_HA = 6
- const m_R_PPC_ADDR16_HI = 5
- const m_R_PPC_ADDR16_LO = 4
- const m_R_PPC_ADDR24 = 2
- const m_R_PPC_ADDR32 = 1
- const m_R_PPC_COPY = 19
- const m_R_PPC_DIAB_RELSDA_HA = 185
- const m_R_PPC_DIAB_RELSDA_HI = 184
- const m_R_PPC_DIAB_RELSDA_LO = 183
- const m_R_PPC_DIAB_SDA21_HA = 182
- const m_R_PPC_DIAB_SDA21_HI = 181
- const m_R_PPC_DIAB_SDA21_LO = 180
- const m_R_PPC_DTPMOD32 = 68
- const m_R_PPC_DTPREL16 = 74
- const m_R_PPC_DTPREL16_HA = 77
- const m_R_PPC_DTPREL16_HI = 76
- const m_R_PPC_DTPREL16_LO = 75
- const m_R_PPC_DTPREL32 = 78
- const m_R_PPC_EMB_BIT_FLD = 115
- const m_R_PPC_EMB_MRKREF = 110
- const m_R_PPC_EMB_NADDR16 = 102
- const m_R_PPC_EMB_NADDR16_HA = 105
- const m_R_PPC_EMB_NADDR16_HI = 104
- const m_R_PPC_EMB_NADDR16_LO = 103
- const m_R_PPC_EMB_NADDR32 = 101
- const m_R_PPC_EMB_RELSDA = 116
- const m_R_PPC_EMB_RELSEC16 = 111
- const m_R_PPC_EMB_RELST_HA = 114
- const m_R_PPC_EMB_RELST_HI = 113
- const m_R_PPC_EMB_RELST_LO = 112
- const m_R_PPC_EMB_SDA21 = 109
- const m_R_PPC_EMB_SDA2I16 = 107
- const m_R_PPC_EMB_SDA2REL = 108
- const m_R_PPC_EMB_SDAI16 = 106
- const m_R_PPC_GLOB_DAT = 20
- const m_R_PPC_GOT16 = 14
- const m_R_PPC_GOT16_HA = 17
- const m_R_PPC_GOT16_HI = 16
- const m_R_PPC_GOT16_LO = 15
- const m_R_PPC_GOT_DTPREL16 = 91
- const m_R_PPC_GOT_DTPREL16_HA = 94
- const m_R_PPC_GOT_DTPREL16_HI = 93
- const m_R_PPC_GOT_DTPREL16_LO = 92
- const m_R_PPC_GOT_TLSGD16 = 79
- const m_R_PPC_GOT_TLSGD16_HA = 82
- const m_R_PPC_GOT_TLSGD16_HI = 81
- const m_R_PPC_GOT_TLSGD16_LO = 80
- const m_R_PPC_GOT_TLSLD16 = 83
- const m_R_PPC_GOT_TLSLD16_HA = 86
- const m_R_PPC_GOT_TLSLD16_HI = 85
- const m_R_PPC_GOT_TLSLD16_LO = 84
- const m_R_PPC_GOT_TPREL16 = 87
- const m_R_PPC_GOT_TPREL16_HA = 90
- const m_R_PPC_GOT_TPREL16_HI = 89
- const m_R_PPC_GOT_TPREL16_LO = 88
- const m_R_PPC_IRELATIVE = 248
- const m_R_PPC_JMP_SLOT = 21
- const m_R_PPC_LOCAL24PC = 23
- const m_R_PPC_NONE = 0
- const m_R_PPC_PLT16_HA = 31
- const m_R_PPC_PLT16_HI = 30
- const m_R_PPC_PLT16_LO = 29
- const m_R_PPC_PLT32 = 27
- const m_R_PPC_PLTREL24 = 18
- const m_R_PPC_PLTREL32 = 28
- const m_R_PPC_REL14 = 11
- const m_R_PPC_REL14_BRNTAKEN = 13
- const m_R_PPC_REL14_BRTAKEN = 12
- const m_R_PPC_REL16 = 249
- const m_R_PPC_REL16_HA = 252
- const m_R_PPC_REL16_HI = 251
- const m_R_PPC_REL16_LO = 250
- const m_R_PPC_REL24 = 10
- const m_R_PPC_REL32 = 26
- const m_R_PPC_RELATIVE = 22
- const m_R_PPC_SDAREL16 = 32
- const m_R_PPC_SECTOFF = 33
- const m_R_PPC_SECTOFF_HA = 36
- const m_R_PPC_SECTOFF_HI = 35
- const m_R_PPC_SECTOFF_LO = 34
- const m_R_PPC_TLS = 67
- const m_R_PPC_TLSGD = 95
- const m_R_PPC_TLSLD = 96
- const m_R_PPC_TOC16 = 255
- const m_R_PPC_TPREL16 = 69
- const m_R_PPC_TPREL16_HA = 72
- const m_R_PPC_TPREL16_HI = 71
- const m_R_PPC_TPREL16_LO = 70
- const m_R_PPC_TPREL32 = 73
- const m_R_PPC_UADDR16 = 25
- const m_R_PPC_UADDR32 = 24
- const m_R_RISCV_32 = 1
- const m_R_RISCV_32_PCREL = 57
- const m_R_RISCV_64 = 2
- const m_R_RISCV_ADD16 = 34
- const m_R_RISCV_ADD32 = 35
- const m_R_RISCV_ADD64 = 36
- const m_R_RISCV_ADD8 = 33
- const m_R_RISCV_ALIGN = 43
- const m_R_RISCV_BRANCH = 16
- const m_R_RISCV_CALL = 18
- const m_R_RISCV_CALL_PLT = 19
- const m_R_RISCV_COPY = 4
- const m_R_RISCV_GOT32_PCREL = 41
- const m_R_RISCV_GOT_HI20 = 20
- const m_R_RISCV_HI20 = 26
- const m_R_RISCV_IRELATIVE = 58
- const m_R_RISCV_JAL = 17
- const m_R_RISCV_JUMP_SLOT = 5
- const m_R_RISCV_LO12_I = 27
- const m_R_RISCV_LO12_S = 28
- const m_R_RISCV_NONE = 0
- const m_R_RISCV_PCREL_HI20 = 23
- const m_R_RISCV_PCREL_LO12_I = 24
- const m_R_RISCV_PCREL_LO12_S = 25
- const m_R_RISCV_PLT32 = 59
- const m_R_RISCV_RELATIVE = 3
- const m_R_RISCV_RELAX = 51
- const m_R_RISCV_RVC_BRANCH = 44
- const m_R_RISCV_RVC_JUMP = 45
- const m_R_RISCV_RVC_LUI = 46
- const m_R_RISCV_SET16 = 55
- const m_R_RISCV_SET32 = 56
- const m_R_RISCV_SET6 = 53
- const m_R_RISCV_SET8 = 54
- const m_R_RISCV_SET_ULEB128 = 60
- const m_R_RISCV_SUB16 = 38
- const m_R_RISCV_SUB32 = 39
- const m_R_RISCV_SUB6 = 52
- const m_R_RISCV_SUB64 = 40
- const m_R_RISCV_SUB8 = 37
- const m_R_RISCV_SUB_ULEB128 = 61
- const m_R_RISCV_TLSDESC = 12
- const m_R_RISCV_TLSDESC_ADD_LO12 = 64
- const m_R_RISCV_TLSDESC_CALL = 65
- const m_R_RISCV_TLSDESC_HI20 = 62
- const m_R_RISCV_TLSDESC_LOAD_LO12 = 63
- const m_R_RISCV_TLS_DTPMOD32 = 6
- const m_R_RISCV_TLS_DTPMOD64 = 7
- const m_R_RISCV_TLS_DTPREL32 = 8
- const m_R_RISCV_TLS_DTPREL64 = 9
- const m_R_RISCV_TLS_GD_HI20 = 22
- const m_R_RISCV_TLS_GOT_HI20 = 21
- const m_R_RISCV_TLS_TPREL32 = 10
- const m_R_RISCV_TLS_TPREL64 = 11
- const m_R_RISCV_TPREL_ADD = 32
- const m_R_RISCV_TPREL_HI20 = 29
- const m_R_RISCV_TPREL_LO12_I = 30
- const m_R_RISCV_TPREL_LO12_S = 31
- const m_R_SH_ALIGN = 29
- const m_R_SH_CODE = 30
- const m_R_SH_COPY = 162
- const m_R_SH_COUNT = 28
- const m_R_SH_DATA = 31
- const m_R_SH_DIR32 = 1
- const m_R_SH_DIR8BP = 7
- const m_R_SH_DIR8L = 9
- const m_R_SH_DIR8W = 8
- const m_R_SH_DIR8WPL = 5
- const m_R_SH_DIR8WPN = 3
- const m_R_SH_DIR8WPZ = 6
- const m_R_SH_FUNCDESC = 207
- const m_R_SH_FUNCDESC_VALUE = 208
- const m_R_SH_GLOB_DAT = 163
- const m_R_SH_GNU_VTENTRY = 35
- const m_R_SH_GNU_VTINHERIT = 34
- const m_R_SH_GOT20 = 201
- const m_R_SH_GOT32 = 160
- const m_R_SH_GOTFUNCDESC = 203
- const m_R_SH_GOTFUNCDEST20 = 204
- const m_R_SH_GOTOFF = 166
- const m_R_SH_GOTOFF20 = 202
- const m_R_SH_GOTOFFFUNCDESC = 205
- const m_R_SH_GOTOFFFUNCDEST20 = 206
- const m_R_SH_GOTPC = 167
- const m_R_SH_IND12W = 4
- const m_R_SH_JMP_SLOT = 164
- const m_R_SH_LABEL = 32
- const m_R_SH_NONE = 0
- const m_R_SH_NUM = 256
- const m_R_SH_PLT32 = 161
- const m_R_SH_REL32 = 2
- const m_R_SH_RELATIVE = 165
- const m_R_SH_SWITCH16 = 25
- const m_R_SH_SWITCH32 = 26
- const m_R_SH_SWITCH8 = 33
- const m_R_SH_TLS_DTPMOD32 = 149
- const m_R_SH_TLS_DTPOFF32 = 150
- const m_R_SH_TLS_GD_32 = 144
- const m_R_SH_TLS_IE_32 = 147
- const m_R_SH_TLS_LDO_32 = 146
- const m_R_SH_TLS_LD_32 = 145
- const m_R_SH_TLS_LE_32 = 148
- const m_R_SH_TLS_TPOFF32 = 151
- const m_R_SH_USES = 27
- const m_R_SPARC_10 = 30
- const m_R_SPARC_11 = 31
- const m_R_SPARC_13 = 11
- const m_R_SPARC_16 = 2
- const m_R_SPARC_22 = 10
- const m_R_SPARC_32 = 3
- const m_R_SPARC_5 = 44
- const m_R_SPARC_6 = 45
- const m_R_SPARC_64 = 32
- const m_R_SPARC_7 = 43
- const m_R_SPARC_8 = 1
- const m_R_SPARC_COPY = 19
- const m_R_SPARC_DISP16 = 5
- const m_R_SPARC_DISP32 = 6
- const m_R_SPARC_DISP64 = 46
- const m_R_SPARC_DISP8 = 4
- const m_R_SPARC_GLOB_DAT = 20
- const m_R_SPARC_GLOB_JMP = 42
- const m_R_SPARC_GNU_VTENTRY = 251
- const m_R_SPARC_GNU_VTINHERIT = 250
- const m_R_SPARC_GOT10 = 13
- const m_R_SPARC_GOT13 = 14
- const m_R_SPARC_GOT22 = 15
- const m_R_SPARC_GOTDATA_HIX22 = 80
- const m_R_SPARC_GOTDATA_LOX10 = 81
- const m_R_SPARC_GOTDATA_OP = 84
- const m_R_SPARC_GOTDATA_OP_HIX22 = 82
- const m_R_SPARC_GOTDATA_OP_LOX10 = 83
- const m_R_SPARC_H34 = 85
- const m_R_SPARC_H44 = 50
- const m_R_SPARC_HH22 = 34
- const m_R_SPARC_HI22 = 9
- const m_R_SPARC_HIPLT22 = 25
- const m_R_SPARC_HIX22 = 48
- const m_R_SPARC_HM10 = 35
- const m_R_SPARC_JMP_SLOT = 21
- const m_R_SPARC_L44 = 52
- const m_R_SPARC_LM22 = 36
- const m_R_SPARC_LO10 = 12
- const m_R_SPARC_LOPLT10 = 26
- const m_R_SPARC_LOX10 = 49
- const m_R_SPARC_M44 = 51
- const m_R_SPARC_NONE = 0
- const m_R_SPARC_NUM = 253
- const m_R_SPARC_OLO10 = 33
- const m_R_SPARC_PC10 = 16
- const m_R_SPARC_PC22 = 17
- const m_R_SPARC_PCPLT10 = 29
- const m_R_SPARC_PCPLT22 = 28
- const m_R_SPARC_PCPLT32 = 27
- const m_R_SPARC_PC_HH22 = 37
- const m_R_SPARC_PC_HM10 = 38
- const m_R_SPARC_PC_LM22 = 39
- const m_R_SPARC_PLT32 = 24
- const m_R_SPARC_PLT64 = 47
- const m_R_SPARC_REGISTER = 53
- const m_R_SPARC_RELATIVE = 22
- const m_R_SPARC_REV32 = 252
- const m_R_SPARC_SIZE32 = 86
- const m_R_SPARC_SIZE64 = 87
- const m_R_SPARC_TLS_DTPMOD32 = 74
- const m_R_SPARC_TLS_DTPMOD64 = 75
- const m_R_SPARC_TLS_DTPOFF32 = 76
- const m_R_SPARC_TLS_DTPOFF64 = 77
- const m_R_SPARC_TLS_GD_ADD = 58
- const m_R_SPARC_TLS_GD_CALL = 59
- const m_R_SPARC_TLS_GD_HI22 = 56
- const m_R_SPARC_TLS_GD_LO10 = 57
- const m_R_SPARC_TLS_IE_ADD = 71
- const m_R_SPARC_TLS_IE_HI22 = 67
- const m_R_SPARC_TLS_IE_LD = 69
- const m_R_SPARC_TLS_IE_LDX = 70
- const m_R_SPARC_TLS_IE_LO10 = 68
- const m_R_SPARC_TLS_LDM_ADD = 62
- const m_R_SPARC_TLS_LDM_CALL = 63
- const m_R_SPARC_TLS_LDM_HI22 = 60
- const m_R_SPARC_TLS_LDM_LO10 = 61
- const m_R_SPARC_TLS_LDO_ADD = 66
- const m_R_SPARC_TLS_LDO_HIX22 = 64
- const m_R_SPARC_TLS_LDO_LOX10 = 65
- const m_R_SPARC_TLS_LE_HIX22 = 72
- const m_R_SPARC_TLS_LE_LOX10 = 73
- const m_R_SPARC_TLS_TPOFF32 = 78
- const m_R_SPARC_TLS_TPOFF64 = 79
- const m_R_SPARC_UA16 = 55
- const m_R_SPARC_UA32 = 23
- const m_R_SPARC_UA64 = 54
- const m_R_SPARC_WDISP16 = 40
- const m_R_SPARC_WDISP19 = 41
- const m_R_SPARC_WDISP22 = 8
- const m_R_SPARC_WDISP30 = 7
- const m_R_SPARC_WPLT30 = 18
- const m_R_X86_64_16 = 12
- const m_R_X86_64_32 = 10
- const m_R_X86_64_32S = 11
- const m_R_X86_64_64 = 1
- const m_R_X86_64_8 = 14
- const m_R_X86_64_COPY = 5
- const m_R_X86_64_DTPMOD64 = 16
- const m_R_X86_64_DTPOFF32 = 21
- const m_R_X86_64_DTPOFF64 = 17
- const m_R_X86_64_GLOB_DAT = 6
- const m_R_X86_64_GOT32 = 3
- const m_R_X86_64_GOT64 = 27
- const m_R_X86_64_GOTOFF64 = 25
- const m_R_X86_64_GOTPC32 = 26
- const m_R_X86_64_GOTPC32_TLSDESC = 34
- const m_R_X86_64_GOTPC64 = 29
- const m_R_X86_64_GOTPCREL = 9
- const m_R_X86_64_GOTPCREL64 = 28
- const m_R_X86_64_GOTPCRELX = 41
- const m_R_X86_64_GOTPLT64 = 30
- const m_R_X86_64_GOTTPOFF = 22
- const m_R_X86_64_IRELATIVE = 37
- const m_R_X86_64_JUMP_SLOT = 7
- const m_R_X86_64_NONE = 0
- const m_R_X86_64_NUM = 43
- const m_R_X86_64_PC16 = 13
- const m_R_X86_64_PC32 = 2
- const m_R_X86_64_PC64 = 24
- const m_R_X86_64_PC8 = 15
- const m_R_X86_64_PLT32 = 4
- const m_R_X86_64_PLTOFF64 = 31
- const m_R_X86_64_RELATIVE = 8
- const m_R_X86_64_RELATIVE64 = 38
- const m_R_X86_64_REX_GOTPCRELX = 42
- const m_R_X86_64_SIZE32 = 32
- const m_R_X86_64_SIZE64 = 33
- const m_R_X86_64_TLSDESC = 36
- const m_R_X86_64_TLSDESC_CALL = 35
- const m_R_X86_64_TLSGD = 19
- const m_R_X86_64_TLSLD = 20
- const m_R_X86_64_TPOFF32 = 23
- const m_R_X86_64_TPOFF64 = 18
- const m_SELFMAG = 4
- const m_SHF_ALPHA_GPREL = 0x10000000
- const m_SHF_ARM_COMDEF = 0x80000000
- const m_SHF_ARM_ENTRYSECT = 0x10000000
- const m_SHF_IA_64_NORECOV = 0x20000000
- const m_SHF_IA_64_SHORT = 0x10000000
- const m_SHF_MASKOS = 0x0ff00000
- const m_SHF_MASKPROC = 0xf0000000
- const m_SHF_MIPS_ADDR = 0x40000000
- const m_SHF_MIPS_GPREL = 0x10000000
- const m_SHF_MIPS_LOCAL = 0x04000000
- const m_SHF_MIPS_MERGE = 0x20000000
- const m_SHF_MIPS_NAMES = 0x02000000
- const m_SHF_MIPS_NODUPE = 0x01000000
- const m_SHF_MIPS_NOSTRIP = 0x08000000
- const m_SHF_MIPS_STRINGS = 0x80000000
- const m_SHF_PARISC_HUGE = 0x40000000
- const m_SHF_PARISC_SBP = 0x80000000
- const m_SHF_PARISC_SHORT = 0x20000000
- const m_SHN_ABS = 65521
- const m_SHN_AFTER = 0xff01
- const m_SHN_BEFORE = 0xff00
- const m_SHN_COMMON = 65522
- const m_SHN_HIOS = 0xff3f
- const m_SHN_HIPROC = 0xff1f
- const m_SHN_HIRESERVE = 0xffff
- const m_SHN_LOOS = 0xff20
- const m_SHN_LOPROC = 0xff00
- const m_SHN_LORESERVE = 0xff00
- const m_SHN_MIPS_ACOMMON = 0xff00
- const m_SHN_MIPS_DATA = 0xff02
- const m_SHN_MIPS_SCOMMON = 0xff03
- const m_SHN_MIPS_SUNDEFINED = 0xff04
- const m_SHN_MIPS_TEXT = 0xff01
- const m_SHN_PARISC_ANSI_COMMON = 0xff00
- const m_SHN_PARISC_HUGE_COMMON = 0xff01
- const m_SHN_UNDEF = 0
- const m_SHN_XINDEX = 0xffff
- const m_SHT_ALPHA_DEBUG = 0x70000001
- const m_SHT_ALPHA_REGINFO = 0x70000002
- const m_SHT_CHECKSUM = 0x6ffffff8
- const m_SHT_DYNAMIC = 6
- const m_SHT_DYNSYM = 11
- const m_SHT_FINI_ARRAY = 15
- const m_SHT_GNU_ATTRIBUTES = 0x6ffffff5
- const m_SHT_GNU_HASH = 0x6ffffff6
- const m_SHT_GNU_LIBLIST = 0x6ffffff7
- const m_SHT_GNU_verdef = 0x6ffffffd
- const m_SHT_GNU_verneed = 0x6ffffffe
- const m_SHT_GNU_versym = 0x6fffffff
- const m_SHT_GROUP = 17
- const m_SHT_HASH = 5
- const m_SHT_HIOS = 0x6fffffff
- const m_SHT_HIPROC = 0x7fffffff
- const m_SHT_HISUNW = 0x6fffffff
- const m_SHT_HIUSER = 0x8fffffff
- const m_SHT_INIT_ARRAY = 14
- const m_SHT_LOOS = 0x60000000
- const m_SHT_LOPROC = 0x70000000
- const m_SHT_LOSUNW = 0x6ffffffa
- const m_SHT_LOUSER = 0x80000000
- const m_SHT_MIPS_AUXSYM = 0x70000016
- const m_SHT_MIPS_CONFLICT = 0x70000002
- const m_SHT_MIPS_CONTENT = 0x7000000c
- const m_SHT_MIPS_DEBUG = 0x70000005
- const m_SHT_MIPS_DELTACLASS = 0x7000001d
- const m_SHT_MIPS_DELTADECL = 0x7000001f
- const m_SHT_MIPS_DELTAINST = 0x7000001c
- const m_SHT_MIPS_DELTASYM = 0x7000001b
- const m_SHT_MIPS_DENSE = 0x70000013
- const m_SHT_MIPS_DWARF = 0x7000001e
- const m_SHT_MIPS_EH_REGION = 0x70000027
- const m_SHT_MIPS_EVENTS = 0x70000021
- const m_SHT_MIPS_EXTSYM = 0x70000012
- const m_SHT_MIPS_FDESC = 0x70000011
- const m_SHT_MIPS_GPTAB = 0x70000003
- const m_SHT_MIPS_IFACE = 0x7000000b
- const m_SHT_MIPS_LIBLIST = 0x70000000
- const m_SHT_MIPS_LINE = 0x70000019
- const m_SHT_MIPS_LOCSTR = 0x70000018
- const m_SHT_MIPS_LOCSYM = 0x70000015
- const m_SHT_MIPS_MSYM = 0x70000001
- const m_SHT_MIPS_OPTIONS = 0x7000000d
- const m_SHT_MIPS_OPTSYM = 0x70000017
- const m_SHT_MIPS_PACKAGE = 0x70000007
- const m_SHT_MIPS_PACKSYM = 0x70000008
- const m_SHT_MIPS_PDESC = 0x70000014
- const m_SHT_MIPS_PDR_EXCEPTION = 0x70000029
- const m_SHT_MIPS_PIXIE = 0x70000023
- const m_SHT_MIPS_REGINFO = 0x70000006
- const m_SHT_MIPS_RELD = 0x70000009
- const m_SHT_MIPS_RFDESC = 0x7000001a
- const m_SHT_MIPS_SHDR = 0x70000010
- const m_SHT_MIPS_SYMBOL_LIB = 0x70000020
- const m_SHT_MIPS_TRANSLATE = 0x70000022
- const m_SHT_MIPS_UCODE = 0x70000004
- const m_SHT_MIPS_WHIRL = 0x70000026
- const m_SHT_MIPS_XLATE = 0x70000024
- const m_SHT_MIPS_XLATE_DEBUG = 0x70000025
- const m_SHT_MIPS_XLATE_OLD = 0x70000028
- const m_SHT_NOBITS = 8
- const m_SHT_NOTE = 7
- const m_SHT_NULL = 0
- const m_SHT_NUM = 20
- const m_SHT_PARISC_DOC = 0x70000002
- const m_SHT_PARISC_EXT = 0x70000000
- const m_SHT_PARISC_UNWIND = 0x70000001
- const m_SHT_PREINIT_ARRAY = 16
- const m_SHT_PROGBITS = 1
- const m_SHT_REL = 9
- const m_SHT_RELA = 4
- const m_SHT_RELR = 19
- const m_SHT_SHLIB = 10
- const m_SHT_STRTAB = 3
- const m_SHT_SUNW_COMDAT = 0x6ffffffb
- const m_SHT_SUNW_move = 0x6ffffffa
- const m_SHT_SUNW_syminfo = 0x6ffffffc
- const m_SHT_SYMTAB = 2
- const m_SHT_SYMTAB_SHNDX = 18
- const m_STB_GLOBAL = 1
- const m_STB_GNU_UNIQUE = 10
- const m_STB_HIOS = 12
- const m_STB_HIPROC = 15
- const m_STB_LOCAL = 0
- const m_STB_LOOS = 10
- const m_STB_LOPROC = 13
- const m_STB_MIPS_SPLIT_COMMON = 13
- const m_STB_NUM = 3
- const m_STB_WEAK = 2
- const m_STN_UNDEF = 0
- const m_STO_ALPHA_NOPV = 0x80
- const m_STO_ALPHA_STD_GPLOAD = 0x88
- const m_STO_MIPS_DEFAULT = 0x0
- const m_STO_MIPS_HIDDEN = 0x2
- const m_STO_MIPS_INTERNAL = 0x1
- const m_STO_MIPS_PLT = 0x8
- const m_STO_MIPS_PROTECTED = 0x3
- const m_STO_MIPS_SC_ALIGN_UNUSED = 0xff
- const m_STO_PPC64_LOCAL_BIT = 5
- const m_STO_PPC64_LOCAL_MASK = 0xe0
- const m_STT_ARM_16BIT = "STT_HIPROC"
- const m_STT_ARM_TFUNC = "STT_LOPROC"
- const m_STT_COMMON = 5
- const m_STT_FILE = 4
- const m_STT_FUNC = 2
- const m_STT_GNU_IFUNC = 10
- const m_STT_HIOS = 12
- const m_STT_HIPROC = 15
- const m_STT_LOOS = 10
- const m_STT_LOPROC = 13
- const m_STT_NOTYPE = 0
- const m_STT_NUM = 7
- const m_STT_OBJECT = 1
- const m_STT_PARISC_MILLICODE = 13
- const m_STT_SECTION = 3
- const m_STT_SPARC_REGISTER = 13
- const m_STT_TLS = 6
- const m_STV_DEFAULT = 0
- const m_STV_HIDDEN = 2
- const m_STV_INTERNAL = 1
- const m_STV_PROTECTED = 3
- const m_SYMINFO_BT_LOWRESERVE = 0xff00
- const m_SYMINFO_BT_PARENT = 0xfffe
- const m_SYMINFO_BT_SELF = 0xffff
- const m_SYMINFO_CURRENT = 1
- const m_SYMINFO_FLG_COPY = 0x0004
- const m_SYMINFO_FLG_DIRECT = 0x0001
- const m_SYMINFO_FLG_LAZYLOAD = 0x0008
- const m_SYMINFO_FLG_PASSTHRU = 0x0002
- const m_SYMINFO_NONE = 0
- const m_SYMINFO_NUM = 2
- const m_VER_DEF_CURRENT = 1
- const m_VER_DEF_NONE = 0
- const m_VER_DEF_NUM = 2
- const m_VER_FLG_BASE = 0x1
- const m_VER_FLG_WEAK = 0x2
- const m_VER_NDX_ELIMINATE = 0xff01
- const m_VER_NDX_GLOBAL = 1
- const m_VER_NDX_LOCAL = 0
- const m_VER_NDX_LORESERVE = 0xff00
- const m_VER_NEED_CURRENT = 1
- const m_VER_NEED_NONE = 0
- const m_VER_NEED_NUM = 2
- const m_n_hash = "n_desc"
- type Tnlist = struct {
- F__ccgo0_0 struct {
- Fn_un [0]struct {
- Fn_next [0]uintptr
- Fn_strx [0]int32
- Fn_name uintptr
- }
- Fn_name uintptr
- }
- Fn_type uint8
- Fn_other int8
- Fn_desc int16
- Fn_value uint32
- }
- type TElf32_Half = uint16
- type TElf64_Half = uint16
- type TElf32_Word = uint32
- type TElf32_Sword = int32
- type TElf64_Word = uint32
- type TElf64_Sword = int32
- type TElf32_Xword = uint64
- type TElf32_Sxword = int64
- type TElf64_Xword = uint64
- type TElf64_Sxword = int64
- type TElf32_Addr = uint32
- type TElf64_Addr = uint64
- type TElf32_Off = uint32
- type TElf64_Off = uint64
- type TElf32_Section = uint16
- type TElf64_Section = uint16
- type TElf32_Versym = uint16
- type TElf64_Versym = uint16
- type TElf32_Ehdr = struct {
- Fe_ident [16]uint8
- Fe_type TElf32_Half
- Fe_machine TElf32_Half
- Fe_version TElf32_Word
- Fe_entry TElf32_Addr
- Fe_phoff TElf32_Off
- Fe_shoff TElf32_Off
- Fe_flags TElf32_Word
- Fe_ehsize TElf32_Half
- Fe_phentsize TElf32_Half
- Fe_phnum TElf32_Half
- Fe_shentsize TElf32_Half
- Fe_shnum TElf32_Half
- Fe_shstrndx TElf32_Half
- }
- type TElf64_Ehdr = struct {
- Fe_ident [16]uint8
- Fe_type TElf64_Half
- Fe_machine TElf64_Half
- Fe_version TElf64_Word
- Fe_entry TElf64_Addr
- Fe_phoff TElf64_Off
- Fe_shoff TElf64_Off
- Fe_flags TElf64_Word
- Fe_ehsize TElf64_Half
- Fe_phentsize TElf64_Half
- Fe_phnum TElf64_Half
- Fe_shentsize TElf64_Half
- Fe_shnum TElf64_Half
- Fe_shstrndx TElf64_Half
- }
- type TElf32_Shdr = struct {
- Fsh_name TElf32_Word
- Fsh_type TElf32_Word
- Fsh_flags TElf32_Word
- Fsh_addr TElf32_Addr
- Fsh_offset TElf32_Off
- Fsh_size TElf32_Word
- Fsh_link TElf32_Word
- Fsh_info TElf32_Word
- Fsh_addralign TElf32_Word
- Fsh_entsize TElf32_Word
- }
- type TElf64_Shdr = struct {
- Fsh_name TElf64_Word
- Fsh_type TElf64_Word
- Fsh_flags TElf64_Xword
- Fsh_addr TElf64_Addr
- Fsh_offset TElf64_Off
- Fsh_size TElf64_Xword
- Fsh_link TElf64_Word
- Fsh_info TElf64_Word
- Fsh_addralign TElf64_Xword
- Fsh_entsize TElf64_Xword
- }
- type TElf32_Chdr = struct {
- Fch_type TElf32_Word
- Fch_size TElf32_Word
- Fch_addralign TElf32_Word
- }
- type TElf64_Chdr = struct {
- Fch_type TElf64_Word
- Fch_reserved TElf64_Word
- Fch_size TElf64_Xword
- Fch_addralign TElf64_Xword
- }
- type TElf32_Sym = struct {
- Fst_name TElf32_Word
- Fst_value TElf32_Addr
- Fst_size TElf32_Word
- Fst_info uint8
- Fst_other uint8
- Fst_shndx TElf32_Section
- }
- type TElf64_Sym = struct {
- Fst_name TElf64_Word
- Fst_info uint8
- Fst_other uint8
- Fst_shndx TElf64_Section
- Fst_value TElf64_Addr
- Fst_size TElf64_Xword
- }
- type TElf32_Syminfo = struct {
- Fsi_boundto TElf32_Half
- Fsi_flags TElf32_Half
- }
- type TElf64_Syminfo = struct {
- Fsi_boundto TElf64_Half
- Fsi_flags TElf64_Half
- }
- type TElf32_Rel = struct {
- Fr_offset TElf32_Addr
- Fr_info TElf32_Word
- }
- type TElf64_Rel = struct {
- Fr_offset TElf64_Addr
- Fr_info TElf64_Xword
- }
- type TElf32_Rela = struct {
- Fr_offset TElf32_Addr
- Fr_info TElf32_Word
- Fr_addend TElf32_Sword
- }
- type TElf64_Rela = struct {
- Fr_offset TElf64_Addr
- Fr_info TElf64_Xword
- Fr_addend TElf64_Sxword
- }
- type TElf32_Relr = uint32
- type TElf64_Relr = uint64
- type TElf32_Phdr = struct {
- Fp_type TElf32_Word
- Fp_offset TElf32_Off
- Fp_vaddr TElf32_Addr
- Fp_paddr TElf32_Addr
- Fp_filesz TElf32_Word
- Fp_memsz TElf32_Word
- Fp_flags TElf32_Word
- Fp_align TElf32_Word
- }
- type TElf64_Phdr = struct {
- Fp_type TElf64_Word
- Fp_flags TElf64_Word
- Fp_offset TElf64_Off
- Fp_vaddr TElf64_Addr
- Fp_paddr TElf64_Addr
- Fp_filesz TElf64_Xword
- Fp_memsz TElf64_Xword
- Fp_align TElf64_Xword
- }
- type TElf32_Dyn = struct {
- Fd_tag TElf32_Sword
- Fd_un struct {
- Fd_ptr [0]TElf32_Addr
- Fd_val TElf32_Word
- }
- }
- type TElf64_Dyn = struct {
- Fd_tag TElf64_Sxword
- Fd_un struct {
- Fd_ptr [0]TElf64_Addr
- Fd_val TElf64_Xword
- }
- }
- type TElf32_Verdef = struct {
- Fvd_version TElf32_Half
- Fvd_flags TElf32_Half
- Fvd_ndx TElf32_Half
- Fvd_cnt TElf32_Half
- Fvd_hash TElf32_Word
- Fvd_aux TElf32_Word
- Fvd_next TElf32_Word
- }
- type TElf64_Verdef = struct {
- Fvd_version TElf64_Half
- Fvd_flags TElf64_Half
- Fvd_ndx TElf64_Half
- Fvd_cnt TElf64_Half
- Fvd_hash TElf64_Word
- Fvd_aux TElf64_Word
- Fvd_next TElf64_Word
- }
- type TElf32_Verdaux = struct {
- Fvda_name TElf32_Word
- Fvda_next TElf32_Word
- }
- type TElf64_Verdaux = struct {
- Fvda_name TElf64_Word
- Fvda_next TElf64_Word
- }
- type TElf32_Verneed = struct {
- Fvn_version TElf32_Half
- Fvn_cnt TElf32_Half
- Fvn_file TElf32_Word
- Fvn_aux TElf32_Word
- Fvn_next TElf32_Word
- }
- type TElf64_Verneed = struct {
- Fvn_version TElf64_Half
- Fvn_cnt TElf64_Half
- Fvn_file TElf64_Word
- Fvn_aux TElf64_Word
- Fvn_next TElf64_Word
- }
- type TElf32_Vernaux = struct {
- Fvna_hash TElf32_Word
- Fvna_flags TElf32_Half
- Fvna_other TElf32_Half
- Fvna_name TElf32_Word
- Fvna_next TElf32_Word
- }
- type TElf64_Vernaux = struct {
- Fvna_hash TElf64_Word
- Fvna_flags TElf64_Half
- Fvna_other TElf64_Half
- Fvna_name TElf64_Word
- Fvna_next TElf64_Word
- }
- type TElf32_auxv_t = struct {
- Fa_type Tuint32_t
- Fa_un struct {
- Fa_val Tuint32_t
- }
- }
- type TElf64_auxv_t = struct {
- Fa_type Tuint64_t
- Fa_un struct {
- Fa_val Tuint64_t
- }
- }
- type TElf32_Nhdr = struct {
- Fn_namesz TElf32_Word
- Fn_descsz TElf32_Word
- Fn_type TElf32_Word
- }
- type TElf64_Nhdr = struct {
- Fn_namesz TElf64_Word
- Fn_descsz TElf64_Word
- Fn_type TElf64_Word
- }
- type TElf32_Move = struct {
- Fm_value TElf32_Xword
- Fm_info TElf32_Word
- Fm_poffset TElf32_Word
- Fm_repeat TElf32_Half
- Fm_stride TElf32_Half
- }
- type TElf64_Move = struct {
- Fm_value TElf64_Xword
- Fm_info TElf64_Xword
- Fm_poffset TElf64_Xword
- Fm_repeat TElf64_Half
- Fm_stride TElf64_Half
- }
- type TElf32_gptab = struct {
- Fgt_entry [0]struct {
- Fgt_g_value TElf32_Word
- Fgt_bytes TElf32_Word
- }
- Fgt_header struct {
- Fgt_current_g_value TElf32_Word
- Fgt_unused TElf32_Word
- }
- }
- type TElf32_RegInfo = struct {
- Fri_gprmask TElf32_Word
- Fri_cprmask [4]TElf32_Word
- Fri_gp_value TElf32_Sword
- }
- type TElf_Options = struct {
- Fkind uint8
- Fsize uint8
- Fsection TElf32_Section
- Finfo TElf32_Word
- }
- type TElf_Options_Hw = struct {
- Fhwp_flags1 TElf32_Word
- Fhwp_flags2 TElf32_Word
- }
- type TElf32_Lib = struct {
- Fl_name TElf32_Word
- Fl_time_stamp TElf32_Word
- Fl_checksum TElf32_Word
- Fl_version TElf32_Word
- Fl_flags TElf32_Word
- }
- type TElf64_Lib = struct {
- Fl_name TElf64_Word
- Fl_time_stamp TElf64_Word
- Fl_checksum TElf64_Word
- Fl_version TElf64_Word
- Fl_flags TElf64_Word
- }
- type TElf32_Conflict = uint32
- type TElf_MIPS_ABIFlags_v0 = struct {
- Fversion TElf32_Half
- Fisa_level uint8
- Fisa_rev uint8
- Fgpr_size uint8
- Fcpr1_size uint8
- Fcpr2_size uint8
- Ffp_abi uint8
- Fisa_ext TElf32_Word
- Fases TElf32_Word
- Fflags1 TElf32_Word
- Fflags2 TElf32_Word
- }
- const _Val_GNU_MIPS_ABI_FP_ANY = 0
- const _Val_GNU_MIPS_ABI_FP_DOUBLE = 1
- const _Val_GNU_MIPS_ABI_FP_SINGLE = 2
- const _Val_GNU_MIPS_ABI_FP_SOFT = 3
- const _Val_GNU_MIPS_ABI_FP_OLD_64 = 4
- const _Val_GNU_MIPS_ABI_FP_XX = 5
- const _Val_GNU_MIPS_ABI_FP_64 = 6
- const _Val_GNU_MIPS_ABI_FP_64A = 7
- const _Val_GNU_MIPS_ABI_FP_MAX = 7
- // C documentation
- //
- // /*
- // * __elf_is_okay__ - Determine if ehdr really
- // * is ELF and valid for the target platform.
- // *
- // * WARNING: This is NOT an ELF ABI function and
- // * as such its use should be restricted.
- // */
- func ___elf_is_okay__(tls *libc.TLS, ehdr uintptr) (r int32) {
- var retval int32
- _ = retval
- retval = 0
- /*
- * We need to check magic, class size, endianess,
- * and version before we look at the rest of the
- * Elf_Ehdr structure. These few elements are
- * represented in a machine independent fashion.
- */
- 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) {
- /* Now check the machine dependent header */
- 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) {
- retval = int32(1)
- }
- }
- return retval
- }
- // C documentation
- //
- // /*
- // * Convert an Elf_Sym into an nlist structure. This fills in only the
- // * n_value and n_type members.
- // */
- func _elf_sym_to_nlist(tls *libc.TLS, nl uintptr, s uintptr, shdr uintptr, shnum int32) {
- var sh, p5 uintptr
- var v1, v2, v3, v4 int32
- _, _, _, _, _, _ = sh, v1, v2, v3, v4, p5
- (*Tnlist)(unsafe.Pointer(nl)).Fn_value = (*TElf32_Sym)(unsafe.Pointer(s)).Fst_value
- switch libc.Int32FromUint16((*TElf32_Sym)(unsafe.Pointer(s)).Fst_shndx) {
- case m_SHN_UNDEF:
- fallthrough
- case int32(m_SHN_COMMON):
- (*Tnlist)(unsafe.Pointer(nl)).Fn_type = uint8(m_N_UNDF)
- case int32(m_SHN_ABS):
- if libc.Int32FromUint8((*TElf32_Sym)(unsafe.Pointer(s)).Fst_info)&int32(0xf) == int32(m_STT_FILE) {
- v1 = int32(m_N_FN)
- } else {
- v1 = int32(m_N_ABS)
- }
- (*Tnlist)(unsafe.Pointer(nl)).Fn_type = libc.Uint8FromInt32(v1)
- default:
- if libc.Int32FromUint16((*TElf32_Sym)(unsafe.Pointer(s)).Fst_shndx) >= shnum {
- (*Tnlist)(unsafe.Pointer(nl)).Fn_type = uint8(m_N_UNDF)
- } else {
- sh = shdr + uintptr((*TElf32_Sym)(unsafe.Pointer(s)).Fst_shndx)*40
- if (*TElf32_Shdr)(unsafe.Pointer(sh)).Fsh_type == uint32(m_SHT_PROGBITS) {
- if (*TElf32_Shdr)(unsafe.Pointer(sh)).Fsh_flags&libc.Uint32FromInt32(libc.Int32FromInt32(1)<<libc.Int32FromInt32(0)) != 0 {
- v3 = int32(m_N_DATA)
- } else {
- v3 = int32(m_N_TEXT)
- }
- v2 = v3
- } else {
- if (*TElf32_Shdr)(unsafe.Pointer(sh)).Fsh_type == uint32(m_SHT_NOBITS) {
- v4 = int32(m_N_BSS)
- } else {
- v4 = m_N_UNDF
- }
- v2 = v4
- }
- (*Tnlist)(unsafe.Pointer(nl)).Fn_type = libc.Uint8FromInt32(v2)
- }
- break
- }
- 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) {
- p5 = nl + 4
- *(*uint8)(unsafe.Pointer(p5)) = uint8(int32(*(*uint8)(unsafe.Pointer(p5))) | libc.Int32FromInt32(m_N_EXT))
- }
- }
- func X__fdnlist(tls *libc.TLS, fd int32, list uintptr) (r int32) {
- bp := tls.Alloc(16592)
- defer tls.Free(16592)
- var cc, i TElf32_Sword
- var errsave, nent, v6 int32
- var name, p, s, shdr, strtab uintptr
- var shdr_size, size, symsize, symstrsize TElf32_Word
- var symoff, symstroff TElf32_Off
- var v3 uint32
- var _ /* ehdr at bp+16384 */ TElf32_Ehdr
- var _ /* sbuf at bp+0 */ [1024]TElf32_Sym
- var _ /* st at bp+16436 */ Tstat
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cc, errsave, i, name, nent, p, s, shdr, shdr_size, size, strtab, symoff, symsize, symstroff, symstrsize, v3, v6
- symoff = uint32(0)
- symstroff = uint32(0)
- symsize = uint32(0)
- symstrsize = uint32(0)
- nent = -int32(1)
- strtab = libc.UintptrFromInt32(0)
- shdr = libc.UintptrFromInt32(0)
- /* Make sure obj is OK */
- 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 {
- return -int32(1)
- }
- if libc.Int32FromUint16((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shnum) == 0 || uint32((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shentsize) != uint32(40) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ERANGE)
- return -int32(1)
- }
- /* calculate section header table size */
- shdr_size = libc.Uint32FromInt32(libc.Int32FromUint16((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shentsize) * libc.Int32FromUint16((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shnum))
- /* Make sure it's not too big to mmap */
- if libc.Int64FromUint32(shdr_size) > (*(*Tstat)(unsafe.Pointer(bp + 16436))).Fst_size {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EFBIG)
- return -int32(1)
- }
- shdr = libc.Xmalloc(tls, shdr_size)
- if shdr == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- /* Load section header table. */
- if libc.Xpread(tls, fd, shdr, shdr_size, libc.Int64FromUint32((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shoff)) != libc.Int32FromUint32(shdr_size) {
- goto done
- }
- /*
- * Find the symbol table entry and it's corresponding
- * string table entry. Version 1.1 of the ABI states
- * that there is only one symbol table but that this
- * could change in the future.
- */
- i = 0
- for {
- if !(i < libc.Int32FromUint16((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shnum)) {
- break
- }
- if (*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr(i)*40))).Fsh_type == uint32(m_SHT_SYMTAB) {
- if (*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr(i)*40))).Fsh_link >= uint32((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shnum) {
- goto done
- }
- symoff = (*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr(i)*40))).Fsh_offset
- symsize = (*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr(i)*40))).Fsh_size
- symstroff = (*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr((*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr(i)*40))).Fsh_link)*40))).Fsh_offset
- symstrsize = (*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr((*(*TElf32_Shdr)(unsafe.Pointer(shdr + uintptr(i)*40))).Fsh_link)*40))).Fsh_size
- break
- }
- goto _1
- _1:
- ;
- i++
- }
- /* Check for files too large to mmap. */
- if libc.Int64FromUint32(symstrsize) > (*(*Tstat)(unsafe.Pointer(bp + 16436))).Fst_size {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EFBIG)
- goto done
- }
- /*
- * Load string table into our address space. This gives us
- * an easy way to randomly access all the strings, without
- * making the memory allocation permanent as with malloc/free
- * (i.e., munmap will return it to the system).
- */
- strtab = libc.Xmalloc(tls, symstrsize)
- if strtab == libc.UintptrFromInt32(0) {
- goto done
- }
- if libc.Xpread(tls, fd, strtab, symstrsize, libc.Int64FromUint32(symstroff)) != libc.Int32FromUint32(symstrsize) {
- goto done
- }
- /*
- * clean out any left-over information for all valid entries.
- * Type and value defined to be 0 if not found; historical
- * versions cleared other and desc as well. Also figure out
- * the largest string length so don't read any more of the
- * string table than we have to.
- *
- * XXX clearing anything other than n_type and n_value violates
- * the semantics given in the man page.
- */
- nent = 0
- p = list
- for {
- if !!(*(*uintptr)(unsafe.Pointer(p)) == uintptr(0) || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p))))) == 0) {
- break
- }
- (*Tnlist)(unsafe.Pointer(p)).Fn_type = uint8(0)
- (*Tnlist)(unsafe.Pointer(p)).Fn_other = 0
- (*Tnlist)(unsafe.Pointer(p)).Fn_desc = 0
- (*Tnlist)(unsafe.Pointer(p)).Fn_value = uint32(0)
- nent++
- goto _2
- _2:
- ;
- p += 12
- }
- /* Don't process any further if object is stripped. */
- if symoff == uint32(0) {
- goto done
- }
- if libc.Xlseek(tls, fd, libc.Int64FromUint32(symoff), 0) == int64(-int32(1)) {
- nent = -int32(1)
- goto done
- }
- for symsize > uint32(0) && nent > 0 {
- if symsize < libc.Uint32FromInt64(16384) {
- v3 = symsize
- } else {
- v3 = libc.Uint32FromInt64(16384)
- }
- cc = libc.Int32FromUint32(v3)
- if libc.Xread(tls, fd, bp, libc.Uint32FromInt32(cc)) != cc {
- break
- }
- symsize -= libc.Uint32FromInt32(cc)
- s = bp
- for {
- if !(cc > 0 && nent > 0) {
- break
- }
- name = strtab + uintptr((*TElf32_Sym)(unsafe.Pointer(s)).Fst_name)
- if int32(*(*int8)(unsafe.Pointer(name))) == int32('\000') {
- goto _4
- }
- size = symstrsize - (*TElf32_Sym)(unsafe.Pointer(s)).Fst_name
- p = list
- for {
- if !!(*(*uintptr)(unsafe.Pointer(p)) == uintptr(0) || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p))))) == 0) {
- break
- }
- 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 {
- _elf_sym_to_nlist(tls, p, s, shdr, libc.Int32FromUint16((*(*TElf32_Ehdr)(unsafe.Pointer(bp + 16384))).Fe_shnum))
- nent--
- v6 = nent
- if v6 <= 0 {
- break
- }
- }
- goto _5
- _5:
- ;
- p += 12
- }
- goto _4
- _4:
- ;
- s += 16
- cc = TElf32_Sword(uint32(cc) - libc.Uint32FromInt64(16))
- }
- }
- goto done
- done:
- ;
- errsave = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- libc.Xfree(tls, strtab)
- libc.Xfree(tls, shdr)
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = errsave
- return nent
- }
- func Xnlist(tls *libc.TLS, name uintptr, list uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var fd, n int32
- _, _ = fd, n
- if list == libc.UintptrFromInt32(0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return -int32(1)
- }
- fd = libc.Xopen(tls, name, m_O_RDONLY1, libc.VaList(bp+8, 0))
- if fd < 0 {
- return -int32(1)
- }
- n = X__fdnlist(tls, fd, list)
- libc.Xclose(tls, fd)
- return n
- }
- const m_O_CREAT3 = 64
- const m_O_NONBLOCK3 = 2048
- const m_O_TRUNC3 = 512
- const m_O_WRONLY1 = 1
- type Tpidfh = struct {
- Fpf_fd int32
- Fpf_path uintptr
- Fpf_dev Tdev_t
- Fpf_ino Tino_t
- }
- func _pidfile_verify(tls *libc.TLS, pfh uintptr) (r int32) {
- bp := tls.Alloc(144)
- defer tls.Free(144)
- var _ /* sb at bp+0 */ Tstat
- if pfh == libc.UintptrFromInt32(0) || (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd == -int32(1) {
- return int32(m_EINVAL)
- }
- /*
- * Check remembered descriptor.
- */
- if libc.Xfstat(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd, bp) == -int32(1) {
- return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- }
- 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 {
- return int32(m_EINVAL)
- }
- return 0
- }
- func _pidfile_read(tls *libc.TLS, path uintptr, pidptr uintptr) (r int32) {
- bp := tls.Alloc(32)
- defer tls.Free(32)
- var error1, fd, i int32
- var _ /* buf at bp+0 */ [16]int8
- var _ /* endptr at bp+16 */ uintptr
- _, _, _ = error1, fd, i
- fd = libc.Xopen(tls, path, m_O_RDONLY1, 0)
- if fd == -int32(1) {
- return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- }
- i = libc.Xread(tls, fd, bp, libc.Uint32FromInt64(16)-libc.Uint32FromInt32(1))
- error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) /* Remember errno in case close() wants to change it. */
- libc.Xclose(tls, fd)
- if i == -int32(1) {
- return error1
- } else {
- if i == 0 {
- return int32(m_EAGAIN)
- }
- }
- (*(*[16]int8)(unsafe.Pointer(bp)))[i] = int8('\000')
- *(*Tpid_t)(unsafe.Pointer(pidptr)) = int32(libc.Xstrtol(tls, bp, bp+16, int32(10)))
- if *(*uintptr)(unsafe.Pointer(bp + 16)) != bp+uintptr(i) {
- return int32(m_EINVAL)
- }
- return 0
- }
- func Xpidfile_open(tls *libc.TLS, path uintptr, mode Tmode_t, pidptr uintptr) (r uintptr) {
- bp := tls.Alloc(176)
- defer tls.Free(176)
- var count, error1, fd, len1, v2 int32
- var pfh uintptr
- var v3 bool
- var _ /* rqtp at bp+144 */ Ttimespec
- var _ /* sb at bp+0 */ Tstat
- _, _, _, _, _, _, _ = count, error1, fd, len1, pfh, v2, v3
- pfh = libc.Xmalloc(tls, uint32(24))
- if pfh == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- if path == libc.UintptrFromInt32(0) {
- len1 = libc.Xasprintf(tls, pfh+4, __ccgo_ts+304, libc.VaList(bp+168, Xgetprogname(tls)))
- if len1 < 0 {
- libc.Xfree(tls, pfh)
- return libc.UintptrFromInt32(0)
- }
- } else {
- (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path = libc.Xstrdup(tls, path)
- }
- /*
- * Open the PID file and obtain exclusive lock.
- * We truncate PID file here only to remove old PID immediately,
- * PID file will be truncated again in pidfile_write(), so
- * pidfile_write() can be called multiple times.
- */
- 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))
- if fd == -int32(1) {
- if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EAGAIN) {
- if pidptr == libc.UintptrFromInt32(0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EEXIST)
- } else {
- count = int32(20)
- (*(*Ttimespec)(unsafe.Pointer(bp + 144))).Ftv_sec = 0
- (*(*Ttimespec)(unsafe.Pointer(bp + 144))).Ftv_nsec = int32(5000000)
- for {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = _pidfile_read(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path, pidptr)
- if v3 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != int32(m_EAGAIN); !v3 {
- count--
- v2 = count
- }
- if v3 || v2 == 0 {
- break
- }
- libc.Xnanosleep(tls, bp+144, uintptr(0))
- goto _1
- _1:
- }
- if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EAGAIN) {
- *(*Tpid_t)(unsafe.Pointer(pidptr)) = -int32(1)
- }
- if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == 0 || *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EAGAIN) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EEXIST)
- }
- }
- }
- error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- libc.Xfree(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path)
- libc.Xfree(tls, pfh)
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
- return libc.UintptrFromInt32(0)
- }
- /*
- * Remember file information, so in pidfile_write() we are sure we write
- * to the proper descriptor.
- */
- if libc.Xfstat(tls, fd, bp) == -int32(1) {
- error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- libc.Xunlink(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path)
- libc.Xfree(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path)
- libc.Xclose(tls, fd)
- libc.Xfree(tls, pfh)
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
- return libc.UintptrFromInt32(0)
- }
- (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd = fd
- (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_dev = (*(*Tstat)(unsafe.Pointer(bp))).Fst_dev
- (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_ino = (*(*Tstat)(unsafe.Pointer(bp))).Fst_ino
- return pfh
- }
- func Xpidfile_write(tls *libc.TLS, pfh uintptr) (r int32) {
- bp := tls.Alloc(32)
- defer tls.Free(32)
- var error1, fd int32
- var _ /* pidstr at bp+0 */ [16]int8
- _, _ = error1, fd
- /*
- * Check remembered descriptor, so we don't overwrite some other
- * file if pidfile was closed and descriptor reused.
- */
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = _pidfile_verify(tls, pfh)
- if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != 0 {
- /*
- * Don't close descriptor, because we are not sure if it's ours.
- */
- return -int32(1)
- }
- fd = (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd
- /*
- * Truncate PID file, so multiple calls of pidfile_write() are allowed.
- */
- if libc.Xftruncate(tls, fd, 0) == -int32(1) {
- error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- __pidfile_remove(tls, pfh, 0)
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
- return -int32(1)
- }
- libc.X__builtin_snprintf(tls, bp, uint32(16), __ccgo_ts+320, libc.VaList(bp+24, libc.Xgetpid(tls)))
- if libc.Xpwrite(tls, fd, bp, libc.Xstrlen(tls, bp), 0) != libc.Int32FromUint32(libc.Xstrlen(tls, bp)) {
- error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- __pidfile_remove(tls, pfh, 0)
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
- return -int32(1)
- }
- return 0
- }
- func Xpidfile_close(tls *libc.TLS, pfh uintptr) (r int32) {
- var error1 int32
- _ = error1
- error1 = _pidfile_verify(tls, pfh)
- if error1 != 0 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
- return -int32(1)
- }
- if libc.Xclose(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd) == -int32(1) {
- error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- }
- libc.Xfree(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path)
- libc.Xfree(tls, pfh)
- if error1 != 0 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
- return -int32(1)
- }
- return 0
- }
- func __pidfile_remove(tls *libc.TLS, pfh uintptr, freeit int32) (r int32) {
- var error1 int32
- _ = error1
- error1 = _pidfile_verify(tls, pfh)
- if error1 != 0 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
- return -int32(1)
- }
- if libc.Xunlink(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path) == -int32(1) {
- error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- }
- if libc.Xclose(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd) == -int32(1) {
- if error1 == 0 {
- error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- }
- }
- if freeit != 0 {
- libc.Xfree(tls, (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_path)
- libc.Xfree(tls, pfh)
- } else {
- (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd = -int32(1)
- }
- if error1 != 0 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = error1
- return -int32(1)
- }
- return 0
- }
- func Xpidfile_remove(tls *libc.TLS, pfh uintptr) (r int32) {
- return __pidfile_remove(tls, pfh, int32(1))
- }
- func Xpidfile_fileno(tls *libc.TLS, pfh uintptr) (r int32) {
- if pfh == libc.UintptrFromInt32(0) || (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd == -int32(1) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return -int32(1)
- }
- return (*Tpidfh)(unsafe.Pointer(pfh)).Fpf_fd
- }
- func Xgetprogname(tls *libc.TLS) (r uintptr) {
- if libc.Xprogram_invocation_short_name == libc.UintptrFromInt32(0) {
- libc.Xprogram_invocation_short_name = libc.Xprogram_invocation_short_name
- }
- return libc.Xprogram_invocation_short_name
- }
- func Xsetprogname(tls *libc.TLS, progname uintptr) {
- var i Tsize_t
- _ = i
- i = libc.Xstrlen(tls, progname)
- for {
- if !(i > uint32(0)) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(progname + uintptr(i-uint32(1))))) == int32('/') {
- libc.Xprogram_invocation_short_name = progname + uintptr(i)
- return
- }
- goto _1
- _1:
- ;
- i--
- }
- libc.Xprogram_invocation_short_name = progname
- }
- const m_GID_SZ = 251
- const m_GNMLEN = 32
- const m_GNM_SZ = 251
- const m_INVALID = 2
- const m_UID_SZ = 317
- const m_UNMLEN = 32
- const m_UNM_SZ = 317
- const m_VALID = 1
- const m__PW_BUF_LEN = 1024
- type Tgroup = struct {
- Fgr_name uintptr
- Fgr_passwd uintptr
- Fgr_gid Tgid_t
- Fgr_mem uintptr
- }
- type Tpasswd = struct {
- Fpw_name uintptr
- Fpw_passwd uintptr
- Fpw_uid Tuid_t
- Fpw_gid Tgid_t
- Fpw_gecos uintptr
- Fpw_dir uintptr
- Fpw_shell uintptr
- }
- /*
- * Constants and data structures used to implement group and password file
- * caches. Name lengths have been chosen to be as large as those supported
- * by the passwd and group files as well as the standard archive formats.
- * CACHE SIZES MUST BE PRIME
- */
- /*
- * Node structures used in the user, group, uid, and gid caches.
- */
- type TUIDC = struct {
- Fvalid int32
- Fname [32]int8
- Fuid Tuid_t
- }
- /*
- * Constants and data structures used to implement group and password file
- * caches. Name lengths have been chosen to be as large as those supported
- * by the passwd and group files as well as the standard archive formats.
- * CACHE SIZES MUST BE PRIME
- */
- /*
- * Node structures used in the user, group, uid, and gid caches.
- */
- type Tuidc = TUIDC
- type TGIDC = struct {
- Fvalid int32
- Fname [32]int8
- Fgid Tgid_t
- }
- type Tgidc = TGIDC
- /*
- * Routines that control user, group, uid and gid caches.
- * Traditional passwd/group cache routines perform quite poorly with
- * archives. The chances of hitting a valid lookup with an archive is quite a
- * bit worse than with files already resident on the file system. These misses
- * create a MAJOR performance cost. To adress this problem, these routines
- * cache both hits and misses.
- */
- var _uidtb uintptr /* uid to name cache */
- var _gidtb uintptr /* gid to name cache */
- var _usrtb uintptr /* user name to uid cache */
- var _grptb uintptr /* group name to gid cache */
- func _st_hash(tls *libc.TLS, name uintptr, len1 Tsize_t, tabsz int32) (r Tu_int) {
- var key Tu_int
- var v1 Tsize_t
- var v2 uintptr
- _, _, _ = key, v1, v2
- key = uint32(0)
- for {
- v1 = len1
- len1--
- if !(v1 != 0) {
- break
- }
- v2 = name
- name++
- key += libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(v2)))
- key = key<<libc.Int32FromInt32(8) | key>>libc.Int32FromInt32(24)
- }
- return key % libc.Uint32FromInt32(tabsz)
- }
- // C documentation
- //
- // /*
- // * uidtb_start
- // * creates an an empty uidtb
- // * Return:
- // * 0 if ok, -1 otherwise
- // */
- func _uidtb_start(tls *libc.TLS) (r int32) {
- var v1 uintptr
- _ = v1
- if _uidtb != libc.UintptrFromInt32(0) {
- return 0
- }
- if _fail != 0 {
- return -int32(1)
- }
- v1 = libc.Xcalloc(tls, uint32(m_UID_SZ), uint32(4))
- _uidtb = v1
- if v1 == libc.UintptrFromInt32(0) {
- _fail++
- return -int32(1)
- }
- return 0
- }
- var _fail int32
- // C documentation
- //
- // /*
- // * gidtb_start
- // * creates an an empty gidtb
- // * Return:
- // * 0 if ok, -1 otherwise
- // */
- func _gidtb_start(tls *libc.TLS) (r int32) {
- var v1 uintptr
- _ = v1
- if _gidtb != libc.UintptrFromInt32(0) {
- return 0
- }
- if _fail1 != 0 {
- return -int32(1)
- }
- v1 = libc.Xcalloc(tls, uint32(m_GID_SZ), uint32(4))
- _gidtb = v1
- if v1 == libc.UintptrFromInt32(0) {
- _fail1++
- return -int32(1)
- }
- return 0
- }
- var _fail1 int32
- // C documentation
- //
- // /*
- // * usrtb_start
- // * creates an an empty usrtb
- // * Return:
- // * 0 if ok, -1 otherwise
- // */
- func _usrtb_start(tls *libc.TLS) (r int32) {
- var v1 uintptr
- _ = v1
- if _usrtb != libc.UintptrFromInt32(0) {
- return 0
- }
- if _fail2 != 0 {
- return -int32(1)
- }
- v1 = libc.Xcalloc(tls, uint32(m_UNM_SZ), uint32(4))
- _usrtb = v1
- if v1 == libc.UintptrFromInt32(0) {
- _fail2++
- return -int32(1)
- }
- return 0
- }
- var _fail2 int32
- // C documentation
- //
- // /*
- // * grptb_start
- // * creates an an empty grptb
- // * Return:
- // * 0 if ok, -1 otherwise
- // */
- func _grptb_start(tls *libc.TLS) (r int32) {
- var v1 uintptr
- _ = v1
- if _grptb != libc.UintptrFromInt32(0) {
- return 0
- }
- if _fail3 != 0 {
- return -int32(1)
- }
- v1 = libc.Xcalloc(tls, uint32(m_GNM_SZ), uint32(4))
- _grptb = v1
- if v1 == libc.UintptrFromInt32(0) {
- _fail3++
- return -int32(1)
- }
- return 0
- }
- var _fail3 int32
- // C documentation
- //
- // /*
- // * user_from_uid()
- // * caches the name (if any) for the uid. If noname clear, we always
- // * return the stored name (if valid or invalid match).
- // * We use a simple hash table.
- // * Return:
- // * Pointer to stored name (or a empty string)
- // */
- func Xuser_from_uid(tls *libc.TLS, uid Tuid_t, noname int32) (r uintptr) {
- bp := tls.Alloc(1072)
- defer tls.Free(1072)
- var pptr, ptr, v1 uintptr
- var _ /* pw at bp+28 */ uintptr
- var _ /* pwbuf at bp+32 */ [1024]int8
- var _ /* pwstore at bp+0 */ Tpasswd
- _, _, _ = pptr, ptr, v1
- *(*uintptr)(unsafe.Pointer(bp + 28)) = libc.UintptrFromInt32(0)
- ptr = libc.UintptrFromInt32(0)
- if _uidtb != libc.UintptrFromInt32(0) || _uidtb_start(tls) == 0 {
- /*
- * see if we have this uid cached
- */
- pptr = _uidtb + uintptr(uid%libc.Uint32FromInt32(m_UID_SZ))*4
- ptr = *(*uintptr)(unsafe.Pointer(pptr))
- if ptr != libc.UintptrFromInt32(0) && (*TUIDC)(unsafe.Pointer(ptr)).Fvalid > 0 && (*TUIDC)(unsafe.Pointer(ptr)).Fuid == uid {
- /*
- * have an entry for this uid
- */
- if !(noname != 0) || (*TUIDC)(unsafe.Pointer(ptr)).Fvalid == int32(m_VALID) {
- return ptr + 4
- }
- return libc.UintptrFromInt32(0)
- }
- if ptr == libc.UintptrFromInt32(0) {
- v1 = libc.Xmalloc(tls, uint32(40))
- ptr = v1
- *(*uintptr)(unsafe.Pointer(pptr)) = v1
- }
- }
- libc.Xgetpwuid_r(tls, uid, bp, bp+32, uint32(1024), bp+28)
- if *(*uintptr)(unsafe.Pointer(bp + 28)) == libc.UintptrFromInt32(0) {
- /*
- * no match for this uid in the local password file
- * a string that is the uid in numeric format
- */
- if ptr == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- (*TUIDC)(unsafe.Pointer(ptr)).Fuid = uid
- libc.X__builtin_snprintf(tls, ptr+4, uint32(m_UNMLEN), __ccgo_ts+320, libc.VaList(bp+1064, uid))
- (*TUIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_INVALID)
- if noname != 0 {
- return libc.UintptrFromInt32(0)
- }
- } else {
- /*
- * there is an entry for this uid in the password file
- */
- if ptr == libc.UintptrFromInt32(0) {
- return (*Tpasswd)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)))).Fpw_name
- }
- (*TUIDC)(unsafe.Pointer(ptr)).Fuid = uid
- Xstrlcpy(tls, ptr+4, (*Tpasswd)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)))).Fpw_name, uint32(32))
- (*TUIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_VALID)
- }
- return ptr + 4
- }
- // C documentation
- //
- // /*
- // * group_from_gid()
- // * caches the name (if any) for the gid. If noname clear, we always
- // * return the stored name (if valid or invalid match).
- // * We use a simple hash table.
- // * Return:
- // * Pointer to stored name (or a empty string)
- // */
- func Xgroup_from_gid(tls *libc.TLS, gid Tgid_t, noname int32) (r uintptr) {
- bp := tls.Alloc(1872)
- defer tls.Free(1872)
- var pptr, ptr, v1 uintptr
- var _ /* gr at bp+16 */ uintptr
- var _ /* grbuf at bp+20 */ [1824]int8
- var _ /* grstore at bp+0 */ Tgroup
- _, _, _ = pptr, ptr, v1
- *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0)
- ptr = libc.UintptrFromInt32(0)
- if _gidtb != libc.UintptrFromInt32(0) || _gidtb_start(tls) == 0 {
- /*
- * see if we have this gid cached
- */
- pptr = _gidtb + uintptr(gid%libc.Uint32FromInt32(m_GID_SZ))*4
- ptr = *(*uintptr)(unsafe.Pointer(pptr))
- if ptr != libc.UintptrFromInt32(0) && (*TGIDC)(unsafe.Pointer(ptr)).Fvalid > 0 && (*TGIDC)(unsafe.Pointer(ptr)).Fgid == gid {
- /*
- * have an entry for this gid
- */
- if !(noname != 0) || (*TGIDC)(unsafe.Pointer(ptr)).Fvalid == int32(m_VALID) {
- return ptr + 4
- }
- return libc.UintptrFromInt32(0)
- }
- if ptr == libc.UintptrFromInt32(0) {
- v1 = libc.Xmalloc(tls, uint32(40))
- ptr = v1
- *(*uintptr)(unsafe.Pointer(pptr)) = v1
- }
- }
- libc.Xgetgrgid_r(tls, gid, bp, bp+20, uint32(1824), bp+16)
- if *(*uintptr)(unsafe.Pointer(bp + 16)) == libc.UintptrFromInt32(0) {
- /*
- * no match for this gid in the local group file, put in
- * a string that is the gid in numeric format
- */
- if ptr == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- (*TGIDC)(unsafe.Pointer(ptr)).Fgid = gid
- libc.X__builtin_snprintf(tls, ptr+4, uint32(m_GNMLEN), __ccgo_ts+320, libc.VaList(bp+1856, gid))
- (*TGIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_INVALID)
- if noname != 0 {
- return libc.UintptrFromInt32(0)
- }
- } else {
- /*
- * there is an entry for this group in the group file
- */
- if ptr == libc.UintptrFromInt32(0) {
- return (*Tgroup)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fgr_name
- }
- (*TGIDC)(unsafe.Pointer(ptr)).Fgid = gid
- Xstrlcpy(tls, ptr+4, (*Tgroup)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fgr_name, uint32(32))
- (*TGIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_VALID)
- }
- return ptr + 4
- }
- // C documentation
- //
- // /*
- // * uid_from_user()
- // * caches the uid for a given user name. We use a simple hash table.
- // * Return:
- // * 0 if the user name is found (filling in uid), -1 otherwise
- // */
- func Xuid_from_user(tls *libc.TLS, name uintptr, uid uintptr) (r int32) {
- bp := tls.Alloc(1056)
- defer tls.Free(1056)
- var namelen, v1 Tsize_t
- var pptr, ptr, v3 uintptr
- var v2 bool
- var v4 Tuid_t
- var _ /* pw at bp+28 */ uintptr
- var _ /* pwbuf at bp+32 */ [1024]int8
- var _ /* pwstore at bp+0 */ Tpasswd
- _, _, _, _, _, _, _ = namelen, pptr, ptr, v1, v2, v3, v4
- *(*uintptr)(unsafe.Pointer(bp + 28)) = libc.UintptrFromInt32(0)
- ptr = libc.UintptrFromInt32(0)
- /*
- * return -1 for mangled names
- */
- if v2 = name == libc.UintptrFromInt32(0); !v2 {
- v1 = libc.Xstrlen(tls, name)
- namelen = v1
- }
- if v2 || v1 == uint32(0) {
- return -int32(1)
- }
- if _usrtb != libc.UintptrFromInt32(0) || _usrtb_start(tls) == 0 {
- /*
- * look up in hash table, if found and valid return the uid,
- * if found and invalid, return a -1
- */
- pptr = _usrtb + uintptr(_st_hash(tls, name, namelen, int32(m_UNM_SZ)))*4
- ptr = *(*uintptr)(unsafe.Pointer(pptr))
- if ptr != libc.UintptrFromInt32(0) && (*TUIDC)(unsafe.Pointer(ptr)).Fvalid > 0 && libc.Xstrcmp(tls, name, ptr+4) == 0 {
- if (*TUIDC)(unsafe.Pointer(ptr)).Fvalid == int32(m_INVALID) {
- return -int32(1)
- }
- *(*Tuid_t)(unsafe.Pointer(uid)) = (*TUIDC)(unsafe.Pointer(ptr)).Fuid
- return 0
- }
- if ptr == libc.UintptrFromInt32(0) {
- v3 = libc.Xmalloc(tls, uint32(40))
- ptr = v3
- *(*uintptr)(unsafe.Pointer(pptr)) = v3
- }
- }
- /*
- * no match, look it up, if no match store it as an invalid entry,
- * or store the matching uid
- */
- libc.Xgetpwnam_r(tls, name, bp, bp+32, uint32(1024), bp+28)
- if ptr == libc.UintptrFromInt32(0) {
- if *(*uintptr)(unsafe.Pointer(bp + 28)) == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- *(*Tuid_t)(unsafe.Pointer(uid)) = (*Tpasswd)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)))).Fpw_uid
- return 0
- }
- Xstrlcpy(tls, ptr+4, name, uint32(32))
- if *(*uintptr)(unsafe.Pointer(bp + 28)) == libc.UintptrFromInt32(0) {
- (*TUIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_INVALID)
- return -int32(1)
- }
- (*TUIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_VALID)
- v4 = (*Tpasswd)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)))).Fpw_uid
- (*TUIDC)(unsafe.Pointer(ptr)).Fuid = v4
- *(*Tuid_t)(unsafe.Pointer(uid)) = v4
- return 0
- }
- // C documentation
- //
- // /*
- // * gid_from_group()
- // * caches the gid for a given group name. We use a simple hash table.
- // * Return:
- // * 0 if the group name is found (filling in gid), -1 otherwise
- // */
- func Xgid_from_group(tls *libc.TLS, name uintptr, gid uintptr) (r int32) {
- bp := tls.Alloc(1856)
- defer tls.Free(1856)
- var namelen, v1 Tsize_t
- var pptr, ptr, v3 uintptr
- var v2 bool
- var v4 Tgid_t
- var _ /* gr at bp+16 */ uintptr
- var _ /* grbuf at bp+20 */ [1824]int8
- var _ /* grstore at bp+0 */ Tgroup
- _, _, _, _, _, _, _ = namelen, pptr, ptr, v1, v2, v3, v4
- *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0)
- ptr = libc.UintptrFromInt32(0)
- /*
- * return -1 for mangled names
- */
- if v2 = name == libc.UintptrFromInt32(0); !v2 {
- v1 = libc.Xstrlen(tls, name)
- namelen = v1
- }
- if v2 || v1 == uint32(0) {
- return -int32(1)
- }
- if _grptb != libc.UintptrFromInt32(0) || _grptb_start(tls) == 0 {
- /*
- * look up in hash table, if found and valid return the uid,
- * if found and invalid, return a -1
- */
- pptr = _grptb + uintptr(_st_hash(tls, name, namelen, int32(m_GID_SZ)))*4
- ptr = *(*uintptr)(unsafe.Pointer(pptr))
- if ptr != libc.UintptrFromInt32(0) && (*TGIDC)(unsafe.Pointer(ptr)).Fvalid > 0 && libc.Xstrcmp(tls, name, ptr+4) == 0 {
- if (*TGIDC)(unsafe.Pointer(ptr)).Fvalid == int32(m_INVALID) {
- return -int32(1)
- }
- *(*Tgid_t)(unsafe.Pointer(gid)) = (*TGIDC)(unsafe.Pointer(ptr)).Fgid
- return 0
- }
- if ptr == libc.UintptrFromInt32(0) {
- v3 = libc.Xmalloc(tls, uint32(40))
- ptr = v3
- *(*uintptr)(unsafe.Pointer(pptr)) = v3
- }
- }
- /*
- * no match, look it up, if no match store it as an invalid entry,
- * or store the matching gid
- */
- libc.Xgetgrnam_r(tls, name, bp, bp+20, uint32(1824), bp+16)
- if ptr == libc.UintptrFromInt32(0) {
- if *(*uintptr)(unsafe.Pointer(bp + 16)) == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- *(*Tgid_t)(unsafe.Pointer(gid)) = (*Tgroup)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fgr_gid
- return 0
- }
- Xstrlcpy(tls, ptr+4, name, uint32(32))
- if *(*uintptr)(unsafe.Pointer(bp + 16)) == libc.UintptrFromInt32(0) {
- (*TGIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_INVALID)
- return -int32(1)
- }
- (*TGIDC)(unsafe.Pointer(ptr)).Fvalid = int32(m_VALID)
- v4 = (*Tgroup)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fgr_gid
- (*TGIDC)(unsafe.Pointer(ptr)).Fgid = v4
- *(*Tgid_t)(unsafe.Pointer(gid)) = v4
- return 0
- }
- const m_SIZE = 512
- const m_THRESHOLD1 = 20
- type Tstack = struct {
- Fsa uintptr
- Fsn int32
- Fsi int32
- }
- func Xradixsort(tls *libc.TLS, a uintptr, n int32, tab uintptr, endch uint32) (r int32) {
- bp := tls.Alloc(256)
- defer tls.Free(256)
- var c uint32
- var tr uintptr
- var _ /* tr0 at bp+0 */ [256]uint8
- _, _ = c, tr
- if tab == libc.UintptrFromInt32(0) {
- tr = bp
- c = uint32(0)
- for {
- if !(c < endch) {
- break
- }
- (*(*[256]uint8)(unsafe.Pointer(bp)))[c] = uint8(c + uint32(1))
- goto _1
- _1:
- ;
- c++
- }
- (*(*[256]uint8)(unsafe.Pointer(bp)))[c] = uint8(0)
- c++
- for {
- if !(c < uint32(256)) {
- break
- }
- (*(*[256]uint8)(unsafe.Pointer(bp)))[c] = uint8(c)
- goto _2
- _2:
- ;
- c++
- }
- endch = uint32(0)
- } else {
- endch = uint32(*(*uint8)(unsafe.Pointer(tab + uintptr(endch))))
- tr = tab
- if endch != uint32(0) && endch != uint32(255) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return -int32(1)
- }
- }
- _r_sort_a(tls, a, n, 0, tr, endch)
- return 0
- }
- func Xsradixsort(tls *libc.TLS, a uintptr, n int32, tab uintptr, endch uint32) (r int32) {
- bp := tls.Alloc(256)
- defer tls.Free(256)
- var c uint32
- var ta, tr uintptr
- var _ /* tr0 at bp+0 */ [256]uint8
- _, _, _ = c, ta, tr
- if a == libc.UintptrFromInt32(0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EFAULT)
- return -int32(1)
- }
- if tab == libc.UintptrFromInt32(0) {
- tr = bp
- c = uint32(0)
- for {
- if !(c < endch) {
- break
- }
- (*(*[256]uint8)(unsafe.Pointer(bp)))[c] = uint8(c + uint32(1))
- goto _1
- _1:
- ;
- c++
- }
- (*(*[256]uint8)(unsafe.Pointer(bp)))[c] = uint8(0)
- c++
- for {
- if !(c < uint32(256)) {
- break
- }
- (*(*[256]uint8)(unsafe.Pointer(bp)))[c] = uint8(c)
- goto _2
- _2:
- ;
- c++
- }
- endch = uint32(0)
- } else {
- endch = uint32(*(*uint8)(unsafe.Pointer(tab + uintptr(endch))))
- tr = tab
- if endch != uint32(0) && endch != uint32(255) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return -int32(1)
- }
- }
- if n < int32(m_THRESHOLD1) {
- _simplesort(tls, a, n, 0, tr, endch)
- } else {
- ta = Xreallocarray(tls, libc.UintptrFromInt32(0), libc.Uint32FromInt32(n), uint32(4))
- if ta == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- _r_sort_b(tls, a, ta, n, 0, tr, endch)
- libc.Xfree(tls, ta)
- }
- return 0
- }
- // C documentation
- //
- // /* Unstable, in-place sort. */
- func _r_sort_a(tls *libc.TLS, a uintptr, n int32, i int32, tr uintptr, endch uint32) {
- bp := tls.Alloc(7168)
- defer tls.Free(7168)
- var aj, ak, an, cp, r, sp, sp0, sp1, t, v1, v10, v12, v15, v16, v17, v2, v4, v6, v7, v9 uintptr
- var bigc, c, v18, v5, v8 uint32
- var temp Tstack
- var _ /* s at bp+0 */ [512]Tstack
- var _ /* top at bp+6144 */ [256]uintptr
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- /* Set up stack. */
- sp = bp
- (*Tstack)(unsafe.Pointer(sp)).Fsa = a
- (*Tstack)(unsafe.Pointer(sp)).Fsn = n
- v1 = sp
- sp += 12
- (*Tstack)(unsafe.Pointer(v1)).Fsi = i
- for !(bp >= sp) {
- sp -= 12
- v2 = sp
- a = (*Tstack)(unsafe.Pointer(v2)).Fsa
- n = (*Tstack)(unsafe.Pointer(sp)).Fsn
- i = (*Tstack)(unsafe.Pointer(sp)).Fsi
- if n < int32(m_THRESHOLD1) {
- _simplesort(tls, a, n, i, tr, endch)
- continue
- }
- an = a + uintptr(n)*4
- /* Make character histogram. */
- if _nc == uint32(0) {
- _bmin = uint32(255) /* First occupied bin, excluding eos. */
- ak = a
- for {
- if !(ak < an) {
- break
- }
- v4 = ak
- ak += 4
- c = uint32(*(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(v4)) + uintptr(i)))))))
- v6 = uintptr(unsafe.Pointer(&_count)) + uintptr(c)*4
- *(*uint32)(unsafe.Pointer(v6))++
- v5 = *(*uint32)(unsafe.Pointer(v6))
- if v5 == uint32(1) && c != endch {
- if c < _bmin {
- _bmin = c
- }
- _nc++
- }
- goto _3
- _3:
- }
- if sp+uintptr(_nc)*12 > bp+uintptr(m_SIZE)*12 { /* Get more stack. */
- _r_sort_a(tls, a, n, i, tr, endch)
- continue
- }
- }
- /*
- * Special case: if all strings have the same
- * character at position i, move on to the next
- * character.
- */
- if _nc == uint32(1) && _count[_bmin] == libc.Uint32FromInt32(n) {
- (*Tstack)(unsafe.Pointer(sp)).Fsa = a
- (*Tstack)(unsafe.Pointer(sp)).Fsn = n
- v7 = sp
- sp += 12
- (*Tstack)(unsafe.Pointer(v7)).Fsi = i + libc.Int32FromInt32(1)
- v8 = libc.Uint32FromInt32(0)
- _count[_bmin] = v8
- _nc = v8
- continue
- }
- /*
- * Set top[]; push incompletely sorted bins onto stack.
- * top[] = pointers to last out-of-place element in bins.
- * count[] = counts of elements in bins.
- * Before permuting: top[c-1] + count[c] = top[c];
- * during deal: top[c] counts down to top[c-1].
- */
- v9 = sp
- sp1 = v9
- sp0 = v9 /* Stack position of biggest bin. */
- bigc = uint32(2) /* Size of biggest bin. */
- if endch == uint32(0) { /* Special case: set top[eos]. */
- v10 = a + uintptr(_count[0])*4
- ak = v10
- (*(*[256]uintptr)(unsafe.Pointer(bp + 6144)))[0] = v10
- } else {
- ak = a
- (*(*[256]uintptr)(unsafe.Pointer(bp + 6144)))[int32(255)] = an
- }
- cp = uintptr(unsafe.Pointer(&_count)) + uintptr(_bmin)*4
- for {
- if !(_nc > uint32(0)) {
- break
- }
- for *(*uint32)(unsafe.Pointer(cp)) == uint32(0) { /* Find next non-empty pile. */
- cp += 4
- }
- if *(*uint32)(unsafe.Pointer(cp)) > uint32(1) {
- if *(*uint32)(unsafe.Pointer(cp)) > bigc {
- bigc = *(*uint32)(unsafe.Pointer(cp))
- sp1 = sp
- }
- (*Tstack)(unsafe.Pointer(sp)).Fsa = ak
- (*Tstack)(unsafe.Pointer(sp)).Fsn = libc.Int32FromUint32(*(*uint32)(unsafe.Pointer(cp)))
- v12 = sp
- sp += 12
- (*Tstack)(unsafe.Pointer(v12)).Fsi = i + libc.Int32FromInt32(1)
- }
- ak += uintptr(*(*uint32)(unsafe.Pointer(cp))) * 4
- (*(*[256]uintptr)(unsafe.Pointer(bp + 6144)))[(int32(cp)-t__predefined_ptrdiff_t(uintptr(unsafe.Pointer(&_count))))/4] = ak
- _nc--
- goto _11
- _11:
- ;
- cp += 4
- }
- temp = *(*Tstack)(unsafe.Pointer(sp0))
- *(*Tstack)(unsafe.Pointer(sp0)) = *(*Tstack)(unsafe.Pointer(sp1))
- *(*Tstack)(unsafe.Pointer(sp1)) = temp /* Play it safe -- biggest bin last. */
- /*
- * Permute misplacements home. Already home: everything
- * before aj, and in bin[c], items from top[c] on.
- * Inner loop:
- * r = next element to put in place;
- * ak = top[r[i]] = location to put the next element.
- * aj = bottom of 1st disordered bin.
- * Outer loop:
- * Once the 1st disordered bin is done, ie. aj >= ak,
- * aj<-aj + count[c] connects the bins in a linked list;
- * reset count[c].
- */
- aj = a
- for {
- if !(aj < an) {
- break
- }
- r = *(*uintptr)(unsafe.Pointer(aj))
- for {
- v18 = uint32(*(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(r + uintptr(i)))))))
- c = v18
- v17 = bp + 6144 + uintptr(v18)*4
- *(*uintptr)(unsafe.Pointer(v17)) -= 4
- v16 = *(*uintptr)(unsafe.Pointer(v17))
- v15 = v16
- ak = v15
- if !(aj < v15) {
- break
- }
- t = *(*uintptr)(unsafe.Pointer(ak))
- *(*uintptr)(unsafe.Pointer(ak)) = r
- r = t
- goto _14
- _14:
- }
- goto _13
- _13:
- ;
- *(*uintptr)(unsafe.Pointer(aj)) = r
- aj += uintptr(_count[c]) * 4
- _count[c] = libc.Uint32FromInt32(0)
- }
- }
- }
- var _count [256]uint32
- var _nc uint32
- var _bmin uint32
- // C documentation
- //
- // /* Stable sort, requiring additional memory. */
- func _r_sort_b(tls *libc.TLS, a uintptr, ta uintptr, n int32, i int32, tr uintptr, endch uint32) {
- bp := tls.Alloc(7168)
- defer tls.Free(7168)
- var ai, ak, cp, sp, sp0, sp1, v1, v11, v13, v14, v16, v17, v18, v2, v4, v6, v7, v8 uintptr
- var bigc, c, v10, v5 uint32
- var temp Tstack
- var _ /* s at bp+0 */ [512]Tstack
- var _ /* top at bp+6144 */ [256]uintptr
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = ai, ak, bigc, c, cp, sp, sp0, sp1, temp, v1, v10, v11, v13, v14, v16, v17, v18, v2, v4, v5, v6, v7, v8
- sp = bp
- (*Tstack)(unsafe.Pointer(sp)).Fsa = a
- (*Tstack)(unsafe.Pointer(sp)).Fsn = n
- v1 = sp
- sp += 12
- (*Tstack)(unsafe.Pointer(v1)).Fsi = i
- for !(bp >= sp) {
- sp -= 12
- v2 = sp
- a = (*Tstack)(unsafe.Pointer(v2)).Fsa
- n = (*Tstack)(unsafe.Pointer(sp)).Fsn
- i = (*Tstack)(unsafe.Pointer(sp)).Fsi
- if n < int32(m_THRESHOLD1) {
- _simplesort(tls, a, n, i, tr, endch)
- continue
- }
- if _nc1 == uint32(0) {
- _bmin1 = uint32(255)
- ak = a + uintptr(n)*4
- for {
- ak -= 4
- v4 = ak
- if !(v4 >= a) {
- break
- }
- c = uint32(*(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ak)) + uintptr(i)))))))
- v6 = uintptr(unsafe.Pointer(&_count1)) + uintptr(c)*4
- *(*uint32)(unsafe.Pointer(v6))++
- v5 = *(*uint32)(unsafe.Pointer(v6))
- if v5 == uint32(1) && c != endch {
- if c < _bmin1 {
- _bmin1 = c
- }
- _nc1++
- }
- goto _3
- _3:
- }
- if sp+uintptr(_nc1)*12 > bp+uintptr(m_SIZE)*12 {
- _r_sort_b(tls, a, ta, n, i, tr, endch)
- continue
- }
- }
- v7 = sp
- sp1 = v7
- sp0 = v7
- bigc = uint32(2)
- if endch == uint32(0) {
- v8 = a + uintptr(_count1[0])*4
- ak = v8
- (*(*[256]uintptr)(unsafe.Pointer(bp + 6144)))[0] = v8
- _count1[0] = uint32(0)
- } else {
- ak = a
- (*(*[256]uintptr)(unsafe.Pointer(bp + 6144)))[int32(255)] = a + uintptr(n)*4
- _count1[int32(255)] = uint32(0)
- }
- cp = uintptr(unsafe.Pointer(&_count1)) + uintptr(_bmin1)*4
- for {
- if !(_nc1 > uint32(0)) {
- break
- }
- for *(*uint32)(unsafe.Pointer(cp)) == uint32(0) {
- cp += 4
- }
- v10 = *(*uint32)(unsafe.Pointer(cp))
- c = v10
- if v10 > uint32(1) {
- if c > bigc {
- bigc = c
- sp1 = sp
- }
- (*Tstack)(unsafe.Pointer(sp)).Fsa = ak
- (*Tstack)(unsafe.Pointer(sp)).Fsn = libc.Int32FromUint32(c)
- v11 = sp
- sp += 12
- (*Tstack)(unsafe.Pointer(v11)).Fsi = i + libc.Int32FromInt32(1)
- }
- ak += uintptr(c) * 4
- (*(*[256]uintptr)(unsafe.Pointer(bp + 6144)))[(int32(cp)-t__predefined_ptrdiff_t(uintptr(unsafe.Pointer(&_count1))))/4] = ak
- *(*uint32)(unsafe.Pointer(cp)) = uint32(0) /* Reset count[]. */
- _nc1--
- goto _9
- _9:
- ;
- cp += 4
- }
- temp = *(*Tstack)(unsafe.Pointer(sp0))
- *(*Tstack)(unsafe.Pointer(sp0)) = *(*Tstack)(unsafe.Pointer(sp1))
- *(*Tstack)(unsafe.Pointer(sp1)) = temp
- ak = ta + uintptr(n)*4
- ai = a + uintptr(n)*4
- for {
- if !(ak > ta) {
- break
- } /* Copy to temp. */
- ak -= 4
- v13 = ak
- ai -= 4
- v14 = ai
- *(*uintptr)(unsafe.Pointer(v13)) = *(*uintptr)(unsafe.Pointer(v14))
- goto _12
- _12:
- }
- ak = ta + uintptr(n)*4
- for {
- ak -= 4
- v16 = ak
- if !(v16 >= ta) {
- break
- } /* Deal to piles. */
- v18 = bp + 6144 + uintptr(*(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ak)) + uintptr(i)))))))*4
- *(*uintptr)(unsafe.Pointer(v18)) -= 4
- v17 = *(*uintptr)(unsafe.Pointer(v18))
- *(*uintptr)(unsafe.Pointer(v17)) = *(*uintptr)(unsafe.Pointer(ak))
- goto _15
- _15:
- }
- }
- }
- var _count1 [256]uint32
- var _nc1 uint32
- var _bmin1 uint32
- // C documentation
- //
- // /* insertion sort */
- func _simplesort(tls *libc.TLS, a uintptr, n int32, b int32, tr uintptr, endch uint32) {
- var ai, ak, s, t uintptr
- var ch, v5 uint8
- var v2 int32
- _, _, _, _, _, _, _ = ai, ak, ch, s, t, v2, v5
- ak = a + uintptr(1)*4
- for {
- n--
- v2 = n
- if !(v2 >= int32(1)) {
- break
- }
- ai = ak
- for {
- if !(ai > a) {
- break
- }
- s = *(*uintptr)(unsafe.Pointer(ai)) + uintptr(b)
- t = *(*uintptr)(unsafe.Pointer(ai + uintptr(-libc.Int32FromInt32(1))*4)) + uintptr(b)
- for {
- v5 = *(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(s)))))
- ch = v5
- if !(uint32(v5) != endch) {
- break
- }
- if libc.Int32FromUint8(ch) != libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(t)))))) {
- break
- }
- goto _4
- _4:
- ;
- s++
- t++
- }
- if libc.Int32FromUint8(ch) >= libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(tr + uintptr(*(*uint8)(unsafe.Pointer(t)))))) {
- break
- }
- s = *(*uintptr)(unsafe.Pointer(ai))
- *(*uintptr)(unsafe.Pointer(ai)) = *(*uintptr)(unsafe.Pointer(ai + uintptr(-libc.Int32FromInt32(1))*4))
- *(*uintptr)(unsafe.Pointer(ai + uintptr(-libc.Int32FromInt32(1))*4)) = s
- goto _3
- _3:
- ;
- ai -= 4
- }
- goto _1
- _1:
- ;
- ak += 4
- }
- }
- const m_B0 = 0000000
- const m_B1000000 = 0010010
- const m_B110 = 0000003
- const m_B115200 = 0010002
- const m_B1152000 = 0010011
- const m_B1200 = 0000011
- const m_B134 = 0000004
- const m_B150 = 0000005
- const m_B1500000 = 0010012
- const m_B1800 = 0000012
- const m_B19200 = 0000016
- const m_B200 = 0000006
- const m_B2000000 = 0010013
- const m_B230400 = 0010003
- const m_B2400 = 0000013
- const m_B2500000 = 0010014
- const m_B300 = 0000007
- const m_B3000000 = 0010015
- const m_B3500000 = 0010016
- const m_B38400 = 0000017
- const m_B4000000 = 0010017
- const m_B460800 = 0010004
- const m_B4800 = 0000014
- const m_B50 = 0000001
- const m_B500000 = 0010005
- const m_B57600 = 0010001
- const m_B576000 = 0010006
- const m_B600 = 0000010
- const m_B75 = 0000002
- const m_B921600 = 0010007
- const m_B9600 = 0000015
- const m_BRKINT = 0000002
- const m_BS0 = 0000000
- const m_BS1 = 0020000
- const m_BSDLY = 0020000
- const m_CBAUD = 0010017
- const m_CBAUDEX = 0010000
- const m_CIBAUD = 002003600000
- const m_CLOCAL = 0004000
- const m_CMSPAR = 010000000000
- const m_CR0 = 0000000
- const m_CR1 = 0001000
- const m_CR2 = 0002000
- const m_CR3 = 0003000
- const m_CRDLY = 0003000
- const m_CREAD = 0000200
- const m_CRTSCTS = 020000000000
- const m_CS5 = 0000000
- const m_CS6 = 0000020
- const m_CS7 = 0000040
- const m_CS8 = 0000060
- const m_CSIZE = 0000060
- const m_CSTOPB = 0000100
- const m_ECHO = 8
- const m_ECHOCTL = 0001000
- const m_ECHOE = 0000020
- const m_ECHOK = 0000040
- const m_ECHOKE = 0004000
- const m_ECHONL = 64
- const m_ECHOPRT = 0002000
- const m_EXTA = 0000016
- const m_EXTB = 0000017
- const m_EXTPROC = 0200000
- const m_FF0 = 0000000
- const m_FF1 = 0100000
- const m_FFDLY = 0100000
- const m_FLUSHO = 0010000
- const m_HUPCL = 0002000
- const m_ICANON = 0000002
- const m_ICRNL = 0000400
- const m_IEXTEN = 0100000
- const m_IGNBRK = 0000001
- const m_IGNCR = 0000200
- const m_IGNPAR = 0000004
- const m_IMAXBEL = 0020000
- const m_INLCR = 0000100
- const m_INPCK = 0000020
- const m_ISIG = 0000001
- const m_ISTRIP = 0000040
- const m_IUCLC = 0001000
- const m_IUTF8 = 0040000
- const m_IXANY = 0004000
- const m_IXOFF = 0010000
- const m_IXON = 0002000
- const m_NCCS = 32
- const m_NL0 = 0000000
- const m_NL1 = 0000400
- const m_NLDLY = 0000400
- const m_NOFLSH = 0000200
- const m_OCRNL = 0000010
- const m_OFDEL = 0000200
- const m_OFILL = 0000100
- const m_OLCUC = 0000002
- const m_ONLCR = 0000004
- const m_ONLRET = 0000040
- const m_ONOCR = 0000020
- const m_OPOST = 0000001
- const m_O_CREAT4 = 0100
- const m_O_NONBLOCK4 = 04000
- const m_O_RDONLY2 = 00
- const m_O_RDWR1 = 2
- const m_O_TRUNC4 = 01000
- const m_O_WRONLY2 = 01
- const m_PARENB = 0000400
- const m_PARMRK = 0000010
- const m_PARODD = 0001000
- const m_PENDIN = 0040000
- const m_RPP_ECHO_OFF = 0x00
- const m_RPP_ECHO_ON = 1
- const m_RPP_FORCELOWER = 4
- const m_RPP_FORCEUPPER = 8
- const m_RPP_REQUIRE_TTY = 2
- const m_RPP_SEVENBIT = 16
- const m_RPP_STDIN = 32
- const m_TAB0 = 0000000
- const m_TAB1 = 0004000
- const m_TAB2 = 0010000
- const m_TAB3 = 0014000
- const m_TABDLY = 0014000
- const m_TCIFLUSH = 0
- const m_TCIOFF = 2
- const m_TCIOFLUSH = 2
- const m_TCION = 3
- const m_TCOFLUSH = 1
- const m_TCOOFF = 0
- const m_TCOON = 1
- const m_TCSADRAIN = 1
- const m_TCSAFLUSH = 2
- const m_TCSANOW = 0
- const m_TCSASOFT = 0
- const m_TOSTOP = 0000400
- const m_VDISCARD = 13
- const m_VEOF = 4
- const m_VEOL = 11
- const m_VEOL2 = 16
- const m_VERASE = 2
- const m_VINTR = 0
- const m_VKILL = 3
- const m_VLNEXT = 15
- const m_VMIN = 6
- const m_VQUIT = 1
- const m_VREPRINT = 12
- const m_VSTART = 8
- const m_VSTOP = 9
- const m_VSUSP = 10
- const m_VSWTC = 7
- const m_VT0 = 0000000
- const m_VT1 = 0040000
- const m_VTDLY = 0040000
- const m_VTIME = 5
- const m_VWERASE = 14
- const m_XCASE = 0000004
- const m_XTABS = 0014000
- const m__PATH_BSHELL = "/bin/sh"
- const m__PATH_CONSOLE = "/dev/console"
- const m__PATH_DEFPATH = "/usr/local/bin:/bin:/usr/bin"
- const m__PATH_DEV = "/dev/"
- const m__PATH_DEVNULL = "/dev/null"
- const m__PATH_KLOG = "/proc/kmsg"
- const m__PATH_LASTLOG = "/var/log/lastlog"
- const m__PATH_MAILDIR = "/var/mail"
- const m__PATH_MAN = "/usr/share/man"
- const m__PATH_MNTTAB = "/etc/fstab"
- const m__PATH_MOUNTED = "/etc/mtab"
- const m__PATH_NOLOGIN = "/etc/nologin"
- const m__PATH_SENDMAIL = "/usr/sbin/sendmail"
- const m__PATH_SHADOW = "/etc/shadow"
- const m__PATH_SHELLS = "/etc/shells"
- const m__PATH_STDPATH = "/bin:/usr/bin:/sbin:/usr/sbin"
- const m__PATH_TMP = "/tmp/"
- const m__PATH_TTY = "/dev/tty"
- const m__PATH_UTMP = "/dev/null/utmp"
- const m__PATH_VARDB = "/var/lib/misc/"
- const m__PATH_VARRUN = "/var/run/"
- const m__PATH_VARTMP = "/var/tmp/"
- const m__PATH_VI = "/usr/bin/vi"
- const m__PATH_WTMP = "/dev/null/wtmp"
- type Twinsize = struct {
- Fws_row uint16
- Fws_col uint16
- Fws_xpixel uint16
- Fws_ypixel uint16
- }
- type Tcc_t = uint8
- type Tspeed_t = uint32
- type Ttcflag_t = uint32
- type Ttermios = struct {
- Fc_iflag Ttcflag_t
- Fc_oflag Ttcflag_t
- Fc_cflag Ttcflag_t
- Fc_lflag Ttcflag_t
- Fc_line Tcc_t
- Fc_cc [32]Tcc_t
- F__c_ispeed Tspeed_t
- F__c_ospeed Tspeed_t
- }
- var _signo [65]Tsig_atomic_t
- func Xreadpassphrase(tls *libc.TLS, prompt uintptr, buf uintptr, bufsiz Tsize_t, flags int32) (r uintptr) {
- bp := tls.Alloc(1536)
- defer tls.Free(1536)
- var end, p, v6, v8 uintptr
- var i, input, need_restart, output, save_errno, sigttou, v2, v3 int32
- var nr, v5 Tssize_t
- var v4 bool
- var _ /* ch at bp+0 */ int8
- var _ /* oterm at bp+64 */ Ttermios
- var _ /* sa at bp+124 */ Tsigaction
- var _ /* savealrm at bp+264 */ Tsigaction
- var _ /* savehup at bp+544 */ Tsigaction
- var _ /* saveint at bp+404 */ Tsigaction
- var _ /* savepipe at bp+1384 */ Tsigaction
- var _ /* savequit at bp+684 */ Tsigaction
- var _ /* saveterm at bp+824 */ Tsigaction
- var _ /* savetstp at bp+964 */ Tsigaction
- var _ /* savettin at bp+1104 */ Tsigaction
- var _ /* savettou at bp+1244 */ Tsigaction
- var _ /* term at bp+4 */ Ttermios
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = end, i, input, need_restart, nr, output, p, save_errno, sigttou, v2, v3, v4, v5, v6, v8
- /* I suppose we could alloc on demand in this case (XXX). */
- if bufsiz == uint32(0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return libc.UintptrFromInt32(0)
- }
- goto restart
- restart:
- ;
- i = 0
- for {
- if !(i < int32(m__NSIG)) {
- break
- }
- libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_signo))+uintptr(i)*4, 0)
- goto _1
- _1:
- ;
- i++
- }
- nr = -int32(1)
- save_errno = 0
- need_restart = 0
- /*
- * Read and write to /dev/tty if available. If not, read from
- * stdin and write to stderr unless a tty is required.
- */
- if v4 = flags&int32(m_RPP_STDIN) != 0; !v4 {
- v3 = libc.Xopen(tls, __ccgo_ts+323, int32(m_O_RDWR1), 0)
- output = v3
- v2 = v3
- input = v2
- }
- if v4 || v2 == -int32(1) {
- if flags&int32(m_RPP_REQUIRE_TTY) != 0 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOTTY)
- return libc.UintptrFromInt32(0)
- }
- input = m_STDIN_FILENO
- output = int32(m_STDERR_FILENO)
- }
- /*
- * Turn off echo if possible.
- * If we are using a tty but are not the foreground pgrp this will
- * generate SIGTTOU, so do it *before* installing the signal handlers.
- */
- if input != m_STDIN_FILENO && libc.Xtcgetattr(tls, input, bp+64) == 0 {
- libc.Xmemcpy(tls, bp+4, bp+64, uint32(60))
- if !(flags&libc.Int32FromInt32(m_RPP_ECHO_ON) != 0) {
- (*(*Ttermios)(unsafe.Pointer(bp + 4))).Fc_lflag &= libc.Uint32FromInt32(^(libc.Int32FromInt32(m_ECHO) | libc.Int32FromInt32(m_ECHONL)))
- }
- libc.Xtcsetattr(tls, input, libc.Int32FromInt32(m_TCSAFLUSH)|libc.Int32FromInt32(m_TCSASOFT), bp+4)
- } else {
- libc.Xmemset(tls, bp+4, 0, uint32(60))
- (*(*Ttermios)(unsafe.Pointer(bp + 4))).Fc_lflag |= uint32(m_ECHO)
- libc.Xmemset(tls, bp+64, 0, uint32(60))
- (*(*Ttermios)(unsafe.Pointer(bp + 64))).Fc_lflag |= uint32(m_ECHO)
- }
- /*
- * Catch signals that would otherwise cause the user to end
- * up with echo turned off in the shell. Don't worry about
- * things like SIGXCPU and SIGVTALRM for now.
- */
- libc.Xsigemptyset(tls, bp+124+4)
- (*(*Tsigaction)(unsafe.Pointer(bp + 124))).Fsa_flags = 0 /* don't restart system calls */
- *(*uintptr)(unsafe.Pointer(bp + 124)) = __ccgo_fp(_handler)
- libc.Xsigaction(tls, int32(m_SIGALRM), bp+124, bp+264)
- libc.Xsigaction(tls, int32(m_SIGHUP), bp+124, bp+544)
- libc.Xsigaction(tls, int32(m_SIGINT), bp+124, bp+404)
- libc.Xsigaction(tls, int32(m_SIGPIPE), bp+124, bp+1384)
- libc.Xsigaction(tls, int32(m_SIGQUIT), bp+124, bp+684)
- libc.Xsigaction(tls, int32(m_SIGTERM), bp+124, bp+824)
- libc.Xsigaction(tls, int32(m_SIGTSTP), bp+124, bp+964)
- libc.Xsigaction(tls, int32(m_SIGTTIN), bp+124, bp+1104)
- libc.Xsigaction(tls, int32(m_SIGTTOU), bp+124, bp+1244)
- if !(flags&libc.Int32FromInt32(m_RPP_STDIN) != 0) {
- libc.Xwrite(tls, output, prompt, libc.Xstrlen(tls, prompt))
- }
- end = buf + uintptr(bufsiz) - uintptr(1)
- p = buf
- for {
- v5 = libc.Xread(tls, input, bp, uint32(1))
- nr = v5
- if !(v5 == int32(1) && int32(*(*int8)(unsafe.Pointer(bp))) != int32('\n') && int32(*(*int8)(unsafe.Pointer(bp))) != int32('\r')) {
- break
- }
- if p < end {
- if flags&int32(m_RPP_SEVENBIT) != 0 {
- *(*int8)(unsafe.Pointer(bp)) = int8(int32(*(*int8)(unsafe.Pointer(bp))) & libc.Int32FromInt32(0x7f))
- }
- if libc.BoolInt32(uint32(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(bp))))|uint32(32)-uint32('a') < uint32(26)) != 0 {
- if flags&int32(m_RPP_FORCELOWER) != 0 {
- *(*int8)(unsafe.Pointer(bp)) = int8(libc.Xtolower(tls, libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(bp))))))
- }
- if flags&int32(m_RPP_FORCEUPPER) != 0 {
- *(*int8)(unsafe.Pointer(bp)) = int8(libc.Xtoupper(tls, libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(bp))))))
- }
- }
- v6 = p
- p++
- *(*int8)(unsafe.Pointer(v6)) = *(*int8)(unsafe.Pointer(bp))
- }
- }
- *(*int8)(unsafe.Pointer(p)) = int8('\000')
- save_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- if !((*(*Ttermios)(unsafe.Pointer(bp + 4))).Fc_lflag&libc.Uint32FromInt32(m_ECHO) != 0) {
- libc.Xwrite(tls, output, __ccgo_ts+332, uint32(1))
- }
- /* Restore old terminal settings and signals. */
- if libc.Xmemcmp(tls, bp+4, bp+64, uint32(60)) != 0 {
- sigttou = libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_signo)) + libc.UintptrFromInt32(m_SIGTTOU)*4)
- /* Ignore SIGTTOU generated when we are not the fg pgrp. */
- 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) {
- continue
- }
- libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_signo))+22*4, sigttou)
- }
- libc.Xsigaction(tls, int32(m_SIGALRM), bp+264, libc.UintptrFromInt32(0))
- libc.Xsigaction(tls, int32(m_SIGHUP), bp+544, libc.UintptrFromInt32(0))
- libc.Xsigaction(tls, int32(m_SIGINT), bp+404, libc.UintptrFromInt32(0))
- libc.Xsigaction(tls, int32(m_SIGQUIT), bp+684, libc.UintptrFromInt32(0))
- libc.Xsigaction(tls, int32(m_SIGPIPE), bp+1384, libc.UintptrFromInt32(0))
- libc.Xsigaction(tls, int32(m_SIGTERM), bp+824, libc.UintptrFromInt32(0))
- libc.Xsigaction(tls, int32(m_SIGTSTP), bp+964, libc.UintptrFromInt32(0))
- libc.Xsigaction(tls, int32(m_SIGTTIN), bp+1104, libc.UintptrFromInt32(0))
- libc.Xsigaction(tls, int32(m_SIGTTOU), bp+1244, libc.UintptrFromInt32(0))
- if input != m_STDIN_FILENO {
- libc.Xclose(tls, input)
- }
- /*
- * If we were interrupted by a signal, resend it to ourselves
- * now that we have restored the signal handlers.
- */
- i = 0
- for {
- if !(i < int32(m__NSIG)) {
- break
- }
- if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_signo))+uintptr(i)*4) != 0 {
- libc.Xkill(tls, libc.Xgetpid(tls), i)
- switch i {
- case int32(m_SIGTSTP):
- fallthrough
- case int32(m_SIGTTIN):
- fallthrough
- case int32(m_SIGTTOU):
- need_restart = int32(1)
- }
- }
- goto _7
- _7:
- ;
- i++
- }
- if need_restart != 0 {
- goto restart
- }
- if save_errno != 0 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = save_errno
- }
- if nr == -int32(1) {
- v8 = libc.UintptrFromInt32(0)
- } else {
- v8 = buf
- }
- return v8
- }
- func _handler(tls *libc.TLS, s int32) {
- libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_signo))+uintptr(s)*4, int32(1))
- }
- const m_UINT32_MAX1 = 4294967295
- /*
- * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
- * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
- */
- func Xreallocarray(tls *libc.TLS, optr uintptr, nmemb Tsize_t, size Tsize_t) (r uintptr) {
- 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 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOMEM)
- return libc.UintptrFromInt32(0)
- }
- return libc.Xrealloc(tls, optr, size*nmemb)
- }
- const m_UINT32_MAX2 = "0xffffffffu"
- func Xreallocf(tls *libc.TLS, ptr uintptr, size Tsize_t) (r uintptr) {
- var nptr uintptr
- _ = nptr
- nptr = libc.Xrealloc(tls, ptr, size)
- /*
- * When the System V compatibility option (malloc "V" flag) is
- * in effect, realloc(ptr, 0) frees the memory and returns NULL.
- * So, to avoid double free, call free() only when size != 0.
- * realloc(ptr, 0) can't fail when ptr != NULL.
- */
- if !(nptr != 0) && ptr != 0 && size != uint32(0) {
- libc.Xfree(tls, ptr)
- }
- return nptr
- }
- const m_UINT32_MAX3 = 4294967295
- /*
- * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
- * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
- */
- func Xrecallocarray(tls *libc.TLS, ptr uintptr, oldnmemb Tsize_t, newnmemb Tsize_t, size Tsize_t) (r uintptr) {
- var d, newsize, oldsize Tsize_t
- var newptr uintptr
- _, _, _, _ = d, newptr, newsize, oldsize
- if ptr == libc.UintptrFromInt32(0) {
- return libc.Xcalloc(tls, newnmemb, size)
- }
- 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 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOMEM)
- return libc.UintptrFromInt32(0)
- }
- newsize = newnmemb * size
- 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 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return libc.UintptrFromInt32(0)
- }
- oldsize = oldnmemb * size
- /*
- * Don't bother too much if we're shrinking just a bit,
- * we do not shrink for series of small steps, oh well.
- */
- if newsize <= oldsize {
- d = oldsize - newsize
- if d < oldsize/uint32(2) && d < libc.Uint32FromInt32(libc.Xgetpagesize(tls)) {
- libc.Xmemset(tls, ptr+uintptr(newsize), 0, d)
- return ptr
- }
- }
- newptr = libc.Xmalloc(tls, newsize)
- if newptr == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- if newsize > oldsize {
- libc.Xmemcpy(tls, newptr, ptr, oldsize)
- libc.Xmemset(tls, newptr+uintptr(oldsize), 0, newsize-oldsize)
- } else {
- libc.Xmemcpy(tls, newptr, ptr, newsize)
- }
- Xexplicit_bzero(tls, ptr, oldsize)
- libc.Xfree(tls, ptr)
- return newptr
- }
- const m_CMD2_CLR = 1
- const m_CMD2_GBITS = 4
- const m_CMD2_OBITS = 8
- const m_CMD2_SET = 2
- const m_CMD2_UBITS = 16
- const m_SET_LEN = 6
- const m_SET_LEN_INCR = 4
- const m_S_IFDIR1 = 16384
- const m_S_IRGRP1 = 32
- const m_S_IROTH1 = 4
- const m_S_IRUSR1 = 256
- const m_S_IRWXG1 = 56
- const m_S_IRWXO1 = 7
- const m_S_IRWXU1 = 448
- const m_S_ISGID1 = 1024
- const m_S_ISUID1 = 2048
- const m_S_ISVTX1 = 512
- const m_S_IWGRP1 = 16
- const m_S_IWOTH1 = 2
- const m_S_IWUSR1 = 128
- const m_S_IXGRP1 = 8
- const m_S_IXOTH1 = 1
- const m_S_IXUSR1 = 64
- const m_UINT32_MAX4 = "0xffffffffu"
- const m___LONG_MAX1 = 2147483647
- type TBITCMD = struct {
- Fcmd int8
- Fcmd2 int8
- Fbits Tmode_t
- }
- type Tbitcmd = TBITCMD
- // C documentation
- //
- // /*
- // * Given the old mode and an array of bitcmd structures, apply the operations
- // * described in the bitcmd structures to the old mode, and return the new mode.
- // * Note that there is no '=' command; a strict assignment is just a '-' (clear
- // * bits) followed by a '+' (set bits).
- // */
- func Xgetmode(tls *libc.TLS, bbox uintptr, omode Tmode_t) (r Tmode_t) {
- var clrval, newmode, value Tmode_t
- var set uintptr
- var v11 uint32
- _, _, _, _, _ = clrval, newmode, set, value, v11
- set = bbox
- newmode = omode
- value = uint32(0)
- for {
- switch int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd) {
- case int32('u'):
- goto _2
- case int32('g'):
- goto _3
- case int32('o'):
- goto _4
- case int32('+'):
- goto _5
- case int32('-'):
- goto _6
- case int32('X'):
- goto _7
- default:
- goto _8
- case int32('\000'):
- goto _9
- }
- goto _10
- /*
- * When copying the user, group or other bits around, we "know"
- * where the bits are in the mode so that we can do shifts to
- * copy them around. If we don't use shifts, it gets real
- * grundgy with lots of single bit checks and bit sets.
- */
- _2:
- ;
- value = newmode & uint32(m_S_IRWXU1) >> int32(6)
- goto common
- _3:
- ;
- value = newmode & uint32(m_S_IRWXG1) >> int32(3)
- goto common
- _4:
- ;
- value = newmode & uint32(m_S_IRWXO1)
- goto common
- common:
- ;
- if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_CLR) != 0 {
- if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_SET) != 0 {
- v11 = uint32(m_S_IRWXO1)
- } else {
- v11 = value
- }
- clrval = v11
- if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_UBITS) != 0 {
- newmode &= ^(clrval << libc.Int32FromInt32(6) & (*TBITCMD)(unsafe.Pointer(set)).Fbits)
- }
- if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_GBITS) != 0 {
- newmode &= ^(clrval << libc.Int32FromInt32(3) & (*TBITCMD)(unsafe.Pointer(set)).Fbits)
- }
- if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_OBITS) != 0 {
- newmode &= ^(clrval & (*TBITCMD)(unsafe.Pointer(set)).Fbits)
- }
- }
- if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_SET) != 0 {
- if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_UBITS) != 0 {
- newmode |= value << libc.Int32FromInt32(6) & (*TBITCMD)(unsafe.Pointer(set)).Fbits
- }
- if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_GBITS) != 0 {
- newmode |= value << libc.Int32FromInt32(3) & (*TBITCMD)(unsafe.Pointer(set)).Fbits
- }
- if int32((*TBITCMD)(unsafe.Pointer(set)).Fcmd2)&int32(m_CMD2_OBITS) != 0 {
- newmode |= value & (*TBITCMD)(unsafe.Pointer(set)).Fbits
- }
- }
- goto _10
- _5:
- ;
- newmode |= (*TBITCMD)(unsafe.Pointer(set)).Fbits
- goto _10
- _6:
- ;
- newmode &= ^(*TBITCMD)(unsafe.Pointer(set)).Fbits
- goto _10
- _7:
- ;
- 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 {
- newmode |= (*TBITCMD)(unsafe.Pointer(set)).Fbits
- }
- goto _10
- _9:
- ;
- _8:
- ;
- return newmode
- _10:
- ;
- goto _1
- _1:
- ;
- set += 8
- }
- return r
- }
- func Xsetmode(tls *libc.TLS, p uintptr) (r uintptr) {
- bp := tls.Alloc(272)
- defer tls.Free(272)
- var endset, newset, newset1, newset2, newset3, newset4, newset5, saveset, set, v5 uintptr
- var equalopdone, lval, serrno, setlen int32
- var mask, perm, permXbits, who, v1 Tmode_t
- var op, v4 int8
- var setdiff, setdiff1, setdiff2, setdiff3, setdiff4, setdiff5 Tptrdiff_t
- var _ /* ep at bp+0 */ uintptr
- var _ /* signset at bp+4 */ Tsigset_t
- var _ /* sigoset at bp+132 */ Tsigset_t
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- equalopdone = 0
- if !(*(*int8)(unsafe.Pointer(p)) != 0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return libc.UintptrFromInt32(0)
- }
- /*
- * Get a copy of the mask for the permissions that are mask relative.
- * Flip the bits, we want what's not set. Since it's possible that
- * the caller is opening files inside a signal handler, protect them
- * as best we can.
- */
- libc.Xsigfillset(tls, bp+4)
- libc.Xsigprocmask(tls, m_SIG_BLOCK, bp+4, bp+132)
- v1 = libc.Xumask(tls, uint32(0))
- mask = v1
- libc.Xumask(tls, v1)
- mask = ^mask
- libc.Xsigprocmask(tls, int32(m_SIG_SETMASK), bp+132, libc.UintptrFromInt32(0))
- setlen = libc.Int32FromInt32(m_SET_LEN) + libc.Int32FromInt32(2)
- set = Xreallocarray(tls, libc.UintptrFromInt32(0), libc.Uint32FromInt32(setlen), uint32(8))
- if set == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- saveset = set
- endset = set + uintptr(setlen-libc.Int32FromInt32(2))*8
- /*
- * If an absolute number, get it and return; disallow non-octal digits
- * or illegal bits.
- */
- if libc.BoolInt32(uint32(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(p))))-uint32('0') < uint32(10)) != 0 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
- lval = libc.Xstrtol(tls, p, bp, int32(8))
- if *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) != 0 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- goto out
- }
- if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_ERANGE) && (lval == int32(0x7fffffff) || lval == -libc.Int32FromInt32(0x7fffffff)-libc.Int32FromInt32(1)) {
- goto out
- }
- 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 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- goto out
- }
- perm = libc.Uint32FromInt32(lval)
- if set >= endset {
- setdiff = (int32(set) - int32(saveset)) / 8
- setlen += int32(m_SET_LEN_INCR)
- newset = Xreallocarray(tls, saveset, libc.Uint32FromInt32(setlen), uint32(8))
- if newset == libc.UintptrFromInt32(0) {
- goto out
- }
- set = newset + uintptr(setdiff)*8
- saveset = newset
- endset = newset + uintptr(setlen-libc.Int32FromInt32(2))*8
- }
- 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)
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd = 0
- return saveset
- }
- /*
- * Build list of structures to set/clear/copy bits as described by
- * each clause of the symbolic mode.
- */
- for {
- /* First, find out which bits might be modified. */
- who = uint32(0)
- for {
- switch int32(*(*int8)(unsafe.Pointer(p))) {
- case int32('a'):
- 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))
- case int32('u'):
- who |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_ISUID1) | libc.Int32FromInt32(m_S_IRWXU1))
- case int32('g'):
- who |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_ISGID1) | libc.Int32FromInt32(m_S_IRWXG1))
- case int32('o'):
- who |= uint32(m_S_IRWXO1)
- default:
- goto getop
- }
- goto _3
- _3:
- ;
- p++
- }
- goto getop
- getop:
- ;
- v5 = p
- p++
- v4 = *(*int8)(unsafe.Pointer(v5))
- op = v4
- if int32(v4) != int32('+') && int32(op) != int32('-') && int32(op) != int32('=') {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- goto out
- }
- if int32(op) == int32('=') {
- equalopdone = 0
- }
- who &= libc.Uint32FromInt32(^libc.Int32FromInt32(m_S_ISVTX1))
- perm = uint32(0)
- permXbits = libc.Uint32FromInt32(0)
- for {
- switch int32(*(*int8)(unsafe.Pointer(p))) {
- case int32('r'):
- perm |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IRUSR1) | libc.Int32FromInt32(m_S_IRGRP1) | libc.Int32FromInt32(m_S_IROTH1))
- case int32('s'):
- /*
- * If specific bits where requested and
- * only "other" bits ignore set-id.
- */
- if who == uint32(0) || who&libc.Uint32FromInt32(^libc.Int32FromInt32(m_S_IRWXO1)) != 0 {
- perm |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_ISUID1) | libc.Int32FromInt32(m_S_ISGID1))
- }
- case int32('t'):
- /*
- * If specific bits where requested and
- * only "other" bits ignore set-id.
- */
- if who == uint32(0) || who&libc.Uint32FromInt32(^libc.Int32FromInt32(m_S_IRWXO1)) != 0 {
- who |= uint32(m_S_ISVTX1)
- perm |= uint32(m_S_ISVTX1)
- }
- case int32('w'):
- perm |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IWUSR1) | libc.Int32FromInt32(m_S_IWGRP1) | libc.Int32FromInt32(m_S_IWOTH1))
- case int32('X'):
- permXbits = libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXUSR1) | libc.Int32FromInt32(m_S_IXGRP1) | libc.Int32FromInt32(m_S_IXOTH1))
- case int32('x'):
- perm |= libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXUSR1) | libc.Int32FromInt32(m_S_IXGRP1) | libc.Int32FromInt32(m_S_IXOTH1))
- case int32('u'):
- fallthrough
- case int32('g'):
- fallthrough
- case int32('o'):
- /*
- * When ever we hit 'u', 'g', or 'o', we have
- * to flush out any partial mode that we have,
- * and then do the copying of the mode bits.
- */
- if perm != 0 {
- if set >= endset {
- setdiff1 = (int32(set) - int32(saveset)) / 8
- setlen += int32(m_SET_LEN_INCR)
- newset1 = Xreallocarray(tls, saveset, libc.Uint32FromInt32(setlen), uint32(8))
- if newset1 == libc.UintptrFromInt32(0) {
- goto out
- }
- set = newset1 + uintptr(setdiff1)*8
- saveset = newset1
- endset = newset1 + uintptr(setlen-libc.Int32FromInt32(2))*8
- }
- set = _addcmd(tls, set, libc.Uint32FromInt8(op), who, perm, mask)
- perm = uint32(0)
- }
- if int32(op) == int32('=') {
- equalopdone = int32(1)
- }
- if int32(op) == int32('+') && permXbits != 0 {
- if set >= endset {
- setdiff2 = (int32(set) - int32(saveset)) / 8
- setlen += int32(m_SET_LEN_INCR)
- newset2 = Xreallocarray(tls, saveset, libc.Uint32FromInt32(setlen), uint32(8))
- if newset2 == libc.UintptrFromInt32(0) {
- goto out
- }
- set = newset2 + uintptr(setdiff2)*8
- saveset = newset2
- endset = newset2 + uintptr(setlen-libc.Int32FromInt32(2))*8
- }
- set = _addcmd(tls, set, libc.Uint32FromInt32(libc.Int32FromUint8('X')), who, permXbits, mask)
- permXbits = uint32(0)
- }
- if set >= endset {
- setdiff3 = (int32(set) - int32(saveset)) / 8
- setlen += int32(m_SET_LEN_INCR)
- newset3 = Xreallocarray(tls, saveset, libc.Uint32FromInt32(setlen), uint32(8))
- if newset3 == libc.UintptrFromInt32(0) {
- goto out
- }
- set = newset3 + uintptr(setdiff3)*8
- saveset = newset3
- endset = newset3 + uintptr(setlen-libc.Int32FromInt32(2))*8
- }
- set = _addcmd(tls, set, libc.Uint32FromInt8(*(*int8)(unsafe.Pointer(p))), who, libc.Uint32FromInt8(op), mask)
- default:
- /*
- * Add any permissions that we haven't already
- * done.
- */
- if perm != 0 || int32(op) == int32('=') && !(equalopdone != 0) {
- if int32(op) == int32('=') {
- equalopdone = int32(1)
- }
- if set >= endset {
- setdiff4 = (int32(set) - int32(saveset)) / 8
- setlen += int32(m_SET_LEN_INCR)
- newset4 = Xreallocarray(tls, saveset, libc.Uint32FromInt32(setlen), uint32(8))
- if newset4 == libc.UintptrFromInt32(0) {
- goto out
- }
- set = newset4 + uintptr(setdiff4)*8
- saveset = newset4
- endset = newset4 + uintptr(setlen-libc.Int32FromInt32(2))*8
- }
- set = _addcmd(tls, set, libc.Uint32FromInt8(op), who, perm, mask)
- perm = uint32(0)
- }
- if permXbits != 0 {
- if set >= endset {
- setdiff5 = (int32(set) - int32(saveset)) / 8
- setlen += int32(m_SET_LEN_INCR)
- newset5 = Xreallocarray(tls, saveset, libc.Uint32FromInt32(setlen), uint32(8))
- if newset5 == libc.UintptrFromInt32(0) {
- goto out
- }
- set = newset5 + uintptr(setdiff5)*8
- saveset = newset5
- endset = newset5 + uintptr(setlen-libc.Int32FromInt32(2))*8
- }
- set = _addcmd(tls, set, libc.Uint32FromInt32(libc.Int32FromUint8('X')), who, permXbits, mask)
- permXbits = uint32(0)
- }
- goto apply
- }
- goto _6
- _6:
- ;
- p++
- }
- goto apply
- apply:
- ;
- if !(*(*int8)(unsafe.Pointer(p)) != 0) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(p))) != int32(',') {
- goto getop
- }
- p++
- goto _2
- _2:
- }
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd = 0
- _compress_mode(tls, saveset)
- return saveset
- goto out
- out:
- ;
- serrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- libc.Xfree(tls, saveset)
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = serrno
- return libc.UintptrFromInt32(0)
- }
- func _addcmd(tls *libc.TLS, set uintptr, op Tmode_t, who Tmode_t, oparg Tmode_t, mask Tmode_t) (r uintptr) {
- var v1, v2 uint32
- var v3, v4, v5 int32
- var p6, p7, p8 uintptr
- _, _, _, _, _, _, _, _ = v1, v2, v3, v4, v5, p6, p7, p8
- switch op {
- case uint32('='):
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd = int8('-')
- if who != 0 {
- v1 = who
- } else {
- 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))
- }
- (*TBITCMD)(unsafe.Pointer(set)).Fbits = v1
- set += 8
- op = uint32('+')
- /* FALLTHROUGH */
- fallthrough
- case uint32('+'):
- fallthrough
- case uint32('-'):
- fallthrough
- case uint32('X'):
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd = libc.Int8FromUint32(op)
- if who != 0 {
- v2 = who
- } else {
- v2 = mask
- }
- (*TBITCMD)(unsafe.Pointer(set)).Fbits = v2 & oparg
- case uint32('u'):
- fallthrough
- case uint32('g'):
- fallthrough
- case uint32('o'):
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd = libc.Int8FromUint32(op)
- if who != 0 {
- if who&uint32(m_S_IRUSR1) != 0 {
- v3 = int32(m_CMD2_UBITS)
- } else {
- v3 = 0
- }
- if who&uint32(m_S_IRGRP1) != 0 {
- v4 = int32(m_CMD2_GBITS)
- } else {
- v4 = 0
- }
- if who&uint32(m_S_IROTH1) != 0 {
- v5 = int32(m_CMD2_OBITS)
- } else {
- v5 = 0
- }
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd2 = int8(v3 | v4 | v5)
- (*TBITCMD)(unsafe.Pointer(set)).Fbits = libc.Uint32FromInt32(^libc.Int32FromInt32(0))
- } else {
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd2 = int8(libc.Int32FromInt32(m_CMD2_UBITS) | libc.Int32FromInt32(m_CMD2_GBITS) | libc.Int32FromInt32(m_CMD2_OBITS))
- (*TBITCMD)(unsafe.Pointer(set)).Fbits = mask
- }
- if oparg == uint32('+') {
- p6 = set + 1
- *(*int8)(unsafe.Pointer(p6)) = int8(int32(*(*int8)(unsafe.Pointer(p6))) | libc.Int32FromInt32(m_CMD2_SET))
- } else {
- if oparg == uint32('-') {
- p7 = set + 1
- *(*int8)(unsafe.Pointer(p7)) = int8(int32(*(*int8)(unsafe.Pointer(p7))) | libc.Int32FromInt32(m_CMD2_CLR))
- } else {
- if oparg == uint32('=') {
- p8 = set + 1
- *(*int8)(unsafe.Pointer(p8)) = int8(int32(*(*int8)(unsafe.Pointer(p8))) | (libc.Int32FromInt32(m_CMD2_SET) | libc.Int32FromInt32(m_CMD2_CLR)))
- }
- }
- }
- break
- }
- return set + libc.UintptrFromInt32(1)*8
- }
- // C documentation
- //
- // /*
- // * Given an array of bitcmd structures, compress by compacting consecutive
- // * '+', '-' and 'X' commands into at most 3 commands, one of each. The 'u',
- // * 'g' and 'o' commands continue to be separate. They could probably be
- // * compacted, but it's not worth the effort.
- // */
- func _compress_mode(tls *libc.TLS, set uintptr) {
- var Xbits, clrbits, op, setbits, v2, v6, v7, v8 int32
- var nset, v3, v4 uintptr
- _, _, _, _, _, _, _, _, _, _, _ = Xbits, clrbits, nset, op, setbits, v2, v3, v4, v6, v7, v8
- nset = set
- for {
- /* Copy over any 'u', 'g' and 'o' commands. */
- for {
- v2 = int32((*TBITCMD)(unsafe.Pointer(nset)).Fcmd)
- op = v2
- if !(v2 != int32('+') && op != int32('-') && op != int32('X')) {
- break
- }
- v3 = set
- set += 8
- v4 = nset
- nset += 8
- *(*TBITCMD)(unsafe.Pointer(v3)) = *(*TBITCMD)(unsafe.Pointer(v4))
- if !(op != 0) {
- return
- }
- }
- v7 = libc.Int32FromInt32(0)
- Xbits = v7
- v6 = v7
- clrbits = v6
- setbits = v6
- for {
- v8 = int32((*TBITCMD)(unsafe.Pointer(nset)).Fcmd)
- op = v8
- if v8 == int32('-') {
- clrbits = int32(uint32(clrbits) | (*TBITCMD)(unsafe.Pointer(nset)).Fbits)
- setbits = int32(uint32(setbits) & ^(*TBITCMD)(unsafe.Pointer(nset)).Fbits)
- Xbits = int32(uint32(Xbits) & ^(*TBITCMD)(unsafe.Pointer(nset)).Fbits)
- } else {
- if op == int32('+') {
- setbits = int32(uint32(setbits) | (*TBITCMD)(unsafe.Pointer(nset)).Fbits)
- clrbits = int32(uint32(clrbits) & ^(*TBITCMD)(unsafe.Pointer(nset)).Fbits)
- Xbits = int32(uint32(Xbits) & ^(*TBITCMD)(unsafe.Pointer(nset)).Fbits)
- } else {
- if op == int32('X') {
- Xbits = int32(uint32(Xbits) | (*TBITCMD)(unsafe.Pointer(nset)).Fbits&libc.Uint32FromInt32(^setbits))
- } else {
- break
- }
- }
- }
- goto _5
- _5:
- ;
- nset += 8
- }
- if clrbits != 0 {
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd = int8('-')
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd2 = 0
- (*TBITCMD)(unsafe.Pointer(set)).Fbits = libc.Uint32FromInt32(clrbits)
- set += 8
- }
- if setbits != 0 {
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd = int8('+')
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd2 = 0
- (*TBITCMD)(unsafe.Pointer(set)).Fbits = libc.Uint32FromInt32(setbits)
- set += 8
- }
- if Xbits != 0 {
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd = int8('X')
- (*TBITCMD)(unsafe.Pointer(set)).Fcmd2 = 0
- (*TBITCMD)(unsafe.Pointer(set)).Fbits = libc.Uint32FromInt32(Xbits)
- set += 8
- }
- goto _1
- _1:
- }
- }
- const m_SPT_MAXTITLE = 255
- const m_S_IFDIR2 = 0040000
- const m_S_IRGRP2 = 0040
- const m_S_IROTH2 = 0004
- const m_S_IRUSR2 = 0400
- const m_S_IRWXG2 = 0070
- const m_S_IRWXO2 = 0007
- const m_S_IRWXU2 = 0700
- const m_S_ISGID2 = 02000
- const m_S_ISUID2 = 04000
- const m_S_ISVTX2 = 01000
- const m_S_IWGRP2 = 0020
- const m_S_IWOTH2 = 0002
- const m_S_IWUSR2 = 0200
- const m_S_IXGRP2 = 0010
- const m_S_IXOTH2 = 0001
- const m_S_IXUSR2 = 0100
- const m___LONG_MAX2 = 0x7fffffff
- const m___bool_true_false_are_defined = 1
- const m_bool = "_Bool"
- const m_false = 0
- const m_true = 1
- /*
- * Copyright © 2015 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /*
- * Copyright © 2004-2006, 2009-2011 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /* Clang expands this to 1 if an identifier is *not* reserved. */
- /*
- * Some libc implementations do not have a <sys/cdefs.h>, in particular
- * musl, try to handle this gracefully.
- */
- /* Copyright (C) 1992-2022 Free Software Foundation, Inc.
- Copyright The GNU Toolchain Authors.
- This file is part of the GNU C Library.
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
- var _SPT struct {
- Farg0 uintptr
- Fbase uintptr
- Fend uintptr
- Fnul uintptr
- Fwarned uint8
- Freset uint8
- Ferror1 int32
- }
- func _spt_min(tls *libc.TLS, a Tsize_t, b Tsize_t) (r Tsize_t) {
- var v1 uint32
- _ = v1
- if a < b {
- v1 = a
- } else {
- v1 = b
- }
- return v1
- }
- // C documentation
- //
- // /*
- // * For discussion on the portability of the various methods, see
- // * https://lists.freebsd.org/pipermail/freebsd-stable/2008-June/043136.html
- // */
- func _spt_clearenv(tls *libc.TLS) (r int32) {
- return libc.Xclearenv(tls)
- }
- func _spt_copyenv(tls *libc.TLS, envc int32, envp uintptr) (r int32) {
- var envcopy, eq uintptr
- var envsize, error1, i int32
- _, _, _, _, _ = envcopy, envsize, eq, error1, i
- if libc.Xenviron != envp {
- return 0
- }
- /* Make a copy of the old environ array of pointers, in case
- * clearenv() or setenv() is implemented to free the internal
- * environ array, because we will need to access the old environ
- * contents to make the new copy. */
- envsize = libc.Int32FromUint32(libc.Uint32FromInt32(envc+libc.Int32FromInt32(1)) * uint32(4))
- envcopy = libc.Xmalloc(tls, libc.Uint32FromInt32(envsize))
- if envcopy == libc.UintptrFromInt32(0) {
- return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- }
- libc.Xmemcpy(tls, envcopy, envp, libc.Uint32FromInt32(envsize))
- error1 = _spt_clearenv(tls)
- if error1 != 0 {
- libc.Xenviron = envp
- libc.Xfree(tls, envcopy)
- return error1
- }
- i = 0
- for {
- if !(*(*uintptr)(unsafe.Pointer(envcopy + uintptr(i)*4)) != 0) {
- break
- }
- eq = libc.Xstrchr(tls, *(*uintptr)(unsafe.Pointer(envcopy + uintptr(i)*4)), int32('='))
- if eq == libc.UintptrFromInt32(0) {
- goto _1
- }
- *(*int8)(unsafe.Pointer(eq)) = int8('\000')
- if libc.Xsetenv(tls, *(*uintptr)(unsafe.Pointer(envcopy + uintptr(i)*4)), eq+uintptr(1), int32(1)) < 0 {
- error1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- }
- *(*int8)(unsafe.Pointer(eq)) = int8('=')
- if error1 != 0 {
- /* Because the old environ might not be available
- * anymore we will make do with the shallow copy. */
- libc.Xenviron = envcopy
- return error1
- }
- goto _1
- _1:
- ;
- i++
- }
- /* Dispose of the shallow copy, now that we've finished transfering
- * the old environment. */
- libc.Xfree(tls, envcopy)
- return 0
- }
- func _spt_copyargs(tls *libc.TLS, argc int32, argv uintptr) (r int32) {
- var i int32
- var tmp uintptr
- _, _ = i, tmp
- i = int32(1)
- for {
- if !(i < argc || i >= argc && *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) != 0) {
- break
- }
- if *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) == libc.UintptrFromInt32(0) {
- goto _1
- }
- tmp = libc.Xstrdup(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))
- if tmp == libc.UintptrFromInt32(0) {
- return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- }
- *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) = tmp
- goto _1
- _1:
- ;
- i++
- }
- return 0
- }
- func Xsetproctitle_init(tls *libc.TLS, argc int32, argv uintptr, envp uintptr) {
- var base, end, nul, tmp uintptr
- var envc, error1, i int32
- _, _, _, _, _, _, _ = base, end, envc, error1, i, nul, tmp
- /* Try to make sure we got called with main() arguments. */
- if argc < 0 {
- return
- }
- base = *(*uintptr)(unsafe.Pointer(argv))
- if base == libc.UintptrFromInt32(0) {
- return
- }
- nul = base + uintptr(libc.Xstrlen(tls, base))
- end = nul + uintptr(1)
- i = 0
- for {
- if !(i < argc || i >= argc && *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) != 0) {
- break
- }
- if *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) == libc.UintptrFromInt32(0) || *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) != end {
- goto _1
- }
- end = *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)) + uintptr(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))) + uintptr(1)
- goto _1
- _1:
- ;
- i++
- }
- i = 0
- for {
- if !(*(*uintptr)(unsafe.Pointer(envp + uintptr(i)*4)) != 0) {
- break
- }
- if *(*uintptr)(unsafe.Pointer(envp + uintptr(i)*4)) != end {
- goto _2
- }
- end = *(*uintptr)(unsafe.Pointer(envp + uintptr(i)*4)) + uintptr(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(envp + uintptr(i)*4)))) + uintptr(1)
- goto _2
- _2:
- ;
- i++
- }
- envc = i
- _SPT.Farg0 = libc.Xstrdup(tls, *(*uintptr)(unsafe.Pointer(argv)))
- if _SPT.Farg0 == libc.UintptrFromInt32(0) {
- _SPT.Ferror1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- return
- }
- tmp = libc.Xstrdup(tls, Xgetprogname(tls))
- if tmp == libc.UintptrFromInt32(0) {
- _SPT.Ferror1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- return
- }
- Xsetprogname(tls, tmp)
- error1 = _spt_copyenv(tls, envc, envp)
- if error1 != 0 {
- _SPT.Ferror1 = error1
- return
- }
- error1 = _spt_copyargs(tls, argc, argv)
- if error1 != 0 {
- _SPT.Ferror1 = error1
- return
- }
- _SPT.Fnul = nul
- _SPT.Fbase = base
- _SPT.Fend = end
- }
- func Xsetproctitle_impl(tls *libc.TLS, fmt uintptr, va uintptr) {
- bp := tls.Alloc(272)
- defer tls.Free(272)
- var ap Tva_list
- var len1 int32
- var nul, v1 uintptr
- var _ /* buf at bp+0 */ [256]int8
- _, _, _, _ = ap, len1, nul, v1
- if _SPT.Fbase == libc.UintptrFromInt32(0) {
- if !(_SPT.Fwarned != 0) {
- libc.Xwarnx(tls, __ccgo_ts+334, 0)
- _SPT.Fwarned = uint8(m_true)
- }
- return
- }
- if fmt != 0 {
- if int32(*(*int8)(unsafe.Pointer(fmt))) == int32('-') {
- /* Skip program name prefix. */
- fmt++
- len1 = 0
- } else {
- /* Print program name heading for grep. */
- libc.X__builtin_snprintf(tls, bp, uint32(256), __ccgo_ts+14, libc.VaList(bp+264, Xgetprogname(tls)))
- len1 = libc.Int32FromUint32(libc.Xstrlen(tls, bp))
- }
- ap = va
- len1 += libc.X__builtin_vsnprintf(tls, bp+uintptr(len1), uint32(256)-libc.Uint32FromInt32(len1), fmt, ap)
- _ = ap
- } else {
- len1 = libc.X__builtin_snprintf(tls, bp, uint32(256), __ccgo_ts+432, libc.VaList(bp+264, _SPT.Farg0))
- }
- if len1 <= 0 {
- _SPT.Ferror1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- return
- }
- if !(_SPT.Freset != 0) {
- libc.Xmemset(tls, _SPT.Fbase, 0, libc.Uint32FromInt32(int32(_SPT.Fend)-int32(_SPT.Fbase)))
- _SPT.Freset = uint8(m_true)
- } else {
- libc.Xmemset(tls, _SPT.Fbase, 0, _spt_min(tls, uint32(256), libc.Uint32FromInt32(int32(_SPT.Fend)-int32(_SPT.Fbase))))
- }
- len1 = libc.Int32FromUint32(_spt_min(tls, libc.Uint32FromInt32(len1), _spt_min(tls, uint32(256), libc.Uint32FromInt32(int32(_SPT.Fend)-int32(_SPT.Fbase)))-uint32(1)))
- libc.Xmemcpy(tls, _SPT.Fbase, bp, libc.Uint32FromInt32(len1))
- nul = _SPT.Fbase + uintptr(len1)
- if nul < _SPT.Fnul {
- *(*int8)(unsafe.Pointer(_SPT.Fnul)) = int8('.')
- } else {
- if nul == _SPT.Fnul && nul+1 < _SPT.Fend {
- *(*int8)(unsafe.Pointer(_SPT.Fnul)) = int8(' ')
- nul++
- v1 = nul
- *(*int8)(unsafe.Pointer(v1)) = int8('\000')
- }
- }
- }
- // C documentation
- //
- // /*
- // * Appends src to string dst of size dsize (unlike strncat, dsize is the
- // * full size of dst, not space left). At most dsize-1 characters
- // * will be copied. Always NUL terminates (unless dsize <= strlen(dst)).
- // * Returns strlen(src) + MIN(dsize, strlen(initial dst)).
- // * If retval >= dsize, truncation occurred.
- // */
- func Xstrlcat(tls *libc.TLS, dst uintptr, src uintptr, dsize Tsize_t) (r Tsize_t) {
- var dlen, n, v1, v2 Tsize_t
- var odst, osrc, v3 uintptr
- _, _, _, _, _, _, _ = dlen, n, odst, osrc, v1, v2, v3
- odst = dst
- osrc = src
- n = dsize
- /* Find the end of dst and adjust bytes left but don't go past end. */
- for {
- v1 = n
- n--
- if !(v1 != uint32(0) && int32(*(*int8)(unsafe.Pointer(dst))) != int32('\000')) {
- break
- }
- dst++
- }
- dlen = libc.Uint32FromInt32(int32(dst) - int32(odst))
- n = dsize - dlen
- v2 = n
- n--
- if v2 == uint32(0) {
- return dlen + libc.Xstrlen(tls, src)
- }
- for int32(*(*int8)(unsafe.Pointer(src))) != int32('\000') {
- if n != uint32(0) {
- v3 = dst
- dst++
- *(*int8)(unsafe.Pointer(v3)) = *(*int8)(unsafe.Pointer(src))
- n--
- }
- src++
- }
- *(*int8)(unsafe.Pointer(dst)) = int8('\000')
- return dlen + libc.Uint32FromInt32(int32(src)-int32(osrc)) /* count does not include NUL */
- }
- // C documentation
- //
- // /*
- // * Copy string src to buffer dst of size dsize. At most dsize-1
- // * chars will be copied. Always NUL terminates (unless dsize == 0).
- // * Returns strlen(src); if retval >= dsize, truncation occurred.
- // */
- func Xstrlcpy(tls *libc.TLS, dst uintptr, src uintptr, dsize Tsize_t) (r Tsize_t) {
- var nleft, v1 Tsize_t
- var osrc, v3, v4, v5 uintptr
- var v2 int8
- _, _, _, _, _, _, _ = nleft, osrc, v1, v2, v3, v4, v5
- osrc = src
- nleft = dsize
- /* Copy as many bytes as will fit. */
- if nleft != uint32(0) {
- for {
- nleft--
- v1 = nleft
- if !(v1 != uint32(0)) {
- break
- }
- v3 = src
- src++
- v2 = *(*int8)(unsafe.Pointer(v3))
- v4 = dst
- dst++
- *(*int8)(unsafe.Pointer(v4)) = v2
- if int32(v2) == int32('\000') {
- break
- }
- }
- }
- /* Not enough room in dst, add NUL and traverse rest of src. */
- if nleft == uint32(0) {
- if dsize != uint32(0) {
- *(*int8)(unsafe.Pointer(dst)) = int8('\000')
- } /* NUL-terminate dst */
- for {
- v5 = src
- src++
- if !(*(*int8)(unsafe.Pointer(v5)) != 0) {
- break
- }
- }
- }
- return libc.Uint32FromInt32(int32(src) - int32(osrc) - libc.Int32FromInt32(1)) /* count does not include NUL */
- }
- const m__SL_CHUNKSIZE = 20
- type TStringList = struct {
- Fsl_str uintptr
- Fsl_max Tsize_t
- Fsl_cur Tsize_t
- }
- type T_stringlist = TStringList
- // C documentation
- //
- // /*
- // * sl_init(): Initialize a string list
- // */
- func Xsl_init(tls *libc.TLS) (r uintptr) {
- var sl uintptr
- _ = sl
- sl = libc.Xmalloc(tls, uint32(12))
- if sl == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- (*TStringList)(unsafe.Pointer(sl)).Fsl_cur = uint32(0)
- (*TStringList)(unsafe.Pointer(sl)).Fsl_max = uint32(m__SL_CHUNKSIZE)
- (*TStringList)(unsafe.Pointer(sl)).Fsl_str = Xreallocarray(tls, libc.UintptrFromInt32(0), (*TStringList)(unsafe.Pointer(sl)).Fsl_max, uint32(4))
- if (*TStringList)(unsafe.Pointer(sl)).Fsl_str == libc.UintptrFromInt32(0) {
- libc.Xfree(tls, sl)
- sl = libc.UintptrFromInt32(0)
- }
- return sl
- }
- // C documentation
- //
- // /*
- // * sl_add(): Add an item to the string list
- // */
- func Xsl_add(tls *libc.TLS, sl uintptr, name uintptr) (r int32) {
- var new1, v2 uintptr
- var v1 Tsize_t
- _, _, _ = new1, v1, v2
- if (*TStringList)(unsafe.Pointer(sl)).Fsl_cur == (*TStringList)(unsafe.Pointer(sl)).Fsl_max-uint32(1) {
- new1 = Xreallocarray(tls, (*TStringList)(unsafe.Pointer(sl)).Fsl_str, (*TStringList)(unsafe.Pointer(sl)).Fsl_max+libc.Uint32FromInt32(m__SL_CHUNKSIZE), uint32(4))
- if new1 == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- *(*Tsize_t)(unsafe.Pointer(sl + 4)) += uint32(m__SL_CHUNKSIZE)
- (*TStringList)(unsafe.Pointer(sl)).Fsl_str = new1
- }
- v2 = sl + 8
- v1 = *(*Tsize_t)(unsafe.Pointer(v2))
- *(*Tsize_t)(unsafe.Pointer(v2))++
- *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(v1)*4)) = name
- return 0
- }
- // C documentation
- //
- // /*
- // * sl_free(): Free a stringlist
- // */
- func Xsl_free(tls *libc.TLS, sl uintptr, all int32) {
- var i Tsize_t
- _ = i
- if sl == libc.UintptrFromInt32(0) {
- return
- }
- if (*TStringList)(unsafe.Pointer(sl)).Fsl_str != 0 {
- if all != 0 {
- i = uint32(0)
- for {
- if !(i < (*TStringList)(unsafe.Pointer(sl)).Fsl_cur) {
- break
- }
- libc.Xfree(tls, *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(i)*4)))
- goto _1
- _1:
- ;
- i++
- }
- }
- libc.Xfree(tls, (*TStringList)(unsafe.Pointer(sl)).Fsl_str)
- }
- libc.Xfree(tls, sl)
- }
- // C documentation
- //
- // /*
- // * sl_find(): Find a name in the string list
- // */
- func Xsl_find(tls *libc.TLS, sl uintptr, name uintptr) (r uintptr) {
- var i Tsize_t
- _ = i
- i = uint32(0)
- for {
- if !(i < (*TStringList)(unsafe.Pointer(sl)).Fsl_cur) {
- break
- }
- if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(i)*4)), name) == 0 {
- return *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(i)*4))
- }
- goto _1
- _1:
- ;
- i++
- }
- return libc.UintptrFromInt32(0)
- }
- func Xsl_delete(tls *libc.TLS, sl uintptr, name uintptr, all int32) (r int32) {
- var i, j, v3 Tsize_t
- var v4 uintptr
- _, _, _, _ = i, j, v3, v4
- i = uint32(0)
- for {
- if !(i < (*TStringList)(unsafe.Pointer(sl)).Fsl_cur) {
- break
- }
- if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(i)*4)), name) == 0 {
- if all != 0 {
- libc.Xfree(tls, *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(i)*4)))
- }
- j = i + uint32(1)
- for {
- if !(j < (*TStringList)(unsafe.Pointer(sl)).Fsl_cur) {
- break
- }
- *(*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))
- goto _2
- _2:
- ;
- j++
- }
- v4 = sl + 8
- *(*Tsize_t)(unsafe.Pointer(v4))--
- v3 = *(*Tsize_t)(unsafe.Pointer(v4))
- *(*uintptr)(unsafe.Pointer((*TStringList)(unsafe.Pointer(sl)).Fsl_str + uintptr(v3)*4)) = libc.UintptrFromInt32(0)
- return 0
- }
- goto _1
- _1:
- ;
- i++
- }
- return -int32(1)
- }
- const m_S_IFBLK1 = 24576
- const m_S_IFCHR1 = 8192
- const m_S_IFDIR3 = 16384
- const m_S_IFIFO1 = 4096
- const m_S_IFLNK1 = 40960
- const m_S_IFMT1 = 61440
- const m_S_IFREG1 = 32768
- const m_S_IFSOCK1 = 49152
- const m_S_IRGRP3 = 32
- const m_S_IROTH3 = 4
- const m_S_IRUSR3 = 256
- const m_S_ISGID3 = 1024
- const m_S_ISUID3 = 2048
- const m_S_ISVTX3 = 512
- const m_S_IWGRP3 = 16
- const m_S_IWOTH3 = 2
- const m_S_IWUSR3 = 128
- const m_S_IXGRP3 = 8
- const m_S_IXOTH3 = 1
- const m_S_IXUSR3 = 64
- func Xstrmode(tls *libc.TLS, mode Tmode_t, p uintptr) {
- 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
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- /* print type */
- switch mode & libc.Uint32FromInt32(m_S_IFMT1) {
- case uint32(m_S_IFDIR3): /* directory */
- v1 = p
- p++
- *(*int8)(unsafe.Pointer(v1)) = int8('d')
- case uint32(m_S_IFCHR1): /* character special */
- v2 = p
- p++
- *(*int8)(unsafe.Pointer(v2)) = int8('c')
- case uint32(m_S_IFBLK1): /* block special */
- v3 = p
- p++
- *(*int8)(unsafe.Pointer(v3)) = int8('b')
- case uint32(m_S_IFREG1): /* regular */
- v4 = p
- p++
- *(*int8)(unsafe.Pointer(v4)) = int8('-')
- case uint32(m_S_IFLNK1): /* symbolic link */
- v5 = p
- p++
- *(*int8)(unsafe.Pointer(v5)) = int8('l')
- case uint32(m_S_IFSOCK1): /* socket */
- v6 = p
- p++
- *(*int8)(unsafe.Pointer(v6)) = int8('s')
- case uint32(m_S_IFIFO1): /* fifo */
- v7 = p
- p++
- *(*int8)(unsafe.Pointer(v7)) = int8('p')
- default: /* unknown */
- v8 = p
- p++
- *(*int8)(unsafe.Pointer(v8)) = int8('?')
- break
- }
- /* usr */
- if mode&uint32(m_S_IRUSR3) != 0 {
- v9 = p
- p++
- *(*int8)(unsafe.Pointer(v9)) = int8('r')
- } else {
- v10 = p
- p++
- *(*int8)(unsafe.Pointer(v10)) = int8('-')
- }
- if mode&uint32(m_S_IWUSR3) != 0 {
- v11 = p
- p++
- *(*int8)(unsafe.Pointer(v11)) = int8('w')
- } else {
- v12 = p
- p++
- *(*int8)(unsafe.Pointer(v12)) = int8('-')
- }
- switch mode & libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXUSR3)|libc.Int32FromInt32(m_S_ISUID3)) {
- case uint32(0):
- v13 = p
- p++
- *(*int8)(unsafe.Pointer(v13)) = int8('-')
- case uint32(m_S_IXUSR3):
- v14 = p
- p++
- *(*int8)(unsafe.Pointer(v14)) = int8('x')
- case uint32(m_S_ISUID3):
- v15 = p
- p++
- *(*int8)(unsafe.Pointer(v15)) = int8('S')
- case libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXUSR3) | libc.Int32FromInt32(m_S_ISUID3)):
- v16 = p
- p++
- *(*int8)(unsafe.Pointer(v16)) = int8('s')
- break
- }
- /* group */
- if mode&uint32(m_S_IRGRP3) != 0 {
- v17 = p
- p++
- *(*int8)(unsafe.Pointer(v17)) = int8('r')
- } else {
- v18 = p
- p++
- *(*int8)(unsafe.Pointer(v18)) = int8('-')
- }
- if mode&uint32(m_S_IWGRP3) != 0 {
- v19 = p
- p++
- *(*int8)(unsafe.Pointer(v19)) = int8('w')
- } else {
- v20 = p
- p++
- *(*int8)(unsafe.Pointer(v20)) = int8('-')
- }
- switch mode & libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXGRP3)|libc.Int32FromInt32(m_S_ISGID3)) {
- case uint32(0):
- v21 = p
- p++
- *(*int8)(unsafe.Pointer(v21)) = int8('-')
- case uint32(m_S_IXGRP3):
- v22 = p
- p++
- *(*int8)(unsafe.Pointer(v22)) = int8('x')
- case uint32(m_S_ISGID3):
- v23 = p
- p++
- *(*int8)(unsafe.Pointer(v23)) = int8('S')
- case libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXGRP3) | libc.Int32FromInt32(m_S_ISGID3)):
- v24 = p
- p++
- *(*int8)(unsafe.Pointer(v24)) = int8('s')
- break
- }
- /* other */
- if mode&uint32(m_S_IROTH3) != 0 {
- v25 = p
- p++
- *(*int8)(unsafe.Pointer(v25)) = int8('r')
- } else {
- v26 = p
- p++
- *(*int8)(unsafe.Pointer(v26)) = int8('-')
- }
- if mode&uint32(m_S_IWOTH3) != 0 {
- v27 = p
- p++
- *(*int8)(unsafe.Pointer(v27)) = int8('w')
- } else {
- v28 = p
- p++
- *(*int8)(unsafe.Pointer(v28)) = int8('-')
- }
- switch mode & libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXOTH3)|libc.Int32FromInt32(m_S_ISVTX3)) {
- case uint32(0):
- v29 = p
- p++
- *(*int8)(unsafe.Pointer(v29)) = int8('-')
- case uint32(m_S_IXOTH3):
- v30 = p
- p++
- *(*int8)(unsafe.Pointer(v30)) = int8('x')
- case uint32(m_S_ISVTX3):
- v31 = p
- p++
- *(*int8)(unsafe.Pointer(v31)) = int8('T')
- case libc.Uint32FromInt32(libc.Int32FromInt32(m_S_IXOTH3) | libc.Int32FromInt32(m_S_ISVTX3)):
- v32 = p
- p++
- *(*int8)(unsafe.Pointer(v32)) = int8('t')
- break
- }
- v33 = p
- p++
- *(*int8)(unsafe.Pointer(v33)) = int8(' ') /* will be a '+' if ACL's implemented */
- *(*int8)(unsafe.Pointer(p)) = int8('\000')
- }
- // C documentation
- //
- // /*
- // * Find the first occurrence of find in s, where the search is limited to the
- // * first slen characters of s.
- // */
- func Xstrnstr(tls *libc.TLS, s uintptr, find uintptr, slen Tsize_t) (r uintptr) {
- var c, sc, v1, v4 int8
- var len1, v3 Tsize_t
- var v2, v5 uintptr
- var v6 bool
- _, _, _, _, _, _, _, _, _ = c, len1, sc, v1, v2, v3, v4, v5, v6
- v2 = find
- find++
- v1 = *(*int8)(unsafe.Pointer(v2))
- c = v1
- if int32(v1) != int32('\000') {
- len1 = libc.Xstrlen(tls, find)
- for cond := true; cond; cond = libc.Xstrncmp(tls, s, find, len1) != 0 {
- for cond := true; cond; cond = int32(sc) != int32(c) {
- v3 = slen
- slen--
- if v6 = v3 < uint32(1); !v6 {
- v5 = s
- s++
- v4 = *(*int8)(unsafe.Pointer(v5))
- sc = v4
- }
- if v6 || int32(v4) == int32('\000') {
- return libc.UintptrFromInt32(0)
- }
- }
- if len1 > slen {
- return libc.UintptrFromInt32(0)
- }
- }
- s--
- }
- return s
- }
- func Xstrtoi(tls *libc.TLS, nptr uintptr, endptr uintptr, base int32, lo Tintmax_t, hi Tintmax_t, rstatus uintptr) (r Tintmax_t) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var im Tintmax_t
- var serrno int32
- var _ /* ep at bp+0 */ uintptr
- var _ /* rep at bp+4 */ int32
- _, _ = im, serrno
- /* endptr may be NULL */
- if endptr == libc.UintptrFromInt32(0) {
- endptr = bp
- }
- if rstatus == libc.UintptrFromInt32(0) {
- rstatus = bp + 4
- }
- serrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
- im = libc.Xstrtoimax(tls, nptr, endptr, base)
- *(*int32)(unsafe.Pointer(rstatus)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = serrno
- if *(*int32)(unsafe.Pointer(rstatus)) == 0 {
- /* No digits were found */
- if nptr == *(*uintptr)(unsafe.Pointer(endptr)) {
- *(*int32)(unsafe.Pointer(rstatus)) = int32(m_ECANCELED)
- } else {
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(endptr))))) != int32('\000') {
- *(*int32)(unsafe.Pointer(rstatus)) = int32(m_EOPNOTSUPP)
- }
- }
- }
- if im < lo {
- if *(*int32)(unsafe.Pointer(rstatus)) == 0 {
- *(*int32)(unsafe.Pointer(rstatus)) = int32(m_ERANGE)
- }
- return lo
- }
- if im > hi {
- if *(*int32)(unsafe.Pointer(rstatus)) == 0 {
- *(*int32)(unsafe.Pointer(rstatus)) = int32(m_ERANGE)
- }
- return hi
- }
- return im
- }
- const m_S_IFBLK2 = 0060000
- const m_S_IFCHR2 = 0020000
- const m_S_IFDIR4 = 0040000
- const m_S_IFIFO2 = 0010000
- const m_S_IFLNK2 = 0120000
- const m_S_IFMT2 = 0170000
- const m_S_IFREG2 = 0100000
- const m_S_IFSOCK2 = 0140000
- const m_S_IRGRP4 = 0040
- const m_S_IROTH4 = 0004
- const m_S_IRUSR4 = 0400
- const m_S_ISGID4 = 02000
- const m_S_ISUID4 = 04000
- const m_S_ISVTX4 = 01000
- const m_S_IWGRP4 = 0020
- const m_S_IWOTH4 = 0002
- const m_S_IWUSR4 = 0200
- const m_S_IXGRP4 = 0010
- const m_S_IXOTH4 = 0001
- const m_S_IXUSR4 = 0100
- func Xstrtonum(tls *libc.TLS, nptr uintptr, minval int64, maxval int64, errstr uintptr) (r int64) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var rv int64
- var v1 uintptr
- var _ /* e at bp+0 */ int32
- var _ /* resp at bp+4 */ uintptr
- _, _ = rv, v1
- if errstr == libc.UintptrFromInt32(0) {
- errstr = bp + 4
- }
- rv = Xstrtoi(tls, nptr, libc.UintptrFromInt32(0), int32(10), minval, maxval, bp)
- if *(*int32)(unsafe.Pointer(bp)) == 0 {
- *(*uintptr)(unsafe.Pointer(errstr)) = libc.UintptrFromInt32(0)
- return rv
- }
- if *(*int32)(unsafe.Pointer(bp)) == int32(m_ERANGE) {
- if rv == maxval {
- v1 = __ccgo_ts + 435
- } else {
- v1 = __ccgo_ts + 445
- }
- *(*uintptr)(unsafe.Pointer(errstr)) = v1
- } else {
- *(*uintptr)(unsafe.Pointer(errstr)) = __ccgo_ts + 455
- }
- return 0
- }
- func Xstrtou(tls *libc.TLS, nptr uintptr, endptr uintptr, base int32, lo Tuintmax_t, hi Tuintmax_t, rstatus uintptr) (r Tuintmax_t) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var im Tuintmax_t
- var serrno int32
- var _ /* ep at bp+0 */ uintptr
- var _ /* rep at bp+4 */ int32
- _, _ = im, serrno
- /* endptr may be NULL */
- if endptr == libc.UintptrFromInt32(0) {
- endptr = bp
- }
- if rstatus == libc.UintptrFromInt32(0) {
- rstatus = bp + 4
- }
- serrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
- im = libc.Xstrtoumax(tls, nptr, endptr, base)
- *(*int32)(unsafe.Pointer(rstatus)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = serrno
- if *(*int32)(unsafe.Pointer(rstatus)) == 0 {
- /* No digits were found */
- if nptr == *(*uintptr)(unsafe.Pointer(endptr)) {
- *(*int32)(unsafe.Pointer(rstatus)) = int32(m_ECANCELED)
- } else {
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(endptr))))) != int32('\000') {
- *(*int32)(unsafe.Pointer(rstatus)) = int32(m_EOPNOTSUPP)
- }
- }
- }
- if im < lo {
- if *(*int32)(unsafe.Pointer(rstatus)) == 0 {
- *(*int32)(unsafe.Pointer(rstatus)) = int32(m_ERANGE)
- }
- return lo
- }
- if im > hi {
- if *(*int32)(unsafe.Pointer(rstatus)) == 0 {
- *(*int32)(unsafe.Pointer(rstatus)) = int32(m_ERANGE)
- }
- return hi
- }
- return im
- }
- // C documentation
- //
- // /*
- // * Convert a 32 bit representation of time_t into time_t. XXX needs to
- // * implement the 50-year rule to handle post-2038 conversions.
- // */
- func X_time32_to_time(tls *libc.TLS, t32 Tint32_t) (r Ttime_t) {
- return int64(t32)
- }
- // C documentation
- //
- // /*
- // * Convert time_t to a 32 bit representation. If time_t is 64 bits we can
- // * simply chop it down. The resulting 32 bit representation can be
- // * converted back to a temporally local 64 bit time_t using time32_to_time.
- // */
- func X_time_to_time32(tls *libc.TLS, t Ttime_t) (r Tint32_t) {
- return int32(t)
- }
- // C documentation
- //
- // /*
- // * Convert a 64 bit representation of time_t into time_t. If time_t is
- // * represented as 32 bits we can simply chop it and not support times
- // * past 2038.
- // */
- func X_time64_to_time(tls *libc.TLS, t64 Tint64_t) (r Ttime_t) {
- return t64
- }
- // C documentation
- //
- // /*
- // * Convert time_t to a 64 bit representation. If time_t is represented
- // * as 32 bits we simply sign-extend and do not support times past 2038.
- // */
- func X_time_to_time64(tls *libc.TLS, t Ttime_t) (r Tint64_t) {
- return t
- }
- // C documentation
- //
- // /*
- // * Convert to/from 'long'. Depending on the sizeof(long) this may or
- // * may not require using the 50-year rule.
- // */
- func X_time_to_long(tls *libc.TLS, t Ttime_t) (r int32) {
- if uint32(4) == uint32(8) {
- return int32(X_time_to_time64(tls, t))
- }
- return int32(t)
- }
- func X_long_to_time(tls *libc.TLS, tlong int32) (r Ttime_t) {
- if uint32(4) == uint32(4) {
- return X_time32_to_time(tls, tlong)
- }
- return int64(tlong)
- }
- // C documentation
- //
- // /*
- // * Convert to/from 'int'. Depending on the sizeof(int) this may or
- // * may not require using the 50-year rule.
- // */
- func X_time_to_int(tls *libc.TLS, t Ttime_t) (r int32) {
- if uint32(4) == uint32(8) {
- return int32(X_time_to_time64(tls, t))
- }
- return int32(t)
- }
- func X_int_to_time(tls *libc.TLS, tint int32) (r Ttime_t) {
- if uint32(4) == uint32(4) {
- return X_time32_to_time(tls, tint)
- }
- return int64(tint)
- }
- const m_S_AMP = 13
- const m_S_CTRL = 4
- const m_S_EATCRNL = 12
- const m_S_GROUND = 0
- const m_S_HEX = 7
- const m_S_HEX1 = 8
- const m_S_HEX2 = 9
- const m_S_META = 2
- const m_S_META1 = 3
- const m_S_MIME1 = 10
- const m_S_MIME2 = 11
- const m_S_NUMBER = 14
- const m_S_OCTAL2 = 5
- const m_S_OCTAL3 = 6
- const m_S_START = 1
- const m_S_STRING = 15
- const m_UNVIS_END = "_VIS_END"
- const m_UNVIS_NOCHAR = 3
- const m_UNVIS_VALID = 1
- const m_UNVIS_VALIDPUSH = 2
- const m_VIS_CSTYLE = 0x0002
- const m_VIS_DQ = 0x8000
- const m_VIS_GLOB = 0x1000
- const m_VIS_HTTP1808 = 128
- const m_VIS_HTTP1866 = 512
- const m_VIS_HTTPSTYLE = 0x0080
- const m_VIS_MIMESTYLE = 256
- const m_VIS_NL = 0x0010
- const m_VIS_NOESCAPE = 1024
- const m_VIS_NOLOCALE = 0x4000
- const m_VIS_NOSLASH = 0x0040
- const m_VIS_OCTAL = 0x0001
- const m_VIS_SAFE = 0x0020
- const m_VIS_SHELL = 0x2000
- const m_VIS_SP = 0x0004
- const m_VIS_TAB = 0x0008
- const m__VIS_END = 2048
- /*
- * Copyright © 2015 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /*
- * Copyright © 2004-2006, 2009-2011 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /* Clang expands this to 1 if an identifier is *not* reserved. */
- /*
- * Some libc implementations do not have a <sys/cdefs.h>, in particular
- * musl, try to handle this gracefully.
- */
- /* Copyright (C) 1992-2022 Free Software Foundation, Inc.
- Copyright The GNU Toolchain Authors.
- This file is part of the GNU C Library.
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
- /*
- * decode driven by state machine
- */
- // C documentation
- //
- // /*
- // * RFC 1866
- // */
- type Tnv = struct {
- Fname [7]int8
- Fvalue Tuint8_t
- }
- /*
- * Copyright © 2015 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /*
- * Copyright © 2004-2006, 2009-2011 Guillem Jover <guillem@hadrons.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /* Clang expands this to 1 if an identifier is *not* reserved. */
- /*
- * Some libc implementations do not have a <sys/cdefs.h>, in particular
- * musl, try to handle this gracefully.
- */
- /* Copyright (C) 1992-2022 Free Software Foundation, Inc.
- Copyright The GNU Toolchain Authors.
- This file is part of the GNU C Library.
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
- /*
- * decode driven by state machine
- */
- // C documentation
- //
- // /*
- // * RFC 1866
- // */
- var _nv = [100]Tnv{
- 0: {
- Fname: [7]int8{'A', 'E', 'l', 'i', 'g'},
- Fvalue: uint8(198),
- },
- 1: {
- Fname: [7]int8{'A', 'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(193),
- },
- 2: {
- Fname: [7]int8{'A', 'c', 'i', 'r', 'c'},
- Fvalue: uint8(194),
- },
- 3: {
- Fname: [7]int8{'A', 'g', 'r', 'a', 'v', 'e'},
- Fvalue: uint8(192),
- },
- 4: {
- Fname: [7]int8{'A', 'r', 'i', 'n', 'g'},
- Fvalue: uint8(197),
- },
- 5: {
- Fname: [7]int8{'A', 't', 'i', 'l', 'd', 'e'},
- Fvalue: uint8(195),
- },
- 6: {
- Fname: [7]int8{'A', 'u', 'm', 'l'},
- Fvalue: uint8(196),
- },
- 7: {
- Fname: [7]int8{'C', 'c', 'e', 'd', 'i', 'l'},
- Fvalue: uint8(199),
- },
- 8: {
- Fname: [7]int8{'E', 'T', 'H'},
- Fvalue: uint8(208),
- },
- 9: {
- Fname: [7]int8{'E', 'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(201),
- },
- 10: {
- Fname: [7]int8{'E', 'c', 'i', 'r', 'c'},
- Fvalue: uint8(202),
- },
- 11: {
- Fname: [7]int8{'E', 'g', 'r', 'a', 'v', 'e'},
- Fvalue: uint8(200),
- },
- 12: {
- Fname: [7]int8{'E', 'u', 'm', 'l'},
- Fvalue: uint8(203),
- },
- 13: {
- Fname: [7]int8{'I', 'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(205),
- },
- 14: {
- Fname: [7]int8{'I', 'c', 'i', 'r', 'c'},
- Fvalue: uint8(206),
- },
- 15: {
- Fname: [7]int8{'I', 'g', 'r', 'a', 'v', 'e'},
- Fvalue: uint8(204),
- },
- 16: {
- Fname: [7]int8{'I', 'u', 'm', 'l'},
- Fvalue: uint8(207),
- },
- 17: {
- Fname: [7]int8{'N', 't', 'i', 'l', 'd', 'e'},
- Fvalue: uint8(209),
- },
- 18: {
- Fname: [7]int8{'O', 'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(211),
- },
- 19: {
- Fname: [7]int8{'O', 'c', 'i', 'r', 'c'},
- Fvalue: uint8(212),
- },
- 20: {
- Fname: [7]int8{'O', 'g', 'r', 'a', 'v', 'e'},
- Fvalue: uint8(210),
- },
- 21: {
- Fname: [7]int8{'O', 's', 'l', 'a', 's', 'h'},
- Fvalue: uint8(216),
- },
- 22: {
- Fname: [7]int8{'O', 't', 'i', 'l', 'd', 'e'},
- Fvalue: uint8(213),
- },
- 23: {
- Fname: [7]int8{'O', 'u', 'm', 'l'},
- Fvalue: uint8(214),
- },
- 24: {
- Fname: [7]int8{'T', 'H', 'O', 'R', 'N'},
- Fvalue: uint8(222),
- },
- 25: {
- Fname: [7]int8{'U', 'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(218),
- },
- 26: {
- Fname: [7]int8{'U', 'c', 'i', 'r', 'c'},
- Fvalue: uint8(219),
- },
- 27: {
- Fname: [7]int8{'U', 'g', 'r', 'a', 'v', 'e'},
- Fvalue: uint8(217),
- },
- 28: {
- Fname: [7]int8{'U', 'u', 'm', 'l'},
- Fvalue: uint8(220),
- },
- 29: {
- Fname: [7]int8{'Y', 'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(221),
- },
- 30: {
- Fname: [7]int8{'a', 'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(225),
- },
- 31: {
- Fname: [7]int8{'a', 'c', 'i', 'r', 'c'},
- Fvalue: uint8(226),
- },
- 32: {
- Fname: [7]int8{'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(180),
- },
- 33: {
- Fname: [7]int8{'a', 'e', 'l', 'i', 'g'},
- Fvalue: uint8(230),
- },
- 34: {
- Fname: [7]int8{'a', 'g', 'r', 'a', 'v', 'e'},
- Fvalue: uint8(224),
- },
- 35: {
- Fname: [7]int8{'a', 'm', 'p'},
- Fvalue: uint8(38),
- },
- 36: {
- Fname: [7]int8{'a', 'r', 'i', 'n', 'g'},
- Fvalue: uint8(229),
- },
- 37: {
- Fname: [7]int8{'a', 't', 'i', 'l', 'd', 'e'},
- Fvalue: uint8(227),
- },
- 38: {
- Fname: [7]int8{'a', 'u', 'm', 'l'},
- Fvalue: uint8(228),
- },
- 39: {
- Fname: [7]int8{'b', 'r', 'v', 'b', 'a', 'r'},
- Fvalue: uint8(166),
- },
- 40: {
- Fname: [7]int8{'c', 'c', 'e', 'd', 'i', 'l'},
- Fvalue: uint8(231),
- },
- 41: {
- Fname: [7]int8{'c', 'e', 'd', 'i', 'l'},
- Fvalue: uint8(184),
- },
- 42: {
- Fname: [7]int8{'c', 'e', 'n', 't'},
- Fvalue: uint8(162),
- },
- 43: {
- Fname: [7]int8{'c', 'o', 'p', 'y'},
- Fvalue: uint8(169),
- },
- 44: {
- Fname: [7]int8{'c', 'u', 'r', 'r', 'e', 'n'},
- Fvalue: uint8(164),
- },
- 45: {
- Fname: [7]int8{'d', 'e', 'g'},
- Fvalue: uint8(176),
- },
- 46: {
- Fname: [7]int8{'d', 'i', 'v', 'i', 'd', 'e'},
- Fvalue: uint8(247),
- },
- 47: {
- Fname: [7]int8{'e', 'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(233),
- },
- 48: {
- Fname: [7]int8{'e', 'c', 'i', 'r', 'c'},
- Fvalue: uint8(234),
- },
- 49: {
- Fname: [7]int8{'e', 'g', 'r', 'a', 'v', 'e'},
- Fvalue: uint8(232),
- },
- 50: {
- Fname: [7]int8{'e', 't', 'h'},
- Fvalue: uint8(240),
- },
- 51: {
- Fname: [7]int8{'e', 'u', 'm', 'l'},
- Fvalue: uint8(235),
- },
- 52: {
- Fname: [7]int8{'f', 'r', 'a', 'c', '1', '2'},
- Fvalue: uint8(189),
- },
- 53: {
- Fname: [7]int8{'f', 'r', 'a', 'c', '1', '4'},
- Fvalue: uint8(188),
- },
- 54: {
- Fname: [7]int8{'f', 'r', 'a', 'c', '3', '4'},
- Fvalue: uint8(190),
- },
- 55: {
- Fname: [7]int8{'g', 't'},
- Fvalue: uint8(62),
- },
- 56: {
- Fname: [7]int8{'i', 'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(237),
- },
- 57: {
- Fname: [7]int8{'i', 'c', 'i', 'r', 'c'},
- Fvalue: uint8(238),
- },
- 58: {
- Fname: [7]int8{'i', 'e', 'x', 'c', 'l'},
- Fvalue: uint8(161),
- },
- 59: {
- Fname: [7]int8{'i', 'g', 'r', 'a', 'v', 'e'},
- Fvalue: uint8(236),
- },
- 60: {
- Fname: [7]int8{'i', 'q', 'u', 'e', 's', 't'},
- Fvalue: uint8(191),
- },
- 61: {
- Fname: [7]int8{'i', 'u', 'm', 'l'},
- Fvalue: uint8(239),
- },
- 62: {
- Fname: [7]int8{'l', 'a', 'q', 'u', 'o'},
- Fvalue: uint8(171),
- },
- 63: {
- Fname: [7]int8{'l', 't'},
- Fvalue: uint8(60),
- },
- 64: {
- Fname: [7]int8{'m', 'a', 'c', 'r'},
- Fvalue: uint8(175),
- },
- 65: {
- Fname: [7]int8{'m', 'i', 'c', 'r', 'o'},
- Fvalue: uint8(181),
- },
- 66: {
- Fname: [7]int8{'m', 'i', 'd', 'd', 'o', 't'},
- Fvalue: uint8(183),
- },
- 67: {
- Fname: [7]int8{'n', 'b', 's', 'p'},
- Fvalue: uint8(160),
- },
- 68: {
- Fname: [7]int8{'n', 'o', 't'},
- Fvalue: uint8(172),
- },
- 69: {
- Fname: [7]int8{'n', 't', 'i', 'l', 'd', 'e'},
- Fvalue: uint8(241),
- },
- 70: {
- Fname: [7]int8{'o', 'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(243),
- },
- 71: {
- Fname: [7]int8{'o', 'c', 'i', 'r', 'c'},
- Fvalue: uint8(244),
- },
- 72: {
- Fname: [7]int8{'o', 'g', 'r', 'a', 'v', 'e'},
- Fvalue: uint8(242),
- },
- 73: {
- Fname: [7]int8{'o', 'r', 'd', 'f'},
- Fvalue: uint8(170),
- },
- 74: {
- Fname: [7]int8{'o', 'r', 'd', 'm'},
- Fvalue: uint8(186),
- },
- 75: {
- Fname: [7]int8{'o', 's', 'l', 'a', 's', 'h'},
- Fvalue: uint8(248),
- },
- 76: {
- Fname: [7]int8{'o', 't', 'i', 'l', 'd', 'e'},
- Fvalue: uint8(245),
- },
- 77: {
- Fname: [7]int8{'o', 'u', 'm', 'l'},
- Fvalue: uint8(246),
- },
- 78: {
- Fname: [7]int8{'p', 'a', 'r', 'a'},
- Fvalue: uint8(182),
- },
- 79: {
- Fname: [7]int8{'p', 'l', 'u', 's', 'm', 'n'},
- Fvalue: uint8(177),
- },
- 80: {
- Fname: [7]int8{'p', 'o', 'u', 'n', 'd'},
- Fvalue: uint8(163),
- },
- 81: {
- Fname: [7]int8{'q', 'u', 'o', 't'},
- Fvalue: uint8(34),
- },
- 82: {
- Fname: [7]int8{'r', 'a', 'q', 'u', 'o'},
- Fvalue: uint8(187),
- },
- 83: {
- Fname: [7]int8{'r', 'e', 'g'},
- Fvalue: uint8(174),
- },
- 84: {
- Fname: [7]int8{'s', 'e', 'c', 't'},
- Fvalue: uint8(167),
- },
- 85: {
- Fname: [7]int8{'s', 'h', 'y'},
- Fvalue: uint8(173),
- },
- 86: {
- Fname: [7]int8{'s', 'u', 'p', '1'},
- Fvalue: uint8(185),
- },
- 87: {
- Fname: [7]int8{'s', 'u', 'p', '2'},
- Fvalue: uint8(178),
- },
- 88: {
- Fname: [7]int8{'s', 'u', 'p', '3'},
- Fvalue: uint8(179),
- },
- 89: {
- Fname: [7]int8{'s', 'z', 'l', 'i', 'g'},
- Fvalue: uint8(223),
- },
- 90: {
- Fname: [7]int8{'t', 'h', 'o', 'r', 'n'},
- Fvalue: uint8(254),
- },
- 91: {
- Fname: [7]int8{'t', 'i', 'm', 'e', 's'},
- Fvalue: uint8(215),
- },
- 92: {
- Fname: [7]int8{'u', 'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(250),
- },
- 93: {
- Fname: [7]int8{'u', 'c', 'i', 'r', 'c'},
- Fvalue: uint8(251),
- },
- 94: {
- Fname: [7]int8{'u', 'g', 'r', 'a', 'v', 'e'},
- Fvalue: uint8(249),
- },
- 95: {
- Fname: [7]int8{'u', 'm', 'l'},
- Fvalue: uint8(168),
- },
- 96: {
- Fname: [7]int8{'u', 'u', 'm', 'l'},
- Fvalue: uint8(252),
- },
- 97: {
- Fname: [7]int8{'y', 'a', 'c', 'u', 't', 'e'},
- Fvalue: uint8(253),
- },
- 98: {
- Fname: [7]int8{'y', 'e', 'n'},
- Fvalue: uint8(165),
- },
- 99: {
- Fname: [7]int8{'y', 'u', 'm', 'l'},
- Fvalue: uint8(255),
- },
- }
- // C documentation
- //
- // /*
- // * unvis - decode characters previously encoded by vis
- // */
- func Xunvis(tls *libc.TLS, cp uintptr, c int32, astate uintptr, flag int32) (r int32) {
- var ia, is, lc, st, uc uint8
- var v22, v23, v24, v25, v26 int32
- var p19, p20, p21, p28 uintptr
- _, _, _, _, _, _, _, _, _, _, _, _, _, _ = ia, is, lc, st, uc, v22, v23, v24, v25, v26, p19, p20, p21, p28
- uc = libc.Uint8FromInt32(c)
- /*
- * Bottom 8 bits of astate hold the state machine state.
- * Top 8 bits hold the current character in the http 1866 nv string decoding
- */
- st = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(astate)) & libc.Int32FromInt32(0xff))
- if flag&int32(m__VIS_END) != 0 {
- switch libc.Int32FromUint8(st) {
- case int32(m_S_OCTAL2):
- fallthrough
- case int32(m_S_OCTAL3):
- fallthrough
- case int32(m_S_HEX2):
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- case m_S_GROUND:
- return int32(m_UNVIS_NOCHAR)
- default:
- return -int32(1)
- }
- }
- switch libc.Int32FromUint8(st) {
- case m_S_GROUND:
- goto _1
- case int32(m_S_START):
- goto _2
- case int32(m_S_META):
- goto _3
- case int32(m_S_META1):
- goto _4
- case int32(m_S_CTRL):
- goto _5
- case int32(m_S_OCTAL2):
- goto _6
- case int32(m_S_OCTAL3):
- goto _7
- case int32(m_S_HEX):
- goto _8
- case int32(m_S_HEX1):
- goto _9
- case int32(m_S_HEX2):
- goto _10
- case int32(m_S_MIME1):
- goto _11
- case int32(m_S_MIME2):
- goto _12
- case int32(m_S_EATCRNL):
- goto _13
- case int32(m_S_AMP):
- goto _14
- case int32(m_S_STRING):
- goto _15
- case int32(m_S_NUMBER):
- goto _16
- default:
- goto _17
- }
- goto _18
- _1:
- ;
- *(*int8)(unsafe.Pointer(cp)) = 0
- if flag&int32(m_VIS_NOESCAPE) == 0 && c == int32('\\') {
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_START)))
- return int32(m_UNVIS_NOCHAR)
- }
- if flag&int32(m_VIS_HTTP1808) != 0 && c == int32('%') {
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_HEX1)))
- return int32(m_UNVIS_NOCHAR)
- }
- if flag&int32(m_VIS_HTTP1866) != 0 && c == int32('&') {
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_AMP)))
- return int32(m_UNVIS_NOCHAR)
- }
- if flag&int32(m_VIS_MIMESTYLE) != 0 && c == int32('=') {
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_MIME1)))
- return int32(m_UNVIS_NOCHAR)
- }
- *(*int8)(unsafe.Pointer(cp)) = int8(c)
- return int32(m_UNVIS_VALID)
- _2:
- ;
- switch c {
- case int32('\\'):
- *(*int8)(unsafe.Pointer(cp)) = int8(c)
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- case int32('0'):
- fallthrough
- case int32('1'):
- fallthrough
- case int32('2'):
- fallthrough
- case int32('3'):
- fallthrough
- case int32('4'):
- fallthrough
- case int32('5'):
- fallthrough
- case int32('6'):
- fallthrough
- case int32('7'):
- *(*int8)(unsafe.Pointer(cp)) = int8(c - libc.Int32FromUint8('0'))
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_OCTAL2)))
- return int32(m_UNVIS_NOCHAR)
- case int32('M'):
- *(*int8)(unsafe.Pointer(cp)) = libc.Int8FromInt32(0200)
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_META)))
- return int32(m_UNVIS_NOCHAR)
- case int32('^'):
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_CTRL)))
- return int32(m_UNVIS_NOCHAR)
- case int32('n'):
- *(*int8)(unsafe.Pointer(cp)) = int8('\n')
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- case int32('r'):
- *(*int8)(unsafe.Pointer(cp)) = int8('\r')
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- case int32('b'):
- *(*int8)(unsafe.Pointer(cp)) = int8('\b')
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- case int32('a'):
- *(*int8)(unsafe.Pointer(cp)) = int8('\007')
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- case int32('v'):
- *(*int8)(unsafe.Pointer(cp)) = int8('\v')
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- case int32('t'):
- *(*int8)(unsafe.Pointer(cp)) = int8('\t')
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- case int32('f'):
- *(*int8)(unsafe.Pointer(cp)) = int8('\f')
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- case int32('s'):
- *(*int8)(unsafe.Pointer(cp)) = int8(' ')
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- case int32('E'):
- *(*int8)(unsafe.Pointer(cp)) = int8('\033')
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- case int32('x'):
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_HEX)))
- return int32(m_UNVIS_NOCHAR)
- case int32('\n'):
- /*
- * hidden newline
- */
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_NOCHAR)
- case int32('$'):
- /*
- * hidden marker
- */
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_NOCHAR)
- default:
- if libc.BoolInt32(libc.Uint32FromInt32(c)-uint32(0x21) < uint32(0x5e)) != 0 {
- *(*int8)(unsafe.Pointer(cp)) = int8(c)
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- }
- }
- goto bad
- _3:
- ;
- if c == int32('-') {
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_META1)))
- } else {
- if c == int32('^') {
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_CTRL)))
- } else {
- goto bad
- }
- }
- return int32(m_UNVIS_NOCHAR)
- _4:
- ;
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- p19 = cp
- *(*int8)(unsafe.Pointer(p19)) = int8(int32(*(*int8)(unsafe.Pointer(p19))) | c)
- return int32(m_UNVIS_VALID)
- _5:
- ;
- if c == int32('?') {
- p20 = cp
- *(*int8)(unsafe.Pointer(p20)) = int8(int32(*(*int8)(unsafe.Pointer(p20))) | libc.Int32FromInt32(0177))
- } else {
- p21 = cp
- *(*int8)(unsafe.Pointer(p21)) = int8(int32(*(*int8)(unsafe.Pointer(p21))) | c&libc.Int32FromInt32(037))
- }
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- _6:
- ; /* second possible octal digit */
- if libc.Int32FromUint8(uc) >= int32('0') && libc.Int32FromUint8(uc) <= int32('7') {
- /*
- * yes - and maybe a third
- */
- *(*int8)(unsafe.Pointer(cp)) = int8(int32(*(*int8)(unsafe.Pointer(cp)))<<int32(3) + (c - int32('0')))
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_OCTAL3)))
- return int32(m_UNVIS_NOCHAR)
- }
- /*
- * no - done with current sequence, push back passed char
- */
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALIDPUSH)
- _7:
- ; /* third possible octal digit */
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- if libc.Int32FromUint8(uc) >= int32('0') && libc.Int32FromUint8(uc) <= int32('7') {
- *(*int8)(unsafe.Pointer(cp)) = int8(int32(*(*int8)(unsafe.Pointer(cp)))<<int32(3) + (c - int32('0')))
- return int32(m_UNVIS_VALID)
- }
- /*
- * we were done, push back passed char
- */
- return int32(m_UNVIS_VALIDPUSH)
- _8:
- ;
- if !(libc.Xisxdigit(tls, libc.Int32FromUint8(uc)) != 0) {
- goto bad
- }
- /*FALLTHROUGH*/
- _9:
- ;
- if libc.Xisxdigit(tls, libc.Int32FromUint8(uc)) != 0 {
- if libc.BoolInt32(uint32(uc)-uint32('0') < uint32(10)) != 0 {
- v22 = libc.Int32FromUint8(uc) - int32('0')
- } else {
- v22 = libc.Xtolower(tls, libc.Int32FromUint8(uc)) - int32('a') + int32(10)
- }
- *(*int8)(unsafe.Pointer(cp)) = int8(v22)
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_HEX2)))
- return int32(m_UNVIS_NOCHAR)
- }
- /*
- * no - done with current sequence, push back passed char
- */
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALIDPUSH)
- _10:
- ;
- *(*int32)(unsafe.Pointer(astate)) = m_S_GROUND
- if libc.Xisxdigit(tls, libc.Int32FromUint8(uc)) != 0 {
- if libc.BoolInt32(uint32(uc)-uint32('0') < uint32(10)) != 0 {
- v23 = libc.Int32FromUint8(uc) - int32('0')
- } else {
- v23 = libc.Xtolower(tls, libc.Int32FromUint8(uc)) - int32('a') + int32(10)
- }
- *(*int8)(unsafe.Pointer(cp)) = int8(v23 | int32(*(*int8)(unsafe.Pointer(cp)))<<int32(4))
- return int32(m_UNVIS_VALID)
- }
- return int32(m_UNVIS_VALIDPUSH)
- _11:
- ;
- if libc.Int32FromUint8(uc) == int32('\n') || libc.Int32FromUint8(uc) == int32('\r') {
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_EATCRNL)))
- return int32(m_UNVIS_NOCHAR)
- }
- 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) {
- if libc.BoolInt32(uint32(uc)-uint32('0') < uint32(10)) != 0 {
- v24 = libc.Int32FromUint8(uc) - int32('0')
- } else {
- v24 = libc.Int32FromUint8(uc) - int32('A') + int32(10)
- }
- *(*int8)(unsafe.Pointer(cp)) = int8(v24)
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_MIME2)))
- return int32(m_UNVIS_NOCHAR)
- }
- goto bad
- _12:
- ;
- 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) {
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- if libc.BoolInt32(uint32(uc)-uint32('0') < uint32(10)) != 0 {
- v25 = libc.Int32FromUint8(uc) - int32('0')
- } else {
- v25 = libc.Int32FromUint8(uc) - int32('A') + int32(10)
- }
- *(*int8)(unsafe.Pointer(cp)) = int8(v25 | int32(*(*int8)(unsafe.Pointer(cp)))<<int32(4))
- return int32(m_UNVIS_VALID)
- }
- goto bad
- _13:
- ;
- switch libc.Int32FromUint8(uc) {
- case int32('\r'):
- fallthrough
- case int32('\n'):
- return int32(m_UNVIS_NOCHAR)
- case int32('='):
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_MIME1)))
- return int32(m_UNVIS_NOCHAR)
- default:
- *(*int8)(unsafe.Pointer(cp)) = libc.Int8FromUint8(uc)
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- }
- _14:
- ;
- *(*int8)(unsafe.Pointer(cp)) = 0
- if libc.Int32FromUint8(uc) == int32('#') {
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_NUMBER)))
- return int32(m_UNVIS_NOCHAR)
- }
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_STRING)))
- /*FALLTHROUGH*/
- _15:
- ;
- ia = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(cp))) /* index in the array */
- is = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(astate))) >> libc.Int32FromInt32(24)) /* index in the string */
- if libc.Int32FromUint8(is) == 0 {
- v26 = 0
- } else {
- v26 = int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_nv)) + uintptr(ia)*8 + uintptr(libc.Int32FromUint8(is)-int32(1)))))
- }
- lc = libc.Uint8FromInt32(v26) /* last character */
- if libc.Int32FromUint8(uc) == int32(';') {
- uc = uint8('\000')
- }
- for {
- if !(uint32(ia) < libc.Uint32FromInt64(800)/libc.Uint32FromInt64(8)) {
- break
- }
- 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) {
- goto bad
- }
- if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_nv)) + uintptr(ia)*8 + uintptr(is)))) == libc.Int32FromUint8(uc) {
- break
- }
- goto _27
- _27:
- ;
- ia++
- }
- if uint32(ia) == libc.Uint32FromInt64(800)/libc.Uint32FromInt64(8) {
- goto bad
- }
- if libc.Int32FromUint8(uc) != 0 {
- *(*int8)(unsafe.Pointer(cp)) = libc.Int8FromUint8(ia)
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromUint8(is)+libc.Int32FromInt32(1))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_STRING)))
- return int32(m_UNVIS_NOCHAR)
- }
- *(*int8)(unsafe.Pointer(cp)) = libc.Int8FromUint8(_nv[ia].Fvalue)
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return int32(m_UNVIS_VALID)
- _16:
- ;
- if libc.Int32FromUint8(uc) == int32(';') {
- return int32(m_UNVIS_VALID)
- }
- if !(libc.BoolInt32(uint32(uc)-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0) {
- goto bad
- }
- p28 = cp
- *(*int8)(unsafe.Pointer(p28)) = int8(int32(*(*int8)(unsafe.Pointer(p28))) + (int32(*(*int8)(unsafe.Pointer(cp)))*libc.Int32FromInt32(10) + libc.Int32FromUint8(uc) - libc.Int32FromUint8('0')))
- return int32(m_UNVIS_NOCHAR)
- _17:
- ;
- goto bad
- bad:
- ;
- /*
- * decoder in unknown state - (probably uninitialized)
- */
- *(*int32)(unsafe.Pointer(astate)) = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromInt32(0))<<libc.Int32FromInt32(24) | libc.Uint32FromInt32(libc.Int32FromInt32(m_S_GROUND)))
- return -int32(1)
- _18:
- ;
- return r
- }
- /*
- * strnunvisx - decode src into dst
- *
- * Number of chars decoded into dst is returned, -1 on error.
- * Dst is null terminated.
- */
- func Xstrnunvisx(tls *libc.TLS, dst uintptr, dlen Tsize_t, src uintptr, flag int32) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var c, v1 int8
- var start, v14, v16, v18, v2 uintptr
- var v13, v15, v17, v19 Tsize_t
- var _ /* state at bp+4 */ int32
- var _ /* t at bp+0 */ int8
- _, _, _, _, _, _, _, _, _, _, _ = c, start, v1, v13, v14, v15, v16, v17, v18, v19, v2
- *(*int8)(unsafe.Pointer(bp)) = int8('\000')
- start = dst
- *(*int32)(unsafe.Pointer(bp + 4)) = 0
- for {
- v2 = src
- src++
- v1 = *(*int8)(unsafe.Pointer(v2))
- c = v1
- if !(int32(v1) != int32('\000')) {
- break
- }
- goto again
- again:
- ;
- switch Xunvis(tls, bp, int32(c), bp+4, flag) {
- case int32(m_UNVIS_VALID):
- goto _3
- case int32(m_UNVIS_VALIDPUSH):
- goto _4
- case int32(m_UNVIS_NOCHAR):
- goto _5
- case 0:
- goto _6
- case -int32(1):
- goto _7
- default:
- goto _8
- }
- goto _9
- _3:
- ;
- _12:
- ;
- v13 = dlen
- dlen--
- if v13 == uint32(0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOSPC)
- return -int32(1)
- }
- goto _11
- _11:
- ;
- if 0 != 0 {
- goto _12
- }
- goto _10
- _10:
- ;
- v14 = dst
- dst++
- *(*int8)(unsafe.Pointer(v14)) = *(*int8)(unsafe.Pointer(bp))
- goto _9
- _4:
- ;
- v15 = dlen
- dlen--
- if v15 == uint32(0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOSPC)
- return -int32(1)
- }
- v16 = dst
- dst++
- *(*int8)(unsafe.Pointer(v16)) = *(*int8)(unsafe.Pointer(bp))
- goto again
- _6:
- ;
- _5:
- ;
- goto _9
- _7:
- ;
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return -int32(1)
- _8:
- ;
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EINVAL)
- return -int32(1)
- _9:
- }
- if Xunvis(tls, bp, int32(c), bp+4, int32(m__VIS_END)) == int32(m_UNVIS_VALID) {
- v17 = dlen
- dlen--
- if v17 == uint32(0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOSPC)
- return -int32(1)
- }
- v18 = dst
- dst++
- *(*int8)(unsafe.Pointer(v18)) = *(*int8)(unsafe.Pointer(bp))
- }
- v19 = dlen
- dlen--
- if v19 == uint32(0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOSPC)
- return -int32(1)
- }
- *(*int8)(unsafe.Pointer(dst)) = int8('\000')
- return int32(dst) - int32(start)
- }
- func Xstrunvisx(tls *libc.TLS, dst uintptr, src uintptr, flag int32) (r int32) {
- return Xstrnunvisx(tls, dst, libc.Uint32FromInt32(^libc.Int32FromInt32(0)), src, flag)
- }
- func Xstrunvis(tls *libc.TLS, dst uintptr, src uintptr) (r int32) {
- return Xstrnunvisx(tls, dst, libc.Uint32FromInt32(^libc.Int32FromInt32(0)), src, 0)
- }
- func Xstrnunvis_openbsd(tls *libc.TLS, dst uintptr, src uintptr, dlen Tsize_t) (r Tssize_t) {
- return Xstrnunvisx(tls, dst, dlen, src, 0)
- }
- func Xstrnunvis_netbsd(tls *libc.TLS, dst uintptr, dlen Tsize_t, src uintptr) (r int32) {
- return Xstrnunvisx(tls, dst, dlen, src, 0)
- }
- const m_MAXEXTRAS = 30
- const m_VIS_CSTYLE1 = 2
- const m_VIS_DQ1 = 32768
- const m_VIS_GLOB1 = 4096
- const m_VIS_HTTP18081 = 0x0080
- const m_VIS_HTTP18661 = 0x0200
- const m_VIS_HTTPSTYLE1 = 128
- const m_VIS_NL1 = 16
- const m_VIS_NOESCAPE1 = 0x0400
- const m_VIS_NOLOCALE1 = 16384
- const m_VIS_NOSLASH1 = 64
- const m_VIS_OCTAL1 = 1
- const m_VIS_SAFE1 = 32
- const m_VIS_SHELL1 = 8192
- const m_VIS_SP1 = 4
- const m_VIS_TAB1 = 8
- const m__VIS_END1 = 0x0800
- type Twctrans_t = uintptr
- /* Keep it simple for now, no locale stuff */
- var _char_shell = [19]Twchar_t{'\'', '`', '"', ';', '&', '<', '>', '(', ')', '|', '{', '}', ']', '\\', '$', '!', '^', '~'}
- var _char_glob = [5]Twchar_t{'*', '?', '[', '#'}
- /*
- * On NetBSD and glibc MB_LEN_MAX is currently > 8 which does not fit on any
- * integer integral type and it is probably wrong, since currently the maximum
- * number of bytes and character needs is 6. Until this is fixed, the
- * loops below are using sizeof(uint64_t) - 1 instead of MB_LEN_MAX, and
- * the assertion is commented out.
- */
- // C documentation
- //
- // /*
- // * This is do_hvis, for HTTP style (RFC 1808)
- // */
- func _do_hvis(tls *libc.TLS, dst uintptr, c Twint_t, flags int32, nextc Twint_t, extra uintptr) (r uintptr) {
- var v1, v2, v3 uintptr
- _, _, _ = v1, v2, v3
- 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(',') {
- dst = _do_svis(tls, dst, c, flags, nextc, extra)
- } else {
- v1 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v1)) = int32('%')
- v2 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v2)) = *(*t__predefined_wchar_t)(unsafe.Pointer(__ccgo_ts + 463 + uintptr(c>>int32(4)&uint32(0xf))*4))
- v3 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v3)) = *(*t__predefined_wchar_t)(unsafe.Pointer(__ccgo_ts + 463 + uintptr(c&uint32(0xf))*4))
- }
- return dst
- }
- // C documentation
- //
- // /*
- // * This is do_mvis, for Quoted-Printable MIME (RFC 2045)
- // * NB: No handling of long lines or CRLF.
- // */
- func _do_mvis(tls *libc.TLS, dst uintptr, c Twint_t, flags int32, nextc Twint_t, extra uintptr) (r uintptr) {
- var v1, v2, v3 uintptr
- _, _, _ = v1, v2, v3
- 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)) {
- v1 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v1)) = int32('=')
- v2 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v2)) = *(*t__predefined_wchar_t)(unsafe.Pointer(__ccgo_ts + 583 + uintptr(c>>int32(4)&uint32(0xf))*4))
- v3 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v3)) = *(*t__predefined_wchar_t)(unsafe.Pointer(__ccgo_ts + 583 + uintptr(c&uint32(0xf))*4))
- } else {
- dst = _do_svis(tls, dst, c, flags, nextc, extra)
- }
- return dst
- }
- // C documentation
- //
- // /*
- // * Output single byte of multibyte character.
- // */
- func _do_mbyte(tls *libc.TLS, dst uintptr, c Twint_t, flags int32, nextc Twint_t, iswextra int32) (r uintptr) {
- 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
- var v21 int32
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- if flags&int32(m_VIS_CSTYLE1) != 0 {
- switch c {
- case uint32('\n'):
- v1 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v1)) = int32('\\')
- v2 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v2)) = int32('n')
- return dst
- case uint32('\r'):
- v3 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v3)) = int32('\\')
- v4 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v4)) = int32('r')
- return dst
- case uint32('\b'):
- v5 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v5)) = int32('\\')
- v6 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v6)) = int32('b')
- return dst
- case uint32('\a'):
- v7 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v7)) = int32('\\')
- v8 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v8)) = int32('a')
- return dst
- case uint32('\v'):
- v9 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v9)) = int32('\\')
- v10 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v10)) = int32('v')
- return dst
- case uint32('\t'):
- v11 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v11)) = int32('\\')
- v12 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v12)) = int32('t')
- return dst
- case uint32('\f'):
- v13 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v13)) = int32('\\')
- v14 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v14)) = int32('f')
- return dst
- case uint32(' '):
- v15 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v15)) = int32('\\')
- v16 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v16)) = int32('s')
- return dst
- case uint32('\000'):
- v17 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v17)) = int32('\\')
- v18 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v18)) = int32('0')
- if libc.Int32FromUint8(uint8(nextc)) >= int32('0') && libc.Int32FromUint8(uint8(nextc)) <= int32('7') {
- v19 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v19)) = int32('0')
- v20 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v20)) = int32('0')
- }
- return dst
- /* We cannot encode these characters in VIS_CSTYLE
- * because they special meaning */
- fallthrough
- case uint32('n'):
- fallthrough
- case uint32('r'):
- fallthrough
- case uint32('b'):
- fallthrough
- case uint32('a'):
- fallthrough
- case uint32('v'):
- fallthrough
- case uint32('t'):
- fallthrough
- case uint32('f'):
- fallthrough
- case uint32('s'):
- fallthrough
- case uint32('0'):
- fallthrough
- case uint32('M'):
- fallthrough
- case uint32('^'):
- fallthrough
- case uint32('$'): /* vis(1) -l */
- default:
- if flags&int32(m_VIS_NOLOCALE1) != 0 {
- v21 = libc.BoolInt32(c-uint32(0x21) < uint32(0x5e))
- } else {
- v21 = libc.Xiswgraph(tls, c)
- }
- if v21 != 0 && !(libc.Int32FromUint8(uint8(c)) >= int32('0') && libc.Int32FromUint8(uint8(c)) <= int32('7')) {
- v22 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v22)) = int32('\\')
- v23 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v23)) = libc.Int32FromUint32(c)
- return dst
- }
- }
- }
- if iswextra != 0 || uint32(c&libc.Uint32FromInt32(0177)) == uint32(' ') || flags&int32(m_VIS_OCTAL1) != 0 {
- v24 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v24)) = int32('\\')
- v25 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v25)) = libc.Int32FromUint8(uint8(uint32(uint8(c))>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(03))) + int32('0')
- v26 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v26)) = libc.Int32FromUint8(uint8(uint32(uint8(c))>>libc.Int32FromInt32(3)&libc.Uint32FromInt32(07))) + int32('0')
- v27 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v27)) = libc.Int32FromUint32(uint32(c&libc.Uint32FromInt32(07)) + uint32('0'))
- } else {
- if flags&int32(m_VIS_NOSLASH1) == 0 {
- v28 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v28)) = int32('\\')
- }
- if c&uint32(0200) != 0 {
- c &= uint32(0177)
- v29 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v29)) = int32('M')
- }
- if libc.Xiswcntrl(tls, c) != 0 {
- v30 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v30)) = int32('^')
- if c == uint32(0177) {
- v31 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v31)) = int32('?')
- } else {
- v32 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v32)) = libc.Int32FromUint32(c + uint32('@'))
- }
- } else {
- v33 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v33)) = int32('-')
- v34 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v34)) = libc.Int32FromUint32(c)
- }
- }
- return dst
- }
- // C documentation
- //
- // /*
- // * This is do_vis, the central code of vis.
- // * dst: Pointer to the destination buffer
- // * c: Character to encode
- // * flags: Flags word
- // * nextc: The character following 'c'
- // * extra: Pointer to the list of extra characters to be
- // * backslash-protected.
- // */
- func _do_svis(tls *libc.TLS, dst uintptr, c Twint_t, flags int32, nextc Twint_t, extra uintptr) (r uintptr) {
- var bmsk, wmsk Tuint64_t
- var i, iswextra, shft, v1 int32
- var v2 bool
- var v3 uintptr
- _, _, _, _, _, _, _, _ = bmsk, i, iswextra, shft, wmsk, v1, v2, v3
- iswextra = libc.BoolInt32(libc.Xwcschr(tls, extra, libc.Int32FromUint32(c)) != libc.UintptrFromInt32(0))
- if v2 = !(iswextra != 0); v2 {
- if flags&int32(m_VIS_NOLOCALE1) != 0 {
- v1 = libc.BoolInt32(c-uint32(0x21) < uint32(0x5e))
- } else {
- v1 = libc.Xiswgraph(tls, c)
- }
- }
- 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'))) {
- v3 = dst
- dst += 4
- *(*Twchar_t)(unsafe.Pointer(v3)) = libc.Int32FromUint32(c)
- return dst
- }
- /* See comment in istrsenvisx() output loop, below. */
- wmsk = uint64(0)
- i = libc.Int32FromUint32(libc.Uint32FromInt64(8) - libc.Uint32FromInt32(1))
- for {
- if !(i >= 0) {
- break
- }
- shft = i * int32(m_CHAR_BIT)
- bmsk = libc.Uint64FromInt64(0xff) << shft
- wmsk |= bmsk
- if uint64(c)&wmsk != 0 || i == 0 {
- dst = _do_mbyte(tls, dst, uint32(uint64(c)&bmsk>>shft), flags, nextc, iswextra)
- }
- goto _4
- _4:
- ;
- i--
- }
- return dst
- }
- type Tvisfun_t = uintptr
- // C documentation
- //
- // /*
- // * Return the appropriate encoding function depending on the flags given.
- // */
- func _getvisfun(tls *libc.TLS, flags int32) (r Tvisfun_t) {
- if flags&int32(m_VIS_HTTPSTYLE1) != 0 {
- return __ccgo_fp(_do_hvis)
- }
- if flags&int32(m_VIS_MIMESTYLE) != 0 {
- return __ccgo_fp(_do_mvis)
- }
- return __ccgo_fp(_do_svis)
- }
- // C documentation
- //
- // /*
- // * Expand list of extra characters to not visually encode.
- // */
- func _makeextralist(tls *libc.TLS, flags int32, src uintptr) (r uintptr) {
- var d, dst, s, v1, v10, v11, v12, v13, v4, v5, v7, v8, v9 uintptr
- var i, len1 Tsize_t
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = d, dst, i, len1, s, v1, v10, v11, v12, v13, v4, v5, v7, v8, v9
- len1 = libc.Xstrlen(tls, src)
- v1 = libc.Xcalloc(tls, len1+uint32(m_MAXEXTRAS), uint32(4))
- dst = v1
- if v1 == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- if flags&int32(m_VIS_NOLOCALE1) != 0 || libc.Xmbstowcs(tls, dst, src, len1) == libc.Uint32FromInt32(-libc.Int32FromInt32(1)) {
- i = uint32(0)
- for {
- if !(i < len1) {
- break
- }
- *(*Twchar_t)(unsafe.Pointer(dst + uintptr(i)*4)) = libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(src + uintptr(i)))))
- goto _2
- _2:
- ;
- i++
- }
- d = dst + uintptr(len1)*4
- } else {
- d = dst + uintptr(libc.Xwcslen(tls, dst))*4
- }
- if flags&int32(m_VIS_GLOB1) != 0 {
- s = uintptr(unsafe.Pointer(&_char_glob))
- for {
- if !(*(*Twchar_t)(unsafe.Pointer(s)) != 0) {
- break
- }
- goto _3
- goto _3
- _3:
- ;
- v4 = d
- d += 4
- v5 = s
- s += 4
- *(*Twchar_t)(unsafe.Pointer(v4)) = *(*Twchar_t)(unsafe.Pointer(v5))
- }
- }
- if flags&int32(m_VIS_SHELL1) != 0 {
- s = uintptr(unsafe.Pointer(&_char_shell))
- for {
- if !(*(*Twchar_t)(unsafe.Pointer(s)) != 0) {
- break
- }
- goto _6
- goto _6
- _6:
- ;
- v7 = d
- d += 4
- v8 = s
- s += 4
- *(*Twchar_t)(unsafe.Pointer(v7)) = *(*Twchar_t)(unsafe.Pointer(v8))
- }
- }
- if flags&int32(m_VIS_SP1) != 0 {
- v9 = d
- d += 4
- *(*Twchar_t)(unsafe.Pointer(v9)) = int32(' ')
- }
- if flags&int32(m_VIS_TAB1) != 0 {
- v10 = d
- d += 4
- *(*Twchar_t)(unsafe.Pointer(v10)) = int32('\t')
- }
- if flags&int32(m_VIS_NL1) != 0 {
- v11 = d
- d += 4
- *(*Twchar_t)(unsafe.Pointer(v11)) = int32('\n')
- }
- if flags&int32(m_VIS_DQ1) != 0 {
- v12 = d
- d += 4
- *(*Twchar_t)(unsafe.Pointer(v12)) = int32('"')
- }
- if flags&int32(m_VIS_NOSLASH1) == 0 {
- v13 = d
- d += 4
- *(*Twchar_t)(unsafe.Pointer(v13)) = int32('\\')
- }
- *(*Twchar_t)(unsafe.Pointer(d)) = int32('\000')
- return dst
- }
- // C documentation
- //
- // /*
- // * istrsenvisx()
- // * The main internal function.
- // * All user-visible functions call this one.
- // */
- func _istrsenvisx(tls *libc.TLS, mbdstp uintptr, dlen uintptr, mbsrc uintptr, mblength Tsize_t, flags int32, mbextra uintptr, cerr_ptr uintptr) (r int32) {
- var bmsk, wmsk Tuint64_t
- var c Twint_t
- var cerr, clen, error1, i, shft, v12, v6 int32
- var dst, extra, mbdst, mdst, pdst, psrc, src, start, v1, v2, v3, v4, v5, v8 uintptr
- var f Tvisfun_t
- var len1, olen Tsize_t
- var maxolen, mbslength Tssize_t
- var v9 uint32
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- clen = 0
- error1 = -int32(1)
- mbslength = libc.Int32FromUint32(mblength)
- /*
- * When inputing a single character, must also read in the
- * next character for nextc, the look-ahead character.
- */
- if mbslength == int32(1) {
- mbslength++
- }
- /*
- * Input (mbsrc) is a char string considered to be multibyte
- * characters. The input loop will read this string pulling
- * one character, possibly multiple bytes, from mbsrc and
- * converting each to wchar_t in src.
- *
- * The vis conversion will be done using the wide char
- * wchar_t string.
- *
- * This will then be converted back to a multibyte string to
- * return to the caller.
- */
- /* Allocate space for the wide char strings */
- v2 = libc.UintptrFromInt32(0)
- extra = v2
- v1 = v2
- pdst = v1
- psrc = v1
- mdst = libc.UintptrFromInt32(0)
- v3 = libc.Xcalloc(tls, libc.Uint32FromInt32(mbslength+int32(1)), uint32(4))
- psrc = v3
- if v3 == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- v4 = libc.Xcalloc(tls, libc.Uint32FromInt32(int32(16)*mbslength+int32(1)), uint32(4))
- pdst = v4
- if v4 == libc.UintptrFromInt32(0) {
- goto out
- }
- if *(*uintptr)(unsafe.Pointer(mbdstp)) == libc.UintptrFromInt32(0) {
- v5 = libc.Xcalloc(tls, libc.Uint32FromInt32(int32(16)*mbslength+int32(1)), uint32(1))
- mdst = v5
- if v5 == libc.UintptrFromInt32(0) {
- goto out
- }
- *(*uintptr)(unsafe.Pointer(mbdstp)) = mdst
- }
- mbdst = *(*uintptr)(unsafe.Pointer(mbdstp))
- dst = pdst
- src = psrc
- if flags&int32(m_VIS_NOLOCALE1) != 0 {
- /* Do one byte at a time conversion */
- cerr = int32(1)
- } else {
- /* Use caller's multibyte conversion error flag. */
- if cerr_ptr != 0 {
- v6 = *(*int32)(unsafe.Pointer(cerr_ptr))
- } else {
- v6 = 0
- }
- cerr = v6
- }
- /*
- * Input loop.
- * Handle up to mblength characters (not bytes). We do not
- * stop at NULs because we may be processing a block of data
- * that includes NULs.
- */
- for mbslength > 0 {
- /* Convert one multibyte character to wchar_t. */
- if !(cerr != 0) {
- clen = libc.Xmbtowc(tls, src, mbsrc, uint32(m_MB_LEN_MAX))
- }
- if cerr != 0 || clen < 0 {
- /* Conversion error, process as a byte instead. */
- *(*Twchar_t)(unsafe.Pointer(src)) = libc.Int32FromUint32(uint32(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(mbsrc)))))
- clen = int32(1)
- cerr = int32(1)
- }
- if clen == 0 {
- /*
- * NUL in input gives 0 return value. process
- * as single NUL byte and keep going.
- */
- clen = int32(1)
- }
- /* Advance buffer character pointer. */
- src += 4
- /* Advance input pointer by number of bytes read. */
- mbsrc += uintptr(clen)
- /* Decrement input byte count. */
- mbslength -= clen
- }
- len1 = libc.Uint32FromInt32((int32(src) - int32(psrc)) / 4)
- src = psrc
- /*
- * In the single character input case, we will have actually
- * processed two characters, c and nextc. Reset len back to
- * just a single character.
- */
- if mblength < len1 {
- len1 = mblength
- }
- /* Convert extra argument to list of characters for this mode. */
- extra = _makeextralist(tls, flags, mbextra)
- if !(extra != 0) {
- if dlen != 0 && *(*Tsize_t)(unsafe.Pointer(dlen)) == uint32(0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOSPC)
- goto out
- }
- *(*int8)(unsafe.Pointer(mbdst)) = int8('\000') /* can't create extra, return "" */
- error1 = 0
- goto out
- }
- /* Look up which processing function to call. */
- f = _getvisfun(tls, flags)
- /*
- * Main processing loop.
- * Call do_Xvis processing function one character at a time
- * with next character available for look-ahead.
- */
- start = dst
- for {
- if !(len1 > uint32(0)) {
- break
- }
- v8 = src
- src += 4
- c = libc.Uint32FromInt32(*(*Twchar_t)(unsafe.Pointer(v8)))
- 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)
- if dst == libc.UintptrFromInt32(0) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_ENOSPC)
- goto out
- }
- goto _7
- _7:
- ;
- len1--
- }
- /* Terminate the string in the buffer. */
- *(*Twchar_t)(unsafe.Pointer(dst)) = int32('\000')
- /*
- * Output loop.
- * Convert wchar_t string back to multibyte output string.
- * If we have hit a multi-byte conversion error on input,
- * output byte-by-byte here. Else use wctomb().
- */
- len1 = libc.Xwcslen(tls, start)
- if dlen != 0 {
- v9 = *(*Tsize_t)(unsafe.Pointer(dlen))
- } else {
- v9 = libc.Xwcslen(tls, start)*uint32(m_MB_LEN_MAX) + uint32(1)
- }
- maxolen = libc.Int32FromUint32(v9)
- olen = uint32(0)
- dst = start
- for {
- if !(len1 > uint32(0)) {
- break
- }
- if !(cerr != 0) {
- clen = libc.Xwctomb(tls, mbdst, *(*Twchar_t)(unsafe.Pointer(dst)))
- }
- if cerr != 0 || clen < 0 {
- /*
- * Conversion error, process as a byte(s) instead.
- * Examine each byte and higher-order bytes for
- * data. E.g.,
- * 0x000000000000a264 -> a2 64
- * 0x000000001f00a264 -> 1f 00 a2 64
- */
- clen = 0
- wmsk = uint64(0)
- i = libc.Int32FromUint32(libc.Uint32FromInt64(8) - libc.Uint32FromInt32(1))
- for {
- if !(i >= 0) {
- break
- }
- shft = i * int32(m_CHAR_BIT)
- bmsk = libc.Uint64FromInt64(0xff) << shft
- wmsk |= bmsk
- if libc.Uint64FromInt32(*(*Twchar_t)(unsafe.Pointer(dst)))&wmsk != 0 || i == 0 {
- v12 = clen
- clen++
- *(*int8)(unsafe.Pointer(mbdst + uintptr(v12))) = libc.Int8FromUint64(libc.Uint64FromInt32(*(*Twchar_t)(unsafe.Pointer(dst))) & bmsk >> shft)
- }
- goto _11
- _11:
- ;
- i--
- }
- cerr = int32(1)
- }
- /* If this character would exceed our output limit, stop. */
- if olen+libc.Uint32FromInt32(clen) > libc.Uint32FromInt32(maxolen) {
- break
- }
- /* Advance output pointer by number of bytes written. */
- mbdst += uintptr(clen)
- /* Advance buffer character pointer. */
- dst += 4
- /* Incrment output character count. */
- olen += libc.Uint32FromInt32(clen)
- goto _10
- _10:
- ;
- len1--
- }
- /* Terminate the output string. */
- *(*int8)(unsafe.Pointer(mbdst)) = int8('\000')
- if flags&int32(m_VIS_NOLOCALE1) != 0 {
- /* Pass conversion error flag out. */
- if cerr_ptr != 0 {
- *(*int32)(unsafe.Pointer(cerr_ptr)) = cerr
- }
- }
- libc.Xfree(tls, extra)
- libc.Xfree(tls, pdst)
- libc.Xfree(tls, psrc)
- return libc.Int32FromUint32(olen)
- goto out
- out:
- ;
- libc.Xfree(tls, extra)
- libc.Xfree(tls, pdst)
- libc.Xfree(tls, psrc)
- libc.Xfree(tls, mdst)
- return error1
- }
- func _istrsenvisxna(tls *libc.TLS, _mbdst uintptr, dlen uintptr, mbsrc uintptr, mblength Tsize_t, flags int32, mbextra uintptr, cerr_ptr uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _mbdst
- return _istrsenvisx(tls, bp, dlen, mbsrc, mblength, flags, mbextra, cerr_ptr)
- }
- func _istrsenvisxl(tls *libc.TLS, mbdst uintptr, dlen uintptr, mbsrc uintptr, flags int32, mbextra uintptr, cerr_ptr uintptr) (r int32) {
- var v1 uint32
- _ = v1
- if mbsrc != libc.UintptrFromInt32(0) {
- v1 = libc.Xstrlen(tls, mbsrc)
- } else {
- v1 = uint32(0)
- }
- return _istrsenvisxna(tls, mbdst, dlen, mbsrc, v1, flags, mbextra, cerr_ptr)
- }
- /*
- * The "svis" variants all take an "extra" arg that is a pointer
- * to a NUL-terminated list of characters to be encoded, too.
- * These functions are useful e. g. to encode strings in such a
- * way so that they are not interpreted by a shell.
- */
- func Xsvis(tls *libc.TLS, _mbdst uintptr, c int32, flags int32, nextc int32, mbextra uintptr) (r uintptr) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _mbdst
- var ret int32
- var _ /* cc at bp+4 */ [2]int8
- _ = ret
- (*(*[2]int8)(unsafe.Pointer(bp + 4)))[0] = int8(c)
- (*(*[2]int8)(unsafe.Pointer(bp + 4)))[int32(1)] = int8(nextc)
- ret = _istrsenvisx(tls, bp, libc.UintptrFromInt32(0), bp+4, uint32(1), flags, mbextra, libc.UintptrFromInt32(0))
- if ret < 0 {
- return libc.UintptrFromInt32(0)
- }
- return *(*uintptr)(unsafe.Pointer(bp)) + uintptr(ret)
- }
- func Xsnvis(tls *libc.TLS, _mbdst uintptr, _dlen Tsize_t, c int32, flags int32, nextc int32, mbextra uintptr) (r uintptr) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _mbdst
- *(*Tsize_t)(unsafe.Pointer(bp + 4)) = _dlen
- var ret int32
- var _ /* cc at bp+8 */ [2]int8
- _ = ret
- (*(*[2]int8)(unsafe.Pointer(bp + 8)))[0] = int8(c)
- (*(*[2]int8)(unsafe.Pointer(bp + 8)))[int32(1)] = int8(nextc)
- ret = _istrsenvisx(tls, bp, bp+4, bp+8, uint32(1), flags, mbextra, libc.UintptrFromInt32(0))
- if ret < 0 {
- return libc.UintptrFromInt32(0)
- }
- return *(*uintptr)(unsafe.Pointer(bp)) + uintptr(ret)
- }
- func Xstrsvis(tls *libc.TLS, mbdst uintptr, mbsrc uintptr, flags int32, mbextra uintptr) (r int32) {
- return _istrsenvisxl(tls, mbdst, libc.UintptrFromInt32(0), mbsrc, flags, mbextra, libc.UintptrFromInt32(0))
- }
- func Xstrsnvis(tls *libc.TLS, mbdst uintptr, _dlen Tsize_t, mbsrc uintptr, flags int32, mbextra uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
- return _istrsenvisxl(tls, mbdst, bp, mbsrc, flags, mbextra, libc.UintptrFromInt32(0))
- }
- func Xstrsvisx(tls *libc.TLS, mbdst uintptr, mbsrc uintptr, len1 Tsize_t, flags int32, mbextra uintptr) (r int32) {
- return _istrsenvisxna(tls, mbdst, libc.UintptrFromInt32(0), mbsrc, len1, flags, mbextra, libc.UintptrFromInt32(0))
- }
- func Xstrsnvisx(tls *libc.TLS, mbdst uintptr, _dlen Tsize_t, mbsrc uintptr, len1 Tsize_t, flags int32, mbextra uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
- return _istrsenvisxna(tls, mbdst, bp, mbsrc, len1, flags, mbextra, libc.UintptrFromInt32(0))
- }
- func Xstrsenvisx(tls *libc.TLS, mbdst uintptr, _dlen Tsize_t, mbsrc uintptr, len1 Tsize_t, flags int32, mbextra uintptr, cerr_ptr uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
- return _istrsenvisxna(tls, mbdst, bp, mbsrc, len1, flags, mbextra, cerr_ptr)
- }
- // C documentation
- //
- // /*
- // * vis - visually encode characters
- // */
- func Xvis(tls *libc.TLS, _mbdst uintptr, c int32, flags int32, nextc int32) (r uintptr) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _mbdst
- var ret int32
- var _ /* cc at bp+4 */ [2]int8
- _ = ret
- (*(*[2]int8)(unsafe.Pointer(bp + 4)))[0] = int8(c)
- (*(*[2]int8)(unsafe.Pointer(bp + 4)))[int32(1)] = int8(nextc)
- ret = _istrsenvisx(tls, bp, libc.UintptrFromInt32(0), bp+4, uint32(1), flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
- if ret < 0 {
- return libc.UintptrFromInt32(0)
- }
- return *(*uintptr)(unsafe.Pointer(bp)) + uintptr(ret)
- }
- func Xnvis(tls *libc.TLS, _mbdst uintptr, _dlen Tsize_t, c int32, flags int32, nextc int32) (r uintptr) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _mbdst
- *(*Tsize_t)(unsafe.Pointer(bp + 4)) = _dlen
- var ret int32
- var _ /* cc at bp+8 */ [2]int8
- _ = ret
- (*(*[2]int8)(unsafe.Pointer(bp + 8)))[0] = int8(c)
- (*(*[2]int8)(unsafe.Pointer(bp + 8)))[int32(1)] = int8(nextc)
- ret = _istrsenvisx(tls, bp, bp+4, bp+8, uint32(1), flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
- if ret < 0 {
- return libc.UintptrFromInt32(0)
- }
- return *(*uintptr)(unsafe.Pointer(bp)) + uintptr(ret)
- }
- /*
- * strvis - visually encode characters from src into dst
- *
- * Dst must be 4 times the size of src to account for possible
- * expansion. The length of dst, not including the trailing NULL,
- * is returned.
- */
- func Xstrvis(tls *libc.TLS, mbdst uintptr, mbsrc uintptr, flags int32) (r int32) {
- return _istrsenvisxl(tls, mbdst, libc.UintptrFromInt32(0), mbsrc, flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
- }
- func Xstrnvis_openbsd(tls *libc.TLS, mbdst uintptr, mbsrc uintptr, _dlen Tsize_t, flags int32) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
- return _istrsenvisxl(tls, mbdst, bp, mbsrc, flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
- }
- func Xstrnvis_netbsd(tls *libc.TLS, mbdst uintptr, _dlen Tsize_t, mbsrc uintptr, flags int32) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
- return _istrsenvisxl(tls, mbdst, bp, mbsrc, flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
- }
- func Xstravis(tls *libc.TLS, mbdstp uintptr, mbsrc uintptr, flags int32) (r int32) {
- var v1 uint32
- _ = v1
- *(*uintptr)(unsafe.Pointer(mbdstp)) = libc.UintptrFromInt32(0)
- if mbsrc != libc.UintptrFromInt32(0) {
- v1 = libc.Xstrlen(tls, mbsrc)
- } else {
- v1 = uint32(0)
- }
- return _istrsenvisx(tls, mbdstp, libc.UintptrFromInt32(0), mbsrc, v1, flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
- }
- /*
- * strvisx - visually encode characters from src into dst
- *
- * Dst must be 4 times the size of src to account for possible
- * expansion. The length of dst, not including the trailing NULL,
- * is returned.
- *
- * Strvisx encodes exactly len characters from src into dst.
- * This is useful for encoding a block of data.
- */
- func Xstrvisx(tls *libc.TLS, mbdst uintptr, mbsrc uintptr, len1 Tsize_t, flags int32) (r int32) {
- return _istrsenvisxna(tls, mbdst, libc.UintptrFromInt32(0), mbsrc, len1, flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
- }
- func Xstrnvisx(tls *libc.TLS, mbdst uintptr, _dlen Tsize_t, mbsrc uintptr, len1 Tsize_t, flags int32) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
- return _istrsenvisxna(tls, mbdst, bp, mbsrc, len1, flags, __ccgo_ts+53, libc.UintptrFromInt32(0))
- }
- func Xstrenvisx(tls *libc.TLS, mbdst uintptr, _dlen Tsize_t, mbsrc uintptr, len1 Tsize_t, flags int32, cerr_ptr uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*Tsize_t)(unsafe.Pointer(bp)) = _dlen
- return _istrsenvisxna(tls, mbdst, bp, mbsrc, len1, flags, __ccgo_ts+53, cerr_ptr)
- }
- // C documentation
- //
- // /*
- // * Appends src to string dst of size siz (unlike wcsncat, siz is the
- // * full size of dst, not space left). At most siz-1 characters
- // * will be copied. Always NUL terminates (unless siz == 0).
- // * Returns wcslen(initial dst) + wcslen(src); if retval >= siz,
- // * truncation occurred.
- // */
- func Xwcslcat(tls *libc.TLS, dst uintptr, src uintptr, siz Tsize_t) (r Tsize_t) {
- var d, s, v3 uintptr
- var dlen, n, v1 Tsize_t
- var v2 bool
- _, _, _, _, _, _, _ = d, dlen, n, s, v1, v2, v3
- d = dst
- s = src
- n = siz
- /* Find the end of dst and adjust bytes left but don't go past end */
- for {
- if v2 = *(*Twchar_t)(unsafe.Pointer(d)) != int32('\000'); v2 {
- v1 = n
- n--
- }
- if !(v2 && v1 != uint32(0)) {
- break
- }
- d += 4
- }
- dlen = libc.Uint32FromInt32((int32(d) - int32(dst)) / 4)
- n = siz - dlen
- if n == uint32(0) {
- return dlen + libc.Xwcslen(tls, s)
- }
- for *(*Twchar_t)(unsafe.Pointer(s)) != int32('\000') {
- if n != uint32(1) {
- v3 = d
- d += 4
- *(*Twchar_t)(unsafe.Pointer(v3)) = *(*Twchar_t)(unsafe.Pointer(s))
- n--
- }
- s += 4
- }
- *(*Twchar_t)(unsafe.Pointer(d)) = int32('\000')
- return dlen + libc.Uint32FromInt32((int32(s)-int32(src))/4) /* count does not include NUL */
- }
- // C documentation
- //
- // /*
- // * Copy src to string dst of size siz. At most siz-1 characters
- // * will be copied. Always NUL terminates (unless siz == 0).
- // * Returns wcslen(src); if retval >= siz, truncation occurred.
- // */
- func Xwcslcpy(tls *libc.TLS, dst uintptr, src uintptr, siz Tsize_t) (r Tsize_t) {
- var d, s, v6, v7, v8 uintptr
- var n, v1, v3 Tsize_t
- var v2 bool
- var v5 Twchar_t
- _, _, _, _, _, _, _, _, _, _ = d, n, s, v1, v2, v3, v5, v6, v7, v8
- d = dst
- s = src
- n = siz
- /* Copy as many bytes as will fit */
- if v2 = n != uint32(0); v2 {
- n--
- v1 = n
- }
- if v2 && v1 != uint32(0) {
- for {
- v6 = s
- s += 4
- v5 = *(*Twchar_t)(unsafe.Pointer(v6))
- v7 = d
- d += 4
- *(*Twchar_t)(unsafe.Pointer(v7)) = v5
- if v5 == 0 {
- break
- }
- goto _4
- _4:
- ;
- n--
- v3 = n
- if !(v3 != uint32(0)) {
- break
- }
- }
- }
- /* Not enough room in dst, add NUL and traverse rest of src */
- if n == uint32(0) {
- if siz != uint32(0) {
- *(*Twchar_t)(unsafe.Pointer(d)) = int32('\000')
- } /* NUL-terminate dst */
- for {
- v8 = s
- s += 4
- if !(*(*Twchar_t)(unsafe.Pointer(v8)) != 0) {
- break
- }
- }
- }
- return libc.Uint32FromInt32((int32(s)-int32(src))/4 - libc.Int32FromInt32(1)) /* count does not include NUL */
- }
- const m_CTL_MAXNAME = 10
- const m_ECHO1 = 0000010
- const m_ECHONL1 = 0000100
- const m_ELFMAG01 = 0x7f
- const m_ELFMAG11 = 'E'
- const m_ELFMAG21 = 'L'
- const m_ELFMAG31 = 'F'
- const m_FIOASYNC = 0x5452
- const m_FIOCLEX = 0x5451
- const m_FIOGETOWN = 0x8903
- const m_FIONBIO = 0x5421
- const m_FIONCLEX = 0x5450
- const m_FIONREAD = 0x541B
- const m_FIOQSIZE = 0x5460
- const m_FIOSETOWN = 0x8901
- const m_GRND_INSECURE = 0x0004
- const m_GRND_NONBLOCK = 1
- const m_GRND_RANDOM = 0x0002
- const m_IOCSIZE_SHIFT = "_IOC_SIZESHIFT"
- const m_MAP_ANON2 = 32
- const m_MAP_PRIVATE2 = 2
- const m_MNT_DETACH = 2
- const m_MNT_EXPIRE = 4
- const m_MNT_FORCE = 1
- const m_MS_BIND = 4096
- const m_MS_DIRSYNC = 128
- const m_MS_MANDLOCK = 64
- const m_MS_MGC_MSK = 0xffff0000
- const m_MS_MGC_VAL = 0xc0ed0000
- const m_MS_MOVE = 8192
- const m_MS_NOATIME = 1024
- const m_MS_NODEV = 4
- const m_MS_NODIRATIME = 2048
- const m_MS_NOEXEC = 8
- const m_MS_NOSUID = 2
- const m_MS_NOSYMFOLLOW = 256
- const m_MS_RDONLY = 1
- const m_MS_REC = 16384
- const m_MS_REMOUNT = 32
- const m_MS_SILENT = 32768
- const m_MS_SYNCHRONOUS = 16
- const m_N_6PACK = 7
- const m_N_AX25 = 5
- const m_N_CAIF = 20
- const m_N_GIGASET_M101 = 16
- const m_N_GSM0710 = 21
- const m_N_HCI = 15
- const m_N_HDLC = 13
- const m_N_IRDA = 11
- const m_N_MASC = 8
- const m_N_MOUSE = 2
- const m_N_NCI = 25
- const m_N_NULL = 27
- const m_N_PPP = 3
- const m_N_PPS = 18
- const m_N_PROFIBUS_FDL = 10
- const m_N_R3964 = 9
- const m_N_SLCAN = 17
- const m_N_SLIP = 1
- const m_N_SMSBLOCK = 12
- const m_N_SPEAKUP = 26
- const m_N_STRIP = 4
- const m_N_SYNC_PPP = 14
- const m_N_TI_WL = 22
- const m_N_TRACEROUTER = 24
- const m_N_TRACESINK = 23
- const m_N_TTY = 0
- const m_N_V253 = 19
- const m_N_X25 = 6
- const m_O_CLOEXEC1 = 524288
- const m_O_NOFOLLOW1 = 131072
- const m_O_RDONLY3 = 0
- const m_O_RDWR2 = 02
- const m_REPEAT = 5
- const m_SHA256_BLOCK_LENGTH = 64
- const m_SHA256_DIGEST_LENGTH = 32
- const m_SHA384_BLOCK_LENGTH = 128
- const m_SHA384_DIGEST_LENGTH = 48
- const m_SHA384_Data = "SHA384Data"
- const m_SHA384_End = "SHA384End"
- const m_SHA384_File = "SHA384File"
- const m_SHA384_FileChunk = "SHA384FileChunk"
- const m_SHA384_Final = "SHA384Final"
- const m_SHA384_Init = "SHA384Init"
- const m_SHA384_Update = "SHA384Update"
- const m_SHA512_BLOCK_LENGTH = 128
- const m_SHA512_DIGEST_LENGTH = 64
- const m_SHA512_Data = "SHA512Data"
- const m_SHA512_End = "SHA512End"
- const m_SHA512_File = "SHA512File"
- const m_SHA512_FileChunk = "SHA512FileChunk"
- const m_SHA512_Final = "SHA512Final"
- const m_SHA512_Init = "SHA512Init"
- const m_SHA512_Update = "SHA512Update"
- const m_SHN_ABS1 = 0xfff1
- const m_SHN_COMMON1 = 0xfff2
- const m_SIOCADDDLCI = 0x8980
- const m_SIOCADDMULTI = 0x8931
- const m_SIOCADDRT = 0x890B
- const m_SIOCATMARK = 0x8905
- const m_SIOCDARP = 0x8953
- const m_SIOCDELDLCI = 0x8981
- const m_SIOCDELMULTI = 0x8932
- const m_SIOCDELRT = 0x890C
- const m_SIOCDEVPRIVATE = 0x89F0
- const m_SIOCDIFADDR = 0x8936
- const m_SIOCDRARP = 0x8960
- const m_SIOCGARP = 0x8954
- const m_SIOCGIFADDR = 0x8915
- const m_SIOCGIFBR = 0x8940
- const m_SIOCGIFBRDADDR = 0x8919
- const m_SIOCGIFCONF = 0x8912
- const m_SIOCGIFCOUNT = 0x8938
- const m_SIOCGIFDSTADDR = 0x8917
- const m_SIOCGIFENCAP = 0x8925
- const m_SIOCGIFFLAGS = 0x8913
- const m_SIOCGIFHWADDR = 0x8927
- const m_SIOCGIFINDEX = 0x8933
- const m_SIOCGIFMAP = 0x8970
- const m_SIOCGIFMEM = 0x891f
- const m_SIOCGIFMETRIC = 0x891d
- const m_SIOCGIFMTU = 0x8921
- const m_SIOCGIFNAME = 0x8910
- const m_SIOCGIFNETMASK = 0x891b
- const m_SIOCGIFPFLAGS = 0x8935
- const m_SIOCGIFSLAVE = 0x8929
- const m_SIOCGIFTXQLEN = 0x8942
- const m_SIOCGPGRP = 0x8904
- const m_SIOCGRARP = 0x8961
- const m_SIOCPROTOPRIVATE = 0x89E0
- const m_SIOCRTMSG = 0x890D
- const m_SIOCSARP = 0x8955
- const m_SIOCSIFADDR = 0x8916
- const m_SIOCSIFBR = 0x8941
- const m_SIOCSIFBRDADDR = 0x891a
- const m_SIOCSIFDSTADDR = 0x8918
- const m_SIOCSIFENCAP = 0x8926
- const m_SIOCSIFFLAGS = 0x8914
- const m_SIOCSIFHWADDR = 0x8924
- const m_SIOCSIFHWBROADCAST = 0x8937
- const m_SIOCSIFLINK = 0x8911
- const m_SIOCSIFMAP = 0x8971
- const m_SIOCSIFMEM = 0x8920
- const m_SIOCSIFMETRIC = 0x891e
- const m_SIOCSIFMTU = 0x8922
- const m_SIOCSIFNAME = 0x8923
- const m_SIOCSIFNETMASK = 0x891c
- const m_SIOCSIFPFLAGS = 0x8934
- const m_SIOCSIFSLAVE = 0x8930
- const m_SIOCSIFTXQLEN = 0x8943
- const m_SIOCSPGRP = 0x8902
- const m_SIOCSRARP = 0x8962
- const m_SIOGIFINDEX = "SIOCGIFINDEX"
- const m_ST_APPEND = 256
- const m_ST_IMMUTABLE = 512
- const m_ST_MANDLOCK = 64
- const m_ST_NOATIME = 1024
- const m_ST_NODEV = 4
- const m_ST_NODIRATIME = 2048
- const m_ST_NOEXEC = 8
- const m_ST_NOSUID = 2
- const m_ST_RDONLY = 1
- const m_ST_RELATIME = 4096
- const m_ST_SYNCHRONOUS = 16
- const m_ST_WRITE = 128
- const m_S_IFCHR3 = 8192
- const m_S_IFIFO3 = 4096
- const m_S_IFMT3 = 61440
- const m_S_IFREG3 = 32768
- const m_S_IFSOCK3 = 49152
- const m_TCFLSH = 0x540B
- const m_TCGETA = 0x5405
- const m_TCGETS = 0x5401
- const m_TCGETX = 0x5432
- const m_TCSBRK = 0x5409
- const m_TCSBRKP = 0x5425
- const m_TCSETA = 0x5406
- const m_TCSETAF = 0x5408
- const m_TCSETAW = 0x5407
- const m_TCSETS = 0x5402
- const m_TCSETSF = 0x5404
- const m_TCSETSW = 0x5403
- const m_TCSETX = 0x5433
- const m_TCSETXF = 0x5434
- const m_TCSETXW = 0x5435
- const m_TCXONC = 0x540A
- const m_TIOCCBRK = 0x5428
- const m_TIOCCONS = 0x541D
- const m_TIOCEXCL = 0x540C
- const m_TIOCGDEV = 0x80045432
- const m_TIOCGETD = 0x5424
- const m_TIOCGEXCL = 0x80045440
- const m_TIOCGICOUNT = 0x545D
- const m_TIOCGISO7816 = 0x80285442
- const m_TIOCGLCKTRMIOS = 0x5456
- const m_TIOCGPGRP = 0x540F
- const m_TIOCGPKT = 0x80045438
- const m_TIOCGPTLCK = 0x80045439
- const m_TIOCGPTN = 0x80045430
- const m_TIOCGPTPEER = 0x5441
- const m_TIOCGRS485 = 0x542E
- const m_TIOCGSERIAL = 0x541E
- const m_TIOCGSID = 0x5429
- const m_TIOCGSOFTCAR = 0x5419
- const m_TIOCGWINSZ = 0x5413
- const m_TIOCINQ = "FIONREAD"
- const m_TIOCLINUX = 0x541C
- const m_TIOCMBIC = 0x5417
- const m_TIOCMBIS = 0x5416
- const m_TIOCMGET = 0x5415
- const m_TIOCMIWAIT = 0x545C
- const m_TIOCMSET = 0x5418
- const m_TIOCM_CAR = 0x040
- const m_TIOCM_CD = "TIOCM_CAR"
- const m_TIOCM_CTS = 0x020
- const m_TIOCM_DSR = 0x100
- const m_TIOCM_DTR = 0x002
- const m_TIOCM_LE = 0x001
- const m_TIOCM_LOOP = 0x8000
- const m_TIOCM_OUT1 = 0x2000
- const m_TIOCM_OUT2 = 0x4000
- const m_TIOCM_RI = "TIOCM_RNG"
- const m_TIOCM_RNG = 0x080
- const m_TIOCM_RTS = 0x004
- const m_TIOCM_SR = 0x010
- const m_TIOCM_ST = 0x008
- const m_TIOCNOTTY = 0x5422
- const m_TIOCNXCL = 0x540D
- const m_TIOCOUTQ = 0x5411
- const m_TIOCPKT = 0x5420
- const m_TIOCPKT_DATA = 0
- const m_TIOCPKT_DOSTOP = 32
- const m_TIOCPKT_FLUSHREAD = 1
- const m_TIOCPKT_FLUSHWRITE = 2
- const m_TIOCPKT_IOCTL = 64
- const m_TIOCPKT_NOSTOP = 16
- const m_TIOCPKT_START = 8
- const m_TIOCPKT_STOP = 4
- const m_TIOCSBRK = 0x5427
- const m_TIOCSCTTY = 0x540E
- const m_TIOCSERCONFIG = 0x5453
- const m_TIOCSERGETLSR = 0x5459
- const m_TIOCSERGETMULTI = 0x545A
- const m_TIOCSERGSTRUCT = 0x5458
- const m_TIOCSERGWILD = 0x5454
- const m_TIOCSERSETMULTI = 0x545B
- const m_TIOCSERSWILD = 0x5455
- const m_TIOCSER_TEMT = 1
- const m_TIOCSETD = 0x5423
- const m_TIOCSIG = 0x40045436
- const m_TIOCSISO7816 = 0xc0285443
- const m_TIOCSLCKTRMIOS = 0x5457
- const m_TIOCSPGRP = 0x5410
- const m_TIOCSPTLCK = 0x40045431
- const m_TIOCSRS485 = 0x542F
- const m_TIOCSSERIAL = 0x541F
- const m_TIOCSSOFTCAR = 0x541A
- const m_TIOCSTI = 0x5412
- const m_TIOCSWINSZ = 0x5414
- const m_TIOCVHANGUP = 0x5437
- const m_UMOUNT_NOFOLLOW = 8
- const m__IOC_DIRBITS = 2
- const m__IOC_NONE = 0
- const m__IOC_NRBITS = 8
- const m__IOC_NRSHIFT = 0
- const m__IOC_READ = 2
- const m__IOC_SIZEBITS = 14
- const m__IOC_TYPEBITS = 8
- const m__IOC_WRITE = 1
- const m__POSIX_C_SOURCE = 199309
- const m___BITS_PER_LONG = 32
- const m___bitwise__ = "__bitwise"
- type t__s8 = int8
- type t__u8 = uint8
- type t__s16 = int16
- type t__u16 = uint16
- type t__s32 = int32
- type t__u32 = uint32
- type t__s64 = int64
- type t__u64 = uint64
- type t__kernel_fd_set = struct {
- Ffds_bits [32]uint32
- }
- type t__kernel_sighandler_t = uintptr
- type t__kernel_key_t = int32
- type t__kernel_mqd_t = int32
- type t__kernel_mode_t = uint16
- type t__kernel_ipc_pid_t = uint16
- type t__kernel_uid_t = uint16
- type t__kernel_gid_t = uint16
- type t__kernel_old_dev_t = uint16
- type t__kernel_long_t = int32
- type t__kernel_ulong_t = uint32
- type t__kernel_ino_t = uint32
- type t__kernel_pid_t = int32
- type t__kernel_suseconds_t = int32
- type t__kernel_daddr_t = int32
- type t__kernel_uid32_t = uint32
- type t__kernel_gid32_t = uint32
- type t__kernel_old_uid_t = uint16
- type t__kernel_old_gid_t = uint16
- type t__kernel_size_t = uint32
- type t__kernel_ssize_t = int32
- type t__kernel_ptrdiff_t = int32
- type t__kernel_fsid_t = struct {
- Fval [2]int32
- }
- type t__kernel_off_t = int32
- type t__kernel_loff_t = int64
- type t__kernel_old_time_t = int32
- type t__kernel_time_t = int32
- type t__kernel_time64_t = int64
- type t__kernel_clock_t = int32
- type t__kernel_timer_t = int32
- type t__kernel_clockid_t = int32
- type t__kernel_caddr_t = uintptr
- type t__kernel_uid16_t = uint16
- type t__kernel_gid16_t = uint16
- type t__le16 = uint16
- type t__be16 = uint16
- type t__le32 = uint32
- type t__be32 = uint32
- type t__le64 = uint64
- type t__be64 = uint64
- type t__sum16 = uint16
- type t__wsum = uint32
- type t__poll_t = uint32
- type t__sysctl_args = struct {
- Fname uintptr
- Fnlen int32
- Foldval uintptr
- Foldlenp uintptr
- Fnewval uintptr
- Fnewlen Tsize_t
- F__unused [4]uint32
- }
- const _CTL_KERN = 1
- const _CTL_VM = 2
- const _CTL_NET = 3
- const _CTL_PROC = 4
- const _CTL_FS = 5
- const _CTL_DEBUG = 6
- const _CTL_DEV = 7
- const _CTL_BUS = 8
- const _CTL_ABI = 9
- const _CTL_CPU = 10
- const _CTL_ARLAN = 254
- const _CTL_S390DBF = 5677
- const _CTL_SUNRPC = 7249
- const _CTL_PM = 9899
- const _CTL_FRV = 9898
- const _CTL_BUS_ISA = 1
- const _INOTIFY_MAX_USER_INSTANCES = 1
- const _INOTIFY_MAX_USER_WATCHES = 2
- const _INOTIFY_MAX_QUEUED_EVENTS = 3
- const _KERN_OSTYPE = 1
- const _KERN_OSRELEASE = 2
- const _KERN_OSREV = 3
- const _KERN_VERSION = 4
- const _KERN_SECUREMASK = 5
- const _KERN_PROF = 6
- const _KERN_NODENAME = 7
- const _KERN_DOMAINNAME = 8
- const _KERN_PANIC = 15
- const _KERN_REALROOTDEV = 16
- const _KERN_SPARC_REBOOT = 21
- const _KERN_CTLALTDEL = 22
- const _KERN_PRINTK = 23
- const _KERN_NAMETRANS = 24
- const _KERN_PPC_HTABRECLAIM = 25
- const _KERN_PPC_ZEROPAGED = 26
- const _KERN_PPC_POWERSAVE_NAP = 27
- const _KERN_MODPROBE = 28
- const _KERN_SG_BIG_BUFF = 29
- const _KERN_ACCT = 30
- const _KERN_PPC_L2CR = 31
- const _KERN_RTSIGNR = 32
- const _KERN_RTSIGMAX = 33
- const _KERN_SHMMAX = 34
- const _KERN_MSGMAX = 35
- const _KERN_MSGMNB = 36
- const _KERN_MSGPOOL = 37
- const _KERN_SYSRQ = 38
- const _KERN_MAX_THREADS = 39
- const _KERN_RANDOM = 40
- const _KERN_SHMALL = 41
- const _KERN_MSGMNI = 42
- const _KERN_SEM = 43
- const _KERN_SPARC_STOP_A = 44
- const _KERN_SHMMNI = 45
- const _KERN_OVERFLOWUID = 46
- const _KERN_OVERFLOWGID = 47
- const _KERN_SHMPATH = 48
- const _KERN_HOTPLUG = 49
- const _KERN_IEEE_EMULATION_WARNINGS = 50
- const _KERN_S390_USER_DEBUG_LOGGING = 51
- const _KERN_CORE_USES_PID = 52
- const _KERN_TAINTED = 53
- const _KERN_CADPID = 54
- const _KERN_PIDMAX = 55
- const _KERN_CORE_PATTERN = 56
- const _KERN_PANIC_ON_OOPS = 57
- const _KERN_HPPA_PWRSW = 58
- const _KERN_HPPA_UNALIGNED = 59
- const _KERN_PRINTK_RATELIMIT = 60
- const _KERN_PRINTK_RATELIMIT_BURST = 61
- const _KERN_PTY = 62
- const _KERN_NGROUPS_MAX = 63
- const _KERN_SPARC_SCONS_PWROFF = 64
- const _KERN_HZ_TIMER = 65
- const _KERN_UNKNOWN_NMI_PANIC = 66
- const _KERN_BOOTLOADER_TYPE = 67
- const _KERN_RANDOMIZE = 68
- const _KERN_SETUID_DUMPABLE = 69
- const _KERN_SPIN_RETRY = 70
- const _KERN_ACPI_VIDEO_FLAGS = 71
- const _KERN_IA64_UNALIGNED = 72
- const _KERN_COMPAT_LOG = 73
- const _KERN_MAX_LOCK_DEPTH = 74
- const _KERN_NMI_WATCHDOG = 75
- const _KERN_PANIC_ON_NMI = 76
- const _KERN_PANIC_ON_WARN = 77
- const _KERN_PANIC_PRINT = 78
- const _VM_UNUSED1 = 1
- const _VM_UNUSED2 = 2
- const _VM_UNUSED3 = 3
- const _VM_UNUSED4 = 4
- const _VM_OVERCOMMIT_MEMORY = 5
- const _VM_UNUSED5 = 6
- const _VM_UNUSED7 = 7
- const _VM_UNUSED8 = 8
- const _VM_UNUSED9 = 9
- const _VM_PAGE_CLUSTER = 10
- const _VM_DIRTY_BACKGROUND = 11
- const _VM_DIRTY_RATIO = 12
- const _VM_DIRTY_WB_CS = 13
- const _VM_DIRTY_EXPIRE_CS = 14
- const _VM_NR_PDFLUSH_THREADS = 15
- const _VM_OVERCOMMIT_RATIO = 16
- const _VM_PAGEBUF = 17
- const _VM_HUGETLB_PAGES = 18
- const _VM_SWAPPINESS = 19
- const _VM_LOWMEM_RESERVE_RATIO = 20
- const _VM_MIN_FREE_KBYTES = 21
- const _VM_MAX_MAP_COUNT = 22
- const _VM_LAPTOP_MODE = 23
- const _VM_BLOCK_DUMP = 24
- const _VM_HUGETLB_GROUP = 25
- const _VM_VFS_CACHE_PRESSURE = 26
- const _VM_LEGACY_VA_LAYOUT = 27
- const _VM_SWAP_TOKEN_TIMEOUT = 28
- const _VM_DROP_PAGECACHE = 29
- const _VM_PERCPU_PAGELIST_FRACTION = 30
- const _VM_ZONE_RECLAIM_MODE = 31
- const _VM_MIN_UNMAPPED = 32
- const _VM_PANIC_ON_OOM = 33
- const _VM_VDSO_ENABLED = 34
- const _VM_MIN_SLAB = 35
- const _NET_CORE = 1
- const _NET_ETHER = 2
- const _NET_802 = 3
- const _NET_UNIX = 4
- const _NET_IPV4 = 5
- const _NET_IPX = 6
- const _NET_ATALK = 7
- const _NET_NETROM = 8
- const _NET_AX25 = 9
- const _NET_BRIDGE = 10
- const _NET_ROSE = 11
- const _NET_IPV6 = 12
- const _NET_X25 = 13
- const _NET_TR = 14
- const _NET_DECNET = 15
- const _NET_ECONET = 16
- const _NET_SCTP = 17
- const _NET_LLC = 18
- const _NET_NETFILTER = 19
- const _NET_DCCP = 20
- const _NET_IRDA = 412
- const _RANDOM_POOLSIZE = 1
- const _RANDOM_ENTROPY_COUNT = 2
- const _RANDOM_READ_THRESH = 3
- const _RANDOM_WRITE_THRESH = 4
- const _RANDOM_BOOT_ID = 5
- const _RANDOM_UUID = 6
- const _PTY_MAX = 1
- const _PTY_NR = 2
- const _BUS_ISA_MEM_BASE = 1
- const _BUS_ISA_PORT_BASE = 2
- const _BUS_ISA_PORT_SHIFT = 3
- const _NET_CORE_WMEM_MAX = 1
- const _NET_CORE_RMEM_MAX = 2
- const _NET_CORE_WMEM_DEFAULT = 3
- const _NET_CORE_RMEM_DEFAULT = 4
- const _NET_CORE_MAX_BACKLOG = 6
- const _NET_CORE_FASTROUTE = 7
- const _NET_CORE_MSG_COST = 8
- const _NET_CORE_MSG_BURST = 9
- const _NET_CORE_OPTMEM_MAX = 10
- const _NET_CORE_HOT_LIST_LENGTH = 11
- const _NET_CORE_DIVERT_VERSION = 12
- const _NET_CORE_NO_CONG_THRESH = 13
- const _NET_CORE_NO_CONG = 14
- const _NET_CORE_LO_CONG = 15
- const _NET_CORE_MOD_CONG = 16
- const _NET_CORE_DEV_WEIGHT = 17
- const _NET_CORE_SOMAXCONN = 18
- const _NET_CORE_BUDGET = 19
- const _NET_CORE_AEVENT_ETIME = 20
- const _NET_CORE_AEVENT_RSEQTH = 21
- const _NET_CORE_WARNINGS = 22
- const _NET_UNIX_DESTROY_DELAY = 1
- const _NET_UNIX_DELETE_DELAY = 2
- const _NET_UNIX_MAX_DGRAM_QLEN = 3
- const _NET_NF_CONNTRACK_MAX = 1
- const _NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT = 2
- const _NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV = 3
- const _NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED = 4
- const _NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT = 5
- const _NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT = 6
- const _NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK = 7
- const _NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT = 8
- const _NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE = 9
- const _NET_NF_CONNTRACK_UDP_TIMEOUT = 10
- const _NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM = 11
- const _NET_NF_CONNTRACK_ICMP_TIMEOUT = 12
- const _NET_NF_CONNTRACK_GENERIC_TIMEOUT = 13
- const _NET_NF_CONNTRACK_BUCKETS = 14
- const _NET_NF_CONNTRACK_LOG_INVALID = 15
- const _NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS = 16
- const _NET_NF_CONNTRACK_TCP_LOOSE = 17
- const _NET_NF_CONNTRACK_TCP_BE_LIBERAL = 18
- const _NET_NF_CONNTRACK_TCP_MAX_RETRANS = 19
- const _NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED = 20
- const _NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT = 21
- const _NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED = 22
- const _NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED = 23
- const _NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT = 24
- const _NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD = 25
- const _NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT = 26
- const _NET_NF_CONNTRACK_COUNT = 27
- const _NET_NF_CONNTRACK_ICMPV6_TIMEOUT = 28
- const _NET_NF_CONNTRACK_FRAG6_TIMEOUT = 29
- const _NET_NF_CONNTRACK_FRAG6_LOW_THRESH = 30
- const _NET_NF_CONNTRACK_FRAG6_HIGH_THRESH = 31
- const _NET_NF_CONNTRACK_CHECKSUM = 32
- const _NET_IPV4_FORWARD = 8
- const _NET_IPV4_DYNADDR = 9
- const _NET_IPV4_CONF = 16
- const _NET_IPV4_NEIGH = 17
- const _NET_IPV4_ROUTE = 18
- const _NET_IPV4_FIB_HASH = 19
- const _NET_IPV4_NETFILTER = 20
- const _NET_IPV4_TCP_TIMESTAMPS = 33
- const _NET_IPV4_TCP_WINDOW_SCALING = 34
- const _NET_IPV4_TCP_SACK = 35
- const _NET_IPV4_TCP_RETRANS_COLLAPSE = 36
- const _NET_IPV4_DEFAULT_TTL = 37
- const _NET_IPV4_AUTOCONFIG = 38
- const _NET_IPV4_NO_PMTU_DISC = 39
- const _NET_IPV4_TCP_SYN_RETRIES = 40
- const _NET_IPV4_IPFRAG_HIGH_THRESH = 41
- const _NET_IPV4_IPFRAG_LOW_THRESH = 42
- const _NET_IPV4_IPFRAG_TIME = 43
- const _NET_IPV4_TCP_MAX_KA_PROBES = 44
- const _NET_IPV4_TCP_KEEPALIVE_TIME = 45
- const _NET_IPV4_TCP_KEEPALIVE_PROBES = 46
- const _NET_IPV4_TCP_RETRIES1 = 47
- const _NET_IPV4_TCP_RETRIES2 = 48
- const _NET_IPV4_TCP_FIN_TIMEOUT = 49
- const _NET_IPV4_IP_MASQ_DEBUG = 50
- const _NET_TCP_SYNCOOKIES = 51
- const _NET_TCP_STDURG = 52
- const _NET_TCP_RFC1337 = 53
- const _NET_TCP_SYN_TAILDROP = 54
- const _NET_TCP_MAX_SYN_BACKLOG = 55
- const _NET_IPV4_LOCAL_PORT_RANGE = 56
- const _NET_IPV4_ICMP_ECHO_IGNORE_ALL = 57
- const _NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS = 58
- const _NET_IPV4_ICMP_SOURCEQUENCH_RATE = 59
- const _NET_IPV4_ICMP_DESTUNREACH_RATE = 60
- const _NET_IPV4_ICMP_TIMEEXCEED_RATE = 61
- const _NET_IPV4_ICMP_PARAMPROB_RATE = 62
- const _NET_IPV4_ICMP_ECHOREPLY_RATE = 63
- const _NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES = 64
- const _NET_IPV4_IGMP_MAX_MEMBERSHIPS = 65
- const _NET_TCP_TW_RECYCLE = 66
- const _NET_IPV4_ALWAYS_DEFRAG = 67
- const _NET_IPV4_TCP_KEEPALIVE_INTVL = 68
- const _NET_IPV4_INET_PEER_THRESHOLD = 69
- const _NET_IPV4_INET_PEER_MINTTL = 70
- const _NET_IPV4_INET_PEER_MAXTTL = 71
- const _NET_IPV4_INET_PEER_GC_MINTIME = 72
- const _NET_IPV4_INET_PEER_GC_MAXTIME = 73
- const _NET_TCP_ORPHAN_RETRIES = 74
- const _NET_TCP_ABORT_ON_OVERFLOW = 75
- const _NET_TCP_SYNACK_RETRIES = 76
- const _NET_TCP_MAX_ORPHANS = 77
- const _NET_TCP_MAX_TW_BUCKETS = 78
- const _NET_TCP_FACK = 79
- const _NET_TCP_REORDERING = 80
- const _NET_TCP_ECN = 81
- const _NET_TCP_DSACK = 82
- const _NET_TCP_MEM = 83
- const _NET_TCP_WMEM = 84
- const _NET_TCP_RMEM = 85
- const _NET_TCP_APP_WIN = 86
- const _NET_TCP_ADV_WIN_SCALE = 87
- const _NET_IPV4_NONLOCAL_BIND = 88
- const _NET_IPV4_ICMP_RATELIMIT = 89
- const _NET_IPV4_ICMP_RATEMASK = 90
- const _NET_TCP_TW_REUSE = 91
- const _NET_TCP_FRTO = 92
- const _NET_TCP_LOW_LATENCY = 93
- const _NET_IPV4_IPFRAG_SECRET_INTERVAL = 94
- const _NET_IPV4_IGMP_MAX_MSF = 96
- const _NET_TCP_NO_METRICS_SAVE = 97
- const _NET_TCP_DEFAULT_WIN_SCALE = 105
- const _NET_TCP_MODERATE_RCVBUF = 106
- const _NET_TCP_TSO_WIN_DIVISOR = 107
- const _NET_TCP_BIC_BETA = 108
- const _NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR = 109
- const _NET_TCP_CONG_CONTROL = 110
- const _NET_TCP_ABC = 111
- const _NET_IPV4_IPFRAG_MAX_DIST = 112
- const _NET_TCP_MTU_PROBING = 113
- const _NET_TCP_BASE_MSS = 114
- const _NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS = 115
- const _NET_TCP_DMA_COPYBREAK = 116
- const _NET_TCP_SLOW_START_AFTER_IDLE = 117
- const _NET_CIPSOV4_CACHE_ENABLE = 118
- const _NET_CIPSOV4_CACHE_BUCKET_SIZE = 119
- const _NET_CIPSOV4_RBM_OPTFMT = 120
- const _NET_CIPSOV4_RBM_STRICTVALID = 121
- const _NET_TCP_AVAIL_CONG_CONTROL = 122
- const _NET_TCP_ALLOWED_CONG_CONTROL = 123
- const _NET_TCP_MAX_SSTHRESH = 124
- const _NET_TCP_FRTO_RESPONSE = 125
- const _NET_IPV4_ROUTE_FLUSH = 1
- const _NET_IPV4_ROUTE_MIN_DELAY = 2
- const _NET_IPV4_ROUTE_MAX_DELAY = 3
- const _NET_IPV4_ROUTE_GC_THRESH = 4
- const _NET_IPV4_ROUTE_MAX_SIZE = 5
- const _NET_IPV4_ROUTE_GC_MIN_INTERVAL = 6
- const _NET_IPV4_ROUTE_GC_TIMEOUT = 7
- const _NET_IPV4_ROUTE_GC_INTERVAL = 8
- const _NET_IPV4_ROUTE_REDIRECT_LOAD = 9
- const _NET_IPV4_ROUTE_REDIRECT_NUMBER = 10
- const _NET_IPV4_ROUTE_REDIRECT_SILENCE = 11
- const _NET_IPV4_ROUTE_ERROR_COST = 12
- const _NET_IPV4_ROUTE_ERROR_BURST = 13
- const _NET_IPV4_ROUTE_GC_ELASTICITY = 14
- const _NET_IPV4_ROUTE_MTU_EXPIRES = 15
- const _NET_IPV4_ROUTE_MIN_PMTU = 16
- const _NET_IPV4_ROUTE_MIN_ADVMSS = 17
- const _NET_IPV4_ROUTE_SECRET_INTERVAL = 18
- const _NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS = 19
- const _NET_PROTO_CONF_ALL = -2
- const _NET_PROTO_CONF_DEFAULT = -3
- const _NET_IPV4_CONF_FORWARDING = 1
- const _NET_IPV4_CONF_MC_FORWARDING = 2
- const _NET_IPV4_CONF_PROXY_ARP = 3
- const _NET_IPV4_CONF_ACCEPT_REDIRECTS = 4
- const _NET_IPV4_CONF_SECURE_REDIRECTS = 5
- const _NET_IPV4_CONF_SEND_REDIRECTS = 6
- const _NET_IPV4_CONF_SHARED_MEDIA = 7
- const _NET_IPV4_CONF_RP_FILTER = 8
- const _NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE = 9
- const _NET_IPV4_CONF_BOOTP_RELAY = 10
- const _NET_IPV4_CONF_LOG_MARTIANS = 11
- const _NET_IPV4_CONF_TAG = 12
- const _NET_IPV4_CONF_ARPFILTER = 13
- const _NET_IPV4_CONF_MEDIUM_ID = 14
- const _NET_IPV4_CONF_NOXFRM = 15
- const _NET_IPV4_CONF_NOPOLICY = 16
- const _NET_IPV4_CONF_FORCE_IGMP_VERSION = 17
- const _NET_IPV4_CONF_ARP_ANNOUNCE = 18
- const _NET_IPV4_CONF_ARP_IGNORE = 19
- const _NET_IPV4_CONF_PROMOTE_SECONDARIES = 20
- const _NET_IPV4_CONF_ARP_ACCEPT = 21
- const _NET_IPV4_CONF_ARP_NOTIFY = 22
- const _NET_IPV4_CONF_ARP_EVICT_NOCARRIER = 23
- const _NET_IPV4_NF_CONNTRACK_MAX = 1
- const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT = 2
- const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV = 3
- const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED = 4
- const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT = 5
- const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT = 6
- const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK = 7
- const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT = 8
- const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE = 9
- const _NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT = 10
- const _NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM = 11
- const _NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT = 12
- const _NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT = 13
- const _NET_IPV4_NF_CONNTRACK_BUCKETS = 14
- const _NET_IPV4_NF_CONNTRACK_LOG_INVALID = 15
- const _NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS = 16
- const _NET_IPV4_NF_CONNTRACK_TCP_LOOSE = 17
- const _NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL = 18
- const _NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS = 19
- const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED = 20
- const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT = 21
- const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED = 22
- const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED = 23
- const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT = 24
- const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD = 25
- const _NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT = 26
- const _NET_IPV4_NF_CONNTRACK_COUNT = 27
- const _NET_IPV4_NF_CONNTRACK_CHECKSUM = 28
- const _NET_IPV6_CONF = 16
- const _NET_IPV6_NEIGH = 17
- const _NET_IPV6_ROUTE = 18
- const _NET_IPV6_ICMP = 19
- const _NET_IPV6_BINDV6ONLY = 20
- const _NET_IPV6_IP6FRAG_HIGH_THRESH = 21
- const _NET_IPV6_IP6FRAG_LOW_THRESH = 22
- const _NET_IPV6_IP6FRAG_TIME = 23
- const _NET_IPV6_IP6FRAG_SECRET_INTERVAL = 24
- const _NET_IPV6_MLD_MAX_MSF = 25
- const _NET_IPV6_ROUTE_FLUSH = 1
- const _NET_IPV6_ROUTE_GC_THRESH = 2
- const _NET_IPV6_ROUTE_MAX_SIZE = 3
- const _NET_IPV6_ROUTE_GC_MIN_INTERVAL = 4
- const _NET_IPV6_ROUTE_GC_TIMEOUT = 5
- const _NET_IPV6_ROUTE_GC_INTERVAL = 6
- const _NET_IPV6_ROUTE_GC_ELASTICITY = 7
- const _NET_IPV6_ROUTE_MTU_EXPIRES = 8
- const _NET_IPV6_ROUTE_MIN_ADVMSS = 9
- const _NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS = 10
- const _NET_IPV6_FORWARDING = 1
- const _NET_IPV6_HOP_LIMIT = 2
- const _NET_IPV6_MTU = 3
- const _NET_IPV6_ACCEPT_RA = 4
- const _NET_IPV6_ACCEPT_REDIRECTS = 5
- const _NET_IPV6_AUTOCONF = 6
- const _NET_IPV6_DAD_TRANSMITS = 7
- const _NET_IPV6_RTR_SOLICITS = 8
- const _NET_IPV6_RTR_SOLICIT_INTERVAL = 9
- const _NET_IPV6_RTR_SOLICIT_DELAY = 10
- const _NET_IPV6_USE_TEMPADDR = 11
- const _NET_IPV6_TEMP_VALID_LFT = 12
- const _NET_IPV6_TEMP_PREFERED_LFT = 13
- const _NET_IPV6_REGEN_MAX_RETRY = 14
- const _NET_IPV6_MAX_DESYNC_FACTOR = 15
- const _NET_IPV6_MAX_ADDRESSES = 16
- const _NET_IPV6_FORCE_MLD_VERSION = 17
- const _NET_IPV6_ACCEPT_RA_DEFRTR = 18
- const _NET_IPV6_ACCEPT_RA_PINFO = 19
- const _NET_IPV6_ACCEPT_RA_RTR_PREF = 20
- const _NET_IPV6_RTR_PROBE_INTERVAL = 21
- const _NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN = 22
- const _NET_IPV6_PROXY_NDP = 23
- const _NET_IPV6_ACCEPT_SOURCE_ROUTE = 25
- const _NET_IPV6_ACCEPT_RA_FROM_LOCAL = 26
- const _NET_IPV6_ACCEPT_RA_RT_INFO_MIN_PLEN = 27
- const _NET_IPV6_RA_DEFRTR_METRIC = 28
- const ___NET_IPV6_MAX = 29
- const _NET_IPV6_ICMP_RATELIMIT = 1
- const _NET_IPV6_ICMP_ECHO_IGNORE_ALL = 2
- const _NET_NEIGH_MCAST_SOLICIT = 1
- const _NET_NEIGH_UCAST_SOLICIT = 2
- const _NET_NEIGH_APP_SOLICIT = 3
- const _NET_NEIGH_RETRANS_TIME = 4
- const _NET_NEIGH_REACHABLE_TIME = 5
- const _NET_NEIGH_DELAY_PROBE_TIME = 6
- const _NET_NEIGH_GC_STALE_TIME = 7
- const _NET_NEIGH_UNRES_QLEN = 8
- const _NET_NEIGH_PROXY_QLEN = 9
- const _NET_NEIGH_ANYCAST_DELAY = 10
- const _NET_NEIGH_PROXY_DELAY = 11
- const _NET_NEIGH_LOCKTIME = 12
- const _NET_NEIGH_GC_INTERVAL = 13
- const _NET_NEIGH_GC_THRESH1 = 14
- const _NET_NEIGH_GC_THRESH2 = 15
- const _NET_NEIGH_GC_THRESH3 = 16
- const _NET_NEIGH_RETRANS_TIME_MS = 17
- const _NET_NEIGH_REACHABLE_TIME_MS = 18
- const _NET_NEIGH_INTERVAL_PROBE_TIME_MS = 19
- const _NET_DCCP_DEFAULT = 1
- const _NET_IPX_PPROP_BROADCASTING = 1
- const _NET_IPX_FORWARDING = 2
- const _NET_LLC2 = 1
- const _NET_LLC_STATION = 2
- const _NET_LLC2_TIMEOUT = 1
- const _NET_LLC_STATION_ACK_TIMEOUT = 1
- const _NET_LLC2_ACK_TIMEOUT = 1
- const _NET_LLC2_P_TIMEOUT = 2
- const _NET_LLC2_REJ_TIMEOUT = 3
- const _NET_LLC2_BUSY_TIMEOUT = 4
- const _NET_ATALK_AARP_EXPIRY_TIME = 1
- const _NET_ATALK_AARP_TICK_TIME = 2
- const _NET_ATALK_AARP_RETRANSMIT_LIMIT = 3
- const _NET_ATALK_AARP_RESOLVE_TIME = 4
- const _NET_NETROM_DEFAULT_PATH_QUALITY = 1
- const _NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER = 2
- const _NET_NETROM_NETWORK_TTL_INITIALISER = 3
- const _NET_NETROM_TRANSPORT_TIMEOUT = 4
- const _NET_NETROM_TRANSPORT_MAXIMUM_TRIES = 5
- const _NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY = 6
- const _NET_NETROM_TRANSPORT_BUSY_DELAY = 7
- const _NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE = 8
- const _NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT = 9
- const _NET_NETROM_ROUTING_CONTROL = 10
- const _NET_NETROM_LINK_FAILS_COUNT = 11
- const _NET_NETROM_RESET = 12
- const _NET_AX25_IP_DEFAULT_MODE = 1
- const _NET_AX25_DEFAULT_MODE = 2
- const _NET_AX25_BACKOFF_TYPE = 3
- const _NET_AX25_CONNECT_MODE = 4
- const _NET_AX25_STANDARD_WINDOW = 5
- const _NET_AX25_EXTENDED_WINDOW = 6
- const _NET_AX25_T1_TIMEOUT = 7
- const _NET_AX25_T2_TIMEOUT = 8
- const _NET_AX25_T3_TIMEOUT = 9
- const _NET_AX25_IDLE_TIMEOUT = 10
- const _NET_AX25_N2 = 11
- const _NET_AX25_PACLEN = 12
- const _NET_AX25_PROTOCOL = 13
- const _NET_AX25_DAMA_SLAVE_TIMEOUT = 14
- const _NET_ROSE_RESTART_REQUEST_TIMEOUT = 1
- const _NET_ROSE_CALL_REQUEST_TIMEOUT = 2
- const _NET_ROSE_RESET_REQUEST_TIMEOUT = 3
- const _NET_ROSE_CLEAR_REQUEST_TIMEOUT = 4
- const _NET_ROSE_ACK_HOLD_BACK_TIMEOUT = 5
- const _NET_ROSE_ROUTING_CONTROL = 6
- const _NET_ROSE_LINK_FAIL_TIMEOUT = 7
- const _NET_ROSE_MAX_VCS = 8
- const _NET_ROSE_WINDOW_SIZE = 9
- const _NET_ROSE_NO_ACTIVITY_TIMEOUT = 10
- const _NET_X25_RESTART_REQUEST_TIMEOUT = 1
- const _NET_X25_CALL_REQUEST_TIMEOUT = 2
- const _NET_X25_RESET_REQUEST_TIMEOUT = 3
- const _NET_X25_CLEAR_REQUEST_TIMEOUT = 4
- const _NET_X25_ACK_HOLD_BACK_TIMEOUT = 5
- const _NET_X25_FORWARD = 6
- const _NET_TR_RIF_TIMEOUT = 1
- const _NET_DECNET_NODE_TYPE = 1
- const _NET_DECNET_NODE_ADDRESS = 2
- const _NET_DECNET_NODE_NAME = 3
- const _NET_DECNET_DEFAULT_DEVICE = 4
- const _NET_DECNET_TIME_WAIT = 5
- const _NET_DECNET_DN_COUNT = 6
- const _NET_DECNET_DI_COUNT = 7
- const _NET_DECNET_DR_COUNT = 8
- const _NET_DECNET_DST_GC_INTERVAL = 9
- const _NET_DECNET_CONF = 10
- const _NET_DECNET_NO_FC_MAX_CWND = 11
- const _NET_DECNET_MEM = 12
- const _NET_DECNET_RMEM = 13
- const _NET_DECNET_WMEM = 14
- const _NET_DECNET_DEBUG_LEVEL = 255
- const _NET_DECNET_CONF_LOOPBACK = -2
- const _NET_DECNET_CONF_DDCMP = -3
- const _NET_DECNET_CONF_PPP = -4
- const _NET_DECNET_CONF_X25 = -5
- const _NET_DECNET_CONF_GRE = -6
- const _NET_DECNET_CONF_ETHER = -7
- const _NET_DECNET_CONF_DEV_PRIORITY = 1
- const _NET_DECNET_CONF_DEV_T1 = 2
- const _NET_DECNET_CONF_DEV_T2 = 3
- const _NET_DECNET_CONF_DEV_T3 = 4
- const _NET_DECNET_CONF_DEV_FORWARDING = 5
- const _NET_DECNET_CONF_DEV_BLKSIZE = 6
- const _NET_DECNET_CONF_DEV_STATE = 7
- const _NET_SCTP_RTO_INITIAL = 1
- const _NET_SCTP_RTO_MIN = 2
- const _NET_SCTP_RTO_MAX = 3
- const _NET_SCTP_RTO_ALPHA = 4
- const _NET_SCTP_RTO_BETA = 5
- const _NET_SCTP_VALID_COOKIE_LIFE = 6
- const _NET_SCTP_ASSOCIATION_MAX_RETRANS = 7
- const _NET_SCTP_PATH_MAX_RETRANS = 8
- const _NET_SCTP_MAX_INIT_RETRANSMITS = 9
- const _NET_SCTP_HB_INTERVAL = 10
- const _NET_SCTP_PRESERVE_ENABLE = 11
- const _NET_SCTP_MAX_BURST = 12
- const _NET_SCTP_ADDIP_ENABLE = 13
- const _NET_SCTP_PRSCTP_ENABLE = 14
- const _NET_SCTP_SNDBUF_POLICY = 15
- const _NET_SCTP_SACK_TIMEOUT = 16
- const _NET_SCTP_RCVBUF_POLICY = 17
- const _NET_BRIDGE_NF_CALL_ARPTABLES = 1
- const _NET_BRIDGE_NF_CALL_IPTABLES = 2
- const _NET_BRIDGE_NF_CALL_IP6TABLES = 3
- const _NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4
- const _NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5
- const _FS_NRINODE = 1
- const _FS_STATINODE = 2
- const _FS_MAXINODE = 3
- const _FS_NRDQUOT = 4
- const _FS_MAXDQUOT = 5
- const _FS_NRFILE = 6
- const _FS_MAXFILE = 7
- const _FS_DENTRY = 8
- const _FS_NRSUPER = 9
- const _FS_MAXSUPER = 10
- const _FS_OVERFLOWUID = 11
- const _FS_OVERFLOWGID = 12
- const _FS_LEASES = 13
- const _FS_DIR_NOTIFY = 14
- const _FS_LEASE_TIME = 15
- const _FS_DQSTATS = 16
- const _FS_XFS = 17
- const _FS_AIO_NR = 18
- const _FS_AIO_MAX_NR = 19
- const _FS_INOTIFY = 20
- const _FS_OCFS2 = 988
- const _FS_DQ_LOOKUPS = 1
- const _FS_DQ_DROPS = 2
- const _FS_DQ_READS = 3
- const _FS_DQ_WRITES = 4
- const _FS_DQ_CACHE_HITS = 5
- const _FS_DQ_ALLOCATED = 6
- const _FS_DQ_FREE = 7
- const _FS_DQ_SYNCS = 8
- const _FS_DQ_WARNINGS = 9
- const _DEV_CDROM = 1
- const _DEV_HWMON = 2
- const _DEV_PARPORT = 3
- const _DEV_RAID = 4
- const _DEV_MAC_HID = 5
- const _DEV_SCSI = 6
- const _DEV_IPMI = 7
- const _DEV_CDROM_INFO = 1
- const _DEV_CDROM_AUTOCLOSE = 2
- const _DEV_CDROM_AUTOEJECT = 3
- const _DEV_CDROM_DEBUG = 4
- const _DEV_CDROM_LOCK = 5
- const _DEV_CDROM_CHECK_MEDIA = 6
- const _DEV_PARPORT_DEFAULT = -3
- const _DEV_RAID_SPEED_LIMIT_MIN = 1
- const _DEV_RAID_SPEED_LIMIT_MAX = 2
- const _DEV_PARPORT_DEFAULT_TIMESLICE = 1
- const _DEV_PARPORT_DEFAULT_SPINTIME = 2
- const _DEV_PARPORT_SPINTIME = 1
- const _DEV_PARPORT_BASE_ADDR = 2
- const _DEV_PARPORT_IRQ = 3
- const _DEV_PARPORT_DMA = 4
- const _DEV_PARPORT_MODES = 5
- const _DEV_PARPORT_DEVICES = 6
- const _DEV_PARPORT_AUTOPROBE = 16
- const _DEV_PARPORT_DEVICES_ACTIVE = -3
- const _DEV_PARPORT_DEVICE_TIMESLICE = 1
- const _DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES = 1
- const _DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES = 2
- const _DEV_MAC_HID_MOUSE_BUTTON_EMULATION = 3
- const _DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE = 4
- const _DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE = 5
- const _DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES = 6
- const _DEV_SCSI_LOGGING_LEVEL = 1
- const _DEV_IPMI_POWEROFF_POWERCYCLE = 1
- const _ABI_DEFHANDLER_COFF = 1
- const _ABI_DEFHANDLER_ELF = 2
- const _ABI_DEFHANDLER_LCALL7 = 3
- const _ABI_DEFHANDLER_LIBCSO = 4
- const _ABI_TRACE = 5
- const _ABI_FAKE_UTSNAME = 6
- type Tstatvfs = struct {
- Ff_bsize uint32
- Ff_frsize uint32
- Ff_blocks Tfsblkcnt_t
- Ff_bfree Tfsblkcnt_t
- Ff_bavail Tfsblkcnt_t
- Ff_files Tfsfilcnt_t
- Ff_ffree Tfsfilcnt_t
- Ff_favail Tfsfilcnt_t
- Ff_fsid uint32
- F__ccgo60 uint32
- Ff_flag uint32
- Ff_namemax uint32
- Ff_type uint32
- F__reserved [5]int32
- }
- type TElf_Symndx = uint32
- type Tdl_phdr_info = struct {
- Fdlpi_addr TElf32_Addr
- Fdlpi_name uintptr
- Fdlpi_phdr uintptr
- Fdlpi_phnum TElf32_Half
- Fdlpi_adds uint64
- Fdlpi_subs uint64
- Fdlpi_tls_modid Tsize_t
- Fdlpi_tls_data uintptr
- }
- type Tlink_map = struct {
- Fl_addr TElf32_Addr
- Fl_name uintptr
- Fl_ld uintptr
- Fl_next uintptr
- Fl_prev uintptr
- }
- type Tr_debug = struct {
- Fr_version int32
- Fr_map uintptr
- Fr_brk TElf32_Addr
- Fr_state int32
- Fr_ldbase TElf32_Addr
- }
- const _RT_CONSISTENT = 0
- const _RT_ADD = 1
- const _RT_DELETE = 2
- type TSHA2_CTX = struct {
- Fstate struct {
- Fst64 [0][8]Tuint64_t
- Fst32 [8]Tuint32_t
- F__ccgo_pad2 [32]byte
- }
- Fbitcount [2]Tuint64_t
- Fbuffer [128]Tuint8_t
- }
- type T_SHA2_CTX = TSHA2_CTX
- type TSHA512_CTX = struct {
- Fstate struct {
- Fst64 [0][8]Tuint64_t
- Fst32 [8]Tuint32_t
- F__ccgo_pad2 [32]byte
- }
- Fbitcount [2]Tuint64_t
- Fbuffer [128]Tuint8_t
- }
- type TSHA384_CTX = struct {
- Fstate struct {
- Fst64 [0][8]Tuint64_t
- Fst32 [8]Tuint32_t
- F__ccgo_pad2 [32]byte
- }
- Fbitcount [2]Tuint64_t
- Fbuffer [128]Tuint8_t
- }
- type Trand_pool_info = struct {
- Fentropy_count int32
- Fbuf_size int32
- }
- type Tfsid_t = struct {
- F__val [2]int32
- }
- type t__fsid_t = Tfsid_t
- type Tstatfs = struct {
- Ff_type uint32
- Ff_bsize uint32
- Ff_blocks Tfsblkcnt_t
- Ff_bfree Tfsblkcnt_t
- Ff_bavail Tfsblkcnt_t
- Ff_files Tfsfilcnt_t
- Ff_ffree Tfsfilcnt_t
- Ff_fsid Tfsid_t
- Ff_namelen uint32
- Ff_frsize uint32
- Ff_flags uint32
- Ff_spare [4]uint32
- }
- func Xgetentropy(tls *libc.TLS, buf uintptr, len1 Tsize_t) (r int32) {
- var ret int32
- _ = ret
- ret = -int32(1)
- if len1 > uint32(256) {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EIO)
- return -int32(1)
- }
- /*
- * Try descriptor-less getrandom(), in non-blocking mode.
- *
- * The design of Linux getrandom is broken. It has an
- * uninitialized phase coupled with blocking behaviour, which
- * is unacceptable from within a library at boot time without
- * possible recovery. See http://bugs.python.org/issue26839#msg267745
- */
- ret = _getentropy_getrandom(tls, buf, len1)
- if ret != -int32(1) {
- return ret
- }
- /*
- * Try to get entropy with /dev/urandom
- *
- * This can fail if the process is inside a chroot or if file
- * descriptors are exhausted.
- */
- ret = _getentropy_urandom(tls, buf, len1)
- if ret != -int32(1) {
- return ret
- }
- /*
- * Try to use sysctl CTL_KERN, KERN_RANDOM, RANDOM_UUID.
- * sysctl is a failsafe API, so it guarantees a result. This
- * should work inside a chroot, or when file descriptors are
- * exhausted.
- *
- * However this can fail if the Linux kernel removes support
- * for sysctl. Starting in 2007, there have been efforts to
- * deprecate the sysctl API/ABI, and push callers towards use
- * of the chroot-unavailable fd-using /proc mechanism --
- * essentially the same problems as /dev/urandom.
- *
- * Numerous setbacks have been encountered in their deprecation
- * schedule, so as of June 2014 the kernel ABI still exists on
- * most Linux architectures. The sysctl() stub in libc is missing
- * on some systems. There are also reports that some kernels
- * spew messages to the console.
- */
- ret = _getentropy_sysctl(tls, buf, len1)
- if ret != -int32(1) {
- return ret
- }
- /*
- * Entropy collection via /dev/urandom and sysctl have failed.
- *
- * No other API exists for collecting entropy. See the large
- * comment block above.
- *
- * We have very few options:
- * - Even syslog_r is unsafe to call at this low level, so
- * there is no way to alert the user or program.
- * - Cannot call abort() because some systems have unsafe
- * corefiles.
- * - Could raise(SIGKILL) resulting in silent program termination.
- * - Return EIO, to hint that arc4random's stir function
- * should raise(SIGKILL)
- * - Do the best under the circumstances....
- *
- * This code path exists to bring light to the issue that Linux
- * still does not provide a failsafe API for entropy collection.
- *
- * We hope this demonstrates that Linux should either retain their
- * sysctl ABI, or consider providing a new failsafe API which
- * works in a chroot or when file descriptors are exhausted.
- */
- ret = _getentropy_fallback(tls, buf, len1)
- if ret != -int32(1) {
- return ret
- }
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EIO)
- return ret
- }
- // C documentation
- //
- // /*
- // * Basic sanity checking; wish we could do better.
- // */
- func _gotdata(tls *libc.TLS, buf uintptr, len1 Tsize_t) (r int32) {
- var any_set int8
- var i Tsize_t
- _, _ = any_set, i
- any_set = 0
- i = uint32(0)
- for {
- if !(i < len1) {
- break
- }
- any_set = int8(int32(any_set) | int32(*(*int8)(unsafe.Pointer(buf + uintptr(i)))))
- goto _1
- _1:
- ;
- i++
- }
- if int32(any_set) == 0 {
- return -int32(1)
- }
- return 0
- }
- func _getentropy_getrandom(tls *libc.TLS, buf uintptr, len1 Tsize_t) (r int32) {
- bp := tls.Alloc(32)
- defer tls.Free(32)
- var pre_errno, ret int32
- _, _ = pre_errno, ret
- pre_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- if len1 > uint32(256) {
- return -int32(1)
- }
- for cond := true; cond; cond = ret == -int32(1) && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EINTR) {
- ret = int32(libc.Xsyscall(tls, int32(m_SYS_getrandom), libc.VaList(bp+8, buf, len1, int32(m_GRND_NONBLOCK))))
- }
- if ret != libc.Int32FromUint32(len1) {
- return -int32(1)
- }
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = pre_errno
- return 0
- }
- func _getentropy_urandom(tls *libc.TLS, buf uintptr, len1 Tsize_t) (r int32) {
- bp := tls.Alloc(176)
- defer tls.Free(176)
- var fd, flags, save_errno int32
- var i, wanted Tsize_t
- var ret Tssize_t
- var _ /* cnt at bp+144 */ int32
- var _ /* st at bp+0 */ Tstat
- _, _, _, _, _, _ = fd, flags, i, ret, save_errno, wanted
- save_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- goto start
- start:
- ;
- flags = m_O_RDONLY3
- flags |= int32(m_O_NOFOLLOW1)
- flags |= int32(m_O_CLOEXEC1)
- fd = libc.Xopen(tls, __ccgo_ts+651, flags, libc.VaList(bp+160, 0))
- if fd == -int32(1) {
- if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EINTR) {
- goto start
- }
- goto nodevrandom
- }
- /* Lightly verify that the device node looks sane */
- if libc.Xfstat(tls, fd, bp) == -int32(1) || !((*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&libc.Uint32FromInt32(m_S_IFMT3) == libc.Uint32FromInt32(m_S_IFCHR3)) {
- libc.Xclose(tls, fd)
- goto nodevrandom
- }
- 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) {
- libc.Xclose(tls, fd)
- goto nodevrandom
- }
- i = uint32(0)
- for {
- if !(i < len1) {
- break
- }
- wanted = len1 - i
- ret = libc.Xread(tls, fd, buf+uintptr(i), wanted)
- if ret == -int32(1) {
- if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EAGAIN) || *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(m_EINTR) {
- goto _1
- }
- libc.Xclose(tls, fd)
- goto nodevrandom
- }
- i += libc.Uint32FromInt32(ret)
- goto _1
- _1:
- }
- libc.Xclose(tls, fd)
- if _gotdata(tls, buf, len1) == 0 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = save_errno
- return 0 /* satisfied */
- }
- goto nodevrandom
- nodevrandom:
- ;
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EIO)
- return -int32(1)
- }
- func _getentropy_sysctl(tls *libc.TLS, buf uintptr, len1 Tsize_t) (r int32) {
- bp := tls.Alloc(64)
- defer tls.Free(64)
- var i Tsize_t
- var save_errno int32
- var v2 uint32
- var _ /* args at bp+4 */ t__sysctl_args
- var _ /* chunk at bp+0 */ Tsize_t
- _, _, _ = i, save_errno, v2
- save_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- i = uint32(0)
- for {
- if !(i < len1) {
- break
- }
- if len1-i < libc.Uint32FromInt32(libc.Int32FromInt32(16)) {
- v2 = len1 - i
- } else {
- v2 = libc.Uint32FromInt32(libc.Int32FromInt32(16))
- }
- *(*Tsize_t)(unsafe.Pointer(bp)) = v2
- /* SYS__sysctl because some systems already removed sysctl() */
- *(*t__sysctl_args)(unsafe.Pointer(bp + 4)) = t__sysctl_args{
- Fname: uintptr(unsafe.Pointer(&_mib)),
- Fnlen: int32(3),
- Foldval: buf + uintptr(i),
- Foldlenp: bp,
- }
- if libc.Xsyscall(tls, int32(m_SYS__sysctl), libc.VaList(bp+56, bp+4)) != 0 {
- goto sysctlfailed
- }
- i += *(*Tsize_t)(unsafe.Pointer(bp))
- goto _1
- _1:
- }
- if _gotdata(tls, buf, len1) == 0 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = save_errno
- return 0 /* satisfied */
- }
- goto sysctlfailed
- sysctlfailed:
- ;
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EIO)
- return -int32(1)
- }
- var _mib = [3]int32{
- 0: int32(_CTL_KERN),
- 1: int32(_KERN_RANDOM),
- 2: int32(_RANDOM_UUID),
- }
- var _cl = [6]int32{
- 1: int32(m_CLOCK_MONOTONIC),
- 2: int32(m_CLOCK_MONOTONIC_RAW),
- 3: int32(m_CLOCK_TAI),
- 4: int32(m_CLOCK_PROCESS_CPUTIME_ID),
- 5: int32(m_CLOCK_THREAD_CPUTIME_ID),
- }
- func _getentropy_phdr(tls *libc.TLS, info uintptr, size Tsize_t, data uintptr) (r int32) {
- var ctx uintptr
- _ = ctx
- ctx = data
- libmd.XSHA512Update(tls, ctx, info, uint32(4))
- return 0
- }
- func _getentropy_fallback(tls *libc.TLS, buf uintptr, len1 Tsize_t) (r int32) {
- bp := tls.Alloc(1216)
- defer tls.Free(1216)
- var faster, j, pgs, repeat, save_errno, v13, v14, v16, v18, v19, v3, v9 int32
- var i, ii, m, mo Tsize_t
- var v11 uintptr
- var v17 Toff_t
- var v20, v21 uint32
- var v5, v6, v7, v8 Tpid_t
- var _ /* ctx at bp+524 */ TSHA512_CTX
- var _ /* e at bp+64 */ int32
- var _ /* mm at bp+1120 */ [12]struct {
- Fnpg Tsize_t
- Fp uintptr
- }
- var _ /* off at bp+1112 */ Toff_t
- var _ /* p at bp+736 */ uintptr
- var _ /* pid at bp+732 */ Tpid_t
- var _ /* results at bp+0 */ [64]Tuint8_t
- var _ /* ru at bp+100 */ Trusage
- var _ /* sigset at bp+252 */ Tsigset_t
- var _ /* ss at bp+740 */ Tsockaddr_storage
- var _ /* ssl at bp+1108 */ Tsocklen_t
- var _ /* st at bp+380 */ Tstat
- var _ /* stfs at bp+1024 */ Tstatfs
- var _ /* stvfs at bp+868 */ Tstatvfs
- var _ /* tios at bp+964 */ Ttermios
- var _ /* ts at bp+68 */ Ttimespec
- var _ /* tv at bp+84 */ Ttimeval
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- save_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- pgs = libc.Xgetpagesize(tls)
- faster = 0
- *(*Tpid_t)(unsafe.Pointer(bp + 732)) = libc.Xgetpid(tls)
- if _lastpid == *(*Tpid_t)(unsafe.Pointer(bp + 732)) {
- faster = int32(1)
- repeat = int32(2)
- } else {
- faster = 0
- _lastpid = *(*Tpid_t)(unsafe.Pointer(bp + 732))
- repeat = int32(m_REPEAT)
- }
- i = uint32(0)
- for {
- if !(i < len1) {
- break
- }
- libmd.XSHA512Init(tls, bp+524)
- j = 0
- for {
- if !(j < repeat) {
- break
- }
- v3 = libc.Xgettimeofday(tls, bp+84, libc.UintptrFromInt32(0))
- *(*int32)(unsafe.Pointer(bp + 64)) = v3
- if v3 == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+84, uint32(16))
- }
- if *(*int32)(unsafe.Pointer(bp + 64)) != -int32(1) {
- _cnt += int32((*(*Ttimeval)(unsafe.Pointer(bp + 84))).Ftv_sec)
- _cnt += int32((*(*Ttimeval)(unsafe.Pointer(bp + 84))).Ftv_usec)
- }
- _dl_iterate_phdr(tls, __ccgo_fp(_getentropy_phdr), bp+524)
- ii = uint32(0)
- for {
- if !(ii < libc.Uint32FromInt64(24)/libc.Uint32FromInt64(4)) {
- break
- }
- if libc.Xclock_gettime(tls, _cl[ii], bp+68) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+68, uint32(16))
- }
- goto _4
- _4:
- ;
- ii++
- }
- v5 = libc.Xgetpid(tls)
- *(*Tpid_t)(unsafe.Pointer(bp + 732)) = v5
- if v5 == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+732, uint32(4))
- }
- v6 = libc.Xgetsid(tls, *(*Tpid_t)(unsafe.Pointer(bp + 732)))
- *(*Tpid_t)(unsafe.Pointer(bp + 732)) = v6
- if v6 == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+732, uint32(4))
- }
- v7 = libc.Xgetppid(tls)
- *(*Tpid_t)(unsafe.Pointer(bp + 732)) = v7
- if v7 == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+732, uint32(4))
- }
- v8 = libc.Xgetpgid(tls, 0)
- *(*Tpid_t)(unsafe.Pointer(bp + 732)) = v8
- if v8 == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+732, uint32(4))
- }
- v9 = libc.Xgetpriority(tls, 0, uint32(0))
- *(*int32)(unsafe.Pointer(bp + 64)) = v9
- if v9 == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+64, uint32(4))
- }
- if !(faster != 0) {
- (*(*Ttimespec)(unsafe.Pointer(bp + 68))).Ftv_sec = 0
- (*(*Ttimespec)(unsafe.Pointer(bp + 68))).Ftv_nsec = int32(1)
- libc.Xnanosleep(tls, bp+68, libc.UintptrFromInt32(0))
- }
- if libc.Xsigpending(tls, bp+252) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+252, uint32(128))
- }
- if libc.Xsigprocmask(tls, m_SIG_BLOCK, libc.UintptrFromInt32(0), bp+252) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+252, uint32(128))
- }
- libmd.XSHA512Update(tls, bp+524, __ccgo_fp(Xgetentropy), uint32(4)) /* an addr in this library */
- libmd.XSHA512Update(tls, bp+524, __ccgo_fp(libc.Xprintf), uint32(4)) /* an addr in libc */
- *(*uintptr)(unsafe.Pointer(bp + 736)) = bp + 736
- libmd.XSHA512Update(tls, bp+524, bp+736, uint32(4)) /* an addr on stack */
- *(*uintptr)(unsafe.Pointer(bp + 736)) = libc.X__errno_location(tls)
- libmd.XSHA512Update(tls, bp+524, bp+736, uint32(4)) /* the addr of errno */
- if i == uint32(0) {
- /*
- * Prime-sized mappings encourage fragmentation;
- * thus exposing some address entropy.
- */
- *(*[12]struct {
- Fnpg Tsize_t
- Fp uintptr
- })(unsafe.Pointer(bp + 1120)) = [12]struct {
- Fnpg Tsize_t
- Fp uintptr
- }{
- 0: {
- Fnpg: uint32(17),
- Fp: uintptr(-libc.Int32FromInt32(1)),
- },
- 1: {
- Fnpg: uint32(3),
- Fp: uintptr(-libc.Int32FromInt32(1)),
- },
- 2: {
- Fnpg: uint32(11),
- Fp: uintptr(-libc.Int32FromInt32(1)),
- },
- 3: {
- Fnpg: uint32(2),
- Fp: uintptr(-libc.Int32FromInt32(1)),
- },
- 4: {
- Fnpg: uint32(5),
- Fp: uintptr(-libc.Int32FromInt32(1)),
- },
- 5: {
- Fnpg: uint32(3),
- Fp: uintptr(-libc.Int32FromInt32(1)),
- },
- 6: {
- Fnpg: uint32(7),
- Fp: uintptr(-libc.Int32FromInt32(1)),
- },
- 7: {
- Fnpg: uint32(1),
- Fp: uintptr(-libc.Int32FromInt32(1)),
- },
- 8: {
- Fnpg: uint32(57),
- Fp: uintptr(-libc.Int32FromInt32(1)),
- },
- 9: {
- Fnpg: uint32(3),
- Fp: uintptr(-libc.Int32FromInt32(1)),
- },
- 10: {
- Fnpg: uint32(131),
- Fp: uintptr(-libc.Int32FromInt32(1)),
- },
- 11: {
- Fnpg: uint32(1),
- Fp: uintptr(-libc.Int32FromInt32(1)),
- },
- }
- m = uint32(0)
- for {
- if !(m < libc.Uint32FromInt64(96)/libc.Uint32FromInt64(8)) {
- break
- }
- v11 = libc.Xmmap(tls, libc.UintptrFromInt32(0), (*(*[12]struct {
- Fnpg Tsize_t
- Fp uintptr
- })(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))
- (*(*[12]struct {
- Fnpg Tsize_t
- Fp uintptr
- })(unsafe.Pointer(bp + 1120)))[m].Fp = v11
- if v11 != 0 {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+1120+uintptr(m)*8+4, uint32(4))
- }
- if (*(*[12]struct {
- Fnpg Tsize_t
- Fp uintptr
- })(unsafe.Pointer(bp + 1120)))[m].Fp != uintptr(-libc.Int32FromInt32(1)) {
- /* Touch some memory... */
- *(*uintptr)(unsafe.Pointer(bp + 736)) = (*(*[12]struct {
- Fnpg Tsize_t
- Fp uintptr
- })(unsafe.Pointer(bp + 1120)))[m].Fp
- mo = libc.Uint32FromInt32(_cnt) % ((*(*[12]struct {
- Fnpg Tsize_t
- Fp uintptr
- })(unsafe.Pointer(bp + 1120)))[m].Fnpg*libc.Uint32FromInt32(pgs) - uint32(1))
- *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 736)) + uintptr(mo))) = int8(1)
- _cnt += int32((*(*[12]struct {
- Fnpg Tsize_t
- Fp uintptr
- })(unsafe.Pointer(bp + 1120)))[m].Fp) / pgs
- }
- /* Check cnts and times... */
- ii = uint32(0)
- for {
- if !(ii < libc.Uint32FromInt64(24)/libc.Uint32FromInt64(4)) {
- break
- }
- v13 = libc.Xclock_gettime(tls, _cl[ii], bp+68)
- *(*int32)(unsafe.Pointer(bp + 64)) = v13
- if v13 == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+68, uint32(16))
- }
- if *(*int32)(unsafe.Pointer(bp + 64)) != -int32(1) {
- _cnt += (*(*Ttimespec)(unsafe.Pointer(bp + 68))).Ftv_nsec
- }
- goto _12
- _12:
- ;
- ii++
- }
- v14 = libc.Xgetrusage(tls, m_RUSAGE_SELF, bp+100)
- *(*int32)(unsafe.Pointer(bp + 64)) = v14
- if v14 == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+100, uint32(152))
- }
- if *(*int32)(unsafe.Pointer(bp + 64)) != -int32(1) {
- _cnt += int32((*(*Trusage)(unsafe.Pointer(bp + 100))).Fru_utime.Ftv_sec)
- _cnt += int32((*(*Trusage)(unsafe.Pointer(bp + 100))).Fru_utime.Ftv_usec)
- }
- goto _10
- _10:
- ;
- m++
- }
- m = uint32(0)
- for {
- if !(m < libc.Uint32FromInt64(96)/libc.Uint32FromInt64(8)) {
- break
- }
- if (*(*[12]struct {
- Fnpg Tsize_t
- Fp uintptr
- })(unsafe.Pointer(bp + 1120)))[m].Fp != uintptr(-libc.Int32FromInt32(1)) {
- libc.Xmunmap(tls, (*(*[12]struct {
- Fnpg Tsize_t
- Fp uintptr
- })(unsafe.Pointer(bp + 1120)))[m].Fp, (*(*[12]struct {
- Fnpg Tsize_t
- Fp uintptr
- })(unsafe.Pointer(bp + 1120)))[m].Fnpg*libc.Uint32FromInt32(pgs))
- }
- (*(*[12]struct {
- Fnpg Tsize_t
- Fp uintptr
- })(unsafe.Pointer(bp + 1120)))[m].Fp = uintptr(-libc.Int32FromInt32(1))
- goto _15
- _15:
- ;
- m++
- }
- if libc.Xstat(tls, __ccgo_ts+664, bp+380) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+380, uint32(144))
- }
- if libc.Xstatvfs(tls, __ccgo_ts+664, bp+868) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+868, uint32(96))
- }
- if _statfs(tls, __ccgo_ts+664, bp+1024) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+1024, uint32(84))
- }
- if libc.Xstat(tls, __ccgo_ts+666, bp+380) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+380, uint32(144))
- }
- if libc.Xstatvfs(tls, __ccgo_ts+666, bp+868) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+868, uint32(96))
- }
- if _statfs(tls, __ccgo_ts+666, bp+1024) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+1024, uint32(84))
- }
- v16 = libc.Xfstat(tls, 0, bp+380)
- *(*int32)(unsafe.Pointer(bp + 64)) = v16
- if v16 == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+380, uint32(144))
- }
- if *(*int32)(unsafe.Pointer(bp + 64)) == -int32(1) {
- 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) {
- if libc.Xfstatvfs(tls, 0, bp+868) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+868, uint32(96))
- }
- if libc.Xfstatfs(tls, 0, bp+1024) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+1024, uint32(84))
- }
- v17 = libc.Xlseek(tls, 0, libc.Int64FromInt32(0), int32(1))
- *(*Toff_t)(unsafe.Pointer(bp + 1112)) = v17
- if v17 < 0 {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+1112, uint32(8))
- }
- }
- if (*(*Tstat)(unsafe.Pointer(bp + 380))).Fst_mode&uint32(m_S_IFMT3) == uint32(m_S_IFCHR3) {
- if libc.Xtcgetattr(tls, 0, bp+964) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+964, uint32(60))
- }
- } else {
- if (*(*Tstat)(unsafe.Pointer(bp + 380))).Fst_mode&uint32(m_S_IFMT3) == uint32(m_S_IFSOCK3) {
- libc.Xmemset(tls, bp+740, 0, uint32(128))
- *(*Tsocklen_t)(unsafe.Pointer(bp + 1108)) = uint32(128)
- if libc.Xgetpeername(tls, 0, bp+740, bp+1108) == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+740, uint32(128))
- }
- }
- }
- }
- v18 = libc.Xgetrusage(tls, -int32(1), bp+100)
- *(*int32)(unsafe.Pointer(bp + 64)) = v18
- if v18 == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+100, uint32(152))
- }
- if *(*int32)(unsafe.Pointer(bp + 64)) != -int32(1) {
- _cnt += int32((*(*Trusage)(unsafe.Pointer(bp + 100))).Fru_utime.Ftv_sec)
- _cnt += int32((*(*Trusage)(unsafe.Pointer(bp + 100))).Fru_utime.Ftv_usec)
- }
- } else {
- /* Subsequent hashes absorb previous result */
- libmd.XSHA512Update(tls, bp+524, bp, uint32(64))
- }
- v19 = libc.Xgettimeofday(tls, bp+84, libc.UintptrFromInt32(0))
- *(*int32)(unsafe.Pointer(bp + 64)) = v19
- if v19 == -int32(1) {
- libmd.XSHA512Update(tls, bp+524, libc.X__errno_location(tls), uint32(4))
- } else {
- libmd.XSHA512Update(tls, bp+524, bp+84, uint32(16))
- }
- if *(*int32)(unsafe.Pointer(bp + 64)) != -int32(1) {
- _cnt += int32((*(*Ttimeval)(unsafe.Pointer(bp + 84))).Ftv_sec)
- _cnt += int32((*(*Ttimeval)(unsafe.Pointer(bp + 84))).Ftv_usec)
- }
- libmd.XSHA512Update(tls, bp+524, uintptr(unsafe.Pointer(&_cnt)), uint32(4))
- goto _2
- _2:
- ;
- j++
- }
- /* Not as random as you think but we take what we are given */
- *(*uintptr)(unsafe.Pointer(bp + 736)) = uintptr(libc.Int32FromUint32(libc.Xgetauxval(tls, uint32(m_AT_RANDOM))))
- if *(*uintptr)(unsafe.Pointer(bp + 736)) != 0 {
- libmd.XSHA512Update(tls, bp+524, *(*uintptr)(unsafe.Pointer(bp + 736)), libc.Uint32FromInt32(libc.Int32FromInt32(16)))
- }
- *(*uintptr)(unsafe.Pointer(bp + 736)) = uintptr(libc.Int32FromUint32(libc.Xgetauxval(tls, uint32(m_AT_SYSINFO_EHDR))))
- if *(*uintptr)(unsafe.Pointer(bp + 736)) != 0 {
- libmd.XSHA512Update(tls, bp+524, *(*uintptr)(unsafe.Pointer(bp + 736)), libc.Uint32FromInt32(pgs))
- }
- *(*uintptr)(unsafe.Pointer(bp + 736)) = uintptr(libc.Int32FromUint32(libc.Xgetauxval(tls, uint32(m_AT_BASE))))
- if *(*uintptr)(unsafe.Pointer(bp + 736)) != 0 {
- libmd.XSHA512Update(tls, bp+524, bp+736, uint32(4))
- }
- libmd.XSHA512Final(tls, bp, bp+524)
- if libc.Uint32FromInt64(64) < len1-i {
- v20 = libc.Uint32FromInt64(64)
- } else {
- v20 = len1 - i
- }
- libc.Xmemcpy(tls, buf+uintptr(i), bp, v20)
- if libc.Uint32FromInt64(64) < len1-i {
- v21 = libc.Uint32FromInt64(64)
- } else {
- v21 = len1 - i
- }
- i += v21
- goto _1
- _1:
- }
- Xexplicit_bzero(tls, bp+524, uint32(208))
- Xexplicit_bzero(tls, bp, uint32(64))
- if _gotdata(tls, buf, len1) == 0 {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = save_errno
- return 0 /* satisfied */
- }
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = int32(m_EIO)
- return -int32(1)
- }
- var _cnt int32
- var _lastpid Tpid_t
- func __ccgo_fp(f interface{}) uintptr {
- type iface [2]uintptr
- return (*iface)(unsafe.Pointer(&f))[1]
- }
- var Xoptreset int32
- var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data
- 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"
|