musl-git-20140310.patch 253 KB

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