musl-git-20140301.patch 246 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177
  1. diff -Nur musl-0.9.15/arch/arm/bits/shm.h musl-git/arch/arm/bits/shm.h
  2. --- musl-0.9.15/arch/arm/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  3. +++ musl-git/arch/arm/bits/shm.h 2014-03-01 08:58:13.000000000 +0100
  4. @@ -16,3 +16,14 @@
  5. unsigned long __pad1;
  6. unsigned long __pad2;
  7. };
  8. +
  9. +struct shminfo {
  10. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  11. +};
  12. +
  13. +struct shm_info {
  14. + int __used_ids;
  15. + unsigned long shm_tot, shm_rss, shm_swp;
  16. + unsigned long __swap_attempts, __swap_successes;
  17. +};
  18. +
  19. diff -Nur musl-0.9.15/arch/arm/bits/termios.h musl-git/arch/arm/bits/termios.h
  20. --- musl-0.9.15/arch/arm/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  21. +++ musl-git/arch/arm/bits/termios.h 2014-03-01 08:58:13.000000000 +0100
  22. @@ -42,6 +42,7 @@
  23. #define IXANY 0004000
  24. #define IXOFF 0010000
  25. #define IMAXBEL 0020000
  26. +#define IUTF8 0040000
  27. #define OPOST 0000001
  28. #define OLCUC 0000002
  29. @@ -75,9 +76,6 @@
  30. #define VT0 0000000
  31. #define VT1 0040000
  32. -/* ?? */
  33. -#define XTABS 0014000
  34. -
  35. #define B0 0000000
  36. #define B50 0000001
  37. #define B75 0000002
  38. @@ -125,8 +123,6 @@
  39. #define HUPCL 0002000
  40. #define CLOCAL 0004000
  41. -#define CRTSCTS 020000000000
  42. -
  43. #define ISIG 0000001
  44. #define ICANON 0000002
  45. #define ECHO 0000010
  46. @@ -137,14 +133,11 @@
  47. #define TOSTOP 0000400
  48. #define IEXTEN 0100000
  49. -/* Extensions? */
  50. -#define CBAUDEX 0010000
  51. #define ECHOCTL 0001000
  52. #define ECHOPRT 0002000
  53. #define ECHOKE 0004000
  54. #define FLUSHO 0010000
  55. #define PENDIN 0040000
  56. -#define EXTPROC 0200000
  57. #define TCOOFF 0
  58. #define TCOON 1
  59. @@ -158,3 +151,10 @@
  60. #define TCSANOW 0
  61. #define TCSADRAIN 1
  62. #define TCSAFLUSH 2
  63. +
  64. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  65. +#define CBAUDEX 0010000
  66. +#define CRTSCTS 020000000000
  67. +#define EXTPROC 0200000
  68. +#define XTABS 0014000
  69. +#endif
  70. diff -Nur musl-0.9.15/arch/arm/syscall_arch.h musl-git/arch/arm/syscall_arch.h
  71. --- musl-0.9.15/arch/arm/syscall_arch.h 2014-01-03 21:12:17.000000000 +0100
  72. +++ musl-git/arch/arm/syscall_arch.h 2014-03-01 08:58:14.000000000 +0100
  73. @@ -3,6 +3,8 @@
  74. ((union { long long ll; long l[2]; }){ .ll = x }).l[1]
  75. #define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
  76. +long (__syscall)(long, ...);
  77. +
  78. #ifndef __clang__
  79. #define __asm_syscall(...) do { \
  80. diff -Nur musl-0.9.15/arch/i386/bits/shm.h musl-git/arch/i386/bits/shm.h
  81. --- musl-0.9.15/arch/i386/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  82. +++ musl-git/arch/i386/bits/shm.h 2014-03-01 08:58:14.000000000 +0100
  83. @@ -16,3 +16,14 @@
  84. unsigned long __pad1;
  85. unsigned long __pad2;
  86. };
  87. +
  88. +struct shminfo {
  89. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  90. +};
  91. +
  92. +struct shm_info {
  93. + int __used_ids;
  94. + unsigned long shm_tot, shm_rss, shm_swp;
  95. + unsigned long __swap_attempts, __swap_successes;
  96. +};
  97. +
  98. diff -Nur musl-0.9.15/arch/i386/bits/termios.h musl-git/arch/i386/bits/termios.h
  99. --- musl-0.9.15/arch/i386/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  100. +++ musl-git/arch/i386/bits/termios.h 2014-03-01 08:58:14.000000000 +0100
  101. @@ -42,6 +42,7 @@
  102. #define IXANY 0004000
  103. #define IXOFF 0010000
  104. #define IMAXBEL 0020000
  105. +#define IUTF8 0040000
  106. #define OPOST 0000001
  107. #define OLCUC 0000002
  108. @@ -75,9 +76,6 @@
  109. #define VT0 0000000
  110. #define VT1 0040000
  111. -/* ?? */
  112. -#define XTABS 0014000
  113. -
  114. #define B0 0000000
  115. #define B50 0000001
  116. #define B75 0000002
  117. @@ -125,8 +123,6 @@
  118. #define HUPCL 0002000
  119. #define CLOCAL 0004000
  120. -#define CRTSCTS 020000000000
  121. -
  122. #define ISIG 0000001
  123. #define ICANON 0000002
  124. #define ECHO 0000010
  125. @@ -137,14 +133,11 @@
  126. #define TOSTOP 0000400
  127. #define IEXTEN 0100000
  128. -/* Extensions? */
  129. -#define CBAUDEX 0010000
  130. #define ECHOCTL 0001000
  131. #define ECHOPRT 0002000
  132. #define ECHOKE 0004000
  133. #define FLUSHO 0010000
  134. #define PENDIN 0040000
  135. -#define EXTPROC 0200000
  136. #define TCOOFF 0
  137. #define TCOON 1
  138. @@ -158,3 +151,10 @@
  139. #define TCSANOW 0
  140. #define TCSADRAIN 1
  141. #define TCSAFLUSH 2
  142. +
  143. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  144. +#define CBAUDEX 0010000
  145. +#define CRTSCTS 020000000000
  146. +#define EXTPROC 0200000
  147. +#define XTABS 0014000
  148. +#endif
  149. diff -Nur musl-0.9.15/arch/microblaze/bits/shm.h musl-git/arch/microblaze/bits/shm.h
  150. --- musl-0.9.15/arch/microblaze/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  151. +++ musl-git/arch/microblaze/bits/shm.h 2014-03-01 08:58:14.000000000 +0100
  152. @@ -16,3 +16,14 @@
  153. unsigned long __pad1;
  154. unsigned long __pad2;
  155. };
  156. +
  157. +struct shminfo {
  158. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  159. +};
  160. +
  161. +struct shm_info {
  162. + int __used_ids;
  163. + unsigned long shm_tot, shm_rss, shm_swp;
  164. + unsigned long __swap_attempts, __swap_successes;
  165. +};
  166. +
  167. diff -Nur musl-0.9.15/arch/microblaze/bits/termios.h musl-git/arch/microblaze/bits/termios.h
  168. --- musl-0.9.15/arch/microblaze/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  169. +++ musl-git/arch/microblaze/bits/termios.h 2014-03-01 08:58:14.000000000 +0100
  170. @@ -42,6 +42,7 @@
  171. #define IXANY 0004000
  172. #define IXOFF 0010000
  173. #define IMAXBEL 0020000
  174. +#define IUTF8 0040000
  175. #define OPOST 0000001
  176. #define OLCUC 0000002
  177. @@ -75,9 +76,6 @@
  178. #define VT0 0000000
  179. #define VT1 0040000
  180. -/* ?? */
  181. -#define XTABS 0014000
  182. -
  183. #define B0 0000000
  184. #define B50 0000001
  185. #define B75 0000002
  186. @@ -125,8 +123,6 @@
  187. #define HUPCL 0002000
  188. #define CLOCAL 0004000
  189. -#define CRTSCTS 020000000000
  190. -
  191. #define ISIG 0000001
  192. #define ICANON 0000002
  193. #define ECHO 0000010
  194. @@ -137,14 +133,11 @@
  195. #define TOSTOP 0000400
  196. #define IEXTEN 0100000
  197. -/* Extensions? */
  198. -#define CBAUDEX 0010000
  199. #define ECHOCTL 0001000
  200. #define ECHOPRT 0002000
  201. #define ECHOKE 0004000
  202. #define FLUSHO 0010000
  203. #define PENDIN 0040000
  204. -#define EXTPROC 0200000
  205. #define TCOOFF 0
  206. #define TCOON 1
  207. @@ -158,3 +151,10 @@
  208. #define TCSANOW 0
  209. #define TCSADRAIN 1
  210. #define TCSAFLUSH 2
  211. +
  212. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  213. +#define CBAUDEX 0010000
  214. +#define CRTSCTS 020000000000
  215. +#define EXTPROC 0200000
  216. +#define XTABS 0014000
  217. +#endif
  218. diff -Nur musl-0.9.15/arch/microblaze/syscall_arch.h musl-git/arch/microblaze/syscall_arch.h
  219. --- musl-0.9.15/arch/microblaze/syscall_arch.h 2014-01-03 21:12:17.000000000 +0100
  220. +++ musl-git/arch/microblaze/syscall_arch.h 2014-03-01 08:58:14.000000000 +0100
  221. @@ -3,6 +3,8 @@
  222. ((union { long long ll; long l[2]; }){ .ll = x }).l[1]
  223. #define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
  224. +long (__syscall)(long, ...);
  225. +
  226. #ifndef __clang__
  227. static __inline long __syscall0(long n)
  228. diff -Nur musl-0.9.15/arch/mips/bits/fenv.h musl-git/arch/mips/bits/fenv.h
  229. --- musl-0.9.15/arch/mips/bits/fenv.h 2014-01-03 21:12:17.000000000 +0100
  230. +++ musl-git/arch/mips/bits/fenv.h 2014-03-01 08:58:14.000000000 +0100
  231. @@ -1,3 +1,7 @@
  232. +#ifdef __mips_soft_float
  233. +#define FE_ALL_EXCEPT 0
  234. +#define FE_TONEAREST 0
  235. +#else
  236. #define FE_INEXACT 4
  237. #define FE_UNDERFLOW 8
  238. #define FE_OVERFLOW 16
  239. @@ -10,6 +14,7 @@
  240. #define FE_TOWARDZERO 1
  241. #define FE_UPWARD 2
  242. #define FE_DOWNWARD 3
  243. +#endif
  244. typedef unsigned short fexcept_t;
  245. diff -Nur musl-0.9.15/arch/mips/bits/shm.h musl-git/arch/mips/bits/shm.h
  246. --- musl-0.9.15/arch/mips/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  247. +++ musl-git/arch/mips/bits/shm.h 2014-03-01 08:58:14.000000000 +0100
  248. @@ -13,3 +13,14 @@
  249. unsigned long __pad1;
  250. unsigned long __pad2;
  251. };
  252. +
  253. +struct shminfo {
  254. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  255. +};
  256. +
  257. +struct shm_info {
  258. + int __used_ids;
  259. + unsigned long shm_tot, shm_rss, shm_swp;
  260. + unsigned long __swap_attempts, __swap_successes;
  261. +};
  262. +
  263. diff -Nur musl-0.9.15/arch/mips/bits/termios.h musl-git/arch/mips/bits/termios.h
  264. --- musl-0.9.15/arch/mips/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  265. +++ musl-git/arch/mips/bits/termios.h 2014-03-01 08:58:14.000000000 +0100
  266. @@ -77,9 +77,6 @@
  267. #define VT0 0000000
  268. #define VT1 0040000
  269. -/* ?? */
  270. -#define XTABS 0014000
  271. -
  272. #define B0 0000000
  273. #define B50 0000001
  274. #define B75 0000002
  275. @@ -129,12 +126,6 @@
  276. #define PARODD 0001000
  277. #define HUPCL 0002000
  278. #define CLOCAL 0004000
  279. -#define CBAUDEX 0010000
  280. -
  281. -#define CIBAUD 002003600000
  282. -#define CMSPAR 010000000000
  283. -#define CRTSCTS 020000000000
  284. -#define IBSHIFT 16
  285. #define ISIG 0000001
  286. #define ICANON 0000002
  287. @@ -152,9 +143,6 @@
  288. #define PENDIN 0040000
  289. #define TOSTOP 0100000
  290. #define ITOSTOP 0100000
  291. -#define EXTPROC 0200000
  292. -
  293. -#define TIOCSER_TEMT 1
  294. #define TCOOFF 0
  295. #define TCOON 1
  296. @@ -168,3 +156,14 @@
  297. #define TCSANOW 0
  298. #define TCSADRAIN 1
  299. #define TCSAFLUSH 2
  300. +
  301. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  302. +#define CBAUDEX 0010000
  303. +#define CIBAUD 002003600000
  304. +#define IBSHIFT 16
  305. +#define CMSPAR 010000000000
  306. +#define CRTSCTS 020000000000
  307. +#define EXTPROC 0200000
  308. +#define XTABS 0014000
  309. +#define TIOCSER_TEMT 1
  310. +#endif
  311. diff -Nur musl-0.9.15/arch/mips/reloc.h musl-git/arch/mips/reloc.h
  312. --- musl-0.9.15/arch/mips/reloc.h 2014-01-03 21:12:17.000000000 +0100
  313. +++ musl-git/arch/mips/reloc.h 2014-03-01 08:58:14.000000000 +0100
  314. @@ -8,7 +8,13 @@
  315. #define ENDIAN_SUFFIX ""
  316. #endif
  317. -#define LDSO_ARCH "mips" ENDIAN_SUFFIX
  318. +#ifdef __mips_soft_float
  319. +#define FP_SUFFIX "-sf"
  320. +#else
  321. +#define FP_SUFFIX ""
  322. +#endif
  323. +
  324. +#define LDSO_ARCH "mips" ENDIAN_SUFFIX FP_SUFFIX
  325. #define IS_COPY(x) ((x)==R_MIPS_COPY)
  326. #define IS_PLT(x) 1
  327. diff -Nur musl-0.9.15/arch/mips/syscall_arch.h musl-git/arch/mips/syscall_arch.h
  328. --- musl-0.9.15/arch/mips/syscall_arch.h 2014-01-03 21:12:17.000000000 +0100
  329. +++ musl-git/arch/mips/syscall_arch.h 2014-03-01 08:58:14.000000000 +0100
  330. @@ -3,6 +3,8 @@
  331. ((union { long long ll; long l[2]; }){ .ll = x }).l[1]
  332. #define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
  333. +long (__syscall)(long, ...);
  334. +
  335. #ifndef __clang__
  336. #define __asm_syscall(...) do { \
  337. diff -Nur musl-0.9.15/arch/powerpc/bits/shm.h musl-git/arch/powerpc/bits/shm.h
  338. --- musl-0.9.15/arch/powerpc/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  339. +++ musl-git/arch/powerpc/bits/shm.h 2014-03-01 08:58:14.000000000 +0100
  340. @@ -16,3 +16,14 @@
  341. unsigned long __pad1;
  342. unsigned long __pad2;
  343. };
  344. +
  345. +struct shminfo {
  346. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  347. +};
  348. +
  349. +struct shm_info {
  350. + int __used_ids;
  351. + unsigned long shm_tot, shm_rss, shm_swp;
  352. + unsigned long __swap_attempts, __swap_successes;
  353. +};
  354. +
  355. diff -Nur musl-0.9.15/arch/powerpc/bits/termios.h musl-git/arch/powerpc/bits/termios.h
  356. --- musl-0.9.15/arch/powerpc/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  357. +++ musl-git/arch/powerpc/bits/termios.h 2014-03-01 08:58:14.000000000 +0100
  358. @@ -66,7 +66,6 @@
  359. #define TAB1 00002000
  360. #define TAB2 00004000
  361. #define TAB3 00006000
  362. -#define XTABS 00006000
  363. #define CRDLY 00030000
  364. #define CR0 00000000
  365. #define CR1 00010000
  366. @@ -101,7 +100,6 @@
  367. #define B38400 0000017
  368. #define EXTA B19200
  369. #define EXTB B38400
  370. -#define CBAUDEX 0000000
  371. #define B57600 00020
  372. #define B115200 00021
  373. #define B230400 00022
  374. @@ -120,9 +118,6 @@
  375. #define B4000000 00036
  376. #define BOTHER 00037
  377. -#define CIBAUD 077600000
  378. -#define IBSHIFT 16
  379. -
  380. #define CSIZE 00001400
  381. #define CS5 00000000
  382. #define CS6 00000400
  383. @@ -136,8 +131,6 @@
  384. #define HUPCL 00040000
  385. #define CLOCAL 00100000
  386. -#define CMSPAR 010000000000
  387. -#define CRTSCTS 020000000000
  388. #define ISIG 0x00000080
  389. #define ICANON 0x00000100
  390. @@ -154,7 +147,6 @@
  391. #define FLUSHO 0x00800000
  392. #define PENDIN 0x20000000
  393. #define IEXTEN 0x00000400
  394. -#define EXTPROC 0x10000000
  395. #define TCOOFF 0
  396. #define TCOON 1
  397. @@ -168,3 +160,13 @@
  398. #define TCSANOW 0
  399. #define TCSADRAIN 1
  400. #define TCSAFLUSH 2
  401. +
  402. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  403. +#define CBAUDEX 0000000
  404. +#define CIBAUD 077600000
  405. +#define IBSHIFT 16
  406. +#define CMSPAR 010000000000
  407. +#define CRTSCTS 020000000000
  408. +#define EXTPROC 0x10000000
  409. +#define XTABS 00006000
  410. +#endif
  411. diff -Nur musl-0.9.15/arch/sh/atomic.h musl-git/arch/sh/atomic.h
  412. --- musl-0.9.15/arch/sh/atomic.h 1970-01-01 01:00:00.000000000 +0100
  413. +++ musl-git/arch/sh/atomic.h 2014-03-01 08:58:14.000000000 +0100
  414. @@ -0,0 +1,87 @@
  415. +#ifndef _INTERNAL_ATOMIC_H
  416. +#define _INTERNAL_ATOMIC_H
  417. +
  418. +#include <stdint.h>
  419. +
  420. +static inline int a_ctz_l(unsigned long x)
  421. +{
  422. + static const char debruijn32[32] = {
  423. + 0, 1, 23, 2, 29, 24, 19, 3, 30, 27, 25, 11, 20, 8, 4, 13,
  424. + 31, 22, 28, 18, 26, 10, 7, 12, 21, 17, 9, 6, 16, 5, 15, 14
  425. + };
  426. + return debruijn32[(x&-x)*0x076be629 >> 27];
  427. +}
  428. +
  429. +static inline int a_ctz_64(uint64_t x)
  430. +{
  431. + uint32_t y = x;
  432. + if (!y) {
  433. + y = x>>32;
  434. + return 32 + a_ctz_l(y);
  435. + }
  436. + return a_ctz_l(y);
  437. +}
  438. +
  439. +int __sh_cas(volatile int *, int, int);
  440. +int __sh_swap(volatile int *, int);
  441. +int __sh_fetch_add(volatile int *, int);
  442. +void __sh_store(volatile int *, int);
  443. +void __sh_and(volatile int *, int);
  444. +void __sh_or(volatile int *, int);
  445. +
  446. +#define a_cas(p,t,s) __sh_cas(p,t,s)
  447. +#define a_swap(x,v) __sh_swap(x,v)
  448. +#define a_fetch_add(x,v) __sh_fetch_add(x, v)
  449. +#define a_store(x,v) __sh_store(x, v)
  450. +#define a_and(x,v) __sh_and(x, v)
  451. +#define a_or(x,v) __sh_or(x, v)
  452. +
  453. +static inline void *a_cas_p(volatile void *p, void *t, void *s)
  454. +{
  455. + return (void *)a_cas(p, (int)t, (int)s);
  456. +}
  457. +
  458. +static inline long a_cas_l(volatile void *p, long t, long s)
  459. +{
  460. + return a_cas(p, t, s);
  461. +}
  462. +
  463. +static inline void a_inc(volatile int *x)
  464. +{
  465. + a_fetch_add(x, 1);
  466. +}
  467. +
  468. +static inline void a_dec(volatile int *x)
  469. +{
  470. + a_fetch_add(x, -1);
  471. +}
  472. +
  473. +static inline void a_spin()
  474. +{
  475. +}
  476. +
  477. +static inline void a_crash()
  478. +{
  479. + *(volatile char *)0=0;
  480. +}
  481. +
  482. +static inline void a_or_l(volatile void *p, long v)
  483. +{
  484. + a_or(p, v);
  485. +}
  486. +
  487. +static inline void a_and_64(volatile uint64_t *p, uint64_t v)
  488. +{
  489. + union { uint64_t v; uint32_t r[2]; } u = { v };
  490. + a_and((int *)p, u.r[0]);
  491. + a_and((int *)p+1, u.r[1]);
  492. +}
  493. +
  494. +static inline void a_or_64(volatile uint64_t *p, uint64_t v)
  495. +{
  496. + union { uint64_t v; uint32_t r[2]; } u = { v };
  497. + a_or((int *)p, u.r[0]);
  498. + a_or((int *)p+1, u.r[1]);
  499. +}
  500. +
  501. +#endif
  502. diff -Nur musl-0.9.15/arch/sh/bits/alltypes.h.in musl-git/arch/sh/bits/alltypes.h.in
  503. --- musl-0.9.15/arch/sh/bits/alltypes.h.in 1970-01-01 01:00:00.000000000 +0100
  504. +++ musl-git/arch/sh/bits/alltypes.h.in 2014-03-01 08:58:14.000000000 +0100
  505. @@ -0,0 +1,23 @@
  506. +#define _Addr int
  507. +#define _Int64 long long
  508. +#define _Reg int
  509. +
  510. +TYPEDEF __builtin_va_list va_list;
  511. +TYPEDEF __builtin_va_list __isoc_va_list;
  512. +
  513. +#ifndef __cplusplus
  514. +TYPEDEF long wchar_t;
  515. +#endif
  516. +TYPEDEF unsigned wint_t;
  517. +
  518. +TYPEDEF float float_t;
  519. +TYPEDEF double double_t;
  520. +
  521. +TYPEDEF long time_t;
  522. +TYPEDEF long suseconds_t;
  523. +
  524. +TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t;
  525. +TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
  526. +TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
  527. +TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
  528. +TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
  529. diff -Nur musl-0.9.15/arch/sh/bits/endian.h musl-git/arch/sh/bits/endian.h
  530. --- musl-0.9.15/arch/sh/bits/endian.h 1970-01-01 01:00:00.000000000 +0100
  531. +++ musl-git/arch/sh/bits/endian.h 2014-03-01 08:58:14.000000000 +0100
  532. @@ -0,0 +1,5 @@
  533. +#if __BIG_ENDIAN__
  534. +#define __BYTE_ORDER __BIG_ENDIAN
  535. +#else
  536. +#define __BYTE_ORDER __LITTLE_ENDIAN
  537. +#endif
  538. diff -Nur musl-0.9.15/arch/sh/bits/errno.h musl-git/arch/sh/bits/errno.h
  539. --- musl-0.9.15/arch/sh/bits/errno.h 1970-01-01 01:00:00.000000000 +0100
  540. +++ musl-git/arch/sh/bits/errno.h 2014-03-01 08:58:14.000000000 +0100
  541. @@ -0,0 +1,134 @@
  542. +#define EPERM 1
  543. +#define ENOENT 2
  544. +#define ESRCH 3
  545. +#define EINTR 4
  546. +#define EIO 5
  547. +#define ENXIO 6
  548. +#define E2BIG 7
  549. +#define ENOEXEC 8
  550. +#define EBADF 9
  551. +#define ECHILD 10
  552. +#define EAGAIN 11
  553. +#define ENOMEM 12
  554. +#define EACCES 13
  555. +#define EFAULT 14
  556. +#define ENOTBLK 15
  557. +#define EBUSY 16
  558. +#define EEXIST 17
  559. +#define EXDEV 18
  560. +#define ENODEV 19
  561. +#define ENOTDIR 20
  562. +#define EISDIR 21
  563. +#define EINVAL 22
  564. +#define ENFILE 23
  565. +#define EMFILE 24
  566. +#define ENOTTY 25
  567. +#define ETXTBSY 26
  568. +#define EFBIG 27
  569. +#define ENOSPC 28
  570. +#define ESPIPE 29
  571. +#define EROFS 30
  572. +#define EMLINK 31
  573. +#define EPIPE 32
  574. +#define EDOM 33
  575. +#define ERANGE 34
  576. +#define EDEADLK 35
  577. +#define ENAMETOOLONG 36
  578. +#define ENOLCK 37
  579. +#define ENOSYS 38
  580. +#define ENOTEMPTY 39
  581. +#define ELOOP 40
  582. +#define EWOULDBLOCK EAGAIN
  583. +#define ENOMSG 42
  584. +#define EIDRM 43
  585. +#define ECHRNG 44
  586. +#define EL2NSYNC 45
  587. +#define EL3HLT 46
  588. +#define EL3RST 47
  589. +#define ELNRNG 48
  590. +#define EUNATCH 49
  591. +#define ENOCSI 50
  592. +#define EL2HLT 51
  593. +#define EBADE 52
  594. +#define EBADR 53
  595. +#define EXFULL 54
  596. +#define ENOANO 55
  597. +#define EBADRQC 56
  598. +#define EBADSLT 57
  599. +#define EDEADLOCK EDEADLK
  600. +#define EBFONT 59
  601. +#define ENOSTR 60
  602. +#define ENODATA 61
  603. +#define ETIME 62
  604. +#define ENOSR 63
  605. +#define ENONET 64
  606. +#define ENOPKG 65
  607. +#define EREMOTE 66
  608. +#define ENOLINK 67
  609. +#define EADV 68
  610. +#define ESRMNT 69
  611. +#define ECOMM 70
  612. +#define EPROTO 71
  613. +#define EMULTIHOP 72
  614. +#define EDOTDOT 73
  615. +#define EBADMSG 74
  616. +#define EOVERFLOW 75
  617. +#define ENOTUNIQ 76
  618. +#define EBADFD 77
  619. +#define EREMCHG 78
  620. +#define ELIBACC 79
  621. +#define ELIBBAD 80
  622. +#define ELIBSCN 81
  623. +#define ELIBMAX 82
  624. +#define ELIBEXEC 83
  625. +#define EILSEQ 84
  626. +#define ERESTART 85
  627. +#define ESTRPIPE 86
  628. +#define EUSERS 87
  629. +#define ENOTSOCK 88
  630. +#define EDESTADDRREQ 89
  631. +#define EMSGSIZE 90
  632. +#define EPROTOTYPE 91
  633. +#define ENOPROTOOPT 92
  634. +#define EPROTONOSUPPORT 93
  635. +#define ESOCKTNOSUPPORT 94
  636. +#define EOPNOTSUPP 95
  637. +#define ENOTSUP EOPNOTSUPP
  638. +#define EPFNOSUPPORT 96
  639. +#define EAFNOSUPPORT 97
  640. +#define EADDRINUSE 98
  641. +#define EADDRNOTAVAIL 99
  642. +#define ENETDOWN 100
  643. +#define ENETUNREACH 101
  644. +#define ENETRESET 102
  645. +#define ECONNABORTED 103
  646. +#define ECONNRESET 104
  647. +#define ENOBUFS 105
  648. +#define EISCONN 106
  649. +#define ENOTCONN 107
  650. +#define ESHUTDOWN 108
  651. +#define ETOOMANYREFS 109
  652. +#define ETIMEDOUT 110
  653. +#define ECONNREFUSED 111
  654. +#define EHOSTDOWN 112
  655. +#define EHOSTUNREACH 113
  656. +#define EALREADY 114
  657. +#define EINPROGRESS 115
  658. +#define ESTALE 116
  659. +#define EUCLEAN 117
  660. +#define ENOTNAM 118
  661. +#define ENAVAIL 119
  662. +#define EISNAM 120
  663. +#define EREMOTEIO 121
  664. +#define EDQUOT 122
  665. +#define ENOMEDIUM 123
  666. +#define EMEDIUMTYPE 124
  667. +#define ECANCELED 125
  668. +#define ENOKEY 126
  669. +#define EKEYEXPIRED 127
  670. +#define EKEYREVOKED 128
  671. +#define EKEYREJECTED 129
  672. +#define EOWNERDEAD 130
  673. +#define ENOTRECOVERABLE 131
  674. +#define ERFKILL 132
  675. +#define EHWPOISON 133
  676. diff -Nur musl-0.9.15/arch/sh/bits/fcntl.h musl-git/arch/sh/bits/fcntl.h
  677. --- musl-0.9.15/arch/sh/bits/fcntl.h 1970-01-01 01:00:00.000000000 +0100
  678. +++ musl-git/arch/sh/bits/fcntl.h 2014-03-01 08:58:14.000000000 +0100
  679. @@ -0,0 +1,39 @@
  680. +#define O_CREAT 0100
  681. +#define O_EXCL 0200
  682. +#define O_NOCTTY 0400
  683. +#define O_TRUNC 01000
  684. +#define O_APPEND 02000
  685. +#define O_NONBLOCK 04000
  686. +#define O_DSYNC 010000
  687. +#define O_SYNC 04010000
  688. +#define O_RSYNC 04010000
  689. +#define O_DIRECTORY 0200000
  690. +#define O_NOFOLLOW 0400000
  691. +#define O_CLOEXEC 02000000
  692. +
  693. +#define O_ASYNC 020000
  694. +#define O_DIRECT 040000
  695. +#define O_LARGEFILE 0100000
  696. +#define O_NOATIME 01000000
  697. +#define O_TMPFILE 020200000
  698. +#define O_NDELAY O_NONBLOCK
  699. +
  700. +#define F_DUPFD 0
  701. +#define F_GETFD 1
  702. +#define F_SETFD 2
  703. +#define F_GETFL 3
  704. +#define F_SETFL 4
  705. +
  706. +#define F_SETOWN 8
  707. +#define F_GETOWN 9
  708. +#define F_SETSIG 10
  709. +#define F_GETSIG 11
  710. +
  711. +#define F_GETLK 12
  712. +#define F_SETLK 13
  713. +#define F_SETLKW 14
  714. +
  715. +#define F_SETOWN_EX 15
  716. +#define F_GETOWN_EX 16
  717. +
  718. +#define F_GETOWNER_UIDS 17
  719. diff -Nur musl-0.9.15/arch/sh/bits/fenv.h musl-git/arch/sh/bits/fenv.h
  720. --- musl-0.9.15/arch/sh/bits/fenv.h 1970-01-01 01:00:00.000000000 +0100
  721. +++ musl-git/arch/sh/bits/fenv.h 2014-03-01 08:58:14.000000000 +0100
  722. @@ -0,0 +1,26 @@
  723. +#ifndef __SH_FPU_ANY__
  724. +
  725. +#define FE_ALL_EXCEPT 0
  726. +#define FE_TONEAREST 0
  727. +
  728. +#else
  729. +
  730. +#define FE_TONEAREST 0
  731. +#define FE_TOWARDZERO 1
  732. +
  733. +#define FE_INEXACT 0x04
  734. +#define FE_UNDERFLOW 0x08
  735. +#define FE_OVERFLOW 0x10
  736. +#define FE_DIVBYZERO 0x20
  737. +#define FE_INVALID 0x40
  738. +#define FE_ALL_EXCEPT 0x7c
  739. +
  740. +#endif
  741. +
  742. +typedef unsigned long fexcept_t;
  743. +
  744. +typedef struct {
  745. + unsigned long __cw;
  746. +} fenv_t;
  747. +
  748. +#define FE_DFL_ENV ((const fenv_t *) -1)
  749. diff -Nur musl-0.9.15/arch/sh/bits/float.h musl-git/arch/sh/bits/float.h
  750. --- musl-0.9.15/arch/sh/bits/float.h 1970-01-01 01:00:00.000000000 +0100
  751. +++ musl-git/arch/sh/bits/float.h 2014-03-01 08:58:14.000000000 +0100
  752. @@ -0,0 +1,17 @@
  753. +#define FLT_ROUNDS 1
  754. +#define FLT_EVAL_METHOD 0
  755. +
  756. +#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
  757. +#define LDBL_MIN 2.22507385850720138309e-308L
  758. +#define LDBL_MAX 1.79769313486231570815e+308L
  759. +#define LDBL_EPSILON 2.22044604925031308085e-16L
  760. +
  761. +#define LDBL_MANT_DIG 53
  762. +#define LDBL_MIN_EXP (-1021)
  763. +#define LDBL_MAX_EXP 1024
  764. +
  765. +#define LDBL_DIG 15
  766. +#define LDBL_MIN_10_EXP (-307)
  767. +#define LDBL_MAX_10_EXP 308
  768. +
  769. +#define DECIMAL_DIG 17
  770. diff -Nur musl-0.9.15/arch/sh/bits/ioctl.h musl-git/arch/sh/bits/ioctl.h
  771. --- musl-0.9.15/arch/sh/bits/ioctl.h 1970-01-01 01:00:00.000000000 +0100
  772. +++ musl-git/arch/sh/bits/ioctl.h 2014-03-01 08:58:14.000000000 +0100
  773. @@ -0,0 +1,205 @@
  774. +#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
  775. +#define _IOC_NONE 0U
  776. +#define _IOC_WRITE 1U
  777. +#define _IOC_READ 2U
  778. +
  779. +#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
  780. +#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
  781. +#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
  782. +#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
  783. +
  784. +#define FIOCLEX _IO('f', 1)
  785. +#define FIONCLEX _IO('f', 2)
  786. +#define FIOASYNC _IOW('f', 125, int)
  787. +#define FIONBIO _IOW('f', 126, int)
  788. +#define FIONREAD _IOR('f', 127, int)
  789. +#define TIOCINQ FIONREAD
  790. +#define FIOQSIZE _IOR('f', 128, char[8])
  791. +
  792. +#define TCGETA _IOR('t', 23, char[18])
  793. +#define TCSETA _IOW('t', 24, char[18])
  794. +#define TCSETAW _IOW('t', 25, char[18])
  795. +#define TCSETAF _IOW('t', 28, char[18])
  796. +
  797. +#define TCSBRK _IO('t', 29)
  798. +#define TCXONC _IO('t', 30)
  799. +#define TCFLSH _IO('t', 31)
  800. +
  801. +#define TIOCSWINSZ _IOW('t', 103, char[8])
  802. +#define TIOCGWINSZ _IOR('t', 104, char[8])
  803. +#define TIOCSTART _IO('t', 110)
  804. +#define TIOCSTOP _IO('t', 111)
  805. +#define TIOCOUTQ _IOR('t', 115, int)
  806. +
  807. +#define TIOCSPGRP _IOW('t', 118, int)
  808. +#define TIOCGPGRP _IOR('t', 119, int)
  809. +
  810. +#define TIOCEXCL _IO('T', 12)
  811. +#define TIOCNXCL _IO('T', 13)
  812. +#define TIOCSCTTY _IO('T', 14)
  813. +
  814. +#define TIOCSTI _IOW('T', 18, char)
  815. +#define TIOCMGET _IOR('T', 21, unsigned int)
  816. +#define TIOCMBIS _IOW('T', 22, unsigned int)
  817. +#define TIOCMBIC _IOW('T', 23, unsigned int)
  818. +#define TIOCMSET _IOW('T', 24, unsigned int)
  819. +#define TIOCM_LE 0x001
  820. +#define TIOCM_DTR 0x002
  821. +#define TIOCM_RTS 0x004
  822. +#define TIOCM_ST 0x008
  823. +#define TIOCM_SR 0x010
  824. +#define TIOCM_CTS 0x020
  825. +#define TIOCM_CAR 0x040
  826. +#define TIOCM_RNG 0x080
  827. +#define TIOCM_DSR 0x100
  828. +#define TIOCM_CD TIOCM_CAR
  829. +#define TIOCM_RI TIOCM_RNG
  830. +#define TIOCM_OUT1 0x2000
  831. +#define TIOCM_OUT2 0x4000
  832. +#define TIOCM_LOOP 0x8000
  833. +
  834. +#define TIOCGSOFTCAR _IOR('T', 25, unsigned int)
  835. +#define TIOCSSOFTCAR _IOW('T', 26, unsigned int)
  836. +#define TIOCLINUX _IOW('T', 28, char)
  837. +#define TIOCCONS _IO('T', 29)
  838. +#define TIOCGSERIAL _IOR('T', 30, char[60])
  839. +#define TIOCSSERIAL _IOW('T', 31, char[60])
  840. +#define TIOCPKT _IOW('T', 32, int)
  841. +#define TIOCPKT_DATA 0
  842. +#define TIOCPKT_FLUSHREAD 1
  843. +#define TIOCPKT_FLUSHWRITE 2
  844. +#define TIOCPKT_STOP 4
  845. +#define TIOCPKT_START 8
  846. +#define TIOCPKT_NOSTOP 16
  847. +#define TIOCPKT_DOSTOP 32
  848. +#define TIOCPKT_IOCTL 64
  849. +
  850. +#define TIOCNOTTY _IO('T', 34)
  851. +#define TIOCSETD _IOW('T', 35, int)
  852. +#define TIOCGETD _IOR('T', 36, int)
  853. +#define TCSBRKP _IOW('T', 37, int)
  854. +#define TIOCSBRK _IO('T', 39)
  855. +#define TIOCCBRK _IO('T', 40)
  856. +#define TIOCGSID _IOR('T', 41, int)
  857. +#define TCGETS _IOR('T', 42, char[44])
  858. +#define TCSETS _IOW('T', 43, char[44])
  859. +#define TCSETSW _IOW('T', 44, char[44])
  860. +#define TCSETSF _IOW('T', 45, char[44])
  861. +#define TIOCGPTN _IOR('T', 48, unsigned int)
  862. +#define TIOCSPTLCK _IOW('T', 49, int)
  863. +#define TIOCGDEV _IOR('T', 50, unsigned int)
  864. +#define TIOCSIG _IOW('T', 54, int)
  865. +#define TIOCVHANGUP _IO('T', 55)
  866. +#define TIOCGPKT _IOR('T', 56, int)
  867. +#define TIOCGPTLCK _IOR('T', 57, int)
  868. +#define TIOCGEXCL _IOR('T', 64, int)
  869. +
  870. +#define TIOCSERCONFIG _IO('T', 83)
  871. +#define TIOCSERGWILD _IOR('T', 84, int)
  872. +#define TIOCSERSWILD _IOW('T', 85, int)
  873. +#define TIOCGLCKTRMIOS _IO('T', 86)
  874. +#define TIOCSLCKTRMIOS _IO('T', 87)
  875. +#define TIOCSERGSTRUCT _IOR('T', 88, char[216])
  876. +#define TIOCSERGETLSR _IOR('T', 89, unsigned int)
  877. +#define TIOCSER_TEMT 0x01
  878. +#define TIOCSERGETMULTI _IOR('T', 90, char[168])
  879. +#define TIOCSERSETMULTI _IOW('T', 91, char[168])
  880. +
  881. +#define TIOCMIWAIT _IO('T', 92)
  882. +#define TIOCGICOUNT _IO('T', 93)
  883. +
  884. +struct winsize {
  885. + unsigned short ws_row;
  886. + unsigned short ws_col;
  887. + unsigned short ws_xpixel;
  888. + unsigned short ws_ypixel;
  889. +};
  890. +
  891. +#define TIOCM_MODEM_BITS TIOCM_OUT2
  892. +
  893. +#define N_TTY 0
  894. +#define N_SLIP 1
  895. +#define N_MOUSE 2
  896. +#define N_PPP 3
  897. +#define N_STRIP 4
  898. +#define N_AX25 5
  899. +#define N_X25 6
  900. +#define N_6PACK 7
  901. +#define N_MASC 8
  902. +#define N_R3964 9
  903. +#define N_PROFIBUS_FDL 10
  904. +#define N_IRDA 11
  905. +#define N_SMSBLOCK 12
  906. +#define N_HDLC 13
  907. +#define N_SYNC_PPP 14
  908. +#define N_HCI 15
  909. +
  910. +#define FIOGETOWN _IOR('f', 123, int)
  911. +#define FIOSETOWN _IOW('f', 124, int)
  912. +
  913. +#define SIOCATMARK _IOR('s', 7, int)
  914. +#define SIOCSPGRP _IOW('s', 8, int)
  915. +#define SIOCGPGRP _IOW('s', 9, int)
  916. +#define SIOCGSTAMP _IOR('s', 100, char[8])
  917. +
  918. +#define SIOCADDRT 0x890B
  919. +#define SIOCDELRT 0x890C
  920. +#define SIOCRTMSG 0x890D
  921. +
  922. +#define SIOCGIFNAME 0x8910
  923. +#define SIOCSIFLINK 0x8911
  924. +#define SIOCGIFCONF 0x8912
  925. +#define SIOCGIFFLAGS 0x8913
  926. +#define SIOCSIFFLAGS 0x8914
  927. +#define SIOCGIFADDR 0x8915
  928. +#define SIOCSIFADDR 0x8916
  929. +#define SIOCGIFDSTADDR 0x8917
  930. +#define SIOCSIFDSTADDR 0x8918
  931. +#define SIOCGIFBRDADDR 0x8919
  932. +#define SIOCSIFBRDADDR 0x891a
  933. +#define SIOCGIFNETMASK 0x891b
  934. +#define SIOCSIFNETMASK 0x891c
  935. +#define SIOCGIFMETRIC 0x891d
  936. +#define SIOCSIFMETRIC 0x891e
  937. +#define SIOCGIFMEM 0x891f
  938. +#define SIOCSIFMEM 0x8920
  939. +#define SIOCGIFMTU 0x8921
  940. +#define SIOCSIFMTU 0x8922
  941. +#define SIOCSIFHWADDR 0x8924
  942. +#define SIOCGIFENCAP 0x8925
  943. +#define SIOCSIFENCAP 0x8926
  944. +#define SIOCGIFHWADDR 0x8927
  945. +#define SIOCGIFSLAVE 0x8929
  946. +#define SIOCSIFSLAVE 0x8930
  947. +#define SIOCADDMULTI 0x8931
  948. +#define SIOCDELMULTI 0x8932
  949. +#define SIOCGIFINDEX 0x8933
  950. +#define SIOGIFINDEX SIOCGIFINDEX
  951. +#define SIOCSIFPFLAGS 0x8934
  952. +#define SIOCGIFPFLAGS 0x8935
  953. +#define SIOCDIFADDR 0x8936
  954. +#define SIOCSIFHWBROADCAST 0x8937
  955. +#define SIOCGIFCOUNT 0x8938
  956. +
  957. +#define SIOCGIFBR 0x8940
  958. +#define SIOCSIFBR 0x8941
  959. +
  960. +#define SIOCGIFTXQLEN 0x8942
  961. +#define SIOCSIFTXQLEN 0x8943
  962. +
  963. +#define SIOCDARP 0x8953
  964. +#define SIOCGARP 0x8954
  965. +#define SIOCSARP 0x8955
  966. +
  967. +#define SIOCDRARP 0x8960
  968. +#define SIOCGRARP 0x8961
  969. +#define SIOCSRARP 0x8962
  970. +
  971. +#define SIOCGIFMAP 0x8970
  972. +#define SIOCSIFMAP 0x8971
  973. +
  974. +#define SIOCADDDLCI 0x8980
  975. +#define SIOCDELDLCI 0x8981
  976. +
  977. +#define SIOCDEVPRIVATE 0x89F0
  978. +#define SIOCPROTOPRIVATE 0x89E0
  979. diff -Nur musl-0.9.15/arch/sh/bits/ipc.h musl-git/arch/sh/bits/ipc.h
  980. --- musl-0.9.15/arch/sh/bits/ipc.h 1970-01-01 01:00:00.000000000 +0100
  981. +++ musl-git/arch/sh/bits/ipc.h 2014-03-01 08:58:14.000000000 +0100
  982. @@ -0,0 +1,14 @@
  983. +struct ipc_perm
  984. +{
  985. + key_t __ipc_perm_key;
  986. + uid_t uid;
  987. + gid_t gid;
  988. + uid_t cuid;
  989. + gid_t cgid;
  990. + mode_t mode;
  991. + int __ipc_perm_seq;
  992. + long __pad1;
  993. + long __pad2;
  994. +};
  995. +
  996. +#define IPC_64 0x100
  997. diff -Nur musl-0.9.15/arch/sh/bits/limits.h musl-git/arch/sh/bits/limits.h
  998. --- musl-0.9.15/arch/sh/bits/limits.h 1970-01-01 01:00:00.000000000 +0100
  999. +++ musl-git/arch/sh/bits/limits.h 2014-03-01 08:58:14.000000000 +0100
  1000. @@ -0,0 +1,8 @@
  1001. +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  1002. + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  1003. +#define PAGE_SIZE 4096
  1004. +#define LONG_BIT 32
  1005. +#endif
  1006. +
  1007. +#define LONG_MAX 0x7fffffffL
  1008. +#define LLONG_MAX 0x7fffffffffffffffLL
  1009. diff -Nur musl-0.9.15/arch/sh/bits/mman.h musl-git/arch/sh/bits/mman.h
  1010. --- musl-0.9.15/arch/sh/bits/mman.h 1970-01-01 01:00:00.000000000 +0100
  1011. +++ musl-git/arch/sh/bits/mman.h 2014-03-01 08:58:14.000000000 +0100
  1012. @@ -0,0 +1,62 @@
  1013. +#define MAP_FAILED ((void *) -1)
  1014. +
  1015. +#define PROT_NONE 0
  1016. +#define PROT_READ 1
  1017. +#define PROT_WRITE 2
  1018. +#define PROT_EXEC 4
  1019. +#define PROT_GROWSDOWN 0x01000000
  1020. +#define PROT_GROWSUP 0x02000000
  1021. +
  1022. +#define MAP_SHARED 0x01
  1023. +#define MAP_PRIVATE 0x02
  1024. +#define MAP_FIXED 0x10
  1025. +
  1026. +#define MAP_TYPE 0x0f
  1027. +#define MAP_FILE 0x00
  1028. +#define MAP_ANON 0x20
  1029. +#define MAP_ANONYMOUS MAP_ANON
  1030. +#define MAP_32BIT 0x40
  1031. +#define MAP_NORESERVE 0x4000
  1032. +#define MAP_GROWSDOWN 0x0100
  1033. +#define MAP_DENYWRITE 0x0800
  1034. +#define MAP_EXECUTABLE 0x1000
  1035. +#define MAP_LOCKED 0x2000
  1036. +#define MAP_POPULATE 0x8000
  1037. +#define MAP_NONBLOCK 0x10000
  1038. +#define MAP_STACK 0x20000
  1039. +#define MAP_HUGETLB 0x40000
  1040. +
  1041. +#define POSIX_MADV_NORMAL 0
  1042. +#define POSIX_MADV_RANDOM 1
  1043. +#define POSIX_MADV_SEQUENTIAL 2
  1044. +#define POSIX_MADV_WILLNEED 3
  1045. +#define POSIX_MADV_DONTNEED 4
  1046. +
  1047. +#define MS_ASYNC 1
  1048. +#define MS_INVALIDATE 2
  1049. +#define MS_SYNC 4
  1050. +
  1051. +#define MCL_CURRENT 1
  1052. +#define MCL_FUTURE 2
  1053. +
  1054. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  1055. +#define MADV_NORMAL 0
  1056. +#define MADV_RANDOM 1
  1057. +#define MADV_SEQUENTIAL 2
  1058. +#define MADV_WILLNEED 3
  1059. +#define MADV_DONTNEED 4
  1060. +#define MADV_REMOVE 9
  1061. +#define MADV_DONTFORK 10
  1062. +#define MADV_DOFORK 11
  1063. +#define MADV_MERGEABLE 12
  1064. +#define MADV_UNMERGEABLE 13
  1065. +#define MADV_HUGEPAGE 14
  1066. +#define MADV_NOHUGEPAGE 15
  1067. +#define MADV_DONTDUMP 16
  1068. +#define MADV_DODUMP 17
  1069. +#define MADV_HWPOISON 100
  1070. +#define MADV_SOFT_OFFLINE 101
  1071. +
  1072. +#define MREMAP_MAYMOVE 1
  1073. +#define MREMAP_FIXED 2
  1074. +#endif
  1075. diff -Nur musl-0.9.15/arch/sh/bits/msg.h musl-git/arch/sh/bits/msg.h
  1076. --- musl-0.9.15/arch/sh/bits/msg.h 1970-01-01 01:00:00.000000000 +0100
  1077. +++ musl-git/arch/sh/bits/msg.h 2014-03-01 08:58:14.000000000 +0100
  1078. @@ -0,0 +1,16 @@
  1079. +struct msqid_ds
  1080. +{
  1081. + struct ipc_perm msg_perm;
  1082. + time_t msg_stime;
  1083. + int __unused1;
  1084. + time_t msg_rtime;
  1085. + int __unused2;
  1086. + time_t msg_ctime;
  1087. + int __unused3;
  1088. + unsigned long msg_cbytes;
  1089. + msgqnum_t msg_qnum;
  1090. + msglen_t msg_qbytes;
  1091. + pid_t msg_lspid;
  1092. + pid_t msg_lrpid;
  1093. + unsigned long __unused[2];
  1094. +};
  1095. diff -Nur musl-0.9.15/arch/sh/bits/posix.h musl-git/arch/sh/bits/posix.h
  1096. --- musl-0.9.15/arch/sh/bits/posix.h 1970-01-01 01:00:00.000000000 +0100
  1097. +++ musl-git/arch/sh/bits/posix.h 2014-03-01 08:58:14.000000000 +0100
  1098. @@ -0,0 +1,2 @@
  1099. +#define _POSIX_V6_ILP32_OFFBIG 1
  1100. +#define _POSIX_V7_ILP32_OFFBIG 1
  1101. diff -Nur musl-0.9.15/arch/sh/bits/setjmp.h musl-git/arch/sh/bits/setjmp.h
  1102. --- musl-0.9.15/arch/sh/bits/setjmp.h 1970-01-01 01:00:00.000000000 +0100
  1103. +++ musl-git/arch/sh/bits/setjmp.h 2014-03-01 08:58:14.000000000 +0100
  1104. @@ -0,0 +1 @@
  1105. +typedef unsigned long __jmp_buf[13];
  1106. diff -Nur musl-0.9.15/arch/sh/bits/shm.h musl-git/arch/sh/bits/shm.h
  1107. --- musl-0.9.15/arch/sh/bits/shm.h 1970-01-01 01:00:00.000000000 +0100
  1108. +++ musl-git/arch/sh/bits/shm.h 2014-03-01 08:58:14.000000000 +0100
  1109. @@ -0,0 +1,28 @@
  1110. +#define SHMLBA 16384
  1111. +
  1112. +struct shmid_ds
  1113. +{
  1114. + struct ipc_perm shm_perm;
  1115. + size_t shm_segsz;
  1116. + time_t shm_atime;
  1117. + int __unused1;
  1118. + time_t shm_dtime;
  1119. + int __unused2;
  1120. + time_t shm_ctime;
  1121. + int __unused3;
  1122. + pid_t shm_cpid;
  1123. + pid_t shm_lpid;
  1124. + unsigned long shm_nattch;
  1125. + unsigned long __pad1;
  1126. + unsigned long __pad2;
  1127. +};
  1128. +
  1129. +struct shminfo {
  1130. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  1131. +};
  1132. +
  1133. +struct shm_info {
  1134. + int __used_ids;
  1135. + unsigned long shm_tot, shm_rss, shm_swp;
  1136. + unsigned long __swap_attempts, __swap_successes;
  1137. +};
  1138. diff -Nur musl-0.9.15/arch/sh/bits/signal.h musl-git/arch/sh/bits/signal.h
  1139. --- musl-0.9.15/arch/sh/bits/signal.h 1970-01-01 01:00:00.000000000 +0100
  1140. +++ musl-git/arch/sh/bits/signal.h 2014-03-01 08:58:14.000000000 +0100
  1141. @@ -0,0 +1,76 @@
  1142. +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  1143. + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  1144. +
  1145. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  1146. +typedef int greg_t, gregset_t[16];
  1147. +typedef int freg_t, fpregset_t[16];
  1148. +typedef struct sigcontext {
  1149. + unsigned long oldmask;
  1150. + unsigned long sc_regs[16];
  1151. + unsigned long sc_pc, sc_pr, sc_sr;
  1152. + unsigned long sc_gbr, sc_mach, sc_macl;
  1153. + unsigned long sc_fpregs[16];
  1154. + unsigned long sc_xfpregs[16];
  1155. + unsigned int sc_fpscr, sc_fpul, sc_ownedfp;
  1156. +} mcontext_t;
  1157. +#else
  1158. +typedef struct {
  1159. + unsigned long __regs[58];
  1160. +} mcontext_t;
  1161. +#endif
  1162. +
  1163. +typedef struct __ucontext {
  1164. + unsigned long uc_flags;
  1165. + struct __ucontext *uc_link;
  1166. + stack_t uc_stack;
  1167. + mcontext_t uc_mcontext;
  1168. + sigset_t uc_sigmask;
  1169. +} ucontext_t;
  1170. +
  1171. +#define SA_NOCLDSTOP 1
  1172. +#define SA_NOCLDWAIT 2
  1173. +#define SA_SIGINFO 4
  1174. +#define SA_ONSTACK 0x08000000
  1175. +#define SA_RESTART 0x10000000
  1176. +#define SA_NODEFER 0x40000000
  1177. +#define SA_RESETHAND 0x80000000
  1178. +#define SA_RESTORER 0x04000000
  1179. +
  1180. +#endif
  1181. +
  1182. +#define SIGHUP 1
  1183. +#define SIGINT 2
  1184. +#define SIGQUIT 3
  1185. +#define SIGILL 4
  1186. +#define SIGTRAP 5
  1187. +#define SIGABRT 6
  1188. +#define SIGIOT SIGABRT
  1189. +#define SIGBUS 7
  1190. +#define SIGFPE 8
  1191. +#define SIGKILL 9
  1192. +#define SIGUSR1 10
  1193. +#define SIGSEGV 11
  1194. +#define SIGUSR2 12
  1195. +#define SIGPIPE 13
  1196. +#define SIGALRM 14
  1197. +#define SIGTERM 15
  1198. +#define SIGSTKFLT 16
  1199. +#define SIGCHLD 17
  1200. +#define SIGCONT 18
  1201. +#define SIGSTOP 19
  1202. +#define SIGTSTP 20
  1203. +#define SIGTTIN 21
  1204. +#define SIGTTOU 22
  1205. +#define SIGURG 23
  1206. +#define SIGXCPU 24
  1207. +#define SIGXFSZ 25
  1208. +#define SIGVTALRM 26
  1209. +#define SIGPROF 27
  1210. +#define SIGWINCH 28
  1211. +#define SIGIO 29
  1212. +#define SIGPOLL 29
  1213. +#define SIGPWR 30
  1214. +#define SIGSYS 31
  1215. +#define SIGUNUSED SIGSYS
  1216. +
  1217. +#define _NSIG 65
  1218. diff -Nur musl-0.9.15/arch/sh/bits/socket.h musl-git/arch/sh/bits/socket.h
  1219. --- musl-0.9.15/arch/sh/bits/socket.h 1970-01-01 01:00:00.000000000 +0100
  1220. +++ musl-git/arch/sh/bits/socket.h 2014-03-01 08:58:14.000000000 +0100
  1221. @@ -0,0 +1,17 @@
  1222. +struct msghdr
  1223. +{
  1224. + void *msg_name;
  1225. + socklen_t msg_namelen;
  1226. + struct iovec *msg_iov;
  1227. + int msg_iovlen;
  1228. + void *msg_control;
  1229. + socklen_t msg_controllen;
  1230. + int msg_flags;
  1231. +};
  1232. +
  1233. +struct cmsghdr
  1234. +{
  1235. + socklen_t cmsg_len;
  1236. + int cmsg_level;
  1237. + int cmsg_type;
  1238. +};
  1239. diff -Nur musl-0.9.15/arch/sh/bits/statfs.h musl-git/arch/sh/bits/statfs.h
  1240. --- musl-0.9.15/arch/sh/bits/statfs.h 1970-01-01 01:00:00.000000000 +0100
  1241. +++ musl-git/arch/sh/bits/statfs.h 2014-03-01 08:58:14.000000000 +0100
  1242. @@ -0,0 +1,7 @@
  1243. +struct statfs {
  1244. + unsigned long f_type, f_bsize;
  1245. + fsblkcnt_t f_blocks, f_bfree, f_bavail;
  1246. + fsfilcnt_t f_files, f_ffree;
  1247. + fsid_t f_fsid;
  1248. + unsigned long f_namelen, f_frsize, f_flags, f_spare[4];
  1249. +};
  1250. diff -Nur musl-0.9.15/arch/sh/bits/stat.h musl-git/arch/sh/bits/stat.h
  1251. --- musl-0.9.15/arch/sh/bits/stat.h 1970-01-01 01:00:00.000000000 +0100
  1252. +++ musl-git/arch/sh/bits/stat.h 2014-03-01 08:58:14.000000000 +0100
  1253. @@ -0,0 +1,22 @@
  1254. +/* copied from kernel definition, but with padding replaced
  1255. + * by the corresponding correctly-sized userspace types. */
  1256. +
  1257. +struct stat
  1258. +{
  1259. + dev_t st_dev;
  1260. + int __st_dev_padding;
  1261. + long __st_ino_truncated;
  1262. + mode_t st_mode;
  1263. + nlink_t st_nlink;
  1264. + uid_t st_uid;
  1265. + gid_t st_gid;
  1266. + dev_t st_rdev;
  1267. + int __st_rdev_padding;
  1268. + off_t st_size;
  1269. + blksize_t st_blksize;
  1270. + blkcnt_t st_blocks;
  1271. + struct timespec st_atim;
  1272. + struct timespec st_mtim;
  1273. + struct timespec st_ctim;
  1274. + ino_t st_ino;
  1275. +};
  1276. diff -Nur musl-0.9.15/arch/sh/bits/stdarg.h musl-git/arch/sh/bits/stdarg.h
  1277. --- musl-0.9.15/arch/sh/bits/stdarg.h 1970-01-01 01:00:00.000000000 +0100
  1278. +++ musl-git/arch/sh/bits/stdarg.h 2014-03-01 08:58:14.000000000 +0100
  1279. @@ -0,0 +1,4 @@
  1280. +#define va_start(v,l) __builtin_va_start(v,l)
  1281. +#define va_end(v) __builtin_va_end(v)
  1282. +#define va_arg(v,l) __builtin_va_arg(v,l)
  1283. +#define va_copy(d,s) __builtin_va_copy(d,s)
  1284. diff -Nur musl-0.9.15/arch/sh/bits/stdint.h musl-git/arch/sh/bits/stdint.h
  1285. --- musl-0.9.15/arch/sh/bits/stdint.h 1970-01-01 01:00:00.000000000 +0100
  1286. +++ musl-git/arch/sh/bits/stdint.h 2014-03-01 08:58:14.000000000 +0100
  1287. @@ -0,0 +1,20 @@
  1288. +typedef int32_t int_fast16_t;
  1289. +typedef int32_t int_fast32_t;
  1290. +typedef uint32_t uint_fast16_t;
  1291. +typedef uint32_t uint_fast32_t;
  1292. +
  1293. +#define INT_FAST16_MIN INT32_MIN
  1294. +#define INT_FAST32_MIN INT32_MIN
  1295. +
  1296. +#define INT_FAST16_MAX INT32_MAX
  1297. +#define INT_FAST32_MAX INT32_MAX
  1298. +
  1299. +#define UINT_FAST16_MAX UINT32_MAX
  1300. +#define UINT_FAST32_MAX UINT32_MAX
  1301. +
  1302. +#define INTPTR_MIN INT32_MIN
  1303. +#define INTPTR_MAX INT32_MAX
  1304. +#define UINTPTR_MAX UINT32_MAX
  1305. +#define PTRDIFF_MIN INT32_MIN
  1306. +#define PTRDIFF_MAX INT32_MAX
  1307. +#define SIZE_MAX UINT32_MAX
  1308. diff -Nur musl-0.9.15/arch/sh/bits/syscall.h musl-git/arch/sh/bits/syscall.h
  1309. --- musl-0.9.15/arch/sh/bits/syscall.h 1970-01-01 01:00:00.000000000 +0100
  1310. +++ musl-git/arch/sh/bits/syscall.h 2014-03-01 08:58:14.000000000 +0100
  1311. @@ -0,0 +1,684 @@
  1312. +#define __NR_restart_syscall 0
  1313. +#define __NR_exit 1
  1314. +#define __NR_fork 2
  1315. +#define __NR_read 3
  1316. +#define __NR_write 4
  1317. +#define __NR_open 5
  1318. +#define __NR_close 6
  1319. +#define __NR_waitpid 7
  1320. +#define __NR_creat 8
  1321. +#define __NR_link 9
  1322. +#define __NR_unlink 10
  1323. +#define __NR_execve 11
  1324. +#define __NR_chdir 12
  1325. +#define __NR_time 13
  1326. +#define __NR_mknod 14
  1327. +#define __NR_chmod 15
  1328. +#define __NR_lchown 16
  1329. +#define __NR_oldstat 18
  1330. +#define __NR_lseek 19
  1331. +#define __NR_getpid 20
  1332. +#define __NR_mount 21
  1333. +#define __NR_umount 22
  1334. +#define __NR_setuid 23
  1335. +#define __NR_getuid 24
  1336. +#define __NR_stime 25
  1337. +#define __NR_ptrace 26
  1338. +#define __NR_alarm 27
  1339. +#define __NR_oldfstat 28
  1340. +#define __NR_pause 29
  1341. +#define __NR_utime 30
  1342. +#define __NR_access 33
  1343. +#define __NR_nice 34
  1344. +#define __NR_sync 36
  1345. +#define __NR_kill 37
  1346. +#define __NR_rename 38
  1347. +#define __NR_mkdir 39
  1348. +#define __NR_rmdir 40
  1349. +#define __NR_dup 41
  1350. +#define __NR_pipe 42
  1351. +#define __NR_times 43
  1352. +#define __NR_brk 45
  1353. +#define __NR_setgid 46
  1354. +#define __NR_getgid 47
  1355. +#define __NR_signal 48
  1356. +#define __NR_geteuid 49
  1357. +#define __NR_getegid 50
  1358. +#define __NR_acct 51
  1359. +#define __NR_umount2 52
  1360. +#define __NR_ioctl 54
  1361. +#define __NR_fcntl 55
  1362. +#define __NR_setpgid 57
  1363. +#define __NR_umask 60
  1364. +#define __NR_chroot 61
  1365. +#define __NR_ustat 62
  1366. +#define __NR_dup2 63
  1367. +#define __NR_getppid 64
  1368. +#define __NR_getpgrp 65
  1369. +#define __NR_setsid 66
  1370. +#define __NR_sigaction 67
  1371. +#define __NR_sgetmask 68
  1372. +#define __NR_ssetmask 69
  1373. +#define __NR_setreuid 70
  1374. +#define __NR_setregid 71
  1375. +#define __NR_sigsuspend 72
  1376. +#define __NR_sigpending 73
  1377. +#define __NR_sethostname 74
  1378. +#define __NR_setrlimit 75
  1379. +#define __NR_getrlimit 76
  1380. +#define __NR_getrusage 77
  1381. +#define __NR_gettimeofday 78
  1382. +#define __NR_settimeofday 79
  1383. +#define __NR_getgroups 80
  1384. +#define __NR_setgroups 81
  1385. +#define __NR_symlink 83
  1386. +#define __NR_oldlstat 84
  1387. +#define __NR_readlink 85
  1388. +#define __NR_uselib 86
  1389. +#define __NR_swapon 87
  1390. +#define __NR_reboot 88
  1391. +#define __NR_readdir 89
  1392. +#define __NR_mmap 90
  1393. +#define __NR_munmap 91
  1394. +#define __NR_truncate 92
  1395. +#define __NR_ftruncate 93
  1396. +#define __NR_fchmod 94
  1397. +#define __NR_fchown 95
  1398. +#define __NR_getpriority 96
  1399. +#define __NR_setpriority 97
  1400. +#define __NR_statfs 99
  1401. +#define __NR_fstatfs 100
  1402. +#define __NR_socketcall 102
  1403. +#define __NR_syslog 103
  1404. +#define __NR_setitimer 104
  1405. +#define __NR_getitimer 105
  1406. +#define __NR_stat 106
  1407. +#define __NR_lstat 107
  1408. +#define __NR_fstat 108
  1409. +#define __NR_olduname 109
  1410. +#define __NR_vhangup 111
  1411. +#define __NR_wait4 114
  1412. +#define __NR_swapoff 115
  1413. +#define __NR_sysinfo 116
  1414. +#define __NR_ipc 117
  1415. +#define __NR_fsync 118
  1416. +#define __NR_sigreturn 119
  1417. +#define __NR_clone 120
  1418. +#define __NR_setdomainname 121
  1419. +#define __NR_uname 122
  1420. +#define __NR_cacheflush 123
  1421. +#define __NR_adjtimex 124
  1422. +#define __NR_mprotect 125
  1423. +#define __NR_sigprocmask 126
  1424. +#define __NR_init_module 128
  1425. +#define __NR_delete_module 129
  1426. +#define __NR_quotactl 131
  1427. +#define __NR_getpgid 132
  1428. +#define __NR_fchdir 133
  1429. +#define __NR_bdflush 134
  1430. +#define __NR_sysfs 135
  1431. +#define __NR_personality 136
  1432. +#define __NR_setfsuid 138
  1433. +#define __NR_setfsgid 139
  1434. +#define __NR__llseek 140
  1435. +#define __NR_getdents 141
  1436. +#define __NR__newselect 142
  1437. +#define __NR_flock 143
  1438. +#define __NR_msync 144
  1439. +#define __NR_readv 145
  1440. +#define __NR_writev 146
  1441. +#define __NR_getsid 147
  1442. +#define __NR_fdatasync 148
  1443. +#define __NR__sysctl 149
  1444. +#define __NR_mlock 150
  1445. +#define __NR_munlock 151
  1446. +#define __NR_mlockall 152
  1447. +#define __NR_munlockall 153
  1448. +#define __NR_sched_setparam 154
  1449. +#define __NR_sched_getparam 155
  1450. +#define __NR_sched_setscheduler 156
  1451. +#define __NR_sched_getscheduler 157
  1452. +#define __NR_sched_yield 158
  1453. +#define __NR_sched_get_priority_max 159
  1454. +#define __NR_sched_get_priority_min 160
  1455. +#define __NR_sched_rr_get_interval 161
  1456. +#define __NR_nanosleep 162
  1457. +#define __NR_mremap 163
  1458. +#define __NR_setresuid 164
  1459. +#define __NR_getresuid 165
  1460. +#define __NR_poll 168
  1461. +#define __NR_nfsservctl 169
  1462. +#define __NR_setresgid 170
  1463. +#define __NR_getresgid 171
  1464. +#define __NR_prctl 172
  1465. +#define __NR_rt_sigreturn 173
  1466. +#define __NR_rt_sigaction 174
  1467. +#define __NR_rt_sigprocmask 175
  1468. +#define __NR_rt_sigpending 176
  1469. +#define __NR_rt_sigtimedwait 177
  1470. +#define __NR_rt_sigqueueinfo 178
  1471. +#define __NR_rt_sigsuspend 179
  1472. +#define __NR_pread64 180
  1473. +#define __NR_pwrite64 181
  1474. +#define __NR_chown 182
  1475. +#define __NR_getcwd 183
  1476. +#define __NR_capget 184
  1477. +#define __NR_capset 185
  1478. +#define __NR_sigaltstack 186
  1479. +#define __NR_sendfile 187
  1480. +#define __NR_vfork 190
  1481. +#define __NR_ugetrlimit 191
  1482. +#define __NR_mmap2 192
  1483. +#define __NR_truncate64 193
  1484. +#define __NR_ftruncate64 194
  1485. +#define __NR_stat64 195
  1486. +#define __NR_lstat64 196
  1487. +#define __NR_fstat64 197
  1488. +#define __NR_lchown32 198
  1489. +#define __NR_getuid32 199
  1490. +#define __NR_getgid32 200
  1491. +#define __NR_geteuid32 201
  1492. +#define __NR_getegid32 202
  1493. +#define __NR_setreuid32 203
  1494. +#define __NR_setregid32 204
  1495. +#define __NR_getgroups32 205
  1496. +#define __NR_setgroups32 206
  1497. +#define __NR_fchown32 207
  1498. +#define __NR_setresuid32 208
  1499. +#define __NR_getresuid32 209
  1500. +#define __NR_setresgid32 210
  1501. +#define __NR_getresgid32 211
  1502. +#define __NR_chown32 212
  1503. +#define __NR_setuid32 213
  1504. +#define __NR_setgid32 214
  1505. +#define __NR_setfsuid32 215
  1506. +#define __NR_setfsgid32 216
  1507. +#define __NR_pivot_root 217
  1508. +#define __NR_mincore 218
  1509. +#define __NR_madvise 219
  1510. +#define __NR_getdents64 220
  1511. +#define __NR_fcntl64 221
  1512. +#define __NR_gettid 224
  1513. +#define __NR_readahead 225
  1514. +#define __NR_setxattr 226
  1515. +#define __NR_lsetxattr 227
  1516. +#define __NR_fsetxattr 228
  1517. +#define __NR_getxattr 229
  1518. +#define __NR_lgetxattr 230
  1519. +#define __NR_fgetxattr 231
  1520. +#define __NR_listxattr 232
  1521. +#define __NR_llistxattr 233
  1522. +#define __NR_flistxattr 234
  1523. +#define __NR_removexattr 235
  1524. +#define __NR_lremovexattr 236
  1525. +#define __NR_fremovexattr 237
  1526. +#define __NR_tkill 238
  1527. +#define __NR_sendfile64 239
  1528. +#define __NR_futex 240
  1529. +#define __NR_sched_setaffinity 241
  1530. +#define __NR_sched_getaffinity 242
  1531. +#define __NR_io_setup 245
  1532. +#define __NR_io_destroy 246
  1533. +#define __NR_io_getevents 247
  1534. +#define __NR_io_submit 248
  1535. +#define __NR_io_cancel 249
  1536. +#define __NR_fadvise64 250
  1537. +#define __NR_exit_group 252
  1538. +#define __NR_lookup_dcookie 253
  1539. +#define __NR_epoll_create 254
  1540. +#define __NR_epoll_ctl 255
  1541. +#define __NR_epoll_wait 256
  1542. +#define __NR_remap_file_pages 257
  1543. +#define __NR_set_tid_address 258
  1544. +#define __NR_timer_create 259
  1545. +#define __NR_timer_settime 260
  1546. +#define __NR_timer_gettime 261
  1547. +#define __NR_timer_getoverrun 262
  1548. +#define __NR_timer_delete 263
  1549. +#define __NR_clock_settime 264
  1550. +#define __NR_clock_gettime 265
  1551. +#define __NR_clock_getres 266
  1552. +#define __NR_clock_nanosleep 267
  1553. +#define __NR_statfs64 268
  1554. +#define __NR_fstatfs64 269
  1555. +#define __NR_tgkill 270
  1556. +#define __NR_utimes 271
  1557. +#define __NR_fadvise64_64 272
  1558. +#define __NR_mbind 274
  1559. +#define __NR_get_mempolicy 275
  1560. +#define __NR_set_mempolicy 276
  1561. +#define __NR_mq_open 277
  1562. +#define __NR_mq_unlink 278
  1563. +#define __NR_mq_timedsend 279
  1564. +#define __NR_mq_timedreceive 280
  1565. +#define __NR_mq_notify 281
  1566. +#define __NR_mq_getsetattr 282
  1567. +#define __NR_kexec_load 283
  1568. +#define __NR_waitid 284
  1569. +#define __NR_add_key 285
  1570. +#define __NR_request_key 286
  1571. +#define __NR_keyctl 287
  1572. +#define __NR_ioprio_set 288
  1573. +#define __NR_ioprio_get 289
  1574. +#define __NR_inotify_init 290
  1575. +#define __NR_inotify_add_watch 291
  1576. +#define __NR_inotify_rm_watch 292
  1577. +#define __NR_migrate_pages 294
  1578. +#define __NR_openat 295
  1579. +#define __NR_mkdirat 296
  1580. +#define __NR_mknodat 297
  1581. +#define __NR_fchownat 298
  1582. +#define __NR_futimesat 299
  1583. +#define __NR_fstatat64 300
  1584. +#define __NR_unlinkat 301
  1585. +#define __NR_renameat 302
  1586. +#define __NR_linkat 303
  1587. +#define __NR_symlinkat 304
  1588. +#define __NR_readlinkat 305
  1589. +#define __NR_fchmodat 306
  1590. +#define __NR_faccessat 307
  1591. +#define __NR_pselect6 308
  1592. +#define __NR_ppoll 309
  1593. +#define __NR_unshare 310
  1594. +#define __NR_set_robust_list 311
  1595. +#define __NR_get_robust_list 312
  1596. +#define __NR_splice 313
  1597. +#define __NR_sync_file_range 314
  1598. +#define __NR_tee 315
  1599. +#define __NR_vmsplice 316
  1600. +#define __NR_move_pages 317
  1601. +#define __NR_getcpu 318
  1602. +#define __NR_epoll_pwait 319
  1603. +#define __NR_utimensat 320
  1604. +#define __NR_signalfd 321
  1605. +#define __NR_timerfd_create 322
  1606. +#define __NR_eventfd 323
  1607. +#define __NR_fallocate 324
  1608. +#define __NR_timerfd_settime 325
  1609. +#define __NR_timerfd_gettime 326
  1610. +#define __NR_signalfd4 327
  1611. +#define __NR_eventfd2 328
  1612. +#define __NR_epoll_create1 329
  1613. +#define __NR_dup3 330
  1614. +#define __NR_pipe2 331
  1615. +#define __NR_inotify_init1 332
  1616. +#define __NR_preadv 333
  1617. +#define __NR_pwritev 334
  1618. +#define __NR_rt_tgsigqueueinfo 335
  1619. +#define __NR_perf_event_open 336
  1620. +#define __NR_fanotify_init 337
  1621. +#define __NR_fanotify_mark 338
  1622. +#define __NR_prlimit64 339
  1623. +#define __NR_socket 340
  1624. +#define __NR_bind 341
  1625. +#define __NR_connect 342
  1626. +#define __NR_listen 343
  1627. +#define __NR_accept 344
  1628. +#define __NR_getsockname 345
  1629. +#define __NR_getpeername 346
  1630. +#define __NR_socketpair 347
  1631. +#define __NR_send 348
  1632. +#define __NR_sendto 349
  1633. +#define __NR_recv 350
  1634. +#define __NR_recvfrom 351
  1635. +#define __NR_shutdown 352
  1636. +#define __NR_setsockopt 353
  1637. +#define __NR_getsockopt 354
  1638. +#define __NR_sendmsg 355
  1639. +#define __NR_recvmsg 356
  1640. +#define __NR_recvmmsg 357
  1641. +#define __NR_accept4 358
  1642. +#define __NR_name_to_handle_at 359
  1643. +#define __NR_open_by_handle_at 360
  1644. +#define __NR_clock_adjtime 361
  1645. +#define __NR_syncfs 362
  1646. +#define __NR_sendmmsg 363
  1647. +#define __NR_setns 364
  1648. +#define __NR_process_vm_readv 365
  1649. +#define __NR_process_vm_writev 366
  1650. +#define __NR_kcmp 367
  1651. +#define __NR_finit_module 368
  1652. +
  1653. +
  1654. +/* Repeated with SYS_ prefix */
  1655. +
  1656. +#define SYS_restart_syscall 0
  1657. +#define SYS_exit 1
  1658. +#define SYS_fork 2
  1659. +#define SYS_read 3
  1660. +#define SYS_write 4
  1661. +#define SYS_open 5
  1662. +#define SYS_close 6
  1663. +#define SYS_waitpid 7
  1664. +#define SYS_creat 8
  1665. +#define SYS_link 9
  1666. +#define SYS_unlink 10
  1667. +#define SYS_execve 11
  1668. +#define SYS_chdir 12
  1669. +#define SYS_time 13
  1670. +#define SYS_mknod 14
  1671. +#define SYS_chmod 15
  1672. +#define SYS_lchown 16
  1673. +#define SYS_oldstat 18
  1674. +#define SYS_lseek 19
  1675. +#define SYS_getpid 20
  1676. +#define SYS_mount 21
  1677. +#define SYS_umount 22
  1678. +#define SYS_setuid 23
  1679. +#define SYS_getuid 24
  1680. +#define SYS_stime 25
  1681. +#define SYS_ptrace 26
  1682. +#define SYS_alarm 27
  1683. +#define SYS_oldfstat 28
  1684. +#define SYS_pause 29
  1685. +#define SYS_utime 30
  1686. +#define SYS_access 33
  1687. +#define SYS_nice 34
  1688. +#define SYS_sync 36
  1689. +#define SYS_kill 37
  1690. +#define SYS_rename 38
  1691. +#define SYS_mkdir 39
  1692. +#define SYS_rmdir 40
  1693. +#define SYS_dup 41
  1694. +#define SYS_pipe 42
  1695. +#define SYS_times 43
  1696. +#define SYS_brk 45
  1697. +#define SYS_setgid 46
  1698. +#define SYS_getgid 47
  1699. +#define SYS_signal 48
  1700. +#define SYS_geteuid 49
  1701. +#define SYS_getegid 50
  1702. +#define SYS_acct 51
  1703. +#define SYS_umount2 52
  1704. +#define SYS_ioctl 54
  1705. +#define SYS_fcntl 55
  1706. +#define SYS_setpgid 57
  1707. +#define SYS_umask 60
  1708. +#define SYS_chroot 61
  1709. +#define SYS_ustat 62
  1710. +#define SYS_dup2 63
  1711. +#define SYS_getppid 64
  1712. +#define SYS_getpgrp 65
  1713. +#define SYS_setsid 66
  1714. +#define SYS_sigaction 67
  1715. +#define SYS_sgetmask 68
  1716. +#define SYS_ssetmask 69
  1717. +#define SYS_setreuid 70
  1718. +#define SYS_setregid 71
  1719. +#define SYS_sigsuspend 72
  1720. +#define SYS_sigpending 73
  1721. +#define SYS_sethostname 74
  1722. +#define SYS_setrlimit 75
  1723. +#define SYS_getrlimit 76
  1724. +#define SYS_getrusage 77
  1725. +#define SYS_gettimeofday 78
  1726. +#define SYS_settimeofday 79
  1727. +#define SYS_getgroups 80
  1728. +#define SYS_setgroups 81
  1729. +#define SYS_symlink 83
  1730. +#define SYS_oldlstat 84
  1731. +#define SYS_readlink 85
  1732. +#define SYS_uselib 86
  1733. +#define SYS_swapon 87
  1734. +#define SYS_reboot 88
  1735. +#define SYS_readdir 89
  1736. +#define SYS_mmap 90
  1737. +#define SYS_munmap 91
  1738. +#define SYS_truncate 92
  1739. +#define SYS_ftruncate 93
  1740. +#define SYS_fchmod 94
  1741. +#define SYS_fchown 95
  1742. +#define SYS_getpriority 96
  1743. +#define SYS_setpriority 97
  1744. +#define SYS_statfs 99
  1745. +#define SYS_fstatfs 100
  1746. +#define SYS_socketcall 102
  1747. +#define SYS_syslog 103
  1748. +#define SYS_setitimer 104
  1749. +#define SYS_getitimer 105
  1750. +#define SYS_stat 106
  1751. +#define SYS_lstat 107
  1752. +#define SYS_fstat 108
  1753. +#define SYS_olduname 109
  1754. +#define SYS_vhangup 111
  1755. +#define SYS_wait4 114
  1756. +#define SYS_swapoff 115
  1757. +#define SYS_sysinfo 116
  1758. +#define SYS_ipc 117
  1759. +#define SYS_fsync 118
  1760. +#define SYS_sigreturn 119
  1761. +#define SYS_clone 120
  1762. +#define SYS_setdomainname 121
  1763. +#define SYS_uname 122
  1764. +#define SYS_cacheflush 123
  1765. +#define SYS_adjtimex 124
  1766. +#define SYS_mprotect 125
  1767. +#define SYS_sigprocmask 126
  1768. +#define SYS_init_module 128
  1769. +#define SYS_delete_module 129
  1770. +#define SYS_quotactl 131
  1771. +#define SYS_getpgid 132
  1772. +#define SYS_fchdir 133
  1773. +#define SYS_bdflush 134
  1774. +#define SYS_sysfs 135
  1775. +#define SYS_personality 136
  1776. +#define SYS_setfsuid 138
  1777. +#define SYS_setfsgid 139
  1778. +#define SYS__llseek 140
  1779. +#define SYS_getdents 141
  1780. +#define SYS__newselect 142
  1781. +#define SYS_flock 143
  1782. +#define SYS_msync 144
  1783. +#define SYS_readv 145
  1784. +#define SYS_writev 146
  1785. +#define SYS_getsid 147
  1786. +#define SYS_fdatasync 148
  1787. +#define SYS__sysctl 149
  1788. +#define SYS_mlock 150
  1789. +#define SYS_munlock 151
  1790. +#define SYS_mlockall 152
  1791. +#define SYS_munlockall 153
  1792. +#define SYS_sched_setparam 154
  1793. +#define SYS_sched_getparam 155
  1794. +#define SYS_sched_setscheduler 156
  1795. +#define SYS_sched_getscheduler 157
  1796. +#define SYS_sched_yield 158
  1797. +#define SYS_sched_get_priority_max 159
  1798. +#define SYS_sched_get_priority_min 160
  1799. +#define SYS_sched_rr_get_interval 161
  1800. +#define SYS_nanosleep 162
  1801. +#define SYS_mremap 163
  1802. +#define SYS_setresuid 164
  1803. +#define SYS_getresuid 165
  1804. +#define SYS_poll 168
  1805. +#define SYS_nfsservctl 169
  1806. +#define SYS_setresgid 170
  1807. +#define SYS_getresgid 171
  1808. +#define SYS_prctl 172
  1809. +#define SYS_rt_sigreturn 173
  1810. +#define SYS_rt_sigaction 174
  1811. +#define SYS_rt_sigprocmask 175
  1812. +#define SYS_rt_sigpending 176
  1813. +#define SYS_rt_sigtimedwait 177
  1814. +#define SYS_rt_sigqueueinfo 178
  1815. +#define SYS_rt_sigsuspend 179
  1816. +#define SYS_pread64 180
  1817. +#define SYS_pwrite64 181
  1818. +#define SYS_chown 182
  1819. +#define SYS_getcwd 183
  1820. +#define SYS_capget 184
  1821. +#define SYS_capset 185
  1822. +#define SYS_sigaltstack 186
  1823. +#define SYS_sendfile 187
  1824. +#define SYS_vfork 190
  1825. +#define SYS_ugetrlimit 191
  1826. +#define SYS_mmap2 192
  1827. +#define SYS_truncate64 193
  1828. +#define SYS_ftruncate64 194
  1829. +#define SYS_stat64 195
  1830. +#define SYS_lstat64 196
  1831. +#define SYS_fstat64 197
  1832. +#define SYS_lchown32 198
  1833. +#define SYS_getuid32 199
  1834. +#define SYS_getgid32 200
  1835. +#define SYS_geteuid32 201
  1836. +#define SYS_getegid32 202
  1837. +#define SYS_setreuid32 203
  1838. +#define SYS_setregid32 204
  1839. +#define SYS_getgroups32 205
  1840. +#define SYS_setgroups32 206
  1841. +#define SYS_fchown32 207
  1842. +#define SYS_setresuid32 208
  1843. +#define SYS_getresuid32 209
  1844. +#define SYS_setresgid32 210
  1845. +#define SYS_getresgid32 211
  1846. +#define SYS_chown32 212
  1847. +#define SYS_setuid32 213
  1848. +#define SYS_setgid32 214
  1849. +#define SYS_setfsuid32 215
  1850. +#define SYS_setfsgid32 216
  1851. +#define SYS_pivot_root 217
  1852. +#define SYS_mincore 218
  1853. +#define SYS_madvise 219
  1854. +#define SYS_getdents64 220
  1855. +#define SYS_fcntl64 221
  1856. +#define SYS_gettid 224
  1857. +#define SYS_readahead 225
  1858. +#define SYS_setxattr 226
  1859. +#define SYS_lsetxattr 227
  1860. +#define SYS_fsetxattr 228
  1861. +#define SYS_getxattr 229
  1862. +#define SYS_lgetxattr 230
  1863. +#define SYS_fgetxattr 231
  1864. +#define SYS_listxattr 232
  1865. +#define SYS_llistxattr 233
  1866. +#define SYS_flistxattr 234
  1867. +#define SYS_removexattr 235
  1868. +#define SYS_lremovexattr 236
  1869. +#define SYS_fremovexattr 237
  1870. +#define SYS_tkill 238
  1871. +#define SYS_sendfile64 239
  1872. +#define SYS_futex 240
  1873. +#define SYS_sched_setaffinity 241
  1874. +#define SYS_sched_getaffinity 242
  1875. +#define SYS_io_setup 245
  1876. +#define SYS_io_destroy 246
  1877. +#define SYS_io_getevents 247
  1878. +#define SYS_io_submit 248
  1879. +#define SYS_io_cancel 249
  1880. +#define SYS_fadvise64 250
  1881. +#define SYS_exit_group 252
  1882. +#define SYS_lookup_dcookie 253
  1883. +#define SYS_epoll_create 254
  1884. +#define SYS_epoll_ctl 255
  1885. +#define SYS_epoll_wait 256
  1886. +#define SYS_remap_file_pages 257
  1887. +#define SYS_set_tid_address 258
  1888. +#define SYS_timer_create 259
  1889. +#define SYS_timer_settime 260
  1890. +#define SYS_timer_gettime 261
  1891. +#define SYS_timer_getoverrun 262
  1892. +#define SYS_timer_delete 263
  1893. +#define SYS_clock_settime 264
  1894. +#define SYS_clock_gettime 265
  1895. +#define SYS_clock_getres 266
  1896. +#define SYS_clock_nanosleep 267
  1897. +#define SYS_statfs64 268
  1898. +#define SYS_fstatfs64 269
  1899. +#define SYS_tgkill 270
  1900. +#define SYS_utimes 271
  1901. +#define SYS_fadvise64_64 272
  1902. +#define SYS_mbind 274
  1903. +#define SYS_get_mempolicy 275
  1904. +#define SYS_set_mempolicy 276
  1905. +#define SYS_mq_open 277
  1906. +#define SYS_mq_unlink 278
  1907. +#define SYS_mq_timedsend 279
  1908. +#define SYS_mq_timedreceive 280
  1909. +#define SYS_mq_notify 281
  1910. +#define SYS_mq_getsetattr 282
  1911. +#define SYS_kexec_load 283
  1912. +#define SYS_waitid 284
  1913. +#define SYS_add_key 285
  1914. +#define SYS_request_key 286
  1915. +#define SYS_keyctl 287
  1916. +#define SYS_ioprio_set 288
  1917. +#define SYS_ioprio_get 289
  1918. +#define SYS_inotify_init 290
  1919. +#define SYS_inotify_add_watch 291
  1920. +#define SYS_inotify_rm_watch 292
  1921. +#define SYS_migrate_pages 294
  1922. +#define SYS_openat 295
  1923. +#define SYS_mkdirat 296
  1924. +#define SYS_mknodat 297
  1925. +#define SYS_fchownat 298
  1926. +#define SYS_futimesat 299
  1927. +#define SYS_fstatat64 300
  1928. +#define SYS_unlinkat 301
  1929. +#define SYS_renameat 302
  1930. +#define SYS_linkat 303
  1931. +#define SYS_symlinkat 304
  1932. +#define SYS_readlinkat 305
  1933. +#define SYS_fchmodat 306
  1934. +#define SYS_faccessat 307
  1935. +#define SYS_pselect6 308
  1936. +#define SYS_ppoll 309
  1937. +#define SYS_unshare 310
  1938. +#define SYS_set_robust_list 311
  1939. +#define SYS_get_robust_list 312
  1940. +#define SYS_splice 313
  1941. +#define SYS_sync_file_range 314
  1942. +#define SYS_tee 315
  1943. +#define SYS_vmsplice 316
  1944. +#define SYS_move_pages 317
  1945. +#define SYS_getcpu 318
  1946. +#define SYS_epoll_pwait 319
  1947. +#define SYS_utimensat 320
  1948. +#define SYS_signalfd 321
  1949. +#define SYS_timerfd_create 322
  1950. +#define SYS_eventfd 323
  1951. +#define SYS_fallocate 324
  1952. +#define SYS_timerfd_settime 325
  1953. +#define SYS_timerfd_gettime 326
  1954. +#define SYS_signalfd4 327
  1955. +#define SYS_eventfd2 328
  1956. +#define SYS_epoll_create1 329
  1957. +#define SYS_dup3 330
  1958. +#define SYS_pipe2 331
  1959. +#define SYS_inotify_init1 332
  1960. +#define SYS_preadv 333
  1961. +#define SYS_pwritev 334
  1962. +#define SYS_rt_tgsigqueueinfo 335
  1963. +#define SYS_perf_event_open 336
  1964. +#define SYS_fanotify_init 337
  1965. +#define SYS_fanotify_mark 338
  1966. +#define SYS_prlimit64 339
  1967. +#define SYS_socket 340
  1968. +#define SYS_bind 341
  1969. +#define SYS_connect 342
  1970. +#define SYS_listen 343
  1971. +#define SYS_accept 344
  1972. +#define SYS_getsockname 345
  1973. +#define SYS_getpeername 346
  1974. +#define SYS_socketpair 347
  1975. +#define SYS_send 348
  1976. +#define SYS_sendto 349
  1977. +#define SYS_recv 350
  1978. +#define SYS_recvfrom 351
  1979. +#define SYS_shutdown 352
  1980. +#define SYS_setsockopt 353
  1981. +#define SYS_getsockopt 354
  1982. +#define SYS_sendmsg 355
  1983. +#define SYS_recvmsg 356
  1984. +#define SYS_recvmmsg 357
  1985. +#define SYS_accept4 358
  1986. +#define SYS_name_to_handle_at 359
  1987. +#define SYS_open_by_handle_at 360
  1988. +#define SYS_clock_adjtime 361
  1989. +#define SYS_syncfs 362
  1990. +#define SYS_sendmmsg 363
  1991. +#define SYS_setns 364
  1992. +#define SYS_process_vm_readv 365
  1993. +#define SYS_process_vm_writev 366
  1994. +#define SYS_kcmp 367
  1995. +#define SYS_finit_module 368
  1996. diff -Nur musl-0.9.15/arch/sh/bits/termios.h musl-git/arch/sh/bits/termios.h
  1997. --- musl-0.9.15/arch/sh/bits/termios.h 1970-01-01 01:00:00.000000000 +0100
  1998. +++ musl-git/arch/sh/bits/termios.h 2014-03-01 08:58:14.000000000 +0100
  1999. @@ -0,0 +1,160 @@
  2000. +struct termios
  2001. +{
  2002. + tcflag_t c_iflag;
  2003. + tcflag_t c_oflag;
  2004. + tcflag_t c_cflag;
  2005. + tcflag_t c_lflag;
  2006. + cc_t c_line;
  2007. + cc_t c_cc[NCCS];
  2008. + speed_t __c_ispeed;
  2009. + speed_t __c_ospeed;
  2010. +};
  2011. +
  2012. +#define VINTR 0
  2013. +#define VQUIT 1
  2014. +#define VERASE 2
  2015. +#define VKILL 3
  2016. +#define VEOF 4
  2017. +#define VTIME 5
  2018. +#define VMIN 6
  2019. +#define VSWTC 7
  2020. +#define VSTART 8
  2021. +#define VSTOP 9
  2022. +#define VSUSP 10
  2023. +#define VEOL 11
  2024. +#define VREPRINT 12
  2025. +#define VDISCARD 13
  2026. +#define VWERASE 14
  2027. +#define VLNEXT 15
  2028. +#define VEOL2 16
  2029. +
  2030. +#define IGNBRK 0000001
  2031. +#define BRKINT 0000002
  2032. +#define IGNPAR 0000004
  2033. +#define PARMRK 0000010
  2034. +#define INPCK 0000020
  2035. +#define ISTRIP 0000040
  2036. +#define INLCR 0000100
  2037. +#define IGNCR 0000200
  2038. +#define ICRNL 0000400
  2039. +#define IUCLC 0001000
  2040. +#define IXON 0002000
  2041. +#define IXANY 0004000
  2042. +#define IXOFF 0010000
  2043. +#define IMAXBEL 0020000
  2044. +#define IUTF8 0040000
  2045. +
  2046. +#define OPOST 0000001
  2047. +#define OLCUC 0000002
  2048. +#define ONLCR 0000004
  2049. +#define OCRNL 0000010
  2050. +#define ONOCR 0000020
  2051. +#define ONLRET 0000040
  2052. +#define OFILL 0000100
  2053. +#define OFDEL 0000200
  2054. +#define NLDLY 0000400
  2055. +#define NL0 0000000
  2056. +#define NL1 0000400
  2057. +#define CRDLY 0003000
  2058. +#define CR0 0000000
  2059. +#define CR1 0001000
  2060. +#define CR2 0002000
  2061. +#define CR3 0003000
  2062. +#define TABDLY 0014000
  2063. +#define TAB0 0000000
  2064. +#define TAB1 0004000
  2065. +#define TAB2 0010000
  2066. +#define TAB3 0014000
  2067. +#define BSDLY 0020000
  2068. +#define BS0 0000000
  2069. +#define BS1 0020000
  2070. +#define FFDLY 0100000
  2071. +#define FF0 0000000
  2072. +#define FF1 0100000
  2073. +
  2074. +#define VTDLY 0040000
  2075. +#define VT0 0000000
  2076. +#define VT1 0040000
  2077. +
  2078. +#define B0 0000000
  2079. +#define B50 0000001
  2080. +#define B75 0000002
  2081. +#define B110 0000003
  2082. +#define B134 0000004
  2083. +#define B150 0000005
  2084. +#define B200 0000006
  2085. +#define B300 0000007
  2086. +#define B600 0000010
  2087. +#define B1200 0000011
  2088. +#define B1800 0000012
  2089. +#define B2400 0000013
  2090. +#define B4800 0000014
  2091. +#define B9600 0000015
  2092. +#define B19200 0000016
  2093. +#define B38400 0000017
  2094. +
  2095. +#define B57600 0010001
  2096. +#define B115200 0010002
  2097. +#define B230400 0010003
  2098. +#define B460800 0010004
  2099. +#define B500000 0010005
  2100. +#define B576000 0010006
  2101. +#define B921600 0010007
  2102. +#define B1000000 0010010
  2103. +#define B1152000 0010011
  2104. +#define B1500000 0010012
  2105. +#define B2000000 0010013
  2106. +#define B2500000 0010014
  2107. +#define B3000000 0010015
  2108. +#define B3500000 0010016
  2109. +#define B4000000 0010017
  2110. +
  2111. +#define CBAUD 0010017
  2112. +
  2113. +#define CSIZE 0000060
  2114. +#define CS5 0000000
  2115. +#define CS6 0000020
  2116. +#define CS7 0000040
  2117. +#define CS8 0000060
  2118. +#define CSTOPB 0000100
  2119. +#define CREAD 0000200
  2120. +#define PARENB 0000400
  2121. +#define PARODD 0001000
  2122. +#define HUPCL 0002000
  2123. +#define CLOCAL 0004000
  2124. +
  2125. +#define ISIG 0000001
  2126. +#define ICANON 0000002
  2127. +#define ECHO 0000010
  2128. +#define ECHOE 0000020
  2129. +#define ECHOK 0000040
  2130. +#define ECHONL 0000100
  2131. +#define NOFLSH 0000200
  2132. +#define TOSTOP 0000400
  2133. +#define IEXTEN 0100000
  2134. +
  2135. +#define ECHOCTL 0001000
  2136. +#define ECHOPRT 0002000
  2137. +#define ECHOKE 0004000
  2138. +#define FLUSHO 0010000
  2139. +#define PENDIN 0040000
  2140. +
  2141. +#define TCOOFF 0
  2142. +#define TCOON 1
  2143. +#define TCIOFF 2
  2144. +#define TCION 3
  2145. +
  2146. +#define TCIFLUSH 0
  2147. +#define TCOFLUSH 1
  2148. +#define TCIOFLUSH 2
  2149. +
  2150. +#define TCSANOW 0
  2151. +#define TCSADRAIN 1
  2152. +#define TCSAFLUSH 2
  2153. +
  2154. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  2155. +#define CBAUDEX 0010000
  2156. +#define CRTSCTS 020000000000
  2157. +#define EXTPROC 0200000
  2158. +#define XTABS 0014000
  2159. +#endif
  2160. diff -Nur musl-0.9.15/arch/sh/crt_arch.h musl-git/arch/sh/crt_arch.h
  2161. --- musl-0.9.15/arch/sh/crt_arch.h 1970-01-01 01:00:00.000000000 +0100
  2162. +++ musl-git/arch/sh/crt_arch.h 2014-03-01 08:58:14.000000000 +0100
  2163. @@ -0,0 +1,9 @@
  2164. +__asm__("\
  2165. +.global _start \n\
  2166. +_start: \n\
  2167. + mov r15, r4 \n\
  2168. + mov #-16, r0 \n\
  2169. + and r0, r15 \n\
  2170. + bsr __cstart \n\
  2171. + nop \n\
  2172. +");
  2173. diff -Nur musl-0.9.15/arch/sh/pthread_arch.h musl-git/arch/sh/pthread_arch.h
  2174. --- musl-0.9.15/arch/sh/pthread_arch.h 1970-01-01 01:00:00.000000000 +0100
  2175. +++ musl-git/arch/sh/pthread_arch.h 2014-03-01 08:58:14.000000000 +0100
  2176. @@ -0,0 +1,11 @@
  2177. +static inline struct pthread *__pthread_self()
  2178. +{
  2179. + char *self;
  2180. + __asm__ __volatile__ ("stc gbr,%0" : "=r" (self) );
  2181. + return (struct pthread *) (self + 8 - sizeof(struct pthread));
  2182. +}
  2183. +
  2184. +#define TLS_ABOVE_TP
  2185. +#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) - 8)
  2186. +
  2187. +#define CANCEL_REG_IP 17
  2188. diff -Nur musl-0.9.15/arch/sh/reloc.h musl-git/arch/sh/reloc.h
  2189. --- musl-0.9.15/arch/sh/reloc.h 1970-01-01 01:00:00.000000000 +0100
  2190. +++ musl-git/arch/sh/reloc.h 2014-03-01 08:58:14.000000000 +0100
  2191. @@ -0,0 +1,47 @@
  2192. +#if __BYTE_ORDER == __BIG_ENDIAN
  2193. +#define ENDIAN_SUFFIX "eb"
  2194. +#else
  2195. +#define ENDIAN_SUFFIX ""
  2196. +#endif
  2197. +
  2198. +#define LDSO_ARCH "sh" ENDIAN_SUFFIX
  2199. +
  2200. +#define IS_COPY(x) ((x) == R_SH_COPY)
  2201. +#define IS_PLT(x) ((x) == R_SH_JMP_SLOT)
  2202. +
  2203. +static inline void do_single_reloc(
  2204. + struct dso *self, unsigned char *base_addr,
  2205. + size_t *reloc_addr, int type, size_t addend,
  2206. + Sym *sym, size_t sym_size,
  2207. + struct symdef def, size_t sym_val)
  2208. +{
  2209. + switch(type) {
  2210. + case R_SH_GLOB_DAT:
  2211. + case R_SH_JMP_SLOT:
  2212. + *reloc_addr = sym_val;
  2213. + break;
  2214. + case R_SH_RELATIVE:
  2215. + *reloc_addr = (size_t)base_addr + addend;
  2216. + break;
  2217. + case R_SH_DIR32:
  2218. + *reloc_addr = sym_val + addend;
  2219. + break;
  2220. + case R_SH_REL32:
  2221. + *reloc_addr = sym_val + addend - (size_t)reloc_addr + (size_t)base_addr;
  2222. + break;
  2223. + case R_SH_COPY:
  2224. + memcpy(reloc_addr, (void *)sym_val, sym_size);
  2225. + break;
  2226. + case R_SH_TLS_DTPMOD32:
  2227. + *reloc_addr += def.dso ? def.dso->tls_id : self->tls_id;
  2228. + break;
  2229. + case R_SH_TLS_DTPOFF32:
  2230. + *reloc_addr += def.sym->st_value;
  2231. + break;
  2232. + case R_SH_TLS_TPOFF32:
  2233. + *reloc_addr += def.sym
  2234. + ? def.sym->st_value + def.dso->tls_offset + 8
  2235. + : self->tls_offset + 8;
  2236. + break;
  2237. + }
  2238. +}
  2239. diff -Nur musl-0.9.15/arch/sh/src/atomic.c musl-git/arch/sh/src/atomic.c
  2240. --- musl-0.9.15/arch/sh/src/atomic.c 1970-01-01 01:00:00.000000000 +0100
  2241. +++ musl-git/arch/sh/src/atomic.c 2014-03-01 08:58:14.000000000 +0100
  2242. @@ -0,0 +1,146 @@
  2243. +#include "libc.h"
  2244. +
  2245. +#define LLSC_CLOBBERS "r0", "t", "memory"
  2246. +#define LLSC_START(mem) \
  2247. + "0: movli.l @" mem ", r0\n"
  2248. +#define LLSC_END(mem) \
  2249. + "1: movco.l r0, @" mem "\n" \
  2250. + " bf 0b\n" \
  2251. + " synco\n"
  2252. +
  2253. +/* gusa is a hack in the kernel which lets you create a sequence of instructions
  2254. + * which will be restarted if the process is preempted in the middle of the
  2255. + * sequence. It will do for implementing atomics on non-smp systems. ABI is:
  2256. + * r0 = address of first instruction after the atomic sequence
  2257. + * r1 = original stack pointer
  2258. + * r15 = -1 * length of atomic sequence in bytes
  2259. + */
  2260. +#define GUSA_CLOBBERS "r0", "r1", "memory"
  2261. +#define GUSA_START(mem,old,nop) \
  2262. + " .align 2\n" \
  2263. + " mova 1f, r0\n" \
  2264. + nop \
  2265. + " mov r15, r1\n" \
  2266. + " mov #(0f-1f), r15\n" \
  2267. + "0: mov.l @" mem ", " old "\n"
  2268. +/* the target of mova must be 4 byte aligned, so we may need a nop */
  2269. +#define GUSA_START_ODD(mem,old) GUSA_START(mem,old,"")
  2270. +#define GUSA_START_EVEN(mem,old) GUSA_START(mem,old,"\tnop\n")
  2271. +#define GUSA_END(mem,new) \
  2272. + " mov.l " new ", @" mem "\n" \
  2273. + "1: mov r1, r15\n"
  2274. +
  2275. +#define CPU_HAS_LLSC 0x0040
  2276. +
  2277. +int __sh_cas(volatile int *p, int t, int s)
  2278. +{
  2279. + int old;
  2280. + if (__hwcap & CPU_HAS_LLSC) {
  2281. + __asm__ __volatile__(
  2282. + LLSC_START("%1")
  2283. + " mov r0, %0\n"
  2284. + " cmp/eq %0, %2\n"
  2285. + " bf 1f\n"
  2286. + " mov %3, r0\n"
  2287. + LLSC_END("%1")
  2288. + : "=&r"(old) : "r"(p), "r"(t), "r"(s) : LLSC_CLOBBERS);
  2289. + } else {
  2290. + __asm__ __volatile__(
  2291. + GUSA_START_EVEN("%1", "%0")
  2292. + " cmp/eq %0, %2\n"
  2293. + " bf 1f\n"
  2294. + GUSA_END("%1", "%3")
  2295. + : "=&r"(old) : "r"(p), "r"(t), "r"(s) : GUSA_CLOBBERS, "t");
  2296. + }
  2297. + return old;
  2298. +}
  2299. +
  2300. +int __sh_swap(volatile int *x, int v)
  2301. +{
  2302. + int old;
  2303. + if (__hwcap & CPU_HAS_LLSC) {
  2304. + __asm__ __volatile__(
  2305. + LLSC_START("%1")
  2306. + " mov r0, %0\n"
  2307. + " mov %2, r0\n"
  2308. + LLSC_END("%1")
  2309. + : "=&r"(old) : "r"(x), "r"(v) : LLSC_CLOBBERS);
  2310. + } else {
  2311. + __asm__ __volatile__(
  2312. + GUSA_START_EVEN("%1", "%0")
  2313. + GUSA_END("%1", "%2")
  2314. + : "=&r"(old) : "r"(x), "r"(v) : GUSA_CLOBBERS);
  2315. + }
  2316. + return old;
  2317. +}
  2318. +
  2319. +int __sh_fetch_add(volatile int *x, int v)
  2320. +{
  2321. + int old, dummy;
  2322. + if (__hwcap & CPU_HAS_LLSC) {
  2323. + __asm__ __volatile__(
  2324. + LLSC_START("%1")
  2325. + " mov r0, %0\n"
  2326. + " add %2, r0\n"
  2327. + LLSC_END("%1")
  2328. + : "=&r"(old) : "r"(x), "r"(v) : LLSC_CLOBBERS);
  2329. + } else {
  2330. + __asm__ __volatile__(
  2331. + GUSA_START_EVEN("%2", "%0")
  2332. + " mov %0, %1\n"
  2333. + " add %3, %1\n"
  2334. + GUSA_END("%2", "%1")
  2335. + : "=&r"(old), "=&r"(dummy) : "r"(x), "r"(v) : GUSA_CLOBBERS);
  2336. + }
  2337. + return old;
  2338. +}
  2339. +
  2340. +void __sh_store(volatile int *p, int x)
  2341. +{
  2342. + if (__hwcap & CPU_HAS_LLSC) {
  2343. + __asm__ __volatile__(
  2344. + " mov.l %1, @%0\n"
  2345. + " synco\n"
  2346. + : : "r"(p), "r"(x) : "memory");
  2347. + } else {
  2348. + __asm__ __volatile__(
  2349. + " mov.l %1, @%0\n"
  2350. + : : "r"(p), "r"(x) : "memory");
  2351. + }
  2352. +}
  2353. +
  2354. +void __sh_and(volatile int *x, int v)
  2355. +{
  2356. + int dummy;
  2357. + if (__hwcap & CPU_HAS_LLSC) {
  2358. + __asm__ __volatile__(
  2359. + LLSC_START("%0")
  2360. + " and %1, r0\n"
  2361. + LLSC_END("%0")
  2362. + : : "r"(x), "r"(v) : LLSC_CLOBBERS);
  2363. + } else {
  2364. + __asm__ __volatile__(
  2365. + GUSA_START_ODD("%1", "%0")
  2366. + " and %2, %0\n"
  2367. + GUSA_END("%1", "%0")
  2368. + : "=&r"(dummy) : "r"(x), "r"(v) : GUSA_CLOBBERS);
  2369. + }
  2370. +}
  2371. +
  2372. +void __sh_or(volatile int *x, int v)
  2373. +{
  2374. + int dummy;
  2375. + if (__hwcap & CPU_HAS_LLSC) {
  2376. + __asm__ __volatile__(
  2377. + LLSC_START("%0")
  2378. + " or %1, r0\n"
  2379. + LLSC_END("%0")
  2380. + : : "r"(x), "r"(v) : LLSC_CLOBBERS);
  2381. + } else {
  2382. + __asm__ __volatile__(
  2383. + GUSA_START_ODD("%1", "%0")
  2384. + " or %2, %0\n"
  2385. + GUSA_END("%1", "%0")
  2386. + : "=&r"(dummy) : "r"(x), "r"(v) : GUSA_CLOBBERS);
  2387. + }
  2388. +}
  2389. diff -Nur musl-0.9.15/arch/sh/src/__fpsrc_values.c musl-git/arch/sh/src/__fpsrc_values.c
  2390. --- musl-0.9.15/arch/sh/src/__fpsrc_values.c 1970-01-01 01:00:00.000000000 +0100
  2391. +++ musl-git/arch/sh/src/__fpsrc_values.c 2014-03-01 08:58:14.000000000 +0100
  2392. @@ -0,0 +1,2 @@
  2393. +/* used by gcc for switching the FPU between single and double precision */
  2394. +const unsigned long __fpscr_values[2] = { 0, 0x80000 };
  2395. diff -Nur musl-0.9.15/arch/sh/syscall_arch.h musl-git/arch/sh/syscall_arch.h
  2396. --- musl-0.9.15/arch/sh/syscall_arch.h 1970-01-01 01:00:00.000000000 +0100
  2397. +++ musl-git/arch/sh/syscall_arch.h 2014-03-01 08:58:14.000000000 +0100
  2398. @@ -0,0 +1,87 @@
  2399. +#define __SYSCALL_LL_E(x) \
  2400. +((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
  2401. +((union { long long ll; long l[2]; }){ .ll = x }).l[1]
  2402. +#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
  2403. +
  2404. +/* The extra OR instructions are to work around a hardware bug:
  2405. + * http://documentation.renesas.com/doc/products/mpumcu/tu/tnsh7456ae.pdf
  2406. + */
  2407. +#define __asm_syscall(trapno, ...) do { \
  2408. + __asm__ __volatile__ ( \
  2409. + "trapa #" #trapno "\n" \
  2410. + "or r0, r0\n" \
  2411. + "or r0, r0\n" \
  2412. + "or r0, r0\n" \
  2413. + "or r0, r0\n" \
  2414. + "or r0, r0\n" \
  2415. + : "=r"(r0) : __VA_ARGS__ : "memory"); \
  2416. + return r0; \
  2417. + } while (0)
  2418. +
  2419. +static inline long __syscall0(long n)
  2420. +{
  2421. + register long r3 __asm__("r3") = n;
  2422. + register long r0 __asm__("r0");
  2423. + __asm_syscall(16, "r"(r3));
  2424. +}
  2425. +
  2426. +static inline long __syscall1(long n, long a)
  2427. +{
  2428. + register long r3 __asm__("r3") = n;
  2429. + register long r4 __asm__("r4") = a;
  2430. + register long r0 __asm__("r0");
  2431. + __asm_syscall(17, "r"(r3), "r"(r4));
  2432. +}
  2433. +
  2434. +static inline long __syscall2(long n, long a, long b)
  2435. +{
  2436. + register long r3 __asm__("r3") = n;
  2437. + register long r4 __asm__("r4") = a;
  2438. + register long r5 __asm__("r5") = b;
  2439. + register long r0 __asm__("r0");
  2440. + __asm_syscall(18, "r"(r3), "r"(r4), "r"(r5));
  2441. +}
  2442. +
  2443. +static inline long __syscall3(long n, long a, long b, long c)
  2444. +{
  2445. + register long r3 __asm__("r3") = n;
  2446. + register long r4 __asm__("r4") = a;
  2447. + register long r5 __asm__("r5") = b;
  2448. + register long r6 __asm__("r6") = c;
  2449. + register long r0 __asm__("r0");
  2450. + __asm_syscall(19, "r"(r3), "r"(r4), "r"(r5), "r"(r6));
  2451. +}
  2452. +
  2453. +static inline long __syscall4(long n, long a, long b, long c, long d)
  2454. +{
  2455. + register long r3 __asm__("r3") = n;
  2456. + register long r4 __asm__("r4") = a;
  2457. + register long r5 __asm__("r5") = b;
  2458. + register long r6 __asm__("r6") = c;
  2459. + register long r7 __asm__("r7") = d;
  2460. + register long r0 __asm__("r0");
  2461. + __asm_syscall(20, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7));
  2462. +}
  2463. +
  2464. +static inline long __syscall5(long n, long a, long b, long c, long d, long e)
  2465. +{
  2466. + register long r3 __asm__("r3") = n;
  2467. + register long r4 __asm__("r4") = a;
  2468. + register long r5 __asm__("r5") = b;
  2469. + register long r6 __asm__("r6") = c;
  2470. + register long r7 __asm__("r7") = d;
  2471. + register long r0 __asm__("r0") = e;
  2472. + __asm_syscall(21, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "0"(r0));
  2473. +}
  2474. +
  2475. +static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
  2476. +{
  2477. + register long r3 __asm__("r3") = n;
  2478. + register long r4 __asm__("r4") = a;
  2479. + register long r5 __asm__("r5") = b;
  2480. + register long r6 __asm__("r6") = c;
  2481. + register long r7 __asm__("r7") = d;
  2482. + register long r0 __asm__("r0") = e;
  2483. + register long r1 __asm__("r1") = f;
  2484. + __asm_syscall(22, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "0"(r0), "r"(r1));
  2485. +}
  2486. diff -Nur musl-0.9.15/arch/x32/atomic.h musl-git/arch/x32/atomic.h
  2487. --- musl-0.9.15/arch/x32/atomic.h 1970-01-01 01:00:00.000000000 +0100
  2488. +++ musl-git/arch/x32/atomic.h 2014-03-01 08:58:14.000000000 +0100
  2489. @@ -0,0 +1,125 @@
  2490. +#ifndef _INTERNAL_ATOMIC_H
  2491. +#define _INTERNAL_ATOMIC_H
  2492. +
  2493. +#include <stdint.h>
  2494. +
  2495. +static inline int a_ctz_64(uint64_t x)
  2496. +{
  2497. + __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
  2498. + return x;
  2499. +}
  2500. +
  2501. +static inline int a_ctz_l(unsigned long x)
  2502. +{
  2503. + __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
  2504. + return x;
  2505. +}
  2506. +
  2507. +static inline void a_and_64(volatile uint64_t *p, uint64_t v)
  2508. +{
  2509. + __asm__( "lock ; and %1, %0"
  2510. + : "=m"(*p) : "r"(v) : "memory" );
  2511. +}
  2512. +
  2513. +static inline void a_or_64(volatile uint64_t *p, uint64_t v)
  2514. +{
  2515. + __asm__( "lock ; or %1, %0"
  2516. + : "=m"(*p) : "r"(v) : "memory" );
  2517. +}
  2518. +
  2519. +static inline void a_store_l(volatile void *p, long x)
  2520. +{
  2521. + __asm__( "mov %1, %0" : "=m"(*(long *)p) : "r"(x) : "memory" );
  2522. +}
  2523. +
  2524. +static inline void a_or_l(volatile void *p, long v)
  2525. +{
  2526. + __asm__( "lock ; or %1, %0"
  2527. + : "=m"(*(long *)p) : "r"(v) : "memory" );
  2528. +}
  2529. +
  2530. +static inline void *a_cas_p(volatile void *p, void *t, void *s)
  2531. +{
  2532. + __asm__( "lock ; cmpxchg %3, %1"
  2533. + : "=a"(t), "=m"(*(long *)p) : "a"(t), "r"(s) : "memory" );
  2534. + return t;
  2535. +}
  2536. +
  2537. +static inline long a_cas_l(volatile void *p, long t, long s)
  2538. +{
  2539. + __asm__( "lock ; cmpxchg %3, %1"
  2540. + : "=a"(t), "=m"(*(long *)p) : "a"(t), "r"(s) : "memory" );
  2541. + return t;
  2542. +}
  2543. +
  2544. +static inline int a_cas(volatile int *p, int t, int s)
  2545. +{
  2546. + __asm__( "lock ; cmpxchg %3, %1"
  2547. + : "=a"(t), "=m"(*p) : "a"(t), "r"(s) : "memory" );
  2548. + return t;
  2549. +}
  2550. +
  2551. +static inline void *a_swap_p(void *volatile *x, void *v)
  2552. +{
  2553. + __asm__( "xchg %0, %1" : "=r"(v), "=m"(*(void **)x) : "0"(v) : "memory" );
  2554. + return v;
  2555. +}
  2556. +static inline long a_swap_l(volatile void *x, long v)
  2557. +{
  2558. + __asm__( "xchg %0, %1" : "=r"(v), "=m"(*(long *)x) : "0"(v) : "memory" );
  2559. + return v;
  2560. +}
  2561. +
  2562. +static inline void a_or(volatile void *p, int v)
  2563. +{
  2564. + __asm__( "lock ; or %1, %0"
  2565. + : "=m"(*(int *)p) : "r"(v) : "memory" );
  2566. +}
  2567. +
  2568. +static inline void a_and(volatile void *p, int v)
  2569. +{
  2570. + __asm__( "lock ; and %1, %0"
  2571. + : "=m"(*(int *)p) : "r"(v) : "memory" );
  2572. +}
  2573. +
  2574. +static inline int a_swap(volatile int *x, int v)
  2575. +{
  2576. + __asm__( "xchg %0, %1" : "=r"(v), "=m"(*x) : "0"(v) : "memory" );
  2577. + return v;
  2578. +}
  2579. +
  2580. +#define a_xchg a_swap
  2581. +
  2582. +static inline int a_fetch_add(volatile int *x, int v)
  2583. +{
  2584. + __asm__( "lock ; xadd %0, %1" : "=r"(v), "=m"(*x) : "0"(v) : "memory" );
  2585. + return v;
  2586. +}
  2587. +
  2588. +static inline void a_inc(volatile int *x)
  2589. +{
  2590. + __asm__( "lock ; incl %0" : "=m"(*x) : "m"(*x) : "memory" );
  2591. +}
  2592. +
  2593. +static inline void a_dec(volatile int *x)
  2594. +{
  2595. + __asm__( "lock ; decl %0" : "=m"(*x) : "m"(*x) : "memory" );
  2596. +}
  2597. +
  2598. +static inline void a_store(volatile int *p, int x)
  2599. +{
  2600. + __asm__( "mov %1, %0" : "=m"(*p) : "r"(x) : "memory" );
  2601. +}
  2602. +
  2603. +static inline void a_spin()
  2604. +{
  2605. + __asm__ __volatile__( "pause" : : : "memory" );
  2606. +}
  2607. +
  2608. +static inline void a_crash()
  2609. +{
  2610. + __asm__ __volatile__( "hlt" : : : "memory" );
  2611. +}
  2612. +
  2613. +
  2614. +#endif
  2615. diff -Nur musl-0.9.15/arch/x32/bits/alltypes.h.in musl-git/arch/x32/bits/alltypes.h.in
  2616. --- musl-0.9.15/arch/x32/bits/alltypes.h.in 1970-01-01 01:00:00.000000000 +0100
  2617. +++ musl-git/arch/x32/bits/alltypes.h.in 2014-03-01 08:58:14.000000000 +0100
  2618. @@ -0,0 +1,28 @@
  2619. +#define _Addr int
  2620. +#define _Int64 long long
  2621. +#define _Reg long long
  2622. +
  2623. +TYPEDEF __builtin_va_list va_list;
  2624. +TYPEDEF __builtin_va_list __isoc_va_list;
  2625. +
  2626. +#ifndef __cplusplus
  2627. +TYPEDEF long wchar_t;
  2628. +#endif
  2629. +TYPEDEF unsigned wint_t;
  2630. +
  2631. +#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 2
  2632. +TYPEDEF long double float_t;
  2633. +TYPEDEF long double double_t;
  2634. +#else
  2635. +TYPEDEF float float_t;
  2636. +TYPEDEF double double_t;
  2637. +#endif
  2638. +
  2639. +TYPEDEF long long time_t;
  2640. +TYPEDEF long long suseconds_t;
  2641. +
  2642. +TYPEDEF struct { union { int __i[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
  2643. +TYPEDEF struct { union { int __i[10]; void *__p[5]; } __u; } pthread_mutex_t;
  2644. +TYPEDEF struct { union { int __i[12]; void *__p[6]; } __u; } pthread_cond_t;
  2645. +TYPEDEF struct { union { int __i[14]; void *__p[7]; } __u; } pthread_rwlock_t;
  2646. +TYPEDEF struct { union { int __i[8]; void *__p[4]; } __u; } pthread_barrier_t;
  2647. diff -Nur musl-0.9.15/arch/x32/bits/endian.h musl-git/arch/x32/bits/endian.h
  2648. --- musl-0.9.15/arch/x32/bits/endian.h 1970-01-01 01:00:00.000000000 +0100
  2649. +++ musl-git/arch/x32/bits/endian.h 2014-03-01 08:58:14.000000000 +0100
  2650. @@ -0,0 +1 @@
  2651. +#define __BYTE_ORDER __LITTLE_ENDIAN
  2652. diff -Nur musl-0.9.15/arch/x32/bits/errno.h musl-git/arch/x32/bits/errno.h
  2653. --- musl-0.9.15/arch/x32/bits/errno.h 1970-01-01 01:00:00.000000000 +0100
  2654. +++ musl-git/arch/x32/bits/errno.h 2014-03-01 08:58:14.000000000 +0100
  2655. @@ -0,0 +1,134 @@
  2656. +#define EPERM 1
  2657. +#define ENOENT 2
  2658. +#define ESRCH 3
  2659. +#define EINTR 4
  2660. +#define EIO 5
  2661. +#define ENXIO 6
  2662. +#define E2BIG 7
  2663. +#define ENOEXEC 8
  2664. +#define EBADF 9
  2665. +#define ECHILD 10
  2666. +#define EAGAIN 11
  2667. +#define ENOMEM 12
  2668. +#define EACCES 13
  2669. +#define EFAULT 14
  2670. +#define ENOTBLK 15
  2671. +#define EBUSY 16
  2672. +#define EEXIST 17
  2673. +#define EXDEV 18
  2674. +#define ENODEV 19
  2675. +#define ENOTDIR 20
  2676. +#define EISDIR 21
  2677. +#define EINVAL 22
  2678. +#define ENFILE 23
  2679. +#define EMFILE 24
  2680. +#define ENOTTY 25
  2681. +#define ETXTBSY 26
  2682. +#define EFBIG 27
  2683. +#define ENOSPC 28
  2684. +#define ESPIPE 29
  2685. +#define EROFS 30
  2686. +#define EMLINK 31
  2687. +#define EPIPE 32
  2688. +#define EDOM 33
  2689. +#define ERANGE 34
  2690. +#define EDEADLK 35
  2691. +#define ENAMETOOLONG 36
  2692. +#define ENOLCK 37
  2693. +#define ENOSYS 38
  2694. +#define ENOTEMPTY 39
  2695. +#define ELOOP 40
  2696. +#define EWOULDBLOCK EAGAIN
  2697. +#define ENOMSG 42
  2698. +#define EIDRM 43
  2699. +#define ECHRNG 44
  2700. +#define EL2NSYNC 45
  2701. +#define EL3HLT 46
  2702. +#define EL3RST 47
  2703. +#define ELNRNG 48
  2704. +#define EUNATCH 49
  2705. +#define ENOCSI 50
  2706. +#define EL2HLT 51
  2707. +#define EBADE 52
  2708. +#define EBADR 53
  2709. +#define EXFULL 54
  2710. +#define ENOANO 55
  2711. +#define EBADRQC 56
  2712. +#define EBADSLT 57
  2713. +#define EDEADLOCK EDEADLK
  2714. +#define EBFONT 59
  2715. +#define ENOSTR 60
  2716. +#define ENODATA 61
  2717. +#define ETIME 62
  2718. +#define ENOSR 63
  2719. +#define ENONET 64
  2720. +#define ENOPKG 65
  2721. +#define EREMOTE 66
  2722. +#define ENOLINK 67
  2723. +#define EADV 68
  2724. +#define ESRMNT 69
  2725. +#define ECOMM 70
  2726. +#define EPROTO 71
  2727. +#define EMULTIHOP 72
  2728. +#define EDOTDOT 73
  2729. +#define EBADMSG 74
  2730. +#define EOVERFLOW 75
  2731. +#define ENOTUNIQ 76
  2732. +#define EBADFD 77
  2733. +#define EREMCHG 78
  2734. +#define ELIBACC 79
  2735. +#define ELIBBAD 80
  2736. +#define ELIBSCN 81
  2737. +#define ELIBMAX 82
  2738. +#define ELIBEXEC 83
  2739. +#define EILSEQ 84
  2740. +#define ERESTART 85
  2741. +#define ESTRPIPE 86
  2742. +#define EUSERS 87
  2743. +#define ENOTSOCK 88
  2744. +#define EDESTADDRREQ 89
  2745. +#define EMSGSIZE 90
  2746. +#define EPROTOTYPE 91
  2747. +#define ENOPROTOOPT 92
  2748. +#define EPROTONOSUPPORT 93
  2749. +#define ESOCKTNOSUPPORT 94
  2750. +#define EOPNOTSUPP 95
  2751. +#define ENOTSUP EOPNOTSUPP
  2752. +#define EPFNOSUPPORT 96
  2753. +#define EAFNOSUPPORT 97
  2754. +#define EADDRINUSE 98
  2755. +#define EADDRNOTAVAIL 99
  2756. +#define ENETDOWN 100
  2757. +#define ENETUNREACH 101
  2758. +#define ENETRESET 102
  2759. +#define ECONNABORTED 103
  2760. +#define ECONNRESET 104
  2761. +#define ENOBUFS 105
  2762. +#define EISCONN 106
  2763. +#define ENOTCONN 107
  2764. +#define ESHUTDOWN 108
  2765. +#define ETOOMANYREFS 109
  2766. +#define ETIMEDOUT 110
  2767. +#define ECONNREFUSED 111
  2768. +#define EHOSTDOWN 112
  2769. +#define EHOSTUNREACH 113
  2770. +#define EALREADY 114
  2771. +#define EINPROGRESS 115
  2772. +#define ESTALE 116
  2773. +#define EUCLEAN 117
  2774. +#define ENOTNAM 118
  2775. +#define ENAVAIL 119
  2776. +#define EISNAM 120
  2777. +#define EREMOTEIO 121
  2778. +#define EDQUOT 122
  2779. +#define ENOMEDIUM 123
  2780. +#define EMEDIUMTYPE 124
  2781. +#define ECANCELED 125
  2782. +#define ENOKEY 126
  2783. +#define EKEYEXPIRED 127
  2784. +#define EKEYREVOKED 128
  2785. +#define EKEYREJECTED 129
  2786. +#define EOWNERDEAD 130
  2787. +#define ENOTRECOVERABLE 131
  2788. +#define ERFKILL 132
  2789. +#define EHWPOISON 133
  2790. diff -Nur musl-0.9.15/arch/x32/bits/fcntl.h musl-git/arch/x32/bits/fcntl.h
  2791. --- musl-0.9.15/arch/x32/bits/fcntl.h 1970-01-01 01:00:00.000000000 +0100
  2792. +++ musl-git/arch/x32/bits/fcntl.h 2014-03-01 08:58:14.000000000 +0100
  2793. @@ -0,0 +1,39 @@
  2794. +#define O_CREAT 0100
  2795. +#define O_EXCL 0200
  2796. +#define O_NOCTTY 0400
  2797. +#define O_TRUNC 01000
  2798. +#define O_APPEND 02000
  2799. +#define O_NONBLOCK 04000
  2800. +#define O_DSYNC 010000
  2801. +#define O_SYNC 04010000
  2802. +#define O_RSYNC 04010000
  2803. +#define O_DIRECTORY 0200000
  2804. +#define O_NOFOLLOW 0400000
  2805. +#define O_CLOEXEC 02000000
  2806. +
  2807. +#define O_ASYNC 020000
  2808. +#define O_DIRECT 040000
  2809. +#define O_LARGEFILE 0
  2810. +#define O_NOATIME 01000000
  2811. +#define O_TMPFILE 020200000
  2812. +#define O_NDELAY O_NONBLOCK
  2813. +
  2814. +#define F_DUPFD 0
  2815. +#define F_GETFD 1
  2816. +#define F_SETFD 2
  2817. +#define F_GETFL 3
  2818. +#define F_SETFL 4
  2819. +
  2820. +#define F_SETOWN 8
  2821. +#define F_GETOWN 9
  2822. +#define F_SETSIG 10
  2823. +#define F_GETSIG 11
  2824. +
  2825. +#define F_GETLK 5
  2826. +#define F_SETLK 6
  2827. +#define F_SETLKW 7
  2828. +
  2829. +#define F_SETOWN_EX 15
  2830. +#define F_GETOWN_EX 16
  2831. +
  2832. +#define F_GETOWNER_UIDS 17
  2833. diff -Nur musl-0.9.15/arch/x32/bits/fenv.h musl-git/arch/x32/bits/fenv.h
  2834. --- musl-0.9.15/arch/x32/bits/fenv.h 1970-01-01 01:00:00.000000000 +0100
  2835. +++ musl-git/arch/x32/bits/fenv.h 2014-03-01 08:58:14.000000000 +0100
  2836. @@ -0,0 +1,34 @@
  2837. +#define FE_INVALID 1
  2838. +#define __FE_DENORM 2
  2839. +#define FE_DIVBYZERO 4
  2840. +#define FE_OVERFLOW 8
  2841. +#define FE_UNDERFLOW 16
  2842. +#define FE_INEXACT 32
  2843. +
  2844. +#define FE_ALL_EXCEPT 63
  2845. +
  2846. +#define FE_TONEAREST 0
  2847. +#define FE_DOWNWARD 0x400
  2848. +#define FE_UPWARD 0x800
  2849. +#define FE_TOWARDZERO 0xc00
  2850. +
  2851. +typedef unsigned short fexcept_t;
  2852. +
  2853. +typedef struct {
  2854. + unsigned short __control_word;
  2855. + unsigned short __unused1;
  2856. + unsigned short __status_word;
  2857. + unsigned short __unused2;
  2858. + unsigned short __tags;
  2859. + unsigned short __unused3;
  2860. + unsigned int __eip;
  2861. + unsigned short __cs_selector;
  2862. + unsigned int __opcode:11;
  2863. + unsigned int __unused4:5;
  2864. + unsigned int __data_offset;
  2865. + unsigned short __data_selector;
  2866. + unsigned short __unused5;
  2867. + unsigned int __mxcsr;
  2868. +} fenv_t;
  2869. +
  2870. +#define FE_DFL_ENV ((const fenv_t *) -1)
  2871. diff -Nur musl-0.9.15/arch/x32/bits/float.h musl-git/arch/x32/bits/float.h
  2872. --- musl-0.9.15/arch/x32/bits/float.h 1970-01-01 01:00:00.000000000 +0100
  2873. +++ musl-git/arch/x32/bits/float.h 2014-03-01 08:58:14.000000000 +0100
  2874. @@ -0,0 +1,21 @@
  2875. +#define FLT_ROUNDS 1
  2876. +#ifdef __FLT_EVAL_METHOD__
  2877. +#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
  2878. +#else
  2879. +#define FLT_EVAL_METHOD 0
  2880. +#endif
  2881. +
  2882. +#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
  2883. +#define LDBL_MIN 3.3621031431120935063e-4932L
  2884. +#define LDBL_MAX 1.1897314953572317650e+4932L
  2885. +#define LDBL_EPSILON 1.0842021724855044340e-19L
  2886. +
  2887. +#define LDBL_MANT_DIG 64
  2888. +#define LDBL_MIN_EXP (-16381)
  2889. +#define LDBL_MAX_EXP 16384
  2890. +
  2891. +#define LDBL_DIG 18
  2892. +#define LDBL_MIN_10_EXP (-4931)
  2893. +#define LDBL_MAX_10_EXP 4932
  2894. +
  2895. +#define DECIMAL_DIG 21
  2896. diff -Nur musl-0.9.15/arch/x32/bits/ioctl.h musl-git/arch/x32/bits/ioctl.h
  2897. --- musl-0.9.15/arch/x32/bits/ioctl.h 1970-01-01 01:00:00.000000000 +0100
  2898. +++ musl-git/arch/x32/bits/ioctl.h 2014-03-01 08:58:14.000000000 +0100
  2899. @@ -0,0 +1,197 @@
  2900. +#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
  2901. +#define _IOC_NONE 0U
  2902. +#define _IOC_WRITE 1U
  2903. +#define _IOC_READ 2U
  2904. +
  2905. +#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
  2906. +#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
  2907. +#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
  2908. +#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
  2909. +
  2910. +#define TCGETS 0x5401
  2911. +#define TCSETS 0x5402
  2912. +#define TCSETSW 0x5403
  2913. +#define TCSETSF 0x5404
  2914. +#define TCGETA 0x5405
  2915. +#define TCSETA 0x5406
  2916. +#define TCSETAW 0x5407
  2917. +#define TCSETAF 0x5408
  2918. +#define TCSBRK 0x5409
  2919. +#define TCXONC 0x540A
  2920. +#define TCFLSH 0x540B
  2921. +#define TIOCEXCL 0x540C
  2922. +#define TIOCNXCL 0x540D
  2923. +#define TIOCSCTTY 0x540E
  2924. +#define TIOCGPGRP 0x540F
  2925. +#define TIOCSPGRP 0x5410
  2926. +#define TIOCOUTQ 0x5411
  2927. +#define TIOCSTI 0x5412
  2928. +#define TIOCGWINSZ 0x5413
  2929. +#define TIOCSWINSZ 0x5414
  2930. +#define TIOCMGET 0x5415
  2931. +#define TIOCMBIS 0x5416
  2932. +#define TIOCMBIC 0x5417
  2933. +#define TIOCMSET 0x5418
  2934. +#define TIOCGSOFTCAR 0x5419
  2935. +#define TIOCSSOFTCAR 0x541A
  2936. +#define FIONREAD 0x541B
  2937. +#define TIOCINQ FIONREAD
  2938. +#define TIOCLINUX 0x541C
  2939. +#define TIOCCONS 0x541D
  2940. +#define TIOCGSERIAL 0x541E
  2941. +#define TIOCSSERIAL 0x541F
  2942. +#define TIOCPKT 0x5420
  2943. +#define FIONBIO 0x5421
  2944. +#define TIOCNOTTY 0x5422
  2945. +#define TIOCSETD 0x5423
  2946. +#define TIOCGETD 0x5424
  2947. +#define TCSBRKP 0x5425
  2948. +#define TIOCTTYGSTRUCT 0x5426
  2949. +#define TIOCSBRK 0x5427
  2950. +#define TIOCCBRK 0x5428
  2951. +#define TIOCGSID 0x5429
  2952. +#define TIOCGPTN 0x80045430
  2953. +#define TIOCSPTLCK 0x40045431
  2954. +#define TCGETX 0x5432
  2955. +#define TCSETX 0x5433
  2956. +#define TCSETXF 0x5434
  2957. +#define TCSETXW 0x5435
  2958. +
  2959. +#define FIONCLEX 0x5450
  2960. +#define FIOCLEX 0x5451
  2961. +#define FIOASYNC 0x5452
  2962. +#define TIOCSERCONFIG 0x5453
  2963. +#define TIOCSERGWILD 0x5454
  2964. +#define TIOCSERSWILD 0x5455
  2965. +#define TIOCGLCKTRMIOS 0x5456
  2966. +#define TIOCSLCKTRMIOS 0x5457
  2967. +#define TIOCSERGSTRUCT 0x5458
  2968. +#define TIOCSERGETLSR 0x5459
  2969. +#define TIOCSERGETMULTI 0x545A
  2970. +#define TIOCSERSETMULTI 0x545B
  2971. +
  2972. +#define TIOCMIWAIT 0x545C
  2973. +#define TIOCGICOUNT 0x545D
  2974. +#define TIOCGHAYESESP 0x545E
  2975. +#define TIOCSHAYESESP 0x545F
  2976. +#define FIOQSIZE 0x5460
  2977. +
  2978. +#define TIOCPKT_DATA 0
  2979. +#define TIOCPKT_FLUSHREAD 1
  2980. +#define TIOCPKT_FLUSHWRITE 2
  2981. +#define TIOCPKT_STOP 4
  2982. +#define TIOCPKT_START 8
  2983. +#define TIOCPKT_NOSTOP 16
  2984. +#define TIOCPKT_DOSTOP 32
  2985. +#define TIOCPKT_IOCTL 64
  2986. +
  2987. +#define TIOCSER_TEMT 0x01
  2988. +
  2989. +struct winsize {
  2990. + unsigned short ws_row;
  2991. + unsigned short ws_col;
  2992. + unsigned short ws_xpixel;
  2993. + unsigned short ws_ypixel;
  2994. +};
  2995. +
  2996. +#define TIOCM_LE 0x001
  2997. +#define TIOCM_DTR 0x002
  2998. +#define TIOCM_RTS 0x004
  2999. +#define TIOCM_ST 0x008
  3000. +#define TIOCM_SR 0x010
  3001. +#define TIOCM_CTS 0x020
  3002. +#define TIOCM_CAR 0x040
  3003. +#define TIOCM_RNG 0x080
  3004. +#define TIOCM_DSR 0x100
  3005. +#define TIOCM_CD TIOCM_CAR
  3006. +#define TIOCM_RI TIOCM_RNG
  3007. +#define TIOCM_OUT1 0x2000
  3008. +#define TIOCM_OUT2 0x4000
  3009. +#define TIOCM_LOOP 0x8000
  3010. +#define TIOCM_MODEM_BITS TIOCM_OUT2
  3011. +
  3012. +#define N_TTY 0
  3013. +#define N_SLIP 1
  3014. +#define N_MOUSE 2
  3015. +#define N_PPP 3
  3016. +#define N_STRIP 4
  3017. +#define N_AX25 5
  3018. +#define N_X25 6
  3019. +#define N_6PACK 7
  3020. +#define N_MASC 8
  3021. +#define N_R3964 9
  3022. +#define N_PROFIBUS_FDL 10
  3023. +#define N_IRDA 11
  3024. +#define N_SMSBLOCK 12
  3025. +#define N_HDLC 13
  3026. +#define N_SYNC_PPP 14
  3027. +#define N_HCI 15
  3028. +
  3029. +#define FIOSETOWN 0x8901
  3030. +#define SIOCSPGRP 0x8902
  3031. +#define FIOGETOWN 0x8903
  3032. +#define SIOCGPGRP 0x8904
  3033. +#define SIOCATMARK 0x8905
  3034. +#define SIOCGSTAMP 0x8906
  3035. +
  3036. +#define SIOCADDRT 0x890B
  3037. +#define SIOCDELRT 0x890C
  3038. +#define SIOCRTMSG 0x890D
  3039. +
  3040. +#define SIOCGIFNAME 0x8910
  3041. +#define SIOCSIFLINK 0x8911
  3042. +#define SIOCGIFCONF 0x8912
  3043. +#define SIOCGIFFLAGS 0x8913
  3044. +#define SIOCSIFFLAGS 0x8914
  3045. +#define SIOCGIFADDR 0x8915
  3046. +#define SIOCSIFADDR 0x8916
  3047. +#define SIOCGIFDSTADDR 0x8917
  3048. +#define SIOCSIFDSTADDR 0x8918
  3049. +#define SIOCGIFBRDADDR 0x8919
  3050. +#define SIOCSIFBRDADDR 0x891a
  3051. +#define SIOCGIFNETMASK 0x891b
  3052. +#define SIOCSIFNETMASK 0x891c
  3053. +#define SIOCGIFMETRIC 0x891d
  3054. +#define SIOCSIFMETRIC 0x891e
  3055. +#define SIOCGIFMEM 0x891f
  3056. +#define SIOCSIFMEM 0x8920
  3057. +#define SIOCGIFMTU 0x8921
  3058. +#define SIOCSIFMTU 0x8922
  3059. +#define SIOCSIFHWADDR 0x8924
  3060. +#define SIOCGIFENCAP 0x8925
  3061. +#define SIOCSIFENCAP 0x8926
  3062. +#define SIOCGIFHWADDR 0x8927
  3063. +#define SIOCGIFSLAVE 0x8929
  3064. +#define SIOCSIFSLAVE 0x8930
  3065. +#define SIOCADDMULTI 0x8931
  3066. +#define SIOCDELMULTI 0x8932
  3067. +#define SIOCGIFINDEX 0x8933
  3068. +#define SIOGIFINDEX SIOCGIFINDEX
  3069. +#define SIOCSIFPFLAGS 0x8934
  3070. +#define SIOCGIFPFLAGS 0x8935
  3071. +#define SIOCDIFADDR 0x8936
  3072. +#define SIOCSIFHWBROADCAST 0x8937
  3073. +#define SIOCGIFCOUNT 0x8938
  3074. +
  3075. +#define SIOCGIFBR 0x8940
  3076. +#define SIOCSIFBR 0x8941
  3077. +
  3078. +#define SIOCGIFTXQLEN 0x8942
  3079. +#define SIOCSIFTXQLEN 0x8943
  3080. +
  3081. +#define SIOCDARP 0x8953
  3082. +#define SIOCGARP 0x8954
  3083. +#define SIOCSARP 0x8955
  3084. +
  3085. +#define SIOCDRARP 0x8960
  3086. +#define SIOCGRARP 0x8961
  3087. +#define SIOCSRARP 0x8962
  3088. +
  3089. +#define SIOCGIFMAP 0x8970
  3090. +#define SIOCSIFMAP 0x8971
  3091. +
  3092. +#define SIOCADDDLCI 0x8980
  3093. +#define SIOCDELDLCI 0x8981
  3094. +
  3095. +#define SIOCDEVPRIVATE 0x89F0
  3096. +#define SIOCPROTOPRIVATE 0x89E0
  3097. diff -Nur musl-0.9.15/arch/x32/bits/io.h musl-git/arch/x32/bits/io.h
  3098. --- musl-0.9.15/arch/x32/bits/io.h 1970-01-01 01:00:00.000000000 +0100
  3099. +++ musl-git/arch/x32/bits/io.h 2014-03-01 08:58:14.000000000 +0100
  3100. @@ -0,0 +1,77 @@
  3101. +static __inline void outb(unsigned char __val, unsigned short __port)
  3102. +{
  3103. + __asm__ volatile ("outb %0,%1" : : "a" (__val), "dN" (__port));
  3104. +}
  3105. +
  3106. +static __inline void outw(unsigned short __val, unsigned short __port)
  3107. +{
  3108. + __asm__ volatile ("outw %0,%1" : : "a" (__val), "dN" (__port));
  3109. +}
  3110. +
  3111. +static __inline void outl(unsigned int __val, unsigned short __port)
  3112. +{
  3113. + __asm__ volatile ("outl %0,%1" : : "a" (__val), "dN" (__port));
  3114. +}
  3115. +
  3116. +static __inline unsigned char inb(unsigned short __port)
  3117. +{
  3118. + unsigned char __val;
  3119. + __asm__ volatile ("inb %1,%0" : "=a" (__val) : "dN" (__port));
  3120. + return __val;
  3121. +}
  3122. +
  3123. +static __inline unsigned short inw(unsigned short __port)
  3124. +{
  3125. + unsigned short __val;
  3126. + __asm__ volatile ("inw %1,%0" : "=a" (__val) : "dN" (__port));
  3127. + return __val;
  3128. +}
  3129. +
  3130. +static __inline unsigned int inl(unsigned short __port)
  3131. +{
  3132. + unsigned int __val;
  3133. + __asm__ volatile ("inl %1,%0" : "=a" (__val) : "dN" (__port));
  3134. + return __val;
  3135. +}
  3136. +
  3137. +static __inline void outsb(unsigned short __port, const void *__buf, unsigned long __n)
  3138. +{
  3139. + __asm__ volatile ("cld; rep; outsb"
  3140. + : "+S" (__buf), "+c" (__n)
  3141. + : "d" (__port));
  3142. +}
  3143. +
  3144. +static __inline void outsw(unsigned short __port, const void *__buf, unsigned long __n)
  3145. +{
  3146. + __asm__ volatile ("cld; rep; outsw"
  3147. + : "+S" (__buf), "+c" (__n)
  3148. + : "d" (__port));
  3149. +}
  3150. +
  3151. +static __inline void outsl(unsigned short __port, const void *__buf, unsigned long __n)
  3152. +{
  3153. + __asm__ volatile ("cld; rep; outsl"
  3154. + : "+S" (__buf), "+c"(__n)
  3155. + : "d" (__port));
  3156. +}
  3157. +
  3158. +static __inline void insb(unsigned short __port, void *__buf, unsigned long __n)
  3159. +{
  3160. + __asm__ volatile ("cld; rep; insb"
  3161. + : "+D" (__buf), "+c" (__n)
  3162. + : "d" (__port));
  3163. +}
  3164. +
  3165. +static __inline void insw(unsigned short __port, void *__buf, unsigned long __n)
  3166. +{
  3167. + __asm__ volatile ("cld; rep; insw"
  3168. + : "+D" (__buf), "+c" (__n)
  3169. + : "d" (__port));
  3170. +}
  3171. +
  3172. +static __inline void insl(unsigned short __port, void *__buf, unsigned long __n)
  3173. +{
  3174. + __asm__ volatile ("cld; rep; insl"
  3175. + : "+D" (__buf), "+c" (__n)
  3176. + : "d" (__port));
  3177. +}
  3178. diff -Nur musl-0.9.15/arch/x32/bits/ipc.h musl-git/arch/x32/bits/ipc.h
  3179. --- musl-0.9.15/arch/x32/bits/ipc.h 1970-01-01 01:00:00.000000000 +0100
  3180. +++ musl-git/arch/x32/bits/ipc.h 2014-03-01 08:58:14.000000000 +0100
  3181. @@ -0,0 +1,14 @@
  3182. +struct ipc_perm
  3183. +{
  3184. + key_t __ipc_perm_key;
  3185. + uid_t uid;
  3186. + gid_t gid;
  3187. + uid_t cuid;
  3188. + gid_t cgid;
  3189. + mode_t mode;
  3190. + int __ipc_perm_seq;
  3191. + long long __pad1;
  3192. + long long __pad2;
  3193. +};
  3194. +
  3195. +#define IPC_64 0
  3196. diff -Nur musl-0.9.15/arch/x32/bits/limits.h musl-git/arch/x32/bits/limits.h
  3197. --- musl-0.9.15/arch/x32/bits/limits.h 1970-01-01 01:00:00.000000000 +0100
  3198. +++ musl-git/arch/x32/bits/limits.h 2014-03-01 08:58:14.000000000 +0100
  3199. @@ -0,0 +1,8 @@
  3200. +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  3201. + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3202. +#define PAGE_SIZE 4096
  3203. +#define LONG_BIT 32
  3204. +#endif
  3205. +
  3206. +#define LONG_MAX 0x7fffffffL
  3207. +#define LLONG_MAX 0x7fffffffffffffffLL
  3208. diff -Nur musl-0.9.15/arch/x32/bits/mman.h musl-git/arch/x32/bits/mman.h
  3209. --- musl-0.9.15/arch/x32/bits/mman.h 1970-01-01 01:00:00.000000000 +0100
  3210. +++ musl-git/arch/x32/bits/mman.h 2014-03-01 08:58:14.000000000 +0100
  3211. @@ -0,0 +1,62 @@
  3212. +#define MAP_FAILED ((void *) -1)
  3213. +
  3214. +#define PROT_NONE 0
  3215. +#define PROT_READ 1
  3216. +#define PROT_WRITE 2
  3217. +#define PROT_EXEC 4
  3218. +#define PROT_GROWSDOWN 0x01000000
  3219. +#define PROT_GROWSUP 0x02000000
  3220. +
  3221. +#define MAP_SHARED 0x01
  3222. +#define MAP_PRIVATE 0x02
  3223. +#define MAP_FIXED 0x10
  3224. +
  3225. +#define MAP_TYPE 0x0f
  3226. +#define MAP_FILE 0x00
  3227. +#define MAP_ANON 0x20
  3228. +#define MAP_ANONYMOUS MAP_ANON
  3229. +#define MAP_32BIT 0x40
  3230. +#define MAP_NORESERVE 0x4000
  3231. +#define MAP_GROWSDOWN 0x0100
  3232. +#define MAP_DENYWRITE 0x0800
  3233. +#define MAP_EXECUTABLE 0x1000
  3234. +#define MAP_LOCKED 0x2000
  3235. +#define MAP_POPULATE 0x8000
  3236. +#define MAP_NONBLOCK 0x10000
  3237. +#define MAP_STACK 0x20000
  3238. +#define MAP_HUGETLB 0x40000
  3239. +
  3240. +#define POSIX_MADV_NORMAL 0
  3241. +#define POSIX_MADV_RANDOM 1
  3242. +#define POSIX_MADV_SEQUENTIAL 2
  3243. +#define POSIX_MADV_WILLNEED 3
  3244. +#define POSIX_MADV_DONTNEED 0
  3245. +
  3246. +#define MS_ASYNC 1
  3247. +#define MS_INVALIDATE 2
  3248. +#define MS_SYNC 4
  3249. +
  3250. +#define MCL_CURRENT 1
  3251. +#define MCL_FUTURE 2
  3252. +
  3253. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3254. +#define MADV_NORMAL 0
  3255. +#define MADV_RANDOM 1
  3256. +#define MADV_SEQUENTIAL 2
  3257. +#define MADV_WILLNEED 3
  3258. +#define MADV_DONTNEED 4
  3259. +#define MADV_REMOVE 9
  3260. +#define MADV_DONTFORK 10
  3261. +#define MADV_DOFORK 11
  3262. +#define MADV_MERGEABLE 12
  3263. +#define MADV_UNMERGEABLE 13
  3264. +#define MADV_HUGEPAGE 14
  3265. +#define MADV_NOHUGEPAGE 15
  3266. +#define MADV_DONTDUMP 16
  3267. +#define MADV_DODUMP 17
  3268. +#define MADV_HWPOISON 100
  3269. +#define MADV_SOFT_OFFLINE 101
  3270. +
  3271. +#define MREMAP_MAYMOVE 1
  3272. +#define MREMAP_FIXED 2
  3273. +#endif
  3274. diff -Nur musl-0.9.15/arch/x32/bits/msg.h musl-git/arch/x32/bits/msg.h
  3275. --- musl-0.9.15/arch/x32/bits/msg.h 1970-01-01 01:00:00.000000000 +0100
  3276. +++ musl-git/arch/x32/bits/msg.h 2014-03-01 08:58:14.000000000 +0100
  3277. @@ -0,0 +1,16 @@
  3278. +struct msqid_ds
  3279. +{
  3280. + struct ipc_perm msg_perm;
  3281. + time_t msg_stime;
  3282. + time_t msg_rtime;
  3283. + time_t msg_ctime;
  3284. + unsigned long msg_cbytes;
  3285. + long __unused1;
  3286. + msgqnum_t msg_qnum;
  3287. + long __unused2;
  3288. + msglen_t msg_qbytes;
  3289. + long __unused3;
  3290. + pid_t msg_lspid;
  3291. + pid_t msg_lrpid;
  3292. + unsigned long long __unused[2];
  3293. +};
  3294. diff -Nur musl-0.9.15/arch/x32/bits/posix.h musl-git/arch/x32/bits/posix.h
  3295. --- musl-0.9.15/arch/x32/bits/posix.h 1970-01-01 01:00:00.000000000 +0100
  3296. +++ musl-git/arch/x32/bits/posix.h 2014-03-01 08:58:14.000000000 +0100
  3297. @@ -0,0 +1,2 @@
  3298. +#define _POSIX_V6_LP64_OFF64 1
  3299. +#define _POSIX_V7_LP64_OFF64 1
  3300. diff -Nur musl-0.9.15/arch/x32/bits/reg.h musl-git/arch/x32/bits/reg.h
  3301. --- musl-0.9.15/arch/x32/bits/reg.h 1970-01-01 01:00:00.000000000 +0100
  3302. +++ musl-git/arch/x32/bits/reg.h 2014-03-01 08:58:14.000000000 +0100
  3303. @@ -0,0 +1,29 @@
  3304. +#undef __WORDSIZE
  3305. +#define __WORDSIZE 32
  3306. +#define R15 0
  3307. +#define R14 1
  3308. +#define R13 2
  3309. +#define R12 3
  3310. +#define RBP 4
  3311. +#define RBX 5
  3312. +#define R11 6
  3313. +#define R10 7
  3314. +#define R9 8
  3315. +#define R8 9
  3316. +#define RAX 10
  3317. +#define RCX 11
  3318. +#define RDX 12
  3319. +#define RSI 13
  3320. +#define RDI 14
  3321. +#define ORIG_RAX 15
  3322. +#define RIP 16
  3323. +#define CS 17
  3324. +#define EFLAGS 18
  3325. +#define RSP 19
  3326. +#define SS 20
  3327. +#define FS_BASE 21
  3328. +#define GS_BASE 22
  3329. +#define DS 23
  3330. +#define ES 24
  3331. +#define FS 25
  3332. +#define GS 26
  3333. diff -Nur musl-0.9.15/arch/x32/bits/setjmp.h musl-git/arch/x32/bits/setjmp.h
  3334. --- musl-0.9.15/arch/x32/bits/setjmp.h 1970-01-01 01:00:00.000000000 +0100
  3335. +++ musl-git/arch/x32/bits/setjmp.h 2014-03-01 08:58:14.000000000 +0100
  3336. @@ -0,0 +1 @@
  3337. +typedef unsigned long long __jmp_buf[8];
  3338. diff -Nur musl-0.9.15/arch/x32/bits/shm.h musl-git/arch/x32/bits/shm.h
  3339. --- musl-0.9.15/arch/x32/bits/shm.h 1970-01-01 01:00:00.000000000 +0100
  3340. +++ musl-git/arch/x32/bits/shm.h 2014-03-01 08:58:14.000000000 +0100
  3341. @@ -0,0 +1,33 @@
  3342. +#define SHMLBA 4096
  3343. +
  3344. +struct shmid_ds
  3345. +{
  3346. + struct ipc_perm shm_perm;
  3347. + size_t shm_segsz;
  3348. + time_t shm_atime;
  3349. + time_t shm_dtime;
  3350. + time_t shm_ctime;
  3351. + pid_t shm_cpid;
  3352. + pid_t shm_lpid;
  3353. + unsigned long shm_nattch;
  3354. + unsigned long __pad0;
  3355. + unsigned long long __pad1;
  3356. + unsigned long long __pad2;
  3357. +};
  3358. +
  3359. +struct shminfo {
  3360. + unsigned long shmmax, __pad0, shmmin, __pad1, shmmni, __pad2,
  3361. + shmseg, __pad3, shmall, __pad4;
  3362. + unsigned long long __unused[4];
  3363. +};
  3364. +
  3365. +struct shm_info {
  3366. + int __used_ids;
  3367. + int __pad_ids;
  3368. + unsigned long shm_tot, __pad0, shm_rss, __pad1, shm_swp, __pad2;
  3369. + unsigned long __swap_attempts, __pad3, __swap_successes, __pad4;
  3370. +}
  3371. +#ifdef __GNUC__
  3372. +__attribute__((__aligned__(8)))
  3373. +#endif
  3374. +;
  3375. diff -Nur musl-0.9.15/arch/x32/bits/signal.h musl-git/arch/x32/bits/signal.h
  3376. --- musl-0.9.15/arch/x32/bits/signal.h 1970-01-01 01:00:00.000000000 +0100
  3377. +++ musl-git/arch/x32/bits/signal.h 2014-03-01 08:58:14.000000000 +0100
  3378. @@ -0,0 +1,119 @@
  3379. +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  3380. + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3381. +
  3382. +#ifdef _GNU_SOURCE
  3383. +#define REG_R8 0
  3384. +#define REG_R9 1
  3385. +#define REG_R10 2
  3386. +#define REG_R11 3
  3387. +#define REG_R12 4
  3388. +#define REG_R13 5
  3389. +#define REG_R14 6
  3390. +#define REG_R15 7
  3391. +#define REG_RDI 8
  3392. +#define REG_RSI 9
  3393. +#define REG_RBP 10
  3394. +#define REG_RBX 11
  3395. +#define REG_RDX 12
  3396. +#define REG_RAX 13
  3397. +#define REG_RCX 14
  3398. +#define REG_RSP 15
  3399. +#define REG_RIP 16
  3400. +#define REG_EFL 17
  3401. +#define REG_CSGSFS 18
  3402. +#define REG_ERR 19
  3403. +#define REG_TRAPNO 20
  3404. +#define REG_OLDMASK 21
  3405. +#define REG_CR2 22
  3406. +#endif
  3407. +
  3408. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3409. +typedef long long greg_t, gregset_t[23];
  3410. +typedef struct _fpstate {
  3411. + unsigned short cwd, swd, ftw, fop;
  3412. + unsigned long long rip, rdp;
  3413. + unsigned mxcsr, mxcr_mask;
  3414. + struct {
  3415. + unsigned short significand[4], exponent, padding[3];
  3416. + } _st[8];
  3417. + struct {
  3418. + unsigned element[4];
  3419. + } _xmm[16];
  3420. + unsigned padding[24];
  3421. +} *fpregset_t;
  3422. +struct sigcontext {
  3423. + unsigned long long r8, r9, r10, r11, r12, r13, r14, r15;
  3424. + unsigned long long rdi, rsi, rbp, rbx, rdx, rax, rcx, rsp, rip, eflags;
  3425. + unsigned short cs, gs, fs, __pad0;
  3426. + unsigned long long err, trapno, oldmask, cr2;
  3427. + struct _fpstate *fpstate;
  3428. + unsigned long long __reserved1[8];
  3429. +};
  3430. +typedef struct {
  3431. + gregset_t gregs;
  3432. + fpregset_t fpregs;
  3433. + unsigned long long __reserved1[8];
  3434. +} mcontext_t;
  3435. +#else
  3436. +typedef struct {
  3437. + unsigned long long __space[32];
  3438. +} mcontext_t;
  3439. +#endif
  3440. +
  3441. +typedef struct __ucontext {
  3442. + unsigned long uc_flags;
  3443. + struct __ucontext *uc_link;
  3444. + stack_t uc_stack;
  3445. + mcontext_t uc_mcontext;
  3446. + sigset_t uc_sigmask;
  3447. + unsigned long long __fpregs_mem[64];
  3448. +} ucontext_t;
  3449. +
  3450. +#define SA_NOCLDSTOP 1
  3451. +#define SA_NOCLDWAIT 2
  3452. +#define SA_SIGINFO 4
  3453. +#define SA_ONSTACK 0x08000000
  3454. +#define SA_RESTART 0x10000000
  3455. +#define SA_NODEFER 0x40000000
  3456. +#define SA_RESETHAND 0x80000000
  3457. +#define SA_RESTORER 0x04000000
  3458. +
  3459. +#endif
  3460. +
  3461. +#define SIGHUP 1
  3462. +#define SIGINT 2
  3463. +#define SIGQUIT 3
  3464. +#define SIGILL 4
  3465. +#define SIGTRAP 5
  3466. +#define SIGABRT 6
  3467. +#define SIGIOT SIGABRT
  3468. +#define SIGBUS 7
  3469. +#define SIGFPE 8
  3470. +#define SIGKILL 9
  3471. +#define SIGUSR1 10
  3472. +#define SIGSEGV 11
  3473. +#define SIGUSR2 12
  3474. +#define SIGPIPE 13
  3475. +#define SIGALRM 14
  3476. +#define SIGTERM 15
  3477. +#define SIGSTKFLT 16
  3478. +#define SIGCHLD 17
  3479. +#define SIGCONT 18
  3480. +#define SIGSTOP 19
  3481. +#define SIGTSTP 20
  3482. +#define SIGTTIN 21
  3483. +#define SIGTTOU 22
  3484. +#define SIGURG 23
  3485. +#define SIGXCPU 24
  3486. +#define SIGXFSZ 25
  3487. +#define SIGVTALRM 26
  3488. +#define SIGPROF 27
  3489. +#define SIGWINCH 28
  3490. +#define SIGIO 29
  3491. +#define SIGPOLL 29
  3492. +#define SIGPWR 30
  3493. +#define SIGSYS 31
  3494. +#define SIGUNUSED SIGSYS
  3495. +
  3496. +#define _NSIG 65
  3497. +
  3498. diff -Nur musl-0.9.15/arch/x32/bits/socket.h musl-git/arch/x32/bits/socket.h
  3499. --- musl-0.9.15/arch/x32/bits/socket.h 1970-01-01 01:00:00.000000000 +0100
  3500. +++ musl-git/arch/x32/bits/socket.h 2014-03-01 08:58:14.000000000 +0100
  3501. @@ -0,0 +1,18 @@
  3502. +struct msghdr
  3503. +{
  3504. + void *msg_name;
  3505. + socklen_t msg_namelen;
  3506. + struct iovec *msg_iov;
  3507. + int msg_iovlen, __pad1;
  3508. + void *msg_control;
  3509. + socklen_t msg_controllen, __pad2;
  3510. + int msg_flags;
  3511. +};
  3512. +
  3513. +struct cmsghdr
  3514. +{
  3515. + socklen_t cmsg_len;
  3516. + int __pad1;
  3517. + int cmsg_level;
  3518. + int cmsg_type;
  3519. +};
  3520. diff -Nur musl-0.9.15/arch/x32/bits/statfs.h musl-git/arch/x32/bits/statfs.h
  3521. --- musl-0.9.15/arch/x32/bits/statfs.h 1970-01-01 01:00:00.000000000 +0100
  3522. +++ musl-git/arch/x32/bits/statfs.h 2014-03-01 08:58:14.000000000 +0100
  3523. @@ -0,0 +1,7 @@
  3524. +struct statfs {
  3525. + unsigned long f_type, f_bsize;
  3526. + fsblkcnt_t f_blocks, f_bfree, f_bavail;
  3527. + fsfilcnt_t f_files, f_ffree;
  3528. + fsid_t f_fsid;
  3529. + unsigned long f_namelen, f_frsize, f_flags, f_spare[4];
  3530. +};
  3531. diff -Nur musl-0.9.15/arch/x32/bits/stat.h musl-git/arch/x32/bits/stat.h
  3532. --- musl-0.9.15/arch/x32/bits/stat.h 1970-01-01 01:00:00.000000000 +0100
  3533. +++ musl-git/arch/x32/bits/stat.h 2014-03-01 08:58:14.000000000 +0100
  3534. @@ -0,0 +1,22 @@
  3535. +/* copied from kernel definition, but with padding replaced
  3536. + * by the corresponding correctly-sized userspace types. */
  3537. +
  3538. +struct stat {
  3539. + dev_t st_dev;
  3540. + ino_t st_ino;
  3541. + nlink_t st_nlink;
  3542. +
  3543. + mode_t st_mode;
  3544. + uid_t st_uid;
  3545. + gid_t st_gid;
  3546. + unsigned int __pad0;
  3547. + dev_t st_rdev;
  3548. + off_t st_size;
  3549. + blksize_t st_blksize;
  3550. + blkcnt_t st_blocks;
  3551. +
  3552. + struct timespec st_atim;
  3553. + struct timespec st_mtim;
  3554. + struct timespec st_ctim;
  3555. + long long __unused[3];
  3556. +};
  3557. diff -Nur musl-0.9.15/arch/x32/bits/stdarg.h musl-git/arch/x32/bits/stdarg.h
  3558. --- musl-0.9.15/arch/x32/bits/stdarg.h 1970-01-01 01:00:00.000000000 +0100
  3559. +++ musl-git/arch/x32/bits/stdarg.h 2014-03-01 08:58:14.000000000 +0100
  3560. @@ -0,0 +1,4 @@
  3561. +#define va_start(v,l) __builtin_va_start(v,l)
  3562. +#define va_end(v) __builtin_va_end(v)
  3563. +#define va_arg(v,l) __builtin_va_arg(v,l)
  3564. +#define va_copy(d,s) __builtin_va_copy(d,s)
  3565. diff -Nur musl-0.9.15/arch/x32/bits/stdint.h musl-git/arch/x32/bits/stdint.h
  3566. --- musl-0.9.15/arch/x32/bits/stdint.h 1970-01-01 01:00:00.000000000 +0100
  3567. +++ musl-git/arch/x32/bits/stdint.h 2014-03-01 08:58:14.000000000 +0100
  3568. @@ -0,0 +1,20 @@
  3569. +typedef int32_t int_fast16_t;
  3570. +typedef int32_t int_fast32_t;
  3571. +typedef uint32_t uint_fast16_t;
  3572. +typedef uint32_t uint_fast32_t;
  3573. +
  3574. +#define INT_FAST16_MIN INT32_MIN
  3575. +#define INT_FAST32_MIN INT32_MIN
  3576. +
  3577. +#define INT_FAST16_MAX INT32_MAX
  3578. +#define INT_FAST32_MAX INT32_MAX
  3579. +
  3580. +#define UINT_FAST16_MAX UINT32_MAX
  3581. +#define UINT_FAST32_MAX UINT32_MAX
  3582. +
  3583. +#define INTPTR_MIN INT32_MIN
  3584. +#define INTPTR_MAX INT32_MAX
  3585. +#define UINTPTR_MAX UINT32_MAX
  3586. +#define PTRDIFF_MIN INT32_MIN
  3587. +#define PTRDIFF_MAX INT32_MAX
  3588. +#define SIZE_MAX UINT32_MAX
  3589. diff -Nur musl-0.9.15/arch/x32/bits/syscall.h musl-git/arch/x32/bits/syscall.h
  3590. --- musl-0.9.15/arch/x32/bits/syscall.h 1970-01-01 01:00:00.000000000 +0100
  3591. +++ musl-git/arch/x32/bits/syscall.h 2014-03-01 08:58:14.000000000 +0100
  3592. @@ -0,0 +1,634 @@
  3593. +#define __X32_SYSCALL_BIT 0x40000000
  3594. +#define __NR_read (__X32_SYSCALL_BIT + 0)
  3595. +#define __NR_write (__X32_SYSCALL_BIT + 1)
  3596. +#define __NR_open (__X32_SYSCALL_BIT + 2)
  3597. +#define __NR_close (__X32_SYSCALL_BIT + 3)
  3598. +#define __NR_stat (__X32_SYSCALL_BIT + 4)
  3599. +#define __NR_fstat (__X32_SYSCALL_BIT + 5)
  3600. +#define __NR_lstat (__X32_SYSCALL_BIT + 6)
  3601. +#define __NR_poll (__X32_SYSCALL_BIT + 7)
  3602. +#define __NR_lseek (__X32_SYSCALL_BIT + 8)
  3603. +#define __NR_mmap (__X32_SYSCALL_BIT + 9)
  3604. +#define __NR_mprotect (__X32_SYSCALL_BIT + 10)
  3605. +#define __NR_munmap (__X32_SYSCALL_BIT + 11)
  3606. +#define __NR_brk (__X32_SYSCALL_BIT + 12)
  3607. +#define __NR_rt_sigprocmask (__X32_SYSCALL_BIT + 14)
  3608. +#define __NR_pread64 (__X32_SYSCALL_BIT + 17)
  3609. +#define __NR_pwrite64 (__X32_SYSCALL_BIT + 18)
  3610. +#define __NR_access (__X32_SYSCALL_BIT + 21)
  3611. +#define __NR_pipe (__X32_SYSCALL_BIT + 22)
  3612. +#define __NR_select (__X32_SYSCALL_BIT + 23)
  3613. +#define __NR_sched_yield (__X32_SYSCALL_BIT + 24)
  3614. +#define __NR_mremap (__X32_SYSCALL_BIT + 25)
  3615. +#define __NR_msync (__X32_SYSCALL_BIT + 26)
  3616. +#define __NR_mincore (__X32_SYSCALL_BIT + 27)
  3617. +#define __NR_madvise (__X32_SYSCALL_BIT + 28)
  3618. +#define __NR_shmget (__X32_SYSCALL_BIT + 29)
  3619. +#define __NR_shmat (__X32_SYSCALL_BIT + 30)
  3620. +#define __NR_shmctl (__X32_SYSCALL_BIT + 31)
  3621. +#define __NR_dup (__X32_SYSCALL_BIT + 32)
  3622. +#define __NR_dup2 (__X32_SYSCALL_BIT + 33)
  3623. +#define __NR_pause (__X32_SYSCALL_BIT + 34)
  3624. +#define __NR_nanosleep (__X32_SYSCALL_BIT + 35)
  3625. +#define __NR_getitimer (__X32_SYSCALL_BIT + 36)
  3626. +#define __NR_alarm (__X32_SYSCALL_BIT + 37)
  3627. +#define __NR_setitimer (__X32_SYSCALL_BIT + 38)
  3628. +#define __NR_getpid (__X32_SYSCALL_BIT + 39)
  3629. +#define __NR_sendfile (__X32_SYSCALL_BIT + 40)
  3630. +#define __NR_socket (__X32_SYSCALL_BIT + 41)
  3631. +#define __NR_connect (__X32_SYSCALL_BIT + 42)
  3632. +#define __NR_accept (__X32_SYSCALL_BIT + 43)
  3633. +#define __NR_sendto (__X32_SYSCALL_BIT + 44)
  3634. +#define __NR_shutdown (__X32_SYSCALL_BIT + 48)
  3635. +#define __NR_bind (__X32_SYSCALL_BIT + 49)
  3636. +#define __NR_listen (__X32_SYSCALL_BIT + 50)
  3637. +#define __NR_getsockname (__X32_SYSCALL_BIT + 51)
  3638. +#define __NR_getpeername (__X32_SYSCALL_BIT + 52)
  3639. +#define __NR_socketpair (__X32_SYSCALL_BIT + 53)
  3640. +#define __NR_clone (__X32_SYSCALL_BIT + 56)
  3641. +#define __NR_fork (__X32_SYSCALL_BIT + 57)
  3642. +#define __NR_vfork (__X32_SYSCALL_BIT + 58)
  3643. +#define __NR_exit (__X32_SYSCALL_BIT + 60)
  3644. +#define __NR_wait4 (__X32_SYSCALL_BIT + 61)
  3645. +#define __NR_kill (__X32_SYSCALL_BIT + 62)
  3646. +#define __NR_uname (__X32_SYSCALL_BIT + 63)
  3647. +#define __NR_semget (__X32_SYSCALL_BIT + 64)
  3648. +#define __NR_semop (__X32_SYSCALL_BIT + 65)
  3649. +#define __NR_semctl (__X32_SYSCALL_BIT + 66)
  3650. +#define __NR_shmdt (__X32_SYSCALL_BIT + 67)
  3651. +#define __NR_msgget (__X32_SYSCALL_BIT + 68)
  3652. +#define __NR_msgsnd (__X32_SYSCALL_BIT + 69)
  3653. +#define __NR_msgrcv (__X32_SYSCALL_BIT + 70)
  3654. +#define __NR_msgctl (__X32_SYSCALL_BIT + 71)
  3655. +#define __NR_fcntl (__X32_SYSCALL_BIT + 72)
  3656. +#define __NR_flock (__X32_SYSCALL_BIT + 73)
  3657. +#define __NR_fsync (__X32_SYSCALL_BIT + 74)
  3658. +#define __NR_fdatasync (__X32_SYSCALL_BIT + 75)
  3659. +#define __NR_truncate (__X32_SYSCALL_BIT + 76)
  3660. +#define __NR_ftruncate (__X32_SYSCALL_BIT + 77)
  3661. +#define __NR_getdents (__X32_SYSCALL_BIT + 78)
  3662. +#define __NR_getcwd (__X32_SYSCALL_BIT + 79)
  3663. +#define __NR_chdir (__X32_SYSCALL_BIT + 80)
  3664. +#define __NR_fchdir (__X32_SYSCALL_BIT + 81)
  3665. +#define __NR_rename (__X32_SYSCALL_BIT + 82)
  3666. +#define __NR_mkdir (__X32_SYSCALL_BIT + 83)
  3667. +#define __NR_rmdir (__X32_SYSCALL_BIT + 84)
  3668. +#define __NR_creat (__X32_SYSCALL_BIT + 85)
  3669. +#define __NR_link (__X32_SYSCALL_BIT + 86)
  3670. +#define __NR_unlink (__X32_SYSCALL_BIT + 87)
  3671. +#define __NR_symlink (__X32_SYSCALL_BIT + 88)
  3672. +#define __NR_readlink (__X32_SYSCALL_BIT + 89)
  3673. +#define __NR_chmod (__X32_SYSCALL_BIT + 90)
  3674. +#define __NR_fchmod (__X32_SYSCALL_BIT + 91)
  3675. +#define __NR_chown (__X32_SYSCALL_BIT + 92)
  3676. +#define __NR_fchown (__X32_SYSCALL_BIT + 93)
  3677. +#define __NR_lchown (__X32_SYSCALL_BIT + 94)
  3678. +#define __NR_umask (__X32_SYSCALL_BIT + 95)
  3679. +#define __NR_gettimeofday (__X32_SYSCALL_BIT + 96)
  3680. +#define __NR_getrlimit (__X32_SYSCALL_BIT + 97)
  3681. +#define __NR_getrusage (__X32_SYSCALL_BIT + 98)
  3682. +#define __NR_sysinfo (__X32_SYSCALL_BIT + 99)
  3683. +#define __NR_times (__X32_SYSCALL_BIT + 100)
  3684. +#define __NR_getuid (__X32_SYSCALL_BIT + 102)
  3685. +#define __NR_syslog (__X32_SYSCALL_BIT + 103)
  3686. +#define __NR_getgid (__X32_SYSCALL_BIT + 104)
  3687. +#define __NR_setuid (__X32_SYSCALL_BIT + 105)
  3688. +#define __NR_setgid (__X32_SYSCALL_BIT + 106)
  3689. +#define __NR_geteuid (__X32_SYSCALL_BIT + 107)
  3690. +#define __NR_getegid (__X32_SYSCALL_BIT + 108)
  3691. +#define __NR_setpgid (__X32_SYSCALL_BIT + 109)
  3692. +#define __NR_getppid (__X32_SYSCALL_BIT + 110)
  3693. +#define __NR_getpgrp (__X32_SYSCALL_BIT + 111)
  3694. +#define __NR_setsid (__X32_SYSCALL_BIT + 112)
  3695. +#define __NR_setreuid (__X32_SYSCALL_BIT + 113)
  3696. +#define __NR_setregid (__X32_SYSCALL_BIT + 114)
  3697. +#define __NR_getgroups (__X32_SYSCALL_BIT + 115)
  3698. +#define __NR_setgroups (__X32_SYSCALL_BIT + 116)
  3699. +#define __NR_setresuid (__X32_SYSCALL_BIT + 117)
  3700. +#define __NR_getresuid (__X32_SYSCALL_BIT + 118)
  3701. +#define __NR_setresgid (__X32_SYSCALL_BIT + 119)
  3702. +#define __NR_getresgid (__X32_SYSCALL_BIT + 120)
  3703. +#define __NR_getpgid (__X32_SYSCALL_BIT + 121)
  3704. +#define __NR_setfsuid (__X32_SYSCALL_BIT + 122)
  3705. +#define __NR_setfsgid (__X32_SYSCALL_BIT + 123)
  3706. +#define __NR_getsid (__X32_SYSCALL_BIT + 124)
  3707. +#define __NR_capget (__X32_SYSCALL_BIT + 125)
  3708. +#define __NR_capset (__X32_SYSCALL_BIT + 126)
  3709. +#define __NR_rt_sigsuspend (__X32_SYSCALL_BIT + 130)
  3710. +#define __NR_utime (__X32_SYSCALL_BIT + 132)
  3711. +#define __NR_mknod (__X32_SYSCALL_BIT + 133)
  3712. +#define __NR_personality (__X32_SYSCALL_BIT + 135)
  3713. +#define __NR_ustat (__X32_SYSCALL_BIT + 136)
  3714. +#define __NR_statfs (__X32_SYSCALL_BIT + 137)
  3715. +#define __NR_fstatfs (__X32_SYSCALL_BIT + 138)
  3716. +#define __NR_sysfs (__X32_SYSCALL_BIT + 139)
  3717. +#define __NR_getpriority (__X32_SYSCALL_BIT + 140)
  3718. +#define __NR_setpriority (__X32_SYSCALL_BIT + 141)
  3719. +#define __NR_sched_setparam (__X32_SYSCALL_BIT + 142)
  3720. +#define __NR_sched_getparam (__X32_SYSCALL_BIT + 143)
  3721. +#define __NR_sched_setscheduler (__X32_SYSCALL_BIT + 144)
  3722. +#define __NR_sched_getscheduler (__X32_SYSCALL_BIT + 145)
  3723. +#define __NR_sched_get_priority_max (__X32_SYSCALL_BIT + 146)
  3724. +#define __NR_sched_get_priority_min (__X32_SYSCALL_BIT + 147)
  3725. +#define __NR_sched_rr_get_interval (__X32_SYSCALL_BIT + 148)
  3726. +#define __NR_mlock (__X32_SYSCALL_BIT + 149)
  3727. +#define __NR_munlock (__X32_SYSCALL_BIT + 150)
  3728. +#define __NR_mlockall (__X32_SYSCALL_BIT + 151)
  3729. +#define __NR_munlockall (__X32_SYSCALL_BIT + 152)
  3730. +#define __NR_vhangup (__X32_SYSCALL_BIT + 153)
  3731. +#define __NR_modify_ldt (__X32_SYSCALL_BIT + 154)
  3732. +#define __NR_pivot_root (__X32_SYSCALL_BIT + 155)
  3733. +#define __NR_prctl (__X32_SYSCALL_BIT + 157)
  3734. +#define __NR_arch_prctl (__X32_SYSCALL_BIT + 158)
  3735. +#define __NR_adjtimex (__X32_SYSCALL_BIT + 159)
  3736. +#define __NR_setrlimit (__X32_SYSCALL_BIT + 160)
  3737. +#define __NR_chroot (__X32_SYSCALL_BIT + 161)
  3738. +#define __NR_sync (__X32_SYSCALL_BIT + 162)
  3739. +#define __NR_acct (__X32_SYSCALL_BIT + 163)
  3740. +#define __NR_settimeofday (__X32_SYSCALL_BIT + 164)
  3741. +#define __NR_mount (__X32_SYSCALL_BIT + 165)
  3742. +#define __NR_umount2 (__X32_SYSCALL_BIT + 166)
  3743. +#define __NR_swapon (__X32_SYSCALL_BIT + 167)
  3744. +#define __NR_swapoff (__X32_SYSCALL_BIT + 168)
  3745. +#define __NR_reboot (__X32_SYSCALL_BIT + 169)
  3746. +#define __NR_sethostname (__X32_SYSCALL_BIT + 170)
  3747. +#define __NR_setdomainname (__X32_SYSCALL_BIT + 171)
  3748. +#define __NR_iopl (__X32_SYSCALL_BIT + 172)
  3749. +#define __NR_ioperm (__X32_SYSCALL_BIT + 173)
  3750. +#define __NR_init_module (__X32_SYSCALL_BIT + 175)
  3751. +#define __NR_delete_module (__X32_SYSCALL_BIT + 176)
  3752. +#define __NR_quotactl (__X32_SYSCALL_BIT + 179)
  3753. +#define __NR_getpmsg (__X32_SYSCALL_BIT + 181)
  3754. +#define __NR_putpmsg (__X32_SYSCALL_BIT + 182)
  3755. +#define __NR_afs_syscall (__X32_SYSCALL_BIT + 183)
  3756. +#define __NR_tuxcall (__X32_SYSCALL_BIT + 184)
  3757. +#define __NR_security (__X32_SYSCALL_BIT + 185)
  3758. +#define __NR_gettid (__X32_SYSCALL_BIT + 186)
  3759. +#define __NR_readahead (__X32_SYSCALL_BIT + 187)
  3760. +#define __NR_setxattr (__X32_SYSCALL_BIT + 188)
  3761. +#define __NR_lsetxattr (__X32_SYSCALL_BIT + 189)
  3762. +#define __NR_fsetxattr (__X32_SYSCALL_BIT + 190)
  3763. +#define __NR_getxattr (__X32_SYSCALL_BIT + 191)
  3764. +#define __NR_lgetxattr (__X32_SYSCALL_BIT + 192)
  3765. +#define __NR_fgetxattr (__X32_SYSCALL_BIT + 193)
  3766. +#define __NR_listxattr (__X32_SYSCALL_BIT + 194)
  3767. +#define __NR_llistxattr (__X32_SYSCALL_BIT + 195)
  3768. +#define __NR_flistxattr (__X32_SYSCALL_BIT + 196)
  3769. +#define __NR_removexattr (__X32_SYSCALL_BIT + 197)
  3770. +#define __NR_lremovexattr (__X32_SYSCALL_BIT + 198)
  3771. +#define __NR_fremovexattr (__X32_SYSCALL_BIT + 199)
  3772. +#define __NR_tkill (__X32_SYSCALL_BIT + 200)
  3773. +#define __NR_time (__X32_SYSCALL_BIT + 201)
  3774. +#define __NR_futex (__X32_SYSCALL_BIT + 202)
  3775. +#define __NR_sched_setaffinity (__X32_SYSCALL_BIT + 203)
  3776. +#define __NR_sched_getaffinity (__X32_SYSCALL_BIT + 204)
  3777. +#define __NR_io_setup (__X32_SYSCALL_BIT + 206)
  3778. +#define __NR_io_destroy (__X32_SYSCALL_BIT + 207)
  3779. +#define __NR_io_getevents (__X32_SYSCALL_BIT + 208)
  3780. +#define __NR_io_submit (__X32_SYSCALL_BIT + 209)
  3781. +#define __NR_io_cancel (__X32_SYSCALL_BIT + 210)
  3782. +#define __NR_lookup_dcookie (__X32_SYSCALL_BIT + 212)
  3783. +#define __NR_epoll_create (__X32_SYSCALL_BIT + 213)
  3784. +#define __NR_remap_file_pages (__X32_SYSCALL_BIT + 216)
  3785. +#define __NR_getdents64 (__X32_SYSCALL_BIT + 217)
  3786. +#define __NR_set_tid_address (__X32_SYSCALL_BIT + 218)
  3787. +#define __NR_restart_syscall (__X32_SYSCALL_BIT + 219)
  3788. +#define __NR_semtimedop (__X32_SYSCALL_BIT + 220)
  3789. +#define __NR_fadvise64 (__X32_SYSCALL_BIT + 221)
  3790. +#define __NR_timer_settime (__X32_SYSCALL_BIT + 223)
  3791. +#define __NR_timer_gettime (__X32_SYSCALL_BIT + 224)
  3792. +#define __NR_timer_getoverrun (__X32_SYSCALL_BIT + 225)
  3793. +#define __NR_timer_delete (__X32_SYSCALL_BIT + 226)
  3794. +#define __NR_clock_settime (__X32_SYSCALL_BIT + 227)
  3795. +#define __NR_clock_gettime (__X32_SYSCALL_BIT + 228)
  3796. +#define __NR_clock_getres (__X32_SYSCALL_BIT + 229)
  3797. +#define __NR_clock_nanosleep (__X32_SYSCALL_BIT + 230)
  3798. +#define __NR_exit_group (__X32_SYSCALL_BIT + 231)
  3799. +#define __NR_epoll_wait (__X32_SYSCALL_BIT + 232)
  3800. +#define __NR_epoll_ctl (__X32_SYSCALL_BIT + 233)
  3801. +#define __NR_tgkill (__X32_SYSCALL_BIT + 234)
  3802. +#define __NR_utimes (__X32_SYSCALL_BIT + 235)
  3803. +#define __NR_mbind (__X32_SYSCALL_BIT + 237)
  3804. +#define __NR_set_mempolicy (__X32_SYSCALL_BIT + 238)
  3805. +#define __NR_get_mempolicy (__X32_SYSCALL_BIT + 239)
  3806. +#define __NR_mq_open (__X32_SYSCALL_BIT + 240)
  3807. +#define __NR_mq_unlink (__X32_SYSCALL_BIT + 241)
  3808. +#define __NR_mq_timedsend (__X32_SYSCALL_BIT + 242)
  3809. +#define __NR_mq_timedreceive (__X32_SYSCALL_BIT + 243)
  3810. +#define __NR_mq_getsetattr (__X32_SYSCALL_BIT + 245)
  3811. +#define __NR_add_key (__X32_SYSCALL_BIT + 248)
  3812. +#define __NR_request_key (__X32_SYSCALL_BIT + 249)
  3813. +#define __NR_keyctl (__X32_SYSCALL_BIT + 250)
  3814. +#define __NR_ioprio_set (__X32_SYSCALL_BIT + 251)
  3815. +#define __NR_ioprio_get (__X32_SYSCALL_BIT + 252)
  3816. +#define __NR_inotify_init (__X32_SYSCALL_BIT + 253)
  3817. +#define __NR_inotify_add_watch (__X32_SYSCALL_BIT + 254)
  3818. +#define __NR_inotify_rm_watch (__X32_SYSCALL_BIT + 255)
  3819. +#define __NR_migrate_pages (__X32_SYSCALL_BIT + 256)
  3820. +#define __NR_openat (__X32_SYSCALL_BIT + 257)
  3821. +#define __NR_mkdirat (__X32_SYSCALL_BIT + 258)
  3822. +#define __NR_mknodat (__X32_SYSCALL_BIT + 259)
  3823. +#define __NR_fchownat (__X32_SYSCALL_BIT + 260)
  3824. +#define __NR_futimesat (__X32_SYSCALL_BIT + 261)
  3825. +#define __NR_newfstatat (__X32_SYSCALL_BIT + 262)
  3826. +#define __NR_unlinkat (__X32_SYSCALL_BIT + 263)
  3827. +#define __NR_renameat (__X32_SYSCALL_BIT + 264)
  3828. +#define __NR_linkat (__X32_SYSCALL_BIT + 265)
  3829. +#define __NR_symlinkat (__X32_SYSCALL_BIT + 266)
  3830. +#define __NR_readlinkat (__X32_SYSCALL_BIT + 267)
  3831. +#define __NR_fchmodat (__X32_SYSCALL_BIT + 268)
  3832. +#define __NR_faccessat (__X32_SYSCALL_BIT + 269)
  3833. +#define __NR_pselect6 (__X32_SYSCALL_BIT + 270)
  3834. +#define __NR_ppoll (__X32_SYSCALL_BIT + 271)
  3835. +#define __NR_unshare (__X32_SYSCALL_BIT + 272)
  3836. +#define __NR_splice (__X32_SYSCALL_BIT + 275)
  3837. +#define __NR_tee (__X32_SYSCALL_BIT + 276)
  3838. +#define __NR_sync_file_range (__X32_SYSCALL_BIT + 277)
  3839. +#define __NR_utimensat (__X32_SYSCALL_BIT + 280)
  3840. +#define __NR_epoll_pwait (__X32_SYSCALL_BIT + 281)
  3841. +#define __NR_signalfd (__X32_SYSCALL_BIT + 282)
  3842. +#define __NR_timerfd_create (__X32_SYSCALL_BIT + 283)
  3843. +#define __NR_eventfd (__X32_SYSCALL_BIT + 284)
  3844. +#define __NR_fallocate (__X32_SYSCALL_BIT + 285)
  3845. +#define __NR_timerfd_settime (__X32_SYSCALL_BIT + 286)
  3846. +#define __NR_timerfd_gettime (__X32_SYSCALL_BIT + 287)
  3847. +#define __NR_accept4 (__X32_SYSCALL_BIT + 288)
  3848. +#define __NR_signalfd4 (__X32_SYSCALL_BIT + 289)
  3849. +#define __NR_eventfd2 (__X32_SYSCALL_BIT + 290)
  3850. +#define __NR_epoll_create1 (__X32_SYSCALL_BIT + 291)
  3851. +#define __NR_dup3 (__X32_SYSCALL_BIT + 292)
  3852. +#define __NR_pipe2 (__X32_SYSCALL_BIT + 293)
  3853. +#define __NR_inotify_init1 (__X32_SYSCALL_BIT + 294)
  3854. +#define __NR_perf_event_open (__X32_SYSCALL_BIT + 298)
  3855. +#define __NR_fanotify_init (__X32_SYSCALL_BIT + 300)
  3856. +#define __NR_fanotify_mark (__X32_SYSCALL_BIT + 301)
  3857. +#define __NR_prlimit64 (__X32_SYSCALL_BIT + 302)
  3858. +#define __NR_name_to_handle_at (__X32_SYSCALL_BIT + 303)
  3859. +#define __NR_open_by_handle_at (__X32_SYSCALL_BIT + 304)
  3860. +#define __NR_clock_adjtime (__X32_SYSCALL_BIT + 305)
  3861. +#define __NR_syncfs (__X32_SYSCALL_BIT + 306)
  3862. +#define __NR_setns (__X32_SYSCALL_BIT + 308)
  3863. +#define __NR_getcpu (__X32_SYSCALL_BIT + 309)
  3864. +#define __NR_kcmp (__X32_SYSCALL_BIT + 312)
  3865. +#define __NR_finit_module (__X32_SYSCALL_BIT + 313)
  3866. +#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
  3867. +#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
  3868. +#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
  3869. +#define __NR_readv (__X32_SYSCALL_BIT + 515)
  3870. +#define __NR_writev (__X32_SYSCALL_BIT + 516)
  3871. +#define __NR_recvfrom (__X32_SYSCALL_BIT + 517)
  3872. +#define __NR_sendmsg (__X32_SYSCALL_BIT + 518)
  3873. +#define __NR_recvmsg (__X32_SYSCALL_BIT + 519)
  3874. +#define __NR_execve (__X32_SYSCALL_BIT + 520)
  3875. +#define __NR_ptrace (__X32_SYSCALL_BIT + 521)
  3876. +#define __NR_rt_sigpending (__X32_SYSCALL_BIT + 522)
  3877. +#define __NR_rt_sigtimedwait (__X32_SYSCALL_BIT + 523)
  3878. +#define __NR_rt_sigqueueinfo (__X32_SYSCALL_BIT + 524)
  3879. +#define __NR_sigaltstack (__X32_SYSCALL_BIT + 525)
  3880. +#define __NR_timer_create (__X32_SYSCALL_BIT + 526)
  3881. +#define __NR_mq_notify (__X32_SYSCALL_BIT + 527)
  3882. +#define __NR_kexec_load (__X32_SYSCALL_BIT + 528)
  3883. +#define __NR_waitid (__X32_SYSCALL_BIT + 529)
  3884. +#define __NR_set_robust_list (__X32_SYSCALL_BIT + 530)
  3885. +#define __NR_get_robust_list (__X32_SYSCALL_BIT + 531)
  3886. +#define __NR_vmsplice (__X32_SYSCALL_BIT + 532)
  3887. +#define __NR_move_pages (__X32_SYSCALL_BIT + 533)
  3888. +#define __NR_preadv (__X32_SYSCALL_BIT + 534)
  3889. +#define __NR_pwritev (__X32_SYSCALL_BIT + 535)
  3890. +#define __NR_rt_tgsigqueueinfo (__X32_SYSCALL_BIT + 536)
  3891. +#define __NR_recvmmsg (__X32_SYSCALL_BIT + 537)
  3892. +#define __NR_sendmmsg (__X32_SYSCALL_BIT + 538)
  3893. +#define __NR_process_vm_readv (__X32_SYSCALL_BIT + 539)
  3894. +#define __NR_process_vm_writev (__X32_SYSCALL_BIT + 540)
  3895. +#define __NR_setsockopt (__X32_SYSCALL_BIT + 541)
  3896. +#define __NR_getsockopt (__X32_SYSCALL_BIT + 542)
  3897. +
  3898. +#undef __NR_fstatat
  3899. +#undef __NR_pread
  3900. +#undef __NR_pwrite
  3901. +#undef __NR_getdents
  3902. +#define __NR_fstatat __NR_newfstatat
  3903. +#define __NR_pread __NR_pread64
  3904. +#define __NR_pwrite __NR_pwrite64
  3905. +#define __NR_getdents __NR_getdents64
  3906. +#define __NR_fadvise __NR_fadvise64
  3907. +
  3908. +
  3909. +
  3910. +/* Repeat with SYS_ prefix */
  3911. +
  3912. +
  3913. +
  3914. +#define SYS_read __NR_read
  3915. +#define SYS_write __NR_write
  3916. +#define SYS_open __NR_open
  3917. +#define SYS_close __NR_close
  3918. +#define SYS_stat __NR_stat
  3919. +#define SYS_fstat __NR_fstat
  3920. +#define SYS_lstat __NR_lstat
  3921. +#define SYS_poll __NR_poll
  3922. +#define SYS_lseek __NR_lseek
  3923. +#define SYS_mmap __NR_mmap
  3924. +#define SYS_mprotect __NR_mprotect
  3925. +#define SYS_munmap __NR_munmap
  3926. +#define SYS_brk __NR_brk
  3927. +#define SYS_rt_sigprocmask __NR_rt_sigprocmask
  3928. +#define SYS_pread64 __NR_pread64
  3929. +#define SYS_pwrite64 __NR_pwrite64
  3930. +#define SYS_access __NR_access
  3931. +#define SYS_pipe __NR_pipe
  3932. +#define SYS_select __NR_select
  3933. +#define SYS_sched_yield __NR_sched_yield
  3934. +#define SYS_mremap __NR_mremap
  3935. +#define SYS_msync __NR_msync
  3936. +#define SYS_mincore __NR_mincore
  3937. +#define SYS_madvise __NR_madvise
  3938. +#define SYS_shmget __NR_shmget
  3939. +#define SYS_shmat __NR_shmat
  3940. +#define SYS_shmctl __NR_shmctl
  3941. +#define SYS_dup __NR_dup
  3942. +#define SYS_dup2 __NR_dup2
  3943. +#define SYS_pause __NR_pause
  3944. +#define SYS_nanosleep __NR_nanosleep
  3945. +#define SYS_getitimer __NR_getitimer
  3946. +#define SYS_alarm __NR_alarm
  3947. +#define SYS_setitimer __NR_setitimer
  3948. +#define SYS_getpid __NR_getpid
  3949. +#define SYS_sendfile __NR_sendfile
  3950. +#define SYS_socket __NR_socket
  3951. +#define SYS_connect __NR_connect
  3952. +#define SYS_accept __NR_accept
  3953. +#define SYS_sendto __NR_sendto
  3954. +#define SYS_shutdown __NR_shutdown
  3955. +#define SYS_bind __NR_bind
  3956. +#define SYS_listen __NR_listen
  3957. +#define SYS_getsockname __NR_getsockname
  3958. +#define SYS_getpeername __NR_getpeername
  3959. +#define SYS_socketpair __NR_socketpair
  3960. +#define SYS_clone __NR_clone
  3961. +#define SYS_fork __NR_fork
  3962. +#define SYS_vfork __NR_vfork
  3963. +#define SYS_exit __NR_exit
  3964. +#define SYS_wait4 __NR_wait4
  3965. +#define SYS_kill __NR_kill
  3966. +#define SYS_uname __NR_uname
  3967. +#define SYS_semget __NR_semget
  3968. +#define SYS_semop __NR_semop
  3969. +#define SYS_semctl __NR_semctl
  3970. +#define SYS_shmdt __NR_shmdt
  3971. +#define SYS_msgget __NR_msgget
  3972. +#define SYS_msgsnd __NR_msgsnd
  3973. +#define SYS_msgrcv __NR_msgrcv
  3974. +#define SYS_msgctl __NR_msgctl
  3975. +#define SYS_fcntl __NR_fcntl
  3976. +#define SYS_flock __NR_flock
  3977. +#define SYS_fsync __NR_fsync
  3978. +#define SYS_fdatasync __NR_fdatasync
  3979. +#define SYS_truncate __NR_truncate
  3980. +#define SYS_ftruncate __NR_ftruncate
  3981. +#define SYS_getdents __NR_getdents
  3982. +#define SYS_getcwd __NR_getcwd
  3983. +#define SYS_chdir __NR_chdir
  3984. +#define SYS_fchdir __NR_fchdir
  3985. +#define SYS_rename __NR_rename
  3986. +#define SYS_mkdir __NR_mkdir
  3987. +#define SYS_rmdir __NR_rmdir
  3988. +#define SYS_creat __NR_creat
  3989. +#define SYS_link __NR_link
  3990. +#define SYS_unlink __NR_unlink
  3991. +#define SYS_symlink __NR_symlink
  3992. +#define SYS_readlink __NR_readlink
  3993. +#define SYS_chmod __NR_chmod
  3994. +#define SYS_fchmod __NR_fchmod
  3995. +#define SYS_chown __NR_chown
  3996. +#define SYS_fchown __NR_fchown
  3997. +#define SYS_lchown __NR_lchown
  3998. +#define SYS_umask __NR_umask
  3999. +#define SYS_gettimeofday __NR_gettimeofday
  4000. +#define SYS_getrlimit __NR_getrlimit
  4001. +#define SYS_getrusage __NR_getrusage
  4002. +#define SYS_sysinfo __NR_sysinfo
  4003. +#define SYS_times __NR_times
  4004. +#define SYS_getuid __NR_getuid
  4005. +#define SYS_syslog __NR_syslog
  4006. +#define SYS_getgid __NR_getgid
  4007. +#define SYS_setuid __NR_setuid
  4008. +#define SYS_setgid __NR_setgid
  4009. +#define SYS_geteuid __NR_geteuid
  4010. +#define SYS_getegid __NR_getegid
  4011. +#define SYS_setpgid __NR_setpgid
  4012. +#define SYS_getppid __NR_getppid
  4013. +#define SYS_getpgrp __NR_getpgrp
  4014. +#define SYS_setsid __NR_setsid
  4015. +#define SYS_setreuid __NR_setreuid
  4016. +#define SYS_setregid __NR_setregid
  4017. +#define SYS_getgroups __NR_getgroups
  4018. +#define SYS_setgroups __NR_setgroups
  4019. +#define SYS_setresuid __NR_setresuid
  4020. +#define SYS_getresuid __NR_getresuid
  4021. +#define SYS_setresgid __NR_setresgid
  4022. +#define SYS_getresgid __NR_getresgid
  4023. +#define SYS_getpgid __NR_getpgid
  4024. +#define SYS_setfsuid __NR_setfsuid
  4025. +#define SYS_setfsgid __NR_setfsgid
  4026. +#define SYS_getsid __NR_getsid
  4027. +#define SYS_capget __NR_capget
  4028. +#define SYS_capset __NR_capset
  4029. +#define SYS_rt_sigsuspend __NR_rt_sigsuspend
  4030. +#define SYS_utime __NR_utime
  4031. +#define SYS_mknod __NR_mknod
  4032. +#define SYS_personality __NR_personality
  4033. +#define SYS_ustat __NR_ustat
  4034. +#define SYS_statfs __NR_statfs
  4035. +#define SYS_fstatfs __NR_fstatfs
  4036. +#define SYS_sysfs __NR_sysfs
  4037. +#define SYS_getpriority __NR_getpriority
  4038. +#define SYS_setpriority __NR_setpriority
  4039. +#define SYS_sched_setparam __NR_sched_setparam
  4040. +#define SYS_sched_getparam __NR_sched_getparam
  4041. +#define SYS_sched_setscheduler __NR_sched_setscheduler
  4042. +#define SYS_sched_getscheduler __NR_sched_getscheduler
  4043. +#define SYS_sched_get_priority_max __NR_sched_get_priority_max
  4044. +#define SYS_sched_get_priority_min __NR_sched_get_priority_min
  4045. +#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval
  4046. +#define SYS_mlock __NR_mlock
  4047. +#define SYS_munlock __NR_munlock
  4048. +#define SYS_mlockall __NR_mlockall
  4049. +#define SYS_munlockall __NR_munlockall
  4050. +#define SYS_vhangup __NR_vhangup
  4051. +#define SYS_modify_ldt __NR_modify_ldt
  4052. +#define SYS_pivot_root __NR_pivot_root
  4053. +#define SYS_prctl __NR_prctl
  4054. +#define SYS_arch_prctl __NR_arch_prctl
  4055. +#define SYS_adjtimex __NR_adjtimex
  4056. +#define SYS_setrlimit __NR_setrlimit
  4057. +#define SYS_chroot __NR_chroot
  4058. +#define SYS_sync __NR_sync
  4059. +#define SYS_acct __NR_acct
  4060. +#define SYS_settimeofday __NR_settimeofday
  4061. +#define SYS_mount __NR_mount
  4062. +#define SYS_umount2 __NR_umount2
  4063. +#define SYS_swapon __NR_swapon
  4064. +#define SYS_swapoff __NR_swapoff
  4065. +#define SYS_reboot __NR_reboot
  4066. +#define SYS_sethostname __NR_sethostname
  4067. +#define SYS_setdomainname __NR_setdomainname
  4068. +#define SYS_iopl __NR_iopl
  4069. +#define SYS_ioperm __NR_ioperm
  4070. +#define SYS_init_module __NR_init_module
  4071. +#define SYS_delete_module __NR_delete_module
  4072. +#define SYS_quotactl __NR_quotactl
  4073. +#define SYS_getpmsg __NR_getpmsg
  4074. +#define SYS_putpmsg __NR_putpmsg
  4075. +#define SYS_afs_syscall __NR_afs_syscall
  4076. +#define SYS_tuxcall __NR_tuxcall
  4077. +#define SYS_security __NR_security
  4078. +#define SYS_gettid __NR_gettid
  4079. +#define SYS_readahead __NR_readahead
  4080. +#define SYS_setxattr __NR_setxattr
  4081. +#define SYS_lsetxattr __NR_lsetxattr
  4082. +#define SYS_fsetxattr __NR_fsetxattr
  4083. +#define SYS_getxattr __NR_getxattr
  4084. +#define SYS_lgetxattr __NR_lgetxattr
  4085. +#define SYS_fgetxattr __NR_fgetxattr
  4086. +#define SYS_listxattr __NR_listxattr
  4087. +#define SYS_llistxattr __NR_llistxattr
  4088. +#define SYS_flistxattr __NR_flistxattr
  4089. +#define SYS_removexattr __NR_removexattr
  4090. +#define SYS_lremovexattr __NR_lremovexattr
  4091. +#define SYS_fremovexattr __NR_fremovexattr
  4092. +#define SYS_tkill __NR_tkill
  4093. +#define SYS_time __NR_time
  4094. +#define SYS_futex __NR_futex
  4095. +#define SYS_sched_setaffinity __NR_sched_setaffinity
  4096. +#define SYS_sched_getaffinity __NR_sched_getaffinity
  4097. +#define SYS_io_setup __NR_io_setup
  4098. +#define SYS_io_destroy __NR_io_destroy
  4099. +#define SYS_io_getevents __NR_io_getevents
  4100. +#define SYS_io_submit __NR_io_submit
  4101. +#define SYS_io_cancel __NR_io_cancel
  4102. +#define SYS_lookup_dcookie __NR_lookup_dcookie
  4103. +#define SYS_epoll_create __NR_epoll_create
  4104. +#define SYS_remap_file_pages __NR_remap_file_pages
  4105. +#define SYS_getdents64 __NR_getdents64
  4106. +#define SYS_set_tid_address __NR_set_tid_address
  4107. +#define SYS_restart_syscall __NR_restart_syscall
  4108. +#define SYS_semtimedop __NR_semtimedop
  4109. +#define SYS_fadvise64 __NR_fadvise64
  4110. +#define SYS_timer_settime __NR_timer_settime
  4111. +#define SYS_timer_gettime __NR_timer_gettime
  4112. +#define SYS_timer_getoverrun __NR_timer_getoverrun
  4113. +#define SYS_timer_delete __NR_timer_delete
  4114. +#define SYS_clock_settime __NR_clock_settime
  4115. +#define SYS_clock_gettime __NR_clock_gettime
  4116. +#define SYS_clock_getres __NR_clock_getres
  4117. +#define SYS_clock_nanosleep __NR_clock_nanosleep
  4118. +#define SYS_exit_group __NR_exit_group
  4119. +#define SYS_epoll_wait __NR_epoll_wait
  4120. +#define SYS_epoll_ctl __NR_epoll_ctl
  4121. +#define SYS_tgkill __NR_tgkill
  4122. +#define SYS_utimes __NR_utimes
  4123. +#define SYS_mbind __NR_mbind
  4124. +#define SYS_set_mempolicy __NR_set_mempolicy
  4125. +#define SYS_get_mempolicy __NR_get_mempolicy
  4126. +#define SYS_mq_open __NR_mq_open
  4127. +#define SYS_mq_unlink __NR_mq_unlink
  4128. +#define SYS_mq_timedsend __NR_mq_timedsend
  4129. +#define SYS_mq_timedreceive __NR_mq_timedreceive
  4130. +#define SYS_mq_getsetattr __NR_mq_getsetattr
  4131. +#define SYS_add_key __NR_add_key
  4132. +#define SYS_request_key __NR_request_key
  4133. +#define SYS_keyctl __NR_keyctl
  4134. +#define SYS_ioprio_set __NR_ioprio_set
  4135. +#define SYS_ioprio_get __NR_ioprio_get
  4136. +#define SYS_inotify_init __NR_inotify_init
  4137. +#define SYS_inotify_add_watch __NR_inotify_add_watch
  4138. +#define SYS_inotify_rm_watch __NR_inotify_rm_watch
  4139. +#define SYS_migrate_pages __NR_migrate_pages
  4140. +#define SYS_openat __NR_openat
  4141. +#define SYS_mkdirat __NR_mkdirat
  4142. +#define SYS_mknodat __NR_mknodat
  4143. +#define SYS_fchownat __NR_fchownat
  4144. +#define SYS_futimesat __NR_futimesat
  4145. +#define SYS_newfstatat __NR_newfstatat
  4146. +#define SYS_unlinkat __NR_unlinkat
  4147. +#define SYS_renameat __NR_renameat
  4148. +#define SYS_linkat __NR_linkat
  4149. +#define SYS_symlinkat __NR_symlinkat
  4150. +#define SYS_readlinkat __NR_readlinkat
  4151. +#define SYS_fchmodat __NR_fchmodat
  4152. +#define SYS_faccessat __NR_faccessat
  4153. +#define SYS_pselect6 __NR_pselect6
  4154. +#define SYS_ppoll __NR_ppoll
  4155. +#define SYS_unshare __NR_unshare
  4156. +#define SYS_splice __NR_splice
  4157. +#define SYS_tee __NR_tee
  4158. +#define SYS_sync_file_range __NR_sync_file_range
  4159. +#define SYS_utimensat __NR_utimensat
  4160. +#define SYS_epoll_pwait __NR_epoll_pwait
  4161. +#define SYS_signalfd __NR_signalfd
  4162. +#define SYS_timerfd_create __NR_timerfd_create
  4163. +#define SYS_eventfd __NR_eventfd
  4164. +#define SYS_fallocate __NR_fallocate
  4165. +#define SYS_timerfd_settime __NR_timerfd_settime
  4166. +#define SYS_timerfd_gettime __NR_timerfd_gettime
  4167. +#define SYS_accept4 __NR_accept4
  4168. +#define SYS_signalfd4 __NR_signalfd4
  4169. +#define SYS_eventfd2 __NR_eventfd2
  4170. +#define SYS_epoll_create1 __NR_epoll_create1
  4171. +#define SYS_dup3 __NR_dup3
  4172. +#define SYS_pipe2 __NR_pipe2
  4173. +#define SYS_inotify_init1 __NR_inotify_init1
  4174. +#define SYS_perf_event_open __NR_perf_event_open
  4175. +#define SYS_fanotify_init __NR_fanotify_init
  4176. +#define SYS_fanotify_mark __NR_fanotify_mark
  4177. +#define SYS_prlimit64 __NR_prlimit64
  4178. +#define SYS_name_to_handle_at __NR_name_to_handle_at
  4179. +#define SYS_open_by_handle_at __NR_open_by_handle_at
  4180. +#define SYS_clock_adjtime __NR_clock_adjtime
  4181. +#define SYS_syncfs __NR_syncfs
  4182. +#define SYS_setns __NR_setns
  4183. +#define SYS_getcpu __NR_getcpu
  4184. +#define SYS_kcmp __NR_kcmp
  4185. +#define SYS_finit_module __NR_finit_module
  4186. +#define SYS_rt_sigaction __NR_rt_sigaction
  4187. +#define SYS_rt_sigreturn __NR_rt_sigreturn
  4188. +#define SYS_ioctl __NR_ioctl
  4189. +#define SYS_readv __NR_readv
  4190. +#define SYS_writev __NR_writev
  4191. +#define SYS_recvfrom __NR_recvfrom
  4192. +#define SYS_sendmsg __NR_sendmsg
  4193. +#define SYS_recvmsg __NR_recvmsg
  4194. +#define SYS_execve __NR_execve
  4195. +#define SYS_ptrace __NR_ptrace
  4196. +#define SYS_rt_sigpending __NR_rt_sigpending
  4197. +#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait
  4198. +#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo
  4199. +#define SYS_sigaltstack __NR_sigaltstack
  4200. +#define SYS_timer_create __NR_timer_create
  4201. +#define SYS_mq_notify __NR_mq_notify
  4202. +#define SYS_kexec_load __NR_kexec_load
  4203. +#define SYS_waitid __NR_waitid
  4204. +#define SYS_set_robust_list __NR_set_robust_list
  4205. +#define SYS_get_robust_list __NR_get_robust_list
  4206. +#define SYS_vmsplice __NR_vmsplice
  4207. +#define SYS_move_pages __NR_move_pages
  4208. +#define SYS_preadv __NR_preadv
  4209. +#define SYS_pwritev __NR_pwritev
  4210. +#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
  4211. +#define SYS_recvmmsg __NR_recvmmsg
  4212. +#define SYS_sendmmsg __NR_sendmmsg
  4213. +#define SYS_process_vm_readv __NR_process_vm_readv
  4214. +#define SYS_process_vm_writev __NR_process_vm_writev
  4215. +#define SYS_setsockopt __NR_setsockopt
  4216. +#define SYS_getsockopt __NR_getsockopt
  4217. +
  4218. +#undef SYS_fstatat
  4219. +#undef SYS_pread
  4220. +#undef SYS_pwrite
  4221. +#undef SYS_getdents
  4222. +#define SYS_fstatat SYS_newfstatat
  4223. +#define SYS_pread SYS_pread64
  4224. +#define SYS_pwrite SYS_pwrite64
  4225. +#define SYS_getdents SYS_getdents64
  4226. +#define SYS_fadvise SYS_fadvise64
  4227. diff -Nur musl-0.9.15/arch/x32/bits/termios.h musl-git/arch/x32/bits/termios.h
  4228. --- musl-0.9.15/arch/x32/bits/termios.h 1970-01-01 01:00:00.000000000 +0100
  4229. +++ musl-git/arch/x32/bits/termios.h 2014-03-01 08:58:14.000000000 +0100
  4230. @@ -0,0 +1,160 @@
  4231. +struct termios
  4232. +{
  4233. + tcflag_t c_iflag;
  4234. + tcflag_t c_oflag;
  4235. + tcflag_t c_cflag;
  4236. + tcflag_t c_lflag;
  4237. + cc_t c_line;
  4238. + cc_t c_cc[NCCS];
  4239. + speed_t __c_ispeed;
  4240. + speed_t __c_ospeed;
  4241. +};
  4242. +
  4243. +#define VINTR 0
  4244. +#define VQUIT 1
  4245. +#define VERASE 2
  4246. +#define VKILL 3
  4247. +#define VEOF 4
  4248. +#define VTIME 5
  4249. +#define VMIN 6
  4250. +#define VSWTC 7
  4251. +#define VSTART 8
  4252. +#define VSTOP 9
  4253. +#define VSUSP 10
  4254. +#define VEOL 11
  4255. +#define VREPRINT 12
  4256. +#define VDISCARD 13
  4257. +#define VWERASE 14
  4258. +#define VLNEXT 15
  4259. +#define VEOL2 16
  4260. +
  4261. +#define IGNBRK 0000001
  4262. +#define BRKINT 0000002
  4263. +#define IGNPAR 0000004
  4264. +#define PARMRK 0000010
  4265. +#define INPCK 0000020
  4266. +#define ISTRIP 0000040
  4267. +#define INLCR 0000100
  4268. +#define IGNCR 0000200
  4269. +#define ICRNL 0000400
  4270. +#define IUCLC 0001000
  4271. +#define IXON 0002000
  4272. +#define IXANY 0004000
  4273. +#define IXOFF 0010000
  4274. +#define IMAXBEL 0020000
  4275. +#define IUTF8 0040000
  4276. +
  4277. +#define OPOST 0000001
  4278. +#define OLCUC 0000002
  4279. +#define ONLCR 0000004
  4280. +#define OCRNL 0000010
  4281. +#define ONOCR 0000020
  4282. +#define ONLRET 0000040
  4283. +#define OFILL 0000100
  4284. +#define OFDEL 0000200
  4285. +#define NLDLY 0000400
  4286. +#define NL0 0000000
  4287. +#define NL1 0000400
  4288. +#define CRDLY 0003000
  4289. +#define CR0 0000000
  4290. +#define CR1 0001000
  4291. +#define CR2 0002000
  4292. +#define CR3 0003000
  4293. +#define TABDLY 0014000
  4294. +#define TAB0 0000000
  4295. +#define TAB1 0004000
  4296. +#define TAB2 0010000
  4297. +#define TAB3 0014000
  4298. +#define BSDLY 0020000
  4299. +#define BS0 0000000
  4300. +#define BS1 0020000
  4301. +#define FFDLY 0100000
  4302. +#define FF0 0000000
  4303. +#define FF1 0100000
  4304. +
  4305. +#define VTDLY 0040000
  4306. +#define VT0 0000000
  4307. +#define VT1 0040000
  4308. +
  4309. +#define B0 0000000
  4310. +#define B50 0000001
  4311. +#define B75 0000002
  4312. +#define B110 0000003
  4313. +#define B134 0000004
  4314. +#define B150 0000005
  4315. +#define B200 0000006
  4316. +#define B300 0000007
  4317. +#define B600 0000010
  4318. +#define B1200 0000011
  4319. +#define B1800 0000012
  4320. +#define B2400 0000013
  4321. +#define B4800 0000014
  4322. +#define B9600 0000015
  4323. +#define B19200 0000016
  4324. +#define B38400 0000017
  4325. +
  4326. +#define B57600 0010001
  4327. +#define B115200 0010002
  4328. +#define B230400 0010003
  4329. +#define B460800 0010004
  4330. +#define B500000 0010005
  4331. +#define B576000 0010006
  4332. +#define B921600 0010007
  4333. +#define B1000000 0010010
  4334. +#define B1152000 0010011
  4335. +#define B1500000 0010012
  4336. +#define B2000000 0010013
  4337. +#define B2500000 0010014
  4338. +#define B3000000 0010015
  4339. +#define B3500000 0010016
  4340. +#define B4000000 0010017
  4341. +
  4342. +#define CBAUD 0010017
  4343. +
  4344. +#define CSIZE 0000060
  4345. +#define CS5 0000000
  4346. +#define CS6 0000020
  4347. +#define CS7 0000040
  4348. +#define CS8 0000060
  4349. +#define CSTOPB 0000100
  4350. +#define CREAD 0000200
  4351. +#define PARENB 0000400
  4352. +#define PARODD 0001000
  4353. +#define HUPCL 0002000
  4354. +#define CLOCAL 0004000
  4355. +
  4356. +#define ISIG 0000001
  4357. +#define ICANON 0000002
  4358. +#define ECHO 0000010
  4359. +#define ECHOE 0000020
  4360. +#define ECHOK 0000040
  4361. +#define ECHONL 0000100
  4362. +#define NOFLSH 0000200
  4363. +#define TOSTOP 0000400
  4364. +#define IEXTEN 0100000
  4365. +
  4366. +#define ECHOCTL 0001000
  4367. +#define ECHOPRT 0002000
  4368. +#define ECHOKE 0004000
  4369. +#define FLUSHO 0010000
  4370. +#define PENDIN 0040000
  4371. +
  4372. +#define TCOOFF 0
  4373. +#define TCOON 1
  4374. +#define TCIOFF 2
  4375. +#define TCION 3
  4376. +
  4377. +#define TCIFLUSH 0
  4378. +#define TCOFLUSH 1
  4379. +#define TCIOFLUSH 2
  4380. +
  4381. +#define TCSANOW 0
  4382. +#define TCSADRAIN 1
  4383. +#define TCSAFLUSH 2
  4384. +
  4385. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  4386. +#define CBAUDEX 0010000
  4387. +#define CRTSCTS 020000000000
  4388. +#define EXTPROC 0200000
  4389. +#define XTABS 0014000
  4390. +#endif
  4391. diff -Nur musl-0.9.15/arch/x32/bits/user.h musl-git/arch/x32/bits/user.h
  4392. --- musl-0.9.15/arch/x32/bits/user.h 1970-01-01 01:00:00.000000000 +0100
  4393. +++ musl-git/arch/x32/bits/user.h 2014-03-01 08:58:14.000000000 +0100
  4394. @@ -0,0 +1,44 @@
  4395. +#undef __WORDSIZE
  4396. +#define __WORDSIZE 64
  4397. +
  4398. +typedef struct user_fpregs_struct
  4399. +{
  4400. + uint16_t cwd, swd, ftw, fop;
  4401. + uint64_t rip, rdp;
  4402. + uint32_t mxcsr, mxcs_mask;
  4403. + uint32_t st_space[32], xmm_space[64], padding[24];
  4404. +} elf_fpregset_t;
  4405. +
  4406. +struct user_regs_struct
  4407. +{
  4408. + unsigned long r15, r14, r13, r12, rbp, rbx, r11, r10, r9, r8;
  4409. + unsigned long rax, rcx, rdx, rsi, rdi, orig_rax, rip;
  4410. + unsigned long cs, eflags, rsp, ss, fs_base, gs_base, ds, es, fs, gs;
  4411. +};
  4412. +#define ELF_NGREG 27
  4413. +typedef unsigned long long elf_greg_t, elf_gregset_t[ELF_NGREG];
  4414. +
  4415. +struct user
  4416. +{
  4417. + struct user_regs_struct regs;
  4418. + int u_fpvalid;
  4419. + struct user_fpregs_struct i387;
  4420. + unsigned long u_tsize;
  4421. + unsigned long u_dsize;
  4422. + unsigned long u_ssize;
  4423. + unsigned long start_code;
  4424. + unsigned long start_stack;
  4425. + long signal;
  4426. + int reserved;
  4427. + struct user_regs_struct *u_ar0;
  4428. + struct user_fpregs_struct *u_fpstate;
  4429. + unsigned long magic;
  4430. + char u_comm[32];
  4431. + unsigned long u_debugreg[8];
  4432. +};
  4433. +
  4434. +#define PAGE_MASK (~(PAGE_SIZE-1))
  4435. +#define NBPG PAGE_SIZE
  4436. +#define UPAGES 1
  4437. +#define HOST_TEXT_START_ADDR (u.start_code)
  4438. +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
  4439. diff -Nur musl-0.9.15/arch/x32/crt_arch.h musl-git/arch/x32/crt_arch.h
  4440. --- musl-0.9.15/arch/x32/crt_arch.h 1970-01-01 01:00:00.000000000 +0100
  4441. +++ musl-git/arch/x32/crt_arch.h 2014-03-01 08:58:14.000000000 +0100
  4442. @@ -0,0 +1,9 @@
  4443. +__asm__("\
  4444. +.text \n\
  4445. +.global _start \n\
  4446. +_start: \n\
  4447. + xor %rbp,%rbp \n\
  4448. + mov %rsp,%rdi \n\
  4449. + andq $-16,%rsp \n\
  4450. + call __cstart \n\
  4451. +");
  4452. diff -Nur musl-0.9.15/arch/x32/pthread_arch.h musl-git/arch/x32/pthread_arch.h
  4453. --- musl-0.9.15/arch/x32/pthread_arch.h 1970-01-01 01:00:00.000000000 +0100
  4454. +++ musl-git/arch/x32/pthread_arch.h 2014-03-01 08:58:14.000000000 +0100
  4455. @@ -0,0 +1,10 @@
  4456. +static inline struct pthread *__pthread_self()
  4457. +{
  4458. + struct pthread *self;
  4459. + __asm__ __volatile__ ("mov %%fs:0,%0" : "=r" (self) );
  4460. + return self;
  4461. +}
  4462. +
  4463. +#define TP_ADJ(p) (p)
  4464. +
  4465. +#define CANCEL_REG_IP 16
  4466. diff -Nur musl-0.9.15/arch/x32/reloc.h musl-git/arch/x32/reloc.h
  4467. --- musl-0.9.15/arch/x32/reloc.h 1970-01-01 01:00:00.000000000 +0100
  4468. +++ musl-git/arch/x32/reloc.h 2014-03-01 08:58:14.000000000 +0100
  4469. @@ -0,0 +1,46 @@
  4470. +#include <stdint.h>
  4471. +#include <string.h>
  4472. +#include <elf.h>
  4473. +
  4474. +#define LDSO_ARCH "x32"
  4475. +
  4476. +#define IS_COPY(x) ((x)==R_X86_64_COPY)
  4477. +#define IS_PLT(x) ((x)==R_X86_64_JUMP_SLOT)
  4478. +
  4479. +static inline void do_single_reloc(
  4480. + struct dso *self, unsigned char *base_addr,
  4481. + size_t *reloc_addr, int type, size_t addend,
  4482. + Sym *sym, size_t sym_size,
  4483. + struct symdef def, size_t sym_val)
  4484. +{
  4485. + switch(type) {
  4486. + case R_X86_64_GLOB_DAT:
  4487. + case R_X86_64_JUMP_SLOT:
  4488. + case R_X86_64_64:
  4489. + *reloc_addr = sym_val + addend;
  4490. + break;
  4491. + case R_X86_64_32:
  4492. + *(uint32_t *)reloc_addr = sym_val + addend;
  4493. + break;
  4494. + case R_X86_64_PC32:
  4495. + *reloc_addr = sym_val + addend - (size_t)reloc_addr + (size_t)base_addr;
  4496. + break;
  4497. + case R_X86_64_RELATIVE:
  4498. + *reloc_addr = (size_t)base_addr + addend;
  4499. + break;
  4500. + case R_X86_64_COPY:
  4501. + memcpy(reloc_addr, (void *)sym_val, sym_size);
  4502. + break;
  4503. + case R_X86_64_DTPMOD64:
  4504. + *reloc_addr = def.dso ? def.dso->tls_id : self->tls_id;
  4505. + break;
  4506. + case R_X86_64_DTPOFF64:
  4507. + *reloc_addr = def.sym->st_value + addend;
  4508. + break;
  4509. + case R_X86_64_TPOFF64:
  4510. + *reloc_addr = (def.sym
  4511. + ? def.sym->st_value - def.dso->tls_offset
  4512. + : 0 - self->tls_offset) + addend;
  4513. + break;
  4514. + }
  4515. +}
  4516. diff -Nur musl-0.9.15/arch/x32/src/syscall_cp_fixup.c musl-git/arch/x32/src/syscall_cp_fixup.c
  4517. --- musl-0.9.15/arch/x32/src/syscall_cp_fixup.c 1970-01-01 01:00:00.000000000 +0100
  4518. +++ musl-git/arch/x32/src/syscall_cp_fixup.c 2014-03-01 08:58:14.000000000 +0100
  4519. @@ -0,0 +1,31 @@
  4520. +#include <sys/syscall.h>
  4521. +long __syscall_cp_internal(volatile void*, long long, long long, long long, long long,
  4522. + long long, long long, long long);
  4523. +
  4524. +struct __timespec { long long tv_sec; long tv_nsec; };
  4525. +struct __timespec_kernel { long long tv_sec; long long tv_nsec; };
  4526. +#define __tsc(X) ((struct __timespec*)(unsigned long)(X))
  4527. +#define __fixup(X) do { if(X) X = (unsigned long) (&(struct __timespec_kernel) \
  4528. + { .tv_sec = __tsc(X)->tv_sec, .tv_nsec = __tsc(X)->tv_nsec}); } while(0)
  4529. +
  4530. +long __syscall_cp_asm (volatile void * foo, long long n, long long a1, long long a2, long long a3,
  4531. + long long a4, long long a5, long long a6) {
  4532. + switch (n) {
  4533. + case SYS_mq_timedsend: case SYS_mq_timedreceive: case SYS_pselect6:
  4534. + __fixup(a5);
  4535. + break;
  4536. + case SYS_futex:
  4537. + if((a2 & (~128 /* FUTEX_PRIVATE_FLAG */)) == 0 /* FUTEX_WAIT */)
  4538. + __fixup(a4);
  4539. + break;
  4540. + case SYS_clock_nanosleep:
  4541. + case SYS_rt_sigtimedwait: case SYS_ppoll:
  4542. + __fixup(a3);
  4543. + break;
  4544. + case SYS_nanosleep:
  4545. + __fixup(a1);
  4546. + break;
  4547. + }
  4548. + return __syscall_cp_internal(foo, n, a1, a2, a3, a4, a5, a6);
  4549. +}
  4550. +
  4551. diff -Nur musl-0.9.15/arch/x32/syscall_arch.h musl-git/arch/x32/syscall_arch.h
  4552. --- musl-0.9.15/arch/x32/syscall_arch.h 1970-01-01 01:00:00.000000000 +0100
  4553. +++ musl-git/arch/x32/syscall_arch.h 2014-03-01 08:58:14.000000000 +0100
  4554. @@ -0,0 +1,117 @@
  4555. +#define __SYSCALL_LL_E(x) (x)
  4556. +#define __SYSCALL_LL_O(x) (x)
  4557. +
  4558. +#define __scc(X) sizeof(1?(X):0ULL) < 8 ? (unsigned long) (X) : (long long) (X)
  4559. +typedef long long syscall_arg_t;
  4560. +struct __timespec { long long tv_sec; long tv_nsec; };
  4561. +struct __timespec_kernel { long long tv_sec; long long tv_nsec; };
  4562. +#define __tsc(X) ((struct __timespec*)(unsigned long)(X))
  4563. +#define __fixup(X) do { if(X) X = (unsigned long) (&(struct __timespec_kernel) \
  4564. + { .tv_sec = __tsc(X)->tv_sec, .tv_nsec = __tsc(X)->tv_nsec}); } while(0)
  4565. +#define __fixup_case_2 \
  4566. + case SYS_nanosleep: \
  4567. + __fixup(a1); break; \
  4568. + case SYS_clock_settime: \
  4569. + __fixup(a2); break;
  4570. +#define __fixup_case_3 \
  4571. + case SYS_clock_nanosleep: case SYS_rt_sigtimedwait: case SYS_ppoll: \
  4572. + __fixup(a3); break; \
  4573. + case SYS_utimensat: \
  4574. + if(a3) a3 = (unsigned long) ((struct __timespec_kernel[2]) { \
  4575. + [0] = {.tv_sec = __tsc(a3)[0].tv_sec, .tv_nsec = __tsc(a3)[0].tv_nsec}, \
  4576. + [1] = {.tv_sec = __tsc(a3)[1].tv_sec, .tv_nsec = __tsc(a3)[1].tv_nsec}, \
  4577. + }); break;
  4578. +#define __fixup_case_4 \
  4579. + case SYS_futex: \
  4580. + if((a2 & (~128 /* FUTEX_PRIVATE_FLAG */)) == 0 /* FUTEX_WAIT */) __fixup(a4); break;
  4581. +#define __fixup_case_5 \
  4582. + case SYS_mq_timedsend: case SYS_mq_timedreceive: case SYS_pselect6: \
  4583. + __fixup(a5); break;
  4584. +
  4585. +static __inline long __syscall0(long long n)
  4586. +{
  4587. + unsigned long ret;
  4588. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n) : "rcx", "r11", "memory");
  4589. + return ret;
  4590. +}
  4591. +
  4592. +static __inline long __syscall1(long long n, long long a1)
  4593. +{
  4594. + unsigned long ret;
  4595. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1) : "rcx", "r11", "memory");
  4596. + return ret;
  4597. +}
  4598. +
  4599. +static __inline long __syscall2(long long n, long long a1, long long a2)
  4600. +{
  4601. + unsigned long ret;
  4602. + struct __timespec *ts2 = 0;
  4603. + switch (n) {
  4604. + __fixup_case_2;
  4605. + }
  4606. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2)
  4607. + : "rcx", "r11", "memory");
  4608. + return ret;
  4609. +}
  4610. +
  4611. +static __inline long __syscall3(long long n, long long a1, long long a2, long long a3)
  4612. +{
  4613. + unsigned long ret;
  4614. + switch (n) {
  4615. + __fixup_case_2;
  4616. + __fixup_case_3;
  4617. + }
  4618. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  4619. + "d"(a3) : "rcx", "r11", "memory");
  4620. + return ret;
  4621. +}
  4622. +
  4623. +static __inline long __syscall4(long long n, long long a1, long long a2, long long a3,
  4624. + long long a4_)
  4625. +{
  4626. + unsigned long ret;
  4627. + register long long a4 __asm__("r10") = a4_;
  4628. + switch (n) {
  4629. + __fixup_case_2;
  4630. + __fixup_case_3;
  4631. + __fixup_case_4;
  4632. + }
  4633. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  4634. + "d"(a3), "r"(a4): "rcx", "r11", "memory");
  4635. + return ret;
  4636. +}
  4637. +
  4638. +static __inline long __syscall5(long long n, long long a1, long long a2, long long a3,
  4639. + long long a4_, long long a5_)
  4640. +{
  4641. + unsigned long ret;
  4642. + register long long a4 __asm__("r10") = a4_;
  4643. + register long long a5 __asm__("r8") = a5_;
  4644. + switch (n) {
  4645. + __fixup_case_2;
  4646. + __fixup_case_3;
  4647. + __fixup_case_4;
  4648. + __fixup_case_5;
  4649. + }
  4650. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  4651. + "d"(a3), "r"(a4), "r"(a5) : "rcx", "r11", "memory");
  4652. + return ret;
  4653. +}
  4654. +
  4655. +static __inline long __syscall6(long long n, long long a1, long long a2, long long a3,
  4656. + long long a4_, long long a5_, long long a6_)
  4657. +{
  4658. + unsigned long ret;
  4659. + register long long a4 __asm__("r10") = a4_;
  4660. + register long long a5 __asm__("r8") = a5_;
  4661. + register long long a6 __asm__("r9") = a6_;
  4662. + switch (n) {
  4663. + __fixup_case_2;
  4664. + __fixup_case_3;
  4665. + __fixup_case_4;
  4666. + __fixup_case_5;
  4667. + }
  4668. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  4669. + "d"(a3), "r"(a4), "r"(a5), "r"(a6) : "rcx", "r11", "memory");
  4670. + return ret;
  4671. +}
  4672. diff -Nur musl-0.9.15/arch/x86_64/atomic.h musl-git/arch/x86_64/atomic.h
  4673. --- musl-0.9.15/arch/x86_64/atomic.h 2014-01-03 21:12:17.000000000 +0100
  4674. +++ musl-git/arch/x86_64/atomic.h 2014-03-01 08:58:14.000000000 +0100
  4675. @@ -5,38 +5,36 @@
  4676. static inline int a_ctz_64(uint64_t x)
  4677. {
  4678. - long r;
  4679. - __asm__( "bsf %1,%0" : "=r"(r) : "r"(x) );
  4680. - return r;
  4681. + __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
  4682. + return x;
  4683. }
  4684. static inline int a_ctz_l(unsigned long x)
  4685. {
  4686. - long r;
  4687. - __asm__( "bsf %1,%0" : "=r"(r) : "r"(x) );
  4688. - return r;
  4689. + __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
  4690. + return x;
  4691. }
  4692. static inline void a_and_64(volatile uint64_t *p, uint64_t v)
  4693. {
  4694. - __asm__( "lock ; andq %1, %0"
  4695. - : "=m"(*(long *)p) : "r"(v) : "memory" );
  4696. + __asm__( "lock ; and %1, %0"
  4697. + : "=m"(*p) : "r"(v) : "memory" );
  4698. }
  4699. static inline void a_or_64(volatile uint64_t *p, uint64_t v)
  4700. {
  4701. - __asm__( "lock ; orq %1, %0"
  4702. - : "=m"(*(long *)p) : "r"(v) : "memory" );
  4703. + __asm__( "lock ; or %1, %0"
  4704. + : "=m"(*p) : "r"(v) : "memory" );
  4705. }
  4706. static inline void a_store_l(volatile void *p, long x)
  4707. {
  4708. - __asm__( "movq %1, %0" : "=m"(*(long *)p) : "r"(x) : "memory" );
  4709. + __asm__( "mov %1, %0" : "=m"(*(long *)p) : "r"(x) : "memory" );
  4710. }
  4711. static inline void a_or_l(volatile void *p, long v)
  4712. {
  4713. - __asm__( "lock ; orq %1, %0"
  4714. + __asm__( "lock ; or %1, %0"
  4715. : "=m"(*(long *)p) : "r"(v) : "memory" );
  4716. }
  4717. @@ -56,7 +54,7 @@
  4718. static inline int a_cas(volatile int *p, int t, int s)
  4719. {
  4720. - __asm__( "lock ; cmpxchgl %3, %1"
  4721. + __asm__( "lock ; cmpxchg %3, %1"
  4722. : "=a"(t), "=m"(*p) : "a"(t), "r"(s) : "memory" );
  4723. return t;
  4724. }
  4725. @@ -74,13 +72,13 @@
  4726. static inline void a_or(volatile void *p, int v)
  4727. {
  4728. - __asm__( "lock ; orl %1, %0"
  4729. + __asm__( "lock ; or %1, %0"
  4730. : "=m"(*(int *)p) : "r"(v) : "memory" );
  4731. }
  4732. static inline void a_and(volatile void *p, int v)
  4733. {
  4734. - __asm__( "lock ; andl %1, %0"
  4735. + __asm__( "lock ; and %1, %0"
  4736. : "=m"(*(int *)p) : "r"(v) : "memory" );
  4737. }
  4738. @@ -110,7 +108,7 @@
  4739. static inline void a_store(volatile int *p, int x)
  4740. {
  4741. - __asm__( "movl %1, %0" : "=m"(*p) : "r"(x) : "memory" );
  4742. + __asm__( "mov %1, %0" : "=m"(*p) : "r"(x) : "memory" );
  4743. }
  4744. static inline void a_spin()
  4745. diff -Nur musl-0.9.15/arch/x86_64/bits/shm.h musl-git/arch/x86_64/bits/shm.h
  4746. --- musl-0.9.15/arch/x86_64/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  4747. +++ musl-git/arch/x86_64/bits/shm.h 2014-03-01 08:58:14.000000000 +0100
  4748. @@ -13,3 +13,14 @@
  4749. unsigned long __pad1;
  4750. unsigned long __pad2;
  4751. };
  4752. +
  4753. +struct shminfo {
  4754. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  4755. +};
  4756. +
  4757. +struct shm_info {
  4758. + int __used_ids;
  4759. + unsigned long shm_tot, shm_rss, shm_swp;
  4760. + unsigned long __swap_attempts, __swap_successes;
  4761. +};
  4762. +
  4763. diff -Nur musl-0.9.15/arch/x86_64/bits/stat.h musl-git/arch/x86_64/bits/stat.h
  4764. --- musl-0.9.15/arch/x86_64/bits/stat.h 2014-01-03 21:12:17.000000000 +0100
  4765. +++ musl-git/arch/x86_64/bits/stat.h 2014-03-01 08:58:14.000000000 +0100
  4766. @@ -2,7 +2,7 @@
  4767. * by the corresponding correctly-sized userspace types. */
  4768. struct stat {
  4769. - unsigned long st_dev;
  4770. + dev_t st_dev;
  4771. ino_t st_ino;
  4772. nlink_t st_nlink;
  4773. diff -Nur musl-0.9.15/arch/x86_64/bits/termios.h musl-git/arch/x86_64/bits/termios.h
  4774. --- musl-0.9.15/arch/x86_64/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  4775. +++ musl-git/arch/x86_64/bits/termios.h 2014-03-01 08:58:14.000000000 +0100
  4776. @@ -42,6 +42,7 @@
  4777. #define IXANY 0004000
  4778. #define IXOFF 0010000
  4779. #define IMAXBEL 0020000
  4780. +#define IUTF8 0040000
  4781. #define OPOST 0000001
  4782. #define OLCUC 0000002
  4783. @@ -75,9 +76,6 @@
  4784. #define VT0 0000000
  4785. #define VT1 0040000
  4786. -/* ?? */
  4787. -#define XTABS 0014000
  4788. -
  4789. #define B0 0000000
  4790. #define B50 0000001
  4791. #define B75 0000002
  4792. @@ -125,8 +123,6 @@
  4793. #define HUPCL 0002000
  4794. #define CLOCAL 0004000
  4795. -#define CRTSCTS 020000000000
  4796. -
  4797. #define ISIG 0000001
  4798. #define ICANON 0000002
  4799. #define ECHO 0000010
  4800. @@ -137,14 +133,11 @@
  4801. #define TOSTOP 0000400
  4802. #define IEXTEN 0100000
  4803. -/* Extensions? */
  4804. -#define CBAUDEX 0010000
  4805. #define ECHOCTL 0001000
  4806. #define ECHOPRT 0002000
  4807. #define ECHOKE 0004000
  4808. #define FLUSHO 0010000
  4809. #define PENDIN 0040000
  4810. -#define EXTPROC 0200000
  4811. #define TCOOFF 0
  4812. #define TCOON 1
  4813. @@ -158,3 +151,10 @@
  4814. #define TCSANOW 0
  4815. #define TCSADRAIN 1
  4816. #define TCSAFLUSH 2
  4817. +
  4818. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  4819. +#define CBAUDEX 0010000
  4820. +#define CRTSCTS 020000000000
  4821. +#define EXTPROC 0200000
  4822. +#define XTABS 0014000
  4823. +#endif
  4824. diff -Nur musl-0.9.15/arch/x86_64/pthread_arch.h musl-git/arch/x86_64/pthread_arch.h
  4825. --- musl-0.9.15/arch/x86_64/pthread_arch.h 2014-01-03 21:12:17.000000000 +0100
  4826. +++ musl-git/arch/x86_64/pthread_arch.h 2014-03-01 08:58:14.000000000 +0100
  4827. @@ -1,7 +1,7 @@
  4828. static inline struct pthread *__pthread_self()
  4829. {
  4830. struct pthread *self;
  4831. - __asm__ __volatile__ ("movq %%fs:0,%0" : "=r" (self) );
  4832. + __asm__ __volatile__ ("mov %%fs:0,%0" : "=r" (self) );
  4833. return self;
  4834. }
  4835. diff -Nur musl-0.9.15/configure musl-git/configure
  4836. --- musl-0.9.15/configure 2014-01-03 21:12:17.000000000 +0100
  4837. +++ musl-git/configure 2014-03-01 08:58:14.000000000 +0100
  4838. @@ -222,12 +222,16 @@
  4839. # Convert to just ARCH
  4840. #
  4841. case "$target" in
  4842. +# Catch these early to simplify matching for 32-bit archs
  4843. +mips64*|powerpc64*) fail "$0: unsupported target \"$target\"" ;;
  4844. arm*) ARCH=arm ;;
  4845. i?86*) ARCH=i386 ;;
  4846. +x86_64-x32*|x32*) ARCH=x32 ;;
  4847. x86_64*) ARCH=x86_64 ;;
  4848. -mips-*|mipsel-*) ARCH=mips ;;
  4849. -microblaze-*) ARCH=microblaze ;;
  4850. -powerpc-*) ARCH=powerpc ;;
  4851. +mips*) ARCH=mips ;;
  4852. +microblaze*) ARCH=microblaze ;;
  4853. +powerpc*) ARCH=powerpc ;;
  4854. +sh[1-9bel-]*|sh|superh*) ARCH=sh ;;
  4855. unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;;
  4856. *) fail "$0: unknown or unsupported target \"$target\"" ;;
  4857. esac
  4858. @@ -381,6 +385,7 @@
  4859. tryflag CFLAGS_AUTO -Wno-unused-value
  4860. tryflag CFLAGS_AUTO -Wno-unused-but-set-variable
  4861. tryflag CFLAGS_AUTO -Wno-unknown-pragmas
  4862. +tryflag CFLAGS_AUTO -Wno-pointer-to-int-cast
  4863. fi
  4864. # Some patched GCC builds have these defaults messed up...
  4865. @@ -410,12 +415,33 @@
  4866. trycppif __ARM_PCS_VFP "$t" && SUBARCH=${SUBARCH}hf
  4867. fi
  4868. -test "$ARCH" = "mips" && trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" \
  4869. -&& SUBARCH=${SUBARCH}el
  4870. +if test "$ARCH" = "mips" ; then
  4871. +trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el
  4872. +trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf
  4873. +fi
  4874. test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \
  4875. && SUBARCH=${SUBARCH}el
  4876. +if test "$ARCH" = "sh" ; then
  4877. +trycppif __BIG_ENDIAN__ "$t" && SUBARCH=${SUBARCH}eb
  4878. +if trycppif __SH_FPU_ANY__ "$t" ; then
  4879. +# Some sh configurations are broken and replace double with float
  4880. +# rather than using softfloat when the fpu is present but only
  4881. +# supports single precision. Reject them.
  4882. +printf "checking whether compiler's double type is IEEE double... "
  4883. +echo 'typedef char dblcheck[(int)sizeof(double)-5];' > "$tmpc"
  4884. +if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
  4885. +printf "yes\n"
  4886. +else
  4887. +printf "no\n"
  4888. +fail "$0: error: compiler's floating point configuration is unsupported"
  4889. +fi
  4890. +else
  4891. +SUBARCH=${SUBARCH}-nofpu
  4892. +fi
  4893. +fi
  4894. +
  4895. test "$SUBARCH" \
  4896. && printf "configured for %s variant: %s\n" "$ARCH" "$ARCH$SUBARCH"
  4897. diff -Nur musl-0.9.15/crt/superh/crti.s musl-git/crt/superh/crti.s
  4898. --- musl-0.9.15/crt/superh/crti.s 1970-01-01 01:00:00.000000000 +0100
  4899. +++ musl-git/crt/superh/crti.s 2014-03-01 08:58:14.000000000 +0100
  4900. @@ -0,0 +1,13 @@
  4901. +.section .init
  4902. +.global _init
  4903. +.type _init, @function
  4904. +_init:
  4905. + sts.l pr, @-r15
  4906. + nop
  4907. +
  4908. +.section .fini
  4909. +.global _fini
  4910. +.type _fini, @function
  4911. +_fini:
  4912. + sts.l pr, @-r15
  4913. + nop
  4914. diff -Nur musl-0.9.15/crt/superh/crtn.s musl-git/crt/superh/crtn.s
  4915. --- musl-0.9.15/crt/superh/crtn.s 1970-01-01 01:00:00.000000000 +0100
  4916. +++ musl-git/crt/superh/crtn.s 2014-03-01 08:58:14.000000000 +0100
  4917. @@ -0,0 +1,9 @@
  4918. +.section .init
  4919. + lds.l @r15+, pr
  4920. + rts
  4921. + nop
  4922. +
  4923. +.section .fini
  4924. + lds.l @r15+, pr
  4925. + rts
  4926. + nop
  4927. diff -Nur musl-0.9.15/crt/x32/crti.s musl-git/crt/x32/crti.s
  4928. --- musl-0.9.15/crt/x32/crti.s 1970-01-01 01:00:00.000000000 +0100
  4929. +++ musl-git/crt/x32/crti.s 2014-03-01 08:58:14.000000000 +0100
  4930. @@ -0,0 +1,9 @@
  4931. +.section .init
  4932. +.global _init
  4933. +_init:
  4934. + push %rax
  4935. +
  4936. +.section .fini
  4937. +.global _fini
  4938. +_fini:
  4939. + push %rax
  4940. diff -Nur musl-0.9.15/crt/x32/crtn.s musl-git/crt/x32/crtn.s
  4941. --- musl-0.9.15/crt/x32/crtn.s 1970-01-01 01:00:00.000000000 +0100
  4942. +++ musl-git/crt/x32/crtn.s 2014-03-01 08:58:14.000000000 +0100
  4943. @@ -0,0 +1,7 @@
  4944. +.section .init
  4945. + pop %rax
  4946. + ret
  4947. +
  4948. +.section .fini
  4949. + pop %rax
  4950. + ret
  4951. diff -Nur musl-0.9.15/.gitignore musl-git/.gitignore
  4952. --- musl-0.9.15/.gitignore 1970-01-01 01:00:00.000000000 +0100
  4953. +++ musl-git/.gitignore 2014-03-01 08:58:13.000000000 +0100
  4954. @@ -0,0 +1,11 @@
  4955. +*.o
  4956. +*.lo
  4957. +*.a
  4958. +*.so
  4959. +*.so.1
  4960. +arch/*/bits/alltypes.h
  4961. +config.mak
  4962. +include/bits
  4963. +tools/musl-gcc
  4964. +lib/musl-gcc.specs
  4965. +src/internal/version.h
  4966. diff -Nur musl-0.9.15/include/arpa/inet.h musl-git/include/arpa/inet.h
  4967. --- musl-0.9.15/include/arpa/inet.h 2014-01-03 21:12:17.000000000 +0100
  4968. +++ musl-git/include/arpa/inet.h 2014-03-01 08:58:14.000000000 +0100
  4969. @@ -20,7 +20,7 @@
  4970. const char *inet_ntop (int, const void *__restrict, char *__restrict, socklen_t);
  4971. int inet_aton (const char *, struct in_addr *);
  4972. -struct in_addr inet_makeaddr(int, int);
  4973. +struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
  4974. in_addr_t inet_lnaof(struct in_addr);
  4975. in_addr_t inet_netof(struct in_addr);
  4976. diff -Nur musl-0.9.15/include/dlfcn.h musl-git/include/dlfcn.h
  4977. --- musl-0.9.15/include/dlfcn.h 2014-01-03 21:12:17.000000000 +0100
  4978. +++ musl-git/include/dlfcn.h 2014-03-01 08:58:14.000000000 +0100
  4979. @@ -31,7 +31,7 @@
  4980. const char *dli_sname;
  4981. void *dli_saddr;
  4982. } Dl_info;
  4983. -int dladdr(void *, Dl_info *);
  4984. +int dladdr(const void *, Dl_info *);
  4985. int dlinfo(void *, int, void *);
  4986. #endif
  4987. diff -Nur musl-0.9.15/include/elf.h musl-git/include/elf.h
  4988. --- musl-0.9.15/include/elf.h 2014-01-03 21:12:17.000000000 +0100
  4989. +++ musl-git/include/elf.h 2014-03-01 08:58:14.000000000 +0100
  4990. @@ -1153,6 +1153,7 @@
  4991. #define EF_MIPS_64BIT_WHIRL 16
  4992. #define EF_MIPS_ABI2 32
  4993. #define EF_MIPS_ABI_ON32 64
  4994. +#define EF_MIPS_NAN2008 1024
  4995. #define EF_MIPS_ARCH 0xf0000000
  4996. @@ -2092,6 +2093,117 @@
  4997. #define R_AARCH64_NONE 0
  4998. #define R_AARCH64_ABS64 257
  4999. #define R_AARCH64_ABS32 258
  5000. +#define R_AARCH64_ABS16 259
  5001. +#define R_AARCH64_PREL64 260
  5002. +#define R_AARCH64_PREL32 261
  5003. +#define R_AARCH64_PREL16 262
  5004. +#define R_AARCH64_MOVW_UABS_G0 263
  5005. +#define R_AARCH64_MOVW_UABS_G0_NC 264
  5006. +#define R_AARCH64_MOVW_UABS_G1 265
  5007. +#define R_AARCH64_MOVW_UABS_G1_NC 266
  5008. +#define R_AARCH64_MOVW_UABS_G2 267
  5009. +#define R_AARCH64_MOVW_UABS_G2_NC 268
  5010. +#define R_AARCH64_MOVW_UABS_G3 269
  5011. +#define R_AARCH64_MOVW_SABS_G0 270
  5012. +#define R_AARCH64_MOVW_SABS_G1 271
  5013. +#define R_AARCH64_MOVW_SABS_G2 272
  5014. +#define R_AARCH64_LD_PREL_LO19 273
  5015. +#define R_AARCH64_ADR_PREL_LO21 274
  5016. +#define R_AARCH64_ADR_PREL_PG_HI21 275
  5017. +#define R_AARCH64_ADR_PREL_PG_HI21_NC 276
  5018. +#define R_AARCH64_ADD_ABS_LO12_NC 277
  5019. +#define R_AARCH64_LDST8_ABS_LO12_NC 278
  5020. +#define R_AARCH64_TSTBR14 279
  5021. +#define R_AARCH64_CONDBR19 280
  5022. +#define R_AARCH64_JUMP26 282
  5023. +#define R_AARCH64_CALL26 283
  5024. +#define R_AARCH64_LDST16_ABS_LO12_NC 284
  5025. +#define R_AARCH64_LDST32_ABS_LO12_NC 285
  5026. +#define R_AARCH64_LDST64_ABS_LO12_NC 286
  5027. +#define R_AARCH64_MOVW_PREL_G0 287
  5028. +#define R_AARCH64_MOVW_PREL_G0_NC 288
  5029. +#define R_AARCH64_MOVW_PREL_G1 289
  5030. +#define R_AARCH64_MOVW_PREL_G1_NC 290
  5031. +#define R_AARCH64_MOVW_PREL_G2 291
  5032. +#define R_AARCH64_MOVW_PREL_G2_NC 292
  5033. +#define R_AARCH64_MOVW_PREL_G3 293
  5034. +#define R_AARCH64_LDST128_ABS_LO12_NC 299
  5035. +#define R_AARCH64_MOVW_GOTOFF_G0 300
  5036. +#define R_AARCH64_MOVW_GOTOFF_G0_NC 301
  5037. +#define R_AARCH64_MOVW_GOTOFF_G1 302
  5038. +#define R_AARCH64_MOVW_GOTOFF_G1_NC 303
  5039. +#define R_AARCH64_MOVW_GOTOFF_G2 304
  5040. +#define R_AARCH64_MOVW_GOTOFF_G2_NC 305
  5041. +#define R_AARCH64_MOVW_GOTOFF_G3 306
  5042. +#define R_AARCH64_GOTREL64 307
  5043. +#define R_AARCH64_GOTREL32 308
  5044. +#define R_AARCH64_GOT_LD_PREL19 309
  5045. +#define R_AARCH64_LD64_GOTOFF_LO15 310
  5046. +#define R_AARCH64_ADR_GOT_PAGE 311
  5047. +#define R_AARCH64_LD64_GOT_LO12_NC 312
  5048. +#define R_AARCH64_LD64_GOTPAGE_LO15 313
  5049. +#define R_AARCH64_TLSGD_ADR_PREL21 512
  5050. +#define R_AARCH64_TLSGD_ADR_PAGE21 513
  5051. +#define R_AARCH64_TLSGD_ADD_LO12_NC 514
  5052. +#define R_AARCH64_TLSGD_MOVW_G1 515
  5053. +#define R_AARCH64_TLSGD_MOVW_G0_NC 516
  5054. +#define R_AARCH64_TLSLD_ADR_PREL21 517
  5055. +#define R_AARCH64_TLSLD_ADR_PAGE21 518
  5056. +#define R_AARCH64_TLSLD_ADD_LO12_NC 519
  5057. +#define R_AARCH64_TLSLD_MOVW_G1 520
  5058. +#define R_AARCH64_TLSLD_MOVW_G0_NC 521
  5059. +#define R_AARCH64_TLSLD_LD_PREL19 522
  5060. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523
  5061. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524
  5062. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525
  5063. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526
  5064. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527
  5065. +#define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528
  5066. +#define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529
  5067. +#define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530
  5068. +#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531
  5069. +#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532
  5070. +#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533
  5071. +#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534
  5072. +#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535
  5073. +#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536
  5074. +#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537
  5075. +#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538
  5076. +#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539
  5077. +#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540
  5078. +#define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541
  5079. +#define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542
  5080. +#define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543
  5081. +#define R_AARCH64_TLSLE_MOVW_TPREL_G2 544
  5082. +#define R_AARCH64_TLSLE_MOVW_TPREL_G1 545
  5083. +#define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546
  5084. +#define R_AARCH64_TLSLE_MOVW_TPREL_G0 547
  5085. +#define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548
  5086. +#define R_AARCH64_TLSLE_ADD_TPREL_HI12 549
  5087. +#define R_AARCH64_TLSLE_ADD_TPREL_LO12 550
  5088. +#define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551
  5089. +#define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552
  5090. +#define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553
  5091. +#define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554
  5092. +#define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555
  5093. +#define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556
  5094. +#define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557
  5095. +#define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558
  5096. +#define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559
  5097. +#define R_AARCH64_TLSDESC_LD_PREL19 560
  5098. +#define R_AARCH64_TLSDESC_ADR_PREL21 561
  5099. +#define R_AARCH64_TLSDESC_ADR_PAGE21 562
  5100. +#define R_AARCH64_TLSDESC_LD64_LO12 563
  5101. +#define R_AARCH64_TLSDESC_ADD_LO12 564
  5102. +#define R_AARCH64_TLSDESC_OFF_G1 565
  5103. +#define R_AARCH64_TLSDESC_OFF_G0_NC 566
  5104. +#define R_AARCH64_TLSDESC_LDR 567
  5105. +#define R_AARCH64_TLSDESC_ADD 568
  5106. +#define R_AARCH64_TLSDESC_CALL 569
  5107. +#define R_AARCH64_TLSLE_LDST128_TPREL_LO12 570
  5108. +#define R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC 571
  5109. +#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12 572
  5110. +#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC 573
  5111. #define R_AARCH64_COPY 1024
  5112. #define R_AARCH64_GLOB_DAT 1025
  5113. #define R_AARCH64_JUMP_SLOT 1026
  5114. diff -Nur musl-0.9.15/include/fcntl.h musl-git/include/fcntl.h
  5115. --- musl-0.9.15/include/fcntl.h 2014-01-03 21:12:17.000000000 +0100
  5116. +++ musl-git/include/fcntl.h 2014-03-01 08:58:14.000000000 +0100
  5117. @@ -148,6 +148,7 @@
  5118. #define SPLICE_F_MORE 4
  5119. #define SPLICE_F_GIFT 8
  5120. int fallocate(int, int, off_t, off_t);
  5121. +#define fallocate64 fallocate
  5122. ssize_t readahead(int, off_t, size_t);
  5123. int sync_file_range(int, off_t, off_t, unsigned);
  5124. ssize_t vmsplice(int, const struct iovec *, size_t, unsigned);
  5125. @@ -160,6 +161,7 @@
  5126. #define F_GETLK64 F_GETLK
  5127. #define F_SETLK64 F_SETLK
  5128. #define F_SETLKW64 F_SETLKW
  5129. +#define flock64 flock
  5130. #define open64 open
  5131. #define openat64 openat
  5132. #define creat64 creat
  5133. diff -Nur musl-0.9.15/include/netdb.h musl-git/include/netdb.h
  5134. --- musl-0.9.15/include/netdb.h 2014-01-03 21:12:17.000000000 +0100
  5135. +++ musl-git/include/netdb.h 2014-03-01 08:58:14.000000000 +0100
  5136. @@ -131,6 +131,7 @@
  5137. #define TRY_AGAIN 2
  5138. #define NO_RECOVERY 3
  5139. #define NO_DATA 4
  5140. +#define NO_ADDRESS NO_DATA
  5141. #endif
  5142. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5143. diff -Nur musl-0.9.15/include/netinet/if_ether.h musl-git/include/netinet/if_ether.h
  5144. --- musl-0.9.15/include/netinet/if_ether.h 2014-01-03 21:12:17.000000000 +0100
  5145. +++ musl-git/include/netinet/if_ether.h 2014-03-01 08:58:14.000000000 +0100
  5146. @@ -54,6 +54,7 @@
  5147. #define ETH_P_8021AH 0x88E7
  5148. #define ETH_P_MVRP 0x88F5
  5149. #define ETH_P_1588 0x88F7
  5150. +#define ETH_P_PRP 0x88FB
  5151. #define ETH_P_FCOE 0x8906
  5152. #define ETH_P_TDLS 0x890D
  5153. #define ETH_P_FIP 0x8914
  5154. diff -Nur musl-0.9.15/include/netinet/in.h musl-git/include/netinet/in.h
  5155. --- musl-0.9.15/include/netinet/in.h 2014-01-03 21:12:17.000000000 +0100
  5156. +++ musl-git/include/netinet/in.h 2014-03-01 08:58:14.000000000 +0100
  5157. @@ -149,7 +149,7 @@
  5158. (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0xe))
  5159. #define __ARE_4_EQUAL(a,b) \
  5160. - (!( 0[a]-0[b] | 1[a]-1[b] | 2[a]-2[b] | 3[a]-3[b] ))
  5161. + (!( (0[a]-0[b]) | (1[a]-1[b]) | (2[a]-2[b]) | (3[a]-3[b]) ))
  5162. #define IN6_ARE_ADDR_EQUAL(a,b) \
  5163. __ARE_4_EQUAL((const uint32_t *)(a), (const uint32_t *)(b))
  5164. @@ -211,27 +211,13 @@
  5165. #define IP_MULTICAST_ALL 49
  5166. #define IP_UNICAST_IF 50
  5167. -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5168. -#define MCAST_JOIN_GROUP 42
  5169. -#define MCAST_BLOCK_SOURCE 43
  5170. -#define MCAST_UNBLOCK_SOURCE 44
  5171. -#define MCAST_LEAVE_GROUP 45
  5172. -#define MCAST_JOIN_SOURCE_GROUP 46
  5173. -#define MCAST_LEAVE_SOURCE_GROUP 47
  5174. -#define MCAST_MSFILTER 48
  5175. -
  5176. -#define MCAST_EXCLUDE 0
  5177. -#define MCAST_INCLUDE 1
  5178. -#endif
  5179. -
  5180. #define IP_RECVRETOPTS IP_RETOPTS
  5181. #define IP_PMTUDISC_DONT 0
  5182. #define IP_PMTUDISC_WANT 1
  5183. #define IP_PMTUDISC_DO 2
  5184. #define IP_PMTUDISC_PROBE 3
  5185. -
  5186. -#define SOL_IP 0
  5187. +#define IP_PMTUDISC_INTERFACE 4
  5188. #define IP_DEFAULT_MULTICAST_TTL 1
  5189. #define IP_DEFAULT_MULTICAST_LOOP 1
  5190. @@ -243,6 +229,19 @@
  5191. char ip_opts[40];
  5192. };
  5193. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5194. +
  5195. +#define MCAST_JOIN_GROUP 42
  5196. +#define MCAST_BLOCK_SOURCE 43
  5197. +#define MCAST_UNBLOCK_SOURCE 44
  5198. +#define MCAST_LEAVE_GROUP 45
  5199. +#define MCAST_JOIN_SOURCE_GROUP 46
  5200. +#define MCAST_LEAVE_SOURCE_GROUP 47
  5201. +#define MCAST_MSFILTER 48
  5202. +
  5203. +#define MCAST_EXCLUDE 0
  5204. +#define MCAST_INCLUDE 1
  5205. +
  5206. struct ip_mreq
  5207. {
  5208. struct in_addr imr_multiaddr;
  5209. @@ -273,7 +272,6 @@
  5210. (sizeof(struct ip_msfilter) - sizeof(struct in_addr) \
  5211. + (numsrc) * sizeof(struct in_addr))
  5212. -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5213. struct group_req {
  5214. uint32_t gr_interface;
  5215. struct sockaddr_storage gr_group;
  5216. @@ -295,7 +293,6 @@
  5217. #define GROUP_FILTER_SIZE(numsrc) \
  5218. (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) \
  5219. + (numsrc) * sizeof(struct sockaddr_storage))
  5220. -#endif
  5221. struct in_pktinfo
  5222. {
  5223. @@ -315,6 +312,7 @@
  5224. struct sockaddr_in6 ip6m_addr;
  5225. uint32_t ip6m_mtu;
  5226. };
  5227. +#endif
  5228. #define IPV6_ADDRFORM 1
  5229. #define IPV6_2292PKTINFO 2
  5230. @@ -324,7 +322,6 @@
  5231. #define IPV6_2292PKTOPTIONS 6
  5232. #define IPV6_CHECKSUM 7
  5233. #define IPV6_2292HOPLIMIT 8
  5234. -#define SCM_SRCRT IPV6_RXSRCRT
  5235. #define IPV6_NEXTHOP 9
  5236. #define IPV6_AUTHHDR 10
  5237. #define IPV6_UNICAST_HOPS 16
  5238. @@ -363,15 +360,11 @@
  5239. #define IPV6_RXHOPOPTS IPV6_HOPOPTS
  5240. #define IPV6_RXDSTOPTS IPV6_DSTOPTS
  5241. -
  5242. #define IPV6_PMTUDISC_DONT 0
  5243. #define IPV6_PMTUDISC_WANT 1
  5244. #define IPV6_PMTUDISC_DO 2
  5245. #define IPV6_PMTUDISC_PROBE 3
  5246. -#define SOL_IPV6 41
  5247. -#define SOL_ICMPV6 58
  5248. -
  5249. #define IPV6_RTHDR_LOOSE 0
  5250. #define IPV6_RTHDR_STRICT 1
  5251. diff -Nur musl-0.9.15/include/netinet/tcp.h musl-git/include/netinet/tcp.h
  5252. --- musl-0.9.15/include/netinet/tcp.h 2014-01-03 21:12:17.000000000 +0100
  5253. +++ musl-git/include/netinet/tcp.h 2014-03-01 08:58:14.000000000 +0100
  5254. @@ -44,42 +44,80 @@
  5255. #define SOL_TCP 6
  5256. #include <sys/types.h>
  5257. #include <sys/socket.h>
  5258. -#endif
  5259. +#include <stdint.h>
  5260. +#include <endian.h>
  5261. +
  5262. +typedef uint32_t tcp_seq;
  5263. +#define TH_FIN 0x01
  5264. +#define TH_SYN 0x02
  5265. +#define TH_RST 0x04
  5266. +#define TH_PUSH 0x08
  5267. +#define TH_ACK 0x10
  5268. +#define TH_URG 0x20
  5269. +
  5270. +struct tcphdr {
  5271. #ifdef _GNU_SOURCE
  5272. -#include <endian.h>
  5273. -struct tcphdr
  5274. -{
  5275. - u_int16_t source;
  5276. - u_int16_t dest;
  5277. - u_int32_t seq;
  5278. - u_int32_t ack_seq;
  5279. +#ifdef __GNUC__
  5280. + __extension__
  5281. +#endif
  5282. + union { struct {
  5283. +
  5284. + uint16_t source;
  5285. + uint16_t dest;
  5286. + uint32_t seq;
  5287. + uint32_t ack_seq;
  5288. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  5289. + uint16_t res1:4;
  5290. + uint16_t doff:4;
  5291. + uint16_t fin:1;
  5292. + uint16_t syn:1;
  5293. + uint16_t rst:1;
  5294. + uint16_t psh:1;
  5295. + uint16_t ack:1;
  5296. + uint16_t urg:1;
  5297. + uint16_t res2:2;
  5298. +#else
  5299. + uint16_t doff:4;
  5300. + uint16_t res1:4;
  5301. + uint16_t res2:2;
  5302. + uint16_t urg:1;
  5303. + uint16_t ack:1;
  5304. + uint16_t psh:1;
  5305. + uint16_t rst:1;
  5306. + uint16_t syn:1;
  5307. + uint16_t fin:1;
  5308. +#endif
  5309. + uint16_t window;
  5310. + uint16_t check;
  5311. + uint16_t urg_ptr;
  5312. +
  5313. + }; struct {
  5314. +#endif
  5315. +
  5316. + uint16_t th_sport;
  5317. + uint16_t th_dport;
  5318. + uint32_t th_seq;
  5319. + uint32_t th_ack;
  5320. #if __BYTE_ORDER == __LITTLE_ENDIAN
  5321. - u_int16_t res1:4;
  5322. - u_int16_t doff:4;
  5323. - u_int16_t fin:1;
  5324. - u_int16_t syn:1;
  5325. - u_int16_t rst:1;
  5326. - u_int16_t psh:1;
  5327. - u_int16_t ack:1;
  5328. - u_int16_t urg:1;
  5329. - u_int16_t res2:2;
  5330. + uint8_t th_x2:4;
  5331. + uint8_t th_off:4;
  5332. #else
  5333. - u_int16_t doff:4;
  5334. - u_int16_t res1:4;
  5335. - u_int16_t res2:2;
  5336. - u_int16_t urg:1;
  5337. - u_int16_t ack:1;
  5338. - u_int16_t psh:1;
  5339. - u_int16_t rst:1;
  5340. - u_int16_t syn:1;
  5341. - u_int16_t fin:1;
  5342. -#endif
  5343. - u_int16_t window;
  5344. - u_int16_t check;
  5345. - u_int16_t urg_ptr;
  5346. + uint8_t th_off:4;
  5347. + uint8_t th_x2:4;
  5348. +#endif
  5349. + uint8_t th_flags;
  5350. + uint16_t th_win;
  5351. + uint16_t th_sum;
  5352. + uint16_t th_urp;
  5353. +
  5354. +#ifdef _GNU_SOURCE
  5355. + }; };
  5356. +#endif
  5357. };
  5358. +#endif
  5359. +#ifdef _GNU_SOURCE
  5360. #define TCPI_OPT_TIMESTAMPS 1
  5361. #define TCPI_OPT_SACK 2
  5362. #define TCPI_OPT_WSCALE 4
  5363. @@ -93,37 +131,37 @@
  5364. struct tcp_info
  5365. {
  5366. - u_int8_t tcpi_state;
  5367. - u_int8_t tcpi_ca_state;
  5368. - u_int8_t tcpi_retransmits;
  5369. - u_int8_t tcpi_probes;
  5370. - u_int8_t tcpi_backoff;
  5371. - u_int8_t tcpi_options;
  5372. - u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
  5373. - u_int32_t tcpi_rto;
  5374. - u_int32_t tcpi_ato;
  5375. - u_int32_t tcpi_snd_mss;
  5376. - u_int32_t tcpi_rcv_mss;
  5377. - u_int32_t tcpi_unacked;
  5378. - u_int32_t tcpi_sacked;
  5379. - u_int32_t tcpi_lost;
  5380. - u_int32_t tcpi_retrans;
  5381. - u_int32_t tcpi_fackets;
  5382. - u_int32_t tcpi_last_data_sent;
  5383. - u_int32_t tcpi_last_ack_sent;
  5384. - u_int32_t tcpi_last_data_recv;
  5385. - u_int32_t tcpi_last_ack_recv;
  5386. - u_int32_t tcpi_pmtu;
  5387. - u_int32_t tcpi_rcv_ssthresh;
  5388. - u_int32_t tcpi_rtt;
  5389. - u_int32_t tcpi_rttvar;
  5390. - u_int32_t tcpi_snd_ssthresh;
  5391. - u_int32_t tcpi_snd_cwnd;
  5392. - u_int32_t tcpi_advmss;
  5393. - u_int32_t tcpi_reordering;
  5394. - u_int32_t tcpi_rcv_rtt;
  5395. - u_int32_t tcpi_rcv_space;
  5396. - u_int32_t tcpi_total_retrans;
  5397. + uint8_t tcpi_state;
  5398. + uint8_t tcpi_ca_state;
  5399. + uint8_t tcpi_retransmits;
  5400. + uint8_t tcpi_probes;
  5401. + uint8_t tcpi_backoff;
  5402. + uint8_t tcpi_options;
  5403. + uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
  5404. + uint32_t tcpi_rto;
  5405. + uint32_t tcpi_ato;
  5406. + uint32_t tcpi_snd_mss;
  5407. + uint32_t tcpi_rcv_mss;
  5408. + uint32_t tcpi_unacked;
  5409. + uint32_t tcpi_sacked;
  5410. + uint32_t tcpi_lost;
  5411. + uint32_t tcpi_retrans;
  5412. + uint32_t tcpi_fackets;
  5413. + uint32_t tcpi_last_data_sent;
  5414. + uint32_t tcpi_last_ack_sent;
  5415. + uint32_t tcpi_last_data_recv;
  5416. + uint32_t tcpi_last_ack_recv;
  5417. + uint32_t tcpi_pmtu;
  5418. + uint32_t tcpi_rcv_ssthresh;
  5419. + uint32_t tcpi_rtt;
  5420. + uint32_t tcpi_rttvar;
  5421. + uint32_t tcpi_snd_ssthresh;
  5422. + uint32_t tcpi_snd_cwnd;
  5423. + uint32_t tcpi_advmss;
  5424. + uint32_t tcpi_reordering;
  5425. + uint32_t tcpi_rcv_rtt;
  5426. + uint32_t tcpi_rcv_space;
  5427. + uint32_t tcpi_total_retrans;
  5428. };
  5429. #define TCP_MD5SIG_MAXKEYLEN 80
  5430. @@ -131,10 +169,10 @@
  5431. struct tcp_md5sig
  5432. {
  5433. struct sockaddr_storage tcpm_addr;
  5434. - u_int16_t __tcpm_pad1;
  5435. - u_int16_t tcpm_keylen;
  5436. - u_int32_t __tcpm_pad2;
  5437. - u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
  5438. + uint16_t __tcpm_pad1;
  5439. + uint16_t tcpm_keylen;
  5440. + uint32_t __tcpm_pad2;
  5441. + uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
  5442. };
  5443. #endif
  5444. diff -Nur musl-0.9.15/include/netinet/udp.h musl-git/include/netinet/udp.h
  5445. --- musl-0.9.15/include/netinet/udp.h 2014-01-03 21:12:17.000000000 +0100
  5446. +++ musl-git/include/netinet/udp.h 2014-03-01 08:58:14.000000000 +0100
  5447. @@ -5,19 +5,22 @@
  5448. extern "C" {
  5449. #endif
  5450. +#include <features.h>
  5451. #include <stdint.h>
  5452. -struct udphdr {
  5453. - uint16_t source;
  5454. - uint16_t dest;
  5455. - uint16_t len;
  5456. - uint16_t check;
  5457. -};
  5458. -
  5459. +#ifdef _GNU_SOURCE
  5460. #define uh_sport source
  5461. #define uh_dport dest
  5462. #define uh_ulen len
  5463. #define uh_sum check
  5464. +#endif
  5465. +
  5466. +struct udphdr {
  5467. + uint16_t uh_sport;
  5468. + uint16_t uh_dport;
  5469. + uint16_t uh_ulen;
  5470. + uint16_t uh_sum;
  5471. +};
  5472. #define UDP_CORK 1
  5473. #define UDP_ENCAP 100
  5474. diff -Nur musl-0.9.15/include/sched.h musl-git/include/sched.h
  5475. --- musl-0.9.15/include/sched.h 2014-01-03 21:12:17.000000000 +0100
  5476. +++ musl-git/include/sched.h 2014-03-01 08:58:14.000000000 +0100
  5477. @@ -78,7 +78,7 @@
  5478. int sched_getaffinity(pid_t, size_t, cpu_set_t *);
  5479. int sched_setaffinity(pid_t, size_t, const cpu_set_t *);
  5480. -#define __CPU_op_S(i, size, set, op) ( (i)/8 >= (size) ? 0 : \
  5481. +#define __CPU_op_S(i, size, set, op) ( (i)/8U >= (size) ? 0 : \
  5482. ((set)->__bits[(i)/8/sizeof(long)] op (1UL<<((i)%(8*sizeof(long))))) )
  5483. #define CPU_SET_S(i, size, set) __CPU_op_S(i, size, set, |=)
  5484. diff -Nur musl-0.9.15/include/signal.h musl-git/include/signal.h
  5485. --- musl-0.9.15/include/signal.h 2014-01-03 21:12:17.000000000 +0100
  5486. +++ musl-git/include/signal.h 2014-03-01 08:58:14.000000000 +0100
  5487. @@ -227,8 +227,8 @@
  5488. typedef void (*sighandler_t)(int);
  5489. void (*bsd_signal(int, void (*)(int)))(int);
  5490. int sigisemptyset(const sigset_t *);
  5491. -int sigorset (sigset_t *, sigset_t *, sigset_t *);
  5492. -int sigandset(sigset_t *, sigset_t *, sigset_t *);
  5493. +int sigorset (sigset_t *, const sigset_t *, const sigset_t *);
  5494. +int sigandset(sigset_t *, const sigset_t *, const sigset_t *);
  5495. #define SA_NOMASK SA_NODEFER
  5496. #define SA_ONESHOT SA_RESETHAND
  5497. diff -Nur musl-0.9.15/include/stdlib.h musl-git/include/stdlib.h
  5498. --- musl-0.9.15/include/stdlib.h 2014-01-03 21:12:17.000000000 +0100
  5499. +++ musl-git/include/stdlib.h 2014-03-01 08:58:14.000000000 +0100
  5500. @@ -93,7 +93,7 @@
  5501. #define WSTOPSIG(s) WEXITSTATUS(s)
  5502. #define WIFEXITED(s) (!WTERMSIG(s))
  5503. #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
  5504. -#define WIFSIGNALED(s) (((s)&0xffff)-1 < 0xffu)
  5505. +#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
  5506. int posix_memalign (void **, size_t, size_t);
  5507. int setenv (const char *, const char *, int);
  5508. diff -Nur musl-0.9.15/include/sys/inotify.h musl-git/include/sys/inotify.h
  5509. --- musl-0.9.15/include/sys/inotify.h 2014-01-03 21:12:17.000000000 +0100
  5510. +++ musl-git/include/sys/inotify.h 2014-03-01 08:58:14.000000000 +0100
  5511. @@ -48,7 +48,7 @@
  5512. int inotify_init(void);
  5513. int inotify_init1(int);
  5514. int inotify_add_watch(int, const char *, uint32_t);
  5515. -int inotify_rm_watch(int, uint32_t);
  5516. +int inotify_rm_watch(int, int);
  5517. #ifdef __cplusplus
  5518. }
  5519. diff -Nur musl-0.9.15/include/sys/mman.h musl-git/include/sys/mman.h
  5520. --- musl-0.9.15/include/sys/mman.h 2014-01-03 21:12:17.000000000 +0100
  5521. +++ musl-git/include/sys/mman.h 2014-03-01 08:58:14.000000000 +0100
  5522. @@ -33,7 +33,7 @@
  5523. #ifdef _GNU_SOURCE
  5524. void *mremap (void *, size_t, size_t, int, ...);
  5525. -int remap_file_pages (void *, size_t, int, ssize_t, int);
  5526. +int remap_file_pages (void *, size_t, int, size_t, int);
  5527. #endif
  5528. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5529. diff -Nur musl-0.9.15/include/sys/sem.h musl-git/include/sys/sem.h
  5530. --- musl-0.9.15/include/sys/sem.h 2014-01-03 21:12:17.000000000 +0100
  5531. +++ musl-git/include/sys/sem.h 2014-03-01 08:58:14.000000000 +0100
  5532. @@ -29,19 +29,19 @@
  5533. struct semid_ds {
  5534. struct ipc_perm sem_perm;
  5535. - long sem_otime;
  5536. - unsigned long __unused1;
  5537. - long sem_ctime;
  5538. - unsigned long __unused2;
  5539. + time_t sem_otime;
  5540. + time_t __unused1;
  5541. + time_t sem_ctime;
  5542. + time_t __unused2;
  5543. #if __BYTE_ORDER == __LITTLE_ENDIAN
  5544. unsigned short sem_nsems;
  5545. - char __sem_nsems_pad[sizeof(long)-sizeof(short)];
  5546. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  5547. #else
  5548. - char __sem_nsems_pad[sizeof(long)-sizeof(short)];
  5549. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  5550. unsigned short sem_nsems;
  5551. #endif
  5552. - unsigned long __unused3;
  5553. - unsigned long __unused4;
  5554. + time_t __unused3;
  5555. + time_t __unused4;
  5556. };
  5557. #define _SEM_SEMUN_UNDEFINED 1
  5558. diff -Nur musl-0.9.15/include/sys/shm.h musl-git/include/sys/shm.h
  5559. --- musl-0.9.15/include/sys/shm.h 2014-01-03 21:12:17.000000000 +0100
  5560. +++ musl-git/include/sys/shm.h 2014-03-01 08:58:14.000000000 +0100
  5561. @@ -14,6 +14,13 @@
  5562. #include <bits/alltypes.h>
  5563. #include <sys/ipc.h>
  5564. +
  5565. +#ifdef _GNU_SOURCE
  5566. +#define __used_ids used_ids
  5567. +#define __swap_attempts swap_attempts
  5568. +#define __swap_successes swap_successes
  5569. +#endif
  5570. +
  5571. #include <bits/shm.h>
  5572. #define SHM_R 0400
  5573. @@ -33,20 +40,6 @@
  5574. #define SHM_HUGETLB 04000
  5575. #define SHM_NORESERVE 010000
  5576. -struct shminfo {
  5577. - unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  5578. -};
  5579. -
  5580. -struct shm_info {
  5581. - int used_ids;
  5582. - unsigned long shm_tot, shm_rss, shm_swp;
  5583. -#ifdef _GNU_SOURCE
  5584. - unsigned long swap_attempts, swap_successes;
  5585. -#else
  5586. - unsigned long __reserved[2];
  5587. -#endif
  5588. -};
  5589. -
  5590. typedef unsigned long shmatt_t;
  5591. void *shmat(int, const void *, int);
  5592. diff -Nur musl-0.9.15/include/sys/socket.h musl-git/include/sys/socket.h
  5593. --- musl-0.9.15/include/sys/socket.h 2014-01-03 21:12:17.000000000 +0100
  5594. +++ musl-git/include/sys/socket.h 2014-03-01 08:58:14.000000000 +0100
  5595. @@ -202,11 +202,16 @@
  5596. #define SO_LOCK_FILTER 44
  5597. #define SO_SELECT_ERR_QUEUE 45
  5598. #define SO_BUSY_POLL 46
  5599. +#define SO_MAX_PACING_RATE 47
  5600. #ifndef SOL_SOCKET
  5601. #define SOL_SOCKET 1
  5602. #endif
  5603. +#define SOL_IP 0
  5604. +#define SOL_IPV6 41
  5605. +#define SOL_ICMPV6 58
  5606. +
  5607. #define SOL_RAW 255
  5608. #define SOL_DECNET 261
  5609. #define SOL_X25 262
  5610. diff -Nur musl-0.9.15/include/sys/sysctl.h musl-git/include/sys/sysctl.h
  5611. --- musl-0.9.15/include/sys/sysctl.h 2014-01-03 21:12:17.000000000 +0100
  5612. +++ musl-git/include/sys/sysctl.h 1970-01-01 01:00:00.000000000 +0100
  5613. @@ -1,17 +0,0 @@
  5614. -#ifndef _SYS_SYSCTL_H
  5615. -#define _SYS_SYSCTL_H
  5616. -
  5617. -#ifdef __cplusplus
  5618. -extern "C" {
  5619. -#endif
  5620. -
  5621. -#define __NEED_size_t
  5622. -#include <bits/alltypes.h>
  5623. -
  5624. -int sysctl (int *, int, void *, size_t *, void *, size_t);
  5625. -
  5626. -#ifdef __cplusplus
  5627. -}
  5628. -#endif
  5629. -
  5630. -#endif
  5631. diff -Nur musl-0.9.15/include/sys/time.h musl-git/include/sys/time.h
  5632. --- musl-0.9.15/include/sys/time.h 2014-01-03 21:12:17.000000000 +0100
  5633. +++ musl-git/include/sys/time.h 2014-03-01 08:58:14.000000000 +0100
  5634. @@ -51,6 +51,17 @@
  5635. ((a)->tv_usec += 1000000, (a)->tv_sec--) )
  5636. #endif
  5637. +#if defined(_GNU_SOURCE)
  5638. +#define TIMEVAL_TO_TIMESPEC(tv, ts) ( \
  5639. + (ts)->tv_sec = (tv)->tv_sec, \
  5640. + (ts)->tv_nsec = (tv)->tv_usec * 1000, \
  5641. + (void)0 )
  5642. +#define TIMESPEC_TO_TIMEVAL(tv, ts) ( \
  5643. + (tv)->tv_sec = (ts)->tv_sec, \
  5644. + (tv)->tv_usec = (ts)->tv_nsec / 1000, \
  5645. + (void)0 )
  5646. +#endif
  5647. +
  5648. #ifdef __cplusplus
  5649. }
  5650. #endif
  5651. diff -Nur musl-0.9.15/include/sys/wait.h musl-git/include/sys/wait.h
  5652. --- musl-0.9.15/include/sys/wait.h 2014-01-03 21:12:17.000000000 +0100
  5653. +++ musl-git/include/sys/wait.h 2014-03-01 08:58:14.000000000 +0100
  5654. @@ -50,7 +50,7 @@
  5655. #define WCOREDUMP(s) ((s) & 0x80)
  5656. #define WIFEXITED(s) (!WTERMSIG(s))
  5657. #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
  5658. -#define WIFSIGNALED(s) (((s)&0xffff)-1 < 0xffu)
  5659. +#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
  5660. #define WIFCONTINUED(s) ((s) == 0xffff)
  5661. #ifdef __cplusplus
  5662. diff -Nur musl-0.9.15/include/syslog.h musl-git/include/syslog.h
  5663. --- musl-0.9.15/include/syslog.h 2014-01-03 21:12:17.000000000 +0100
  5664. +++ musl-git/include/syslog.h 2014-03-01 08:58:14.000000000 +0100
  5665. @@ -21,7 +21,7 @@
  5666. #define LOG_MAKEPRI(f, p) (((f)<<3)|(p))
  5667. #define LOG_MASK(p) (1<<(p))
  5668. -#define LOG_UPTO(p) ((1<<(p)+1)-1)
  5669. +#define LOG_UPTO(p) ((1<<((p)+1))-1)
  5670. #define LOG_KERN (0<<3)
  5671. #define LOG_USER (1<<3)
  5672. diff -Nur musl-0.9.15/include/time.h musl-git/include/time.h
  5673. --- musl-0.9.15/include/time.h 2014-01-03 21:12:17.000000000 +0100
  5674. +++ musl-git/include/time.h 2014-03-01 08:58:14.000000000 +0100
  5675. @@ -125,7 +125,7 @@
  5676. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5677. -int stime(time_t *);
  5678. +int stime(const time_t *);
  5679. time_t timegm(struct tm *);
  5680. #endif
  5681. diff -Nur musl-0.9.15/include/utmp.h musl-git/include/utmp.h
  5682. --- musl-0.9.15/include/utmp.h 2014-01-03 21:12:17.000000000 +0100
  5683. +++ musl-git/include/utmp.h 2014-03-01 08:58:14.000000000 +0100
  5684. @@ -10,6 +10,7 @@
  5685. #define ACCOUNTING 9
  5686. #define UT_NAMESIZE 32
  5687. #define UT_HOSTSIZE 256
  5688. +#define UT_LINESIZE 32
  5689. struct lastlog {
  5690. time_t ll_time;
  5691. @@ -22,6 +23,8 @@
  5692. #define ut_addr ut_addr_v6[0]
  5693. #define utmp utmpx
  5694. #define utmpname(x) (-1)
  5695. +#define e_exit __e_exit
  5696. +#define e_termination __e_termination
  5697. void endutent(void);
  5698. struct utmp *getutent(void);
  5699. diff -Nur musl-0.9.15/include/utmpx.h musl-git/include/utmpx.h
  5700. --- musl-0.9.15/include/utmpx.h 2014-01-03 21:12:17.000000000 +0100
  5701. +++ musl-git/include/utmpx.h 2014-03-01 08:58:14.000000000 +0100
  5702. @@ -5,6 +5,8 @@
  5703. extern "C" {
  5704. #endif
  5705. +#include <features.h>
  5706. +
  5707. #define __NEED_pid_t
  5708. #define __NEED_time_t
  5709. #define __NEED_suseconds_t
  5710. @@ -12,19 +14,17 @@
  5711. #include <bits/alltypes.h>
  5712. -#define UT_LINESIZE 32
  5713. -
  5714. struct utmpx
  5715. {
  5716. short ut_type;
  5717. pid_t ut_pid;
  5718. - char ut_line[UT_LINESIZE];
  5719. + char ut_line[32];
  5720. char ut_id[4];
  5721. char ut_user[32];
  5722. char ut_host[256];
  5723. struct {
  5724. - short e_termination;
  5725. - short e_exit;
  5726. + short __e_termination;
  5727. + short __e_exit;
  5728. } ut_exit;
  5729. long ut_session;
  5730. struct timeval ut_tv;
  5731. @@ -39,7 +39,11 @@
  5732. struct utmpx *pututxline(const struct utmpx *);
  5733. void setutxent(void);
  5734. +#if defined(_BSD_SOURCE) | defined(_GNU_SOURCE)
  5735. +#define e_exit __e_exit
  5736. +#define e_termination __e_termination
  5737. void updwtmpx(const char *, const struct utmpx *);
  5738. +#endif
  5739. #define EMPTY 0
  5740. #define RUN_LVL 1
  5741. diff -Nur musl-0.9.15/src/crypt/crypt_des.c musl-git/src/crypt/crypt_des.c
  5742. --- musl-0.9.15/src/crypt/crypt_des.c 2014-01-03 21:12:17.000000000 +0100
  5743. +++ musl-git/src/crypt/crypt_des.c 2014-03-01 08:58:14.000000000 +0100
  5744. @@ -692,7 +692,7 @@
  5745. return saltbits;
  5746. }
  5747. -static void des_setkey(const unsigned char *key, struct expanded_key *ekey)
  5748. +void __des_setkey(const unsigned char *key, struct expanded_key *ekey)
  5749. {
  5750. uint32_t k0, k1, rawkey0, rawkey1;
  5751. unsigned int shifts, round, i, ibit;
  5752. @@ -753,7 +753,7 @@
  5753. /*
  5754. * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format.
  5755. */
  5756. -static void do_des(uint32_t l_in, uint32_t r_in,
  5757. +void __do_des(uint32_t l_in, uint32_t r_in,
  5758. uint32_t *l_out, uint32_t *r_out,
  5759. uint32_t count, uint32_t saltbits, const struct expanded_key *ekey)
  5760. {
  5761. @@ -862,7 +862,7 @@
  5762. ((uint32_t)in[5] << 16) |
  5763. ((uint32_t)in[4] << 24);
  5764. - do_des(rawl, rawr, &l_out, &r_out, count, saltbits, ekey);
  5765. + __do_des(rawl, rawr, &l_out, &r_out, count, saltbits, ekey);
  5766. out[0] = l_out >> 24;
  5767. out[1] = l_out >> 16;
  5768. @@ -894,7 +894,7 @@
  5769. if (*key)
  5770. key++;
  5771. }
  5772. - des_setkey(keybuf, &ekey);
  5773. + __des_setkey(keybuf, &ekey);
  5774. if (*setting == _PASSWORD_EFMT1) {
  5775. /*
  5776. @@ -929,7 +929,7 @@
  5777. q = keybuf;
  5778. while (q <= &keybuf[sizeof(keybuf) - 1] && *key)
  5779. *q++ ^= *key++ << 1;
  5780. - des_setkey(keybuf, &ekey);
  5781. + __des_setkey(keybuf, &ekey);
  5782. }
  5783. memcpy(output, setting, 9);
  5784. @@ -957,7 +957,7 @@
  5785. /*
  5786. * Do it.
  5787. */
  5788. - do_des(0, 0, &r0, &r1, count, setup_salt(salt), &ekey);
  5789. + __do_des(0, 0, &r0, &r1, count, setup_salt(salt), &ekey);
  5790. /*
  5791. * Now encode the result...
  5792. diff -Nur musl-0.9.15/src/crypt/encrypt.c musl-git/src/crypt/encrypt.c
  5793. --- musl-0.9.15/src/crypt/encrypt.c 1970-01-01 01:00:00.000000000 +0100
  5794. +++ musl-git/src/crypt/encrypt.c 2014-03-01 08:58:14.000000000 +0100
  5795. @@ -0,0 +1,60 @@
  5796. +#include <stdint.h>
  5797. +#include <stdlib.h>
  5798. +#include <unistd.h>
  5799. +
  5800. +struct expanded_key {
  5801. + uint32_t l[16], r[16];
  5802. +};
  5803. +
  5804. +void __des_setkey(const unsigned char *key, struct expanded_key *ekey);
  5805. +void __do_des(uint32_t l_in, uint32_t r_in,
  5806. + uint32_t *l_out, uint32_t *r_out,
  5807. + uint32_t count, uint32_t saltbits, const struct expanded_key *ekey);
  5808. +
  5809. +
  5810. +static struct expanded_key __encrypt_key;
  5811. +
  5812. +void setkey(const char *key)
  5813. +{
  5814. + unsigned char bkey[8];
  5815. + int i, j;
  5816. +
  5817. + for (i = 0; i < 8; i++) {
  5818. + bkey[i] = 0;
  5819. + for (j = 7; j >= 0; j--, key++)
  5820. + bkey[i] |= (uint32_t)(*key & 1) << j;
  5821. + }
  5822. +
  5823. + __des_setkey(bkey, &__encrypt_key);
  5824. +}
  5825. +
  5826. +void encrypt(char *block, int edflag)
  5827. +{
  5828. + struct expanded_key decrypt_key, *key;
  5829. + uint32_t b[2];
  5830. + int i, j;
  5831. + char *p;
  5832. +
  5833. + p = block;
  5834. + for (i = 0; i < 2; i++) {
  5835. + b[i] = 0;
  5836. + for (j = 31; j >= 0; j--, p++)
  5837. + b[i] |= (uint32_t)(*p & 1) << j;
  5838. + }
  5839. +
  5840. + key = &__encrypt_key;
  5841. + if (edflag) {
  5842. + key = &decrypt_key;
  5843. + for (i = 0; i < 16; i++) {
  5844. + decrypt_key.l[i] = __encrypt_key.l[15-i];
  5845. + decrypt_key.r[i] = __encrypt_key.r[15-i];
  5846. + }
  5847. + }
  5848. +
  5849. + __do_des(b[0], b[1], b, b + 1, 1, 0, key);
  5850. +
  5851. + p = block;
  5852. + for (i = 0; i < 2; i++)
  5853. + for (j = 31; j >= 0; j--)
  5854. + *p++ = b[i]>>j & 1;
  5855. +}
  5856. diff -Nur musl-0.9.15/src/dirent/readdir.c musl-git/src/dirent/readdir.c
  5857. --- musl-0.9.15/src/dirent/readdir.c 2014-01-03 21:12:17.000000000 +0100
  5858. +++ musl-git/src/dirent/readdir.c 2014-03-01 08:58:14.000000000 +0100
  5859. @@ -1,5 +1,7 @@
  5860. #include <dirent.h>
  5861. +#include <errno.h>
  5862. #include "__dirent.h"
  5863. +#include "syscall.h"
  5864. #include "libc.h"
  5865. int __getdents(int, struct dirent *, size_t);
  5866. @@ -9,8 +11,11 @@
  5867. struct dirent *de;
  5868. if (dir->buf_pos >= dir->buf_end) {
  5869. - int len = __getdents(dir->fd, (void *)dir->buf, sizeof dir->buf);
  5870. - if (len <= 0) return 0;
  5871. + int len = __syscall(SYS_getdents, dir->fd, dir->buf, sizeof dir->buf);
  5872. + if (len <= 0) {
  5873. + if (len < 0 && len != -ENOENT) errno = -len;
  5874. + return 0;
  5875. + }
  5876. dir->buf_end = len;
  5877. dir->buf_pos = 0;
  5878. }
  5879. diff -Nur musl-0.9.15/src/fcntl/fcntl.c musl-git/src/fcntl/fcntl.c
  5880. --- musl-0.9.15/src/fcntl/fcntl.c 2014-01-03 21:12:17.000000000 +0100
  5881. +++ musl-git/src/fcntl/fcntl.c 2014-03-01 08:58:14.000000000 +0100
  5882. @@ -13,11 +13,11 @@
  5883. arg = va_arg(ap, long);
  5884. va_end(ap);
  5885. if (cmd == F_SETFL) arg |= O_LARGEFILE;
  5886. - if (cmd == F_SETLKW) return syscall_cp(SYS_fcntl, fd, cmd, arg);
  5887. + if (cmd == F_SETLKW) return syscall_cp(SYS_fcntl, fd, cmd, (void *)arg);
  5888. if (cmd == F_GETOWN) {
  5889. struct f_owner_ex ex;
  5890. int ret = __syscall(SYS_fcntl, fd, F_GETOWN_EX, &ex);
  5891. - if (ret == -EINVAL) return __syscall(SYS_fcntl, fd, cmd, arg);
  5892. + if (ret == -EINVAL) return __syscall(SYS_fcntl, fd, cmd, (void *)arg);
  5893. if (ret) return __syscall_ret(ret);
  5894. return ex.type == F_OWNER_PGRP ? -ex.pid : ex.pid;
  5895. }
  5896. @@ -37,5 +37,14 @@
  5897. if (ret >= 0) __syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC);
  5898. return __syscall_ret(ret);
  5899. }
  5900. - return syscall(SYS_fcntl, fd, cmd, arg);
  5901. + switch (cmd) {
  5902. + case F_SETLK:
  5903. + case F_SETLKW:
  5904. + case F_GETLK:
  5905. + case F_GETOWN_EX:
  5906. + case F_SETOWN_EX:
  5907. + return syscall(SYS_fcntl, fd, cmd, (void *)arg);
  5908. + default:
  5909. + return syscall(SYS_fcntl, fd, cmd, arg);
  5910. + }
  5911. }
  5912. diff -Nur musl-0.9.15/src/fcntl/posix_fadvise.c musl-git/src/fcntl/posix_fadvise.c
  5913. --- musl-0.9.15/src/fcntl/posix_fadvise.c 2014-01-03 21:12:17.000000000 +0100
  5914. +++ musl-git/src/fcntl/posix_fadvise.c 2014-03-01 08:58:14.000000000 +0100
  5915. @@ -1,8 +1,11 @@
  5916. #include <fcntl.h>
  5917. #include "syscall.h"
  5918. +#include "libc.h"
  5919. int posix_fadvise(int fd, off_t base, off_t len, int advice)
  5920. {
  5921. return -(__syscall)(SYS_fadvise, fd, __SYSCALL_LL_O(base),
  5922. __SYSCALL_LL_E(len), advice);
  5923. }
  5924. +
  5925. +LFS64(posix_fadvise);
  5926. diff -Nur musl-0.9.15/src/fcntl/posix_fallocate.c musl-git/src/fcntl/posix_fallocate.c
  5927. --- musl-0.9.15/src/fcntl/posix_fallocate.c 2014-01-03 21:12:17.000000000 +0100
  5928. +++ musl-git/src/fcntl/posix_fallocate.c 2014-03-01 08:58:14.000000000 +0100
  5929. @@ -1,8 +1,11 @@
  5930. #include <fcntl.h>
  5931. #include "syscall.h"
  5932. +#include "libc.h"
  5933. int posix_fallocate(int fd, off_t base, off_t len)
  5934. {
  5935. return -__syscall(SYS_fallocate, fd, 0, __SYSCALL_LL_E(base),
  5936. __SYSCALL_LL_E(len));
  5937. }
  5938. +
  5939. +LFS64(posix_fallocate);
  5940. diff -Nur musl-0.9.15/src/fenv/i386/fenv.s musl-git/src/fenv/i386/fenv.s
  5941. --- musl-0.9.15/src/fenv/i386/fenv.s 2014-01-03 21:12:17.000000000 +0100
  5942. +++ musl-git/src/fenv/i386/fenv.s 2014-03-01 08:58:14.000000000 +0100
  5943. @@ -126,7 +126,7 @@
  5944. push %eax
  5945. push %eax
  5946. push %eax
  5947. - push %eax
  5948. + pushl $0xffff
  5949. push %eax
  5950. pushl $0x37f
  5951. fldenv (%esp)
  5952. diff -Nur musl-0.9.15/src/fenv/mipsel-sf/fenv.sub musl-git/src/fenv/mipsel-sf/fenv.sub
  5953. --- musl-0.9.15/src/fenv/mipsel-sf/fenv.sub 1970-01-01 01:00:00.000000000 +0100
  5954. +++ musl-git/src/fenv/mipsel-sf/fenv.sub 2014-03-01 08:58:14.000000000 +0100
  5955. @@ -0,0 +1 @@
  5956. +../fenv.c
  5957. diff -Nur musl-0.9.15/src/fenv/mips-sf/fenv.sub musl-git/src/fenv/mips-sf/fenv.sub
  5958. --- musl-0.9.15/src/fenv/mips-sf/fenv.sub 1970-01-01 01:00:00.000000000 +0100
  5959. +++ musl-git/src/fenv/mips-sf/fenv.sub 2014-03-01 08:58:14.000000000 +0100
  5960. @@ -0,0 +1 @@
  5961. +../fenv.c
  5962. diff -Nur musl-0.9.15/src/fenv/sh/fenv.s musl-git/src/fenv/sh/fenv.s
  5963. --- musl-0.9.15/src/fenv/sh/fenv.s 1970-01-01 01:00:00.000000000 +0100
  5964. +++ musl-git/src/fenv/sh/fenv.s 2014-03-01 08:58:14.000000000 +0100
  5965. @@ -0,0 +1,74 @@
  5966. +.global fegetround
  5967. +.type fegetround, @function
  5968. +fegetround:
  5969. + sts fpscr, r0
  5970. + rts
  5971. + and #3, r0
  5972. +
  5973. +.global __fesetround
  5974. +.type __fesetround, @function
  5975. +__fesetround:
  5976. + sts fpscr, r0
  5977. + or r4, r0
  5978. + lds r0, fpscr
  5979. + rts
  5980. + mov #0, r0
  5981. +
  5982. +.global fetestexcept
  5983. +.type fetestexcept, @function
  5984. +fetestexcept:
  5985. + sts fpscr, r0
  5986. + and r4, r0
  5987. + rts
  5988. + and #0x7c, r0
  5989. +
  5990. +.global feclearexcept
  5991. +.type feclearexcept, @function
  5992. +feclearexcept:
  5993. + mov r4, r0
  5994. + and #0x7c, r0
  5995. + not r0, r4
  5996. + sts fpscr, r0
  5997. + and r4, r0
  5998. + lds r0, fpscr
  5999. + rts
  6000. + mov #0, r0
  6001. +
  6002. +.global feraiseexcept
  6003. +.type feraiseexcept, @function
  6004. +feraiseexcept:
  6005. + mov r4, r0
  6006. + and #0x7c, r0
  6007. + sts fpscr, r4
  6008. + or r4, r0
  6009. + lds r0, fpscr
  6010. + rts
  6011. + mov #0, r0
  6012. +
  6013. +.global fegetenv
  6014. +.type fegetenv, @function
  6015. +fegetenv:
  6016. + sts fpscr, r0
  6017. + mov.l r0, @r4
  6018. + rts
  6019. + mov #0, r0
  6020. +
  6021. +.global fesetenv
  6022. +.type fesetenv, @function
  6023. +fesetenv:
  6024. + mov r4, r0
  6025. + cmp/eq #-1, r0
  6026. + bf 1f
  6027. +
  6028. + ! the default environment is complicated by the fact that we need to
  6029. + ! preserve the current precision bit, which we do not know a priori
  6030. + sts fpscr, r0
  6031. + mov #8, r1
  6032. + swap.w r1, r1
  6033. + bra 2f
  6034. + and r1, r0
  6035. +
  6036. +1: mov.l @r4, r0 ! non-default environment
  6037. +2: lds r0, fpscr
  6038. + rts
  6039. + mov #0, r0
  6040. diff -Nur musl-0.9.15/src/fenv/sheb-nofpu/fenv.sub musl-git/src/fenv/sheb-nofpu/fenv.sub
  6041. --- musl-0.9.15/src/fenv/sheb-nofpu/fenv.sub 1970-01-01 01:00:00.000000000 +0100
  6042. +++ musl-git/src/fenv/sheb-nofpu/fenv.sub 2014-03-01 08:58:14.000000000 +0100
  6043. @@ -0,0 +1 @@
  6044. +../fenv.c
  6045. diff -Nur musl-0.9.15/src/fenv/sh-nofpu/fenv.sub musl-git/src/fenv/sh-nofpu/fenv.sub
  6046. --- musl-0.9.15/src/fenv/sh-nofpu/fenv.sub 1970-01-01 01:00:00.000000000 +0100
  6047. +++ musl-git/src/fenv/sh-nofpu/fenv.sub 2014-03-01 08:58:14.000000000 +0100
  6048. @@ -0,0 +1 @@
  6049. +../fenv.c
  6050. diff -Nur musl-0.9.15/src/fenv/x32/fenv.s musl-git/src/fenv/x32/fenv.s
  6051. --- musl-0.9.15/src/fenv/x32/fenv.s 1970-01-01 01:00:00.000000000 +0100
  6052. +++ musl-git/src/fenv/x32/fenv.s 2014-03-01 08:58:14.000000000 +0100
  6053. @@ -0,0 +1,97 @@
  6054. +.global feclearexcept
  6055. +.type feclearexcept,@function
  6056. +feclearexcept:
  6057. + # maintain exceptions in the sse mxcsr, clear x87 exceptions
  6058. + mov %edi,%ecx
  6059. + and $0x3f,%ecx
  6060. + fnstsw %ax
  6061. + test %eax,%ecx
  6062. + jz 1f
  6063. + fnclex
  6064. +1: stmxcsr -8(%esp)
  6065. + and $0x3f,%eax
  6066. + or %eax,-8(%esp)
  6067. + test %ecx,-8(%esp)
  6068. + jz 1f
  6069. + not %ecx
  6070. + and %ecx,-8(%esp)
  6071. + ldmxcsr -8(%esp)
  6072. +1: xor %eax,%eax
  6073. + ret
  6074. +
  6075. +.global feraiseexcept
  6076. +.type feraiseexcept,@function
  6077. +feraiseexcept:
  6078. + and $0x3f,%edi
  6079. + stmxcsr -8(%esp)
  6080. + or %edi,-8(%esp)
  6081. + ldmxcsr -8(%esp)
  6082. + xor %eax,%eax
  6083. + ret
  6084. +
  6085. +.global __fesetround
  6086. +.type __fesetround,@function
  6087. +__fesetround:
  6088. + push %rax
  6089. + xor %eax,%eax
  6090. + mov %edi,%ecx
  6091. + fnstcw (%esp)
  6092. + andb $0xf3,1(%esp)
  6093. + or %ch,1(%esp)
  6094. + fldcw (%esp)
  6095. + stmxcsr (%esp)
  6096. + shl $3,%ch
  6097. + andb $0x9f,1(%esp)
  6098. + or %ch,1(%esp)
  6099. + ldmxcsr (%esp)
  6100. + pop %rcx
  6101. + ret
  6102. +
  6103. +.global fegetround
  6104. +.type fegetround,@function
  6105. +fegetround:
  6106. + push %rax
  6107. + stmxcsr (%esp)
  6108. + pop %rax
  6109. + shr $3,%eax
  6110. + and $0xc00,%eax
  6111. + ret
  6112. +
  6113. +.global fegetenv
  6114. +.type fegetenv,@function
  6115. +fegetenv:
  6116. + xor %eax,%eax
  6117. + fnstenv (%edi)
  6118. + stmxcsr 28(%edi)
  6119. + ret
  6120. +
  6121. +.global fesetenv
  6122. +.type fesetenv,@function
  6123. +fesetenv:
  6124. + xor %eax,%eax
  6125. + inc %edi
  6126. + jz 1f
  6127. + fldenv -1(%edi)
  6128. + ldmxcsr 27(%edi)
  6129. + ret
  6130. +1: push %rax
  6131. + push %rax
  6132. + pushq $0xffff
  6133. + pushq $0x37f
  6134. + fldenv (%esp)
  6135. + pushq $0x1f80
  6136. + ldmxcsr (%esp)
  6137. + add $40,%esp
  6138. + ret
  6139. +
  6140. +.global fetestexcept
  6141. +.type fetestexcept,@function
  6142. +fetestexcept:
  6143. + and $0x3f,%edi
  6144. + push %rax
  6145. + stmxcsr (%esp)
  6146. + pop %rsi
  6147. + fnstsw %ax
  6148. + or %esi,%eax
  6149. + and %edi,%eax
  6150. + ret
  6151. diff -Nur musl-0.9.15/src/fenv/x86_64/fenv.s musl-git/src/fenv/x86_64/fenv.s
  6152. --- musl-0.9.15/src/fenv/x86_64/fenv.s 2014-01-03 21:12:17.000000000 +0100
  6153. +++ musl-git/src/fenv/x86_64/fenv.s 2014-03-01 08:58:14.000000000 +0100
  6154. @@ -76,7 +76,7 @@
  6155. ret
  6156. 1: push %rax
  6157. push %rax
  6158. - push %rax
  6159. + pushq $0xffff
  6160. pushq $0x37f
  6161. fldenv (%rsp)
  6162. pushq $0x1f80
  6163. diff -Nur musl-0.9.15/src/internal/sh/syscall.s musl-git/src/internal/sh/syscall.s
  6164. --- musl-0.9.15/src/internal/sh/syscall.s 1970-01-01 01:00:00.000000000 +0100
  6165. +++ musl-git/src/internal/sh/syscall.s 2014-03-01 08:58:14.000000000 +0100
  6166. @@ -0,0 +1,22 @@
  6167. +.global __syscall
  6168. +.type __syscall, @function
  6169. +__syscall:
  6170. + ! The kernel syscall entry point documents that the trap number indicates
  6171. + ! the number of arguments being passed, but it then ignores that information.
  6172. + ! Since we do not actually know how many arguments are being passed, we will
  6173. + ! say there are six, since that is the maximum we support here.
  6174. + mov r4, r3
  6175. + mov r5, r4
  6176. + mov r6, r5
  6177. + mov r7, r6
  6178. + mov.l @r15, r7
  6179. + mov.l @(4,r15), r0
  6180. + mov.l @(8,r15), r1
  6181. + trapa #22
  6182. + or r0, r0
  6183. + or r0, r0
  6184. + or r0, r0
  6185. + or r0, r0
  6186. + or r0, r0
  6187. + rts
  6188. + nop
  6189. diff -Nur musl-0.9.15/src/internal/stdio_impl.h musl-git/src/internal/stdio_impl.h
  6190. --- musl-0.9.15/src/internal/stdio_impl.h 2014-01-03 21:12:17.000000000 +0100
  6191. +++ musl-git/src/internal/stdio_impl.h 2014-03-01 08:58:14.000000000 +0100
  6192. @@ -17,6 +17,7 @@
  6193. #define F_EOF 16
  6194. #define F_ERR 32
  6195. #define F_SVB 64
  6196. +#define F_APP 128
  6197. struct _IO_FILE {
  6198. unsigned flags;
  6199. diff -Nur musl-0.9.15/src/internal/syscall.h musl-git/src/internal/syscall.h
  6200. --- musl-0.9.15/src/internal/syscall.h 2014-01-03 21:12:17.000000000 +0100
  6201. +++ musl-git/src/internal/syscall.h 2014-03-01 08:58:14.000000000 +0100
  6202. @@ -1,22 +1,28 @@
  6203. #ifndef _INTERNAL_SYSCALL_H
  6204. #define _INTERNAL_SYSCALL_H
  6205. -#if defined(__PIC__) && (100*__GNUC__+__GNUC_MINOR__ >= 303)
  6206. -__attribute__((visibility("protected")))
  6207. -#endif
  6208. -long __syscall_ret(unsigned long), __syscall(long, ...),
  6209. - __syscall_cp(long, long, long, long, long, long, long);
  6210. -
  6211. #include <sys/syscall.h>
  6212. #include "syscall_arch.h"
  6213. -#define __syscall1(n,a) __syscall1(n,(long)(a))
  6214. -#define __syscall2(n,a,b) __syscall2(n,(long)(a),(long)(b))
  6215. -#define __syscall3(n,a,b,c) __syscall3(n,(long)(a),(long)(b),(long)(c))
  6216. -#define __syscall4(n,a,b,c,d) __syscall4(n,(long)(a),(long)(b),(long)(c),(long)(d))
  6217. -#define __syscall5(n,a,b,c,d,e) __syscall5(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e))
  6218. -#define __syscall6(n,a,b,c,d,e,f) __syscall6(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e),(long)(f))
  6219. -#define __syscall7(n,a,b,c,d,e,f,g) (__syscall)(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e),(long)(f),(long)g)
  6220. +#ifndef __scc
  6221. +#define __scc(X) ((long) (X))
  6222. +typedef long syscall_arg_t;
  6223. +#endif
  6224. +
  6225. +#if defined(__PIC__) && (100*__GNUC__+__GNUC_MINOR__ >= 303)
  6226. +__attribute__((visibility("protected")))
  6227. +#endif
  6228. +long __syscall_ret(unsigned long), __syscall(syscall_arg_t, ...),
  6229. + __syscall_cp(syscall_arg_t, syscall_arg_t, syscall_arg_t, syscall_arg_t,
  6230. + syscall_arg_t, syscall_arg_t, syscall_arg_t);
  6231. +
  6232. +#define __syscall1(n,a) __syscall1(n,__scc(a))
  6233. +#define __syscall2(n,a,b) __syscall2(n,__scc(a),__scc(b))
  6234. +#define __syscall3(n,a,b,c) __syscall3(n,__scc(a),__scc(b),__scc(c))
  6235. +#define __syscall4(n,a,b,c,d) __syscall4(n,__scc(a),__scc(b),__scc(c),__scc(d))
  6236. +#define __syscall5(n,a,b,c,d,e) __syscall5(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e))
  6237. +#define __syscall6(n,a,b,c,d,e,f) __syscall6(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),__scc(f))
  6238. +#define __syscall7(n,a,b,c,d,e,f,g) (__syscall)(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),__scc(f),__scc(g))
  6239. #define __SYSCALL_NARGS_X(a,b,c,d,e,f,g,h,n,...) n
  6240. #define __SYSCALL_NARGS(...) __SYSCALL_NARGS_X(__VA_ARGS__,7,6,5,4,3,2,1,0,)
  6241. @@ -31,12 +37,12 @@
  6242. #define socketcall_cp __socketcall_cp
  6243. #define __syscall_cp0(n) (__syscall_cp)(n,0,0,0,0,0,0)
  6244. -#define __syscall_cp1(n,a) (__syscall_cp)(n,(long)(a),0,0,0,0,0)
  6245. -#define __syscall_cp2(n,a,b) (__syscall_cp)(n,(long)(a),(long)(b),0,0,0,0)
  6246. -#define __syscall_cp3(n,a,b,c) (__syscall_cp)(n,(long)(a),(long)(b),(long)(c),0,0,0)
  6247. -#define __syscall_cp4(n,a,b,c,d) (__syscall_cp)(n,(long)(a),(long)(b),(long)(c),(long)(d),0,0)
  6248. -#define __syscall_cp5(n,a,b,c,d,e) (__syscall_cp)(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e),0)
  6249. -#define __syscall_cp6(n,a,b,c,d,e,f) (__syscall_cp)(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e),(long)(f))
  6250. +#define __syscall_cp1(n,a) (__syscall_cp)(n,__scc(a),0,0,0,0,0)
  6251. +#define __syscall_cp2(n,a,b) (__syscall_cp)(n,__scc(a),__scc(b),0,0,0,0)
  6252. +#define __syscall_cp3(n,a,b,c) (__syscall_cp)(n,__scc(a),__scc(b),__scc(c),0,0,0)
  6253. +#define __syscall_cp4(n,a,b,c,d) (__syscall_cp)(n,__scc(a),__scc(b),__scc(c),__scc(d),0,0)
  6254. +#define __syscall_cp5(n,a,b,c,d,e) (__syscall_cp)(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),0)
  6255. +#define __syscall_cp6(n,a,b,c,d,e,f) (__syscall_cp)(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),__scc(f))
  6256. #define __syscall_cp(...) __SYSCALL_DISP(__syscall_cp,__VA_ARGS__)
  6257. #define syscall_cp(...) __syscall_ret(__syscall_cp(__VA_ARGS__))
  6258. diff -Nur musl-0.9.15/src/internal/x32/syscall.s musl-git/src/internal/x32/syscall.s
  6259. --- musl-0.9.15/src/internal/x32/syscall.s 1970-01-01 01:00:00.000000000 +0100
  6260. +++ musl-git/src/internal/x32/syscall.s 2014-03-01 08:58:14.000000000 +0100
  6261. @@ -0,0 +1,12 @@
  6262. +.global __syscall
  6263. +.type __syscall,@function
  6264. +__syscall:
  6265. + movq %rdi,%rax
  6266. + movq %rsi,%rdi
  6267. + movq %rdx,%rsi
  6268. + movq %rcx,%rdx
  6269. + movq %r8,%r10
  6270. + movq %r9,%r8
  6271. + movq 8(%rsp),%r9
  6272. + syscall
  6273. + ret
  6274. diff -Nur musl-0.9.15/src/ipc/semctl.c musl-git/src/ipc/semctl.c
  6275. --- musl-0.9.15/src/ipc/semctl.c 2014-01-03 21:12:17.000000000 +0100
  6276. +++ musl-git/src/ipc/semctl.c 2014-03-01 08:58:14.000000000 +0100
  6277. @@ -3,16 +3,22 @@
  6278. #include "syscall.h"
  6279. #include "ipc.h"
  6280. +union semun {
  6281. + int val;
  6282. + struct semid_ds *buf;
  6283. + unsigned short *array;
  6284. +};
  6285. +
  6286. int semctl(int id, int num, int cmd, ...)
  6287. {
  6288. - long arg;
  6289. + union semun arg;
  6290. va_list ap;
  6291. va_start(ap, cmd);
  6292. - arg = va_arg(ap, long);
  6293. + arg = va_arg(ap, union semun);
  6294. va_end(ap);
  6295. #ifdef SYS_semctl
  6296. - return syscall(SYS_semctl, id, num, cmd | IPC_64, arg);
  6297. + return syscall(SYS_semctl, id, num, cmd | IPC_64, arg.buf);
  6298. #else
  6299. - return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg);
  6300. + return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg.buf);
  6301. #endif
  6302. }
  6303. diff -Nur musl-0.9.15/src/ldso/dladdr.c musl-git/src/ldso/dladdr.c
  6304. --- musl-0.9.15/src/ldso/dladdr.c 2014-01-03 21:12:17.000000000 +0100
  6305. +++ musl-git/src/ldso/dladdr.c 2014-03-01 08:58:14.000000000 +0100
  6306. @@ -1,9 +1,9 @@
  6307. #define _GNU_SOURCE
  6308. #include <dlfcn.h>
  6309. -int __dladdr(void *, Dl_info *);
  6310. +int __dladdr(const void *, Dl_info *);
  6311. -int dladdr(void *addr, Dl_info *info)
  6312. +int dladdr(const void *addr, Dl_info *info)
  6313. {
  6314. return __dladdr(addr, info);
  6315. }
  6316. diff -Nur musl-0.9.15/src/ldso/dynlink.c musl-git/src/ldso/dynlink.c
  6317. --- musl-0.9.15/src/ldso/dynlink.c 2014-01-03 21:12:17.000000000 +0100
  6318. +++ musl-git/src/ldso/dynlink.c 2014-03-01 08:58:14.000000000 +0100
  6319. @@ -253,7 +253,8 @@
  6320. name = strings + sym->st_name;
  6321. ctx = IS_COPY(type) ? head->next : head;
  6322. def = find_sym(ctx, name, IS_PLT(type));
  6323. - if (!def.sym && sym->st_info>>4 != STB_WEAK) {
  6324. + if (!def.sym && (sym->st_shndx != SHN_UNDEF
  6325. + || sym->st_info>>4 != STB_WEAK)) {
  6326. snprintf(errbuf, sizeof errbuf,
  6327. "Error relocating %s: %s: symbol not found",
  6328. dso->name, name);
  6329. @@ -1331,7 +1332,7 @@
  6330. return 0;
  6331. }
  6332. -int __dladdr(void *addr, Dl_info *info)
  6333. +int __dladdr(const void *addr, Dl_info *info)
  6334. {
  6335. struct dso *p;
  6336. Sym *sym;
  6337. @@ -1441,7 +1442,7 @@
  6338. {
  6339. return 0;
  6340. }
  6341. -int __dladdr (void *addr, Dl_info *info)
  6342. +int __dladdr (const void *addr, Dl_info *info)
  6343. {
  6344. return 0;
  6345. }
  6346. diff -Nur musl-0.9.15/src/ldso/sh/dlsym.s musl-git/src/ldso/sh/dlsym.s
  6347. --- musl-0.9.15/src/ldso/sh/dlsym.s 1970-01-01 01:00:00.000000000 +0100
  6348. +++ musl-git/src/ldso/sh/dlsym.s 2014-03-01 08:58:14.000000000 +0100
  6349. @@ -0,0 +1,10 @@
  6350. +.text
  6351. +.global dlsym
  6352. +.type dlsym, @function
  6353. +dlsym:
  6354. + mov.l L1, r0
  6355. + braf r0
  6356. +1: mov.l @r15, r6
  6357. +
  6358. +.align 2
  6359. +L1: .long __dlsym@PLT-(1b-.)
  6360. diff -Nur musl-0.9.15/src/ldso/sh/start.s musl-git/src/ldso/sh/start.s
  6361. --- musl-0.9.15/src/ldso/sh/start.s 1970-01-01 01:00:00.000000000 +0100
  6362. +++ musl-git/src/ldso/sh/start.s 2014-03-01 08:58:14.000000000 +0100
  6363. @@ -0,0 +1,26 @@
  6364. +.text
  6365. +.global _start
  6366. +.type _start, @function
  6367. +_start:
  6368. + mov.l @r15, r4
  6369. + mov r15, r5
  6370. + mov.l L1, r0
  6371. + bsrf r0
  6372. + add #4, r5
  6373. +
  6374. +2: mov r0, r2
  6375. + mov.l @r15+, r1
  6376. +1: mov.l @r15+, r0
  6377. + cmp/eq #-1, r0
  6378. + bt/s 1b
  6379. + add #-1, r1
  6380. +
  6381. + add #1, r1
  6382. + mov.l r0, @-r15
  6383. + mov.l r1, @-r15
  6384. + mov #0, r4
  6385. + jmp @r2
  6386. + nop
  6387. +
  6388. +.align 2
  6389. +L1: .long __dynlink@PLT-(2b-.)
  6390. diff -Nur musl-0.9.15/src/ldso/x32/dlsym.s musl-git/src/ldso/x32/dlsym.s
  6391. --- musl-0.9.15/src/ldso/x32/dlsym.s 1970-01-01 01:00:00.000000000 +0100
  6392. +++ musl-git/src/ldso/x32/dlsym.s 2014-03-01 08:58:14.000000000 +0100
  6393. @@ -0,0 +1,6 @@
  6394. +.text
  6395. +.global dlsym
  6396. +.type dlsym,@function
  6397. +dlsym:
  6398. + mov (%rsp),%rdx
  6399. + jmp __dlsym
  6400. diff -Nur musl-0.9.15/src/ldso/x32/start.s musl-git/src/ldso/x32/start.s
  6401. --- musl-0.9.15/src/ldso/x32/start.s 1970-01-01 01:00:00.000000000 +0100
  6402. +++ musl-git/src/ldso/x32/start.s 2014-03-01 08:58:14.000000000 +0100
  6403. @@ -0,0 +1,24 @@
  6404. +.text
  6405. +.global _start
  6406. +_start:
  6407. + mov (%rsp),%rdi /* move argc into 1st argument slot */
  6408. + lea 4(%rsp),%rsi /* move argv into 2nd argument slot */
  6409. + call __dynlink
  6410. + /* in case the dynlinker was called directly, it sets the "consumed"
  6411. + argv values to -1. so we must loop over the array as long as -1
  6412. + is in the top argv slot, decrement argc, and then set the stackpointer
  6413. + to the new argc as well as argc's new value.
  6414. + as the x32 abi has longs in the argv array, we cannot use push/pop.*/
  6415. + movl (%rsp),%edi /* copy argc into edi */
  6416. + xor %rdx,%rdx /* we use rdx as an offset to the current argv member */
  6417. +1: dec %edi
  6418. + addl $4, %edx
  6419. + movl (%rsp, %rdx), %esi
  6420. + cmp $-1,%esi
  6421. + jz 1b
  6422. + inc %edi
  6423. + subl $4, %edx
  6424. + lea (%rsp, %rdx), %rsp /* set rsp to new argv[-1] */
  6425. + movl %edi, (%rsp) /* write new argc there */
  6426. + xor %edx,%edx
  6427. + jmp *%rax
  6428. diff -Nur musl-0.9.15/src/linux/clone.c musl-git/src/linux/clone.c
  6429. --- musl-0.9.15/src/linux/clone.c 1970-01-01 01:00:00.000000000 +0100
  6430. +++ musl-git/src/linux/clone.c 2014-03-01 08:58:14.000000000 +0100
  6431. @@ -0,0 +1,19 @@
  6432. +#include <stdarg.h>
  6433. +#include <unistd.h>
  6434. +#include "pthread_impl.h"
  6435. +#include "syscall.h"
  6436. +
  6437. +int clone(int (*func)(void *), void *stack, int flags, void *arg, ...)
  6438. +{
  6439. + va_list ap;
  6440. + pid_t *ptid, *ctid;
  6441. + void *tls;
  6442. +
  6443. + va_start(ap, arg);
  6444. + ptid = va_arg(ap, pid_t *);
  6445. + tls = va_arg(ap, void *);
  6446. + ctid = va_arg(ap, pid_t *);
  6447. + va_end(ap);
  6448. +
  6449. + return __syscall_ret(__clone(func, stack, flags, arg, ptid, tls, ctid));
  6450. +}
  6451. diff -Nur musl-0.9.15/src/linux/fallocate.c musl-git/src/linux/fallocate.c
  6452. --- musl-0.9.15/src/linux/fallocate.c 2014-01-03 21:12:17.000000000 +0100
  6453. +++ musl-git/src/linux/fallocate.c 2014-03-01 08:58:14.000000000 +0100
  6454. @@ -1,9 +1,13 @@
  6455. #define _GNU_SOURCE
  6456. #include <fcntl.h>
  6457. #include "syscall.h"
  6458. +#include "libc.h"
  6459. int fallocate(int fd, int mode, off_t base, off_t len)
  6460. {
  6461. return syscall(SYS_fallocate, fd, mode, __SYSCALL_LL_E(base),
  6462. __SYSCALL_LL_E(len));
  6463. }
  6464. +
  6465. +#undef fallocate64
  6466. +LFS64(fallocate);
  6467. diff -Nur musl-0.9.15/src/linux/inotify.c musl-git/src/linux/inotify.c
  6468. --- musl-0.9.15/src/linux/inotify.c 2014-01-03 21:12:17.000000000 +0100
  6469. +++ musl-git/src/linux/inotify.c 2014-03-01 08:58:14.000000000 +0100
  6470. @@ -15,7 +15,7 @@
  6471. return syscall(SYS_inotify_add_watch, fd, pathname, mask);
  6472. }
  6473. -int inotify_rm_watch(int fd, uint32_t wd)
  6474. +int inotify_rm_watch(int fd, int wd)
  6475. {
  6476. return syscall(SYS_inotify_rm_watch, fd, wd);
  6477. }
  6478. diff -Nur musl-0.9.15/src/linux/remap_file_pages.c musl-git/src/linux/remap_file_pages.c
  6479. --- musl-0.9.15/src/linux/remap_file_pages.c 2014-01-03 21:12:17.000000000 +0100
  6480. +++ musl-git/src/linux/remap_file_pages.c 2014-03-01 08:58:14.000000000 +0100
  6481. @@ -2,7 +2,7 @@
  6482. #include <sys/mman.h>
  6483. #include "syscall.h"
  6484. -int remap_file_pages(void *addr, size_t size, int prot, ssize_t pgoff, int flags)
  6485. +int remap_file_pages(void *addr, size_t size, int prot, size_t pgoff, int flags)
  6486. {
  6487. return syscall(SYS_remap_file_pages, addr, size, prot, pgoff, flags);
  6488. }
  6489. diff -Nur musl-0.9.15/src/linux/stime.c musl-git/src/linux/stime.c
  6490. --- musl-0.9.15/src/linux/stime.c 2014-01-03 21:12:17.000000000 +0100
  6491. +++ musl-git/src/linux/stime.c 2014-03-01 08:58:14.000000000 +0100
  6492. @@ -2,7 +2,7 @@
  6493. #include <time.h>
  6494. #include <sys/time.h>
  6495. -int stime(time_t *t)
  6496. +int stime(const time_t *t)
  6497. {
  6498. struct timeval tv = { .tv_sec = *t, .tv_usec = 0 };
  6499. return settimeofday(&tv, (void *)0);
  6500. diff -Nur musl-0.9.15/src/locale/wcsxfrm.c musl-git/src/locale/wcsxfrm.c
  6501. --- musl-0.9.15/src/locale/wcsxfrm.c 2014-01-03 21:12:17.000000000 +0100
  6502. +++ musl-git/src/locale/wcsxfrm.c 2014-03-01 08:58:14.000000000 +0100
  6503. @@ -6,10 +6,12 @@
  6504. size_t __wcsxfrm_l(wchar_t *restrict dest, const wchar_t *restrict src, size_t n, locale_t loc)
  6505. {
  6506. size_t l = wcslen(src);
  6507. - if (l >= n) {
  6508. + if (l < n) {
  6509. + wmemcpy(dest, src, l+1);
  6510. + } else if (n) {
  6511. wmemcpy(dest, src, n-1);
  6512. dest[n-1] = 0;
  6513. - } else wcscpy(dest, src);
  6514. + }
  6515. return l;
  6516. }
  6517. diff -Nur musl-0.9.15/src/math/i386/remainderf.s musl-git/src/math/i386/remainderf.s
  6518. --- musl-0.9.15/src/math/i386/remainderf.s 2014-01-03 21:12:18.000000000 +0100
  6519. +++ musl-git/src/math/i386/remainderf.s 2014-03-01 08:58:14.000000000 +0100
  6520. @@ -1,6 +1,9 @@
  6521. .global remainderf
  6522. .type remainderf,@function
  6523. remainderf:
  6524. +.weak dremf
  6525. +.type dremf,@function
  6526. +dremf:
  6527. flds 8(%esp)
  6528. flds 4(%esp)
  6529. 1: fprem1
  6530. diff -Nur musl-0.9.15/src/math/i386/remainder.s musl-git/src/math/i386/remainder.s
  6531. --- musl-0.9.15/src/math/i386/remainder.s 2014-01-03 21:12:18.000000000 +0100
  6532. +++ musl-git/src/math/i386/remainder.s 2014-03-01 08:58:14.000000000 +0100
  6533. @@ -1,6 +1,9 @@
  6534. .global remainder
  6535. .type remainder,@function
  6536. remainder:
  6537. +.weak drem
  6538. +.type drem,@function
  6539. +drem:
  6540. fldl 12(%esp)
  6541. fldl 4(%esp)
  6542. 1: fprem1
  6543. diff -Nur musl-0.9.15/src/math/x32/acosl.s musl-git/src/math/x32/acosl.s
  6544. --- musl-0.9.15/src/math/x32/acosl.s 1970-01-01 01:00:00.000000000 +0100
  6545. +++ musl-git/src/math/x32/acosl.s 2014-03-01 08:58:14.000000000 +0100
  6546. @@ -0,0 +1,16 @@
  6547. +# see ../i386/acos.s
  6548. +
  6549. +.global acosl
  6550. +.type acosl,@function
  6551. +acosl:
  6552. + fldt 8(%esp)
  6553. +1: fld %st(0)
  6554. + fld1
  6555. + fsub %st(0),%st(1)
  6556. + fadd %st(2)
  6557. + fmulp
  6558. + fsqrt
  6559. + fabs
  6560. + fxch %st(1)
  6561. + fpatan
  6562. + ret
  6563. diff -Nur musl-0.9.15/src/math/x32/asinl.s musl-git/src/math/x32/asinl.s
  6564. --- musl-0.9.15/src/math/x32/asinl.s 1970-01-01 01:00:00.000000000 +0100
  6565. +++ musl-git/src/math/x32/asinl.s 2014-03-01 08:58:14.000000000 +0100
  6566. @@ -0,0 +1,12 @@
  6567. +.global asinl
  6568. +.type asinl,@function
  6569. +asinl:
  6570. + fldt 8(%esp)
  6571. +1: fld %st(0)
  6572. + fld1
  6573. + fsub %st(0),%st(1)
  6574. + fadd %st(2)
  6575. + fmulp
  6576. + fsqrt
  6577. + fpatan
  6578. + ret
  6579. diff -Nur musl-0.9.15/src/math/x32/atan2l.s musl-git/src/math/x32/atan2l.s
  6580. --- musl-0.9.15/src/math/x32/atan2l.s 1970-01-01 01:00:00.000000000 +0100
  6581. +++ musl-git/src/math/x32/atan2l.s 2014-03-01 08:58:14.000000000 +0100
  6582. @@ -0,0 +1,7 @@
  6583. +.global atan2l
  6584. +.type atan2l,@function
  6585. +atan2l:
  6586. + fldt 8(%esp)
  6587. + fldt 24(%esp)
  6588. + fpatan
  6589. + ret
  6590. diff -Nur musl-0.9.15/src/math/x32/atanl.s musl-git/src/math/x32/atanl.s
  6591. --- musl-0.9.15/src/math/x32/atanl.s 1970-01-01 01:00:00.000000000 +0100
  6592. +++ musl-git/src/math/x32/atanl.s 2014-03-01 08:58:14.000000000 +0100
  6593. @@ -0,0 +1,7 @@
  6594. +.global atanl
  6595. +.type atanl,@function
  6596. +atanl:
  6597. + fldt 8(%esp)
  6598. + fld1
  6599. + fpatan
  6600. + ret
  6601. diff -Nur musl-0.9.15/src/math/x32/ceill.s musl-git/src/math/x32/ceill.s
  6602. --- musl-0.9.15/src/math/x32/ceill.s 1970-01-01 01:00:00.000000000 +0100
  6603. +++ musl-git/src/math/x32/ceill.s 2014-03-01 08:58:14.000000000 +0100
  6604. @@ -0,0 +1 @@
  6605. +# see floorl.s
  6606. diff -Nur musl-0.9.15/src/math/x32/exp2l.s musl-git/src/math/x32/exp2l.s
  6607. --- musl-0.9.15/src/math/x32/exp2l.s 1970-01-01 01:00:00.000000000 +0100
  6608. +++ musl-git/src/math/x32/exp2l.s 2014-03-01 08:58:14.000000000 +0100
  6609. @@ -0,0 +1,90 @@
  6610. +.global expm1l
  6611. +.type expm1l,@function
  6612. +expm1l:
  6613. + fldt 8(%esp)
  6614. + fldl2e
  6615. + fmulp
  6616. + movl $0xc2820000,-4(%esp)
  6617. + flds -4(%esp)
  6618. + fucomp %st(1)
  6619. + fnstsw %ax
  6620. + sahf
  6621. + fld1
  6622. + jb 1f
  6623. + # x*log2e <= -65, return -1 without underflow
  6624. + fstp %st(1)
  6625. + fchs
  6626. + ret
  6627. +1: fld %st(1)
  6628. + fabs
  6629. + fucom %st(1)
  6630. + fnstsw %ax
  6631. + fstp %st(0)
  6632. + fstp %st(0)
  6633. + sahf
  6634. + ja 1f
  6635. + f2xm1
  6636. + ret
  6637. +1: push %rax
  6638. + call 1f
  6639. + pop %rax
  6640. + fld1
  6641. + fsubrp
  6642. + ret
  6643. +
  6644. +.global exp2l
  6645. +.type exp2l,@function
  6646. +exp2l:
  6647. + fldt 8(%esp)
  6648. +1: fld %st(0)
  6649. + sub $16,%esp
  6650. + fstpt (%esp)
  6651. + mov 8(%esp),%ax
  6652. + and $0x7fff,%ax
  6653. + cmp $0x3fff+13,%ax
  6654. + jb 4f # |x| < 8192
  6655. + cmp $0x3fff+15,%ax
  6656. + jae 3f # |x| >= 32768
  6657. + fsts (%esp)
  6658. + cmpl $0xc67ff800,(%esp)
  6659. + jb 2f # x > -16382
  6660. + movl $0x5f000000,(%esp)
  6661. + flds (%esp) # 0x1p63
  6662. + fld %st(1)
  6663. + fsub %st(1)
  6664. + faddp
  6665. + fucomp %st(1)
  6666. + fnstsw
  6667. + sahf
  6668. + je 2f # x - 0x1p63 + 0x1p63 == x
  6669. + movl $1,(%esp)
  6670. + flds (%esp) # 0x1p-149
  6671. + fdiv %st(1)
  6672. + fstps (%esp) # raise underflow
  6673. +2: fld1
  6674. + fld %st(1)
  6675. + frndint
  6676. + fxch %st(2)
  6677. + fsub %st(2) # st(0)=x-rint(x), st(1)=1, st(2)=rint(x)
  6678. + f2xm1
  6679. + faddp # 2^(x-rint(x))
  6680. +1: fscale
  6681. + fstp %st(1)
  6682. + add $16,%esp
  6683. + ret
  6684. +3: xor %eax,%eax
  6685. +4: cmp $0x3fff-64,%ax
  6686. + fld1
  6687. + jb 1b # |x| < 0x1p-64
  6688. + fstpt (%esp)
  6689. + fistl 8(%esp)
  6690. + fildl 8(%esp)
  6691. + fsubrp %st(1)
  6692. + addl $0x3fff,8(%esp)
  6693. + f2xm1
  6694. + fld1
  6695. + faddp # 2^(x-rint(x))
  6696. + fldt (%esp) # 2^rint(x)
  6697. + fmulp
  6698. + add $16,%esp
  6699. + ret
  6700. diff -Nur musl-0.9.15/src/math/x32/expl.s musl-git/src/math/x32/expl.s
  6701. --- musl-0.9.15/src/math/x32/expl.s 1970-01-01 01:00:00.000000000 +0100
  6702. +++ musl-git/src/math/x32/expl.s 2014-03-01 08:58:14.000000000 +0100
  6703. @@ -0,0 +1,101 @@
  6704. +# exp(x) = 2^hi + 2^hi (2^lo - 1)
  6705. +# where hi+lo = log2e*x with 128bit precision
  6706. +# exact log2e*x calculation depends on nearest rounding mode
  6707. +# using the exact multiplication method of Dekker and Veltkamp
  6708. +
  6709. +.global expl
  6710. +.type expl,@function
  6711. +expl:
  6712. + fldt 8(%esp)
  6713. +
  6714. + # interesting case: 0x1p-32 <= |x| < 16384
  6715. + # check if (exponent|0x8000) is in [0xbfff-32, 0xbfff+13]
  6716. + mov 16(%esp), %ax
  6717. + or $0x8000, %ax
  6718. + sub $0xbfdf, %ax
  6719. + cmp $45, %ax
  6720. + jbe 2f
  6721. + test %ax, %ax
  6722. + fld1
  6723. + js 1f
  6724. + # if |x|>=0x1p14 or nan return 2^trunc(x)
  6725. + fscale
  6726. + fstp %st(1)
  6727. + ret
  6728. + # if |x|<0x1p-32 return 1+x
  6729. +1: faddp
  6730. + ret
  6731. +
  6732. + # should be 0x1.71547652b82fe178p0L == 0x3fff b8aa3b29 5c17f0bc
  6733. + # it will be wrong on non-nearest rounding mode
  6734. +2: fldl2e
  6735. + sub $48, %esp
  6736. + # hi = log2e_hi*x
  6737. + # 2^hi = exp2l(hi)
  6738. + fmul %st(1),%st
  6739. + fld %st(0)
  6740. + fstpt (%esp)
  6741. + fstpt 16(%esp)
  6742. + fstpt 32(%esp)
  6743. + call exp2l
  6744. + # if 2^hi == inf return 2^hi
  6745. + fld %st(0)
  6746. + fstpt (%esp)
  6747. + cmpw $0x7fff, 8(%esp)
  6748. + je 1f
  6749. + fldt 32(%esp)
  6750. + fldt 16(%esp)
  6751. + # fpu stack: 2^hi x hi
  6752. + # exact mult: x*log2e
  6753. + fld %st(1)
  6754. + # c = 0x1p32+1
  6755. + movq $0x41f0000000100000,%rax
  6756. + pushq %rax
  6757. + fldl (%esp)
  6758. + # xh = x - c*x + c*x
  6759. + # xl = x - xh
  6760. + fmulp
  6761. + fld %st(2)
  6762. + fsub %st(1), %st
  6763. + faddp
  6764. + fld %st(2)
  6765. + fsub %st(1), %st
  6766. + # yh = log2e_hi - c*log2e_hi + c*log2e_hi
  6767. + movq $0x3ff7154765200000,%rax
  6768. + pushq %rax
  6769. + fldl (%esp)
  6770. + # fpu stack: 2^hi x hi xh xl yh
  6771. + # lo = hi - xh*yh + xl*yh
  6772. + fld %st(2)
  6773. + fmul %st(1), %st
  6774. + fsubp %st, %st(4)
  6775. + fmul %st(1), %st
  6776. + faddp %st, %st(3)
  6777. + # yl = log2e_hi - yh
  6778. + movq $0x3de705fc2f000000,%rax
  6779. + pushq %rax
  6780. + fldl (%esp)
  6781. + # fpu stack: 2^hi x lo xh xl yl
  6782. + # lo += xh*yl + xl*yl
  6783. + fmul %st, %st(2)
  6784. + fmulp %st, %st(1)
  6785. + fxch %st(2)
  6786. + faddp
  6787. + faddp
  6788. + # log2e_lo
  6789. + movq $0xbfbe,%rax
  6790. + pushq %rax
  6791. + movq $0x82f0025f2dc582ee,%rax
  6792. + pushq %rax
  6793. + fldt (%esp)
  6794. + add $40,%esp
  6795. + # fpu stack: 2^hi x lo log2e_lo
  6796. + # lo += log2e_lo*x
  6797. + # return 2^hi + 2^hi (2^lo - 1)
  6798. + fmulp %st, %st(2)
  6799. + faddp
  6800. + f2xm1
  6801. + fmul %st(1), %st
  6802. + faddp
  6803. +1: add $48, %esp
  6804. + ret
  6805. diff -Nur musl-0.9.15/src/math/x32/expm1l.s musl-git/src/math/x32/expm1l.s
  6806. --- musl-0.9.15/src/math/x32/expm1l.s 1970-01-01 01:00:00.000000000 +0100
  6807. +++ musl-git/src/math/x32/expm1l.s 2014-03-01 08:58:14.000000000 +0100
  6808. @@ -0,0 +1 @@
  6809. +# see exp2l.s
  6810. diff -Nur musl-0.9.15/src/math/x32/fabsf.s musl-git/src/math/x32/fabsf.s
  6811. --- musl-0.9.15/src/math/x32/fabsf.s 1970-01-01 01:00:00.000000000 +0100
  6812. +++ musl-git/src/math/x32/fabsf.s 2014-03-01 08:58:14.000000000 +0100
  6813. @@ -0,0 +1,7 @@
  6814. +.global fabsf
  6815. +.type fabsf,@function
  6816. +fabsf:
  6817. + mov $0x7fffffff,%eax
  6818. + movq %rax,%xmm1
  6819. + andps %xmm1,%xmm0
  6820. + ret
  6821. diff -Nur musl-0.9.15/src/math/x32/fabsl.s musl-git/src/math/x32/fabsl.s
  6822. --- musl-0.9.15/src/math/x32/fabsl.s 1970-01-01 01:00:00.000000000 +0100
  6823. +++ musl-git/src/math/x32/fabsl.s 2014-03-01 08:58:14.000000000 +0100
  6824. @@ -0,0 +1,6 @@
  6825. +.global fabsl
  6826. +.type fabsl,@function
  6827. +fabsl:
  6828. + fldt 8(%esp)
  6829. + fabs
  6830. + ret
  6831. diff -Nur musl-0.9.15/src/math/x32/fabs.s musl-git/src/math/x32/fabs.s
  6832. --- musl-0.9.15/src/math/x32/fabs.s 1970-01-01 01:00:00.000000000 +0100
  6833. +++ musl-git/src/math/x32/fabs.s 2014-03-01 08:58:14.000000000 +0100
  6834. @@ -0,0 +1,9 @@
  6835. +.global fabs
  6836. +.type fabs,@function
  6837. +fabs:
  6838. + xor %eax,%eax
  6839. + dec %rax
  6840. + shr %rax
  6841. + movq %rax,%xmm1
  6842. + andpd %xmm1,%xmm0
  6843. + ret
  6844. diff -Nur musl-0.9.15/src/math/x32/floorl.s musl-git/src/math/x32/floorl.s
  6845. --- musl-0.9.15/src/math/x32/floorl.s 1970-01-01 01:00:00.000000000 +0100
  6846. +++ musl-git/src/math/x32/floorl.s 2014-03-01 08:58:14.000000000 +0100
  6847. @@ -0,0 +1,27 @@
  6848. +.global floorl
  6849. +.type floorl,@function
  6850. +floorl:
  6851. + fldt 8(%esp)
  6852. +1: mov $0x7,%al
  6853. +1: fstcw 8(%esp)
  6854. + mov 9(%esp),%ah
  6855. + mov %al,9(%esp)
  6856. + fldcw 8(%esp)
  6857. + frndint
  6858. + mov %ah,9(%esp)
  6859. + fldcw 8(%esp)
  6860. + ret
  6861. +
  6862. +.global ceill
  6863. +.type ceill,@function
  6864. +ceill:
  6865. + fldt 8(%esp)
  6866. + mov $0xb,%al
  6867. + jmp 1b
  6868. +
  6869. +.global truncl
  6870. +.type truncl,@function
  6871. +truncl:
  6872. + fldt 8(%esp)
  6873. + mov $0xf,%al
  6874. + jmp 1b
  6875. diff -Nur musl-0.9.15/src/math/x32/fmodl.s musl-git/src/math/x32/fmodl.s
  6876. --- musl-0.9.15/src/math/x32/fmodl.s 1970-01-01 01:00:00.000000000 +0100
  6877. +++ musl-git/src/math/x32/fmodl.s 2014-03-01 08:58:14.000000000 +0100
  6878. @@ -0,0 +1,11 @@
  6879. +.global fmodl
  6880. +.type fmodl,@function
  6881. +fmodl:
  6882. + fldt 24(%esp)
  6883. + fldt 8(%esp)
  6884. +1: fprem
  6885. + fstsw %ax
  6886. + sahf
  6887. + jp 1b
  6888. + fstp %st(1)
  6889. + ret
  6890. diff -Nur musl-0.9.15/src/math/x32/llrintf.s musl-git/src/math/x32/llrintf.s
  6891. --- musl-0.9.15/src/math/x32/llrintf.s 1970-01-01 01:00:00.000000000 +0100
  6892. +++ musl-git/src/math/x32/llrintf.s 2014-03-01 08:58:14.000000000 +0100
  6893. @@ -0,0 +1,5 @@
  6894. +.global llrintf
  6895. +.type llrintf,@function
  6896. +llrintf:
  6897. + cvtss2si %xmm0,%rax
  6898. + ret
  6899. diff -Nur musl-0.9.15/src/math/x32/llrintl.s musl-git/src/math/x32/llrintl.s
  6900. --- musl-0.9.15/src/math/x32/llrintl.s 1970-01-01 01:00:00.000000000 +0100
  6901. +++ musl-git/src/math/x32/llrintl.s 2014-03-01 08:58:14.000000000 +0100
  6902. @@ -0,0 +1,7 @@
  6903. +.global llrintl
  6904. +.type llrintl,@function
  6905. +llrintl:
  6906. + fldt 8(%esp)
  6907. + fistpll 8(%esp)
  6908. + mov 8(%esp),%rax
  6909. + ret
  6910. diff -Nur musl-0.9.15/src/math/x32/llrint.s musl-git/src/math/x32/llrint.s
  6911. --- musl-0.9.15/src/math/x32/llrint.s 1970-01-01 01:00:00.000000000 +0100
  6912. +++ musl-git/src/math/x32/llrint.s 2014-03-01 08:58:14.000000000 +0100
  6913. @@ -0,0 +1,5 @@
  6914. +.global llrint
  6915. +.type llrint,@function
  6916. +llrint:
  6917. + cvtsd2si %xmm0,%rax
  6918. + ret
  6919. diff -Nur musl-0.9.15/src/math/x32/log10l.s musl-git/src/math/x32/log10l.s
  6920. --- musl-0.9.15/src/math/x32/log10l.s 1970-01-01 01:00:00.000000000 +0100
  6921. +++ musl-git/src/math/x32/log10l.s 2014-03-01 08:58:14.000000000 +0100
  6922. @@ -0,0 +1,7 @@
  6923. +.global log10l
  6924. +.type log10l,@function
  6925. +log10l:
  6926. + fldlg2
  6927. + fldt 8(%esp)
  6928. + fyl2x
  6929. + ret
  6930. diff -Nur musl-0.9.15/src/math/x32/log1pl.s musl-git/src/math/x32/log1pl.s
  6931. --- musl-0.9.15/src/math/x32/log1pl.s 1970-01-01 01:00:00.000000000 +0100
  6932. +++ musl-git/src/math/x32/log1pl.s 2014-03-01 08:58:14.000000000 +0100
  6933. @@ -0,0 +1,15 @@
  6934. +.global log1pl
  6935. +.type log1pl,@function
  6936. +log1pl:
  6937. + mov 14(%esp),%eax
  6938. + fldln2
  6939. + and $0x7fffffff,%eax
  6940. + fldt 8(%esp)
  6941. + cmp $0x3ffd9400,%eax
  6942. + ja 1f
  6943. + fyl2xp1
  6944. + ret
  6945. +1: fld1
  6946. + faddp
  6947. + fyl2x
  6948. + ret
  6949. diff -Nur musl-0.9.15/src/math/x32/log2l.s musl-git/src/math/x32/log2l.s
  6950. --- musl-0.9.15/src/math/x32/log2l.s 1970-01-01 01:00:00.000000000 +0100
  6951. +++ musl-git/src/math/x32/log2l.s 2014-03-01 08:58:14.000000000 +0100
  6952. @@ -0,0 +1,7 @@
  6953. +.global log2l
  6954. +.type log2l,@function
  6955. +log2l:
  6956. + fld1
  6957. + fldt 8(%esp)
  6958. + fyl2x
  6959. + ret
  6960. diff -Nur musl-0.9.15/src/math/x32/logl.s musl-git/src/math/x32/logl.s
  6961. --- musl-0.9.15/src/math/x32/logl.s 1970-01-01 01:00:00.000000000 +0100
  6962. +++ musl-git/src/math/x32/logl.s 2014-03-01 08:58:14.000000000 +0100
  6963. @@ -0,0 +1,7 @@
  6964. +.global logl
  6965. +.type logl,@function
  6966. +logl:
  6967. + fldln2
  6968. + fldt 8(%esp)
  6969. + fyl2x
  6970. + ret
  6971. diff -Nur musl-0.9.15/src/math/x32/lrintf.s musl-git/src/math/x32/lrintf.s
  6972. --- musl-0.9.15/src/math/x32/lrintf.s 1970-01-01 01:00:00.000000000 +0100
  6973. +++ musl-git/src/math/x32/lrintf.s 2014-03-01 08:58:14.000000000 +0100
  6974. @@ -0,0 +1,5 @@
  6975. +.global lrintf
  6976. +.type lrintf,@function
  6977. +lrintf:
  6978. + cvtss2si %xmm0,%rax
  6979. + ret
  6980. diff -Nur musl-0.9.15/src/math/x32/lrintl.s musl-git/src/math/x32/lrintl.s
  6981. --- musl-0.9.15/src/math/x32/lrintl.s 1970-01-01 01:00:00.000000000 +0100
  6982. +++ musl-git/src/math/x32/lrintl.s 2014-03-01 08:58:14.000000000 +0100
  6983. @@ -0,0 +1,7 @@
  6984. +.global lrintl
  6985. +.type lrintl,@function
  6986. +lrintl:
  6987. + fldt 8(%esp)
  6988. + fistpll 8(%esp)
  6989. + mov 8(%esp),%rax
  6990. + ret
  6991. diff -Nur musl-0.9.15/src/math/x32/lrint.s musl-git/src/math/x32/lrint.s
  6992. --- musl-0.9.15/src/math/x32/lrint.s 1970-01-01 01:00:00.000000000 +0100
  6993. +++ musl-git/src/math/x32/lrint.s 2014-03-01 08:58:14.000000000 +0100
  6994. @@ -0,0 +1,5 @@
  6995. +.global lrint
  6996. +.type lrint,@function
  6997. +lrint:
  6998. + cvtsd2si %xmm0,%rax
  6999. + ret
  7000. diff -Nur musl-0.9.15/src/math/x32/remainderl.s musl-git/src/math/x32/remainderl.s
  7001. --- musl-0.9.15/src/math/x32/remainderl.s 1970-01-01 01:00:00.000000000 +0100
  7002. +++ musl-git/src/math/x32/remainderl.s 2014-03-01 08:58:14.000000000 +0100
  7003. @@ -0,0 +1,11 @@
  7004. +.global remainderl
  7005. +.type remainderl,@function
  7006. +remainderl:
  7007. + fldt 24(%esp)
  7008. + fldt 8(%esp)
  7009. +1: fprem1
  7010. + fstsw %ax
  7011. + sahf
  7012. + jp 1b
  7013. + fstp %st(1)
  7014. + ret
  7015. diff -Nur musl-0.9.15/src/math/x32/rintl.s musl-git/src/math/x32/rintl.s
  7016. --- musl-0.9.15/src/math/x32/rintl.s 1970-01-01 01:00:00.000000000 +0100
  7017. +++ musl-git/src/math/x32/rintl.s 2014-03-01 08:58:14.000000000 +0100
  7018. @@ -0,0 +1,6 @@
  7019. +.global rintl
  7020. +.type rintl,@function
  7021. +rintl:
  7022. + fldt 8(%esp)
  7023. + frndint
  7024. + ret
  7025. diff -Nur musl-0.9.15/src/math/x32/sqrtf.s musl-git/src/math/x32/sqrtf.s
  7026. --- musl-0.9.15/src/math/x32/sqrtf.s 1970-01-01 01:00:00.000000000 +0100
  7027. +++ musl-git/src/math/x32/sqrtf.s 2014-03-01 08:58:14.000000000 +0100
  7028. @@ -0,0 +1,4 @@
  7029. +.global sqrtf
  7030. +.type sqrtf,@function
  7031. +sqrtf: sqrtss %xmm0, %xmm0
  7032. + ret
  7033. diff -Nur musl-0.9.15/src/math/x32/sqrtl.s musl-git/src/math/x32/sqrtl.s
  7034. --- musl-0.9.15/src/math/x32/sqrtl.s 1970-01-01 01:00:00.000000000 +0100
  7035. +++ musl-git/src/math/x32/sqrtl.s 2014-03-01 08:58:14.000000000 +0100
  7036. @@ -0,0 +1,5 @@
  7037. +.global sqrtl
  7038. +.type sqrtl,@function
  7039. +sqrtl: fldt 8(%esp)
  7040. + fsqrt
  7041. + ret
  7042. diff -Nur musl-0.9.15/src/math/x32/sqrt.s musl-git/src/math/x32/sqrt.s
  7043. --- musl-0.9.15/src/math/x32/sqrt.s 1970-01-01 01:00:00.000000000 +0100
  7044. +++ musl-git/src/math/x32/sqrt.s 2014-03-01 08:58:14.000000000 +0100
  7045. @@ -0,0 +1,4 @@
  7046. +.global sqrt
  7047. +.type sqrt,@function
  7048. +sqrt: sqrtsd %xmm0, %xmm0
  7049. + ret
  7050. diff -Nur musl-0.9.15/src/math/x32/truncl.s musl-git/src/math/x32/truncl.s
  7051. --- musl-0.9.15/src/math/x32/truncl.s 1970-01-01 01:00:00.000000000 +0100
  7052. +++ musl-git/src/math/x32/truncl.s 2014-03-01 08:58:14.000000000 +0100
  7053. @@ -0,0 +1 @@
  7054. +# see floorl.s
  7055. diff -Nur musl-0.9.15/src/misc/nftw.c musl-git/src/misc/nftw.c
  7056. --- musl-0.9.15/src/misc/nftw.c 2014-01-03 21:12:18.000000000 +0100
  7057. +++ musl-git/src/misc/nftw.c 2014-03-01 08:58:14.000000000 +0100
  7058. @@ -46,8 +46,7 @@
  7059. type = FTW_F;
  7060. }
  7061. - if ((flags & FTW_MOUNT) && h
  7062. - && (st.st_dev != h->dev || st.st_ino != h->ino))
  7063. + if ((flags & FTW_MOUNT) && h && st.st_dev != h->dev)
  7064. return 0;
  7065. new.chain = h;
  7066. diff -Nur musl-0.9.15/src/network/accept4.c musl-git/src/network/accept4.c
  7067. --- musl-0.9.15/src/network/accept4.c 2014-01-03 21:12:18.000000000 +0100
  7068. +++ musl-git/src/network/accept4.c 2014-03-01 08:58:14.000000000 +0100
  7069. @@ -1,9 +1,20 @@
  7070. #define _GNU_SOURCE
  7071. #include <sys/socket.h>
  7072. +#include <errno.h>
  7073. +#include <fcntl.h>
  7074. #include "syscall.h"
  7075. #include "libc.h"
  7076. int accept4(int fd, struct sockaddr *restrict addr, socklen_t *restrict len, int flg)
  7077. {
  7078. - return socketcall_cp(accept4, fd, addr, len, flg, 0, 0);
  7079. + if (!flg) return accept(fd, addr, len);
  7080. + int ret = socketcall_cp(accept4, fd, addr, len, flg, 0, 0);
  7081. + if (ret>=0 || (errno != ENOSYS && errno != EINVAL)) return ret;
  7082. + ret = accept(fd, addr, len);
  7083. + if (ret<0) return ret;
  7084. + if (flg & SOCK_CLOEXEC)
  7085. + __syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC);
  7086. + if (flg & SOCK_NONBLOCK)
  7087. + __syscall(SYS_fcntl, ret, F_SETFL, O_NONBLOCK);
  7088. + return ret;
  7089. }
  7090. diff -Nur musl-0.9.15/src/network/inet_legacy.c musl-git/src/network/inet_legacy.c
  7091. --- musl-0.9.15/src/network/inet_legacy.c 2014-01-03 21:12:18.000000000 +0100
  7092. +++ musl-git/src/network/inet_legacy.c 2014-03-01 08:58:14.000000000 +0100
  7093. @@ -16,9 +16,8 @@
  7094. return 1;
  7095. }
  7096. -struct in_addr inet_makeaddr(int net, int host)
  7097. +struct in_addr inet_makeaddr(in_addr_t n, in_addr_t h)
  7098. {
  7099. - uint32_t n = net, h = host;
  7100. if (n < 256) h |= n<<24;
  7101. else if (n < 65536) h |= n<<16;
  7102. else h |= n<<8;
  7103. diff -Nur musl-0.9.15/src/network/proto.c musl-git/src/network/proto.c
  7104. --- musl-0.9.15/src/network/proto.c 2014-01-03 21:12:18.000000000 +0100
  7105. +++ musl-git/src/network/proto.c 2014-03-01 08:58:14.000000000 +0100
  7106. @@ -4,7 +4,7 @@
  7107. /* do we really need all these?? */
  7108. static int idx;
  7109. -static const unsigned char protos[][6] = {
  7110. +static const unsigned char protos[][8] = {
  7111. "\000ip",
  7112. "\001icmp",
  7113. "\002igmp",
  7114. @@ -13,7 +13,9 @@
  7115. "\014pup",
  7116. "\021udp",
  7117. "\026idp",
  7118. - "\377raw"
  7119. + "\051ipv6",
  7120. + "\072icmpv6",
  7121. + "\377raw",
  7122. "\0\0"
  7123. };
  7124. diff -Nur musl-0.9.15/src/prng/random.c musl-git/src/prng/random.c
  7125. --- musl-0.9.15/src/prng/random.c 2014-01-03 21:12:18.000000000 +0100
  7126. +++ musl-git/src/prng/random.c 2014-03-01 08:58:14.000000000 +0100
  7127. @@ -1,10 +1,3 @@
  7128. -/*
  7129. - * random.c - Copyright © 2011 Szabolcs Nagy
  7130. - * Permission to use, copy, modify, and/or distribute this code
  7131. - * for any purpose with or without fee is hereby granted.
  7132. - * There is no warranty.
  7133. -*/
  7134. -
  7135. #include <stdlib.h>
  7136. #include <stdint.h>
  7137. #include "libc.h"
  7138. @@ -12,11 +5,7 @@
  7139. /*
  7140. this code uses the same lagged fibonacci generator as the
  7141. original bsd random implementation except for the seeding
  7142. -
  7143. -different seeds produce different sequences with long period
  7144. -(other libcs seed the state with a park-miller generator
  7145. -when seed=0 some fail to produce good random sequence
  7146. -others produce the same sequence as another seed)
  7147. +which was broken in the original
  7148. */
  7149. static uint32_t init[] = {
  7150. @@ -98,6 +87,7 @@
  7151. n = 63;
  7152. x = (uint32_t*)state + 1;
  7153. __srandom(seed);
  7154. + savestate();
  7155. UNLOCK(lock);
  7156. return old;
  7157. }
  7158. diff -Nur musl-0.9.15/src/process/posix_spawn.c musl-git/src/process/posix_spawn.c
  7159. --- musl-0.9.15/src/process/posix_spawn.c 2014-01-03 21:12:18.000000000 +0100
  7160. +++ musl-git/src/process/posix_spawn.c 2014-03-01 08:58:14.000000000 +0100
  7161. @@ -166,7 +166,7 @@
  7162. close(args.p[0]);
  7163. - if (!ec) *res = pid;
  7164. + if (!ec && res) *res = pid;
  7165. pthread_sigmask(SIG_SETMASK, &args.oldmask, 0);
  7166. pthread_setcancelstate(cs, 0);
  7167. diff -Nur musl-0.9.15/src/process/x32/vfork.s musl-git/src/process/x32/vfork.s
  7168. --- musl-0.9.15/src/process/x32/vfork.s 1970-01-01 01:00:00.000000000 +0100
  7169. +++ musl-git/src/process/x32/vfork.s 2014-03-01 08:58:14.000000000 +0100
  7170. @@ -0,0 +1,12 @@
  7171. +.global __vfork
  7172. +.weak vfork
  7173. +.type __vfork,@function
  7174. +.type vfork,@function
  7175. +__vfork:
  7176. +vfork:
  7177. + pop %rdx
  7178. + mov $0x4000003a,%eax /* SYS_vfork */
  7179. + syscall
  7180. + push %rdx
  7181. + mov %rax,%rdi
  7182. + jmp __syscall_ret
  7183. diff -Nur musl-0.9.15/src/setjmp/mipsel-sf/longjmp.sub musl-git/src/setjmp/mipsel-sf/longjmp.sub
  7184. --- musl-0.9.15/src/setjmp/mipsel-sf/longjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7185. +++ musl-git/src/setjmp/mipsel-sf/longjmp.sub 2014-03-01 08:58:14.000000000 +0100
  7186. @@ -0,0 +1 @@
  7187. +../mips-sf/longjmp.s
  7188. diff -Nur musl-0.9.15/src/setjmp/mipsel-sf/setjmp.sub musl-git/src/setjmp/mipsel-sf/setjmp.sub
  7189. --- musl-0.9.15/src/setjmp/mipsel-sf/setjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7190. +++ musl-git/src/setjmp/mipsel-sf/setjmp.sub 2014-03-01 08:58:14.000000000 +0100
  7191. @@ -0,0 +1 @@
  7192. +../mips-sf/setjmp.s
  7193. diff -Nur musl-0.9.15/src/setjmp/mips-sf/longjmp.s musl-git/src/setjmp/mips-sf/longjmp.s
  7194. --- musl-0.9.15/src/setjmp/mips-sf/longjmp.s 1970-01-01 01:00:00.000000000 +0100
  7195. +++ musl-git/src/setjmp/mips-sf/longjmp.s 2014-03-01 08:58:14.000000000 +0100
  7196. @@ -0,0 +1,25 @@
  7197. +.set noreorder
  7198. +
  7199. +.global _longjmp
  7200. +.global longjmp
  7201. +.type _longjmp,@function
  7202. +.type longjmp,@function
  7203. +_longjmp:
  7204. +longjmp:
  7205. + move $2, $5
  7206. + bne $2, $0, 1f
  7207. + nop
  7208. + addu $2, $2, 1
  7209. +1: lw $ra, 0($4)
  7210. + lw $sp, 4($4)
  7211. + lw $16, 8($4)
  7212. + lw $17, 12($4)
  7213. + lw $18, 16($4)
  7214. + lw $19, 20($4)
  7215. + lw $20, 24($4)
  7216. + lw $21, 28($4)
  7217. + lw $22, 32($4)
  7218. + lw $23, 36($4)
  7219. + lw $30, 40($4)
  7220. + jr $ra
  7221. + lw $28, 44($4)
  7222. diff -Nur musl-0.9.15/src/setjmp/mips-sf/longjmp.sub musl-git/src/setjmp/mips-sf/longjmp.sub
  7223. --- musl-0.9.15/src/setjmp/mips-sf/longjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7224. +++ musl-git/src/setjmp/mips-sf/longjmp.sub 2014-03-01 08:58:14.000000000 +0100
  7225. @@ -0,0 +1 @@
  7226. +longjmp.s
  7227. diff -Nur musl-0.9.15/src/setjmp/mips-sf/setjmp.s musl-git/src/setjmp/mips-sf/setjmp.s
  7228. --- musl-0.9.15/src/setjmp/mips-sf/setjmp.s 1970-01-01 01:00:00.000000000 +0100
  7229. +++ musl-git/src/setjmp/mips-sf/setjmp.s 2014-03-01 08:58:14.000000000 +0100
  7230. @@ -0,0 +1,25 @@
  7231. +.set noreorder
  7232. +
  7233. +.global __setjmp
  7234. +.global _setjmp
  7235. +.global setjmp
  7236. +.type __setjmp,@function
  7237. +.type _setjmp,@function
  7238. +.type setjmp,@function
  7239. +__setjmp:
  7240. +_setjmp:
  7241. +setjmp:
  7242. + sw $ra, 0($4)
  7243. + sw $sp, 4($4)
  7244. + sw $16, 8($4)
  7245. + sw $17, 12($4)
  7246. + sw $18, 16($4)
  7247. + sw $19, 20($4)
  7248. + sw $20, 24($4)
  7249. + sw $21, 28($4)
  7250. + sw $22, 32($4)
  7251. + sw $23, 36($4)
  7252. + sw $30, 40($4)
  7253. + sw $28, 44($4)
  7254. + jr $ra
  7255. + li $2, 0
  7256. diff -Nur musl-0.9.15/src/setjmp/mips-sf/setjmp.sub musl-git/src/setjmp/mips-sf/setjmp.sub
  7257. --- musl-0.9.15/src/setjmp/mips-sf/setjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7258. +++ musl-git/src/setjmp/mips-sf/setjmp.sub 2014-03-01 08:58:14.000000000 +0100
  7259. @@ -0,0 +1 @@
  7260. +setjmp.s
  7261. diff -Nur musl-0.9.15/src/setjmp/sh/longjmp.s musl-git/src/setjmp/sh/longjmp.s
  7262. --- musl-0.9.15/src/setjmp/sh/longjmp.s 1970-01-01 01:00:00.000000000 +0100
  7263. +++ musl-git/src/setjmp/sh/longjmp.s 2014-03-01 08:58:14.000000000 +0100
  7264. @@ -0,0 +1,26 @@
  7265. +.global _longjmp
  7266. +.global longjmp
  7267. +.type _longjmp, @function
  7268. +.type longjmp, @function
  7269. +_longjmp:
  7270. +longjmp:
  7271. + mov.l @r4+, r8
  7272. + mov.l @r4+, r9
  7273. + mov.l @r4+, r10
  7274. + mov.l @r4+, r11
  7275. + mov.l @r4+, r12
  7276. + mov.l @r4+, r13
  7277. + mov.l @r4+, r14
  7278. + mov.l @r4+, r15
  7279. + lds.l @r4+, pr
  7280. + fmov.s @r4+, fr12
  7281. + fmov.s @r4+, fr13
  7282. + fmov.s @r4+, fr14
  7283. + fmov.s @r4+, fr15
  7284. +
  7285. + tst r5, r5
  7286. + movt r0
  7287. + add r5, r0
  7288. +
  7289. + rts
  7290. + nop
  7291. diff -Nur musl-0.9.15/src/setjmp/sh/setjmp.s musl-git/src/setjmp/sh/setjmp.s
  7292. --- musl-0.9.15/src/setjmp/sh/setjmp.s 1970-01-01 01:00:00.000000000 +0100
  7293. +++ musl-git/src/setjmp/sh/setjmp.s 2014-03-01 08:58:14.000000000 +0100
  7294. @@ -0,0 +1,25 @@
  7295. +.global __setjmp
  7296. +.global _setjmp
  7297. +.global setjmp
  7298. +.type __setjmp, @function
  7299. +.type _setjmp, @function
  7300. +.type setjmp, @function
  7301. +__setjmp:
  7302. +_setjmp:
  7303. +setjmp:
  7304. + add #52, r4
  7305. + fmov.s fr15, @-r4
  7306. + fmov.s fr14, @-r4
  7307. + fmov.s fr13, @-r4
  7308. + fmov.s fr12, @-r4
  7309. + sts.l pr, @-r4
  7310. + mov.l r15 @-r4
  7311. + mov.l r14, @-r4
  7312. + mov.l r13, @-r4
  7313. + mov.l r12, @-r4
  7314. + mov.l r11, @-r4
  7315. + mov.l r10, @-r4
  7316. + mov.l r9, @-r4
  7317. + mov.l r8, @-r4
  7318. + rts
  7319. + mov #0, r0
  7320. diff -Nur musl-0.9.15/src/setjmp/sheb-nofpu/longjmp.sub musl-git/src/setjmp/sheb-nofpu/longjmp.sub
  7321. --- musl-0.9.15/src/setjmp/sheb-nofpu/longjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7322. +++ musl-git/src/setjmp/sheb-nofpu/longjmp.sub 2014-03-01 08:58:14.000000000 +0100
  7323. @@ -0,0 +1 @@
  7324. +../sh-nofpu/longjmp.s
  7325. diff -Nur musl-0.9.15/src/setjmp/sheb-nofpu/setjmp.sub musl-git/src/setjmp/sheb-nofpu/setjmp.sub
  7326. --- musl-0.9.15/src/setjmp/sheb-nofpu/setjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7327. +++ musl-git/src/setjmp/sheb-nofpu/setjmp.sub 2014-03-01 08:58:14.000000000 +0100
  7328. @@ -0,0 +1 @@
  7329. +../sh-nofpu/setjmp.s
  7330. diff -Nur musl-0.9.15/src/setjmp/sh-nofpu/longjmp.s musl-git/src/setjmp/sh-nofpu/longjmp.s
  7331. --- musl-0.9.15/src/setjmp/sh-nofpu/longjmp.s 1970-01-01 01:00:00.000000000 +0100
  7332. +++ musl-git/src/setjmp/sh-nofpu/longjmp.s 2014-03-01 08:58:14.000000000 +0100
  7333. @@ -0,0 +1,22 @@
  7334. +.global _longjmp
  7335. +.global longjmp
  7336. +.type _longjmp, @function
  7337. +.type longjmp, @function
  7338. +_longjmp:
  7339. +longjmp:
  7340. + mov.l @r4+, r8
  7341. + mov.l @r4+, r9
  7342. + mov.l @r4+, r10
  7343. + mov.l @r4+, r11
  7344. + mov.l @r4+, r12
  7345. + mov.l @r4+, r13
  7346. + mov.l @r4+, r14
  7347. + mov.l @r4+, r15
  7348. + lds.l @r4+, pr
  7349. +
  7350. + tst r5, r5
  7351. + movt r0
  7352. + add r5, r0
  7353. +
  7354. + rts
  7355. + nop
  7356. diff -Nur musl-0.9.15/src/setjmp/sh-nofpu/longjmp.sub musl-git/src/setjmp/sh-nofpu/longjmp.sub
  7357. --- musl-0.9.15/src/setjmp/sh-nofpu/longjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7358. +++ musl-git/src/setjmp/sh-nofpu/longjmp.sub 2014-03-01 08:58:14.000000000 +0100
  7359. @@ -0,0 +1 @@
  7360. +longjmp.s
  7361. diff -Nur musl-0.9.15/src/setjmp/sh-nofpu/setjmp.s musl-git/src/setjmp/sh-nofpu/setjmp.s
  7362. --- musl-0.9.15/src/setjmp/sh-nofpu/setjmp.s 1970-01-01 01:00:00.000000000 +0100
  7363. +++ musl-git/src/setjmp/sh-nofpu/setjmp.s 2014-03-01 08:58:14.000000000 +0100
  7364. @@ -0,0 +1,21 @@
  7365. +.global __setjmp
  7366. +.global _setjmp
  7367. +.global setjmp
  7368. +.type __setjmp, @function
  7369. +.type _setjmp, @function
  7370. +.type setjmp, @function
  7371. +__setjmp:
  7372. +_setjmp:
  7373. +setjmp:
  7374. + add #36, r4
  7375. + sts.l pr, @-r4
  7376. + mov.l r15 @-r4
  7377. + mov.l r14, @-r4
  7378. + mov.l r13, @-r4
  7379. + mov.l r12, @-r4
  7380. + mov.l r11, @-r4
  7381. + mov.l r10, @-r4
  7382. + mov.l r9, @-r4
  7383. + mov.l r8, @-r4
  7384. + rts
  7385. + mov #0, r0
  7386. diff -Nur musl-0.9.15/src/setjmp/sh-nofpu/setjmp.sub musl-git/src/setjmp/sh-nofpu/setjmp.sub
  7387. --- musl-0.9.15/src/setjmp/sh-nofpu/setjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7388. +++ musl-git/src/setjmp/sh-nofpu/setjmp.sub 2014-03-01 08:58:14.000000000 +0100
  7389. @@ -0,0 +1 @@
  7390. +setjmp.s
  7391. diff -Nur musl-0.9.15/src/setjmp/x32/longjmp.s musl-git/src/setjmp/x32/longjmp.s
  7392. --- musl-0.9.15/src/setjmp/x32/longjmp.s 1970-01-01 01:00:00.000000000 +0100
  7393. +++ musl-git/src/setjmp/x32/longjmp.s 2014-03-01 08:58:14.000000000 +0100
  7394. @@ -0,0 +1,22 @@
  7395. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  7396. +.global _longjmp
  7397. +.global longjmp
  7398. +.type _longjmp,@function
  7399. +.type longjmp,@function
  7400. +_longjmp:
  7401. +longjmp:
  7402. + mov %rsi,%rax /* val will be longjmp return */
  7403. + test %rax,%rax
  7404. + jnz 1f
  7405. + inc %rax /* if val==0, val=1 per longjmp semantics */
  7406. +1:
  7407. + mov (%rdi),%rbx /* rdi is the jmp_buf, restore regs from it */
  7408. + mov 8(%rdi),%rbp
  7409. + mov 16(%rdi),%r12
  7410. + mov 24(%rdi),%r13
  7411. + mov 32(%rdi),%r14
  7412. + mov 40(%rdi),%r15
  7413. + mov 48(%rdi),%rdx /* this ends up being the stack pointer */
  7414. + mov %rdx,%rsp
  7415. + mov 56(%rdi),%rdx /* this is the instruction pointer */
  7416. + jmp *%rdx /* goto saved address without altering rsp */
  7417. diff -Nur musl-0.9.15/src/setjmp/x32/setjmp.s musl-git/src/setjmp/x32/setjmp.s
  7418. --- musl-0.9.15/src/setjmp/x32/setjmp.s 1970-01-01 01:00:00.000000000 +0100
  7419. +++ musl-git/src/setjmp/x32/setjmp.s 2014-03-01 08:58:14.000000000 +0100
  7420. @@ -0,0 +1,22 @@
  7421. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  7422. +.global __setjmp
  7423. +.global _setjmp
  7424. +.global setjmp
  7425. +.type __setjmp,@function
  7426. +.type _setjmp,@function
  7427. +.type setjmp,@function
  7428. +__setjmp:
  7429. +_setjmp:
  7430. +setjmp:
  7431. + mov %rbx,(%rdi) /* rdi is jmp_buf, move registers onto it */
  7432. + mov %rbp,8(%rdi)
  7433. + mov %r12,16(%rdi)
  7434. + mov %r13,24(%rdi)
  7435. + mov %r14,32(%rdi)
  7436. + mov %r15,40(%rdi)
  7437. + lea 8(%rsp),%rdx /* this is our rsp WITHOUT current ret addr */
  7438. + mov %rdx,48(%rdi)
  7439. + mov (%rsp),%rdx /* save return addr ptr for new rip */
  7440. + mov %rdx,56(%rdi)
  7441. + xor %rax,%rax /* always return 0 */
  7442. + ret
  7443. diff -Nur musl-0.9.15/src/signal/sh/restore.s musl-git/src/signal/sh/restore.s
  7444. --- musl-0.9.15/src/signal/sh/restore.s 1970-01-01 01:00:00.000000000 +0100
  7445. +++ musl-git/src/signal/sh/restore.s 2014-03-01 08:58:14.000000000 +0100
  7446. @@ -0,0 +1,24 @@
  7447. +.global __restore
  7448. +.type __restore, @function
  7449. +__restore:
  7450. + mov #119, r3 !__NR_sigreturn
  7451. + trapa #16
  7452. +
  7453. + or r0, r0
  7454. + or r0, r0
  7455. + or r0, r0
  7456. + or r0, r0
  7457. + or r0, r0
  7458. +
  7459. +.global __restore_rt
  7460. +.type __restore_rt, @function
  7461. +__restore_rt:
  7462. + mov #100, r3 !__NR_rt_sigreturn
  7463. + add #73, r3
  7464. + trapa #16
  7465. +
  7466. + or r0, r0
  7467. + or r0, r0
  7468. + or r0, r0
  7469. + or r0, r0
  7470. + or r0, r0
  7471. diff -Nur musl-0.9.15/src/signal/sh/sigsetjmp.s musl-git/src/signal/sh/sigsetjmp.s
  7472. --- musl-0.9.15/src/signal/sh/sigsetjmp.s 1970-01-01 01:00:00.000000000 +0100
  7473. +++ musl-git/src/signal/sh/sigsetjmp.s 2014-03-01 08:58:14.000000000 +0100
  7474. @@ -0,0 +1,27 @@
  7475. +.global sigsetjmp
  7476. +.type sigsetjmp, @function
  7477. +sigsetjmp:
  7478. + mov.l r5, @(36,r4)
  7479. + tst r5, r5
  7480. + bf 2f
  7481. +
  7482. + sts.l pr, @-r15
  7483. + mov.l r4, @-r15
  7484. + mov r4, r6
  7485. + add #40, r6
  7486. + mov #0, r5
  7487. + mov #2, r4
  7488. + mov.l L1, r0
  7489. + bsrf r0
  7490. + nop
  7491. +1: mov.l @r15+, r4
  7492. + lds.l @r15+, pr
  7493. +
  7494. +2: mov.l L2, r0
  7495. + braf r0
  7496. + nop
  7497. +3:
  7498. +
  7499. +.align 2
  7500. +L1: .long pthread_sigmask@PLT-(1b-.)
  7501. +L2: .long setjmp@PLT-(3b-.)
  7502. diff -Nur musl-0.9.15/src/signal/sigandset.c musl-git/src/signal/sigandset.c
  7503. --- musl-0.9.15/src/signal/sigandset.c 2014-01-03 21:12:18.000000000 +0100
  7504. +++ musl-git/src/signal/sigandset.c 2014-03-01 08:58:14.000000000 +0100
  7505. @@ -3,7 +3,7 @@
  7506. #define SST_SIZE (_NSIG/8/sizeof(long))
  7507. -int sigandset(sigset_t *dest, sigset_t *left, sigset_t *right)
  7508. +int sigandset(sigset_t *dest, const sigset_t *left, const sigset_t *right)
  7509. {
  7510. unsigned long i = 0, *d = (void*) dest, *l = (void*) left, *r = (void*) right;
  7511. for(; i < SST_SIZE; i++) d[i] = l[i] & r[i];
  7512. diff -Nur musl-0.9.15/src/signal/sigorset.c musl-git/src/signal/sigorset.c
  7513. --- musl-0.9.15/src/signal/sigorset.c 2014-01-03 21:12:18.000000000 +0100
  7514. +++ musl-git/src/signal/sigorset.c 2014-03-01 08:58:14.000000000 +0100
  7515. @@ -3,7 +3,7 @@
  7516. #define SST_SIZE (_NSIG/8/sizeof(long))
  7517. -int sigorset(sigset_t *dest, sigset_t *left, sigset_t *right)
  7518. +int sigorset(sigset_t *dest, const sigset_t *left, const sigset_t *right)
  7519. {
  7520. unsigned long i = 0, *d = (void*) dest, *l = (void*) left, *r = (void*) right;
  7521. for(; i < SST_SIZE; i++) d[i] = l[i] | r[i];
  7522. diff -Nur musl-0.9.15/src/signal/x32/restore.s musl-git/src/signal/x32/restore.s
  7523. --- musl-0.9.15/src/signal/x32/restore.s 1970-01-01 01:00:00.000000000 +0100
  7524. +++ musl-git/src/signal/x32/restore.s 2014-03-01 08:58:14.000000000 +0100
  7525. @@ -0,0 +1,8 @@
  7526. +.global __restore_rt
  7527. +.global __restore
  7528. +.type __restore_rt,@function
  7529. +.type __restore,@function
  7530. +__restore_rt:
  7531. +__restore:
  7532. + movl $0x40000201, %eax /* SYS_rt_sigreturn */
  7533. + syscall
  7534. diff -Nur musl-0.9.15/src/signal/x32/sigsetjmp.s musl-git/src/signal/x32/sigsetjmp.s
  7535. --- musl-0.9.15/src/signal/x32/sigsetjmp.s 1970-01-01 01:00:00.000000000 +0100
  7536. +++ musl-git/src/signal/x32/sigsetjmp.s 2014-03-01 08:58:14.000000000 +0100
  7537. @@ -0,0 +1,14 @@
  7538. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  7539. +.global sigsetjmp
  7540. +.type sigsetjmp,@function
  7541. +sigsetjmp:
  7542. + andl %esi,%esi
  7543. + movq %rsi,64(%rdi)
  7544. + jz 1f
  7545. + pushq %rdi
  7546. + leaq 72(%rdi),%rdx
  7547. + xorl %esi,%esi
  7548. + movl $2,%edi
  7549. + call sigprocmask
  7550. + popq %rdi
  7551. +1: jmp setjmp
  7552. diff -Nur musl-0.9.15/src/stdio/__fdopen.c musl-git/src/stdio/__fdopen.c
  7553. --- musl-0.9.15/src/stdio/__fdopen.c 2014-01-03 21:12:18.000000000 +0100
  7554. +++ musl-git/src/stdio/__fdopen.c 2014-03-01 08:58:14.000000000 +0100
  7555. @@ -32,7 +32,9 @@
  7556. /* Set append mode on fd if opened for append */
  7557. if (*mode == 'a') {
  7558. int flags = __syscall(SYS_fcntl, fd, F_GETFL);
  7559. - __syscall(SYS_fcntl, fd, F_SETFL, flags | O_APPEND);
  7560. + if (!(flags & O_APPEND))
  7561. + __syscall(SYS_fcntl, fd, F_SETFL, flags | O_APPEND);
  7562. + f->flags |= F_APP;
  7563. }
  7564. f->fd = fd;
  7565. diff -Nur musl-0.9.15/src/stdio/ftell.c musl-git/src/stdio/ftell.c
  7566. --- musl-0.9.15/src/stdio/ftell.c 2014-01-03 21:12:18.000000000 +0100
  7567. +++ musl-git/src/stdio/ftell.c 2014-03-01 08:58:14.000000000 +0100
  7568. @@ -4,7 +4,9 @@
  7569. off_t __ftello_unlocked(FILE *f)
  7570. {
  7571. - off_t pos = f->seek(f, 0, SEEK_CUR);
  7572. + off_t pos = f->seek(f, 0,
  7573. + (f->flags & F_APP) && f->wpos > f->wbase
  7574. + ? SEEK_END : SEEK_CUR);
  7575. if (pos < 0) return pos;
  7576. /* Adjust for data in buffer. */
  7577. diff -Nur musl-0.9.15/src/stdio/vfscanf.c musl-git/src/stdio/vfscanf.c
  7578. --- musl-0.9.15/src/stdio/vfscanf.c 2014-01-03 21:12:18.000000000 +0100
  7579. +++ musl-git/src/stdio/vfscanf.c 2014-03-01 08:58:14.000000000 +0100
  7580. @@ -328,3 +328,5 @@
  7581. FUNLOCK(f);
  7582. return matches;
  7583. }
  7584. +
  7585. +weak_alias(vfscanf,__isoc99_vfscanf);
  7586. diff -Nur musl-0.9.15/src/thread/arm/clone.s musl-git/src/thread/arm/clone.s
  7587. --- musl-0.9.15/src/thread/arm/clone.s 2014-01-03 21:12:18.000000000 +0100
  7588. +++ musl-git/src/thread/arm/clone.s 2014-03-01 08:58:14.000000000 +0100
  7589. @@ -1,10 +1,7 @@
  7590. .text
  7591. .global __clone
  7592. -.weak clone
  7593. .type __clone,%function
  7594. -.type clone,%function
  7595. __clone:
  7596. -clone:
  7597. stmfd sp!,{r4,r5,r6,r7}
  7598. mov r7,#120
  7599. mov r6,r3
  7600. diff -Nur musl-0.9.15/src/thread/cancel_dummy.c musl-git/src/thread/cancel_dummy.c
  7601. --- musl-0.9.15/src/thread/cancel_dummy.c 2014-01-03 21:12:18.000000000 +0100
  7602. +++ musl-git/src/thread/cancel_dummy.c 2014-03-01 08:58:14.000000000 +0100
  7603. @@ -1,6 +1,9 @@
  7604. #include "pthread_impl.h"
  7605. +#include "syscall.h"
  7606. -static long sccp(long nr, long u, long v, long w, long x, long y, long z)
  7607. +static long sccp(syscall_arg_t nr,
  7608. + syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
  7609. + syscall_arg_t x, syscall_arg_t y, syscall_arg_t z)
  7610. {
  7611. return (__syscall)(nr, u, v, w, x, y, z);
  7612. }
  7613. diff -Nur musl-0.9.15/src/thread/cancel_impl.c musl-git/src/thread/cancel_impl.c
  7614. --- musl-0.9.15/src/thread/cancel_impl.c 2014-01-03 21:12:18.000000000 +0100
  7615. +++ musl-git/src/thread/cancel_impl.c 2014-03-01 08:58:14.000000000 +0100
  7616. @@ -1,4 +1,5 @@
  7617. #include "pthread_impl.h"
  7618. +#include "syscall.h"
  7619. void __cancel()
  7620. {
  7621. @@ -8,9 +9,13 @@
  7622. pthread_exit(PTHREAD_CANCELED);
  7623. }
  7624. -long __syscall_cp_asm(volatile void *, long, long, long, long, long, long, long);
  7625. +long __syscall_cp_asm(volatile void *, syscall_arg_t,
  7626. + syscall_arg_t, syscall_arg_t, syscall_arg_t,
  7627. + syscall_arg_t, syscall_arg_t, syscall_arg_t);
  7628. -long (__syscall_cp)(long nr, long u, long v, long w, long x, long y, long z)
  7629. +long (__syscall_cp)(syscall_arg_t nr,
  7630. + syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
  7631. + syscall_arg_t x, syscall_arg_t y, syscall_arg_t z)
  7632. {
  7633. pthread_t self;
  7634. long r;
  7635. diff -Nur musl-0.9.15/src/thread/clone.c musl-git/src/thread/clone.c
  7636. --- musl-0.9.15/src/thread/clone.c 2014-01-03 21:12:18.000000000 +0100
  7637. +++ musl-git/src/thread/clone.c 2014-03-01 08:58:14.000000000 +0100
  7638. @@ -1,10 +1,7 @@
  7639. #include <errno.h>
  7640. -#include "libc.h"
  7641. +#include "pthread_impl.h"
  7642. int __clone(int (*func)(void *), void *stack, int flags, void *arg, ...)
  7643. {
  7644. - errno = ENOSYS;
  7645. - return -1;
  7646. + return -ENOSYS;
  7647. }
  7648. -
  7649. -weak_alias(__clone, clone);
  7650. diff -Nur musl-0.9.15/src/thread/i386/clone.s musl-git/src/thread/i386/clone.s
  7651. --- musl-0.9.15/src/thread/i386/clone.s 2014-01-03 21:12:18.000000000 +0100
  7652. +++ musl-git/src/thread/i386/clone.s 2014-03-01 08:58:14.000000000 +0100
  7653. @@ -1,10 +1,7 @@
  7654. .text
  7655. .global __clone
  7656. -.weak clone
  7657. .type __clone,@function
  7658. -.type clone,@function
  7659. __clone:
  7660. -clone:
  7661. push %ebp
  7662. mov %esp,%ebp
  7663. push %ebx
  7664. diff -Nur musl-0.9.15/src/thread/microblaze/clone.s musl-git/src/thread/microblaze/clone.s
  7665. --- musl-0.9.15/src/thread/microblaze/clone.s 2014-01-03 21:12:18.000000000 +0100
  7666. +++ musl-git/src/thread/microblaze/clone.s 2014-03-01 08:58:14.000000000 +0100
  7667. @@ -1,14 +1,11 @@
  7668. .global __clone
  7669. -.weak clone
  7670. .type __clone,@function
  7671. -.type clone,@function
  7672. # r5, r6, r7, r8, r9, r10, stack
  7673. # fn, st, fl, ar, pt, tl, ct
  7674. # fl, st, __, pt, ct, tl
  7675. __clone:
  7676. -clone:
  7677. andi r6, r6, -16
  7678. addi r6, r6, -16
  7679. swi r5, r6, 0
  7680. @@ -23,7 +20,7 @@
  7681. beqi r3, 1f
  7682. rtsd r15, 8
  7683. nop
  7684. -
  7685. +
  7686. 1: lwi r3, r1, 0
  7687. lwi r5, r1, 4
  7688. brald r15, r3
  7689. diff -Nur musl-0.9.15/src/thread/sh/clone.s musl-git/src/thread/sh/clone.s
  7690. --- musl-0.9.15/src/thread/sh/clone.s 1970-01-01 01:00:00.000000000 +0100
  7691. +++ musl-git/src/thread/sh/clone.s 2014-03-01 08:58:14.000000000 +0100
  7692. @@ -0,0 +1,47 @@
  7693. +.text
  7694. +.global __clone
  7695. +.type __clone, @function
  7696. +__clone:
  7697. +! incoming: fn stack flags arg ptid tls ctid
  7698. +! r4 r5 r6 r7 @r15 @(4,r15) @(8,r15)
  7699. +
  7700. + mov #-16, r0
  7701. + and r0, r5
  7702. +
  7703. + mov r4, r1 ! r1 = fn
  7704. + mov r7, r2 ! r2 = arg
  7705. +
  7706. + mov #120, r3 ! r3 = __NR_clone
  7707. + mov r6, r4 ! r4 = flags
  7708. + !mov r5, r5 ! r5 = stack
  7709. + mov.l @r15, r6 ! r6 = ptid
  7710. + mov.l @(8,r15), r7 ! r7 = ctid
  7711. + mov.l @(4,r15), r0 ! r0 = tls
  7712. + trapa #21
  7713. +
  7714. + or r0, r0
  7715. + or r0, r0
  7716. + or r0, r0
  7717. + or r0, r0
  7718. + or r0, r0
  7719. +
  7720. + cmp/eq #0, r0
  7721. + bt 1f
  7722. +
  7723. + ! we are the parent, return
  7724. + rts
  7725. + nop
  7726. +
  7727. +1: ! we are the child, call fn(arg)
  7728. + jsr @r1
  7729. + mov r2, r4
  7730. +
  7731. + mov #1, r3 ! __NR_exit
  7732. + mov r0, r4
  7733. + trapa #17
  7734. +
  7735. + or r0, r0
  7736. + or r0, r0
  7737. + or r0, r0
  7738. + or r0, r0
  7739. + or r0, r0
  7740. diff -Nur musl-0.9.15/src/thread/sh/__set_thread_area.s musl-git/src/thread/sh/__set_thread_area.s
  7741. --- musl-0.9.15/src/thread/sh/__set_thread_area.s 1970-01-01 01:00:00.000000000 +0100
  7742. +++ musl-git/src/thread/sh/__set_thread_area.s 2014-03-01 08:58:14.000000000 +0100
  7743. @@ -0,0 +1,5 @@
  7744. +.global __set_thread_area
  7745. +.type __set_thread_area, @function
  7746. +__set_thread_area:
  7747. + rts
  7748. + ldc r4, gbr
  7749. diff -Nur musl-0.9.15/src/thread/sh/syscall_cp.s musl-git/src/thread/sh/syscall_cp.s
  7750. --- musl-0.9.15/src/thread/sh/syscall_cp.s 1970-01-01 01:00:00.000000000 +0100
  7751. +++ musl-git/src/thread/sh/syscall_cp.s 2014-03-01 08:58:14.000000000 +0100
  7752. @@ -0,0 +1,39 @@
  7753. +.text
  7754. +.global __syscall_cp_asm
  7755. +.type __syscall_cp_asm, @function
  7756. +__syscall_cp_asm:
  7757. +
  7758. +.global __cp_begin
  7759. +__cp_begin:
  7760. + mov.l @r4, r4
  7761. + tst r4, r4
  7762. + bt 2f
  7763. +
  7764. + mov.l L1, r0
  7765. + braf r0
  7766. + nop
  7767. +1:
  7768. +
  7769. +.align 2
  7770. +L1: .long __cancel@PLT-(1b-.)
  7771. +
  7772. +2: mov r5, r3
  7773. + mov r6, r4
  7774. + mov r7, r5
  7775. + mov.l @r15, r6
  7776. + mov.l @(4,r15), r7
  7777. + mov.l @(8,r15), r0
  7778. + mov.l @(12,r15), r1
  7779. + trapa #22
  7780. +
  7781. +.global __cp_end
  7782. +__cp_end:
  7783. + ! work around hardware bug
  7784. + or r0, r0
  7785. + or r0, r0
  7786. + or r0, r0
  7787. + or r0, r0
  7788. + or r0, r0
  7789. +
  7790. + rts
  7791. + nop
  7792. diff -Nur musl-0.9.15/src/thread/sh/__unmapself.s musl-git/src/thread/sh/__unmapself.s
  7793. --- musl-0.9.15/src/thread/sh/__unmapself.s 1970-01-01 01:00:00.000000000 +0100
  7794. +++ musl-git/src/thread/sh/__unmapself.s 2014-03-01 08:58:14.000000000 +0100
  7795. @@ -0,0 +1,22 @@
  7796. +.text
  7797. +.global __unmapself
  7798. +.type __unmapself, @function
  7799. +__unmapself:
  7800. + mov #91, r3 ! SYS_munmap
  7801. + trapa #18
  7802. +
  7803. + or r0, r0
  7804. + or r0, r0
  7805. + or r0, r0
  7806. + or r0, r0
  7807. + or r0, r0
  7808. +
  7809. + mov #1, r3 ! SYS_exit
  7810. + mov #0, r4
  7811. + trapa #17
  7812. +
  7813. + or r0, r0
  7814. + or r0, r0
  7815. + or r0, r0
  7816. + or r0, r0
  7817. + or r0, r0
  7818. diff -Nur musl-0.9.15/src/thread/__wait.c musl-git/src/thread/__wait.c
  7819. --- musl-0.9.15/src/thread/__wait.c 2014-01-03 21:12:18.000000000 +0100
  7820. +++ musl-git/src/thread/__wait.c 2014-03-01 08:58:14.000000000 +0100
  7821. @@ -10,6 +10,6 @@
  7822. }
  7823. if (waiters) a_inc(waiters);
  7824. while (*addr==val)
  7825. - __syscall(SYS_futex, (long)addr, FUTEX_WAIT|priv, val, 0);
  7826. + __syscall(SYS_futex, addr, FUTEX_WAIT|priv, val, 0);
  7827. if (waiters) a_dec(waiters);
  7828. }
  7829. diff -Nur musl-0.9.15/src/thread/x32/clone.s musl-git/src/thread/x32/clone.s
  7830. --- musl-0.9.15/src/thread/x32/clone.s 1970-01-01 01:00:00.000000000 +0100
  7831. +++ musl-git/src/thread/x32/clone.s 2014-03-01 08:58:14.000000000 +0100
  7832. @@ -0,0 +1,25 @@
  7833. +.text
  7834. +.global __clone
  7835. +.type __clone,@function
  7836. +__clone:
  7837. + movl $0x40000038,%eax /* SYS_clone */
  7838. + mov %rdi,%r11
  7839. + mov %rdx,%rdi
  7840. + mov %r8,%rdx
  7841. + mov %r9,%r8
  7842. + mov 8(%rsp),%r10
  7843. + mov %r11,%r9
  7844. + and $-16,%rsi
  7845. + sub $8,%rsi
  7846. + mov %rcx,(%rsi)
  7847. + syscall
  7848. + test %eax,%eax
  7849. + jnz 1f
  7850. + xor %ebp,%ebp
  7851. + pop %rdi
  7852. + call *%r9
  7853. + mov %eax,%edi
  7854. + movl $0x4000003c,%eax /* SYS_exit */
  7855. + syscall
  7856. + hlt
  7857. +1: ret
  7858. diff -Nur musl-0.9.15/src/thread/x32/__set_thread_area.s musl-git/src/thread/x32/__set_thread_area.s
  7859. --- musl-0.9.15/src/thread/x32/__set_thread_area.s 1970-01-01 01:00:00.000000000 +0100
  7860. +++ musl-git/src/thread/x32/__set_thread_area.s 2014-03-01 08:58:14.000000000 +0100
  7861. @@ -0,0 +1,10 @@
  7862. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  7863. +.text
  7864. +.global __set_thread_area
  7865. +.type __set_thread_area,@function
  7866. +__set_thread_area:
  7867. + mov %rdi,%rsi /* shift for syscall */
  7868. + movl $0x1002,%edi /* SET_FS register */
  7869. + movl $0x4000009e,%eax /* set fs segment to */
  7870. + syscall /* arch_prctl(SET_FS, arg)*/
  7871. + ret
  7872. diff -Nur musl-0.9.15/src/thread/x32/syscall_cp.s musl-git/src/thread/x32/syscall_cp.s
  7873. --- musl-0.9.15/src/thread/x32/syscall_cp.s 1970-01-01 01:00:00.000000000 +0100
  7874. +++ musl-git/src/thread/x32/syscall_cp.s 2014-03-01 08:58:14.000000000 +0100
  7875. @@ -0,0 +1,23 @@
  7876. +.text
  7877. +.global __syscall_cp_internal
  7878. +.type __syscall_cp_internal,@function
  7879. +__syscall_cp_internal:
  7880. +
  7881. +.global __cp_begin
  7882. +__cp_begin:
  7883. + mov (%rdi),%eax
  7884. + test %eax,%eax
  7885. + jnz __cancel
  7886. + mov %rdi,%r11
  7887. + mov %rsi,%rax
  7888. + mov %rdx,%rdi
  7889. + mov %rcx,%rsi
  7890. + mov %r8,%rdx
  7891. + mov %r9,%r10
  7892. + mov 8(%rsp),%r8
  7893. + mov 16(%rsp),%r9
  7894. + mov %r11,8(%rsp)
  7895. + syscall
  7896. +.global __cp_end
  7897. +__cp_end:
  7898. + ret
  7899. diff -Nur musl-0.9.15/src/thread/x32/__unmapself.s musl-git/src/thread/x32/__unmapself.s
  7900. --- musl-0.9.15/src/thread/x32/__unmapself.s 1970-01-01 01:00:00.000000000 +0100
  7901. +++ musl-git/src/thread/x32/__unmapself.s 2014-03-01 08:58:14.000000000 +0100
  7902. @@ -0,0 +1,10 @@
  7903. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  7904. +.text
  7905. +.global __unmapself
  7906. +.type __unmapself,@function
  7907. +__unmapself:
  7908. + movl $0x4000000b,%eax /* SYS_munmap */
  7909. + syscall /* munmap(arg2,arg3) */
  7910. + xor %rdi,%rdi /* exit() args: always return success */
  7911. + movl $0x4000003c,%eax /* SYS_exit */
  7912. + syscall /* exit(0) */
  7913. diff -Nur musl-0.9.15/src/thread/x86_64/clone.s musl-git/src/thread/x86_64/clone.s
  7914. --- musl-0.9.15/src/thread/x86_64/clone.s 2014-01-03 21:12:18.000000000 +0100
  7915. +++ musl-git/src/thread/x86_64/clone.s 2014-03-01 08:58:14.000000000 +0100
  7916. @@ -1,10 +1,7 @@
  7917. .text
  7918. .global __clone
  7919. -.weak clone
  7920. .type __clone,@function
  7921. -.type clone,@function
  7922. __clone:
  7923. -clone:
  7924. xor %eax,%eax
  7925. mov $56,%al
  7926. mov %rdi,%r11
  7927. diff -Nur musl-0.9.15/src/time/timer_delete.c musl-git/src/time/timer_delete.c
  7928. --- musl-0.9.15/src/time/timer_delete.c 2014-01-03 21:12:18.000000000 +0100
  7929. +++ musl-git/src/time/timer_delete.c 2014-03-01 08:58:14.000000000 +0100
  7930. @@ -10,5 +10,5 @@
  7931. __wake(&td->timer_id, 1, 1);
  7932. return 0;
  7933. }
  7934. - return __syscall(SYS_timer_delete, (long)t);
  7935. + return __syscall(SYS_timer_delete, t);
  7936. }
  7937. diff -Nur musl-0.9.15/src/time/timer_getoverrun.c musl-git/src/time/timer_getoverrun.c
  7938. --- musl-0.9.15/src/time/timer_getoverrun.c 2014-01-03 21:12:18.000000000 +0100
  7939. +++ musl-git/src/time/timer_getoverrun.c 2014-03-01 08:58:14.000000000 +0100
  7940. @@ -8,5 +8,5 @@
  7941. pthread_t td = (void *)((uintptr_t)t << 1);
  7942. t = (void *)(uintptr_t)(td->timer_id & INT_MAX);
  7943. }
  7944. - return syscall(SYS_timer_getoverrun, (long)t);
  7945. + return syscall(SYS_timer_getoverrun, t);
  7946. }
  7947. diff -Nur musl-0.9.15/src/time/timer_gettime.c musl-git/src/time/timer_gettime.c
  7948. --- musl-0.9.15/src/time/timer_gettime.c 2014-01-03 21:12:18.000000000 +0100
  7949. +++ musl-git/src/time/timer_gettime.c 2014-03-01 08:58:14.000000000 +0100
  7950. @@ -8,5 +8,5 @@
  7951. pthread_t td = (void *)((uintptr_t)t << 1);
  7952. t = (void *)(uintptr_t)(td->timer_id & INT_MAX);
  7953. }
  7954. - return syscall(SYS_timer_gettime, (long)t, val);
  7955. + return syscall(SYS_timer_gettime, t, val);
  7956. }
  7957. diff -Nur musl-0.9.15/src/time/timer_settime.c musl-git/src/time/timer_settime.c
  7958. --- musl-0.9.15/src/time/timer_settime.c 2014-01-03 21:12:18.000000000 +0100
  7959. +++ musl-git/src/time/timer_settime.c 2014-03-01 08:58:14.000000000 +0100
  7960. @@ -8,5 +8,5 @@
  7961. pthread_t td = (void *)((uintptr_t)t << 1);
  7962. t = (void *)(uintptr_t)(td->timer_id & INT_MAX);
  7963. }
  7964. - return syscall(SYS_timer_settime, (long)t, flags, val, old);
  7965. + return syscall(SYS_timer_settime, t, flags, val, old);
  7966. }
  7967. diff -Nur musl-0.9.15/src/unistd/sh/pipe.s musl-git/src/unistd/sh/pipe.s
  7968. --- musl-0.9.15/src/unistd/sh/pipe.s 1970-01-01 01:00:00.000000000 +0100
  7969. +++ musl-git/src/unistd/sh/pipe.s 2014-03-01 08:58:14.000000000 +0100
  7970. @@ -0,0 +1,27 @@
  7971. +.global pipe
  7972. +.type pipe, @function
  7973. +pipe:
  7974. + mov #42, r3
  7975. + trapa #17
  7976. +
  7977. + ! work around hardware bug
  7978. + or r0, r0
  7979. + or r0, r0
  7980. + or r0, r0
  7981. + or r0, r0
  7982. + or r0, r0
  7983. +
  7984. + cmp/pz r0
  7985. + bt 1f
  7986. +
  7987. + mov.l L1, r1
  7988. + braf r1
  7989. + mov r0, r4
  7990. +
  7991. +1: mov.l r0, @(0,r4)
  7992. + mov.l r1, @(4,r4)
  7993. + rts
  7994. + mov #0, r0
  7995. +
  7996. +.align 2
  7997. +L1: .long __syscall_ret@PLT-(1b-.)
  7998. diff -Nur musl-0.9.15/tools/install.sh musl-git/tools/install.sh
  7999. --- musl-0.9.15/tools/install.sh 2014-01-03 21:12:18.000000000 +0100
  8000. +++ musl-git/tools/install.sh 2014-03-01 08:58:14.000000000 +0100
  8001. @@ -51,6 +51,7 @@
  8002. ln -s "$1" "$tmp"
  8003. else
  8004. cat < "$1" > "$tmp"
  8005. +chmod "$mode" "$tmp"
  8006. fi
  8007. mv -f "$tmp" "$2"
  8008. @@ -60,6 +61,4 @@
  8009. exit 1
  8010. }
  8011. -test "$symlink" || chmod "$mode" "$2"
  8012. -
  8013. exit 0