musl-git-20140307.patch 249 KB

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