| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317 |
- /*
- * This file was automatically generated by create-native-map from ../mcs/class/lib/net_4_x/Mono.Posix.dll.
- *
- * DO NOT MODIFY.
- */
- #ifdef HAVE_CONFIG_H
- #include <config.h>
- #endif /* ndef HAVE_CONFIG_H */
- #include <stdlib.h>
- #include <string.h>
- /*
- * Implementation Macros
- */
- #ifndef _GNU_SOURCE
- #define _GNU_SOURCE
- #endif /* ndef _GNU_SOURCE */
- #ifndef _XOPEN_SOURCE
- #define _XOPEN_SOURCE
- #endif /* ndef _XOPEN_SOURCE */
- /*
- * Implementation Includes
- */
- #include <sys/types.h>
- #include <sys/stat.h>
- #ifdef HAVE_NETINET_IN_H
- #include <netinet/in.h>
- #endif /* ndef HAVE_NETINET_IN_H */
- #ifdef HAVE_SYS_TIME_H
- #include <sys/time.h>
- #endif /* ndef HAVE_SYS_TIME_H */
- #ifdef HAVE_SYS_POLL_H
- #include <sys/poll.h>
- #endif /* ndef HAVE_SYS_POLL_H */
- #ifdef HAVE_SYS_WAIT_H
- #include <sys/wait.h>
- #endif /* ndef HAVE_SYS_WAIT_H */
- #ifdef HAVE_SYS_STATVFS_H
- #include <sys/statvfs.h>
- #endif /* ndef HAVE_SYS_STATVFS_H */
- #ifdef HAVE_SYS_XATTR_H
- #include <sys/xattr.h>
- #endif /* ndef HAVE_SYS_XATTR_H */
- #ifdef HAVE_SYS_MMAN_H
- #include <sys/mman.h>
- #endif /* ndef HAVE_SYS_MMAN_H */
- #ifdef HAVE_SYS_SOCKET_H
- #include <sys/socket.h>
- #endif /* ndef HAVE_SYS_SOCKET_H */
- #ifdef HAVE_SYS_UIO_H
- #include <sys/uio.h>
- #endif /* ndef HAVE_SYS_UIO_H */
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>
- #endif /* ndef HAVE_UNISTD_H */
- #include <fcntl.h>
- #include <signal.h>
- #ifdef HAVE_POLL_H
- #include <poll.h>
- #endif /* ndef HAVE_POLL_H */
- #ifdef HAVE_GRP_H
- #include <grp.h>
- #endif /* ndef HAVE_GRP_H */
- #include <errno.h>
- #ifdef HAVE_SYSLOG_H
- #include <syslog.h>
- #endif /* ndef HAVE_SYSLOG_H */
- #ifdef HAVE_DIRENT_H
- #include <dirent.h>
- #endif /* ndef HAVE_DIRENT_H */
- #ifdef HAVE_UTIME_H
- #include <utime.h>
- #endif /* ndef HAVE_UTIME_H */
- #include <time.h>
- #include "mph.h"
- #include "map.h"
- #include <errno.h> /* errno, EOVERFLOW */
- #include <glib.h> /* g* types, g_assert_not_reached() */
- #if defined (G_MININT8)
- #define CNM_MININT8 G_MININT8
- #else
- #define CNM_MININT8 (-128)
- #endif
- #if defined (G_MAXINT8)
- #define CNM_MAXINT8 G_MAXINT8
- #else
- #define CNM_MAXINT8 (127)
- #endif
- #if defined (G_MAXUINT8)
- #define CNM_MAXUINT8 G_MAXUINT8
- #else
- #define CNM_MAXUINT8 (255)
- #endif
- #if defined (G_MININT16)
- #define CNM_MININT16 G_MININT16
- #else
- #define CNM_MININT16 (-32768)
- #endif
- #if defined (G_MAXINT16)
- #define CNM_MAXINT16 G_MAXINT16
- #else
- #define CNM_MAXINT16 (32767)
- #endif
- #if defined (G_MAXUINT16)
- #define CNM_MAXUINT16 G_MAXUINT16
- #else
- #define CNM_MAXUINT16 (65535)
- #endif
- #if defined (G_MININT32)
- #define CNM_MININT32 G_MININT32
- #else
- #define CNM_MININT32 (-2147483648)
- #endif
- #if defined (G_MAXINT32)
- #define CNM_MAXINT32 G_MAXINT32
- #else
- #define CNM_MAXINT32 (2147483647)
- #endif
- #if defined (G_MAXUINT32)
- #define CNM_MAXUINT32 G_MAXUINT32
- #else
- #define CNM_MAXUINT32 (4294967295U)
- #endif
- #if defined (G_MININT64)
- #define CNM_MININT64 G_MININT64
- #else
- #define CNM_MININT64 (-9223372036854775808LL)
- #endif
- #if defined (G_MAXINT64)
- #define CNM_MAXINT64 G_MAXINT64
- #else
- #define CNM_MAXINT64 (9223372036854775807LL)
- #endif
- #if defined (G_MAXUINT64)
- #define CNM_MAXUINT64 G_MAXUINT64
- #else
- #define CNM_MAXUINT64 (18446744073709551615ULL)
- #endif
- /* returns TRUE if @type is an unsigned type */
- #define _cnm_integral_type_is_unsigned(type) \
- (sizeof(type) == sizeof(gint8) \
- ? (((type)-1) > CNM_MAXINT8) \
- : sizeof(type) == sizeof(gint16) \
- ? (((type)-1) > CNM_MAXINT16) \
- : sizeof(type) == sizeof(gint32) \
- ? (((type)-1) > CNM_MAXINT32) \
- : sizeof(type) == sizeof(gint64) \
- ? (((type)-1) > CNM_MAXINT64) \
- : (g_assert_not_reached (), 0))
- /* returns the minimum value of @type as a gint64 */
- #define _cnm_integral_type_min(type) \
- (_cnm_integral_type_is_unsigned (type) \
- ? 0 \
- : sizeof(type) == sizeof(gint8) \
- ? CNM_MININT8 \
- : sizeof(type) == sizeof(gint16) \
- ? CNM_MININT16 \
- : sizeof(type) == sizeof(gint32) \
- ? CNM_MININT32 \
- : sizeof(type) == sizeof(gint64) \
- ? CNM_MININT64 \
- : (g_assert_not_reached (), 0))
- /* returns the maximum value of @type as a guint64 */
- #define _cnm_integral_type_max(type) \
- (_cnm_integral_type_is_unsigned (type) \
- ? sizeof(type) == sizeof(gint8) \
- ? CNM_MAXUINT8 \
- : sizeof(type) == sizeof(gint16) \
- ? CNM_MAXUINT16 \
- : sizeof(type) == sizeof(gint32) \
- ? CNM_MAXUINT32 \
- : sizeof(type) == sizeof(gint64) \
- ? CNM_MAXUINT64 \
- : (g_assert_not_reached (), 0) \
- : sizeof(type) == sizeof(gint8) \
- ? CNM_MAXINT8 \
- : sizeof(type) == sizeof(gint16) \
- ? CNM_MAXINT16 \
- : sizeof(type) == sizeof(gint32) \
- ? CNM_MAXINT32 \
- : sizeof(type) == sizeof(gint64) \
- ? CNM_MAXINT64 \
- : (g_assert_not_reached (), 0))
- #ifdef _CNM_DUMP
- #define _cnm_dump(to_t,from) \
- printf ("# %s -> %s: uns=%i; min=%llx; max=%llx; value=%llx; lt=%i; l0=%i; gt=%i; e=%i\n", \
- #from, #to_t, \
- (int) _cnm_integral_type_is_unsigned (to_t), \
- (gint64) (_cnm_integral_type_min (to_t)), \
- (gint64) (_cnm_integral_type_max (to_t)), \
- (gint64) (from), \
- (((gint64) _cnm_integral_type_min (to_t)) <= (gint64) from), \
- (from < 0), \
- (((guint64) from) <= (guint64) _cnm_integral_type_max (to_t)), \
- !((int) _cnm_integral_type_is_unsigned (to_t) \
- ? ((0 <= from) && \
- ((guint64) from <= (guint64) _cnm_integral_type_max (to_t))) \
- : ((gint64) _cnm_integral_type_min(to_t) <= (gint64) from && \
- (guint64) from <= (guint64) _cnm_integral_type_max (to_t))) \
- )
- #else /* ndef _CNM_DUMP */
- #define _cnm_dump(to_t, from) do {} while (0)
- #endif /* def _CNM_DUMP */
- #ifdef DEBUG
- #define _cnm_return_val_if_overflow(to_t,from,val) G_STMT_START { \
- int uns = _cnm_integral_type_is_unsigned (to_t); \
- gint64 min = (gint64) _cnm_integral_type_min (to_t); \
- guint64 max = (guint64) _cnm_integral_type_max (to_t); \
- gint64 sf = (gint64) from; \
- guint64 uf = (guint64) from; \
- if (!(uns ? ((0 <= from) && (uf <= max)) \
- : (min <= sf && (from < 0 || uf <= max)))) { \
- _cnm_dump(to_t, from); \
- errno = EOVERFLOW; \
- return (val); \
- } \
- } G_STMT_END
- #else /* !def DEBUG */
- /* don't do any overflow checking */
- #define _cnm_return_val_if_overflow(to_t,from,val) G_STMT_START { \
- } G_STMT_END
- #endif /* def DEBUG */
- int Mono_Posix_FromAccessModes (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_AccessModes_F_OK) == Mono_Posix_AccessModes_F_OK)
- #ifdef F_OK
- *r |= F_OK;
- #else /* def F_OK */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_OK */
- if ((x & Mono_Posix_AccessModes_R_OK) == Mono_Posix_AccessModes_R_OK)
- #ifdef R_OK
- *r |= R_OK;
- #else /* def R_OK */
- {errno = EINVAL; return -1;}
- #endif /* ndef R_OK */
- if ((x & Mono_Posix_AccessModes_W_OK) == Mono_Posix_AccessModes_W_OK)
- #ifdef W_OK
- *r |= W_OK;
- #else /* def W_OK */
- {errno = EINVAL; return -1;}
- #endif /* ndef W_OK */
- if ((x & Mono_Posix_AccessModes_X_OK) == Mono_Posix_AccessModes_X_OK)
- #ifdef X_OK
- *r |= X_OK;
- #else /* def X_OK */
- {errno = EINVAL; return -1;}
- #endif /* ndef X_OK */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToAccessModes (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef F_OK
- if ((x & F_OK) == F_OK)
- *r |= Mono_Posix_AccessModes_F_OK;
- #endif /* ndef F_OK */
- #ifdef R_OK
- if ((x & R_OK) == R_OK)
- *r |= Mono_Posix_AccessModes_R_OK;
- #endif /* ndef R_OK */
- #ifdef W_OK
- if ((x & W_OK) == W_OK)
- *r |= Mono_Posix_AccessModes_W_OK;
- #endif /* ndef W_OK */
- #ifdef X_OK
- if ((x & X_OK) == X_OK)
- *r |= Mono_Posix_AccessModes_X_OK;
- #endif /* ndef X_OK */
- return 0;
- }
- int Mono_Posix_FromAtFlags (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_AtFlags_AT_EMPTY_PATH) == Mono_Posix_AtFlags_AT_EMPTY_PATH)
- #ifdef AT_EMPTY_PATH
- *r |= AT_EMPTY_PATH;
- #else /* def AT_EMPTY_PATH */
- {errno = EINVAL; return -1;}
- #endif /* ndef AT_EMPTY_PATH */
- if ((x & Mono_Posix_AtFlags_AT_NO_AUTOMOUNT) == Mono_Posix_AtFlags_AT_NO_AUTOMOUNT)
- #ifdef AT_NO_AUTOMOUNT
- *r |= AT_NO_AUTOMOUNT;
- #else /* def AT_NO_AUTOMOUNT */
- {errno = EINVAL; return -1;}
- #endif /* ndef AT_NO_AUTOMOUNT */
- if ((x & Mono_Posix_AtFlags_AT_REMOVEDIR) == Mono_Posix_AtFlags_AT_REMOVEDIR)
- #ifdef AT_REMOVEDIR
- *r |= AT_REMOVEDIR;
- #else /* def AT_REMOVEDIR */
- {errno = EINVAL; return -1;}
- #endif /* ndef AT_REMOVEDIR */
- if ((x & Mono_Posix_AtFlags_AT_SYMLINK_FOLLOW) == Mono_Posix_AtFlags_AT_SYMLINK_FOLLOW)
- #ifdef AT_SYMLINK_FOLLOW
- *r |= AT_SYMLINK_FOLLOW;
- #else /* def AT_SYMLINK_FOLLOW */
- {errno = EINVAL; return -1;}
- #endif /* ndef AT_SYMLINK_FOLLOW */
- if ((x & Mono_Posix_AtFlags_AT_SYMLINK_NOFOLLOW) == Mono_Posix_AtFlags_AT_SYMLINK_NOFOLLOW)
- #ifdef AT_SYMLINK_NOFOLLOW
- *r |= AT_SYMLINK_NOFOLLOW;
- #else /* def AT_SYMLINK_NOFOLLOW */
- {errno = EINVAL; return -1;}
- #endif /* ndef AT_SYMLINK_NOFOLLOW */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToAtFlags (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef AT_EMPTY_PATH
- if ((x & AT_EMPTY_PATH) == AT_EMPTY_PATH)
- *r |= Mono_Posix_AtFlags_AT_EMPTY_PATH;
- #endif /* ndef AT_EMPTY_PATH */
- #ifdef AT_NO_AUTOMOUNT
- if ((x & AT_NO_AUTOMOUNT) == AT_NO_AUTOMOUNT)
- *r |= Mono_Posix_AtFlags_AT_NO_AUTOMOUNT;
- #endif /* ndef AT_NO_AUTOMOUNT */
- #ifdef AT_REMOVEDIR
- if ((x & AT_REMOVEDIR) == AT_REMOVEDIR)
- *r |= Mono_Posix_AtFlags_AT_REMOVEDIR;
- #endif /* ndef AT_REMOVEDIR */
- #ifdef AT_SYMLINK_FOLLOW
- if ((x & AT_SYMLINK_FOLLOW) == AT_SYMLINK_FOLLOW)
- *r |= Mono_Posix_AtFlags_AT_SYMLINK_FOLLOW;
- #endif /* ndef AT_SYMLINK_FOLLOW */
- #ifdef AT_SYMLINK_NOFOLLOW
- if ((x & AT_SYMLINK_NOFOLLOW) == AT_SYMLINK_NOFOLLOW)
- *r |= Mono_Posix_AtFlags_AT_SYMLINK_NOFOLLOW;
- #endif /* ndef AT_SYMLINK_NOFOLLOW */
- return 0;
- }
- #ifdef HAVE_STRUCT_CMSGHDR
- int
- Mono_Posix_FromCmsghdr (struct Mono_Posix_Cmsghdr *from, struct cmsghdr *to)
- {
- _cnm_return_val_if_overflow (gint64, from->cmsg_len, -1);
- memset (to, 0, sizeof(*to));
- to->cmsg_len = from->cmsg_len;
- if (Mono_Posix_FromUnixSocketProtocol (from->cmsg_level, &to->cmsg_level) != 0) {
- return -1;
- }
- if (Mono_Posix_FromUnixSocketControlMessage (from->cmsg_type, &to->cmsg_type) != 0) {
- return -1;
- }
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_CMSGHDR */
- #ifdef HAVE_STRUCT_CMSGHDR
- int
- Mono_Posix_ToCmsghdr (struct cmsghdr *from, struct Mono_Posix_Cmsghdr *to)
- {
- _cnm_return_val_if_overflow (gint64, from->cmsg_len, -1);
- memset (to, 0, sizeof(*to));
- to->cmsg_len = from->cmsg_len;
- if (Mono_Posix_ToUnixSocketProtocol (from->cmsg_level, &to->cmsg_level) != 0) {
- return -1;
- }
- if (Mono_Posix_ToUnixSocketControlMessage (from->cmsg_type, &to->cmsg_type) != 0) {
- return -1;
- }
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_CMSGHDR */
- int Mono_Posix_FromConfstrName (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_ConfstrName__CS_GNU_LIBC_VERSION)
- #ifdef _CS_GNU_LIBC_VERSION
- {*r = _CS_GNU_LIBC_VERSION; return 0;}
- #else /* def _CS_GNU_LIBC_VERSION */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_GNU_LIBC_VERSION */
- if (x == Mono_Posix_ConfstrName__CS_GNU_LIBPTHREAD_VERSION)
- #ifdef _CS_GNU_LIBPTHREAD_VERSION
- {*r = _CS_GNU_LIBPTHREAD_VERSION; return 0;}
- #else /* def _CS_GNU_LIBPTHREAD_VERSION */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_GNU_LIBPTHREAD_VERSION */
- if (x == Mono_Posix_ConfstrName__CS_LFS64_CFLAGS)
- #ifdef _CS_LFS64_CFLAGS
- {*r = _CS_LFS64_CFLAGS; return 0;}
- #else /* def _CS_LFS64_CFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_LFS64_CFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_LFS64_LDFLAGS)
- #ifdef _CS_LFS64_LDFLAGS
- {*r = _CS_LFS64_LDFLAGS; return 0;}
- #else /* def _CS_LFS64_LDFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_LFS64_LDFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_LFS64_LIBS)
- #ifdef _CS_LFS64_LIBS
- {*r = _CS_LFS64_LIBS; return 0;}
- #else /* def _CS_LFS64_LIBS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_LFS64_LIBS */
- if (x == Mono_Posix_ConfstrName__CS_LFS64_LINTFLAGS)
- #ifdef _CS_LFS64_LINTFLAGS
- {*r = _CS_LFS64_LINTFLAGS; return 0;}
- #else /* def _CS_LFS64_LINTFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_LFS64_LINTFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_LFS_CFLAGS)
- #ifdef _CS_LFS_CFLAGS
- {*r = _CS_LFS_CFLAGS; return 0;}
- #else /* def _CS_LFS_CFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_LFS_CFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_LFS_LDFLAGS)
- #ifdef _CS_LFS_LDFLAGS
- {*r = _CS_LFS_LDFLAGS; return 0;}
- #else /* def _CS_LFS_LDFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_LFS_LDFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_LFS_LIBS)
- #ifdef _CS_LFS_LIBS
- {*r = _CS_LFS_LIBS; return 0;}
- #else /* def _CS_LFS_LIBS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_LFS_LIBS */
- if (x == Mono_Posix_ConfstrName__CS_LFS_LINTFLAGS)
- #ifdef _CS_LFS_LINTFLAGS
- {*r = _CS_LFS_LINTFLAGS; return 0;}
- #else /* def _CS_LFS_LINTFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_LFS_LINTFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_PATH)
- #ifdef _CS_PATH
- {*r = _CS_PATH; return 0;}
- #else /* def _CS_PATH */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_PATH */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_CFLAGS)
- #ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS
- {*r = _CS_POSIX_V6_ILP32_OFF32_CFLAGS; return 0;}
- #else /* def _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LDFLAGS)
- #ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
- {*r = _CS_POSIX_V6_ILP32_OFF32_LDFLAGS; return 0;}
- #else /* def _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LIBS)
- #ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS
- {*r = _CS_POSIX_V6_ILP32_OFF32_LIBS; return 0;}
- #else /* def _CS_POSIX_V6_ILP32_OFF32_LIBS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LIBS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS)
- #ifdef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
- {*r = _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS; return 0;}
- #else /* def _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS)
- #ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
- {*r = _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS; return 0;}
- #else /* def _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS)
- #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
- {*r = _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS; return 0;}
- #else /* def _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LIBS)
- #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS
- {*r = _CS_POSIX_V6_ILP32_OFFBIG_LIBS; return 0;}
- #else /* def _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS)
- #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
- {*r = _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS; return 0;}
- #else /* def _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_CFLAGS)
- #ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS
- {*r = _CS_POSIX_V6_LP64_OFF64_CFLAGS; return 0;}
- #else /* def _CS_POSIX_V6_LP64_OFF64_CFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_LP64_OFF64_CFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LDFLAGS)
- #ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS
- {*r = _CS_POSIX_V6_LP64_OFF64_LDFLAGS; return 0;}
- #else /* def _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LIBS)
- #ifdef _CS_POSIX_V6_LP64_OFF64_LIBS
- {*r = _CS_POSIX_V6_LP64_OFF64_LIBS; return 0;}
- #else /* def _CS_POSIX_V6_LP64_OFF64_LIBS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_LP64_OFF64_LIBS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LINTFLAGS)
- #ifdef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
- {*r = _CS_POSIX_V6_LP64_OFF64_LINTFLAGS; return 0;}
- #else /* def _CS_POSIX_V6_LP64_OFF64_LINTFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS)
- #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
- {*r = _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS; return 0;}
- #else /* def _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS)
- #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
- {*r = _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS; return 0;}
- #else /* def _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LIBS)
- #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
- {*r = _CS_POSIX_V6_LPBIG_OFFBIG_LIBS; return 0;}
- #else /* def _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
- if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS)
- #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
- {*r = _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS; return 0;}
- #else /* def _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_V6_WIDTH_RESTRICTED_ENVS)
- #ifdef _CS_V6_WIDTH_RESTRICTED_ENVS
- {*r = _CS_V6_WIDTH_RESTRICTED_ENVS; return 0;}
- #else /* def _CS_V6_WIDTH_RESTRICTED_ENVS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_V6_WIDTH_RESTRICTED_ENVS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_CFLAGS)
- #ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
- {*r = _CS_XBS5_ILP32_OFF32_CFLAGS; return 0;}
- #else /* def _CS_XBS5_ILP32_OFF32_CFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_ILP32_OFF32_CFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LDFLAGS)
- #ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
- {*r = _CS_XBS5_ILP32_OFF32_LDFLAGS; return 0;}
- #else /* def _CS_XBS5_ILP32_OFF32_LDFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_ILP32_OFF32_LDFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LIBS)
- #ifdef _CS_XBS5_ILP32_OFF32_LIBS
- {*r = _CS_XBS5_ILP32_OFF32_LIBS; return 0;}
- #else /* def _CS_XBS5_ILP32_OFF32_LIBS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_ILP32_OFF32_LIBS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LINTFLAGS)
- #ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
- {*r = _CS_XBS5_ILP32_OFF32_LINTFLAGS; return 0;}
- #else /* def _CS_XBS5_ILP32_OFF32_LINTFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_ILP32_OFF32_LINTFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_CFLAGS)
- #ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
- {*r = _CS_XBS5_ILP32_OFFBIG_CFLAGS; return 0;}
- #else /* def _CS_XBS5_ILP32_OFFBIG_CFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_ILP32_OFFBIG_CFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LDFLAGS)
- #ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
- {*r = _CS_XBS5_ILP32_OFFBIG_LDFLAGS; return 0;}
- #else /* def _CS_XBS5_ILP32_OFFBIG_LDFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_ILP32_OFFBIG_LDFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LIBS)
- #ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
- {*r = _CS_XBS5_ILP32_OFFBIG_LIBS; return 0;}
- #else /* def _CS_XBS5_ILP32_OFFBIG_LIBS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_ILP32_OFFBIG_LIBS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LINTFLAGS)
- #ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
- {*r = _CS_XBS5_ILP32_OFFBIG_LINTFLAGS; return 0;}
- #else /* def _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_CFLAGS)
- #ifdef _CS_XBS5_LP64_OFF64_CFLAGS
- {*r = _CS_XBS5_LP64_OFF64_CFLAGS; return 0;}
- #else /* def _CS_XBS5_LP64_OFF64_CFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_LP64_OFF64_CFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LDFLAGS)
- #ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
- {*r = _CS_XBS5_LP64_OFF64_LDFLAGS; return 0;}
- #else /* def _CS_XBS5_LP64_OFF64_LDFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_LP64_OFF64_LDFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LIBS)
- #ifdef _CS_XBS5_LP64_OFF64_LIBS
- {*r = _CS_XBS5_LP64_OFF64_LIBS; return 0;}
- #else /* def _CS_XBS5_LP64_OFF64_LIBS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_LP64_OFF64_LIBS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LINTFLAGS)
- #ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
- {*r = _CS_XBS5_LP64_OFF64_LINTFLAGS; return 0;}
- #else /* def _CS_XBS5_LP64_OFF64_LINTFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_LP64_OFF64_LINTFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_CFLAGS)
- #ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
- {*r = _CS_XBS5_LPBIG_OFFBIG_CFLAGS; return 0;}
- #else /* def _CS_XBS5_LPBIG_OFFBIG_CFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_CFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LDFLAGS)
- #ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
- {*r = _CS_XBS5_LPBIG_OFFBIG_LDFLAGS; return 0;}
- #else /* def _CS_XBS5_LPBIG_OFFBIG_LDFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LIBS)
- #ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
- {*r = _CS_XBS5_LPBIG_OFFBIG_LIBS; return 0;}
- #else /* def _CS_XBS5_LPBIG_OFFBIG_LIBS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LIBS */
- if (x == Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LINTFLAGS)
- #ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
- {*r = _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS; return 0;}
- #else /* def _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToConfstrName (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef _CS_GNU_LIBC_VERSION
- if (x == _CS_GNU_LIBC_VERSION)
- {*r = Mono_Posix_ConfstrName__CS_GNU_LIBC_VERSION; return 0;}
- #endif /* ndef _CS_GNU_LIBC_VERSION */
- #ifdef _CS_GNU_LIBPTHREAD_VERSION
- if (x == _CS_GNU_LIBPTHREAD_VERSION)
- {*r = Mono_Posix_ConfstrName__CS_GNU_LIBPTHREAD_VERSION; return 0;}
- #endif /* ndef _CS_GNU_LIBPTHREAD_VERSION */
- #ifdef _CS_LFS64_CFLAGS
- if (x == _CS_LFS64_CFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_LFS64_CFLAGS; return 0;}
- #endif /* ndef _CS_LFS64_CFLAGS */
- #ifdef _CS_LFS64_LDFLAGS
- if (x == _CS_LFS64_LDFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_LFS64_LDFLAGS; return 0;}
- #endif /* ndef _CS_LFS64_LDFLAGS */
- #ifdef _CS_LFS64_LIBS
- if (x == _CS_LFS64_LIBS)
- {*r = Mono_Posix_ConfstrName__CS_LFS64_LIBS; return 0;}
- #endif /* ndef _CS_LFS64_LIBS */
- #ifdef _CS_LFS64_LINTFLAGS
- if (x == _CS_LFS64_LINTFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_LFS64_LINTFLAGS; return 0;}
- #endif /* ndef _CS_LFS64_LINTFLAGS */
- #ifdef _CS_LFS_CFLAGS
- if (x == _CS_LFS_CFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_LFS_CFLAGS; return 0;}
- #endif /* ndef _CS_LFS_CFLAGS */
- #ifdef _CS_LFS_LDFLAGS
- if (x == _CS_LFS_LDFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_LFS_LDFLAGS; return 0;}
- #endif /* ndef _CS_LFS_LDFLAGS */
- #ifdef _CS_LFS_LIBS
- if (x == _CS_LFS_LIBS)
- {*r = Mono_Posix_ConfstrName__CS_LFS_LIBS; return 0;}
- #endif /* ndef _CS_LFS_LIBS */
- #ifdef _CS_LFS_LINTFLAGS
- if (x == _CS_LFS_LINTFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_LFS_LINTFLAGS; return 0;}
- #endif /* ndef _CS_LFS_LINTFLAGS */
- #ifdef _CS_PATH
- if (x == _CS_PATH)
- {*r = Mono_Posix_ConfstrName__CS_PATH; return 0;}
- #endif /* ndef _CS_PATH */
- #ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS
- if (x == _CS_POSIX_V6_ILP32_OFF32_CFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_CFLAGS; return 0;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
- #ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
- if (x == _CS_POSIX_V6_ILP32_OFF32_LDFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LDFLAGS; return 0;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
- #ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS
- if (x == _CS_POSIX_V6_ILP32_OFF32_LIBS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LIBS; return 0;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LIBS */
- #ifdef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
- if (x == _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS; return 0;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
- #ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
- if (x == _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS; return 0;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
- #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
- if (x == _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS; return 0;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
- #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS
- if (x == _CS_POSIX_V6_ILP32_OFFBIG_LIBS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LIBS; return 0;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
- #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
- if (x == _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS; return 0;}
- #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS */
- #ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS
- if (x == _CS_POSIX_V6_LP64_OFF64_CFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_CFLAGS; return 0;}
- #endif /* ndef _CS_POSIX_V6_LP64_OFF64_CFLAGS */
- #ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS
- if (x == _CS_POSIX_V6_LP64_OFF64_LDFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LDFLAGS; return 0;}
- #endif /* ndef _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
- #ifdef _CS_POSIX_V6_LP64_OFF64_LIBS
- if (x == _CS_POSIX_V6_LP64_OFF64_LIBS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LIBS; return 0;}
- #endif /* ndef _CS_POSIX_V6_LP64_OFF64_LIBS */
- #ifdef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
- if (x == _CS_POSIX_V6_LP64_OFF64_LINTFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LINTFLAGS; return 0;}
- #endif /* ndef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS */
- #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
- if (x == _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS; return 0;}
- #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
- #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
- if (x == _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS; return 0;}
- #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
- #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
- if (x == _CS_POSIX_V6_LPBIG_OFFBIG_LIBS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LIBS; return 0;}
- #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
- #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
- if (x == _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS; return 0;}
- #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS */
- #ifdef _CS_V6_WIDTH_RESTRICTED_ENVS
- if (x == _CS_V6_WIDTH_RESTRICTED_ENVS)
- {*r = Mono_Posix_ConfstrName__CS_V6_WIDTH_RESTRICTED_ENVS; return 0;}
- #endif /* ndef _CS_V6_WIDTH_RESTRICTED_ENVS */
- #ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
- if (x == _CS_XBS5_ILP32_OFF32_CFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_CFLAGS; return 0;}
- #endif /* ndef _CS_XBS5_ILP32_OFF32_CFLAGS */
- #ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
- if (x == _CS_XBS5_ILP32_OFF32_LDFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LDFLAGS; return 0;}
- #endif /* ndef _CS_XBS5_ILP32_OFF32_LDFLAGS */
- #ifdef _CS_XBS5_ILP32_OFF32_LIBS
- if (x == _CS_XBS5_ILP32_OFF32_LIBS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LIBS; return 0;}
- #endif /* ndef _CS_XBS5_ILP32_OFF32_LIBS */
- #ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
- if (x == _CS_XBS5_ILP32_OFF32_LINTFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LINTFLAGS; return 0;}
- #endif /* ndef _CS_XBS5_ILP32_OFF32_LINTFLAGS */
- #ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
- if (x == _CS_XBS5_ILP32_OFFBIG_CFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_CFLAGS; return 0;}
- #endif /* ndef _CS_XBS5_ILP32_OFFBIG_CFLAGS */
- #ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
- if (x == _CS_XBS5_ILP32_OFFBIG_LDFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LDFLAGS; return 0;}
- #endif /* ndef _CS_XBS5_ILP32_OFFBIG_LDFLAGS */
- #ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
- if (x == _CS_XBS5_ILP32_OFFBIG_LIBS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LIBS; return 0;}
- #endif /* ndef _CS_XBS5_ILP32_OFFBIG_LIBS */
- #ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
- if (x == _CS_XBS5_ILP32_OFFBIG_LINTFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LINTFLAGS; return 0;}
- #endif /* ndef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
- #ifdef _CS_XBS5_LP64_OFF64_CFLAGS
- if (x == _CS_XBS5_LP64_OFF64_CFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_CFLAGS; return 0;}
- #endif /* ndef _CS_XBS5_LP64_OFF64_CFLAGS */
- #ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
- if (x == _CS_XBS5_LP64_OFF64_LDFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LDFLAGS; return 0;}
- #endif /* ndef _CS_XBS5_LP64_OFF64_LDFLAGS */
- #ifdef _CS_XBS5_LP64_OFF64_LIBS
- if (x == _CS_XBS5_LP64_OFF64_LIBS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LIBS; return 0;}
- #endif /* ndef _CS_XBS5_LP64_OFF64_LIBS */
- #ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
- if (x == _CS_XBS5_LP64_OFF64_LINTFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LINTFLAGS; return 0;}
- #endif /* ndef _CS_XBS5_LP64_OFF64_LINTFLAGS */
- #ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
- if (x == _CS_XBS5_LPBIG_OFFBIG_CFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_CFLAGS; return 0;}
- #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_CFLAGS */
- #ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
- if (x == _CS_XBS5_LPBIG_OFFBIG_LDFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LDFLAGS; return 0;}
- #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS */
- #ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
- if (x == _CS_XBS5_LPBIG_OFFBIG_LIBS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LIBS; return 0;}
- #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LIBS */
- #ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
- if (x == _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS)
- {*r = Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LINTFLAGS; return 0;}
- #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromDirectoryNotifyFlags (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_DirectoryNotifyFlags_DN_ACCESS) == Mono_Posix_DirectoryNotifyFlags_DN_ACCESS)
- #ifdef DN_ACCESS
- *r |= DN_ACCESS;
- #else /* def DN_ACCESS */
- {errno = EINVAL; return -1;}
- #endif /* ndef DN_ACCESS */
- if ((x & Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB) == Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB)
- #ifdef DN_ATTRIB
- *r |= DN_ATTRIB;
- #else /* def DN_ATTRIB */
- {errno = EINVAL; return -1;}
- #endif /* ndef DN_ATTRIB */
- if ((x & Mono_Posix_DirectoryNotifyFlags_DN_CREATE) == Mono_Posix_DirectoryNotifyFlags_DN_CREATE)
- #ifdef DN_CREATE
- *r |= DN_CREATE;
- #else /* def DN_CREATE */
- {errno = EINVAL; return -1;}
- #endif /* ndef DN_CREATE */
- if ((x & Mono_Posix_DirectoryNotifyFlags_DN_DELETE) == Mono_Posix_DirectoryNotifyFlags_DN_DELETE)
- #ifdef DN_DELETE
- *r |= DN_DELETE;
- #else /* def DN_DELETE */
- {errno = EINVAL; return -1;}
- #endif /* ndef DN_DELETE */
- if ((x & Mono_Posix_DirectoryNotifyFlags_DN_MODIFY) == Mono_Posix_DirectoryNotifyFlags_DN_MODIFY)
- #ifdef DN_MODIFY
- *r |= DN_MODIFY;
- #else /* def DN_MODIFY */
- {errno = EINVAL; return -1;}
- #endif /* ndef DN_MODIFY */
- if ((x & Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT) == Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT)
- #ifdef DN_MULTISHOT
- *r |= DN_MULTISHOT;
- #else /* def DN_MULTISHOT */
- {errno = EINVAL; return -1;}
- #endif /* ndef DN_MULTISHOT */
- if ((x & Mono_Posix_DirectoryNotifyFlags_DN_RENAME) == Mono_Posix_DirectoryNotifyFlags_DN_RENAME)
- #ifdef DN_RENAME
- *r |= DN_RENAME;
- #else /* def DN_RENAME */
- {errno = EINVAL; return -1;}
- #endif /* ndef DN_RENAME */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToDirectoryNotifyFlags (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef DN_ACCESS
- if ((x & DN_ACCESS) == DN_ACCESS)
- *r |= Mono_Posix_DirectoryNotifyFlags_DN_ACCESS;
- #endif /* ndef DN_ACCESS */
- #ifdef DN_ATTRIB
- if ((x & DN_ATTRIB) == DN_ATTRIB)
- *r |= Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB;
- #endif /* ndef DN_ATTRIB */
- #ifdef DN_CREATE
- if ((x & DN_CREATE) == DN_CREATE)
- *r |= Mono_Posix_DirectoryNotifyFlags_DN_CREATE;
- #endif /* ndef DN_CREATE */
- #ifdef DN_DELETE
- if ((x & DN_DELETE) == DN_DELETE)
- *r |= Mono_Posix_DirectoryNotifyFlags_DN_DELETE;
- #endif /* ndef DN_DELETE */
- #ifdef DN_MODIFY
- if ((x & DN_MODIFY) == DN_MODIFY)
- *r |= Mono_Posix_DirectoryNotifyFlags_DN_MODIFY;
- #endif /* ndef DN_MODIFY */
- #ifdef DN_MULTISHOT
- if ((x & DN_MULTISHOT) == DN_MULTISHOT)
- *r |= Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT;
- #endif /* ndef DN_MULTISHOT */
- #ifdef DN_RENAME
- if ((x & DN_RENAME) == DN_RENAME)
- *r |= Mono_Posix_DirectoryNotifyFlags_DN_RENAME;
- #endif /* ndef DN_RENAME */
- return 0;
- }
- int Mono_Posix_FromEpollEvents (unsigned int x, unsigned int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_EpollEvents_EPOLLERR) == Mono_Posix_EpollEvents_EPOLLERR)
- #ifdef EPOLLERR
- *r |= EPOLLERR;
- #else /* def EPOLLERR */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLERR */
- if ((x & Mono_Posix_EpollEvents_EPOLLET) == Mono_Posix_EpollEvents_EPOLLET)
- #ifdef EPOLLET
- *r |= EPOLLET;
- #else /* def EPOLLET */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLET */
- if ((x & Mono_Posix_EpollEvents_EPOLLHUP) == Mono_Posix_EpollEvents_EPOLLHUP)
- #ifdef EPOLLHUP
- *r |= EPOLLHUP;
- #else /* def EPOLLHUP */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLHUP */
- if ((x & Mono_Posix_EpollEvents_EPOLLIN) == Mono_Posix_EpollEvents_EPOLLIN)
- #ifdef EPOLLIN
- *r |= EPOLLIN;
- #else /* def EPOLLIN */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLIN */
- if ((x & Mono_Posix_EpollEvents_EPOLLMSG) == Mono_Posix_EpollEvents_EPOLLMSG)
- #ifdef EPOLLMSG
- *r |= EPOLLMSG;
- #else /* def EPOLLMSG */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLMSG */
- if ((x & Mono_Posix_EpollEvents_EPOLLONESHOT) == Mono_Posix_EpollEvents_EPOLLONESHOT)
- #ifdef EPOLLONESHOT
- *r |= EPOLLONESHOT;
- #else /* def EPOLLONESHOT */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLONESHOT */
- if ((x & Mono_Posix_EpollEvents_EPOLLOUT) == Mono_Posix_EpollEvents_EPOLLOUT)
- #ifdef EPOLLOUT
- *r |= EPOLLOUT;
- #else /* def EPOLLOUT */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLOUT */
- if ((x & Mono_Posix_EpollEvents_EPOLLPRI) == Mono_Posix_EpollEvents_EPOLLPRI)
- #ifdef EPOLLPRI
- *r |= EPOLLPRI;
- #else /* def EPOLLPRI */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLPRI */
- if ((x & Mono_Posix_EpollEvents_EPOLLRDBAND) == Mono_Posix_EpollEvents_EPOLLRDBAND)
- #ifdef EPOLLRDBAND
- *r |= EPOLLRDBAND;
- #else /* def EPOLLRDBAND */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLRDBAND */
- if ((x & Mono_Posix_EpollEvents_EPOLLRDHUP) == Mono_Posix_EpollEvents_EPOLLRDHUP)
- #ifdef EPOLLRDHUP
- *r |= EPOLLRDHUP;
- #else /* def EPOLLRDHUP */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLRDHUP */
- if ((x & Mono_Posix_EpollEvents_EPOLLRDNORM) == Mono_Posix_EpollEvents_EPOLLRDNORM)
- #ifdef EPOLLRDNORM
- *r |= EPOLLRDNORM;
- #else /* def EPOLLRDNORM */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLRDNORM */
- if ((x & Mono_Posix_EpollEvents_EPOLLWRBAND) == Mono_Posix_EpollEvents_EPOLLWRBAND)
- #ifdef EPOLLWRBAND
- *r |= EPOLLWRBAND;
- #else /* def EPOLLWRBAND */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLWRBAND */
- if ((x & Mono_Posix_EpollEvents_EPOLLWRNORM) == Mono_Posix_EpollEvents_EPOLLWRNORM)
- #ifdef EPOLLWRNORM
- *r |= EPOLLWRNORM;
- #else /* def EPOLLWRNORM */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLLWRNORM */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToEpollEvents (unsigned int x, unsigned int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef EPOLLERR
- if ((x & EPOLLERR) == EPOLLERR)
- *r |= Mono_Posix_EpollEvents_EPOLLERR;
- #endif /* ndef EPOLLERR */
- #ifdef EPOLLET
- if ((x & EPOLLET) == EPOLLET)
- *r |= Mono_Posix_EpollEvents_EPOLLET;
- #endif /* ndef EPOLLET */
- #ifdef EPOLLHUP
- if ((x & EPOLLHUP) == EPOLLHUP)
- *r |= Mono_Posix_EpollEvents_EPOLLHUP;
- #endif /* ndef EPOLLHUP */
- #ifdef EPOLLIN
- if ((x & EPOLLIN) == EPOLLIN)
- *r |= Mono_Posix_EpollEvents_EPOLLIN;
- #endif /* ndef EPOLLIN */
- #ifdef EPOLLMSG
- if ((x & EPOLLMSG) == EPOLLMSG)
- *r |= Mono_Posix_EpollEvents_EPOLLMSG;
- #endif /* ndef EPOLLMSG */
- #ifdef EPOLLONESHOT
- if ((x & EPOLLONESHOT) == EPOLLONESHOT)
- *r |= Mono_Posix_EpollEvents_EPOLLONESHOT;
- #endif /* ndef EPOLLONESHOT */
- #ifdef EPOLLOUT
- if ((x & EPOLLOUT) == EPOLLOUT)
- *r |= Mono_Posix_EpollEvents_EPOLLOUT;
- #endif /* ndef EPOLLOUT */
- #ifdef EPOLLPRI
- if ((x & EPOLLPRI) == EPOLLPRI)
- *r |= Mono_Posix_EpollEvents_EPOLLPRI;
- #endif /* ndef EPOLLPRI */
- #ifdef EPOLLRDBAND
- if ((x & EPOLLRDBAND) == EPOLLRDBAND)
- *r |= Mono_Posix_EpollEvents_EPOLLRDBAND;
- #endif /* ndef EPOLLRDBAND */
- #ifdef EPOLLRDHUP
- if ((x & EPOLLRDHUP) == EPOLLRDHUP)
- *r |= Mono_Posix_EpollEvents_EPOLLRDHUP;
- #endif /* ndef EPOLLRDHUP */
- #ifdef EPOLLRDNORM
- if ((x & EPOLLRDNORM) == EPOLLRDNORM)
- *r |= Mono_Posix_EpollEvents_EPOLLRDNORM;
- #endif /* ndef EPOLLRDNORM */
- #ifdef EPOLLWRBAND
- if ((x & EPOLLWRBAND) == EPOLLWRBAND)
- *r |= Mono_Posix_EpollEvents_EPOLLWRBAND;
- #endif /* ndef EPOLLWRBAND */
- #ifdef EPOLLWRNORM
- if ((x & EPOLLWRNORM) == EPOLLWRNORM)
- *r |= Mono_Posix_EpollEvents_EPOLLWRNORM;
- #endif /* ndef EPOLLWRNORM */
- return 0;
- }
- int Mono_Posix_FromEpollFlags (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_EpollFlags_EPOLL_CLOEXEC) == Mono_Posix_EpollFlags_EPOLL_CLOEXEC)
- #ifdef EPOLL_CLOEXEC
- *r |= EPOLL_CLOEXEC;
- #else /* def EPOLL_CLOEXEC */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLL_CLOEXEC */
- if ((x & Mono_Posix_EpollFlags_EPOLL_NONBLOCK) == Mono_Posix_EpollFlags_EPOLL_NONBLOCK)
- #ifdef EPOLL_NONBLOCK
- *r |= EPOLL_NONBLOCK;
- #else /* def EPOLL_NONBLOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPOLL_NONBLOCK */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToEpollFlags (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef EPOLL_CLOEXEC
- if ((x & EPOLL_CLOEXEC) == EPOLL_CLOEXEC)
- *r |= Mono_Posix_EpollFlags_EPOLL_CLOEXEC;
- #endif /* ndef EPOLL_CLOEXEC */
- #ifdef EPOLL_NONBLOCK
- if ((x & EPOLL_NONBLOCK) == EPOLL_NONBLOCK)
- *r |= Mono_Posix_EpollFlags_EPOLL_NONBLOCK;
- #endif /* ndef EPOLL_NONBLOCK */
- return 0;
- }
- int Mono_Posix_FromErrno (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_Errno_E2BIG)
- #ifdef E2BIG
- {*r = E2BIG; return 0;}
- #else /* def E2BIG */
- {errno = EINVAL; return -1;}
- #endif /* ndef E2BIG */
- if (x == Mono_Posix_Errno_EACCES)
- #ifdef EACCES
- {*r = EACCES; return 0;}
- #else /* def EACCES */
- {errno = EINVAL; return -1;}
- #endif /* ndef EACCES */
- if (x == Mono_Posix_Errno_EADDRINUSE)
- #ifdef EADDRINUSE
- {*r = EADDRINUSE; return 0;}
- #else /* def EADDRINUSE */
- {errno = EINVAL; return -1;}
- #endif /* ndef EADDRINUSE */
- if (x == Mono_Posix_Errno_EADDRNOTAVAIL)
- #ifdef EADDRNOTAVAIL
- {*r = EADDRNOTAVAIL; return 0;}
- #else /* def EADDRNOTAVAIL */
- {errno = EINVAL; return -1;}
- #endif /* ndef EADDRNOTAVAIL */
- if (x == Mono_Posix_Errno_EADV)
- #ifdef EADV
- {*r = EADV; return 0;}
- #else /* def EADV */
- {errno = EINVAL; return -1;}
- #endif /* ndef EADV */
- if (x == Mono_Posix_Errno_EAFNOSUPPORT)
- #ifdef EAFNOSUPPORT
- {*r = EAFNOSUPPORT; return 0;}
- #else /* def EAFNOSUPPORT */
- {errno = EINVAL; return -1;}
- #endif /* ndef EAFNOSUPPORT */
- if (x == Mono_Posix_Errno_EAGAIN)
- #ifdef EAGAIN
- {*r = EAGAIN; return 0;}
- #else /* def EAGAIN */
- {errno = EINVAL; return -1;}
- #endif /* ndef EAGAIN */
- if (x == Mono_Posix_Errno_EALREADY)
- #ifdef EALREADY
- {*r = EALREADY; return 0;}
- #else /* def EALREADY */
- {errno = EINVAL; return -1;}
- #endif /* ndef EALREADY */
- if (x == Mono_Posix_Errno_EAUTH)
- #ifdef EAUTH
- {*r = EAUTH; return 0;}
- #else /* def EAUTH */
- {errno = EINVAL; return -1;}
- #endif /* ndef EAUTH */
- if (x == Mono_Posix_Errno_EBADARCH)
- #ifdef EBADARCH
- {*r = EBADARCH; return 0;}
- #else /* def EBADARCH */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBADARCH */
- if (x == Mono_Posix_Errno_EBADE)
- #ifdef EBADE
- {*r = EBADE; return 0;}
- #else /* def EBADE */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBADE */
- if (x == Mono_Posix_Errno_EBADEXEC)
- #ifdef EBADEXEC
- {*r = EBADEXEC; return 0;}
- #else /* def EBADEXEC */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBADEXEC */
- if (x == Mono_Posix_Errno_EBADF)
- #ifdef EBADF
- {*r = EBADF; return 0;}
- #else /* def EBADF */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBADF */
- if (x == Mono_Posix_Errno_EBADFD)
- #ifdef EBADFD
- {*r = EBADFD; return 0;}
- #else /* def EBADFD */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBADFD */
- if (x == Mono_Posix_Errno_EBADMACHO)
- #ifdef EBADMACHO
- {*r = EBADMACHO; return 0;}
- #else /* def EBADMACHO */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBADMACHO */
- if (x == Mono_Posix_Errno_EBADMSG)
- #ifdef EBADMSG
- {*r = EBADMSG; return 0;}
- #else /* def EBADMSG */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBADMSG */
- if (x == Mono_Posix_Errno_EBADR)
- #ifdef EBADR
- {*r = EBADR; return 0;}
- #else /* def EBADR */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBADR */
- if (x == Mono_Posix_Errno_EBADRPC)
- #ifdef EBADRPC
- {*r = EBADRPC; return 0;}
- #else /* def EBADRPC */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBADRPC */
- if (x == Mono_Posix_Errno_EBADRQC)
- #ifdef EBADRQC
- {*r = EBADRQC; return 0;}
- #else /* def EBADRQC */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBADRQC */
- if (x == Mono_Posix_Errno_EBADSLT)
- #ifdef EBADSLT
- {*r = EBADSLT; return 0;}
- #else /* def EBADSLT */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBADSLT */
- if (x == Mono_Posix_Errno_EBFONT)
- #ifdef EBFONT
- {*r = EBFONT; return 0;}
- #else /* def EBFONT */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBFONT */
- if (x == Mono_Posix_Errno_EBUSY)
- #ifdef EBUSY
- {*r = EBUSY; return 0;}
- #else /* def EBUSY */
- {errno = EINVAL; return -1;}
- #endif /* ndef EBUSY */
- if (x == Mono_Posix_Errno_ECANCELED)
- #ifdef ECANCELED
- {*r = ECANCELED; return 0;}
- #else /* def ECANCELED */
- {errno = EINVAL; return -1;}
- #endif /* ndef ECANCELED */
- if (x == Mono_Posix_Errno_ECHILD)
- #ifdef ECHILD
- {*r = ECHILD; return 0;}
- #else /* def ECHILD */
- {errno = EINVAL; return -1;}
- #endif /* ndef ECHILD */
- if (x == Mono_Posix_Errno_ECHRNG)
- #ifdef ECHRNG
- {*r = ECHRNG; return 0;}
- #else /* def ECHRNG */
- {errno = EINVAL; return -1;}
- #endif /* ndef ECHRNG */
- if (x == Mono_Posix_Errno_ECOMM)
- #ifdef ECOMM
- {*r = ECOMM; return 0;}
- #else /* def ECOMM */
- {errno = EINVAL; return -1;}
- #endif /* ndef ECOMM */
- if (x == Mono_Posix_Errno_ECONNABORTED)
- #ifdef ECONNABORTED
- {*r = ECONNABORTED; return 0;}
- #else /* def ECONNABORTED */
- {errno = EINVAL; return -1;}
- #endif /* ndef ECONNABORTED */
- if (x == Mono_Posix_Errno_ECONNREFUSED)
- #ifdef ECONNREFUSED
- {*r = ECONNREFUSED; return 0;}
- #else /* def ECONNREFUSED */
- {errno = EINVAL; return -1;}
- #endif /* ndef ECONNREFUSED */
- if (x == Mono_Posix_Errno_ECONNRESET)
- #ifdef ECONNRESET
- {*r = ECONNRESET; return 0;}
- #else /* def ECONNRESET */
- {errno = EINVAL; return -1;}
- #endif /* ndef ECONNRESET */
- if (x == Mono_Posix_Errno_EDEADLK)
- #ifdef EDEADLK
- {*r = EDEADLK; return 0;}
- #else /* def EDEADLK */
- {errno = EINVAL; return -1;}
- #endif /* ndef EDEADLK */
- if (x == Mono_Posix_Errno_EDEADLOCK)
- #ifdef EDEADLOCK
- {*r = EDEADLOCK; return 0;}
- #else /* def EDEADLOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef EDEADLOCK */
- if (x == Mono_Posix_Errno_EDESTADDRREQ)
- #ifdef EDESTADDRREQ
- {*r = EDESTADDRREQ; return 0;}
- #else /* def EDESTADDRREQ */
- {errno = EINVAL; return -1;}
- #endif /* ndef EDESTADDRREQ */
- if (x == Mono_Posix_Errno_EDEVERR)
- #ifdef EDEVERR
- {*r = EDEVERR; return 0;}
- #else /* def EDEVERR */
- {errno = EINVAL; return -1;}
- #endif /* ndef EDEVERR */
- if (x == Mono_Posix_Errno_EDOM)
- #ifdef EDOM
- {*r = EDOM; return 0;}
- #else /* def EDOM */
- {errno = EINVAL; return -1;}
- #endif /* ndef EDOM */
- if (x == Mono_Posix_Errno_EDOTDOT)
- #ifdef EDOTDOT
- {*r = EDOTDOT; return 0;}
- #else /* def EDOTDOT */
- {errno = EINVAL; return -1;}
- #endif /* ndef EDOTDOT */
- if (x == Mono_Posix_Errno_EDQUOT)
- #ifdef EDQUOT
- {*r = EDQUOT; return 0;}
- #else /* def EDQUOT */
- {errno = EINVAL; return -1;}
- #endif /* ndef EDQUOT */
- if (x == Mono_Posix_Errno_EEXIST)
- #ifdef EEXIST
- {*r = EEXIST; return 0;}
- #else /* def EEXIST */
- {errno = EINVAL; return -1;}
- #endif /* ndef EEXIST */
- if (x == Mono_Posix_Errno_EFAULT)
- #ifdef EFAULT
- {*r = EFAULT; return 0;}
- #else /* def EFAULT */
- {errno = EINVAL; return -1;}
- #endif /* ndef EFAULT */
- if (x == Mono_Posix_Errno_EFBIG)
- #ifdef EFBIG
- {*r = EFBIG; return 0;}
- #else /* def EFBIG */
- {errno = EINVAL; return -1;}
- #endif /* ndef EFBIG */
- if (x == Mono_Posix_Errno_EFTYPE)
- #ifdef EFTYPE
- {*r = EFTYPE; return 0;}
- #else /* def EFTYPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef EFTYPE */
- if (x == Mono_Posix_Errno_EHOSTDOWN)
- #ifdef EHOSTDOWN
- {*r = EHOSTDOWN; return 0;}
- #else /* def EHOSTDOWN */
- {errno = EINVAL; return -1;}
- #endif /* ndef EHOSTDOWN */
- if (x == Mono_Posix_Errno_EHOSTUNREACH)
- #ifdef EHOSTUNREACH
- {*r = EHOSTUNREACH; return 0;}
- #else /* def EHOSTUNREACH */
- {errno = EINVAL; return -1;}
- #endif /* ndef EHOSTUNREACH */
- if (x == Mono_Posix_Errno_EIDRM)
- #ifdef EIDRM
- {*r = EIDRM; return 0;}
- #else /* def EIDRM */
- {errno = EINVAL; return -1;}
- #endif /* ndef EIDRM */
- if (x == Mono_Posix_Errno_EILSEQ)
- #ifdef EILSEQ
- {*r = EILSEQ; return 0;}
- #else /* def EILSEQ */
- {errno = EINVAL; return -1;}
- #endif /* ndef EILSEQ */
- if (x == Mono_Posix_Errno_EINPROGRESS)
- #ifdef EINPROGRESS
- {*r = EINPROGRESS; return 0;}
- #else /* def EINPROGRESS */
- {errno = EINVAL; return -1;}
- #endif /* ndef EINPROGRESS */
- if (x == Mono_Posix_Errno_EINTR)
- #ifdef EINTR
- {*r = EINTR; return 0;}
- #else /* def EINTR */
- {errno = EINVAL; return -1;}
- #endif /* ndef EINTR */
- if (x == Mono_Posix_Errno_EINVAL)
- #ifdef EINVAL
- {*r = EINVAL; return 0;}
- #else /* def EINVAL */
- {errno = EINVAL; return -1;}
- #endif /* ndef EINVAL */
- if (x == Mono_Posix_Errno_EIO)
- #ifdef EIO
- {*r = EIO; return 0;}
- #else /* def EIO */
- {errno = EINVAL; return -1;}
- #endif /* ndef EIO */
- if (x == Mono_Posix_Errno_EISCONN)
- #ifdef EISCONN
- {*r = EISCONN; return 0;}
- #else /* def EISCONN */
- {errno = EINVAL; return -1;}
- #endif /* ndef EISCONN */
- if (x == Mono_Posix_Errno_EISDIR)
- #ifdef EISDIR
- {*r = EISDIR; return 0;}
- #else /* def EISDIR */
- {errno = EINVAL; return -1;}
- #endif /* ndef EISDIR */
- if (x == Mono_Posix_Errno_EISNAM)
- #ifdef EISNAM
- {*r = EISNAM; return 0;}
- #else /* def EISNAM */
- {errno = EINVAL; return -1;}
- #endif /* ndef EISNAM */
- if (x == Mono_Posix_Errno_EKEYEXPIRED)
- #ifdef EKEYEXPIRED
- {*r = EKEYEXPIRED; return 0;}
- #else /* def EKEYEXPIRED */
- {errno = EINVAL; return -1;}
- #endif /* ndef EKEYEXPIRED */
- if (x == Mono_Posix_Errno_EKEYREJECTED)
- #ifdef EKEYREJECTED
- {*r = EKEYREJECTED; return 0;}
- #else /* def EKEYREJECTED */
- {errno = EINVAL; return -1;}
- #endif /* ndef EKEYREJECTED */
- if (x == Mono_Posix_Errno_EKEYREVOKED)
- #ifdef EKEYREVOKED
- {*r = EKEYREVOKED; return 0;}
- #else /* def EKEYREVOKED */
- {errno = EINVAL; return -1;}
- #endif /* ndef EKEYREVOKED */
- if (x == Mono_Posix_Errno_EL2HLT)
- #ifdef EL2HLT
- {*r = EL2HLT; return 0;}
- #else /* def EL2HLT */
- {errno = EINVAL; return -1;}
- #endif /* ndef EL2HLT */
- if (x == Mono_Posix_Errno_EL2NSYNC)
- #ifdef EL2NSYNC
- {*r = EL2NSYNC; return 0;}
- #else /* def EL2NSYNC */
- {errno = EINVAL; return -1;}
- #endif /* ndef EL2NSYNC */
- if (x == Mono_Posix_Errno_EL3HLT)
- #ifdef EL3HLT
- {*r = EL3HLT; return 0;}
- #else /* def EL3HLT */
- {errno = EINVAL; return -1;}
- #endif /* ndef EL3HLT */
- if (x == Mono_Posix_Errno_EL3RST)
- #ifdef EL3RST
- {*r = EL3RST; return 0;}
- #else /* def EL3RST */
- {errno = EINVAL; return -1;}
- #endif /* ndef EL3RST */
- if (x == Mono_Posix_Errno_ELIBACC)
- #ifdef ELIBACC
- {*r = ELIBACC; return 0;}
- #else /* def ELIBACC */
- {errno = EINVAL; return -1;}
- #endif /* ndef ELIBACC */
- if (x == Mono_Posix_Errno_ELIBBAD)
- #ifdef ELIBBAD
- {*r = ELIBBAD; return 0;}
- #else /* def ELIBBAD */
- {errno = EINVAL; return -1;}
- #endif /* ndef ELIBBAD */
- if (x == Mono_Posix_Errno_ELIBEXEC)
- #ifdef ELIBEXEC
- {*r = ELIBEXEC; return 0;}
- #else /* def ELIBEXEC */
- {errno = EINVAL; return -1;}
- #endif /* ndef ELIBEXEC */
- if (x == Mono_Posix_Errno_ELIBMAX)
- #ifdef ELIBMAX
- {*r = ELIBMAX; return 0;}
- #else /* def ELIBMAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef ELIBMAX */
- if (x == Mono_Posix_Errno_ELIBSCN)
- #ifdef ELIBSCN
- {*r = ELIBSCN; return 0;}
- #else /* def ELIBSCN */
- {errno = EINVAL; return -1;}
- #endif /* ndef ELIBSCN */
- if (x == Mono_Posix_Errno_ELNRNG)
- #ifdef ELNRNG
- {*r = ELNRNG; return 0;}
- #else /* def ELNRNG */
- {errno = EINVAL; return -1;}
- #endif /* ndef ELNRNG */
- if (x == Mono_Posix_Errno_ELOOP)
- #ifdef ELOOP
- {*r = ELOOP; return 0;}
- #else /* def ELOOP */
- {errno = EINVAL; return -1;}
- #endif /* ndef ELOOP */
- if (x == Mono_Posix_Errno_EMEDIUMTYPE)
- #ifdef EMEDIUMTYPE
- {*r = EMEDIUMTYPE; return 0;}
- #else /* def EMEDIUMTYPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef EMEDIUMTYPE */
- if (x == Mono_Posix_Errno_EMFILE)
- #ifdef EMFILE
- {*r = EMFILE; return 0;}
- #else /* def EMFILE */
- {errno = EINVAL; return -1;}
- #endif /* ndef EMFILE */
- if (x == Mono_Posix_Errno_EMLINK)
- #ifdef EMLINK
- {*r = EMLINK; return 0;}
- #else /* def EMLINK */
- {errno = EINVAL; return -1;}
- #endif /* ndef EMLINK */
- if (x == Mono_Posix_Errno_EMSGSIZE)
- #ifdef EMSGSIZE
- {*r = EMSGSIZE; return 0;}
- #else /* def EMSGSIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef EMSGSIZE */
- if (x == Mono_Posix_Errno_EMULTIHOP)
- #ifdef EMULTIHOP
- {*r = EMULTIHOP; return 0;}
- #else /* def EMULTIHOP */
- {errno = EINVAL; return -1;}
- #endif /* ndef EMULTIHOP */
- if (x == Mono_Posix_Errno_ENAMETOOLONG)
- #ifdef ENAMETOOLONG
- {*r = ENAMETOOLONG; return 0;}
- #else /* def ENAMETOOLONG */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENAMETOOLONG */
- if (x == Mono_Posix_Errno_ENAVAIL)
- #ifdef ENAVAIL
- {*r = ENAVAIL; return 0;}
- #else /* def ENAVAIL */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENAVAIL */
- if (x == Mono_Posix_Errno_ENEEDAUTH)
- #ifdef ENEEDAUTH
- {*r = ENEEDAUTH; return 0;}
- #else /* def ENEEDAUTH */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENEEDAUTH */
- if (x == Mono_Posix_Errno_ENETDOWN)
- #ifdef ENETDOWN
- {*r = ENETDOWN; return 0;}
- #else /* def ENETDOWN */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENETDOWN */
- if (x == Mono_Posix_Errno_ENETRESET)
- #ifdef ENETRESET
- {*r = ENETRESET; return 0;}
- #else /* def ENETRESET */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENETRESET */
- if (x == Mono_Posix_Errno_ENETUNREACH)
- #ifdef ENETUNREACH
- {*r = ENETUNREACH; return 0;}
- #else /* def ENETUNREACH */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENETUNREACH */
- if (x == Mono_Posix_Errno_ENFILE)
- #ifdef ENFILE
- {*r = ENFILE; return 0;}
- #else /* def ENFILE */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENFILE */
- if (x == Mono_Posix_Errno_ENOANO)
- #ifdef ENOANO
- {*r = ENOANO; return 0;}
- #else /* def ENOANO */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOANO */
- if (x == Mono_Posix_Errno_ENOATTR)
- #ifdef ENOATTR
- {*r = ENOATTR; return 0;}
- #else /* def ENOATTR */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOATTR */
- if (x == Mono_Posix_Errno_ENOBUFS)
- #ifdef ENOBUFS
- {*r = ENOBUFS; return 0;}
- #else /* def ENOBUFS */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOBUFS */
- if (x == Mono_Posix_Errno_ENOCSI)
- #ifdef ENOCSI
- {*r = ENOCSI; return 0;}
- #else /* def ENOCSI */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOCSI */
- if (x == Mono_Posix_Errno_ENODATA)
- #ifdef ENODATA
- {*r = ENODATA; return 0;}
- #else /* def ENODATA */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENODATA */
- if (x == Mono_Posix_Errno_ENODEV)
- #ifdef ENODEV
- {*r = ENODEV; return 0;}
- #else /* def ENODEV */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENODEV */
- if (x == Mono_Posix_Errno_ENOENT)
- #ifdef ENOENT
- {*r = ENOENT; return 0;}
- #else /* def ENOENT */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOENT */
- if (x == Mono_Posix_Errno_ENOEXEC)
- #ifdef ENOEXEC
- {*r = ENOEXEC; return 0;}
- #else /* def ENOEXEC */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOEXEC */
- if (x == Mono_Posix_Errno_ENOKEY)
- #ifdef ENOKEY
- {*r = ENOKEY; return 0;}
- #else /* def ENOKEY */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOKEY */
- if (x == Mono_Posix_Errno_ENOLCK)
- #ifdef ENOLCK
- {*r = ENOLCK; return 0;}
- #else /* def ENOLCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOLCK */
- if (x == Mono_Posix_Errno_ENOLINK)
- #ifdef ENOLINK
- {*r = ENOLINK; return 0;}
- #else /* def ENOLINK */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOLINK */
- if (x == Mono_Posix_Errno_ENOMEDIUM)
- #ifdef ENOMEDIUM
- {*r = ENOMEDIUM; return 0;}
- #else /* def ENOMEDIUM */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOMEDIUM */
- if (x == Mono_Posix_Errno_ENOMEM)
- #ifdef ENOMEM
- {*r = ENOMEM; return 0;}
- #else /* def ENOMEM */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOMEM */
- if (x == Mono_Posix_Errno_ENOMSG)
- #ifdef ENOMSG
- {*r = ENOMSG; return 0;}
- #else /* def ENOMSG */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOMSG */
- if (x == Mono_Posix_Errno_ENONET)
- #ifdef ENONET
- {*r = ENONET; return 0;}
- #else /* def ENONET */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENONET */
- if (x == Mono_Posix_Errno_ENOPKG)
- #ifdef ENOPKG
- {*r = ENOPKG; return 0;}
- #else /* def ENOPKG */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOPKG */
- if (x == Mono_Posix_Errno_ENOPOLICY)
- #ifdef ENOPOLICY
- {*r = ENOPOLICY; return 0;}
- #else /* def ENOPOLICY */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOPOLICY */
- if (x == Mono_Posix_Errno_ENOPROTOOPT)
- #ifdef ENOPROTOOPT
- {*r = ENOPROTOOPT; return 0;}
- #else /* def ENOPROTOOPT */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOPROTOOPT */
- if (x == Mono_Posix_Errno_ENOSPC)
- #ifdef ENOSPC
- {*r = ENOSPC; return 0;}
- #else /* def ENOSPC */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOSPC */
- if (x == Mono_Posix_Errno_ENOSR)
- #ifdef ENOSR
- {*r = ENOSR; return 0;}
- #else /* def ENOSR */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOSR */
- if (x == Mono_Posix_Errno_ENOSTR)
- #ifdef ENOSTR
- {*r = ENOSTR; return 0;}
- #else /* def ENOSTR */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOSTR */
- if (x == Mono_Posix_Errno_ENOSYS)
- #ifdef ENOSYS
- {*r = ENOSYS; return 0;}
- #else /* def ENOSYS */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOSYS */
- if (x == Mono_Posix_Errno_ENOTBLK)
- #ifdef ENOTBLK
- {*r = ENOTBLK; return 0;}
- #else /* def ENOTBLK */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOTBLK */
- if (x == Mono_Posix_Errno_ENOTCONN)
- #ifdef ENOTCONN
- {*r = ENOTCONN; return 0;}
- #else /* def ENOTCONN */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOTCONN */
- if (x == Mono_Posix_Errno_ENOTDIR)
- #ifdef ENOTDIR
- {*r = ENOTDIR; return 0;}
- #else /* def ENOTDIR */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOTDIR */
- if (x == Mono_Posix_Errno_ENOTEMPTY)
- #ifdef ENOTEMPTY
- {*r = ENOTEMPTY; return 0;}
- #else /* def ENOTEMPTY */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOTEMPTY */
- if (x == Mono_Posix_Errno_ENOTNAM)
- #ifdef ENOTNAM
- {*r = ENOTNAM; return 0;}
- #else /* def ENOTNAM */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOTNAM */
- if (x == Mono_Posix_Errno_ENOTRECOVERABLE)
- #ifdef ENOTRECOVERABLE
- {*r = ENOTRECOVERABLE; return 0;}
- #else /* def ENOTRECOVERABLE */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOTRECOVERABLE */
- if (x == Mono_Posix_Errno_ENOTSOCK)
- #ifdef ENOTSOCK
- {*r = ENOTSOCK; return 0;}
- #else /* def ENOTSOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOTSOCK */
- if (x == Mono_Posix_Errno_ENOTTY)
- #ifdef ENOTTY
- {*r = ENOTTY; return 0;}
- #else /* def ENOTTY */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOTTY */
- if (x == Mono_Posix_Errno_ENOTUNIQ)
- #ifdef ENOTUNIQ
- {*r = ENOTUNIQ; return 0;}
- #else /* def ENOTUNIQ */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENOTUNIQ */
- if (x == Mono_Posix_Errno_ENXIO)
- #ifdef ENXIO
- {*r = ENXIO; return 0;}
- #else /* def ENXIO */
- {errno = EINVAL; return -1;}
- #endif /* ndef ENXIO */
- if (x == Mono_Posix_Errno_EOPNOTSUPP)
- #ifdef EOPNOTSUPP
- {*r = EOPNOTSUPP; return 0;}
- #else /* def EOPNOTSUPP */
- {errno = EINVAL; return -1;}
- #endif /* ndef EOPNOTSUPP */
- if (x == Mono_Posix_Errno_EOVERFLOW)
- #ifdef EOVERFLOW
- {*r = EOVERFLOW; return 0;}
- #else /* def EOVERFLOW */
- {errno = EINVAL; return -1;}
- #endif /* ndef EOVERFLOW */
- if (x == Mono_Posix_Errno_EOWNERDEAD)
- #ifdef EOWNERDEAD
- {*r = EOWNERDEAD; return 0;}
- #else /* def EOWNERDEAD */
- {errno = EINVAL; return -1;}
- #endif /* ndef EOWNERDEAD */
- if (x == Mono_Posix_Errno_EPERM)
- #ifdef EPERM
- {*r = EPERM; return 0;}
- #else /* def EPERM */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPERM */
- if (x == Mono_Posix_Errno_EPFNOSUPPORT)
- #ifdef EPFNOSUPPORT
- {*r = EPFNOSUPPORT; return 0;}
- #else /* def EPFNOSUPPORT */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPFNOSUPPORT */
- if (x == Mono_Posix_Errno_EPIPE)
- #ifdef EPIPE
- {*r = EPIPE; return 0;}
- #else /* def EPIPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPIPE */
- if (x == Mono_Posix_Errno_EPROCLIM)
- #ifdef EPROCLIM
- {*r = EPROCLIM; return 0;}
- #else /* def EPROCLIM */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPROCLIM */
- if (x == Mono_Posix_Errno_EPROCUNAVAIL)
- #ifdef EPROCUNAVAIL
- {*r = EPROCUNAVAIL; return 0;}
- #else /* def EPROCUNAVAIL */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPROCUNAVAIL */
- if (x == Mono_Posix_Errno_EPROGMISMATCH)
- #ifdef EPROGMISMATCH
- {*r = EPROGMISMATCH; return 0;}
- #else /* def EPROGMISMATCH */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPROGMISMATCH */
- if (x == Mono_Posix_Errno_EPROGUNAVAIL)
- #ifdef EPROGUNAVAIL
- {*r = EPROGUNAVAIL; return 0;}
- #else /* def EPROGUNAVAIL */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPROGUNAVAIL */
- if (x == Mono_Posix_Errno_EPROTO)
- #ifdef EPROTO
- {*r = EPROTO; return 0;}
- #else /* def EPROTO */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPROTO */
- if (x == Mono_Posix_Errno_EPROTONOSUPPORT)
- #ifdef EPROTONOSUPPORT
- {*r = EPROTONOSUPPORT; return 0;}
- #else /* def EPROTONOSUPPORT */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPROTONOSUPPORT */
- if (x == Mono_Posix_Errno_EPROTOTYPE)
- #ifdef EPROTOTYPE
- {*r = EPROTOTYPE; return 0;}
- #else /* def EPROTOTYPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPROTOTYPE */
- if (x == Mono_Posix_Errno_EPWROFF)
- #ifdef EPWROFF
- {*r = EPWROFF; return 0;}
- #else /* def EPWROFF */
- {errno = EINVAL; return -1;}
- #endif /* ndef EPWROFF */
- if (x == Mono_Posix_Errno_ERANGE)
- #ifdef ERANGE
- {*r = ERANGE; return 0;}
- #else /* def ERANGE */
- {errno = EINVAL; return -1;}
- #endif /* ndef ERANGE */
- if (x == Mono_Posix_Errno_EREMCHG)
- #ifdef EREMCHG
- {*r = EREMCHG; return 0;}
- #else /* def EREMCHG */
- {errno = EINVAL; return -1;}
- #endif /* ndef EREMCHG */
- if (x == Mono_Posix_Errno_EREMOTE)
- #ifdef EREMOTE
- {*r = EREMOTE; return 0;}
- #else /* def EREMOTE */
- {errno = EINVAL; return -1;}
- #endif /* ndef EREMOTE */
- if (x == Mono_Posix_Errno_EREMOTEIO)
- #ifdef EREMOTEIO
- {*r = EREMOTEIO; return 0;}
- #else /* def EREMOTEIO */
- {errno = EINVAL; return -1;}
- #endif /* ndef EREMOTEIO */
- if (x == Mono_Posix_Errno_ERESTART)
- #ifdef ERESTART
- {*r = ERESTART; return 0;}
- #else /* def ERESTART */
- {errno = EINVAL; return -1;}
- #endif /* ndef ERESTART */
- if (x == Mono_Posix_Errno_EROFS)
- #ifdef EROFS
- {*r = EROFS; return 0;}
- #else /* def EROFS */
- {errno = EINVAL; return -1;}
- #endif /* ndef EROFS */
- if (x == Mono_Posix_Errno_ERPCMISMATCH)
- #ifdef ERPCMISMATCH
- {*r = ERPCMISMATCH; return 0;}
- #else /* def ERPCMISMATCH */
- {errno = EINVAL; return -1;}
- #endif /* ndef ERPCMISMATCH */
- if (x == Mono_Posix_Errno_ESHLIBVERS)
- #ifdef ESHLIBVERS
- {*r = ESHLIBVERS; return 0;}
- #else /* def ESHLIBVERS */
- {errno = EINVAL; return -1;}
- #endif /* ndef ESHLIBVERS */
- if (x == Mono_Posix_Errno_ESHUTDOWN)
- #ifdef ESHUTDOWN
- {*r = ESHUTDOWN; return 0;}
- #else /* def ESHUTDOWN */
- {errno = EINVAL; return -1;}
- #endif /* ndef ESHUTDOWN */
- if (x == Mono_Posix_Errno_ESOCKTNOSUPPORT)
- #ifdef ESOCKTNOSUPPORT
- {*r = ESOCKTNOSUPPORT; return 0;}
- #else /* def ESOCKTNOSUPPORT */
- {errno = EINVAL; return -1;}
- #endif /* ndef ESOCKTNOSUPPORT */
- if (x == Mono_Posix_Errno_ESPIPE)
- #ifdef ESPIPE
- {*r = ESPIPE; return 0;}
- #else /* def ESPIPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef ESPIPE */
- if (x == Mono_Posix_Errno_ESRCH)
- #ifdef ESRCH
- {*r = ESRCH; return 0;}
- #else /* def ESRCH */
- {errno = EINVAL; return -1;}
- #endif /* ndef ESRCH */
- if (x == Mono_Posix_Errno_ESRMNT)
- #ifdef ESRMNT
- {*r = ESRMNT; return 0;}
- #else /* def ESRMNT */
- {errno = EINVAL; return -1;}
- #endif /* ndef ESRMNT */
- if (x == Mono_Posix_Errno_ESTALE)
- #ifdef ESTALE
- {*r = ESTALE; return 0;}
- #else /* def ESTALE */
- {errno = EINVAL; return -1;}
- #endif /* ndef ESTALE */
- if (x == Mono_Posix_Errno_ESTRPIPE)
- #ifdef ESTRPIPE
- {*r = ESTRPIPE; return 0;}
- #else /* def ESTRPIPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef ESTRPIPE */
- if (x == Mono_Posix_Errno_ETIME)
- #ifdef ETIME
- {*r = ETIME; return 0;}
- #else /* def ETIME */
- {errno = EINVAL; return -1;}
- #endif /* ndef ETIME */
- if (x == Mono_Posix_Errno_ETIMEDOUT)
- #ifdef ETIMEDOUT
- {*r = ETIMEDOUT; return 0;}
- #else /* def ETIMEDOUT */
- {errno = EINVAL; return -1;}
- #endif /* ndef ETIMEDOUT */
- if (x == Mono_Posix_Errno_ETOOMANYREFS)
- #ifdef ETOOMANYREFS
- {*r = ETOOMANYREFS; return 0;}
- #else /* def ETOOMANYREFS */
- {errno = EINVAL; return -1;}
- #endif /* ndef ETOOMANYREFS */
- if (x == Mono_Posix_Errno_ETXTBSY)
- #ifdef ETXTBSY
- {*r = ETXTBSY; return 0;}
- #else /* def ETXTBSY */
- {errno = EINVAL; return -1;}
- #endif /* ndef ETXTBSY */
- if (x == Mono_Posix_Errno_EUCLEAN)
- #ifdef EUCLEAN
- {*r = EUCLEAN; return 0;}
- #else /* def EUCLEAN */
- {errno = EINVAL; return -1;}
- #endif /* ndef EUCLEAN */
- if (x == Mono_Posix_Errno_EUNATCH)
- #ifdef EUNATCH
- {*r = EUNATCH; return 0;}
- #else /* def EUNATCH */
- {errno = EINVAL; return -1;}
- #endif /* ndef EUNATCH */
- if (x == Mono_Posix_Errno_EUSERS)
- #ifdef EUSERS
- {*r = EUSERS; return 0;}
- #else /* def EUSERS */
- {errno = EINVAL; return -1;}
- #endif /* ndef EUSERS */
- if (x == Mono_Posix_Errno_EWOULDBLOCK)
- #ifdef EWOULDBLOCK
- {*r = EWOULDBLOCK; return 0;}
- #else /* def EWOULDBLOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef EWOULDBLOCK */
- if (x == Mono_Posix_Errno_EXDEV)
- #ifdef EXDEV
- {*r = EXDEV; return 0;}
- #else /* def EXDEV */
- {errno = EINVAL; return -1;}
- #endif /* ndef EXDEV */
- if (x == Mono_Posix_Errno_EXFULL)
- #ifdef EXFULL
- {*r = EXFULL; return 0;}
- #else /* def EXFULL */
- {errno = EINVAL; return -1;}
- #endif /* ndef EXFULL */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToErrno (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef E2BIG
- if (x == E2BIG)
- {*r = Mono_Posix_Errno_E2BIG; return 0;}
- #endif /* ndef E2BIG */
- #ifdef EACCES
- if (x == EACCES)
- {*r = Mono_Posix_Errno_EACCES; return 0;}
- #endif /* ndef EACCES */
- #ifdef EADDRINUSE
- if (x == EADDRINUSE)
- {*r = Mono_Posix_Errno_EADDRINUSE; return 0;}
- #endif /* ndef EADDRINUSE */
- #ifdef EADDRNOTAVAIL
- if (x == EADDRNOTAVAIL)
- {*r = Mono_Posix_Errno_EADDRNOTAVAIL; return 0;}
- #endif /* ndef EADDRNOTAVAIL */
- #ifdef EADV
- if (x == EADV)
- {*r = Mono_Posix_Errno_EADV; return 0;}
- #endif /* ndef EADV */
- #ifdef EAFNOSUPPORT
- if (x == EAFNOSUPPORT)
- {*r = Mono_Posix_Errno_EAFNOSUPPORT; return 0;}
- #endif /* ndef EAFNOSUPPORT */
- #ifdef EAGAIN
- if (x == EAGAIN)
- {*r = Mono_Posix_Errno_EAGAIN; return 0;}
- #endif /* ndef EAGAIN */
- #ifdef EALREADY
- if (x == EALREADY)
- {*r = Mono_Posix_Errno_EALREADY; return 0;}
- #endif /* ndef EALREADY */
- #ifdef EAUTH
- if (x == EAUTH)
- {*r = Mono_Posix_Errno_EAUTH; return 0;}
- #endif /* ndef EAUTH */
- #ifdef EBADARCH
- if (x == EBADARCH)
- {*r = Mono_Posix_Errno_EBADARCH; return 0;}
- #endif /* ndef EBADARCH */
- #ifdef EBADE
- if (x == EBADE)
- {*r = Mono_Posix_Errno_EBADE; return 0;}
- #endif /* ndef EBADE */
- #ifdef EBADEXEC
- if (x == EBADEXEC)
- {*r = Mono_Posix_Errno_EBADEXEC; return 0;}
- #endif /* ndef EBADEXEC */
- #ifdef EBADF
- if (x == EBADF)
- {*r = Mono_Posix_Errno_EBADF; return 0;}
- #endif /* ndef EBADF */
- #ifdef EBADFD
- if (x == EBADFD)
- {*r = Mono_Posix_Errno_EBADFD; return 0;}
- #endif /* ndef EBADFD */
- #ifdef EBADMACHO
- if (x == EBADMACHO)
- {*r = Mono_Posix_Errno_EBADMACHO; return 0;}
- #endif /* ndef EBADMACHO */
- #ifdef EBADMSG
- if (x == EBADMSG)
- {*r = Mono_Posix_Errno_EBADMSG; return 0;}
- #endif /* ndef EBADMSG */
- #ifdef EBADR
- if (x == EBADR)
- {*r = Mono_Posix_Errno_EBADR; return 0;}
- #endif /* ndef EBADR */
- #ifdef EBADRPC
- if (x == EBADRPC)
- {*r = Mono_Posix_Errno_EBADRPC; return 0;}
- #endif /* ndef EBADRPC */
- #ifdef EBADRQC
- if (x == EBADRQC)
- {*r = Mono_Posix_Errno_EBADRQC; return 0;}
- #endif /* ndef EBADRQC */
- #ifdef EBADSLT
- if (x == EBADSLT)
- {*r = Mono_Posix_Errno_EBADSLT; return 0;}
- #endif /* ndef EBADSLT */
- #ifdef EBFONT
- if (x == EBFONT)
- {*r = Mono_Posix_Errno_EBFONT; return 0;}
- #endif /* ndef EBFONT */
- #ifdef EBUSY
- if (x == EBUSY)
- {*r = Mono_Posix_Errno_EBUSY; return 0;}
- #endif /* ndef EBUSY */
- #ifdef ECANCELED
- if (x == ECANCELED)
- {*r = Mono_Posix_Errno_ECANCELED; return 0;}
- #endif /* ndef ECANCELED */
- #ifdef ECHILD
- if (x == ECHILD)
- {*r = Mono_Posix_Errno_ECHILD; return 0;}
- #endif /* ndef ECHILD */
- #ifdef ECHRNG
- if (x == ECHRNG)
- {*r = Mono_Posix_Errno_ECHRNG; return 0;}
- #endif /* ndef ECHRNG */
- #ifdef ECOMM
- if (x == ECOMM)
- {*r = Mono_Posix_Errno_ECOMM; return 0;}
- #endif /* ndef ECOMM */
- #ifdef ECONNABORTED
- if (x == ECONNABORTED)
- {*r = Mono_Posix_Errno_ECONNABORTED; return 0;}
- #endif /* ndef ECONNABORTED */
- #ifdef ECONNREFUSED
- if (x == ECONNREFUSED)
- {*r = Mono_Posix_Errno_ECONNREFUSED; return 0;}
- #endif /* ndef ECONNREFUSED */
- #ifdef ECONNRESET
- if (x == ECONNRESET)
- {*r = Mono_Posix_Errno_ECONNRESET; return 0;}
- #endif /* ndef ECONNRESET */
- #ifdef EDEADLK
- if (x == EDEADLK)
- {*r = Mono_Posix_Errno_EDEADLK; return 0;}
- #endif /* ndef EDEADLK */
- #ifdef EDEADLOCK
- if (x == EDEADLOCK)
- {*r = Mono_Posix_Errno_EDEADLOCK; return 0;}
- #endif /* ndef EDEADLOCK */
- #ifdef EDESTADDRREQ
- if (x == EDESTADDRREQ)
- {*r = Mono_Posix_Errno_EDESTADDRREQ; return 0;}
- #endif /* ndef EDESTADDRREQ */
- #ifdef EDEVERR
- if (x == EDEVERR)
- {*r = Mono_Posix_Errno_EDEVERR; return 0;}
- #endif /* ndef EDEVERR */
- #ifdef EDOM
- if (x == EDOM)
- {*r = Mono_Posix_Errno_EDOM; return 0;}
- #endif /* ndef EDOM */
- #ifdef EDOTDOT
- if (x == EDOTDOT)
- {*r = Mono_Posix_Errno_EDOTDOT; return 0;}
- #endif /* ndef EDOTDOT */
- #ifdef EDQUOT
- if (x == EDQUOT)
- {*r = Mono_Posix_Errno_EDQUOT; return 0;}
- #endif /* ndef EDQUOT */
- #ifdef EEXIST
- if (x == EEXIST)
- {*r = Mono_Posix_Errno_EEXIST; return 0;}
- #endif /* ndef EEXIST */
- #ifdef EFAULT
- if (x == EFAULT)
- {*r = Mono_Posix_Errno_EFAULT; return 0;}
- #endif /* ndef EFAULT */
- #ifdef EFBIG
- if (x == EFBIG)
- {*r = Mono_Posix_Errno_EFBIG; return 0;}
- #endif /* ndef EFBIG */
- #ifdef EFTYPE
- if (x == EFTYPE)
- {*r = Mono_Posix_Errno_EFTYPE; return 0;}
- #endif /* ndef EFTYPE */
- #ifdef EHOSTDOWN
- if (x == EHOSTDOWN)
- {*r = Mono_Posix_Errno_EHOSTDOWN; return 0;}
- #endif /* ndef EHOSTDOWN */
- #ifdef EHOSTUNREACH
- if (x == EHOSTUNREACH)
- {*r = Mono_Posix_Errno_EHOSTUNREACH; return 0;}
- #endif /* ndef EHOSTUNREACH */
- #ifdef EIDRM
- if (x == EIDRM)
- {*r = Mono_Posix_Errno_EIDRM; return 0;}
- #endif /* ndef EIDRM */
- #ifdef EILSEQ
- if (x == EILSEQ)
- {*r = Mono_Posix_Errno_EILSEQ; return 0;}
- #endif /* ndef EILSEQ */
- #ifdef EINPROGRESS
- if (x == EINPROGRESS)
- {*r = Mono_Posix_Errno_EINPROGRESS; return 0;}
- #endif /* ndef EINPROGRESS */
- #ifdef EINTR
- if (x == EINTR)
- {*r = Mono_Posix_Errno_EINTR; return 0;}
- #endif /* ndef EINTR */
- #ifdef EINVAL
- if (x == EINVAL)
- {*r = Mono_Posix_Errno_EINVAL; return 0;}
- #endif /* ndef EINVAL */
- #ifdef EIO
- if (x == EIO)
- {*r = Mono_Posix_Errno_EIO; return 0;}
- #endif /* ndef EIO */
- #ifdef EISCONN
- if (x == EISCONN)
- {*r = Mono_Posix_Errno_EISCONN; return 0;}
- #endif /* ndef EISCONN */
- #ifdef EISDIR
- if (x == EISDIR)
- {*r = Mono_Posix_Errno_EISDIR; return 0;}
- #endif /* ndef EISDIR */
- #ifdef EISNAM
- if (x == EISNAM)
- {*r = Mono_Posix_Errno_EISNAM; return 0;}
- #endif /* ndef EISNAM */
- #ifdef EKEYEXPIRED
- if (x == EKEYEXPIRED)
- {*r = Mono_Posix_Errno_EKEYEXPIRED; return 0;}
- #endif /* ndef EKEYEXPIRED */
- #ifdef EKEYREJECTED
- if (x == EKEYREJECTED)
- {*r = Mono_Posix_Errno_EKEYREJECTED; return 0;}
- #endif /* ndef EKEYREJECTED */
- #ifdef EKEYREVOKED
- if (x == EKEYREVOKED)
- {*r = Mono_Posix_Errno_EKEYREVOKED; return 0;}
- #endif /* ndef EKEYREVOKED */
- #ifdef EL2HLT
- if (x == EL2HLT)
- {*r = Mono_Posix_Errno_EL2HLT; return 0;}
- #endif /* ndef EL2HLT */
- #ifdef EL2NSYNC
- if (x == EL2NSYNC)
- {*r = Mono_Posix_Errno_EL2NSYNC; return 0;}
- #endif /* ndef EL2NSYNC */
- #ifdef EL3HLT
- if (x == EL3HLT)
- {*r = Mono_Posix_Errno_EL3HLT; return 0;}
- #endif /* ndef EL3HLT */
- #ifdef EL3RST
- if (x == EL3RST)
- {*r = Mono_Posix_Errno_EL3RST; return 0;}
- #endif /* ndef EL3RST */
- #ifdef ELIBACC
- if (x == ELIBACC)
- {*r = Mono_Posix_Errno_ELIBACC; return 0;}
- #endif /* ndef ELIBACC */
- #ifdef ELIBBAD
- if (x == ELIBBAD)
- {*r = Mono_Posix_Errno_ELIBBAD; return 0;}
- #endif /* ndef ELIBBAD */
- #ifdef ELIBEXEC
- if (x == ELIBEXEC)
- {*r = Mono_Posix_Errno_ELIBEXEC; return 0;}
- #endif /* ndef ELIBEXEC */
- #ifdef ELIBMAX
- if (x == ELIBMAX)
- {*r = Mono_Posix_Errno_ELIBMAX; return 0;}
- #endif /* ndef ELIBMAX */
- #ifdef ELIBSCN
- if (x == ELIBSCN)
- {*r = Mono_Posix_Errno_ELIBSCN; return 0;}
- #endif /* ndef ELIBSCN */
- #ifdef ELNRNG
- if (x == ELNRNG)
- {*r = Mono_Posix_Errno_ELNRNG; return 0;}
- #endif /* ndef ELNRNG */
- #ifdef ELOOP
- if (x == ELOOP)
- {*r = Mono_Posix_Errno_ELOOP; return 0;}
- #endif /* ndef ELOOP */
- #ifdef EMEDIUMTYPE
- if (x == EMEDIUMTYPE)
- {*r = Mono_Posix_Errno_EMEDIUMTYPE; return 0;}
- #endif /* ndef EMEDIUMTYPE */
- #ifdef EMFILE
- if (x == EMFILE)
- {*r = Mono_Posix_Errno_EMFILE; return 0;}
- #endif /* ndef EMFILE */
- #ifdef EMLINK
- if (x == EMLINK)
- {*r = Mono_Posix_Errno_EMLINK; return 0;}
- #endif /* ndef EMLINK */
- #ifdef EMSGSIZE
- if (x == EMSGSIZE)
- {*r = Mono_Posix_Errno_EMSGSIZE; return 0;}
- #endif /* ndef EMSGSIZE */
- #ifdef EMULTIHOP
- if (x == EMULTIHOP)
- {*r = Mono_Posix_Errno_EMULTIHOP; return 0;}
- #endif /* ndef EMULTIHOP */
- #ifdef ENAMETOOLONG
- if (x == ENAMETOOLONG)
- {*r = Mono_Posix_Errno_ENAMETOOLONG; return 0;}
- #endif /* ndef ENAMETOOLONG */
- #ifdef ENAVAIL
- if (x == ENAVAIL)
- {*r = Mono_Posix_Errno_ENAVAIL; return 0;}
- #endif /* ndef ENAVAIL */
- #ifdef ENEEDAUTH
- if (x == ENEEDAUTH)
- {*r = Mono_Posix_Errno_ENEEDAUTH; return 0;}
- #endif /* ndef ENEEDAUTH */
- #ifdef ENETDOWN
- if (x == ENETDOWN)
- {*r = Mono_Posix_Errno_ENETDOWN; return 0;}
- #endif /* ndef ENETDOWN */
- #ifdef ENETRESET
- if (x == ENETRESET)
- {*r = Mono_Posix_Errno_ENETRESET; return 0;}
- #endif /* ndef ENETRESET */
- #ifdef ENETUNREACH
- if (x == ENETUNREACH)
- {*r = Mono_Posix_Errno_ENETUNREACH; return 0;}
- #endif /* ndef ENETUNREACH */
- #ifdef ENFILE
- if (x == ENFILE)
- {*r = Mono_Posix_Errno_ENFILE; return 0;}
- #endif /* ndef ENFILE */
- #ifdef ENOANO
- if (x == ENOANO)
- {*r = Mono_Posix_Errno_ENOANO; return 0;}
- #endif /* ndef ENOANO */
- #ifdef ENOATTR
- if (x == ENOATTR)
- {*r = Mono_Posix_Errno_ENOATTR; return 0;}
- #endif /* ndef ENOATTR */
- #ifdef ENOBUFS
- if (x == ENOBUFS)
- {*r = Mono_Posix_Errno_ENOBUFS; return 0;}
- #endif /* ndef ENOBUFS */
- #ifdef ENOCSI
- if (x == ENOCSI)
- {*r = Mono_Posix_Errno_ENOCSI; return 0;}
- #endif /* ndef ENOCSI */
- #ifdef ENODATA
- if (x == ENODATA)
- {*r = Mono_Posix_Errno_ENODATA; return 0;}
- #endif /* ndef ENODATA */
- #ifdef ENODEV
- if (x == ENODEV)
- {*r = Mono_Posix_Errno_ENODEV; return 0;}
- #endif /* ndef ENODEV */
- #ifdef ENOENT
- if (x == ENOENT)
- {*r = Mono_Posix_Errno_ENOENT; return 0;}
- #endif /* ndef ENOENT */
- #ifdef ENOEXEC
- if (x == ENOEXEC)
- {*r = Mono_Posix_Errno_ENOEXEC; return 0;}
- #endif /* ndef ENOEXEC */
- #ifdef ENOKEY
- if (x == ENOKEY)
- {*r = Mono_Posix_Errno_ENOKEY; return 0;}
- #endif /* ndef ENOKEY */
- #ifdef ENOLCK
- if (x == ENOLCK)
- {*r = Mono_Posix_Errno_ENOLCK; return 0;}
- #endif /* ndef ENOLCK */
- #ifdef ENOLINK
- if (x == ENOLINK)
- {*r = Mono_Posix_Errno_ENOLINK; return 0;}
- #endif /* ndef ENOLINK */
- #ifdef ENOMEDIUM
- if (x == ENOMEDIUM)
- {*r = Mono_Posix_Errno_ENOMEDIUM; return 0;}
- #endif /* ndef ENOMEDIUM */
- #ifdef ENOMEM
- if (x == ENOMEM)
- {*r = Mono_Posix_Errno_ENOMEM; return 0;}
- #endif /* ndef ENOMEM */
- #ifdef ENOMSG
- if (x == ENOMSG)
- {*r = Mono_Posix_Errno_ENOMSG; return 0;}
- #endif /* ndef ENOMSG */
- #ifdef ENONET
- if (x == ENONET)
- {*r = Mono_Posix_Errno_ENONET; return 0;}
- #endif /* ndef ENONET */
- #ifdef ENOPKG
- if (x == ENOPKG)
- {*r = Mono_Posix_Errno_ENOPKG; return 0;}
- #endif /* ndef ENOPKG */
- #ifdef ENOPOLICY
- if (x == ENOPOLICY)
- {*r = Mono_Posix_Errno_ENOPOLICY; return 0;}
- #endif /* ndef ENOPOLICY */
- #ifdef ENOPROTOOPT
- if (x == ENOPROTOOPT)
- {*r = Mono_Posix_Errno_ENOPROTOOPT; return 0;}
- #endif /* ndef ENOPROTOOPT */
- #ifdef ENOSPC
- if (x == ENOSPC)
- {*r = Mono_Posix_Errno_ENOSPC; return 0;}
- #endif /* ndef ENOSPC */
- #ifdef ENOSR
- if (x == ENOSR)
- {*r = Mono_Posix_Errno_ENOSR; return 0;}
- #endif /* ndef ENOSR */
- #ifdef ENOSTR
- if (x == ENOSTR)
- {*r = Mono_Posix_Errno_ENOSTR; return 0;}
- #endif /* ndef ENOSTR */
- #ifdef ENOSYS
- if (x == ENOSYS)
- {*r = Mono_Posix_Errno_ENOSYS; return 0;}
- #endif /* ndef ENOSYS */
- #ifdef ENOTBLK
- if (x == ENOTBLK)
- {*r = Mono_Posix_Errno_ENOTBLK; return 0;}
- #endif /* ndef ENOTBLK */
- #ifdef ENOTCONN
- if (x == ENOTCONN)
- {*r = Mono_Posix_Errno_ENOTCONN; return 0;}
- #endif /* ndef ENOTCONN */
- #ifdef ENOTDIR
- if (x == ENOTDIR)
- {*r = Mono_Posix_Errno_ENOTDIR; return 0;}
- #endif /* ndef ENOTDIR */
- #ifdef ENOTEMPTY
- if (x == ENOTEMPTY)
- {*r = Mono_Posix_Errno_ENOTEMPTY; return 0;}
- #endif /* ndef ENOTEMPTY */
- #ifdef ENOTNAM
- if (x == ENOTNAM)
- {*r = Mono_Posix_Errno_ENOTNAM; return 0;}
- #endif /* ndef ENOTNAM */
- #ifdef ENOTRECOVERABLE
- if (x == ENOTRECOVERABLE)
- {*r = Mono_Posix_Errno_ENOTRECOVERABLE; return 0;}
- #endif /* ndef ENOTRECOVERABLE */
- #ifdef ENOTSOCK
- if (x == ENOTSOCK)
- {*r = Mono_Posix_Errno_ENOTSOCK; return 0;}
- #endif /* ndef ENOTSOCK */
- #ifdef ENOTTY
- if (x == ENOTTY)
- {*r = Mono_Posix_Errno_ENOTTY; return 0;}
- #endif /* ndef ENOTTY */
- #ifdef ENOTUNIQ
- if (x == ENOTUNIQ)
- {*r = Mono_Posix_Errno_ENOTUNIQ; return 0;}
- #endif /* ndef ENOTUNIQ */
- #ifdef ENXIO
- if (x == ENXIO)
- {*r = Mono_Posix_Errno_ENXIO; return 0;}
- #endif /* ndef ENXIO */
- #ifdef EOPNOTSUPP
- if (x == EOPNOTSUPP)
- {*r = Mono_Posix_Errno_EOPNOTSUPP; return 0;}
- #endif /* ndef EOPNOTSUPP */
- #ifdef EOVERFLOW
- if (x == EOVERFLOW)
- {*r = Mono_Posix_Errno_EOVERFLOW; return 0;}
- #endif /* ndef EOVERFLOW */
- #ifdef EOWNERDEAD
- if (x == EOWNERDEAD)
- {*r = Mono_Posix_Errno_EOWNERDEAD; return 0;}
- #endif /* ndef EOWNERDEAD */
- #ifdef EPERM
- if (x == EPERM)
- {*r = Mono_Posix_Errno_EPERM; return 0;}
- #endif /* ndef EPERM */
- #ifdef EPFNOSUPPORT
- if (x == EPFNOSUPPORT)
- {*r = Mono_Posix_Errno_EPFNOSUPPORT; return 0;}
- #endif /* ndef EPFNOSUPPORT */
- #ifdef EPIPE
- if (x == EPIPE)
- {*r = Mono_Posix_Errno_EPIPE; return 0;}
- #endif /* ndef EPIPE */
- #ifdef EPROCLIM
- if (x == EPROCLIM)
- {*r = Mono_Posix_Errno_EPROCLIM; return 0;}
- #endif /* ndef EPROCLIM */
- #ifdef EPROCUNAVAIL
- if (x == EPROCUNAVAIL)
- {*r = Mono_Posix_Errno_EPROCUNAVAIL; return 0;}
- #endif /* ndef EPROCUNAVAIL */
- #ifdef EPROGMISMATCH
- if (x == EPROGMISMATCH)
- {*r = Mono_Posix_Errno_EPROGMISMATCH; return 0;}
- #endif /* ndef EPROGMISMATCH */
- #ifdef EPROGUNAVAIL
- if (x == EPROGUNAVAIL)
- {*r = Mono_Posix_Errno_EPROGUNAVAIL; return 0;}
- #endif /* ndef EPROGUNAVAIL */
- #ifdef EPROTO
- if (x == EPROTO)
- {*r = Mono_Posix_Errno_EPROTO; return 0;}
- #endif /* ndef EPROTO */
- #ifdef EPROTONOSUPPORT
- if (x == EPROTONOSUPPORT)
- {*r = Mono_Posix_Errno_EPROTONOSUPPORT; return 0;}
- #endif /* ndef EPROTONOSUPPORT */
- #ifdef EPROTOTYPE
- if (x == EPROTOTYPE)
- {*r = Mono_Posix_Errno_EPROTOTYPE; return 0;}
- #endif /* ndef EPROTOTYPE */
- #ifdef EPWROFF
- if (x == EPWROFF)
- {*r = Mono_Posix_Errno_EPWROFF; return 0;}
- #endif /* ndef EPWROFF */
- #ifdef ERANGE
- if (x == ERANGE)
- {*r = Mono_Posix_Errno_ERANGE; return 0;}
- #endif /* ndef ERANGE */
- #ifdef EREMCHG
- if (x == EREMCHG)
- {*r = Mono_Posix_Errno_EREMCHG; return 0;}
- #endif /* ndef EREMCHG */
- #ifdef EREMOTE
- if (x == EREMOTE)
- {*r = Mono_Posix_Errno_EREMOTE; return 0;}
- #endif /* ndef EREMOTE */
- #ifdef EREMOTEIO
- if (x == EREMOTEIO)
- {*r = Mono_Posix_Errno_EREMOTEIO; return 0;}
- #endif /* ndef EREMOTEIO */
- #ifdef ERESTART
- if (x == ERESTART)
- {*r = Mono_Posix_Errno_ERESTART; return 0;}
- #endif /* ndef ERESTART */
- #ifdef EROFS
- if (x == EROFS)
- {*r = Mono_Posix_Errno_EROFS; return 0;}
- #endif /* ndef EROFS */
- #ifdef ERPCMISMATCH
- if (x == ERPCMISMATCH)
- {*r = Mono_Posix_Errno_ERPCMISMATCH; return 0;}
- #endif /* ndef ERPCMISMATCH */
- #ifdef ESHLIBVERS
- if (x == ESHLIBVERS)
- {*r = Mono_Posix_Errno_ESHLIBVERS; return 0;}
- #endif /* ndef ESHLIBVERS */
- #ifdef ESHUTDOWN
- if (x == ESHUTDOWN)
- {*r = Mono_Posix_Errno_ESHUTDOWN; return 0;}
- #endif /* ndef ESHUTDOWN */
- #ifdef ESOCKTNOSUPPORT
- if (x == ESOCKTNOSUPPORT)
- {*r = Mono_Posix_Errno_ESOCKTNOSUPPORT; return 0;}
- #endif /* ndef ESOCKTNOSUPPORT */
- #ifdef ESPIPE
- if (x == ESPIPE)
- {*r = Mono_Posix_Errno_ESPIPE; return 0;}
- #endif /* ndef ESPIPE */
- #ifdef ESRCH
- if (x == ESRCH)
- {*r = Mono_Posix_Errno_ESRCH; return 0;}
- #endif /* ndef ESRCH */
- #ifdef ESRMNT
- if (x == ESRMNT)
- {*r = Mono_Posix_Errno_ESRMNT; return 0;}
- #endif /* ndef ESRMNT */
- #ifdef ESTALE
- if (x == ESTALE)
- {*r = Mono_Posix_Errno_ESTALE; return 0;}
- #endif /* ndef ESTALE */
- #ifdef ESTRPIPE
- if (x == ESTRPIPE)
- {*r = Mono_Posix_Errno_ESTRPIPE; return 0;}
- #endif /* ndef ESTRPIPE */
- #ifdef ETIME
- if (x == ETIME)
- {*r = Mono_Posix_Errno_ETIME; return 0;}
- #endif /* ndef ETIME */
- #ifdef ETIMEDOUT
- if (x == ETIMEDOUT)
- {*r = Mono_Posix_Errno_ETIMEDOUT; return 0;}
- #endif /* ndef ETIMEDOUT */
- #ifdef ETOOMANYREFS
- if (x == ETOOMANYREFS)
- {*r = Mono_Posix_Errno_ETOOMANYREFS; return 0;}
- #endif /* ndef ETOOMANYREFS */
- #ifdef ETXTBSY
- if (x == ETXTBSY)
- {*r = Mono_Posix_Errno_ETXTBSY; return 0;}
- #endif /* ndef ETXTBSY */
- #ifdef EUCLEAN
- if (x == EUCLEAN)
- {*r = Mono_Posix_Errno_EUCLEAN; return 0;}
- #endif /* ndef EUCLEAN */
- #ifdef EUNATCH
- if (x == EUNATCH)
- {*r = Mono_Posix_Errno_EUNATCH; return 0;}
- #endif /* ndef EUNATCH */
- #ifdef EUSERS
- if (x == EUSERS)
- {*r = Mono_Posix_Errno_EUSERS; return 0;}
- #endif /* ndef EUSERS */
- #ifdef EWOULDBLOCK
- if (x == EWOULDBLOCK)
- {*r = Mono_Posix_Errno_EWOULDBLOCK; return 0;}
- #endif /* ndef EWOULDBLOCK */
- #ifdef EXDEV
- if (x == EXDEV)
- {*r = Mono_Posix_Errno_EXDEV; return 0;}
- #endif /* ndef EXDEV */
- #ifdef EXFULL
- if (x == EXFULL)
- {*r = Mono_Posix_Errno_EXFULL; return 0;}
- #endif /* ndef EXFULL */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromFcntlCommand (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_FcntlCommand_F_DUPFD)
- #ifdef F_DUPFD
- {*r = F_DUPFD; return 0;}
- #else /* def F_DUPFD */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_DUPFD */
- if (x == Mono_Posix_FcntlCommand_F_GETFD)
- #ifdef F_GETFD
- {*r = F_GETFD; return 0;}
- #else /* def F_GETFD */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_GETFD */
- if (x == Mono_Posix_FcntlCommand_F_GETFL)
- #ifdef F_GETFL
- {*r = F_GETFL; return 0;}
- #else /* def F_GETFL */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_GETFL */
- if (x == Mono_Posix_FcntlCommand_F_GETLEASE)
- #ifdef F_GETLEASE
- {*r = F_GETLEASE; return 0;}
- #else /* def F_GETLEASE */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_GETLEASE */
- if (x == Mono_Posix_FcntlCommand_F_GETLK)
- #ifdef F_GETLK
- {*r = F_GETLK; return 0;}
- #else /* def F_GETLK */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_GETLK */
- if (x == Mono_Posix_FcntlCommand_F_GETOWN)
- #ifdef F_GETOWN
- {*r = F_GETOWN; return 0;}
- #else /* def F_GETOWN */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_GETOWN */
- if (x == Mono_Posix_FcntlCommand_F_GETSIG)
- #ifdef F_GETSIG
- {*r = F_GETSIG; return 0;}
- #else /* def F_GETSIG */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_GETSIG */
- if (x == Mono_Posix_FcntlCommand_F_NOCACHE)
- #ifdef F_NOCACHE
- {*r = F_NOCACHE; return 0;}
- #else /* def F_NOCACHE */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_NOCACHE */
- if (x == Mono_Posix_FcntlCommand_F_NOTIFY)
- #ifdef F_NOTIFY
- {*r = F_NOTIFY; return 0;}
- #else /* def F_NOTIFY */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_NOTIFY */
- if (x == Mono_Posix_FcntlCommand_F_SETFD)
- #ifdef F_SETFD
- {*r = F_SETFD; return 0;}
- #else /* def F_SETFD */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_SETFD */
- if (x == Mono_Posix_FcntlCommand_F_SETFL)
- #ifdef F_SETFL
- {*r = F_SETFL; return 0;}
- #else /* def F_SETFL */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_SETFL */
- if (x == Mono_Posix_FcntlCommand_F_SETLEASE)
- #ifdef F_SETLEASE
- {*r = F_SETLEASE; return 0;}
- #else /* def F_SETLEASE */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_SETLEASE */
- if (x == Mono_Posix_FcntlCommand_F_SETLK)
- #ifdef F_SETLK
- {*r = F_SETLK; return 0;}
- #else /* def F_SETLK */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_SETLK */
- if (x == Mono_Posix_FcntlCommand_F_SETLKW)
- #ifdef F_SETLKW
- {*r = F_SETLKW; return 0;}
- #else /* def F_SETLKW */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_SETLKW */
- if (x == Mono_Posix_FcntlCommand_F_SETOWN)
- #ifdef F_SETOWN
- {*r = F_SETOWN; return 0;}
- #else /* def F_SETOWN */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_SETOWN */
- if (x == Mono_Posix_FcntlCommand_F_SETSIG)
- #ifdef F_SETSIG
- {*r = F_SETSIG; return 0;}
- #else /* def F_SETSIG */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_SETSIG */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToFcntlCommand (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef F_DUPFD
- if (x == F_DUPFD)
- {*r = Mono_Posix_FcntlCommand_F_DUPFD; return 0;}
- #endif /* ndef F_DUPFD */
- #ifdef F_GETFD
- if (x == F_GETFD)
- {*r = Mono_Posix_FcntlCommand_F_GETFD; return 0;}
- #endif /* ndef F_GETFD */
- #ifdef F_GETFL
- if (x == F_GETFL)
- {*r = Mono_Posix_FcntlCommand_F_GETFL; return 0;}
- #endif /* ndef F_GETFL */
- #ifdef F_GETLEASE
- if (x == F_GETLEASE)
- {*r = Mono_Posix_FcntlCommand_F_GETLEASE; return 0;}
- #endif /* ndef F_GETLEASE */
- #ifdef F_GETLK
- if (x == F_GETLK)
- {*r = Mono_Posix_FcntlCommand_F_GETLK; return 0;}
- #endif /* ndef F_GETLK */
- #ifdef F_GETOWN
- if (x == F_GETOWN)
- {*r = Mono_Posix_FcntlCommand_F_GETOWN; return 0;}
- #endif /* ndef F_GETOWN */
- #ifdef F_GETSIG
- if (x == F_GETSIG)
- {*r = Mono_Posix_FcntlCommand_F_GETSIG; return 0;}
- #endif /* ndef F_GETSIG */
- #ifdef F_NOCACHE
- if (x == F_NOCACHE)
- {*r = Mono_Posix_FcntlCommand_F_NOCACHE; return 0;}
- #endif /* ndef F_NOCACHE */
- #ifdef F_NOTIFY
- if (x == F_NOTIFY)
- {*r = Mono_Posix_FcntlCommand_F_NOTIFY; return 0;}
- #endif /* ndef F_NOTIFY */
- #ifdef F_SETFD
- if (x == F_SETFD)
- {*r = Mono_Posix_FcntlCommand_F_SETFD; return 0;}
- #endif /* ndef F_SETFD */
- #ifdef F_SETFL
- if (x == F_SETFL)
- {*r = Mono_Posix_FcntlCommand_F_SETFL; return 0;}
- #endif /* ndef F_SETFL */
- #ifdef F_SETLEASE
- if (x == F_SETLEASE)
- {*r = Mono_Posix_FcntlCommand_F_SETLEASE; return 0;}
- #endif /* ndef F_SETLEASE */
- #ifdef F_SETLK
- if (x == F_SETLK)
- {*r = Mono_Posix_FcntlCommand_F_SETLK; return 0;}
- #endif /* ndef F_SETLK */
- #ifdef F_SETLKW
- if (x == F_SETLKW)
- {*r = Mono_Posix_FcntlCommand_F_SETLKW; return 0;}
- #endif /* ndef F_SETLKW */
- #ifdef F_SETOWN
- if (x == F_SETOWN)
- {*r = Mono_Posix_FcntlCommand_F_SETOWN; return 0;}
- #endif /* ndef F_SETOWN */
- #ifdef F_SETSIG
- if (x == F_SETSIG)
- {*r = Mono_Posix_FcntlCommand_F_SETSIG; return 0;}
- #endif /* ndef F_SETSIG */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromFilePermissions (unsigned int x, unsigned int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_FilePermissions_ACCESSPERMS) == Mono_Posix_FilePermissions_ACCESSPERMS)
- #ifdef ACCESSPERMS
- *r |= ACCESSPERMS;
- #else /* def ACCESSPERMS */
- {/* Ignoring Mono_Posix_FilePermissions_ACCESSPERMS, as it is constructed from other values */}
- #endif /* ndef ACCESSPERMS */
- if ((x & Mono_Posix_FilePermissions_ALLPERMS) == Mono_Posix_FilePermissions_ALLPERMS)
- #ifdef ALLPERMS
- *r |= ALLPERMS;
- #else /* def ALLPERMS */
- {/* Ignoring Mono_Posix_FilePermissions_ALLPERMS, as it is constructed from other values */}
- #endif /* ndef ALLPERMS */
- if ((x & Mono_Posix_FilePermissions_DEFFILEMODE) == Mono_Posix_FilePermissions_DEFFILEMODE)
- #ifdef DEFFILEMODE
- *r |= DEFFILEMODE;
- #else /* def DEFFILEMODE */
- {/* Ignoring Mono_Posix_FilePermissions_DEFFILEMODE, as it is constructed from other values */}
- #endif /* ndef DEFFILEMODE */
- if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFBLK)
- #ifdef S_IFBLK
- *r |= S_IFBLK;
- #else /* def S_IFBLK */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IFBLK */
- if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFCHR)
- #ifdef S_IFCHR
- *r |= S_IFCHR;
- #else /* def S_IFCHR */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IFCHR */
- if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFDIR)
- #ifdef S_IFDIR
- *r |= S_IFDIR;
- #else /* def S_IFDIR */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IFDIR */
- if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFIFO)
- #ifdef S_IFIFO
- *r |= S_IFIFO;
- #else /* def S_IFIFO */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IFIFO */
- if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFLNK)
- #ifdef S_IFLNK
- *r |= S_IFLNK;
- #else /* def S_IFLNK */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IFLNK */
- if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFMT)
- #ifdef S_IFMT
- *r |= S_IFMT;
- #else /* def S_IFMT */
- {/* Ignoring Mono_Posix_FilePermissions_S_IFMT, as it is constructed from other values */}
- #endif /* ndef S_IFMT */
- if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFREG)
- #ifdef S_IFREG
- *r |= S_IFREG;
- #else /* def S_IFREG */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IFREG */
- if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFSOCK)
- #ifdef S_IFSOCK
- *r |= S_IFSOCK;
- #else /* def S_IFSOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IFSOCK */
- if ((x & Mono_Posix_FilePermissions_S_IRGRP) == Mono_Posix_FilePermissions_S_IRGRP)
- #ifdef S_IRGRP
- *r |= S_IRGRP;
- #else /* def S_IRGRP */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IRGRP */
- if ((x & Mono_Posix_FilePermissions_S_IROTH) == Mono_Posix_FilePermissions_S_IROTH)
- #ifdef S_IROTH
- *r |= S_IROTH;
- #else /* def S_IROTH */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IROTH */
- if ((x & Mono_Posix_FilePermissions_S_IRUSR) == Mono_Posix_FilePermissions_S_IRUSR)
- #ifdef S_IRUSR
- *r |= S_IRUSR;
- #else /* def S_IRUSR */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IRUSR */
- if ((x & Mono_Posix_FilePermissions_S_IRWXG) == Mono_Posix_FilePermissions_S_IRWXG)
- #ifdef S_IRWXG
- *r |= S_IRWXG;
- #else /* def S_IRWXG */
- {/* Ignoring Mono_Posix_FilePermissions_S_IRWXG, as it is constructed from other values */}
- #endif /* ndef S_IRWXG */
- if ((x & Mono_Posix_FilePermissions_S_IRWXO) == Mono_Posix_FilePermissions_S_IRWXO)
- #ifdef S_IRWXO
- *r |= S_IRWXO;
- #else /* def S_IRWXO */
- {/* Ignoring Mono_Posix_FilePermissions_S_IRWXO, as it is constructed from other values */}
- #endif /* ndef S_IRWXO */
- if ((x & Mono_Posix_FilePermissions_S_IRWXU) == Mono_Posix_FilePermissions_S_IRWXU)
- #ifdef S_IRWXU
- *r |= S_IRWXU;
- #else /* def S_IRWXU */
- {/* Ignoring Mono_Posix_FilePermissions_S_IRWXU, as it is constructed from other values */}
- #endif /* ndef S_IRWXU */
- if ((x & Mono_Posix_FilePermissions_S_ISGID) == Mono_Posix_FilePermissions_S_ISGID)
- #ifdef S_ISGID
- *r |= S_ISGID;
- #else /* def S_ISGID */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_ISGID */
- if ((x & Mono_Posix_FilePermissions_S_ISUID) == Mono_Posix_FilePermissions_S_ISUID)
- #ifdef S_ISUID
- *r |= S_ISUID;
- #else /* def S_ISUID */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_ISUID */
- if ((x & Mono_Posix_FilePermissions_S_ISVTX) == Mono_Posix_FilePermissions_S_ISVTX)
- #ifdef S_ISVTX
- *r |= S_ISVTX;
- #else /* def S_ISVTX */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_ISVTX */
- if ((x & Mono_Posix_FilePermissions_S_IWGRP) == Mono_Posix_FilePermissions_S_IWGRP)
- #ifdef S_IWGRP
- *r |= S_IWGRP;
- #else /* def S_IWGRP */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IWGRP */
- if ((x & Mono_Posix_FilePermissions_S_IWOTH) == Mono_Posix_FilePermissions_S_IWOTH)
- #ifdef S_IWOTH
- *r |= S_IWOTH;
- #else /* def S_IWOTH */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IWOTH */
- if ((x & Mono_Posix_FilePermissions_S_IWUSR) == Mono_Posix_FilePermissions_S_IWUSR)
- #ifdef S_IWUSR
- *r |= S_IWUSR;
- #else /* def S_IWUSR */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IWUSR */
- if ((x & Mono_Posix_FilePermissions_S_IXGRP) == Mono_Posix_FilePermissions_S_IXGRP)
- #ifdef S_IXGRP
- *r |= S_IXGRP;
- #else /* def S_IXGRP */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IXGRP */
- if ((x & Mono_Posix_FilePermissions_S_IXOTH) == Mono_Posix_FilePermissions_S_IXOTH)
- #ifdef S_IXOTH
- *r |= S_IXOTH;
- #else /* def S_IXOTH */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IXOTH */
- if ((x & Mono_Posix_FilePermissions_S_IXUSR) == Mono_Posix_FilePermissions_S_IXUSR)
- #ifdef S_IXUSR
- *r |= S_IXUSR;
- #else /* def S_IXUSR */
- {errno = EINVAL; return -1;}
- #endif /* ndef S_IXUSR */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToFilePermissions (unsigned int x, unsigned int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef ACCESSPERMS
- if ((x & ACCESSPERMS) == ACCESSPERMS)
- *r |= Mono_Posix_FilePermissions_ACCESSPERMS;
- #endif /* ndef ACCESSPERMS */
- #ifdef ALLPERMS
- if ((x & ALLPERMS) == ALLPERMS)
- *r |= Mono_Posix_FilePermissions_ALLPERMS;
- #endif /* ndef ALLPERMS */
- #ifdef DEFFILEMODE
- if ((x & DEFFILEMODE) == DEFFILEMODE)
- *r |= Mono_Posix_FilePermissions_DEFFILEMODE;
- #endif /* ndef DEFFILEMODE */
- #ifdef S_IFBLK
- if ((x & S_IFMT) == S_IFBLK)
- *r |= Mono_Posix_FilePermissions_S_IFBLK;
- #endif /* ndef S_IFBLK */
- #ifdef S_IFCHR
- if ((x & S_IFMT) == S_IFCHR)
- *r |= Mono_Posix_FilePermissions_S_IFCHR;
- #endif /* ndef S_IFCHR */
- #ifdef S_IFDIR
- if ((x & S_IFMT) == S_IFDIR)
- *r |= Mono_Posix_FilePermissions_S_IFDIR;
- #endif /* ndef S_IFDIR */
- #ifdef S_IFIFO
- if ((x & S_IFMT) == S_IFIFO)
- *r |= Mono_Posix_FilePermissions_S_IFIFO;
- #endif /* ndef S_IFIFO */
- #ifdef S_IFLNK
- if ((x & S_IFMT) == S_IFLNK)
- *r |= Mono_Posix_FilePermissions_S_IFLNK;
- #endif /* ndef S_IFLNK */
- #ifdef S_IFMT
- if ((x & S_IFMT) == S_IFMT)
- *r |= Mono_Posix_FilePermissions_S_IFMT;
- #endif /* ndef S_IFMT */
- #ifdef S_IFREG
- if ((x & S_IFMT) == S_IFREG)
- *r |= Mono_Posix_FilePermissions_S_IFREG;
- #endif /* ndef S_IFREG */
- #ifdef S_IFSOCK
- if ((x & S_IFMT) == S_IFSOCK)
- *r |= Mono_Posix_FilePermissions_S_IFSOCK;
- #endif /* ndef S_IFSOCK */
- #ifdef S_IRGRP
- if ((x & S_IRGRP) == S_IRGRP)
- *r |= Mono_Posix_FilePermissions_S_IRGRP;
- #endif /* ndef S_IRGRP */
- #ifdef S_IROTH
- if ((x & S_IROTH) == S_IROTH)
- *r |= Mono_Posix_FilePermissions_S_IROTH;
- #endif /* ndef S_IROTH */
- #ifdef S_IRUSR
- if ((x & S_IRUSR) == S_IRUSR)
- *r |= Mono_Posix_FilePermissions_S_IRUSR;
- #endif /* ndef S_IRUSR */
- #ifdef S_IRWXG
- if ((x & S_IRWXG) == S_IRWXG)
- *r |= Mono_Posix_FilePermissions_S_IRWXG;
- #endif /* ndef S_IRWXG */
- #ifdef S_IRWXO
- if ((x & S_IRWXO) == S_IRWXO)
- *r |= Mono_Posix_FilePermissions_S_IRWXO;
- #endif /* ndef S_IRWXO */
- #ifdef S_IRWXU
- if ((x & S_IRWXU) == S_IRWXU)
- *r |= Mono_Posix_FilePermissions_S_IRWXU;
- #endif /* ndef S_IRWXU */
- #ifdef S_ISGID
- if ((x & S_ISGID) == S_ISGID)
- *r |= Mono_Posix_FilePermissions_S_ISGID;
- #endif /* ndef S_ISGID */
- #ifdef S_ISUID
- if ((x & S_ISUID) == S_ISUID)
- *r |= Mono_Posix_FilePermissions_S_ISUID;
- #endif /* ndef S_ISUID */
- #ifdef S_ISVTX
- if ((x & S_ISVTX) == S_ISVTX)
- *r |= Mono_Posix_FilePermissions_S_ISVTX;
- #endif /* ndef S_ISVTX */
- #ifdef S_IWGRP
- if ((x & S_IWGRP) == S_IWGRP)
- *r |= Mono_Posix_FilePermissions_S_IWGRP;
- #endif /* ndef S_IWGRP */
- #ifdef S_IWOTH
- if ((x & S_IWOTH) == S_IWOTH)
- *r |= Mono_Posix_FilePermissions_S_IWOTH;
- #endif /* ndef S_IWOTH */
- #ifdef S_IWUSR
- if ((x & S_IWUSR) == S_IWUSR)
- *r |= Mono_Posix_FilePermissions_S_IWUSR;
- #endif /* ndef S_IWUSR */
- #ifdef S_IXGRP
- if ((x & S_IXGRP) == S_IXGRP)
- *r |= Mono_Posix_FilePermissions_S_IXGRP;
- #endif /* ndef S_IXGRP */
- #ifdef S_IXOTH
- if ((x & S_IXOTH) == S_IXOTH)
- *r |= Mono_Posix_FilePermissions_S_IXOTH;
- #endif /* ndef S_IXOTH */
- #ifdef S_IXUSR
- if ((x & S_IXUSR) == S_IXUSR)
- *r |= Mono_Posix_FilePermissions_S_IXUSR;
- #endif /* ndef S_IXUSR */
- return 0;
- }
- #ifdef HAVE_STRUCT_FLOCK
- int
- Mono_Posix_FromFlock (struct Mono_Posix_Flock *from, struct flock *to)
- {
- _cnm_return_val_if_overflow (off_t, from->l_start, -1);
- _cnm_return_val_if_overflow (off_t, from->l_len, -1);
- _cnm_return_val_if_overflow (pid_t, from->l_pid, -1);
- memset (to, 0, sizeof(*to));
- if (Mono_Posix_FromLockType (from->l_type, &to->l_type) != 0) {
- return -1;
- }
- if (Mono_Posix_FromSeekFlags (from->l_whence, &to->l_whence) != 0) {
- return -1;
- }
- to->l_start = from->l_start;
- to->l_len = from->l_len;
- to->l_pid = from->l_pid;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_FLOCK */
- #ifdef HAVE_STRUCT_FLOCK
- int
- Mono_Posix_ToFlock (struct flock *from, struct Mono_Posix_Flock *to)
- {
- _cnm_return_val_if_overflow (gint64, from->l_start, -1);
- _cnm_return_val_if_overflow (gint64, from->l_len, -1);
- _cnm_return_val_if_overflow (int, from->l_pid, -1);
- memset (to, 0, sizeof(*to));
- if (Mono_Posix_ToLockType (from->l_type, &to->l_type) != 0) {
- return -1;
- }
- if (Mono_Posix_ToSeekFlags (from->l_whence, &to->l_whence) != 0) {
- return -1;
- }
- to->l_start = from->l_start;
- to->l_len = from->l_len;
- to->l_pid = from->l_pid;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_FLOCK */
- #ifdef HAVE_STRUCT_IOVEC
- int
- Mono_Posix_FromIovec (struct Mono_Posix_Iovec *from, struct iovec *to)
- {
- _cnm_return_val_if_overflow (guint64, from->iov_len, -1);
- memset (to, 0, sizeof(*to));
- to->iov_base = from->iov_base;
- to->iov_len = from->iov_len;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_IOVEC */
- #ifdef HAVE_STRUCT_IOVEC
- int
- Mono_Posix_ToIovec (struct iovec *from, struct Mono_Posix_Iovec *to)
- {
- _cnm_return_val_if_overflow (guint64, from->iov_len, -1);
- memset (to, 0, sizeof(*to));
- to->iov_base = from->iov_base;
- to->iov_len = from->iov_len;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_IOVEC */
- #ifdef HAVE_STRUCT_LINGER
- int
- Mono_Posix_FromLinger (struct Mono_Posix_Linger *from, struct linger *to)
- {
- _cnm_return_val_if_overflow (int, from->l_onoff, -1);
- _cnm_return_val_if_overflow (int, from->l_linger, -1);
- memset (to, 0, sizeof(*to));
- to->l_onoff = from->l_onoff;
- to->l_linger = from->l_linger;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_LINGER */
- #ifdef HAVE_STRUCT_LINGER
- int
- Mono_Posix_ToLinger (struct linger *from, struct Mono_Posix_Linger *to)
- {
- _cnm_return_val_if_overflow (int, from->l_onoff, -1);
- _cnm_return_val_if_overflow (int, from->l_linger, -1);
- memset (to, 0, sizeof(*to));
- to->l_onoff = from->l_onoff;
- to->l_linger = from->l_linger;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_LINGER */
- int Mono_Posix_FromLockType (short x, short *r)
- {
- *r = 0;
- if (x == Mono_Posix_LockType_F_RDLCK)
- #ifdef F_RDLCK
- {*r = F_RDLCK; return 0;}
- #else /* def F_RDLCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_RDLCK */
- if (x == Mono_Posix_LockType_F_UNLCK)
- #ifdef F_UNLCK
- {*r = F_UNLCK; return 0;}
- #else /* def F_UNLCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_UNLCK */
- if (x == Mono_Posix_LockType_F_WRLCK)
- #ifdef F_WRLCK
- {*r = F_WRLCK; return 0;}
- #else /* def F_WRLCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_WRLCK */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToLockType (short x, short *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef F_RDLCK
- if (x == F_RDLCK)
- {*r = Mono_Posix_LockType_F_RDLCK; return 0;}
- #endif /* ndef F_RDLCK */
- #ifdef F_UNLCK
- if (x == F_UNLCK)
- {*r = Mono_Posix_LockType_F_UNLCK; return 0;}
- #endif /* ndef F_UNLCK */
- #ifdef F_WRLCK
- if (x == F_WRLCK)
- {*r = Mono_Posix_LockType_F_WRLCK; return 0;}
- #endif /* ndef F_WRLCK */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromLockfCommand (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_LockfCommand_F_LOCK)
- #ifdef F_LOCK
- {*r = F_LOCK; return 0;}
- #else /* def F_LOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_LOCK */
- if (x == Mono_Posix_LockfCommand_F_TEST)
- #ifdef F_TEST
- {*r = F_TEST; return 0;}
- #else /* def F_TEST */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_TEST */
- if (x == Mono_Posix_LockfCommand_F_TLOCK)
- #ifdef F_TLOCK
- {*r = F_TLOCK; return 0;}
- #else /* def F_TLOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_TLOCK */
- if (x == Mono_Posix_LockfCommand_F_ULOCK)
- #ifdef F_ULOCK
- {*r = F_ULOCK; return 0;}
- #else /* def F_ULOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef F_ULOCK */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToLockfCommand (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef F_LOCK
- if (x == F_LOCK)
- {*r = Mono_Posix_LockfCommand_F_LOCK; return 0;}
- #endif /* ndef F_LOCK */
- #ifdef F_TEST
- if (x == F_TEST)
- {*r = Mono_Posix_LockfCommand_F_TEST; return 0;}
- #endif /* ndef F_TEST */
- #ifdef F_TLOCK
- if (x == F_TLOCK)
- {*r = Mono_Posix_LockfCommand_F_TLOCK; return 0;}
- #endif /* ndef F_TLOCK */
- #ifdef F_ULOCK
- if (x == F_ULOCK)
- {*r = Mono_Posix_LockfCommand_F_ULOCK; return 0;}
- #endif /* ndef F_ULOCK */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromMessageFlags (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_MessageFlags_MSG_CMSG_CLOEXEC) == Mono_Posix_MessageFlags_MSG_CMSG_CLOEXEC)
- #ifdef MSG_CMSG_CLOEXEC
- *r |= MSG_CMSG_CLOEXEC;
- #else /* def MSG_CMSG_CLOEXEC */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_CMSG_CLOEXEC */
- if ((x & Mono_Posix_MessageFlags_MSG_CONFIRM) == Mono_Posix_MessageFlags_MSG_CONFIRM)
- #ifdef MSG_CONFIRM
- *r |= MSG_CONFIRM;
- #else /* def MSG_CONFIRM */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_CONFIRM */
- if ((x & Mono_Posix_MessageFlags_MSG_CTRUNC) == Mono_Posix_MessageFlags_MSG_CTRUNC)
- #ifdef MSG_CTRUNC
- *r |= MSG_CTRUNC;
- #else /* def MSG_CTRUNC */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_CTRUNC */
- if ((x & Mono_Posix_MessageFlags_MSG_DONTROUTE) == Mono_Posix_MessageFlags_MSG_DONTROUTE)
- #ifdef MSG_DONTROUTE
- *r |= MSG_DONTROUTE;
- #else /* def MSG_DONTROUTE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_DONTROUTE */
- if ((x & Mono_Posix_MessageFlags_MSG_DONTWAIT) == Mono_Posix_MessageFlags_MSG_DONTWAIT)
- #ifdef MSG_DONTWAIT
- *r |= MSG_DONTWAIT;
- #else /* def MSG_DONTWAIT */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_DONTWAIT */
- if ((x & Mono_Posix_MessageFlags_MSG_EOR) == Mono_Posix_MessageFlags_MSG_EOR)
- #ifdef MSG_EOR
- *r |= MSG_EOR;
- #else /* def MSG_EOR */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_EOR */
- if ((x & Mono_Posix_MessageFlags_MSG_ERRQUEUE) == Mono_Posix_MessageFlags_MSG_ERRQUEUE)
- #ifdef MSG_ERRQUEUE
- *r |= MSG_ERRQUEUE;
- #else /* def MSG_ERRQUEUE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_ERRQUEUE */
- if ((x & Mono_Posix_MessageFlags_MSG_FASTOPEN) == Mono_Posix_MessageFlags_MSG_FASTOPEN)
- #ifdef MSG_FASTOPEN
- *r |= MSG_FASTOPEN;
- #else /* def MSG_FASTOPEN */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_FASTOPEN */
- if ((x & Mono_Posix_MessageFlags_MSG_FIN) == Mono_Posix_MessageFlags_MSG_FIN)
- #ifdef MSG_FIN
- *r |= MSG_FIN;
- #else /* def MSG_FIN */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_FIN */
- if ((x & Mono_Posix_MessageFlags_MSG_MORE) == Mono_Posix_MessageFlags_MSG_MORE)
- #ifdef MSG_MORE
- *r |= MSG_MORE;
- #else /* def MSG_MORE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_MORE */
- if ((x & Mono_Posix_MessageFlags_MSG_NOSIGNAL) == Mono_Posix_MessageFlags_MSG_NOSIGNAL)
- #ifdef MSG_NOSIGNAL
- *r |= MSG_NOSIGNAL;
- #else /* def MSG_NOSIGNAL */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_NOSIGNAL */
- if ((x & Mono_Posix_MessageFlags_MSG_OOB) == Mono_Posix_MessageFlags_MSG_OOB)
- #ifdef MSG_OOB
- *r |= MSG_OOB;
- #else /* def MSG_OOB */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_OOB */
- if ((x & Mono_Posix_MessageFlags_MSG_PEEK) == Mono_Posix_MessageFlags_MSG_PEEK)
- #ifdef MSG_PEEK
- *r |= MSG_PEEK;
- #else /* def MSG_PEEK */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_PEEK */
- if ((x & Mono_Posix_MessageFlags_MSG_PROXY) == Mono_Posix_MessageFlags_MSG_PROXY)
- #ifdef MSG_PROXY
- *r |= MSG_PROXY;
- #else /* def MSG_PROXY */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_PROXY */
- if ((x & Mono_Posix_MessageFlags_MSG_RST) == Mono_Posix_MessageFlags_MSG_RST)
- #ifdef MSG_RST
- *r |= MSG_RST;
- #else /* def MSG_RST */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_RST */
- if ((x & Mono_Posix_MessageFlags_MSG_SYN) == Mono_Posix_MessageFlags_MSG_SYN)
- #ifdef MSG_SYN
- *r |= MSG_SYN;
- #else /* def MSG_SYN */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_SYN */
- if ((x & Mono_Posix_MessageFlags_MSG_TRUNC) == Mono_Posix_MessageFlags_MSG_TRUNC)
- #ifdef MSG_TRUNC
- *r |= MSG_TRUNC;
- #else /* def MSG_TRUNC */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_TRUNC */
- if ((x & Mono_Posix_MessageFlags_MSG_WAITALL) == Mono_Posix_MessageFlags_MSG_WAITALL)
- #ifdef MSG_WAITALL
- *r |= MSG_WAITALL;
- #else /* def MSG_WAITALL */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_WAITALL */
- if ((x & Mono_Posix_MessageFlags_MSG_WAITFORONE) == Mono_Posix_MessageFlags_MSG_WAITFORONE)
- #ifdef MSG_WAITFORONE
- *r |= MSG_WAITFORONE;
- #else /* def MSG_WAITFORONE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MSG_WAITFORONE */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToMessageFlags (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef MSG_CMSG_CLOEXEC
- if ((x & MSG_CMSG_CLOEXEC) == MSG_CMSG_CLOEXEC)
- *r |= Mono_Posix_MessageFlags_MSG_CMSG_CLOEXEC;
- #endif /* ndef MSG_CMSG_CLOEXEC */
- #ifdef MSG_CONFIRM
- if ((x & MSG_CONFIRM) == MSG_CONFIRM)
- *r |= Mono_Posix_MessageFlags_MSG_CONFIRM;
- #endif /* ndef MSG_CONFIRM */
- #ifdef MSG_CTRUNC
- if ((x & MSG_CTRUNC) == MSG_CTRUNC)
- *r |= Mono_Posix_MessageFlags_MSG_CTRUNC;
- #endif /* ndef MSG_CTRUNC */
- #ifdef MSG_DONTROUTE
- if ((x & MSG_DONTROUTE) == MSG_DONTROUTE)
- *r |= Mono_Posix_MessageFlags_MSG_DONTROUTE;
- #endif /* ndef MSG_DONTROUTE */
- #ifdef MSG_DONTWAIT
- if ((x & MSG_DONTWAIT) == MSG_DONTWAIT)
- *r |= Mono_Posix_MessageFlags_MSG_DONTWAIT;
- #endif /* ndef MSG_DONTWAIT */
- #ifdef MSG_EOR
- if ((x & MSG_EOR) == MSG_EOR)
- *r |= Mono_Posix_MessageFlags_MSG_EOR;
- #endif /* ndef MSG_EOR */
- #ifdef MSG_ERRQUEUE
- if ((x & MSG_ERRQUEUE) == MSG_ERRQUEUE)
- *r |= Mono_Posix_MessageFlags_MSG_ERRQUEUE;
- #endif /* ndef MSG_ERRQUEUE */
- #ifdef MSG_FASTOPEN
- if ((x & MSG_FASTOPEN) == MSG_FASTOPEN)
- *r |= Mono_Posix_MessageFlags_MSG_FASTOPEN;
- #endif /* ndef MSG_FASTOPEN */
- #ifdef MSG_FIN
- if ((x & MSG_FIN) == MSG_FIN)
- *r |= Mono_Posix_MessageFlags_MSG_FIN;
- #endif /* ndef MSG_FIN */
- #ifdef MSG_MORE
- if ((x & MSG_MORE) == MSG_MORE)
- *r |= Mono_Posix_MessageFlags_MSG_MORE;
- #endif /* ndef MSG_MORE */
- #ifdef MSG_NOSIGNAL
- if ((x & MSG_NOSIGNAL) == MSG_NOSIGNAL)
- *r |= Mono_Posix_MessageFlags_MSG_NOSIGNAL;
- #endif /* ndef MSG_NOSIGNAL */
- #ifdef MSG_OOB
- if ((x & MSG_OOB) == MSG_OOB)
- *r |= Mono_Posix_MessageFlags_MSG_OOB;
- #endif /* ndef MSG_OOB */
- #ifdef MSG_PEEK
- if ((x & MSG_PEEK) == MSG_PEEK)
- *r |= Mono_Posix_MessageFlags_MSG_PEEK;
- #endif /* ndef MSG_PEEK */
- #ifdef MSG_PROXY
- if ((x & MSG_PROXY) == MSG_PROXY)
- *r |= Mono_Posix_MessageFlags_MSG_PROXY;
- #endif /* ndef MSG_PROXY */
- #ifdef MSG_RST
- if ((x & MSG_RST) == MSG_RST)
- *r |= Mono_Posix_MessageFlags_MSG_RST;
- #endif /* ndef MSG_RST */
- #ifdef MSG_SYN
- if ((x & MSG_SYN) == MSG_SYN)
- *r |= Mono_Posix_MessageFlags_MSG_SYN;
- #endif /* ndef MSG_SYN */
- #ifdef MSG_TRUNC
- if ((x & MSG_TRUNC) == MSG_TRUNC)
- *r |= Mono_Posix_MessageFlags_MSG_TRUNC;
- #endif /* ndef MSG_TRUNC */
- #ifdef MSG_WAITALL
- if ((x & MSG_WAITALL) == MSG_WAITALL)
- *r |= Mono_Posix_MessageFlags_MSG_WAITALL;
- #endif /* ndef MSG_WAITALL */
- #ifdef MSG_WAITFORONE
- if ((x & MSG_WAITFORONE) == MSG_WAITFORONE)
- *r |= Mono_Posix_MessageFlags_MSG_WAITFORONE;
- #endif /* ndef MSG_WAITFORONE */
- return 0;
- }
- int Mono_Posix_FromMlockallFlags (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_MlockallFlags_MCL_CURRENT) == Mono_Posix_MlockallFlags_MCL_CURRENT)
- #ifdef MCL_CURRENT
- *r |= MCL_CURRENT;
- #else /* def MCL_CURRENT */
- {errno = EINVAL; return -1;}
- #endif /* ndef MCL_CURRENT */
- if ((x & Mono_Posix_MlockallFlags_MCL_FUTURE) == Mono_Posix_MlockallFlags_MCL_FUTURE)
- #ifdef MCL_FUTURE
- *r |= MCL_FUTURE;
- #else /* def MCL_FUTURE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MCL_FUTURE */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToMlockallFlags (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef MCL_CURRENT
- if ((x & MCL_CURRENT) == MCL_CURRENT)
- *r |= Mono_Posix_MlockallFlags_MCL_CURRENT;
- #endif /* ndef MCL_CURRENT */
- #ifdef MCL_FUTURE
- if ((x & MCL_FUTURE) == MCL_FUTURE)
- *r |= Mono_Posix_MlockallFlags_MCL_FUTURE;
- #endif /* ndef MCL_FUTURE */
- return 0;
- }
- int Mono_Posix_FromMmapFlags (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_MmapFlags_MAP_ANON) == Mono_Posix_MmapFlags_MAP_ANON)
- #ifdef MAP_ANON
- *r |= MAP_ANON;
- #else /* def MAP_ANON */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_ANON */
- if ((x & Mono_Posix_MmapFlags_MAP_ANONYMOUS) == Mono_Posix_MmapFlags_MAP_ANONYMOUS)
- #ifdef MAP_ANONYMOUS
- *r |= MAP_ANONYMOUS;
- #else /* def MAP_ANONYMOUS */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_ANONYMOUS */
- if ((x & Mono_Posix_MmapFlags_MAP_DENYWRITE) == Mono_Posix_MmapFlags_MAP_DENYWRITE)
- #ifdef MAP_DENYWRITE
- *r |= MAP_DENYWRITE;
- #else /* def MAP_DENYWRITE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_DENYWRITE */
- if ((x & Mono_Posix_MmapFlags_MAP_EXECUTABLE) == Mono_Posix_MmapFlags_MAP_EXECUTABLE)
- #ifdef MAP_EXECUTABLE
- *r |= MAP_EXECUTABLE;
- #else /* def MAP_EXECUTABLE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_EXECUTABLE */
- if ((x & Mono_Posix_MmapFlags_MAP_FILE) == Mono_Posix_MmapFlags_MAP_FILE)
- #ifdef MAP_FILE
- *r |= MAP_FILE;
- #else /* def MAP_FILE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_FILE */
- if ((x & Mono_Posix_MmapFlags_MAP_FIXED) == Mono_Posix_MmapFlags_MAP_FIXED)
- #ifdef MAP_FIXED
- *r |= MAP_FIXED;
- #else /* def MAP_FIXED */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_FIXED */
- if ((x & Mono_Posix_MmapFlags_MAP_GROWSDOWN) == Mono_Posix_MmapFlags_MAP_GROWSDOWN)
- #ifdef MAP_GROWSDOWN
- *r |= MAP_GROWSDOWN;
- #else /* def MAP_GROWSDOWN */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_GROWSDOWN */
- if ((x & Mono_Posix_MmapFlags_MAP_LOCKED) == Mono_Posix_MmapFlags_MAP_LOCKED)
- #ifdef MAP_LOCKED
- *r |= MAP_LOCKED;
- #else /* def MAP_LOCKED */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_LOCKED */
- if ((x & Mono_Posix_MmapFlags_MAP_NONBLOCK) == Mono_Posix_MmapFlags_MAP_NONBLOCK)
- #ifdef MAP_NONBLOCK
- *r |= MAP_NONBLOCK;
- #else /* def MAP_NONBLOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_NONBLOCK */
- if ((x & Mono_Posix_MmapFlags_MAP_NORESERVE) == Mono_Posix_MmapFlags_MAP_NORESERVE)
- #ifdef MAP_NORESERVE
- *r |= MAP_NORESERVE;
- #else /* def MAP_NORESERVE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_NORESERVE */
- if ((x & Mono_Posix_MmapFlags_MAP_POPULATE) == Mono_Posix_MmapFlags_MAP_POPULATE)
- #ifdef MAP_POPULATE
- *r |= MAP_POPULATE;
- #else /* def MAP_POPULATE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_POPULATE */
- if ((x & Mono_Posix_MmapFlags_MAP_PRIVATE) == Mono_Posix_MmapFlags_MAP_PRIVATE)
- #ifdef MAP_PRIVATE
- *r |= MAP_PRIVATE;
- #else /* def MAP_PRIVATE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_PRIVATE */
- if ((x & Mono_Posix_MmapFlags_MAP_SHARED) == Mono_Posix_MmapFlags_MAP_SHARED)
- #ifdef MAP_SHARED
- *r |= MAP_SHARED;
- #else /* def MAP_SHARED */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_SHARED */
- if ((x & Mono_Posix_MmapFlags_MAP_TYPE) == Mono_Posix_MmapFlags_MAP_TYPE)
- #ifdef MAP_TYPE
- *r |= MAP_TYPE;
- #else /* def MAP_TYPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MAP_TYPE */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToMmapFlags (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef MAP_ANON
- if ((x & MAP_ANON) == MAP_ANON)
- *r |= Mono_Posix_MmapFlags_MAP_ANON;
- #endif /* ndef MAP_ANON */
- #ifdef MAP_ANONYMOUS
- if ((x & MAP_ANONYMOUS) == MAP_ANONYMOUS)
- *r |= Mono_Posix_MmapFlags_MAP_ANONYMOUS;
- #endif /* ndef MAP_ANONYMOUS */
- #ifdef MAP_DENYWRITE
- if ((x & MAP_DENYWRITE) == MAP_DENYWRITE)
- *r |= Mono_Posix_MmapFlags_MAP_DENYWRITE;
- #endif /* ndef MAP_DENYWRITE */
- #ifdef MAP_EXECUTABLE
- if ((x & MAP_EXECUTABLE) == MAP_EXECUTABLE)
- *r |= Mono_Posix_MmapFlags_MAP_EXECUTABLE;
- #endif /* ndef MAP_EXECUTABLE */
- #ifdef MAP_FILE
- if ((x & MAP_FILE) == MAP_FILE)
- *r |= Mono_Posix_MmapFlags_MAP_FILE;
- #endif /* ndef MAP_FILE */
- #ifdef MAP_FIXED
- if ((x & MAP_FIXED) == MAP_FIXED)
- *r |= Mono_Posix_MmapFlags_MAP_FIXED;
- #endif /* ndef MAP_FIXED */
- #ifdef MAP_GROWSDOWN
- if ((x & MAP_GROWSDOWN) == MAP_GROWSDOWN)
- *r |= Mono_Posix_MmapFlags_MAP_GROWSDOWN;
- #endif /* ndef MAP_GROWSDOWN */
- #ifdef MAP_LOCKED
- if ((x & MAP_LOCKED) == MAP_LOCKED)
- *r |= Mono_Posix_MmapFlags_MAP_LOCKED;
- #endif /* ndef MAP_LOCKED */
- #ifdef MAP_NONBLOCK
- if ((x & MAP_NONBLOCK) == MAP_NONBLOCK)
- *r |= Mono_Posix_MmapFlags_MAP_NONBLOCK;
- #endif /* ndef MAP_NONBLOCK */
- #ifdef MAP_NORESERVE
- if ((x & MAP_NORESERVE) == MAP_NORESERVE)
- *r |= Mono_Posix_MmapFlags_MAP_NORESERVE;
- #endif /* ndef MAP_NORESERVE */
- #ifdef MAP_POPULATE
- if ((x & MAP_POPULATE) == MAP_POPULATE)
- *r |= Mono_Posix_MmapFlags_MAP_POPULATE;
- #endif /* ndef MAP_POPULATE */
- #ifdef MAP_PRIVATE
- if ((x & MAP_PRIVATE) == MAP_PRIVATE)
- *r |= Mono_Posix_MmapFlags_MAP_PRIVATE;
- #endif /* ndef MAP_PRIVATE */
- #ifdef MAP_SHARED
- if ((x & MAP_SHARED) == MAP_SHARED)
- *r |= Mono_Posix_MmapFlags_MAP_SHARED;
- #endif /* ndef MAP_SHARED */
- #ifdef MAP_TYPE
- if ((x & MAP_TYPE) == MAP_TYPE)
- *r |= Mono_Posix_MmapFlags_MAP_TYPE;
- #endif /* ndef MAP_TYPE */
- return 0;
- }
- int Mono_Posix_FromMmapProts (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_MmapProts_PROT_EXEC) == Mono_Posix_MmapProts_PROT_EXEC)
- #ifdef PROT_EXEC
- *r |= PROT_EXEC;
- #else /* def PROT_EXEC */
- {errno = EINVAL; return -1;}
- #endif /* ndef PROT_EXEC */
- if ((x & Mono_Posix_MmapProts_PROT_GROWSDOWN) == Mono_Posix_MmapProts_PROT_GROWSDOWN)
- #ifdef PROT_GROWSDOWN
- *r |= PROT_GROWSDOWN;
- #else /* def PROT_GROWSDOWN */
- {errno = EINVAL; return -1;}
- #endif /* ndef PROT_GROWSDOWN */
- if ((x & Mono_Posix_MmapProts_PROT_GROWSUP) == Mono_Posix_MmapProts_PROT_GROWSUP)
- #ifdef PROT_GROWSUP
- *r |= PROT_GROWSUP;
- #else /* def PROT_GROWSUP */
- {errno = EINVAL; return -1;}
- #endif /* ndef PROT_GROWSUP */
- if ((x & Mono_Posix_MmapProts_PROT_NONE) == Mono_Posix_MmapProts_PROT_NONE)
- #ifdef PROT_NONE
- *r |= PROT_NONE;
- #else /* def PROT_NONE */
- {errno = EINVAL; return -1;}
- #endif /* ndef PROT_NONE */
- if ((x & Mono_Posix_MmapProts_PROT_READ) == Mono_Posix_MmapProts_PROT_READ)
- #ifdef PROT_READ
- *r |= PROT_READ;
- #else /* def PROT_READ */
- {errno = EINVAL; return -1;}
- #endif /* ndef PROT_READ */
- if ((x & Mono_Posix_MmapProts_PROT_WRITE) == Mono_Posix_MmapProts_PROT_WRITE)
- #ifdef PROT_WRITE
- *r |= PROT_WRITE;
- #else /* def PROT_WRITE */
- {errno = EINVAL; return -1;}
- #endif /* ndef PROT_WRITE */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToMmapProts (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef PROT_EXEC
- if ((x & PROT_EXEC) == PROT_EXEC)
- *r |= Mono_Posix_MmapProts_PROT_EXEC;
- #endif /* ndef PROT_EXEC */
- #ifdef PROT_GROWSDOWN
- if ((x & PROT_GROWSDOWN) == PROT_GROWSDOWN)
- *r |= Mono_Posix_MmapProts_PROT_GROWSDOWN;
- #endif /* ndef PROT_GROWSDOWN */
- #ifdef PROT_GROWSUP
- if ((x & PROT_GROWSUP) == PROT_GROWSUP)
- *r |= Mono_Posix_MmapProts_PROT_GROWSUP;
- #endif /* ndef PROT_GROWSUP */
- #ifdef PROT_NONE
- if ((x & PROT_NONE) == PROT_NONE)
- *r |= Mono_Posix_MmapProts_PROT_NONE;
- #endif /* ndef PROT_NONE */
- #ifdef PROT_READ
- if ((x & PROT_READ) == PROT_READ)
- *r |= Mono_Posix_MmapProts_PROT_READ;
- #endif /* ndef PROT_READ */
- #ifdef PROT_WRITE
- if ((x & PROT_WRITE) == PROT_WRITE)
- *r |= Mono_Posix_MmapProts_PROT_WRITE;
- #endif /* ndef PROT_WRITE */
- return 0;
- }
- int Mono_Posix_FromMountFlags (guint64 x, guint64 *r)
- {
- *r = 0;
- if ((x & Mono_Posix_MountFlags_ST_APPEND) == Mono_Posix_MountFlags_ST_APPEND)
- #ifdef ST_APPEND
- *r |= ST_APPEND;
- #else /* def ST_APPEND */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_APPEND */
- if ((x & Mono_Posix_MountFlags_ST_BIND) == Mono_Posix_MountFlags_ST_BIND)
- #ifdef ST_BIND
- *r |= ST_BIND;
- #else /* def ST_BIND */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_BIND */
- if ((x & Mono_Posix_MountFlags_ST_IMMUTABLE) == Mono_Posix_MountFlags_ST_IMMUTABLE)
- #ifdef ST_IMMUTABLE
- *r |= ST_IMMUTABLE;
- #else /* def ST_IMMUTABLE */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_IMMUTABLE */
- if ((x & Mono_Posix_MountFlags_ST_MANDLOCK) == Mono_Posix_MountFlags_ST_MANDLOCK)
- #ifdef ST_MANDLOCK
- *r |= ST_MANDLOCK;
- #else /* def ST_MANDLOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_MANDLOCK */
- if ((x & Mono_Posix_MountFlags_ST_NOATIME) == Mono_Posix_MountFlags_ST_NOATIME)
- #ifdef ST_NOATIME
- *r |= ST_NOATIME;
- #else /* def ST_NOATIME */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_NOATIME */
- if ((x & Mono_Posix_MountFlags_ST_NODEV) == Mono_Posix_MountFlags_ST_NODEV)
- #ifdef ST_NODEV
- *r |= ST_NODEV;
- #else /* def ST_NODEV */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_NODEV */
- if ((x & Mono_Posix_MountFlags_ST_NODIRATIME) == Mono_Posix_MountFlags_ST_NODIRATIME)
- #ifdef ST_NODIRATIME
- *r |= ST_NODIRATIME;
- #else /* def ST_NODIRATIME */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_NODIRATIME */
- if ((x & Mono_Posix_MountFlags_ST_NOEXEC) == Mono_Posix_MountFlags_ST_NOEXEC)
- #ifdef ST_NOEXEC
- *r |= ST_NOEXEC;
- #else /* def ST_NOEXEC */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_NOEXEC */
- if ((x & Mono_Posix_MountFlags_ST_NOSUID) == Mono_Posix_MountFlags_ST_NOSUID)
- #ifdef ST_NOSUID
- *r |= ST_NOSUID;
- #else /* def ST_NOSUID */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_NOSUID */
- if ((x & Mono_Posix_MountFlags_ST_RDONLY) == Mono_Posix_MountFlags_ST_RDONLY)
- #ifdef ST_RDONLY
- *r |= ST_RDONLY;
- #else /* def ST_RDONLY */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_RDONLY */
- if ((x & Mono_Posix_MountFlags_ST_REMOUNT) == Mono_Posix_MountFlags_ST_REMOUNT)
- #ifdef ST_REMOUNT
- *r |= ST_REMOUNT;
- #else /* def ST_REMOUNT */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_REMOUNT */
- if ((x & Mono_Posix_MountFlags_ST_SYNCHRONOUS) == Mono_Posix_MountFlags_ST_SYNCHRONOUS)
- #ifdef ST_SYNCHRONOUS
- *r |= ST_SYNCHRONOUS;
- #else /* def ST_SYNCHRONOUS */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_SYNCHRONOUS */
- if ((x & Mono_Posix_MountFlags_ST_WRITE) == Mono_Posix_MountFlags_ST_WRITE)
- #ifdef ST_WRITE
- *r |= ST_WRITE;
- #else /* def ST_WRITE */
- {errno = EINVAL; return -1;}
- #endif /* ndef ST_WRITE */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToMountFlags (guint64 x, guint64 *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef ST_APPEND
- if ((x & ST_APPEND) == ST_APPEND)
- *r |= Mono_Posix_MountFlags_ST_APPEND;
- #endif /* ndef ST_APPEND */
- #ifdef ST_BIND
- if ((x & ST_BIND) == ST_BIND)
- *r |= Mono_Posix_MountFlags_ST_BIND;
- #endif /* ndef ST_BIND */
- #ifdef ST_IMMUTABLE
- if ((x & ST_IMMUTABLE) == ST_IMMUTABLE)
- *r |= Mono_Posix_MountFlags_ST_IMMUTABLE;
- #endif /* ndef ST_IMMUTABLE */
- #ifdef ST_MANDLOCK
- if ((x & ST_MANDLOCK) == ST_MANDLOCK)
- *r |= Mono_Posix_MountFlags_ST_MANDLOCK;
- #endif /* ndef ST_MANDLOCK */
- #ifdef ST_NOATIME
- if ((x & ST_NOATIME) == ST_NOATIME)
- *r |= Mono_Posix_MountFlags_ST_NOATIME;
- #endif /* ndef ST_NOATIME */
- #ifdef ST_NODEV
- if ((x & ST_NODEV) == ST_NODEV)
- *r |= Mono_Posix_MountFlags_ST_NODEV;
- #endif /* ndef ST_NODEV */
- #ifdef ST_NODIRATIME
- if ((x & ST_NODIRATIME) == ST_NODIRATIME)
- *r |= Mono_Posix_MountFlags_ST_NODIRATIME;
- #endif /* ndef ST_NODIRATIME */
- #ifdef ST_NOEXEC
- if ((x & ST_NOEXEC) == ST_NOEXEC)
- *r |= Mono_Posix_MountFlags_ST_NOEXEC;
- #endif /* ndef ST_NOEXEC */
- #ifdef ST_NOSUID
- if ((x & ST_NOSUID) == ST_NOSUID)
- *r |= Mono_Posix_MountFlags_ST_NOSUID;
- #endif /* ndef ST_NOSUID */
- #ifdef ST_RDONLY
- if ((x & ST_RDONLY) == ST_RDONLY)
- *r |= Mono_Posix_MountFlags_ST_RDONLY;
- #endif /* ndef ST_RDONLY */
- #ifdef ST_REMOUNT
- if ((x & ST_REMOUNT) == ST_REMOUNT)
- *r |= Mono_Posix_MountFlags_ST_REMOUNT;
- #endif /* ndef ST_REMOUNT */
- #ifdef ST_SYNCHRONOUS
- if ((x & ST_SYNCHRONOUS) == ST_SYNCHRONOUS)
- *r |= Mono_Posix_MountFlags_ST_SYNCHRONOUS;
- #endif /* ndef ST_SYNCHRONOUS */
- #ifdef ST_WRITE
- if ((x & ST_WRITE) == ST_WRITE)
- *r |= Mono_Posix_MountFlags_ST_WRITE;
- #endif /* ndef ST_WRITE */
- return 0;
- }
- int Mono_Posix_FromMremapFlags (guint64 x, guint64 *r)
- {
- *r = 0;
- if ((x & Mono_Posix_MremapFlags_MREMAP_MAYMOVE) == Mono_Posix_MremapFlags_MREMAP_MAYMOVE)
- #ifdef MREMAP_MAYMOVE
- *r |= MREMAP_MAYMOVE;
- #else /* def MREMAP_MAYMOVE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MREMAP_MAYMOVE */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToMremapFlags (guint64 x, guint64 *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef MREMAP_MAYMOVE
- if ((x & MREMAP_MAYMOVE) == MREMAP_MAYMOVE)
- *r |= Mono_Posix_MremapFlags_MREMAP_MAYMOVE;
- #endif /* ndef MREMAP_MAYMOVE */
- return 0;
- }
- int Mono_Posix_FromMsyncFlags (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_MsyncFlags_MS_ASYNC) == Mono_Posix_MsyncFlags_MS_ASYNC)
- #ifdef MS_ASYNC
- *r |= MS_ASYNC;
- #else /* def MS_ASYNC */
- {errno = EINVAL; return -1;}
- #endif /* ndef MS_ASYNC */
- if ((x & Mono_Posix_MsyncFlags_MS_INVALIDATE) == Mono_Posix_MsyncFlags_MS_INVALIDATE)
- #ifdef MS_INVALIDATE
- *r |= MS_INVALIDATE;
- #else /* def MS_INVALIDATE */
- {errno = EINVAL; return -1;}
- #endif /* ndef MS_INVALIDATE */
- if ((x & Mono_Posix_MsyncFlags_MS_SYNC) == Mono_Posix_MsyncFlags_MS_SYNC)
- #ifdef MS_SYNC
- *r |= MS_SYNC;
- #else /* def MS_SYNC */
- {errno = EINVAL; return -1;}
- #endif /* ndef MS_SYNC */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToMsyncFlags (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef MS_ASYNC
- if ((x & MS_ASYNC) == MS_ASYNC)
- *r |= Mono_Posix_MsyncFlags_MS_ASYNC;
- #endif /* ndef MS_ASYNC */
- #ifdef MS_INVALIDATE
- if ((x & MS_INVALIDATE) == MS_INVALIDATE)
- *r |= Mono_Posix_MsyncFlags_MS_INVALIDATE;
- #endif /* ndef MS_INVALIDATE */
- #ifdef MS_SYNC
- if ((x & MS_SYNC) == MS_SYNC)
- *r |= Mono_Posix_MsyncFlags_MS_SYNC;
- #endif /* ndef MS_SYNC */
- return 0;
- }
- int Mono_Posix_FromOpenFlags (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_OpenFlags_O_APPEND) == Mono_Posix_OpenFlags_O_APPEND)
- #ifdef O_APPEND
- *r |= O_APPEND;
- #else /* def O_APPEND */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_APPEND */
- if ((x & Mono_Posix_OpenFlags_O_ASYNC) == Mono_Posix_OpenFlags_O_ASYNC)
- #ifdef O_ASYNC
- *r |= O_ASYNC;
- #else /* def O_ASYNC */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_ASYNC */
- if ((x & Mono_Posix_OpenFlags_O_CLOEXEC) == Mono_Posix_OpenFlags_O_CLOEXEC)
- #ifdef O_CLOEXEC
- *r |= O_CLOEXEC;
- #else /* def O_CLOEXEC */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_CLOEXEC */
- if ((x & Mono_Posix_OpenFlags_O_CREAT) == Mono_Posix_OpenFlags_O_CREAT)
- #ifdef O_CREAT
- *r |= O_CREAT;
- #else /* def O_CREAT */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_CREAT */
- if ((x & Mono_Posix_OpenFlags_O_DIRECT) == Mono_Posix_OpenFlags_O_DIRECT)
- #ifdef O_DIRECT
- *r |= O_DIRECT;
- #else /* def O_DIRECT */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_DIRECT */
- if ((x & Mono_Posix_OpenFlags_O_DIRECTORY) == Mono_Posix_OpenFlags_O_DIRECTORY)
- #ifdef O_DIRECTORY
- *r |= O_DIRECTORY;
- #else /* def O_DIRECTORY */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_DIRECTORY */
- if ((x & Mono_Posix_OpenFlags_O_EXCL) == Mono_Posix_OpenFlags_O_EXCL)
- #ifdef O_EXCL
- *r |= O_EXCL;
- #else /* def O_EXCL */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_EXCL */
- if ((x & Mono_Posix_OpenFlags_O_LARGEFILE) == Mono_Posix_OpenFlags_O_LARGEFILE)
- #ifdef O_LARGEFILE
- *r |= O_LARGEFILE;
- #else /* def O_LARGEFILE */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_LARGEFILE */
- if ((x & Mono_Posix_OpenFlags_O_NOCTTY) == Mono_Posix_OpenFlags_O_NOCTTY)
- #ifdef O_NOCTTY
- *r |= O_NOCTTY;
- #else /* def O_NOCTTY */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_NOCTTY */
- if ((x & Mono_Posix_OpenFlags_O_NOFOLLOW) == Mono_Posix_OpenFlags_O_NOFOLLOW)
- #ifdef O_NOFOLLOW
- *r |= O_NOFOLLOW;
- #else /* def O_NOFOLLOW */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_NOFOLLOW */
- if ((x & Mono_Posix_OpenFlags_O_NONBLOCK) == Mono_Posix_OpenFlags_O_NONBLOCK)
- #ifdef O_NONBLOCK
- *r |= O_NONBLOCK;
- #else /* def O_NONBLOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_NONBLOCK */
- if ((x & Mono_Posix_OpenFlags_O_PATH) == Mono_Posix_OpenFlags_O_PATH)
- #ifdef O_PATH
- *r |= O_PATH;
- #else /* def O_PATH */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_PATH */
- if ((x & Mono_Posix_OpenFlags_O_RDONLY) == Mono_Posix_OpenFlags_O_RDONLY)
- #ifdef O_RDONLY
- *r |= O_RDONLY;
- #else /* def O_RDONLY */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_RDONLY */
- if ((x & Mono_Posix_OpenFlags_O_RDWR) == Mono_Posix_OpenFlags_O_RDWR)
- #ifdef O_RDWR
- *r |= O_RDWR;
- #else /* def O_RDWR */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_RDWR */
- if ((x & Mono_Posix_OpenFlags_O_SYNC) == Mono_Posix_OpenFlags_O_SYNC)
- #ifdef O_SYNC
- *r |= O_SYNC;
- #else /* def O_SYNC */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_SYNC */
- if ((x & Mono_Posix_OpenFlags_O_TRUNC) == Mono_Posix_OpenFlags_O_TRUNC)
- #ifdef O_TRUNC
- *r |= O_TRUNC;
- #else /* def O_TRUNC */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_TRUNC */
- if ((x & Mono_Posix_OpenFlags_O_WRONLY) == Mono_Posix_OpenFlags_O_WRONLY)
- #ifdef O_WRONLY
- *r |= O_WRONLY;
- #else /* def O_WRONLY */
- {errno = EINVAL; return -1;}
- #endif /* ndef O_WRONLY */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToOpenFlags (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef O_APPEND
- if ((x & O_APPEND) == O_APPEND)
- *r |= Mono_Posix_OpenFlags_O_APPEND;
- #endif /* ndef O_APPEND */
- #ifdef O_ASYNC
- if ((x & O_ASYNC) == O_ASYNC)
- *r |= Mono_Posix_OpenFlags_O_ASYNC;
- #endif /* ndef O_ASYNC */
- #ifdef O_CLOEXEC
- if ((x & O_CLOEXEC) == O_CLOEXEC)
- *r |= Mono_Posix_OpenFlags_O_CLOEXEC;
- #endif /* ndef O_CLOEXEC */
- #ifdef O_CREAT
- if ((x & O_CREAT) == O_CREAT)
- *r |= Mono_Posix_OpenFlags_O_CREAT;
- #endif /* ndef O_CREAT */
- #ifdef O_DIRECT
- if ((x & O_DIRECT) == O_DIRECT)
- *r |= Mono_Posix_OpenFlags_O_DIRECT;
- #endif /* ndef O_DIRECT */
- #ifdef O_DIRECTORY
- if ((x & O_DIRECTORY) == O_DIRECTORY)
- *r |= Mono_Posix_OpenFlags_O_DIRECTORY;
- #endif /* ndef O_DIRECTORY */
- #ifdef O_EXCL
- if ((x & O_EXCL) == O_EXCL)
- *r |= Mono_Posix_OpenFlags_O_EXCL;
- #endif /* ndef O_EXCL */
- #ifdef O_LARGEFILE
- if ((x & O_LARGEFILE) == O_LARGEFILE)
- *r |= Mono_Posix_OpenFlags_O_LARGEFILE;
- #endif /* ndef O_LARGEFILE */
- #ifdef O_NOCTTY
- if ((x & O_NOCTTY) == O_NOCTTY)
- *r |= Mono_Posix_OpenFlags_O_NOCTTY;
- #endif /* ndef O_NOCTTY */
- #ifdef O_NOFOLLOW
- if ((x & O_NOFOLLOW) == O_NOFOLLOW)
- *r |= Mono_Posix_OpenFlags_O_NOFOLLOW;
- #endif /* ndef O_NOFOLLOW */
- #ifdef O_NONBLOCK
- if ((x & O_NONBLOCK) == O_NONBLOCK)
- *r |= Mono_Posix_OpenFlags_O_NONBLOCK;
- #endif /* ndef O_NONBLOCK */
- #ifdef O_PATH
- if ((x & O_PATH) == O_PATH)
- *r |= Mono_Posix_OpenFlags_O_PATH;
- #endif /* ndef O_PATH */
- #ifdef O_RDONLY
- if ((x & O_RDONLY) == O_RDONLY)
- *r |= Mono_Posix_OpenFlags_O_RDONLY;
- #endif /* ndef O_RDONLY */
- #ifdef O_RDWR
- if ((x & O_RDWR) == O_RDWR)
- *r |= Mono_Posix_OpenFlags_O_RDWR;
- #endif /* ndef O_RDWR */
- #ifdef O_SYNC
- if ((x & O_SYNC) == O_SYNC)
- *r |= Mono_Posix_OpenFlags_O_SYNC;
- #endif /* ndef O_SYNC */
- #ifdef O_TRUNC
- if ((x & O_TRUNC) == O_TRUNC)
- *r |= Mono_Posix_OpenFlags_O_TRUNC;
- #endif /* ndef O_TRUNC */
- #ifdef O_WRONLY
- if ((x & O_WRONLY) == O_WRONLY)
- *r |= Mono_Posix_OpenFlags_O_WRONLY;
- #endif /* ndef O_WRONLY */
- return 0;
- }
- int Mono_Posix_FromPathconfName (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_PathconfName__PC_2_SYMLINKS)
- #ifdef _PC_2_SYMLINKS
- {*r = _PC_2_SYMLINKS; return 0;}
- #else /* def _PC_2_SYMLINKS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_2_SYMLINKS */
- if (x == Mono_Posix_PathconfName__PC_ALLOC_SIZE_MIN)
- #ifdef _PC_ALLOC_SIZE_MIN
- {*r = _PC_ALLOC_SIZE_MIN; return 0;}
- #else /* def _PC_ALLOC_SIZE_MIN */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_ALLOC_SIZE_MIN */
- if (x == Mono_Posix_PathconfName__PC_ASYNC_IO)
- #ifdef _PC_ASYNC_IO
- {*r = _PC_ASYNC_IO; return 0;}
- #else /* def _PC_ASYNC_IO */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_ASYNC_IO */
- if (x == Mono_Posix_PathconfName__PC_CHOWN_RESTRICTED)
- #ifdef _PC_CHOWN_RESTRICTED
- {*r = _PC_CHOWN_RESTRICTED; return 0;}
- #else /* def _PC_CHOWN_RESTRICTED */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_CHOWN_RESTRICTED */
- if (x == Mono_Posix_PathconfName__PC_FILESIZEBITS)
- #ifdef _PC_FILESIZEBITS
- {*r = _PC_FILESIZEBITS; return 0;}
- #else /* def _PC_FILESIZEBITS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_FILESIZEBITS */
- if (x == Mono_Posix_PathconfName__PC_LINK_MAX)
- #ifdef _PC_LINK_MAX
- {*r = _PC_LINK_MAX; return 0;}
- #else /* def _PC_LINK_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_LINK_MAX */
- if (x == Mono_Posix_PathconfName__PC_MAX_CANON)
- #ifdef _PC_MAX_CANON
- {*r = _PC_MAX_CANON; return 0;}
- #else /* def _PC_MAX_CANON */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_MAX_CANON */
- if (x == Mono_Posix_PathconfName__PC_MAX_INPUT)
- #ifdef _PC_MAX_INPUT
- {*r = _PC_MAX_INPUT; return 0;}
- #else /* def _PC_MAX_INPUT */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_MAX_INPUT */
- if (x == Mono_Posix_PathconfName__PC_NAME_MAX)
- #ifdef _PC_NAME_MAX
- {*r = _PC_NAME_MAX; return 0;}
- #else /* def _PC_NAME_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_NAME_MAX */
- if (x == Mono_Posix_PathconfName__PC_NO_TRUNC)
- #ifdef _PC_NO_TRUNC
- {*r = _PC_NO_TRUNC; return 0;}
- #else /* def _PC_NO_TRUNC */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_NO_TRUNC */
- if (x == Mono_Posix_PathconfName__PC_PATH_MAX)
- #ifdef _PC_PATH_MAX
- {*r = _PC_PATH_MAX; return 0;}
- #else /* def _PC_PATH_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_PATH_MAX */
- if (x == Mono_Posix_PathconfName__PC_PIPE_BUF)
- #ifdef _PC_PIPE_BUF
- {*r = _PC_PIPE_BUF; return 0;}
- #else /* def _PC_PIPE_BUF */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_PIPE_BUF */
- if (x == Mono_Posix_PathconfName__PC_PRIO_IO)
- #ifdef _PC_PRIO_IO
- {*r = _PC_PRIO_IO; return 0;}
- #else /* def _PC_PRIO_IO */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_PRIO_IO */
- if (x == Mono_Posix_PathconfName__PC_REC_INCR_XFER_SIZE)
- #ifdef _PC_REC_INCR_XFER_SIZE
- {*r = _PC_REC_INCR_XFER_SIZE; return 0;}
- #else /* def _PC_REC_INCR_XFER_SIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_REC_INCR_XFER_SIZE */
- if (x == Mono_Posix_PathconfName__PC_REC_MAX_XFER_SIZE)
- #ifdef _PC_REC_MAX_XFER_SIZE
- {*r = _PC_REC_MAX_XFER_SIZE; return 0;}
- #else /* def _PC_REC_MAX_XFER_SIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_REC_MAX_XFER_SIZE */
- if (x == Mono_Posix_PathconfName__PC_REC_MIN_XFER_SIZE)
- #ifdef _PC_REC_MIN_XFER_SIZE
- {*r = _PC_REC_MIN_XFER_SIZE; return 0;}
- #else /* def _PC_REC_MIN_XFER_SIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_REC_MIN_XFER_SIZE */
- if (x == Mono_Posix_PathconfName__PC_REC_XFER_ALIGN)
- #ifdef _PC_REC_XFER_ALIGN
- {*r = _PC_REC_XFER_ALIGN; return 0;}
- #else /* def _PC_REC_XFER_ALIGN */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_REC_XFER_ALIGN */
- if (x == Mono_Posix_PathconfName__PC_SOCK_MAXBUF)
- #ifdef _PC_SOCK_MAXBUF
- {*r = _PC_SOCK_MAXBUF; return 0;}
- #else /* def _PC_SOCK_MAXBUF */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_SOCK_MAXBUF */
- if (x == Mono_Posix_PathconfName__PC_SYMLINK_MAX)
- #ifdef _PC_SYMLINK_MAX
- {*r = _PC_SYMLINK_MAX; return 0;}
- #else /* def _PC_SYMLINK_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_SYMLINK_MAX */
- if (x == Mono_Posix_PathconfName__PC_SYNC_IO)
- #ifdef _PC_SYNC_IO
- {*r = _PC_SYNC_IO; return 0;}
- #else /* def _PC_SYNC_IO */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_SYNC_IO */
- if (x == Mono_Posix_PathconfName__PC_VDISABLE)
- #ifdef _PC_VDISABLE
- {*r = _PC_VDISABLE; return 0;}
- #else /* def _PC_VDISABLE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _PC_VDISABLE */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToPathconfName (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef _PC_2_SYMLINKS
- if (x == _PC_2_SYMLINKS)
- {*r = Mono_Posix_PathconfName__PC_2_SYMLINKS; return 0;}
- #endif /* ndef _PC_2_SYMLINKS */
- #ifdef _PC_ALLOC_SIZE_MIN
- if (x == _PC_ALLOC_SIZE_MIN)
- {*r = Mono_Posix_PathconfName__PC_ALLOC_SIZE_MIN; return 0;}
- #endif /* ndef _PC_ALLOC_SIZE_MIN */
- #ifdef _PC_ASYNC_IO
- if (x == _PC_ASYNC_IO)
- {*r = Mono_Posix_PathconfName__PC_ASYNC_IO; return 0;}
- #endif /* ndef _PC_ASYNC_IO */
- #ifdef _PC_CHOWN_RESTRICTED
- if (x == _PC_CHOWN_RESTRICTED)
- {*r = Mono_Posix_PathconfName__PC_CHOWN_RESTRICTED; return 0;}
- #endif /* ndef _PC_CHOWN_RESTRICTED */
- #ifdef _PC_FILESIZEBITS
- if (x == _PC_FILESIZEBITS)
- {*r = Mono_Posix_PathconfName__PC_FILESIZEBITS; return 0;}
- #endif /* ndef _PC_FILESIZEBITS */
- #ifdef _PC_LINK_MAX
- if (x == _PC_LINK_MAX)
- {*r = Mono_Posix_PathconfName__PC_LINK_MAX; return 0;}
- #endif /* ndef _PC_LINK_MAX */
- #ifdef _PC_MAX_CANON
- if (x == _PC_MAX_CANON)
- {*r = Mono_Posix_PathconfName__PC_MAX_CANON; return 0;}
- #endif /* ndef _PC_MAX_CANON */
- #ifdef _PC_MAX_INPUT
- if (x == _PC_MAX_INPUT)
- {*r = Mono_Posix_PathconfName__PC_MAX_INPUT; return 0;}
- #endif /* ndef _PC_MAX_INPUT */
- #ifdef _PC_NAME_MAX
- if (x == _PC_NAME_MAX)
- {*r = Mono_Posix_PathconfName__PC_NAME_MAX; return 0;}
- #endif /* ndef _PC_NAME_MAX */
- #ifdef _PC_NO_TRUNC
- if (x == _PC_NO_TRUNC)
- {*r = Mono_Posix_PathconfName__PC_NO_TRUNC; return 0;}
- #endif /* ndef _PC_NO_TRUNC */
- #ifdef _PC_PATH_MAX
- if (x == _PC_PATH_MAX)
- {*r = Mono_Posix_PathconfName__PC_PATH_MAX; return 0;}
- #endif /* ndef _PC_PATH_MAX */
- #ifdef _PC_PIPE_BUF
- if (x == _PC_PIPE_BUF)
- {*r = Mono_Posix_PathconfName__PC_PIPE_BUF; return 0;}
- #endif /* ndef _PC_PIPE_BUF */
- #ifdef _PC_PRIO_IO
- if (x == _PC_PRIO_IO)
- {*r = Mono_Posix_PathconfName__PC_PRIO_IO; return 0;}
- #endif /* ndef _PC_PRIO_IO */
- #ifdef _PC_REC_INCR_XFER_SIZE
- if (x == _PC_REC_INCR_XFER_SIZE)
- {*r = Mono_Posix_PathconfName__PC_REC_INCR_XFER_SIZE; return 0;}
- #endif /* ndef _PC_REC_INCR_XFER_SIZE */
- #ifdef _PC_REC_MAX_XFER_SIZE
- if (x == _PC_REC_MAX_XFER_SIZE)
- {*r = Mono_Posix_PathconfName__PC_REC_MAX_XFER_SIZE; return 0;}
- #endif /* ndef _PC_REC_MAX_XFER_SIZE */
- #ifdef _PC_REC_MIN_XFER_SIZE
- if (x == _PC_REC_MIN_XFER_SIZE)
- {*r = Mono_Posix_PathconfName__PC_REC_MIN_XFER_SIZE; return 0;}
- #endif /* ndef _PC_REC_MIN_XFER_SIZE */
- #ifdef _PC_REC_XFER_ALIGN
- if (x == _PC_REC_XFER_ALIGN)
- {*r = Mono_Posix_PathconfName__PC_REC_XFER_ALIGN; return 0;}
- #endif /* ndef _PC_REC_XFER_ALIGN */
- #ifdef _PC_SOCK_MAXBUF
- if (x == _PC_SOCK_MAXBUF)
- {*r = Mono_Posix_PathconfName__PC_SOCK_MAXBUF; return 0;}
- #endif /* ndef _PC_SOCK_MAXBUF */
- #ifdef _PC_SYMLINK_MAX
- if (x == _PC_SYMLINK_MAX)
- {*r = Mono_Posix_PathconfName__PC_SYMLINK_MAX; return 0;}
- #endif /* ndef _PC_SYMLINK_MAX */
- #ifdef _PC_SYNC_IO
- if (x == _PC_SYNC_IO)
- {*r = Mono_Posix_PathconfName__PC_SYNC_IO; return 0;}
- #endif /* ndef _PC_SYNC_IO */
- #ifdef _PC_VDISABLE
- if (x == _PC_VDISABLE)
- {*r = Mono_Posix_PathconfName__PC_VDISABLE; return 0;}
- #endif /* ndef _PC_VDISABLE */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromPollEvents (short x, short *r)
- {
- *r = 0;
- if ((x & Mono_Posix_PollEvents_POLLERR) == Mono_Posix_PollEvents_POLLERR)
- #ifdef POLLERR
- *r |= POLLERR;
- #else /* def POLLERR */
- {errno = EINVAL; return -1;}
- #endif /* ndef POLLERR */
- if ((x & Mono_Posix_PollEvents_POLLHUP) == Mono_Posix_PollEvents_POLLHUP)
- #ifdef POLLHUP
- *r |= POLLHUP;
- #else /* def POLLHUP */
- {errno = EINVAL; return -1;}
- #endif /* ndef POLLHUP */
- if ((x & Mono_Posix_PollEvents_POLLIN) == Mono_Posix_PollEvents_POLLIN)
- #ifdef POLLIN
- *r |= POLLIN;
- #else /* def POLLIN */
- {errno = EINVAL; return -1;}
- #endif /* ndef POLLIN */
- if ((x & Mono_Posix_PollEvents_POLLNVAL) == Mono_Posix_PollEvents_POLLNVAL)
- #ifdef POLLNVAL
- *r |= POLLNVAL;
- #else /* def POLLNVAL */
- {errno = EINVAL; return -1;}
- #endif /* ndef POLLNVAL */
- if ((x & Mono_Posix_PollEvents_POLLOUT) == Mono_Posix_PollEvents_POLLOUT)
- #ifdef POLLOUT
- *r |= POLLOUT;
- #else /* def POLLOUT */
- {errno = EINVAL; return -1;}
- #endif /* ndef POLLOUT */
- if ((x & Mono_Posix_PollEvents_POLLPRI) == Mono_Posix_PollEvents_POLLPRI)
- #ifdef POLLPRI
- *r |= POLLPRI;
- #else /* def POLLPRI */
- {errno = EINVAL; return -1;}
- #endif /* ndef POLLPRI */
- if ((x & Mono_Posix_PollEvents_POLLRDBAND) == Mono_Posix_PollEvents_POLLRDBAND)
- #ifdef POLLRDBAND
- *r |= POLLRDBAND;
- #else /* def POLLRDBAND */
- {errno = EINVAL; return -1;}
- #endif /* ndef POLLRDBAND */
- if ((x & Mono_Posix_PollEvents_POLLRDNORM) == Mono_Posix_PollEvents_POLLRDNORM)
- #ifdef POLLRDNORM
- *r |= POLLRDNORM;
- #else /* def POLLRDNORM */
- {errno = EINVAL; return -1;}
- #endif /* ndef POLLRDNORM */
- if ((x & Mono_Posix_PollEvents_POLLWRBAND) == Mono_Posix_PollEvents_POLLWRBAND)
- #ifdef POLLWRBAND
- *r |= POLLWRBAND;
- #else /* def POLLWRBAND */
- {errno = EINVAL; return -1;}
- #endif /* ndef POLLWRBAND */
- if ((x & Mono_Posix_PollEvents_POLLWRNORM) == Mono_Posix_PollEvents_POLLWRNORM)
- #ifdef POLLWRNORM
- *r |= POLLWRNORM;
- #else /* def POLLWRNORM */
- {errno = EINVAL; return -1;}
- #endif /* ndef POLLWRNORM */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToPollEvents (short x, short *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef POLLERR
- if ((x & POLLERR) == POLLERR)
- *r |= Mono_Posix_PollEvents_POLLERR;
- #endif /* ndef POLLERR */
- #ifdef POLLHUP
- if ((x & POLLHUP) == POLLHUP)
- *r |= Mono_Posix_PollEvents_POLLHUP;
- #endif /* ndef POLLHUP */
- #ifdef POLLIN
- if ((x & POLLIN) == POLLIN)
- *r |= Mono_Posix_PollEvents_POLLIN;
- #endif /* ndef POLLIN */
- #ifdef POLLNVAL
- if ((x & POLLNVAL) == POLLNVAL)
- *r |= Mono_Posix_PollEvents_POLLNVAL;
- #endif /* ndef POLLNVAL */
- #ifdef POLLOUT
- if ((x & POLLOUT) == POLLOUT)
- *r |= Mono_Posix_PollEvents_POLLOUT;
- #endif /* ndef POLLOUT */
- #ifdef POLLPRI
- if ((x & POLLPRI) == POLLPRI)
- *r |= Mono_Posix_PollEvents_POLLPRI;
- #endif /* ndef POLLPRI */
- #ifdef POLLRDBAND
- if ((x & POLLRDBAND) == POLLRDBAND)
- *r |= Mono_Posix_PollEvents_POLLRDBAND;
- #endif /* ndef POLLRDBAND */
- #ifdef POLLRDNORM
- if ((x & POLLRDNORM) == POLLRDNORM)
- *r |= Mono_Posix_PollEvents_POLLRDNORM;
- #endif /* ndef POLLRDNORM */
- #ifdef POLLWRBAND
- if ((x & POLLWRBAND) == POLLWRBAND)
- *r |= Mono_Posix_PollEvents_POLLWRBAND;
- #endif /* ndef POLLWRBAND */
- #ifdef POLLWRNORM
- if ((x & POLLWRNORM) == POLLWRNORM)
- *r |= Mono_Posix_PollEvents_POLLWRNORM;
- #endif /* ndef POLLWRNORM */
- return 0;
- }
- #ifdef HAVE_STRUCT_POLLFD
- int
- Mono_Posix_FromPollfd (struct Mono_Posix_Pollfd *from, struct pollfd *to)
- {
- _cnm_return_val_if_overflow (int, from->fd, -1);
- memset (to, 0, sizeof(*to));
- to->fd = from->fd;
- if (Mono_Posix_FromPollEvents (from->events, &to->events) != 0) {
- return -1;
- }
- if (Mono_Posix_FromPollEvents (from->revents, &to->revents) != 0) {
- return -1;
- }
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_POLLFD */
- #ifdef HAVE_STRUCT_POLLFD
- int
- Mono_Posix_ToPollfd (struct pollfd *from, struct Mono_Posix_Pollfd *to)
- {
- _cnm_return_val_if_overflow (int, from->fd, -1);
- memset (to, 0, sizeof(*to));
- to->fd = from->fd;
- if (Mono_Posix_ToPollEvents (from->events, &to->events) != 0) {
- return -1;
- }
- if (Mono_Posix_ToPollEvents (from->revents, &to->revents) != 0) {
- return -1;
- }
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_POLLFD */
- int Mono_Posix_FromPosixFadviseAdvice (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_PosixFadviseAdvice_POSIX_FADV_DONTNEED)
- #ifdef POSIX_FADV_DONTNEED
- {*r = POSIX_FADV_DONTNEED; return 0;}
- #else /* def POSIX_FADV_DONTNEED */
- {errno = EINVAL; return -1;}
- #endif /* ndef POSIX_FADV_DONTNEED */
- if (x == Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NOREUSE)
- #ifdef POSIX_FADV_NOREUSE
- {*r = POSIX_FADV_NOREUSE; return 0;}
- #else /* def POSIX_FADV_NOREUSE */
- {errno = EINVAL; return -1;}
- #endif /* ndef POSIX_FADV_NOREUSE */
- if (x == Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NORMAL)
- #ifdef POSIX_FADV_NORMAL
- {*r = POSIX_FADV_NORMAL; return 0;}
- #else /* def POSIX_FADV_NORMAL */
- {errno = EINVAL; return -1;}
- #endif /* ndef POSIX_FADV_NORMAL */
- if (x == Mono_Posix_PosixFadviseAdvice_POSIX_FADV_RANDOM)
- #ifdef POSIX_FADV_RANDOM
- {*r = POSIX_FADV_RANDOM; return 0;}
- #else /* def POSIX_FADV_RANDOM */
- {errno = EINVAL; return -1;}
- #endif /* ndef POSIX_FADV_RANDOM */
- if (x == Mono_Posix_PosixFadviseAdvice_POSIX_FADV_SEQUENTIAL)
- #ifdef POSIX_FADV_SEQUENTIAL
- {*r = POSIX_FADV_SEQUENTIAL; return 0;}
- #else /* def POSIX_FADV_SEQUENTIAL */
- {errno = EINVAL; return -1;}
- #endif /* ndef POSIX_FADV_SEQUENTIAL */
- if (x == Mono_Posix_PosixFadviseAdvice_POSIX_FADV_WILLNEED)
- #ifdef POSIX_FADV_WILLNEED
- {*r = POSIX_FADV_WILLNEED; return 0;}
- #else /* def POSIX_FADV_WILLNEED */
- {errno = EINVAL; return -1;}
- #endif /* ndef POSIX_FADV_WILLNEED */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToPosixFadviseAdvice (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef POSIX_FADV_DONTNEED
- if (x == POSIX_FADV_DONTNEED)
- {*r = Mono_Posix_PosixFadviseAdvice_POSIX_FADV_DONTNEED; return 0;}
- #endif /* ndef POSIX_FADV_DONTNEED */
- #ifdef POSIX_FADV_NOREUSE
- if (x == POSIX_FADV_NOREUSE)
- {*r = Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NOREUSE; return 0;}
- #endif /* ndef POSIX_FADV_NOREUSE */
- #ifdef POSIX_FADV_NORMAL
- if (x == POSIX_FADV_NORMAL)
- {*r = Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NORMAL; return 0;}
- #endif /* ndef POSIX_FADV_NORMAL */
- #ifdef POSIX_FADV_RANDOM
- if (x == POSIX_FADV_RANDOM)
- {*r = Mono_Posix_PosixFadviseAdvice_POSIX_FADV_RANDOM; return 0;}
- #endif /* ndef POSIX_FADV_RANDOM */
- #ifdef POSIX_FADV_SEQUENTIAL
- if (x == POSIX_FADV_SEQUENTIAL)
- {*r = Mono_Posix_PosixFadviseAdvice_POSIX_FADV_SEQUENTIAL; return 0;}
- #endif /* ndef POSIX_FADV_SEQUENTIAL */
- #ifdef POSIX_FADV_WILLNEED
- if (x == POSIX_FADV_WILLNEED)
- {*r = Mono_Posix_PosixFadviseAdvice_POSIX_FADV_WILLNEED; return 0;}
- #endif /* ndef POSIX_FADV_WILLNEED */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromPosixMadviseAdvice (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_PosixMadviseAdvice_POSIX_MADV_DONTNEED)
- #ifdef POSIX_MADV_DONTNEED
- {*r = POSIX_MADV_DONTNEED; return 0;}
- #else /* def POSIX_MADV_DONTNEED */
- {errno = EINVAL; return -1;}
- #endif /* ndef POSIX_MADV_DONTNEED */
- if (x == Mono_Posix_PosixMadviseAdvice_POSIX_MADV_NORMAL)
- #ifdef POSIX_MADV_NORMAL
- {*r = POSIX_MADV_NORMAL; return 0;}
- #else /* def POSIX_MADV_NORMAL */
- {errno = EINVAL; return -1;}
- #endif /* ndef POSIX_MADV_NORMAL */
- if (x == Mono_Posix_PosixMadviseAdvice_POSIX_MADV_RANDOM)
- #ifdef POSIX_MADV_RANDOM
- {*r = POSIX_MADV_RANDOM; return 0;}
- #else /* def POSIX_MADV_RANDOM */
- {errno = EINVAL; return -1;}
- #endif /* ndef POSIX_MADV_RANDOM */
- if (x == Mono_Posix_PosixMadviseAdvice_POSIX_MADV_SEQUENTIAL)
- #ifdef POSIX_MADV_SEQUENTIAL
- {*r = POSIX_MADV_SEQUENTIAL; return 0;}
- #else /* def POSIX_MADV_SEQUENTIAL */
- {errno = EINVAL; return -1;}
- #endif /* ndef POSIX_MADV_SEQUENTIAL */
- if (x == Mono_Posix_PosixMadviseAdvice_POSIX_MADV_WILLNEED)
- #ifdef POSIX_MADV_WILLNEED
- {*r = POSIX_MADV_WILLNEED; return 0;}
- #else /* def POSIX_MADV_WILLNEED */
- {errno = EINVAL; return -1;}
- #endif /* ndef POSIX_MADV_WILLNEED */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToPosixMadviseAdvice (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef POSIX_MADV_DONTNEED
- if (x == POSIX_MADV_DONTNEED)
- {*r = Mono_Posix_PosixMadviseAdvice_POSIX_MADV_DONTNEED; return 0;}
- #endif /* ndef POSIX_MADV_DONTNEED */
- #ifdef POSIX_MADV_NORMAL
- if (x == POSIX_MADV_NORMAL)
- {*r = Mono_Posix_PosixMadviseAdvice_POSIX_MADV_NORMAL; return 0;}
- #endif /* ndef POSIX_MADV_NORMAL */
- #ifdef POSIX_MADV_RANDOM
- if (x == POSIX_MADV_RANDOM)
- {*r = Mono_Posix_PosixMadviseAdvice_POSIX_MADV_RANDOM; return 0;}
- #endif /* ndef POSIX_MADV_RANDOM */
- #ifdef POSIX_MADV_SEQUENTIAL
- if (x == POSIX_MADV_SEQUENTIAL)
- {*r = Mono_Posix_PosixMadviseAdvice_POSIX_MADV_SEQUENTIAL; return 0;}
- #endif /* ndef POSIX_MADV_SEQUENTIAL */
- #ifdef POSIX_MADV_WILLNEED
- if (x == POSIX_MADV_WILLNEED)
- {*r = Mono_Posix_PosixMadviseAdvice_POSIX_MADV_WILLNEED; return 0;}
- #endif /* ndef POSIX_MADV_WILLNEED */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromSeekFlags (short x, short *r)
- {
- *r = 0;
- if (x == Mono_Posix_SeekFlags_L_INCR)
- #ifdef L_INCR
- {*r = L_INCR; return 0;}
- #else /* def L_INCR */
- {errno = EINVAL; return -1;}
- #endif /* ndef L_INCR */
- if (x == Mono_Posix_SeekFlags_L_SET)
- #ifdef L_SET
- {*r = L_SET; return 0;}
- #else /* def L_SET */
- {errno = EINVAL; return -1;}
- #endif /* ndef L_SET */
- if (x == Mono_Posix_SeekFlags_L_XTND)
- #ifdef L_XTND
- {*r = L_XTND; return 0;}
- #else /* def L_XTND */
- {errno = EINVAL; return -1;}
- #endif /* ndef L_XTND */
- if (x == Mono_Posix_SeekFlags_SEEK_CUR)
- #ifdef SEEK_CUR
- {*r = SEEK_CUR; return 0;}
- #else /* def SEEK_CUR */
- {errno = EINVAL; return -1;}
- #endif /* ndef SEEK_CUR */
- if (x == Mono_Posix_SeekFlags_SEEK_END)
- #ifdef SEEK_END
- {*r = SEEK_END; return 0;}
- #else /* def SEEK_END */
- {errno = EINVAL; return -1;}
- #endif /* ndef SEEK_END */
- if (x == Mono_Posix_SeekFlags_SEEK_SET)
- #ifdef SEEK_SET
- {*r = SEEK_SET; return 0;}
- #else /* def SEEK_SET */
- {errno = EINVAL; return -1;}
- #endif /* ndef SEEK_SET */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToSeekFlags (short x, short *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef L_INCR
- if (x == L_INCR)
- {*r = Mono_Posix_SeekFlags_L_INCR; return 0;}
- #endif /* ndef L_INCR */
- #ifdef L_SET
- if (x == L_SET)
- {*r = Mono_Posix_SeekFlags_L_SET; return 0;}
- #endif /* ndef L_SET */
- #ifdef L_XTND
- if (x == L_XTND)
- {*r = Mono_Posix_SeekFlags_L_XTND; return 0;}
- #endif /* ndef L_XTND */
- #ifdef SEEK_CUR
- if (x == SEEK_CUR)
- {*r = Mono_Posix_SeekFlags_SEEK_CUR; return 0;}
- #endif /* ndef SEEK_CUR */
- #ifdef SEEK_END
- if (x == SEEK_END)
- {*r = Mono_Posix_SeekFlags_SEEK_END; return 0;}
- #endif /* ndef SEEK_END */
- #ifdef SEEK_SET
- if (x == SEEK_SET)
- {*r = Mono_Posix_SeekFlags_SEEK_SET; return 0;}
- #endif /* ndef SEEK_SET */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromShutdownOption (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_ShutdownOption_SHUT_RD)
- #ifdef SHUT_RD
- {*r = SHUT_RD; return 0;}
- #else /* def SHUT_RD */
- {errno = EINVAL; return -1;}
- #endif /* ndef SHUT_RD */
- if (x == Mono_Posix_ShutdownOption_SHUT_RDWR)
- #ifdef SHUT_RDWR
- {*r = SHUT_RDWR; return 0;}
- #else /* def SHUT_RDWR */
- {errno = EINVAL; return -1;}
- #endif /* ndef SHUT_RDWR */
- if (x == Mono_Posix_ShutdownOption_SHUT_WR)
- #ifdef SHUT_WR
- {*r = SHUT_WR; return 0;}
- #else /* def SHUT_WR */
- {errno = EINVAL; return -1;}
- #endif /* ndef SHUT_WR */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToShutdownOption (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef SHUT_RD
- if (x == SHUT_RD)
- {*r = Mono_Posix_ShutdownOption_SHUT_RD; return 0;}
- #endif /* ndef SHUT_RD */
- #ifdef SHUT_RDWR
- if (x == SHUT_RDWR)
- {*r = Mono_Posix_ShutdownOption_SHUT_RDWR; return 0;}
- #endif /* ndef SHUT_RDWR */
- #ifdef SHUT_WR
- if (x == SHUT_WR)
- {*r = Mono_Posix_ShutdownOption_SHUT_WR; return 0;}
- #endif /* ndef SHUT_WR */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromSignum (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_Signum_SIGABRT)
- #ifdef SIGABRT
- {*r = SIGABRT; return 0;}
- #else /* def SIGABRT */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGABRT */
- if (x == Mono_Posix_Signum_SIGALRM)
- #ifdef SIGALRM
- {*r = SIGALRM; return 0;}
- #else /* def SIGALRM */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGALRM */
- if (x == Mono_Posix_Signum_SIGBUS)
- #ifdef SIGBUS
- {*r = SIGBUS; return 0;}
- #else /* def SIGBUS */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGBUS */
- if (x == Mono_Posix_Signum_SIGCHLD)
- #ifdef SIGCHLD
- {*r = SIGCHLD; return 0;}
- #else /* def SIGCHLD */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGCHLD */
- if (x == Mono_Posix_Signum_SIGCLD)
- #ifdef SIGCLD
- {*r = SIGCLD; return 0;}
- #else /* def SIGCLD */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGCLD */
- if (x == Mono_Posix_Signum_SIGCONT)
- #ifdef SIGCONT
- {*r = SIGCONT; return 0;}
- #else /* def SIGCONT */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGCONT */
- if (x == Mono_Posix_Signum_SIGFPE)
- #ifdef SIGFPE
- {*r = SIGFPE; return 0;}
- #else /* def SIGFPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGFPE */
- if (x == Mono_Posix_Signum_SIGHUP)
- #ifdef SIGHUP
- {*r = SIGHUP; return 0;}
- #else /* def SIGHUP */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGHUP */
- if (x == Mono_Posix_Signum_SIGILL)
- #ifdef SIGILL
- {*r = SIGILL; return 0;}
- #else /* def SIGILL */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGILL */
- if (x == Mono_Posix_Signum_SIGINT)
- #ifdef SIGINT
- {*r = SIGINT; return 0;}
- #else /* def SIGINT */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGINT */
- if (x == Mono_Posix_Signum_SIGIO)
- #ifdef SIGIO
- {*r = SIGIO; return 0;}
- #else /* def SIGIO */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGIO */
- if (x == Mono_Posix_Signum_SIGIOT)
- #ifdef SIGIOT
- {*r = SIGIOT; return 0;}
- #else /* def SIGIOT */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGIOT */
- if (x == Mono_Posix_Signum_SIGKILL)
- #ifdef SIGKILL
- {*r = SIGKILL; return 0;}
- #else /* def SIGKILL */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGKILL */
- if (x == Mono_Posix_Signum_SIGPIPE)
- #ifdef SIGPIPE
- {*r = SIGPIPE; return 0;}
- #else /* def SIGPIPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGPIPE */
- if (x == Mono_Posix_Signum_SIGPOLL)
- #ifdef SIGPOLL
- {*r = SIGPOLL; return 0;}
- #else /* def SIGPOLL */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGPOLL */
- if (x == Mono_Posix_Signum_SIGPROF)
- #ifdef SIGPROF
- {*r = SIGPROF; return 0;}
- #else /* def SIGPROF */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGPROF */
- if (x == Mono_Posix_Signum_SIGPWR)
- #ifdef SIGPWR
- {*r = SIGPWR; return 0;}
- #else /* def SIGPWR */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGPWR */
- if (x == Mono_Posix_Signum_SIGQUIT)
- #ifdef SIGQUIT
- {*r = SIGQUIT; return 0;}
- #else /* def SIGQUIT */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGQUIT */
- if (x == Mono_Posix_Signum_SIGSEGV)
- #ifdef SIGSEGV
- {*r = SIGSEGV; return 0;}
- #else /* def SIGSEGV */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGSEGV */
- if (x == Mono_Posix_Signum_SIGSTKFLT)
- #ifdef SIGSTKFLT
- {*r = SIGSTKFLT; return 0;}
- #else /* def SIGSTKFLT */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGSTKFLT */
- if (x == Mono_Posix_Signum_SIGSTOP)
- #ifdef SIGSTOP
- {*r = SIGSTOP; return 0;}
- #else /* def SIGSTOP */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGSTOP */
- if (x == Mono_Posix_Signum_SIGSYS)
- #ifdef SIGSYS
- {*r = SIGSYS; return 0;}
- #else /* def SIGSYS */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGSYS */
- if (x == Mono_Posix_Signum_SIGTERM)
- #ifdef SIGTERM
- {*r = SIGTERM; return 0;}
- #else /* def SIGTERM */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGTERM */
- if (x == Mono_Posix_Signum_SIGTRAP)
- #ifdef SIGTRAP
- {*r = SIGTRAP; return 0;}
- #else /* def SIGTRAP */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGTRAP */
- if (x == Mono_Posix_Signum_SIGTSTP)
- #ifdef SIGTSTP
- {*r = SIGTSTP; return 0;}
- #else /* def SIGTSTP */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGTSTP */
- if (x == Mono_Posix_Signum_SIGTTIN)
- #ifdef SIGTTIN
- {*r = SIGTTIN; return 0;}
- #else /* def SIGTTIN */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGTTIN */
- if (x == Mono_Posix_Signum_SIGTTOU)
- #ifdef SIGTTOU
- {*r = SIGTTOU; return 0;}
- #else /* def SIGTTOU */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGTTOU */
- if (x == Mono_Posix_Signum_SIGUNUSED)
- #ifdef SIGUNUSED
- {*r = SIGUNUSED; return 0;}
- #else /* def SIGUNUSED */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGUNUSED */
- if (x == Mono_Posix_Signum_SIGURG)
- #ifdef SIGURG
- {*r = SIGURG; return 0;}
- #else /* def SIGURG */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGURG */
- if (x == Mono_Posix_Signum_SIGUSR1)
- #ifdef SIGUSR1
- {*r = SIGUSR1; return 0;}
- #else /* def SIGUSR1 */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGUSR1 */
- if (x == Mono_Posix_Signum_SIGUSR2)
- #ifdef SIGUSR2
- {*r = SIGUSR2; return 0;}
- #else /* def SIGUSR2 */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGUSR2 */
- if (x == Mono_Posix_Signum_SIGVTALRM)
- #ifdef SIGVTALRM
- {*r = SIGVTALRM; return 0;}
- #else /* def SIGVTALRM */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGVTALRM */
- if (x == Mono_Posix_Signum_SIGWINCH)
- #ifdef SIGWINCH
- {*r = SIGWINCH; return 0;}
- #else /* def SIGWINCH */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGWINCH */
- if (x == Mono_Posix_Signum_SIGXCPU)
- #ifdef SIGXCPU
- {*r = SIGXCPU; return 0;}
- #else /* def SIGXCPU */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGXCPU */
- if (x == Mono_Posix_Signum_SIGXFSZ)
- #ifdef SIGXFSZ
- {*r = SIGXFSZ; return 0;}
- #else /* def SIGXFSZ */
- {errno = EINVAL; return -1;}
- #endif /* ndef SIGXFSZ */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToSignum (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef SIGABRT
- if (x == SIGABRT)
- {*r = Mono_Posix_Signum_SIGABRT; return 0;}
- #endif /* ndef SIGABRT */
- #ifdef SIGALRM
- if (x == SIGALRM)
- {*r = Mono_Posix_Signum_SIGALRM; return 0;}
- #endif /* ndef SIGALRM */
- #ifdef SIGBUS
- if (x == SIGBUS)
- {*r = Mono_Posix_Signum_SIGBUS; return 0;}
- #endif /* ndef SIGBUS */
- #ifdef SIGCHLD
- if (x == SIGCHLD)
- {*r = Mono_Posix_Signum_SIGCHLD; return 0;}
- #endif /* ndef SIGCHLD */
- #ifdef SIGCLD
- if (x == SIGCLD)
- {*r = Mono_Posix_Signum_SIGCLD; return 0;}
- #endif /* ndef SIGCLD */
- #ifdef SIGCONT
- if (x == SIGCONT)
- {*r = Mono_Posix_Signum_SIGCONT; return 0;}
- #endif /* ndef SIGCONT */
- #ifdef SIGFPE
- if (x == SIGFPE)
- {*r = Mono_Posix_Signum_SIGFPE; return 0;}
- #endif /* ndef SIGFPE */
- #ifdef SIGHUP
- if (x == SIGHUP)
- {*r = Mono_Posix_Signum_SIGHUP; return 0;}
- #endif /* ndef SIGHUP */
- #ifdef SIGILL
- if (x == SIGILL)
- {*r = Mono_Posix_Signum_SIGILL; return 0;}
- #endif /* ndef SIGILL */
- #ifdef SIGINT
- if (x == SIGINT)
- {*r = Mono_Posix_Signum_SIGINT; return 0;}
- #endif /* ndef SIGINT */
- #ifdef SIGIO
- if (x == SIGIO)
- {*r = Mono_Posix_Signum_SIGIO; return 0;}
- #endif /* ndef SIGIO */
- #ifdef SIGIOT
- if (x == SIGIOT)
- {*r = Mono_Posix_Signum_SIGIOT; return 0;}
- #endif /* ndef SIGIOT */
- #ifdef SIGKILL
- if (x == SIGKILL)
- {*r = Mono_Posix_Signum_SIGKILL; return 0;}
- #endif /* ndef SIGKILL */
- #ifdef SIGPIPE
- if (x == SIGPIPE)
- {*r = Mono_Posix_Signum_SIGPIPE; return 0;}
- #endif /* ndef SIGPIPE */
- #ifdef SIGPOLL
- if (x == SIGPOLL)
- {*r = Mono_Posix_Signum_SIGPOLL; return 0;}
- #endif /* ndef SIGPOLL */
- #ifdef SIGPROF
- if (x == SIGPROF)
- {*r = Mono_Posix_Signum_SIGPROF; return 0;}
- #endif /* ndef SIGPROF */
- #ifdef SIGPWR
- if (x == SIGPWR)
- {*r = Mono_Posix_Signum_SIGPWR; return 0;}
- #endif /* ndef SIGPWR */
- #ifdef SIGQUIT
- if (x == SIGQUIT)
- {*r = Mono_Posix_Signum_SIGQUIT; return 0;}
- #endif /* ndef SIGQUIT */
- #ifdef SIGSEGV
- if (x == SIGSEGV)
- {*r = Mono_Posix_Signum_SIGSEGV; return 0;}
- #endif /* ndef SIGSEGV */
- #ifdef SIGSTKFLT
- if (x == SIGSTKFLT)
- {*r = Mono_Posix_Signum_SIGSTKFLT; return 0;}
- #endif /* ndef SIGSTKFLT */
- #ifdef SIGSTOP
- if (x == SIGSTOP)
- {*r = Mono_Posix_Signum_SIGSTOP; return 0;}
- #endif /* ndef SIGSTOP */
- #ifdef SIGSYS
- if (x == SIGSYS)
- {*r = Mono_Posix_Signum_SIGSYS; return 0;}
- #endif /* ndef SIGSYS */
- #ifdef SIGTERM
- if (x == SIGTERM)
- {*r = Mono_Posix_Signum_SIGTERM; return 0;}
- #endif /* ndef SIGTERM */
- #ifdef SIGTRAP
- if (x == SIGTRAP)
- {*r = Mono_Posix_Signum_SIGTRAP; return 0;}
- #endif /* ndef SIGTRAP */
- #ifdef SIGTSTP
- if (x == SIGTSTP)
- {*r = Mono_Posix_Signum_SIGTSTP; return 0;}
- #endif /* ndef SIGTSTP */
- #ifdef SIGTTIN
- if (x == SIGTTIN)
- {*r = Mono_Posix_Signum_SIGTTIN; return 0;}
- #endif /* ndef SIGTTIN */
- #ifdef SIGTTOU
- if (x == SIGTTOU)
- {*r = Mono_Posix_Signum_SIGTTOU; return 0;}
- #endif /* ndef SIGTTOU */
- #ifdef SIGUNUSED
- if (x == SIGUNUSED)
- {*r = Mono_Posix_Signum_SIGUNUSED; return 0;}
- #endif /* ndef SIGUNUSED */
- #ifdef SIGURG
- if (x == SIGURG)
- {*r = Mono_Posix_Signum_SIGURG; return 0;}
- #endif /* ndef SIGURG */
- #ifdef SIGUSR1
- if (x == SIGUSR1)
- {*r = Mono_Posix_Signum_SIGUSR1; return 0;}
- #endif /* ndef SIGUSR1 */
- #ifdef SIGUSR2
- if (x == SIGUSR2)
- {*r = Mono_Posix_Signum_SIGUSR2; return 0;}
- #endif /* ndef SIGUSR2 */
- #ifdef SIGVTALRM
- if (x == SIGVTALRM)
- {*r = Mono_Posix_Signum_SIGVTALRM; return 0;}
- #endif /* ndef SIGVTALRM */
- #ifdef SIGWINCH
- if (x == SIGWINCH)
- {*r = Mono_Posix_Signum_SIGWINCH; return 0;}
- #endif /* ndef SIGWINCH */
- #ifdef SIGXCPU
- if (x == SIGXCPU)
- {*r = Mono_Posix_Signum_SIGXCPU; return 0;}
- #endif /* ndef SIGXCPU */
- #ifdef SIGXFSZ
- if (x == SIGXFSZ)
- {*r = Mono_Posix_Signum_SIGXFSZ; return 0;}
- #endif /* ndef SIGXFSZ */
- errno = EINVAL; return -1;
- }
- #ifdef HAVE_STRUCT_SOCKADDR_IN
- int
- Mono_Posix_FromSockaddrIn (struct Mono_Posix_SockaddrIn *from, struct sockaddr_in *to)
- {
- _cnm_return_val_if_overflow (unsigned short, from->sin_port, -1);
- memset (to, 0, sizeof(*to));
- to->sin_port = from->sin_port;
- if (Mono_Posix_FromInAddr (&from->sin_addr, &to->sin_addr) != 0) {
- return -1;
- }
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_SOCKADDR_IN */
- #ifdef HAVE_STRUCT_SOCKADDR_IN
- int
- Mono_Posix_ToSockaddrIn (struct sockaddr_in *from, struct Mono_Posix_SockaddrIn *to)
- {
- _cnm_return_val_if_overflow (unsigned short, from->sin_port, -1);
- memset (to, 0, sizeof(*to));
- to->sin_port = from->sin_port;
- if (Mono_Posix_ToInAddr (&from->sin_addr, &to->sin_addr) != 0) {
- return -1;
- }
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_SOCKADDR_IN */
- #ifdef HAVE_STRUCT_SOCKADDR_IN6
- int
- Mono_Posix_FromSockaddrIn6 (struct Mono_Posix_SockaddrIn6 *from, struct sockaddr_in6 *to)
- {
- _cnm_return_val_if_overflow (unsigned short, from->sin6_port, -1);
- _cnm_return_val_if_overflow (unsigned int, from->sin6_flowinfo, -1);
- _cnm_return_val_if_overflow (unsigned int, from->sin6_scope_id, -1);
- memset (to, 0, sizeof(*to));
- to->sin6_port = from->sin6_port;
- to->sin6_flowinfo = from->sin6_flowinfo;
- if (Mono_Posix_FromIn6Addr (&from->sin6_addr, &to->sin6_addr) != 0) {
- return -1;
- }
- to->sin6_scope_id = from->sin6_scope_id;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_SOCKADDR_IN6 */
- #ifdef HAVE_STRUCT_SOCKADDR_IN6
- int
- Mono_Posix_ToSockaddrIn6 (struct sockaddr_in6 *from, struct Mono_Posix_SockaddrIn6 *to)
- {
- _cnm_return_val_if_overflow (unsigned short, from->sin6_port, -1);
- _cnm_return_val_if_overflow (unsigned int, from->sin6_flowinfo, -1);
- _cnm_return_val_if_overflow (unsigned int, from->sin6_scope_id, -1);
- memset (to, 0, sizeof(*to));
- to->sin6_port = from->sin6_port;
- to->sin6_flowinfo = from->sin6_flowinfo;
- if (Mono_Posix_ToIn6Addr (&from->sin6_addr, &to->sin6_addr) != 0) {
- return -1;
- }
- to->sin6_scope_id = from->sin6_scope_id;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_SOCKADDR_IN6 */
- int Mono_Posix_FromSockaddrType (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_SockaddrType_Invalid)
- #ifdef Invalid
- {*r = Invalid; return 0;}
- #else /* def Invalid */
- {errno = EINVAL; return -1;}
- #endif /* ndef Invalid */
- if (x == Mono_Posix_SockaddrType_MustBeWrapped)
- #ifdef MustBeWrapped
- {*r = MustBeWrapped; return 0;}
- #else /* def MustBeWrapped */
- {errno = EINVAL; return -1;}
- #endif /* ndef MustBeWrapped */
- if (x == Mono_Posix_SockaddrType_Sockaddr)
- #ifdef Sockaddr
- {*r = Sockaddr; return 0;}
- #else /* def Sockaddr */
- {errno = EINVAL; return -1;}
- #endif /* ndef Sockaddr */
- if (x == Mono_Posix_SockaddrType_SockaddrIn)
- #ifdef SockaddrIn
- {*r = SockaddrIn; return 0;}
- #else /* def SockaddrIn */
- {errno = EINVAL; return -1;}
- #endif /* ndef SockaddrIn */
- if (x == Mono_Posix_SockaddrType_SockaddrIn6)
- #ifdef SockaddrIn6
- {*r = SockaddrIn6; return 0;}
- #else /* def SockaddrIn6 */
- {errno = EINVAL; return -1;}
- #endif /* ndef SockaddrIn6 */
- if (x == Mono_Posix_SockaddrType_SockaddrStorage)
- #ifdef SockaddrStorage
- {*r = SockaddrStorage; return 0;}
- #else /* def SockaddrStorage */
- {errno = EINVAL; return -1;}
- #endif /* ndef SockaddrStorage */
- if (x == Mono_Posix_SockaddrType_SockaddrUn)
- #ifdef SockaddrUn
- {*r = SockaddrUn; return 0;}
- #else /* def SockaddrUn */
- {errno = EINVAL; return -1;}
- #endif /* ndef SockaddrUn */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToSockaddrType (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef Invalid
- if (x == Invalid)
- {*r = Mono_Posix_SockaddrType_Invalid; return 0;}
- #endif /* ndef Invalid */
- #ifdef MustBeWrapped
- if (x == MustBeWrapped)
- {*r = Mono_Posix_SockaddrType_MustBeWrapped; return 0;}
- #endif /* ndef MustBeWrapped */
- #ifdef Sockaddr
- if (x == Sockaddr)
- {*r = Mono_Posix_SockaddrType_Sockaddr; return 0;}
- #endif /* ndef Sockaddr */
- #ifdef SockaddrIn
- if (x == SockaddrIn)
- {*r = Mono_Posix_SockaddrType_SockaddrIn; return 0;}
- #endif /* ndef SockaddrIn */
- #ifdef SockaddrIn6
- if (x == SockaddrIn6)
- {*r = Mono_Posix_SockaddrType_SockaddrIn6; return 0;}
- #endif /* ndef SockaddrIn6 */
- #ifdef SockaddrStorage
- if (x == SockaddrStorage)
- {*r = Mono_Posix_SockaddrType_SockaddrStorage; return 0;}
- #endif /* ndef SockaddrStorage */
- #ifdef SockaddrUn
- if (x == SockaddrUn)
- {*r = Mono_Posix_SockaddrType_SockaddrUn; return 0;}
- #endif /* ndef SockaddrUn */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromSysconfName (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_SysconfName__SC_2_CHAR_TERM)
- #ifdef _SC_2_CHAR_TERM
- {*r = _SC_2_CHAR_TERM; return 0;}
- #else /* def _SC_2_CHAR_TERM */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_CHAR_TERM */
- if (x == Mono_Posix_SysconfName__SC_2_C_BIND)
- #ifdef _SC_2_C_BIND
- {*r = _SC_2_C_BIND; return 0;}
- #else /* def _SC_2_C_BIND */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_C_BIND */
- if (x == Mono_Posix_SysconfName__SC_2_C_DEV)
- #ifdef _SC_2_C_DEV
- {*r = _SC_2_C_DEV; return 0;}
- #else /* def _SC_2_C_DEV */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_C_DEV */
- if (x == Mono_Posix_SysconfName__SC_2_C_VERSION)
- #ifdef _SC_2_C_VERSION
- {*r = _SC_2_C_VERSION; return 0;}
- #else /* def _SC_2_C_VERSION */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_C_VERSION */
- if (x == Mono_Posix_SysconfName__SC_2_FORT_DEV)
- #ifdef _SC_2_FORT_DEV
- {*r = _SC_2_FORT_DEV; return 0;}
- #else /* def _SC_2_FORT_DEV */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_FORT_DEV */
- if (x == Mono_Posix_SysconfName__SC_2_FORT_RUN)
- #ifdef _SC_2_FORT_RUN
- {*r = _SC_2_FORT_RUN; return 0;}
- #else /* def _SC_2_FORT_RUN */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_FORT_RUN */
- if (x == Mono_Posix_SysconfName__SC_2_LOCALEDEF)
- #ifdef _SC_2_LOCALEDEF
- {*r = _SC_2_LOCALEDEF; return 0;}
- #else /* def _SC_2_LOCALEDEF */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_LOCALEDEF */
- if (x == Mono_Posix_SysconfName__SC_2_PBS)
- #ifdef _SC_2_PBS
- {*r = _SC_2_PBS; return 0;}
- #else /* def _SC_2_PBS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_PBS */
- if (x == Mono_Posix_SysconfName__SC_2_PBS_ACCOUNTING)
- #ifdef _SC_2_PBS_ACCOUNTING
- {*r = _SC_2_PBS_ACCOUNTING; return 0;}
- #else /* def _SC_2_PBS_ACCOUNTING */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_PBS_ACCOUNTING */
- if (x == Mono_Posix_SysconfName__SC_2_PBS_CHECKPOINT)
- #ifdef _SC_2_PBS_CHECKPOINT
- {*r = _SC_2_PBS_CHECKPOINT; return 0;}
- #else /* def _SC_2_PBS_CHECKPOINT */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_PBS_CHECKPOINT */
- if (x == Mono_Posix_SysconfName__SC_2_PBS_LOCATE)
- #ifdef _SC_2_PBS_LOCATE
- {*r = _SC_2_PBS_LOCATE; return 0;}
- #else /* def _SC_2_PBS_LOCATE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_PBS_LOCATE */
- if (x == Mono_Posix_SysconfName__SC_2_PBS_MESSAGE)
- #ifdef _SC_2_PBS_MESSAGE
- {*r = _SC_2_PBS_MESSAGE; return 0;}
- #else /* def _SC_2_PBS_MESSAGE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_PBS_MESSAGE */
- if (x == Mono_Posix_SysconfName__SC_2_PBS_TRACK)
- #ifdef _SC_2_PBS_TRACK
- {*r = _SC_2_PBS_TRACK; return 0;}
- #else /* def _SC_2_PBS_TRACK */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_PBS_TRACK */
- if (x == Mono_Posix_SysconfName__SC_2_SW_DEV)
- #ifdef _SC_2_SW_DEV
- {*r = _SC_2_SW_DEV; return 0;}
- #else /* def _SC_2_SW_DEV */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_SW_DEV */
- if (x == Mono_Posix_SysconfName__SC_2_UPE)
- #ifdef _SC_2_UPE
- {*r = _SC_2_UPE; return 0;}
- #else /* def _SC_2_UPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_UPE */
- if (x == Mono_Posix_SysconfName__SC_2_VERSION)
- #ifdef _SC_2_VERSION
- {*r = _SC_2_VERSION; return 0;}
- #else /* def _SC_2_VERSION */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_2_VERSION */
- if (x == Mono_Posix_SysconfName__SC_ADVISORY_INFO)
- #ifdef _SC_ADVISORY_INFO
- {*r = _SC_ADVISORY_INFO; return 0;}
- #else /* def _SC_ADVISORY_INFO */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_ADVISORY_INFO */
- if (x == Mono_Posix_SysconfName__SC_AIO_LISTIO_MAX)
- #ifdef _SC_AIO_LISTIO_MAX
- {*r = _SC_AIO_LISTIO_MAX; return 0;}
- #else /* def _SC_AIO_LISTIO_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_AIO_LISTIO_MAX */
- if (x == Mono_Posix_SysconfName__SC_AIO_MAX)
- #ifdef _SC_AIO_MAX
- {*r = _SC_AIO_MAX; return 0;}
- #else /* def _SC_AIO_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_AIO_MAX */
- if (x == Mono_Posix_SysconfName__SC_AIO_PRIO_DELTA_MAX)
- #ifdef _SC_AIO_PRIO_DELTA_MAX
- {*r = _SC_AIO_PRIO_DELTA_MAX; return 0;}
- #else /* def _SC_AIO_PRIO_DELTA_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_AIO_PRIO_DELTA_MAX */
- if (x == Mono_Posix_SysconfName__SC_ARG_MAX)
- #ifdef _SC_ARG_MAX
- {*r = _SC_ARG_MAX; return 0;}
- #else /* def _SC_ARG_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_ARG_MAX */
- if (x == Mono_Posix_SysconfName__SC_ASYNCHRONOUS_IO)
- #ifdef _SC_ASYNCHRONOUS_IO
- {*r = _SC_ASYNCHRONOUS_IO; return 0;}
- #else /* def _SC_ASYNCHRONOUS_IO */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_ASYNCHRONOUS_IO */
- if (x == Mono_Posix_SysconfName__SC_ATEXIT_MAX)
- #ifdef _SC_ATEXIT_MAX
- {*r = _SC_ATEXIT_MAX; return 0;}
- #else /* def _SC_ATEXIT_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_ATEXIT_MAX */
- if (x == Mono_Posix_SysconfName__SC_AVPHYS_PAGES)
- #ifdef _SC_AVPHYS_PAGES
- {*r = _SC_AVPHYS_PAGES; return 0;}
- #else /* def _SC_AVPHYS_PAGES */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_AVPHYS_PAGES */
- if (x == Mono_Posix_SysconfName__SC_BARRIERS)
- #ifdef _SC_BARRIERS
- {*r = _SC_BARRIERS; return 0;}
- #else /* def _SC_BARRIERS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_BARRIERS */
- if (x == Mono_Posix_SysconfName__SC_BASE)
- #ifdef _SC_BASE
- {*r = _SC_BASE; return 0;}
- #else /* def _SC_BASE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_BASE */
- if (x == Mono_Posix_SysconfName__SC_BC_BASE_MAX)
- #ifdef _SC_BC_BASE_MAX
- {*r = _SC_BC_BASE_MAX; return 0;}
- #else /* def _SC_BC_BASE_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_BC_BASE_MAX */
- if (x == Mono_Posix_SysconfName__SC_BC_DIM_MAX)
- #ifdef _SC_BC_DIM_MAX
- {*r = _SC_BC_DIM_MAX; return 0;}
- #else /* def _SC_BC_DIM_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_BC_DIM_MAX */
- if (x == Mono_Posix_SysconfName__SC_BC_SCALE_MAX)
- #ifdef _SC_BC_SCALE_MAX
- {*r = _SC_BC_SCALE_MAX; return 0;}
- #else /* def _SC_BC_SCALE_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_BC_SCALE_MAX */
- if (x == Mono_Posix_SysconfName__SC_BC_STRING_MAX)
- #ifdef _SC_BC_STRING_MAX
- {*r = _SC_BC_STRING_MAX; return 0;}
- #else /* def _SC_BC_STRING_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_BC_STRING_MAX */
- if (x == Mono_Posix_SysconfName__SC_CHARCLASS_NAME_MAX)
- #ifdef _SC_CHARCLASS_NAME_MAX
- {*r = _SC_CHARCLASS_NAME_MAX; return 0;}
- #else /* def _SC_CHARCLASS_NAME_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_CHARCLASS_NAME_MAX */
- if (x == Mono_Posix_SysconfName__SC_CHAR_BIT)
- #ifdef _SC_CHAR_BIT
- {*r = _SC_CHAR_BIT; return 0;}
- #else /* def _SC_CHAR_BIT */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_CHAR_BIT */
- if (x == Mono_Posix_SysconfName__SC_CHAR_MAX)
- #ifdef _SC_CHAR_MAX
- {*r = _SC_CHAR_MAX; return 0;}
- #else /* def _SC_CHAR_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_CHAR_MAX */
- if (x == Mono_Posix_SysconfName__SC_CHAR_MIN)
- #ifdef _SC_CHAR_MIN
- {*r = _SC_CHAR_MIN; return 0;}
- #else /* def _SC_CHAR_MIN */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_CHAR_MIN */
- if (x == Mono_Posix_SysconfName__SC_CHILD_MAX)
- #ifdef _SC_CHILD_MAX
- {*r = _SC_CHILD_MAX; return 0;}
- #else /* def _SC_CHILD_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_CHILD_MAX */
- if (x == Mono_Posix_SysconfName__SC_CLK_TCK)
- #ifdef _SC_CLK_TCK
- {*r = _SC_CLK_TCK; return 0;}
- #else /* def _SC_CLK_TCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_CLK_TCK */
- if (x == Mono_Posix_SysconfName__SC_CLOCK_SELECTION)
- #ifdef _SC_CLOCK_SELECTION
- {*r = _SC_CLOCK_SELECTION; return 0;}
- #else /* def _SC_CLOCK_SELECTION */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_CLOCK_SELECTION */
- if (x == Mono_Posix_SysconfName__SC_COLL_WEIGHTS_MAX)
- #ifdef _SC_COLL_WEIGHTS_MAX
- {*r = _SC_COLL_WEIGHTS_MAX; return 0;}
- #else /* def _SC_COLL_WEIGHTS_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_COLL_WEIGHTS_MAX */
- if (x == Mono_Posix_SysconfName__SC_CPUTIME)
- #ifdef _SC_CPUTIME
- {*r = _SC_CPUTIME; return 0;}
- #else /* def _SC_CPUTIME */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_CPUTIME */
- if (x == Mono_Posix_SysconfName__SC_C_LANG_SUPPORT)
- #ifdef _SC_C_LANG_SUPPORT
- {*r = _SC_C_LANG_SUPPORT; return 0;}
- #else /* def _SC_C_LANG_SUPPORT */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_C_LANG_SUPPORT */
- if (x == Mono_Posix_SysconfName__SC_C_LANG_SUPPORT_R)
- #ifdef _SC_C_LANG_SUPPORT_R
- {*r = _SC_C_LANG_SUPPORT_R; return 0;}
- #else /* def _SC_C_LANG_SUPPORT_R */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_C_LANG_SUPPORT_R */
- if (x == Mono_Posix_SysconfName__SC_DELAYTIMER_MAX)
- #ifdef _SC_DELAYTIMER_MAX
- {*r = _SC_DELAYTIMER_MAX; return 0;}
- #else /* def _SC_DELAYTIMER_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_DELAYTIMER_MAX */
- if (x == Mono_Posix_SysconfName__SC_DEVICE_IO)
- #ifdef _SC_DEVICE_IO
- {*r = _SC_DEVICE_IO; return 0;}
- #else /* def _SC_DEVICE_IO */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_DEVICE_IO */
- if (x == Mono_Posix_SysconfName__SC_DEVICE_SPECIFIC)
- #ifdef _SC_DEVICE_SPECIFIC
- {*r = _SC_DEVICE_SPECIFIC; return 0;}
- #else /* def _SC_DEVICE_SPECIFIC */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_DEVICE_SPECIFIC */
- if (x == Mono_Posix_SysconfName__SC_DEVICE_SPECIFIC_R)
- #ifdef _SC_DEVICE_SPECIFIC_R
- {*r = _SC_DEVICE_SPECIFIC_R; return 0;}
- #else /* def _SC_DEVICE_SPECIFIC_R */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_DEVICE_SPECIFIC_R */
- if (x == Mono_Posix_SysconfName__SC_EQUIV_CLASS_MAX)
- #ifdef _SC_EQUIV_CLASS_MAX
- {*r = _SC_EQUIV_CLASS_MAX; return 0;}
- #else /* def _SC_EQUIV_CLASS_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_EQUIV_CLASS_MAX */
- if (x == Mono_Posix_SysconfName__SC_EXPR_NEST_MAX)
- #ifdef _SC_EXPR_NEST_MAX
- {*r = _SC_EXPR_NEST_MAX; return 0;}
- #else /* def _SC_EXPR_NEST_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_EXPR_NEST_MAX */
- if (x == Mono_Posix_SysconfName__SC_FD_MGMT)
- #ifdef _SC_FD_MGMT
- {*r = _SC_FD_MGMT; return 0;}
- #else /* def _SC_FD_MGMT */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_FD_MGMT */
- if (x == Mono_Posix_SysconfName__SC_FIFO)
- #ifdef _SC_FIFO
- {*r = _SC_FIFO; return 0;}
- #else /* def _SC_FIFO */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_FIFO */
- if (x == Mono_Posix_SysconfName__SC_FILE_ATTRIBUTES)
- #ifdef _SC_FILE_ATTRIBUTES
- {*r = _SC_FILE_ATTRIBUTES; return 0;}
- #else /* def _SC_FILE_ATTRIBUTES */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_FILE_ATTRIBUTES */
- if (x == Mono_Posix_SysconfName__SC_FILE_LOCKING)
- #ifdef _SC_FILE_LOCKING
- {*r = _SC_FILE_LOCKING; return 0;}
- #else /* def _SC_FILE_LOCKING */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_FILE_LOCKING */
- if (x == Mono_Posix_SysconfName__SC_FILE_SYSTEM)
- #ifdef _SC_FILE_SYSTEM
- {*r = _SC_FILE_SYSTEM; return 0;}
- #else /* def _SC_FILE_SYSTEM */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_FILE_SYSTEM */
- if (x == Mono_Posix_SysconfName__SC_FSYNC)
- #ifdef _SC_FSYNC
- {*r = _SC_FSYNC; return 0;}
- #else /* def _SC_FSYNC */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_FSYNC */
- if (x == Mono_Posix_SysconfName__SC_GETGR_R_SIZE_MAX)
- #ifdef _SC_GETGR_R_SIZE_MAX
- {*r = _SC_GETGR_R_SIZE_MAX; return 0;}
- #else /* def _SC_GETGR_R_SIZE_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_GETGR_R_SIZE_MAX */
- if (x == Mono_Posix_SysconfName__SC_GETPW_R_SIZE_MAX)
- #ifdef _SC_GETPW_R_SIZE_MAX
- {*r = _SC_GETPW_R_SIZE_MAX; return 0;}
- #else /* def _SC_GETPW_R_SIZE_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_GETPW_R_SIZE_MAX */
- if (x == Mono_Posix_SysconfName__SC_HOST_NAME_MAX)
- #ifdef _SC_HOST_NAME_MAX
- {*r = _SC_HOST_NAME_MAX; return 0;}
- #else /* def _SC_HOST_NAME_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_HOST_NAME_MAX */
- if (x == Mono_Posix_SysconfName__SC_INT_MAX)
- #ifdef _SC_INT_MAX
- {*r = _SC_INT_MAX; return 0;}
- #else /* def _SC_INT_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_INT_MAX */
- if (x == Mono_Posix_SysconfName__SC_INT_MIN)
- #ifdef _SC_INT_MIN
- {*r = _SC_INT_MIN; return 0;}
- #else /* def _SC_INT_MIN */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_INT_MIN */
- if (x == Mono_Posix_SysconfName__SC_IOV_MAX)
- #ifdef _SC_IOV_MAX
- {*r = _SC_IOV_MAX; return 0;}
- #else /* def _SC_IOV_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_IOV_MAX */
- if (x == Mono_Posix_SysconfName__SC_JOB_CONTROL)
- #ifdef _SC_JOB_CONTROL
- {*r = _SC_JOB_CONTROL; return 0;}
- #else /* def _SC_JOB_CONTROL */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_JOB_CONTROL */
- if (x == Mono_Posix_SysconfName__SC_LEVEL1_DCACHE_ASSOC)
- #ifdef _SC_LEVEL1_DCACHE_ASSOC
- {*r = _SC_LEVEL1_DCACHE_ASSOC; return 0;}
- #else /* def _SC_LEVEL1_DCACHE_ASSOC */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL1_DCACHE_ASSOC */
- if (x == Mono_Posix_SysconfName__SC_LEVEL1_DCACHE_LINESIZE)
- #ifdef _SC_LEVEL1_DCACHE_LINESIZE
- {*r = _SC_LEVEL1_DCACHE_LINESIZE; return 0;}
- #else /* def _SC_LEVEL1_DCACHE_LINESIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL1_DCACHE_LINESIZE */
- if (x == Mono_Posix_SysconfName__SC_LEVEL1_DCACHE_SIZE)
- #ifdef _SC_LEVEL1_DCACHE_SIZE
- {*r = _SC_LEVEL1_DCACHE_SIZE; return 0;}
- #else /* def _SC_LEVEL1_DCACHE_SIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL1_DCACHE_SIZE */
- if (x == Mono_Posix_SysconfName__SC_LEVEL1_ICACHE_ASSOC)
- #ifdef _SC_LEVEL1_ICACHE_ASSOC
- {*r = _SC_LEVEL1_ICACHE_ASSOC; return 0;}
- #else /* def _SC_LEVEL1_ICACHE_ASSOC */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL1_ICACHE_ASSOC */
- if (x == Mono_Posix_SysconfName__SC_LEVEL1_ICACHE_LINESIZE)
- #ifdef _SC_LEVEL1_ICACHE_LINESIZE
- {*r = _SC_LEVEL1_ICACHE_LINESIZE; return 0;}
- #else /* def _SC_LEVEL1_ICACHE_LINESIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL1_ICACHE_LINESIZE */
- if (x == Mono_Posix_SysconfName__SC_LEVEL1_ICACHE_SIZE)
- #ifdef _SC_LEVEL1_ICACHE_SIZE
- {*r = _SC_LEVEL1_ICACHE_SIZE; return 0;}
- #else /* def _SC_LEVEL1_ICACHE_SIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL1_ICACHE_SIZE */
- if (x == Mono_Posix_SysconfName__SC_LEVEL2_CACHE_ASSOC)
- #ifdef _SC_LEVEL2_CACHE_ASSOC
- {*r = _SC_LEVEL2_CACHE_ASSOC; return 0;}
- #else /* def _SC_LEVEL2_CACHE_ASSOC */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL2_CACHE_ASSOC */
- if (x == Mono_Posix_SysconfName__SC_LEVEL2_CACHE_LINESIZE)
- #ifdef _SC_LEVEL2_CACHE_LINESIZE
- {*r = _SC_LEVEL2_CACHE_LINESIZE; return 0;}
- #else /* def _SC_LEVEL2_CACHE_LINESIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL2_CACHE_LINESIZE */
- if (x == Mono_Posix_SysconfName__SC_LEVEL2_CACHE_SIZE)
- #ifdef _SC_LEVEL2_CACHE_SIZE
- {*r = _SC_LEVEL2_CACHE_SIZE; return 0;}
- #else /* def _SC_LEVEL2_CACHE_SIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL2_CACHE_SIZE */
- if (x == Mono_Posix_SysconfName__SC_LEVEL3_CACHE_ASSOC)
- #ifdef _SC_LEVEL3_CACHE_ASSOC
- {*r = _SC_LEVEL3_CACHE_ASSOC; return 0;}
- #else /* def _SC_LEVEL3_CACHE_ASSOC */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL3_CACHE_ASSOC */
- if (x == Mono_Posix_SysconfName__SC_LEVEL3_CACHE_LINESIZE)
- #ifdef _SC_LEVEL3_CACHE_LINESIZE
- {*r = _SC_LEVEL3_CACHE_LINESIZE; return 0;}
- #else /* def _SC_LEVEL3_CACHE_LINESIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL3_CACHE_LINESIZE */
- if (x == Mono_Posix_SysconfName__SC_LEVEL3_CACHE_SIZE)
- #ifdef _SC_LEVEL3_CACHE_SIZE
- {*r = _SC_LEVEL3_CACHE_SIZE; return 0;}
- #else /* def _SC_LEVEL3_CACHE_SIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL3_CACHE_SIZE */
- if (x == Mono_Posix_SysconfName__SC_LEVEL4_CACHE_ASSOC)
- #ifdef _SC_LEVEL4_CACHE_ASSOC
- {*r = _SC_LEVEL4_CACHE_ASSOC; return 0;}
- #else /* def _SC_LEVEL4_CACHE_ASSOC */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL4_CACHE_ASSOC */
- if (x == Mono_Posix_SysconfName__SC_LEVEL4_CACHE_LINESIZE)
- #ifdef _SC_LEVEL4_CACHE_LINESIZE
- {*r = _SC_LEVEL4_CACHE_LINESIZE; return 0;}
- #else /* def _SC_LEVEL4_CACHE_LINESIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL4_CACHE_LINESIZE */
- if (x == Mono_Posix_SysconfName__SC_LEVEL4_CACHE_SIZE)
- #ifdef _SC_LEVEL4_CACHE_SIZE
- {*r = _SC_LEVEL4_CACHE_SIZE; return 0;}
- #else /* def _SC_LEVEL4_CACHE_SIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LEVEL4_CACHE_SIZE */
- if (x == Mono_Posix_SysconfName__SC_LINE_MAX)
- #ifdef _SC_LINE_MAX
- {*r = _SC_LINE_MAX; return 0;}
- #else /* def _SC_LINE_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LINE_MAX */
- if (x == Mono_Posix_SysconfName__SC_LOGIN_NAME_MAX)
- #ifdef _SC_LOGIN_NAME_MAX
- {*r = _SC_LOGIN_NAME_MAX; return 0;}
- #else /* def _SC_LOGIN_NAME_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LOGIN_NAME_MAX */
- if (x == Mono_Posix_SysconfName__SC_LONG_BIT)
- #ifdef _SC_LONG_BIT
- {*r = _SC_LONG_BIT; return 0;}
- #else /* def _SC_LONG_BIT */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_LONG_BIT */
- if (x == Mono_Posix_SysconfName__SC_MAPPED_FILES)
- #ifdef _SC_MAPPED_FILES
- {*r = _SC_MAPPED_FILES; return 0;}
- #else /* def _SC_MAPPED_FILES */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_MAPPED_FILES */
- if (x == Mono_Posix_SysconfName__SC_MB_LEN_MAX)
- #ifdef _SC_MB_LEN_MAX
- {*r = _SC_MB_LEN_MAX; return 0;}
- #else /* def _SC_MB_LEN_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_MB_LEN_MAX */
- if (x == Mono_Posix_SysconfName__SC_MEMLOCK)
- #ifdef _SC_MEMLOCK
- {*r = _SC_MEMLOCK; return 0;}
- #else /* def _SC_MEMLOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_MEMLOCK */
- if (x == Mono_Posix_SysconfName__SC_MEMLOCK_RANGE)
- #ifdef _SC_MEMLOCK_RANGE
- {*r = _SC_MEMLOCK_RANGE; return 0;}
- #else /* def _SC_MEMLOCK_RANGE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_MEMLOCK_RANGE */
- if (x == Mono_Posix_SysconfName__SC_MEMORY_PROTECTION)
- #ifdef _SC_MEMORY_PROTECTION
- {*r = _SC_MEMORY_PROTECTION; return 0;}
- #else /* def _SC_MEMORY_PROTECTION */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_MEMORY_PROTECTION */
- if (x == Mono_Posix_SysconfName__SC_MESSAGE_PASSING)
- #ifdef _SC_MESSAGE_PASSING
- {*r = _SC_MESSAGE_PASSING; return 0;}
- #else /* def _SC_MESSAGE_PASSING */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_MESSAGE_PASSING */
- if (x == Mono_Posix_SysconfName__SC_MONOTONIC_CLOCK)
- #ifdef _SC_MONOTONIC_CLOCK
- {*r = _SC_MONOTONIC_CLOCK; return 0;}
- #else /* def _SC_MONOTONIC_CLOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_MONOTONIC_CLOCK */
- if (x == Mono_Posix_SysconfName__SC_MQ_OPEN_MAX)
- #ifdef _SC_MQ_OPEN_MAX
- {*r = _SC_MQ_OPEN_MAX; return 0;}
- #else /* def _SC_MQ_OPEN_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_MQ_OPEN_MAX */
- if (x == Mono_Posix_SysconfName__SC_MQ_PRIO_MAX)
- #ifdef _SC_MQ_PRIO_MAX
- {*r = _SC_MQ_PRIO_MAX; return 0;}
- #else /* def _SC_MQ_PRIO_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_MQ_PRIO_MAX */
- if (x == Mono_Posix_SysconfName__SC_MULTI_PROCESS)
- #ifdef _SC_MULTI_PROCESS
- {*r = _SC_MULTI_PROCESS; return 0;}
- #else /* def _SC_MULTI_PROCESS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_MULTI_PROCESS */
- if (x == Mono_Posix_SysconfName__SC_NETWORKING)
- #ifdef _SC_NETWORKING
- {*r = _SC_NETWORKING; return 0;}
- #else /* def _SC_NETWORKING */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_NETWORKING */
- if (x == Mono_Posix_SysconfName__SC_NGROUPS_MAX)
- #ifdef _SC_NGROUPS_MAX
- {*r = _SC_NGROUPS_MAX; return 0;}
- #else /* def _SC_NGROUPS_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_NGROUPS_MAX */
- if (x == Mono_Posix_SysconfName__SC_NL_ARGMAX)
- #ifdef _SC_NL_ARGMAX
- {*r = _SC_NL_ARGMAX; return 0;}
- #else /* def _SC_NL_ARGMAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_NL_ARGMAX */
- if (x == Mono_Posix_SysconfName__SC_NL_LANGMAX)
- #ifdef _SC_NL_LANGMAX
- {*r = _SC_NL_LANGMAX; return 0;}
- #else /* def _SC_NL_LANGMAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_NL_LANGMAX */
- if (x == Mono_Posix_SysconfName__SC_NL_MSGMAX)
- #ifdef _SC_NL_MSGMAX
- {*r = _SC_NL_MSGMAX; return 0;}
- #else /* def _SC_NL_MSGMAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_NL_MSGMAX */
- if (x == Mono_Posix_SysconfName__SC_NL_NMAX)
- #ifdef _SC_NL_NMAX
- {*r = _SC_NL_NMAX; return 0;}
- #else /* def _SC_NL_NMAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_NL_NMAX */
- if (x == Mono_Posix_SysconfName__SC_NL_SETMAX)
- #ifdef _SC_NL_SETMAX
- {*r = _SC_NL_SETMAX; return 0;}
- #else /* def _SC_NL_SETMAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_NL_SETMAX */
- if (x == Mono_Posix_SysconfName__SC_NL_TEXTMAX)
- #ifdef _SC_NL_TEXTMAX
- {*r = _SC_NL_TEXTMAX; return 0;}
- #else /* def _SC_NL_TEXTMAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_NL_TEXTMAX */
- if (x == Mono_Posix_SysconfName__SC_NPROCESSORS_CONF)
- #ifdef _SC_NPROCESSORS_CONF
- {*r = _SC_NPROCESSORS_CONF; return 0;}
- #else /* def _SC_NPROCESSORS_CONF */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_NPROCESSORS_CONF */
- if (x == Mono_Posix_SysconfName__SC_NPROCESSORS_ONLN)
- #ifdef _SC_NPROCESSORS_ONLN
- {*r = _SC_NPROCESSORS_ONLN; return 0;}
- #else /* def _SC_NPROCESSORS_ONLN */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_NPROCESSORS_ONLN */
- if (x == Mono_Posix_SysconfName__SC_NZERO)
- #ifdef _SC_NZERO
- {*r = _SC_NZERO; return 0;}
- #else /* def _SC_NZERO */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_NZERO */
- if (x == Mono_Posix_SysconfName__SC_OPEN_MAX)
- #ifdef _SC_OPEN_MAX
- {*r = _SC_OPEN_MAX; return 0;}
- #else /* def _SC_OPEN_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_OPEN_MAX */
- if (x == Mono_Posix_SysconfName__SC_PAGESIZE)
- #ifdef _SC_PAGESIZE
- {*r = _SC_PAGESIZE; return 0;}
- #else /* def _SC_PAGESIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PAGESIZE */
- if (x == Mono_Posix_SysconfName__SC_PASS_MAX)
- #ifdef _SC_PASS_MAX
- {*r = _SC_PASS_MAX; return 0;}
- #else /* def _SC_PASS_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PASS_MAX */
- if (x == Mono_Posix_SysconfName__SC_PHYS_PAGES)
- #ifdef _SC_PHYS_PAGES
- {*r = _SC_PHYS_PAGES; return 0;}
- #else /* def _SC_PHYS_PAGES */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PHYS_PAGES */
- if (x == Mono_Posix_SysconfName__SC_PII)
- #ifdef _SC_PII
- {*r = _SC_PII; return 0;}
- #else /* def _SC_PII */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PII */
- if (x == Mono_Posix_SysconfName__SC_PII_INTERNET)
- #ifdef _SC_PII_INTERNET
- {*r = _SC_PII_INTERNET; return 0;}
- #else /* def _SC_PII_INTERNET */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PII_INTERNET */
- if (x == Mono_Posix_SysconfName__SC_PII_INTERNET_DGRAM)
- #ifdef _SC_PII_INTERNET_DGRAM
- {*r = _SC_PII_INTERNET_DGRAM; return 0;}
- #else /* def _SC_PII_INTERNET_DGRAM */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PII_INTERNET_DGRAM */
- if (x == Mono_Posix_SysconfName__SC_PII_INTERNET_STREAM)
- #ifdef _SC_PII_INTERNET_STREAM
- {*r = _SC_PII_INTERNET_STREAM; return 0;}
- #else /* def _SC_PII_INTERNET_STREAM */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PII_INTERNET_STREAM */
- if (x == Mono_Posix_SysconfName__SC_PII_OSI)
- #ifdef _SC_PII_OSI
- {*r = _SC_PII_OSI; return 0;}
- #else /* def _SC_PII_OSI */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PII_OSI */
- if (x == Mono_Posix_SysconfName__SC_PII_OSI_CLTS)
- #ifdef _SC_PII_OSI_CLTS
- {*r = _SC_PII_OSI_CLTS; return 0;}
- #else /* def _SC_PII_OSI_CLTS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PII_OSI_CLTS */
- if (x == Mono_Posix_SysconfName__SC_PII_OSI_COTS)
- #ifdef _SC_PII_OSI_COTS
- {*r = _SC_PII_OSI_COTS; return 0;}
- #else /* def _SC_PII_OSI_COTS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PII_OSI_COTS */
- if (x == Mono_Posix_SysconfName__SC_PII_OSI_M)
- #ifdef _SC_PII_OSI_M
- {*r = _SC_PII_OSI_M; return 0;}
- #else /* def _SC_PII_OSI_M */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PII_OSI_M */
- if (x == Mono_Posix_SysconfName__SC_PII_SOCKET)
- #ifdef _SC_PII_SOCKET
- {*r = _SC_PII_SOCKET; return 0;}
- #else /* def _SC_PII_SOCKET */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PII_SOCKET */
- if (x == Mono_Posix_SysconfName__SC_PII_XTI)
- #ifdef _SC_PII_XTI
- {*r = _SC_PII_XTI; return 0;}
- #else /* def _SC_PII_XTI */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PII_XTI */
- if (x == Mono_Posix_SysconfName__SC_PIPE)
- #ifdef _SC_PIPE
- {*r = _SC_PIPE; return 0;}
- #else /* def _SC_PIPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PIPE */
- if (x == Mono_Posix_SysconfName__SC_POLL)
- #ifdef _SC_POLL
- {*r = _SC_POLL; return 0;}
- #else /* def _SC_POLL */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_POLL */
- if (x == Mono_Posix_SysconfName__SC_PRIORITIZED_IO)
- #ifdef _SC_PRIORITIZED_IO
- {*r = _SC_PRIORITIZED_IO; return 0;}
- #else /* def _SC_PRIORITIZED_IO */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PRIORITIZED_IO */
- if (x == Mono_Posix_SysconfName__SC_PRIORITY_SCHEDULING)
- #ifdef _SC_PRIORITY_SCHEDULING
- {*r = _SC_PRIORITY_SCHEDULING; return 0;}
- #else /* def _SC_PRIORITY_SCHEDULING */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_PRIORITY_SCHEDULING */
- if (x == Mono_Posix_SysconfName__SC_READER_WRITER_LOCKS)
- #ifdef _SC_READER_WRITER_LOCKS
- {*r = _SC_READER_WRITER_LOCKS; return 0;}
- #else /* def _SC_READER_WRITER_LOCKS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_READER_WRITER_LOCKS */
- if (x == Mono_Posix_SysconfName__SC_REALTIME_SIGNALS)
- #ifdef _SC_REALTIME_SIGNALS
- {*r = _SC_REALTIME_SIGNALS; return 0;}
- #else /* def _SC_REALTIME_SIGNALS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_REALTIME_SIGNALS */
- if (x == Mono_Posix_SysconfName__SC_REGEXP)
- #ifdef _SC_REGEXP
- {*r = _SC_REGEXP; return 0;}
- #else /* def _SC_REGEXP */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_REGEXP */
- if (x == Mono_Posix_SysconfName__SC_REGEX_VERSION)
- #ifdef _SC_REGEX_VERSION
- {*r = _SC_REGEX_VERSION; return 0;}
- #else /* def _SC_REGEX_VERSION */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_REGEX_VERSION */
- if (x == Mono_Posix_SysconfName__SC_RE_DUP_MAX)
- #ifdef _SC_RE_DUP_MAX
- {*r = _SC_RE_DUP_MAX; return 0;}
- #else /* def _SC_RE_DUP_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_RE_DUP_MAX */
- if (x == Mono_Posix_SysconfName__SC_RTSIG_MAX)
- #ifdef _SC_RTSIG_MAX
- {*r = _SC_RTSIG_MAX; return 0;}
- #else /* def _SC_RTSIG_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_RTSIG_MAX */
- if (x == Mono_Posix_SysconfName__SC_SAVED_IDS)
- #ifdef _SC_SAVED_IDS
- {*r = _SC_SAVED_IDS; return 0;}
- #else /* def _SC_SAVED_IDS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SAVED_IDS */
- if (x == Mono_Posix_SysconfName__SC_SCHAR_MAX)
- #ifdef _SC_SCHAR_MAX
- {*r = _SC_SCHAR_MAX; return 0;}
- #else /* def _SC_SCHAR_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SCHAR_MAX */
- if (x == Mono_Posix_SysconfName__SC_SCHAR_MIN)
- #ifdef _SC_SCHAR_MIN
- {*r = _SC_SCHAR_MIN; return 0;}
- #else /* def _SC_SCHAR_MIN */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SCHAR_MIN */
- if (x == Mono_Posix_SysconfName__SC_SELECT)
- #ifdef _SC_SELECT
- {*r = _SC_SELECT; return 0;}
- #else /* def _SC_SELECT */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SELECT */
- if (x == Mono_Posix_SysconfName__SC_SEMAPHORES)
- #ifdef _SC_SEMAPHORES
- {*r = _SC_SEMAPHORES; return 0;}
- #else /* def _SC_SEMAPHORES */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SEMAPHORES */
- if (x == Mono_Posix_SysconfName__SC_SEM_NSEMS_MAX)
- #ifdef _SC_SEM_NSEMS_MAX
- {*r = _SC_SEM_NSEMS_MAX; return 0;}
- #else /* def _SC_SEM_NSEMS_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SEM_NSEMS_MAX */
- if (x == Mono_Posix_SysconfName__SC_SEM_VALUE_MAX)
- #ifdef _SC_SEM_VALUE_MAX
- {*r = _SC_SEM_VALUE_MAX; return 0;}
- #else /* def _SC_SEM_VALUE_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SEM_VALUE_MAX */
- if (x == Mono_Posix_SysconfName__SC_SHARED_MEMORY_OBJECTS)
- #ifdef _SC_SHARED_MEMORY_OBJECTS
- {*r = _SC_SHARED_MEMORY_OBJECTS; return 0;}
- #else /* def _SC_SHARED_MEMORY_OBJECTS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SHARED_MEMORY_OBJECTS */
- if (x == Mono_Posix_SysconfName__SC_SHELL)
- #ifdef _SC_SHELL
- {*r = _SC_SHELL; return 0;}
- #else /* def _SC_SHELL */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SHELL */
- if (x == Mono_Posix_SysconfName__SC_SHRT_MAX)
- #ifdef _SC_SHRT_MAX
- {*r = _SC_SHRT_MAX; return 0;}
- #else /* def _SC_SHRT_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SHRT_MAX */
- if (x == Mono_Posix_SysconfName__SC_SHRT_MIN)
- #ifdef _SC_SHRT_MIN
- {*r = _SC_SHRT_MIN; return 0;}
- #else /* def _SC_SHRT_MIN */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SHRT_MIN */
- if (x == Mono_Posix_SysconfName__SC_SIGNALS)
- #ifdef _SC_SIGNALS
- {*r = _SC_SIGNALS; return 0;}
- #else /* def _SC_SIGNALS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SIGNALS */
- if (x == Mono_Posix_SysconfName__SC_SIGQUEUE_MAX)
- #ifdef _SC_SIGQUEUE_MAX
- {*r = _SC_SIGQUEUE_MAX; return 0;}
- #else /* def _SC_SIGQUEUE_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SIGQUEUE_MAX */
- if (x == Mono_Posix_SysconfName__SC_SINGLE_PROCESS)
- #ifdef _SC_SINGLE_PROCESS
- {*r = _SC_SINGLE_PROCESS; return 0;}
- #else /* def _SC_SINGLE_PROCESS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SINGLE_PROCESS */
- if (x == Mono_Posix_SysconfName__SC_SPAWN)
- #ifdef _SC_SPAWN
- {*r = _SC_SPAWN; return 0;}
- #else /* def _SC_SPAWN */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SPAWN */
- if (x == Mono_Posix_SysconfName__SC_SPIN_LOCKS)
- #ifdef _SC_SPIN_LOCKS
- {*r = _SC_SPIN_LOCKS; return 0;}
- #else /* def _SC_SPIN_LOCKS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SPIN_LOCKS */
- if (x == Mono_Posix_SysconfName__SC_SPORADIC_SERVER)
- #ifdef _SC_SPORADIC_SERVER
- {*r = _SC_SPORADIC_SERVER; return 0;}
- #else /* def _SC_SPORADIC_SERVER */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SPORADIC_SERVER */
- if (x == Mono_Posix_SysconfName__SC_SSIZE_MAX)
- #ifdef _SC_SSIZE_MAX
- {*r = _SC_SSIZE_MAX; return 0;}
- #else /* def _SC_SSIZE_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SSIZE_MAX */
- if (x == Mono_Posix_SysconfName__SC_STREAMS)
- #ifdef _SC_STREAMS
- {*r = _SC_STREAMS; return 0;}
- #else /* def _SC_STREAMS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_STREAMS */
- if (x == Mono_Posix_SysconfName__SC_STREAM_MAX)
- #ifdef _SC_STREAM_MAX
- {*r = _SC_STREAM_MAX; return 0;}
- #else /* def _SC_STREAM_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_STREAM_MAX */
- if (x == Mono_Posix_SysconfName__SC_SYMLOOP_MAX)
- #ifdef _SC_SYMLOOP_MAX
- {*r = _SC_SYMLOOP_MAX; return 0;}
- #else /* def _SC_SYMLOOP_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SYMLOOP_MAX */
- if (x == Mono_Posix_SysconfName__SC_SYNCHRONIZED_IO)
- #ifdef _SC_SYNCHRONIZED_IO
- {*r = _SC_SYNCHRONIZED_IO; return 0;}
- #else /* def _SC_SYNCHRONIZED_IO */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SYNCHRONIZED_IO */
- if (x == Mono_Posix_SysconfName__SC_SYSTEM_DATABASE)
- #ifdef _SC_SYSTEM_DATABASE
- {*r = _SC_SYSTEM_DATABASE; return 0;}
- #else /* def _SC_SYSTEM_DATABASE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SYSTEM_DATABASE */
- if (x == Mono_Posix_SysconfName__SC_SYSTEM_DATABASE_R)
- #ifdef _SC_SYSTEM_DATABASE_R
- {*r = _SC_SYSTEM_DATABASE_R; return 0;}
- #else /* def _SC_SYSTEM_DATABASE_R */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_SYSTEM_DATABASE_R */
- if (x == Mono_Posix_SysconfName__SC_THREADS)
- #ifdef _SC_THREADS
- {*r = _SC_THREADS; return 0;}
- #else /* def _SC_THREADS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREADS */
- if (x == Mono_Posix_SysconfName__SC_THREAD_ATTR_STACKADDR)
- #ifdef _SC_THREAD_ATTR_STACKADDR
- {*r = _SC_THREAD_ATTR_STACKADDR; return 0;}
- #else /* def _SC_THREAD_ATTR_STACKADDR */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_ATTR_STACKADDR */
- if (x == Mono_Posix_SysconfName__SC_THREAD_ATTR_STACKSIZE)
- #ifdef _SC_THREAD_ATTR_STACKSIZE
- {*r = _SC_THREAD_ATTR_STACKSIZE; return 0;}
- #else /* def _SC_THREAD_ATTR_STACKSIZE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_ATTR_STACKSIZE */
- if (x == Mono_Posix_SysconfName__SC_THREAD_CPUTIME)
- #ifdef _SC_THREAD_CPUTIME
- {*r = _SC_THREAD_CPUTIME; return 0;}
- #else /* def _SC_THREAD_CPUTIME */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_CPUTIME */
- if (x == Mono_Posix_SysconfName__SC_THREAD_DESTRUCTOR_ITERATIONS)
- #ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS
- {*r = _SC_THREAD_DESTRUCTOR_ITERATIONS; return 0;}
- #else /* def _SC_THREAD_DESTRUCTOR_ITERATIONS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_DESTRUCTOR_ITERATIONS */
- if (x == Mono_Posix_SysconfName__SC_THREAD_KEYS_MAX)
- #ifdef _SC_THREAD_KEYS_MAX
- {*r = _SC_THREAD_KEYS_MAX; return 0;}
- #else /* def _SC_THREAD_KEYS_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_KEYS_MAX */
- if (x == Mono_Posix_SysconfName__SC_THREAD_PRIORITY_SCHEDULING)
- #ifdef _SC_THREAD_PRIORITY_SCHEDULING
- {*r = _SC_THREAD_PRIORITY_SCHEDULING; return 0;}
- #else /* def _SC_THREAD_PRIORITY_SCHEDULING */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_PRIORITY_SCHEDULING */
- if (x == Mono_Posix_SysconfName__SC_THREAD_PRIO_INHERIT)
- #ifdef _SC_THREAD_PRIO_INHERIT
- {*r = _SC_THREAD_PRIO_INHERIT; return 0;}
- #else /* def _SC_THREAD_PRIO_INHERIT */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_PRIO_INHERIT */
- if (x == Mono_Posix_SysconfName__SC_THREAD_PRIO_PROTECT)
- #ifdef _SC_THREAD_PRIO_PROTECT
- {*r = _SC_THREAD_PRIO_PROTECT; return 0;}
- #else /* def _SC_THREAD_PRIO_PROTECT */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_PRIO_PROTECT */
- if (x == Mono_Posix_SysconfName__SC_THREAD_PROCESS_SHARED)
- #ifdef _SC_THREAD_PROCESS_SHARED
- {*r = _SC_THREAD_PROCESS_SHARED; return 0;}
- #else /* def _SC_THREAD_PROCESS_SHARED */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_PROCESS_SHARED */
- if (x == Mono_Posix_SysconfName__SC_THREAD_SAFE_FUNCTIONS)
- #ifdef _SC_THREAD_SAFE_FUNCTIONS
- {*r = _SC_THREAD_SAFE_FUNCTIONS; return 0;}
- #else /* def _SC_THREAD_SAFE_FUNCTIONS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_SAFE_FUNCTIONS */
- if (x == Mono_Posix_SysconfName__SC_THREAD_SPORADIC_SERVER)
- #ifdef _SC_THREAD_SPORADIC_SERVER
- {*r = _SC_THREAD_SPORADIC_SERVER; return 0;}
- #else /* def _SC_THREAD_SPORADIC_SERVER */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_SPORADIC_SERVER */
- if (x == Mono_Posix_SysconfName__SC_THREAD_STACK_MIN)
- #ifdef _SC_THREAD_STACK_MIN
- {*r = _SC_THREAD_STACK_MIN; return 0;}
- #else /* def _SC_THREAD_STACK_MIN */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_STACK_MIN */
- if (x == Mono_Posix_SysconfName__SC_THREAD_THREADS_MAX)
- #ifdef _SC_THREAD_THREADS_MAX
- {*r = _SC_THREAD_THREADS_MAX; return 0;}
- #else /* def _SC_THREAD_THREADS_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_THREAD_THREADS_MAX */
- if (x == Mono_Posix_SysconfName__SC_TIMEOUTS)
- #ifdef _SC_TIMEOUTS
- {*r = _SC_TIMEOUTS; return 0;}
- #else /* def _SC_TIMEOUTS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_TIMEOUTS */
- if (x == Mono_Posix_SysconfName__SC_TIMERS)
- #ifdef _SC_TIMERS
- {*r = _SC_TIMERS; return 0;}
- #else /* def _SC_TIMERS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_TIMERS */
- if (x == Mono_Posix_SysconfName__SC_TIMER_MAX)
- #ifdef _SC_TIMER_MAX
- {*r = _SC_TIMER_MAX; return 0;}
- #else /* def _SC_TIMER_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_TIMER_MAX */
- if (x == Mono_Posix_SysconfName__SC_TRACE)
- #ifdef _SC_TRACE
- {*r = _SC_TRACE; return 0;}
- #else /* def _SC_TRACE */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_TRACE */
- if (x == Mono_Posix_SysconfName__SC_TRACE_EVENT_FILTER)
- #ifdef _SC_TRACE_EVENT_FILTER
- {*r = _SC_TRACE_EVENT_FILTER; return 0;}
- #else /* def _SC_TRACE_EVENT_FILTER */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_TRACE_EVENT_FILTER */
- if (x == Mono_Posix_SysconfName__SC_TRACE_INHERIT)
- #ifdef _SC_TRACE_INHERIT
- {*r = _SC_TRACE_INHERIT; return 0;}
- #else /* def _SC_TRACE_INHERIT */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_TRACE_INHERIT */
- if (x == Mono_Posix_SysconfName__SC_TRACE_LOG)
- #ifdef _SC_TRACE_LOG
- {*r = _SC_TRACE_LOG; return 0;}
- #else /* def _SC_TRACE_LOG */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_TRACE_LOG */
- if (x == Mono_Posix_SysconfName__SC_TTY_NAME_MAX)
- #ifdef _SC_TTY_NAME_MAX
- {*r = _SC_TTY_NAME_MAX; return 0;}
- #else /* def _SC_TTY_NAME_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_TTY_NAME_MAX */
- if (x == Mono_Posix_SysconfName__SC_TYPED_MEMORY_OBJECTS)
- #ifdef _SC_TYPED_MEMORY_OBJECTS
- {*r = _SC_TYPED_MEMORY_OBJECTS; return 0;}
- #else /* def _SC_TYPED_MEMORY_OBJECTS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_TYPED_MEMORY_OBJECTS */
- if (x == Mono_Posix_SysconfName__SC_TZNAME_MAX)
- #ifdef _SC_TZNAME_MAX
- {*r = _SC_TZNAME_MAX; return 0;}
- #else /* def _SC_TZNAME_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_TZNAME_MAX */
- if (x == Mono_Posix_SysconfName__SC_T_IOV_MAX)
- #ifdef _SC_T_IOV_MAX
- {*r = _SC_T_IOV_MAX; return 0;}
- #else /* def _SC_T_IOV_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_T_IOV_MAX */
- if (x == Mono_Posix_SysconfName__SC_UCHAR_MAX)
- #ifdef _SC_UCHAR_MAX
- {*r = _SC_UCHAR_MAX; return 0;}
- #else /* def _SC_UCHAR_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_UCHAR_MAX */
- if (x == Mono_Posix_SysconfName__SC_UINT_MAX)
- #ifdef _SC_UINT_MAX
- {*r = _SC_UINT_MAX; return 0;}
- #else /* def _SC_UINT_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_UINT_MAX */
- if (x == Mono_Posix_SysconfName__SC_UIO_MAXIOV)
- #ifdef _SC_UIO_MAXIOV
- {*r = _SC_UIO_MAXIOV; return 0;}
- #else /* def _SC_UIO_MAXIOV */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_UIO_MAXIOV */
- if (x == Mono_Posix_SysconfName__SC_ULONG_MAX)
- #ifdef _SC_ULONG_MAX
- {*r = _SC_ULONG_MAX; return 0;}
- #else /* def _SC_ULONG_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_ULONG_MAX */
- if (x == Mono_Posix_SysconfName__SC_USER_GROUPS)
- #ifdef _SC_USER_GROUPS
- {*r = _SC_USER_GROUPS; return 0;}
- #else /* def _SC_USER_GROUPS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_USER_GROUPS */
- if (x == Mono_Posix_SysconfName__SC_USER_GROUPS_R)
- #ifdef _SC_USER_GROUPS_R
- {*r = _SC_USER_GROUPS_R; return 0;}
- #else /* def _SC_USER_GROUPS_R */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_USER_GROUPS_R */
- if (x == Mono_Posix_SysconfName__SC_USHRT_MAX)
- #ifdef _SC_USHRT_MAX
- {*r = _SC_USHRT_MAX; return 0;}
- #else /* def _SC_USHRT_MAX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_USHRT_MAX */
- if (x == Mono_Posix_SysconfName__SC_V6_ILP32_OFF32)
- #ifdef _SC_V6_ILP32_OFF32
- {*r = _SC_V6_ILP32_OFF32; return 0;}
- #else /* def _SC_V6_ILP32_OFF32 */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_V6_ILP32_OFF32 */
- if (x == Mono_Posix_SysconfName__SC_V6_ILP32_OFFBIG)
- #ifdef _SC_V6_ILP32_OFFBIG
- {*r = _SC_V6_ILP32_OFFBIG; return 0;}
- #else /* def _SC_V6_ILP32_OFFBIG */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_V6_ILP32_OFFBIG */
- if (x == Mono_Posix_SysconfName__SC_V6_LP64_OFF64)
- #ifdef _SC_V6_LP64_OFF64
- {*r = _SC_V6_LP64_OFF64; return 0;}
- #else /* def _SC_V6_LP64_OFF64 */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_V6_LP64_OFF64 */
- if (x == Mono_Posix_SysconfName__SC_V6_LPBIG_OFFBIG)
- #ifdef _SC_V6_LPBIG_OFFBIG
- {*r = _SC_V6_LPBIG_OFFBIG; return 0;}
- #else /* def _SC_V6_LPBIG_OFFBIG */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_V6_LPBIG_OFFBIG */
- if (x == Mono_Posix_SysconfName__SC_VERSION)
- #ifdef _SC_VERSION
- {*r = _SC_VERSION; return 0;}
- #else /* def _SC_VERSION */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_VERSION */
- if (x == Mono_Posix_SysconfName__SC_WORD_BIT)
- #ifdef _SC_WORD_BIT
- {*r = _SC_WORD_BIT; return 0;}
- #else /* def _SC_WORD_BIT */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_WORD_BIT */
- if (x == Mono_Posix_SysconfName__SC_XBS5_ILP32_OFF32)
- #ifdef _SC_XBS5_ILP32_OFF32
- {*r = _SC_XBS5_ILP32_OFF32; return 0;}
- #else /* def _SC_XBS5_ILP32_OFF32 */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XBS5_ILP32_OFF32 */
- if (x == Mono_Posix_SysconfName__SC_XBS5_ILP32_OFFBIG)
- #ifdef _SC_XBS5_ILP32_OFFBIG
- {*r = _SC_XBS5_ILP32_OFFBIG; return 0;}
- #else /* def _SC_XBS5_ILP32_OFFBIG */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XBS5_ILP32_OFFBIG */
- if (x == Mono_Posix_SysconfName__SC_XBS5_LP64_OFF64)
- #ifdef _SC_XBS5_LP64_OFF64
- {*r = _SC_XBS5_LP64_OFF64; return 0;}
- #else /* def _SC_XBS5_LP64_OFF64 */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XBS5_LP64_OFF64 */
- if (x == Mono_Posix_SysconfName__SC_XBS5_LPBIG_OFFBIG)
- #ifdef _SC_XBS5_LPBIG_OFFBIG
- {*r = _SC_XBS5_LPBIG_OFFBIG; return 0;}
- #else /* def _SC_XBS5_LPBIG_OFFBIG */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XBS5_LPBIG_OFFBIG */
- if (x == Mono_Posix_SysconfName__SC_XOPEN_CRYPT)
- #ifdef _SC_XOPEN_CRYPT
- {*r = _SC_XOPEN_CRYPT; return 0;}
- #else /* def _SC_XOPEN_CRYPT */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XOPEN_CRYPT */
- if (x == Mono_Posix_SysconfName__SC_XOPEN_ENH_I18N)
- #ifdef _SC_XOPEN_ENH_I18N
- {*r = _SC_XOPEN_ENH_I18N; return 0;}
- #else /* def _SC_XOPEN_ENH_I18N */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XOPEN_ENH_I18N */
- if (x == Mono_Posix_SysconfName__SC_XOPEN_LEGACY)
- #ifdef _SC_XOPEN_LEGACY
- {*r = _SC_XOPEN_LEGACY; return 0;}
- #else /* def _SC_XOPEN_LEGACY */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XOPEN_LEGACY */
- if (x == Mono_Posix_SysconfName__SC_XOPEN_REALTIME)
- #ifdef _SC_XOPEN_REALTIME
- {*r = _SC_XOPEN_REALTIME; return 0;}
- #else /* def _SC_XOPEN_REALTIME */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XOPEN_REALTIME */
- if (x == Mono_Posix_SysconfName__SC_XOPEN_REALTIME_THREADS)
- #ifdef _SC_XOPEN_REALTIME_THREADS
- {*r = _SC_XOPEN_REALTIME_THREADS; return 0;}
- #else /* def _SC_XOPEN_REALTIME_THREADS */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XOPEN_REALTIME_THREADS */
- if (x == Mono_Posix_SysconfName__SC_XOPEN_SHM)
- #ifdef _SC_XOPEN_SHM
- {*r = _SC_XOPEN_SHM; return 0;}
- #else /* def _SC_XOPEN_SHM */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XOPEN_SHM */
- if (x == Mono_Posix_SysconfName__SC_XOPEN_UNIX)
- #ifdef _SC_XOPEN_UNIX
- {*r = _SC_XOPEN_UNIX; return 0;}
- #else /* def _SC_XOPEN_UNIX */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XOPEN_UNIX */
- if (x == Mono_Posix_SysconfName__SC_XOPEN_VERSION)
- #ifdef _SC_XOPEN_VERSION
- {*r = _SC_XOPEN_VERSION; return 0;}
- #else /* def _SC_XOPEN_VERSION */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XOPEN_VERSION */
- if (x == Mono_Posix_SysconfName__SC_XOPEN_XCU_VERSION)
- #ifdef _SC_XOPEN_XCU_VERSION
- {*r = _SC_XOPEN_XCU_VERSION; return 0;}
- #else /* def _SC_XOPEN_XCU_VERSION */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XOPEN_XCU_VERSION */
- if (x == Mono_Posix_SysconfName__SC_XOPEN_XPG2)
- #ifdef _SC_XOPEN_XPG2
- {*r = _SC_XOPEN_XPG2; return 0;}
- #else /* def _SC_XOPEN_XPG2 */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XOPEN_XPG2 */
- if (x == Mono_Posix_SysconfName__SC_XOPEN_XPG3)
- #ifdef _SC_XOPEN_XPG3
- {*r = _SC_XOPEN_XPG3; return 0;}
- #else /* def _SC_XOPEN_XPG3 */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XOPEN_XPG3 */
- if (x == Mono_Posix_SysconfName__SC_XOPEN_XPG4)
- #ifdef _SC_XOPEN_XPG4
- {*r = _SC_XOPEN_XPG4; return 0;}
- #else /* def _SC_XOPEN_XPG4 */
- {errno = EINVAL; return -1;}
- #endif /* ndef _SC_XOPEN_XPG4 */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToSysconfName (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef _SC_2_CHAR_TERM
- if (x == _SC_2_CHAR_TERM)
- {*r = Mono_Posix_SysconfName__SC_2_CHAR_TERM; return 0;}
- #endif /* ndef _SC_2_CHAR_TERM */
- #ifdef _SC_2_C_BIND
- if (x == _SC_2_C_BIND)
- {*r = Mono_Posix_SysconfName__SC_2_C_BIND; return 0;}
- #endif /* ndef _SC_2_C_BIND */
- #ifdef _SC_2_C_DEV
- if (x == _SC_2_C_DEV)
- {*r = Mono_Posix_SysconfName__SC_2_C_DEV; return 0;}
- #endif /* ndef _SC_2_C_DEV */
- #ifdef _SC_2_C_VERSION
- if (x == _SC_2_C_VERSION)
- {*r = Mono_Posix_SysconfName__SC_2_C_VERSION; return 0;}
- #endif /* ndef _SC_2_C_VERSION */
- #ifdef _SC_2_FORT_DEV
- if (x == _SC_2_FORT_DEV)
- {*r = Mono_Posix_SysconfName__SC_2_FORT_DEV; return 0;}
- #endif /* ndef _SC_2_FORT_DEV */
- #ifdef _SC_2_FORT_RUN
- if (x == _SC_2_FORT_RUN)
- {*r = Mono_Posix_SysconfName__SC_2_FORT_RUN; return 0;}
- #endif /* ndef _SC_2_FORT_RUN */
- #ifdef _SC_2_LOCALEDEF
- if (x == _SC_2_LOCALEDEF)
- {*r = Mono_Posix_SysconfName__SC_2_LOCALEDEF; return 0;}
- #endif /* ndef _SC_2_LOCALEDEF */
- #ifdef _SC_2_PBS
- if (x == _SC_2_PBS)
- {*r = Mono_Posix_SysconfName__SC_2_PBS; return 0;}
- #endif /* ndef _SC_2_PBS */
- #ifdef _SC_2_PBS_ACCOUNTING
- if (x == _SC_2_PBS_ACCOUNTING)
- {*r = Mono_Posix_SysconfName__SC_2_PBS_ACCOUNTING; return 0;}
- #endif /* ndef _SC_2_PBS_ACCOUNTING */
- #ifdef _SC_2_PBS_CHECKPOINT
- if (x == _SC_2_PBS_CHECKPOINT)
- {*r = Mono_Posix_SysconfName__SC_2_PBS_CHECKPOINT; return 0;}
- #endif /* ndef _SC_2_PBS_CHECKPOINT */
- #ifdef _SC_2_PBS_LOCATE
- if (x == _SC_2_PBS_LOCATE)
- {*r = Mono_Posix_SysconfName__SC_2_PBS_LOCATE; return 0;}
- #endif /* ndef _SC_2_PBS_LOCATE */
- #ifdef _SC_2_PBS_MESSAGE
- if (x == _SC_2_PBS_MESSAGE)
- {*r = Mono_Posix_SysconfName__SC_2_PBS_MESSAGE; return 0;}
- #endif /* ndef _SC_2_PBS_MESSAGE */
- #ifdef _SC_2_PBS_TRACK
- if (x == _SC_2_PBS_TRACK)
- {*r = Mono_Posix_SysconfName__SC_2_PBS_TRACK; return 0;}
- #endif /* ndef _SC_2_PBS_TRACK */
- #ifdef _SC_2_SW_DEV
- if (x == _SC_2_SW_DEV)
- {*r = Mono_Posix_SysconfName__SC_2_SW_DEV; return 0;}
- #endif /* ndef _SC_2_SW_DEV */
- #ifdef _SC_2_UPE
- if (x == _SC_2_UPE)
- {*r = Mono_Posix_SysconfName__SC_2_UPE; return 0;}
- #endif /* ndef _SC_2_UPE */
- #ifdef _SC_2_VERSION
- if (x == _SC_2_VERSION)
- {*r = Mono_Posix_SysconfName__SC_2_VERSION; return 0;}
- #endif /* ndef _SC_2_VERSION */
- #ifdef _SC_ADVISORY_INFO
- if (x == _SC_ADVISORY_INFO)
- {*r = Mono_Posix_SysconfName__SC_ADVISORY_INFO; return 0;}
- #endif /* ndef _SC_ADVISORY_INFO */
- #ifdef _SC_AIO_LISTIO_MAX
- if (x == _SC_AIO_LISTIO_MAX)
- {*r = Mono_Posix_SysconfName__SC_AIO_LISTIO_MAX; return 0;}
- #endif /* ndef _SC_AIO_LISTIO_MAX */
- #ifdef _SC_AIO_MAX
- if (x == _SC_AIO_MAX)
- {*r = Mono_Posix_SysconfName__SC_AIO_MAX; return 0;}
- #endif /* ndef _SC_AIO_MAX */
- #ifdef _SC_AIO_PRIO_DELTA_MAX
- if (x == _SC_AIO_PRIO_DELTA_MAX)
- {*r = Mono_Posix_SysconfName__SC_AIO_PRIO_DELTA_MAX; return 0;}
- #endif /* ndef _SC_AIO_PRIO_DELTA_MAX */
- #ifdef _SC_ARG_MAX
- if (x == _SC_ARG_MAX)
- {*r = Mono_Posix_SysconfName__SC_ARG_MAX; return 0;}
- #endif /* ndef _SC_ARG_MAX */
- #ifdef _SC_ASYNCHRONOUS_IO
- if (x == _SC_ASYNCHRONOUS_IO)
- {*r = Mono_Posix_SysconfName__SC_ASYNCHRONOUS_IO; return 0;}
- #endif /* ndef _SC_ASYNCHRONOUS_IO */
- #ifdef _SC_ATEXIT_MAX
- if (x == _SC_ATEXIT_MAX)
- {*r = Mono_Posix_SysconfName__SC_ATEXIT_MAX; return 0;}
- #endif /* ndef _SC_ATEXIT_MAX */
- #ifdef _SC_AVPHYS_PAGES
- if (x == _SC_AVPHYS_PAGES)
- {*r = Mono_Posix_SysconfName__SC_AVPHYS_PAGES; return 0;}
- #endif /* ndef _SC_AVPHYS_PAGES */
- #ifdef _SC_BARRIERS
- if (x == _SC_BARRIERS)
- {*r = Mono_Posix_SysconfName__SC_BARRIERS; return 0;}
- #endif /* ndef _SC_BARRIERS */
- #ifdef _SC_BASE
- if (x == _SC_BASE)
- {*r = Mono_Posix_SysconfName__SC_BASE; return 0;}
- #endif /* ndef _SC_BASE */
- #ifdef _SC_BC_BASE_MAX
- if (x == _SC_BC_BASE_MAX)
- {*r = Mono_Posix_SysconfName__SC_BC_BASE_MAX; return 0;}
- #endif /* ndef _SC_BC_BASE_MAX */
- #ifdef _SC_BC_DIM_MAX
- if (x == _SC_BC_DIM_MAX)
- {*r = Mono_Posix_SysconfName__SC_BC_DIM_MAX; return 0;}
- #endif /* ndef _SC_BC_DIM_MAX */
- #ifdef _SC_BC_SCALE_MAX
- if (x == _SC_BC_SCALE_MAX)
- {*r = Mono_Posix_SysconfName__SC_BC_SCALE_MAX; return 0;}
- #endif /* ndef _SC_BC_SCALE_MAX */
- #ifdef _SC_BC_STRING_MAX
- if (x == _SC_BC_STRING_MAX)
- {*r = Mono_Posix_SysconfName__SC_BC_STRING_MAX; return 0;}
- #endif /* ndef _SC_BC_STRING_MAX */
- #ifdef _SC_CHARCLASS_NAME_MAX
- if (x == _SC_CHARCLASS_NAME_MAX)
- {*r = Mono_Posix_SysconfName__SC_CHARCLASS_NAME_MAX; return 0;}
- #endif /* ndef _SC_CHARCLASS_NAME_MAX */
- #ifdef _SC_CHAR_BIT
- if (x == _SC_CHAR_BIT)
- {*r = Mono_Posix_SysconfName__SC_CHAR_BIT; return 0;}
- #endif /* ndef _SC_CHAR_BIT */
- #ifdef _SC_CHAR_MAX
- if (x == _SC_CHAR_MAX)
- {*r = Mono_Posix_SysconfName__SC_CHAR_MAX; return 0;}
- #endif /* ndef _SC_CHAR_MAX */
- #ifdef _SC_CHAR_MIN
- if (x == _SC_CHAR_MIN)
- {*r = Mono_Posix_SysconfName__SC_CHAR_MIN; return 0;}
- #endif /* ndef _SC_CHAR_MIN */
- #ifdef _SC_CHILD_MAX
- if (x == _SC_CHILD_MAX)
- {*r = Mono_Posix_SysconfName__SC_CHILD_MAX; return 0;}
- #endif /* ndef _SC_CHILD_MAX */
- #ifdef _SC_CLK_TCK
- if (x == _SC_CLK_TCK)
- {*r = Mono_Posix_SysconfName__SC_CLK_TCK; return 0;}
- #endif /* ndef _SC_CLK_TCK */
- #ifdef _SC_CLOCK_SELECTION
- if (x == _SC_CLOCK_SELECTION)
- {*r = Mono_Posix_SysconfName__SC_CLOCK_SELECTION; return 0;}
- #endif /* ndef _SC_CLOCK_SELECTION */
- #ifdef _SC_COLL_WEIGHTS_MAX
- if (x == _SC_COLL_WEIGHTS_MAX)
- {*r = Mono_Posix_SysconfName__SC_COLL_WEIGHTS_MAX; return 0;}
- #endif /* ndef _SC_COLL_WEIGHTS_MAX */
- #ifdef _SC_CPUTIME
- if (x == _SC_CPUTIME)
- {*r = Mono_Posix_SysconfName__SC_CPUTIME; return 0;}
- #endif /* ndef _SC_CPUTIME */
- #ifdef _SC_C_LANG_SUPPORT
- if (x == _SC_C_LANG_SUPPORT)
- {*r = Mono_Posix_SysconfName__SC_C_LANG_SUPPORT; return 0;}
- #endif /* ndef _SC_C_LANG_SUPPORT */
- #ifdef _SC_C_LANG_SUPPORT_R
- if (x == _SC_C_LANG_SUPPORT_R)
- {*r = Mono_Posix_SysconfName__SC_C_LANG_SUPPORT_R; return 0;}
- #endif /* ndef _SC_C_LANG_SUPPORT_R */
- #ifdef _SC_DELAYTIMER_MAX
- if (x == _SC_DELAYTIMER_MAX)
- {*r = Mono_Posix_SysconfName__SC_DELAYTIMER_MAX; return 0;}
- #endif /* ndef _SC_DELAYTIMER_MAX */
- #ifdef _SC_DEVICE_IO
- if (x == _SC_DEVICE_IO)
- {*r = Mono_Posix_SysconfName__SC_DEVICE_IO; return 0;}
- #endif /* ndef _SC_DEVICE_IO */
- #ifdef _SC_DEVICE_SPECIFIC
- if (x == _SC_DEVICE_SPECIFIC)
- {*r = Mono_Posix_SysconfName__SC_DEVICE_SPECIFIC; return 0;}
- #endif /* ndef _SC_DEVICE_SPECIFIC */
- #ifdef _SC_DEVICE_SPECIFIC_R
- if (x == _SC_DEVICE_SPECIFIC_R)
- {*r = Mono_Posix_SysconfName__SC_DEVICE_SPECIFIC_R; return 0;}
- #endif /* ndef _SC_DEVICE_SPECIFIC_R */
- #ifdef _SC_EQUIV_CLASS_MAX
- if (x == _SC_EQUIV_CLASS_MAX)
- {*r = Mono_Posix_SysconfName__SC_EQUIV_CLASS_MAX; return 0;}
- #endif /* ndef _SC_EQUIV_CLASS_MAX */
- #ifdef _SC_EXPR_NEST_MAX
- if (x == _SC_EXPR_NEST_MAX)
- {*r = Mono_Posix_SysconfName__SC_EXPR_NEST_MAX; return 0;}
- #endif /* ndef _SC_EXPR_NEST_MAX */
- #ifdef _SC_FD_MGMT
- if (x == _SC_FD_MGMT)
- {*r = Mono_Posix_SysconfName__SC_FD_MGMT; return 0;}
- #endif /* ndef _SC_FD_MGMT */
- #ifdef _SC_FIFO
- if (x == _SC_FIFO)
- {*r = Mono_Posix_SysconfName__SC_FIFO; return 0;}
- #endif /* ndef _SC_FIFO */
- #ifdef _SC_FILE_ATTRIBUTES
- if (x == _SC_FILE_ATTRIBUTES)
- {*r = Mono_Posix_SysconfName__SC_FILE_ATTRIBUTES; return 0;}
- #endif /* ndef _SC_FILE_ATTRIBUTES */
- #ifdef _SC_FILE_LOCKING
- if (x == _SC_FILE_LOCKING)
- {*r = Mono_Posix_SysconfName__SC_FILE_LOCKING; return 0;}
- #endif /* ndef _SC_FILE_LOCKING */
- #ifdef _SC_FILE_SYSTEM
- if (x == _SC_FILE_SYSTEM)
- {*r = Mono_Posix_SysconfName__SC_FILE_SYSTEM; return 0;}
- #endif /* ndef _SC_FILE_SYSTEM */
- #ifdef _SC_FSYNC
- if (x == _SC_FSYNC)
- {*r = Mono_Posix_SysconfName__SC_FSYNC; return 0;}
- #endif /* ndef _SC_FSYNC */
- #ifdef _SC_GETGR_R_SIZE_MAX
- if (x == _SC_GETGR_R_SIZE_MAX)
- {*r = Mono_Posix_SysconfName__SC_GETGR_R_SIZE_MAX; return 0;}
- #endif /* ndef _SC_GETGR_R_SIZE_MAX */
- #ifdef _SC_GETPW_R_SIZE_MAX
- if (x == _SC_GETPW_R_SIZE_MAX)
- {*r = Mono_Posix_SysconfName__SC_GETPW_R_SIZE_MAX; return 0;}
- #endif /* ndef _SC_GETPW_R_SIZE_MAX */
- #ifdef _SC_HOST_NAME_MAX
- if (x == _SC_HOST_NAME_MAX)
- {*r = Mono_Posix_SysconfName__SC_HOST_NAME_MAX; return 0;}
- #endif /* ndef _SC_HOST_NAME_MAX */
- #ifdef _SC_INT_MAX
- if (x == _SC_INT_MAX)
- {*r = Mono_Posix_SysconfName__SC_INT_MAX; return 0;}
- #endif /* ndef _SC_INT_MAX */
- #ifdef _SC_INT_MIN
- if (x == _SC_INT_MIN)
- {*r = Mono_Posix_SysconfName__SC_INT_MIN; return 0;}
- #endif /* ndef _SC_INT_MIN */
- #ifdef _SC_IOV_MAX
- if (x == _SC_IOV_MAX)
- {*r = Mono_Posix_SysconfName__SC_IOV_MAX; return 0;}
- #endif /* ndef _SC_IOV_MAX */
- #ifdef _SC_JOB_CONTROL
- if (x == _SC_JOB_CONTROL)
- {*r = Mono_Posix_SysconfName__SC_JOB_CONTROL; return 0;}
- #endif /* ndef _SC_JOB_CONTROL */
- #ifdef _SC_LEVEL1_DCACHE_ASSOC
- if (x == _SC_LEVEL1_DCACHE_ASSOC)
- {*r = Mono_Posix_SysconfName__SC_LEVEL1_DCACHE_ASSOC; return 0;}
- #endif /* ndef _SC_LEVEL1_DCACHE_ASSOC */
- #ifdef _SC_LEVEL1_DCACHE_LINESIZE
- if (x == _SC_LEVEL1_DCACHE_LINESIZE)
- {*r = Mono_Posix_SysconfName__SC_LEVEL1_DCACHE_LINESIZE; return 0;}
- #endif /* ndef _SC_LEVEL1_DCACHE_LINESIZE */
- #ifdef _SC_LEVEL1_DCACHE_SIZE
- if (x == _SC_LEVEL1_DCACHE_SIZE)
- {*r = Mono_Posix_SysconfName__SC_LEVEL1_DCACHE_SIZE; return 0;}
- #endif /* ndef _SC_LEVEL1_DCACHE_SIZE */
- #ifdef _SC_LEVEL1_ICACHE_ASSOC
- if (x == _SC_LEVEL1_ICACHE_ASSOC)
- {*r = Mono_Posix_SysconfName__SC_LEVEL1_ICACHE_ASSOC; return 0;}
- #endif /* ndef _SC_LEVEL1_ICACHE_ASSOC */
- #ifdef _SC_LEVEL1_ICACHE_LINESIZE
- if (x == _SC_LEVEL1_ICACHE_LINESIZE)
- {*r = Mono_Posix_SysconfName__SC_LEVEL1_ICACHE_LINESIZE; return 0;}
- #endif /* ndef _SC_LEVEL1_ICACHE_LINESIZE */
- #ifdef _SC_LEVEL1_ICACHE_SIZE
- if (x == _SC_LEVEL1_ICACHE_SIZE)
- {*r = Mono_Posix_SysconfName__SC_LEVEL1_ICACHE_SIZE; return 0;}
- #endif /* ndef _SC_LEVEL1_ICACHE_SIZE */
- #ifdef _SC_LEVEL2_CACHE_ASSOC
- if (x == _SC_LEVEL2_CACHE_ASSOC)
- {*r = Mono_Posix_SysconfName__SC_LEVEL2_CACHE_ASSOC; return 0;}
- #endif /* ndef _SC_LEVEL2_CACHE_ASSOC */
- #ifdef _SC_LEVEL2_CACHE_LINESIZE
- if (x == _SC_LEVEL2_CACHE_LINESIZE)
- {*r = Mono_Posix_SysconfName__SC_LEVEL2_CACHE_LINESIZE; return 0;}
- #endif /* ndef _SC_LEVEL2_CACHE_LINESIZE */
- #ifdef _SC_LEVEL2_CACHE_SIZE
- if (x == _SC_LEVEL2_CACHE_SIZE)
- {*r = Mono_Posix_SysconfName__SC_LEVEL2_CACHE_SIZE; return 0;}
- #endif /* ndef _SC_LEVEL2_CACHE_SIZE */
- #ifdef _SC_LEVEL3_CACHE_ASSOC
- if (x == _SC_LEVEL3_CACHE_ASSOC)
- {*r = Mono_Posix_SysconfName__SC_LEVEL3_CACHE_ASSOC; return 0;}
- #endif /* ndef _SC_LEVEL3_CACHE_ASSOC */
- #ifdef _SC_LEVEL3_CACHE_LINESIZE
- if (x == _SC_LEVEL3_CACHE_LINESIZE)
- {*r = Mono_Posix_SysconfName__SC_LEVEL3_CACHE_LINESIZE; return 0;}
- #endif /* ndef _SC_LEVEL3_CACHE_LINESIZE */
- #ifdef _SC_LEVEL3_CACHE_SIZE
- if (x == _SC_LEVEL3_CACHE_SIZE)
- {*r = Mono_Posix_SysconfName__SC_LEVEL3_CACHE_SIZE; return 0;}
- #endif /* ndef _SC_LEVEL3_CACHE_SIZE */
- #ifdef _SC_LEVEL4_CACHE_ASSOC
- if (x == _SC_LEVEL4_CACHE_ASSOC)
- {*r = Mono_Posix_SysconfName__SC_LEVEL4_CACHE_ASSOC; return 0;}
- #endif /* ndef _SC_LEVEL4_CACHE_ASSOC */
- #ifdef _SC_LEVEL4_CACHE_LINESIZE
- if (x == _SC_LEVEL4_CACHE_LINESIZE)
- {*r = Mono_Posix_SysconfName__SC_LEVEL4_CACHE_LINESIZE; return 0;}
- #endif /* ndef _SC_LEVEL4_CACHE_LINESIZE */
- #ifdef _SC_LEVEL4_CACHE_SIZE
- if (x == _SC_LEVEL4_CACHE_SIZE)
- {*r = Mono_Posix_SysconfName__SC_LEVEL4_CACHE_SIZE; return 0;}
- #endif /* ndef _SC_LEVEL4_CACHE_SIZE */
- #ifdef _SC_LINE_MAX
- if (x == _SC_LINE_MAX)
- {*r = Mono_Posix_SysconfName__SC_LINE_MAX; return 0;}
- #endif /* ndef _SC_LINE_MAX */
- #ifdef _SC_LOGIN_NAME_MAX
- if (x == _SC_LOGIN_NAME_MAX)
- {*r = Mono_Posix_SysconfName__SC_LOGIN_NAME_MAX; return 0;}
- #endif /* ndef _SC_LOGIN_NAME_MAX */
- #ifdef _SC_LONG_BIT
- if (x == _SC_LONG_BIT)
- {*r = Mono_Posix_SysconfName__SC_LONG_BIT; return 0;}
- #endif /* ndef _SC_LONG_BIT */
- #ifdef _SC_MAPPED_FILES
- if (x == _SC_MAPPED_FILES)
- {*r = Mono_Posix_SysconfName__SC_MAPPED_FILES; return 0;}
- #endif /* ndef _SC_MAPPED_FILES */
- #ifdef _SC_MB_LEN_MAX
- if (x == _SC_MB_LEN_MAX)
- {*r = Mono_Posix_SysconfName__SC_MB_LEN_MAX; return 0;}
- #endif /* ndef _SC_MB_LEN_MAX */
- #ifdef _SC_MEMLOCK
- if (x == _SC_MEMLOCK)
- {*r = Mono_Posix_SysconfName__SC_MEMLOCK; return 0;}
- #endif /* ndef _SC_MEMLOCK */
- #ifdef _SC_MEMLOCK_RANGE
- if (x == _SC_MEMLOCK_RANGE)
- {*r = Mono_Posix_SysconfName__SC_MEMLOCK_RANGE; return 0;}
- #endif /* ndef _SC_MEMLOCK_RANGE */
- #ifdef _SC_MEMORY_PROTECTION
- if (x == _SC_MEMORY_PROTECTION)
- {*r = Mono_Posix_SysconfName__SC_MEMORY_PROTECTION; return 0;}
- #endif /* ndef _SC_MEMORY_PROTECTION */
- #ifdef _SC_MESSAGE_PASSING
- if (x == _SC_MESSAGE_PASSING)
- {*r = Mono_Posix_SysconfName__SC_MESSAGE_PASSING; return 0;}
- #endif /* ndef _SC_MESSAGE_PASSING */
- #ifdef _SC_MONOTONIC_CLOCK
- if (x == _SC_MONOTONIC_CLOCK)
- {*r = Mono_Posix_SysconfName__SC_MONOTONIC_CLOCK; return 0;}
- #endif /* ndef _SC_MONOTONIC_CLOCK */
- #ifdef _SC_MQ_OPEN_MAX
- if (x == _SC_MQ_OPEN_MAX)
- {*r = Mono_Posix_SysconfName__SC_MQ_OPEN_MAX; return 0;}
- #endif /* ndef _SC_MQ_OPEN_MAX */
- #ifdef _SC_MQ_PRIO_MAX
- if (x == _SC_MQ_PRIO_MAX)
- {*r = Mono_Posix_SysconfName__SC_MQ_PRIO_MAX; return 0;}
- #endif /* ndef _SC_MQ_PRIO_MAX */
- #ifdef _SC_MULTI_PROCESS
- if (x == _SC_MULTI_PROCESS)
- {*r = Mono_Posix_SysconfName__SC_MULTI_PROCESS; return 0;}
- #endif /* ndef _SC_MULTI_PROCESS */
- #ifdef _SC_NETWORKING
- if (x == _SC_NETWORKING)
- {*r = Mono_Posix_SysconfName__SC_NETWORKING; return 0;}
- #endif /* ndef _SC_NETWORKING */
- #ifdef _SC_NGROUPS_MAX
- if (x == _SC_NGROUPS_MAX)
- {*r = Mono_Posix_SysconfName__SC_NGROUPS_MAX; return 0;}
- #endif /* ndef _SC_NGROUPS_MAX */
- #ifdef _SC_NL_ARGMAX
- if (x == _SC_NL_ARGMAX)
- {*r = Mono_Posix_SysconfName__SC_NL_ARGMAX; return 0;}
- #endif /* ndef _SC_NL_ARGMAX */
- #ifdef _SC_NL_LANGMAX
- if (x == _SC_NL_LANGMAX)
- {*r = Mono_Posix_SysconfName__SC_NL_LANGMAX; return 0;}
- #endif /* ndef _SC_NL_LANGMAX */
- #ifdef _SC_NL_MSGMAX
- if (x == _SC_NL_MSGMAX)
- {*r = Mono_Posix_SysconfName__SC_NL_MSGMAX; return 0;}
- #endif /* ndef _SC_NL_MSGMAX */
- #ifdef _SC_NL_NMAX
- if (x == _SC_NL_NMAX)
- {*r = Mono_Posix_SysconfName__SC_NL_NMAX; return 0;}
- #endif /* ndef _SC_NL_NMAX */
- #ifdef _SC_NL_SETMAX
- if (x == _SC_NL_SETMAX)
- {*r = Mono_Posix_SysconfName__SC_NL_SETMAX; return 0;}
- #endif /* ndef _SC_NL_SETMAX */
- #ifdef _SC_NL_TEXTMAX
- if (x == _SC_NL_TEXTMAX)
- {*r = Mono_Posix_SysconfName__SC_NL_TEXTMAX; return 0;}
- #endif /* ndef _SC_NL_TEXTMAX */
- #ifdef _SC_NPROCESSORS_CONF
- if (x == _SC_NPROCESSORS_CONF)
- {*r = Mono_Posix_SysconfName__SC_NPROCESSORS_CONF; return 0;}
- #endif /* ndef _SC_NPROCESSORS_CONF */
- #ifdef _SC_NPROCESSORS_ONLN
- if (x == _SC_NPROCESSORS_ONLN)
- {*r = Mono_Posix_SysconfName__SC_NPROCESSORS_ONLN; return 0;}
- #endif /* ndef _SC_NPROCESSORS_ONLN */
- #ifdef _SC_NZERO
- if (x == _SC_NZERO)
- {*r = Mono_Posix_SysconfName__SC_NZERO; return 0;}
- #endif /* ndef _SC_NZERO */
- #ifdef _SC_OPEN_MAX
- if (x == _SC_OPEN_MAX)
- {*r = Mono_Posix_SysconfName__SC_OPEN_MAX; return 0;}
- #endif /* ndef _SC_OPEN_MAX */
- #ifdef _SC_PAGESIZE
- if (x == _SC_PAGESIZE)
- {*r = Mono_Posix_SysconfName__SC_PAGESIZE; return 0;}
- #endif /* ndef _SC_PAGESIZE */
- #ifdef _SC_PASS_MAX
- if (x == _SC_PASS_MAX)
- {*r = Mono_Posix_SysconfName__SC_PASS_MAX; return 0;}
- #endif /* ndef _SC_PASS_MAX */
- #ifdef _SC_PHYS_PAGES
- if (x == _SC_PHYS_PAGES)
- {*r = Mono_Posix_SysconfName__SC_PHYS_PAGES; return 0;}
- #endif /* ndef _SC_PHYS_PAGES */
- #ifdef _SC_PII
- if (x == _SC_PII)
- {*r = Mono_Posix_SysconfName__SC_PII; return 0;}
- #endif /* ndef _SC_PII */
- #ifdef _SC_PII_INTERNET
- if (x == _SC_PII_INTERNET)
- {*r = Mono_Posix_SysconfName__SC_PII_INTERNET; return 0;}
- #endif /* ndef _SC_PII_INTERNET */
- #ifdef _SC_PII_INTERNET_DGRAM
- if (x == _SC_PII_INTERNET_DGRAM)
- {*r = Mono_Posix_SysconfName__SC_PII_INTERNET_DGRAM; return 0;}
- #endif /* ndef _SC_PII_INTERNET_DGRAM */
- #ifdef _SC_PII_INTERNET_STREAM
- if (x == _SC_PII_INTERNET_STREAM)
- {*r = Mono_Posix_SysconfName__SC_PII_INTERNET_STREAM; return 0;}
- #endif /* ndef _SC_PII_INTERNET_STREAM */
- #ifdef _SC_PII_OSI
- if (x == _SC_PII_OSI)
- {*r = Mono_Posix_SysconfName__SC_PII_OSI; return 0;}
- #endif /* ndef _SC_PII_OSI */
- #ifdef _SC_PII_OSI_CLTS
- if (x == _SC_PII_OSI_CLTS)
- {*r = Mono_Posix_SysconfName__SC_PII_OSI_CLTS; return 0;}
- #endif /* ndef _SC_PII_OSI_CLTS */
- #ifdef _SC_PII_OSI_COTS
- if (x == _SC_PII_OSI_COTS)
- {*r = Mono_Posix_SysconfName__SC_PII_OSI_COTS; return 0;}
- #endif /* ndef _SC_PII_OSI_COTS */
- #ifdef _SC_PII_OSI_M
- if (x == _SC_PII_OSI_M)
- {*r = Mono_Posix_SysconfName__SC_PII_OSI_M; return 0;}
- #endif /* ndef _SC_PII_OSI_M */
- #ifdef _SC_PII_SOCKET
- if (x == _SC_PII_SOCKET)
- {*r = Mono_Posix_SysconfName__SC_PII_SOCKET; return 0;}
- #endif /* ndef _SC_PII_SOCKET */
- #ifdef _SC_PII_XTI
- if (x == _SC_PII_XTI)
- {*r = Mono_Posix_SysconfName__SC_PII_XTI; return 0;}
- #endif /* ndef _SC_PII_XTI */
- #ifdef _SC_PIPE
- if (x == _SC_PIPE)
- {*r = Mono_Posix_SysconfName__SC_PIPE; return 0;}
- #endif /* ndef _SC_PIPE */
- #ifdef _SC_POLL
- if (x == _SC_POLL)
- {*r = Mono_Posix_SysconfName__SC_POLL; return 0;}
- #endif /* ndef _SC_POLL */
- #ifdef _SC_PRIORITIZED_IO
- if (x == _SC_PRIORITIZED_IO)
- {*r = Mono_Posix_SysconfName__SC_PRIORITIZED_IO; return 0;}
- #endif /* ndef _SC_PRIORITIZED_IO */
- #ifdef _SC_PRIORITY_SCHEDULING
- if (x == _SC_PRIORITY_SCHEDULING)
- {*r = Mono_Posix_SysconfName__SC_PRIORITY_SCHEDULING; return 0;}
- #endif /* ndef _SC_PRIORITY_SCHEDULING */
- #ifdef _SC_READER_WRITER_LOCKS
- if (x == _SC_READER_WRITER_LOCKS)
- {*r = Mono_Posix_SysconfName__SC_READER_WRITER_LOCKS; return 0;}
- #endif /* ndef _SC_READER_WRITER_LOCKS */
- #ifdef _SC_REALTIME_SIGNALS
- if (x == _SC_REALTIME_SIGNALS)
- {*r = Mono_Posix_SysconfName__SC_REALTIME_SIGNALS; return 0;}
- #endif /* ndef _SC_REALTIME_SIGNALS */
- #ifdef _SC_REGEXP
- if (x == _SC_REGEXP)
- {*r = Mono_Posix_SysconfName__SC_REGEXP; return 0;}
- #endif /* ndef _SC_REGEXP */
- #ifdef _SC_REGEX_VERSION
- if (x == _SC_REGEX_VERSION)
- {*r = Mono_Posix_SysconfName__SC_REGEX_VERSION; return 0;}
- #endif /* ndef _SC_REGEX_VERSION */
- #ifdef _SC_RE_DUP_MAX
- if (x == _SC_RE_DUP_MAX)
- {*r = Mono_Posix_SysconfName__SC_RE_DUP_MAX; return 0;}
- #endif /* ndef _SC_RE_DUP_MAX */
- #ifdef _SC_RTSIG_MAX
- if (x == _SC_RTSIG_MAX)
- {*r = Mono_Posix_SysconfName__SC_RTSIG_MAX; return 0;}
- #endif /* ndef _SC_RTSIG_MAX */
- #ifdef _SC_SAVED_IDS
- if (x == _SC_SAVED_IDS)
- {*r = Mono_Posix_SysconfName__SC_SAVED_IDS; return 0;}
- #endif /* ndef _SC_SAVED_IDS */
- #ifdef _SC_SCHAR_MAX
- if (x == _SC_SCHAR_MAX)
- {*r = Mono_Posix_SysconfName__SC_SCHAR_MAX; return 0;}
- #endif /* ndef _SC_SCHAR_MAX */
- #ifdef _SC_SCHAR_MIN
- if (x == _SC_SCHAR_MIN)
- {*r = Mono_Posix_SysconfName__SC_SCHAR_MIN; return 0;}
- #endif /* ndef _SC_SCHAR_MIN */
- #ifdef _SC_SELECT
- if (x == _SC_SELECT)
- {*r = Mono_Posix_SysconfName__SC_SELECT; return 0;}
- #endif /* ndef _SC_SELECT */
- #ifdef _SC_SEMAPHORES
- if (x == _SC_SEMAPHORES)
- {*r = Mono_Posix_SysconfName__SC_SEMAPHORES; return 0;}
- #endif /* ndef _SC_SEMAPHORES */
- #ifdef _SC_SEM_NSEMS_MAX
- if (x == _SC_SEM_NSEMS_MAX)
- {*r = Mono_Posix_SysconfName__SC_SEM_NSEMS_MAX; return 0;}
- #endif /* ndef _SC_SEM_NSEMS_MAX */
- #ifdef _SC_SEM_VALUE_MAX
- if (x == _SC_SEM_VALUE_MAX)
- {*r = Mono_Posix_SysconfName__SC_SEM_VALUE_MAX; return 0;}
- #endif /* ndef _SC_SEM_VALUE_MAX */
- #ifdef _SC_SHARED_MEMORY_OBJECTS
- if (x == _SC_SHARED_MEMORY_OBJECTS)
- {*r = Mono_Posix_SysconfName__SC_SHARED_MEMORY_OBJECTS; return 0;}
- #endif /* ndef _SC_SHARED_MEMORY_OBJECTS */
- #ifdef _SC_SHELL
- if (x == _SC_SHELL)
- {*r = Mono_Posix_SysconfName__SC_SHELL; return 0;}
- #endif /* ndef _SC_SHELL */
- #ifdef _SC_SHRT_MAX
- if (x == _SC_SHRT_MAX)
- {*r = Mono_Posix_SysconfName__SC_SHRT_MAX; return 0;}
- #endif /* ndef _SC_SHRT_MAX */
- #ifdef _SC_SHRT_MIN
- if (x == _SC_SHRT_MIN)
- {*r = Mono_Posix_SysconfName__SC_SHRT_MIN; return 0;}
- #endif /* ndef _SC_SHRT_MIN */
- #ifdef _SC_SIGNALS
- if (x == _SC_SIGNALS)
- {*r = Mono_Posix_SysconfName__SC_SIGNALS; return 0;}
- #endif /* ndef _SC_SIGNALS */
- #ifdef _SC_SIGQUEUE_MAX
- if (x == _SC_SIGQUEUE_MAX)
- {*r = Mono_Posix_SysconfName__SC_SIGQUEUE_MAX; return 0;}
- #endif /* ndef _SC_SIGQUEUE_MAX */
- #ifdef _SC_SINGLE_PROCESS
- if (x == _SC_SINGLE_PROCESS)
- {*r = Mono_Posix_SysconfName__SC_SINGLE_PROCESS; return 0;}
- #endif /* ndef _SC_SINGLE_PROCESS */
- #ifdef _SC_SPAWN
- if (x == _SC_SPAWN)
- {*r = Mono_Posix_SysconfName__SC_SPAWN; return 0;}
- #endif /* ndef _SC_SPAWN */
- #ifdef _SC_SPIN_LOCKS
- if (x == _SC_SPIN_LOCKS)
- {*r = Mono_Posix_SysconfName__SC_SPIN_LOCKS; return 0;}
- #endif /* ndef _SC_SPIN_LOCKS */
- #ifdef _SC_SPORADIC_SERVER
- if (x == _SC_SPORADIC_SERVER)
- {*r = Mono_Posix_SysconfName__SC_SPORADIC_SERVER; return 0;}
- #endif /* ndef _SC_SPORADIC_SERVER */
- #ifdef _SC_SSIZE_MAX
- if (x == _SC_SSIZE_MAX)
- {*r = Mono_Posix_SysconfName__SC_SSIZE_MAX; return 0;}
- #endif /* ndef _SC_SSIZE_MAX */
- #ifdef _SC_STREAMS
- if (x == _SC_STREAMS)
- {*r = Mono_Posix_SysconfName__SC_STREAMS; return 0;}
- #endif /* ndef _SC_STREAMS */
- #ifdef _SC_STREAM_MAX
- if (x == _SC_STREAM_MAX)
- {*r = Mono_Posix_SysconfName__SC_STREAM_MAX; return 0;}
- #endif /* ndef _SC_STREAM_MAX */
- #ifdef _SC_SYMLOOP_MAX
- if (x == _SC_SYMLOOP_MAX)
- {*r = Mono_Posix_SysconfName__SC_SYMLOOP_MAX; return 0;}
- #endif /* ndef _SC_SYMLOOP_MAX */
- #ifdef _SC_SYNCHRONIZED_IO
- if (x == _SC_SYNCHRONIZED_IO)
- {*r = Mono_Posix_SysconfName__SC_SYNCHRONIZED_IO; return 0;}
- #endif /* ndef _SC_SYNCHRONIZED_IO */
- #ifdef _SC_SYSTEM_DATABASE
- if (x == _SC_SYSTEM_DATABASE)
- {*r = Mono_Posix_SysconfName__SC_SYSTEM_DATABASE; return 0;}
- #endif /* ndef _SC_SYSTEM_DATABASE */
- #ifdef _SC_SYSTEM_DATABASE_R
- if (x == _SC_SYSTEM_DATABASE_R)
- {*r = Mono_Posix_SysconfName__SC_SYSTEM_DATABASE_R; return 0;}
- #endif /* ndef _SC_SYSTEM_DATABASE_R */
- #ifdef _SC_THREADS
- if (x == _SC_THREADS)
- {*r = Mono_Posix_SysconfName__SC_THREADS; return 0;}
- #endif /* ndef _SC_THREADS */
- #ifdef _SC_THREAD_ATTR_STACKADDR
- if (x == _SC_THREAD_ATTR_STACKADDR)
- {*r = Mono_Posix_SysconfName__SC_THREAD_ATTR_STACKADDR; return 0;}
- #endif /* ndef _SC_THREAD_ATTR_STACKADDR */
- #ifdef _SC_THREAD_ATTR_STACKSIZE
- if (x == _SC_THREAD_ATTR_STACKSIZE)
- {*r = Mono_Posix_SysconfName__SC_THREAD_ATTR_STACKSIZE; return 0;}
- #endif /* ndef _SC_THREAD_ATTR_STACKSIZE */
- #ifdef _SC_THREAD_CPUTIME
- if (x == _SC_THREAD_CPUTIME)
- {*r = Mono_Posix_SysconfName__SC_THREAD_CPUTIME; return 0;}
- #endif /* ndef _SC_THREAD_CPUTIME */
- #ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS
- if (x == _SC_THREAD_DESTRUCTOR_ITERATIONS)
- {*r = Mono_Posix_SysconfName__SC_THREAD_DESTRUCTOR_ITERATIONS; return 0;}
- #endif /* ndef _SC_THREAD_DESTRUCTOR_ITERATIONS */
- #ifdef _SC_THREAD_KEYS_MAX
- if (x == _SC_THREAD_KEYS_MAX)
- {*r = Mono_Posix_SysconfName__SC_THREAD_KEYS_MAX; return 0;}
- #endif /* ndef _SC_THREAD_KEYS_MAX */
- #ifdef _SC_THREAD_PRIORITY_SCHEDULING
- if (x == _SC_THREAD_PRIORITY_SCHEDULING)
- {*r = Mono_Posix_SysconfName__SC_THREAD_PRIORITY_SCHEDULING; return 0;}
- #endif /* ndef _SC_THREAD_PRIORITY_SCHEDULING */
- #ifdef _SC_THREAD_PRIO_INHERIT
- if (x == _SC_THREAD_PRIO_INHERIT)
- {*r = Mono_Posix_SysconfName__SC_THREAD_PRIO_INHERIT; return 0;}
- #endif /* ndef _SC_THREAD_PRIO_INHERIT */
- #ifdef _SC_THREAD_PRIO_PROTECT
- if (x == _SC_THREAD_PRIO_PROTECT)
- {*r = Mono_Posix_SysconfName__SC_THREAD_PRIO_PROTECT; return 0;}
- #endif /* ndef _SC_THREAD_PRIO_PROTECT */
- #ifdef _SC_THREAD_PROCESS_SHARED
- if (x == _SC_THREAD_PROCESS_SHARED)
- {*r = Mono_Posix_SysconfName__SC_THREAD_PROCESS_SHARED; return 0;}
- #endif /* ndef _SC_THREAD_PROCESS_SHARED */
- #ifdef _SC_THREAD_SAFE_FUNCTIONS
- if (x == _SC_THREAD_SAFE_FUNCTIONS)
- {*r = Mono_Posix_SysconfName__SC_THREAD_SAFE_FUNCTIONS; return 0;}
- #endif /* ndef _SC_THREAD_SAFE_FUNCTIONS */
- #ifdef _SC_THREAD_SPORADIC_SERVER
- if (x == _SC_THREAD_SPORADIC_SERVER)
- {*r = Mono_Posix_SysconfName__SC_THREAD_SPORADIC_SERVER; return 0;}
- #endif /* ndef _SC_THREAD_SPORADIC_SERVER */
- #ifdef _SC_THREAD_STACK_MIN
- if (x == _SC_THREAD_STACK_MIN)
- {*r = Mono_Posix_SysconfName__SC_THREAD_STACK_MIN; return 0;}
- #endif /* ndef _SC_THREAD_STACK_MIN */
- #ifdef _SC_THREAD_THREADS_MAX
- if (x == _SC_THREAD_THREADS_MAX)
- {*r = Mono_Posix_SysconfName__SC_THREAD_THREADS_MAX; return 0;}
- #endif /* ndef _SC_THREAD_THREADS_MAX */
- #ifdef _SC_TIMEOUTS
- if (x == _SC_TIMEOUTS)
- {*r = Mono_Posix_SysconfName__SC_TIMEOUTS; return 0;}
- #endif /* ndef _SC_TIMEOUTS */
- #ifdef _SC_TIMERS
- if (x == _SC_TIMERS)
- {*r = Mono_Posix_SysconfName__SC_TIMERS; return 0;}
- #endif /* ndef _SC_TIMERS */
- #ifdef _SC_TIMER_MAX
- if (x == _SC_TIMER_MAX)
- {*r = Mono_Posix_SysconfName__SC_TIMER_MAX; return 0;}
- #endif /* ndef _SC_TIMER_MAX */
- #ifdef _SC_TRACE
- if (x == _SC_TRACE)
- {*r = Mono_Posix_SysconfName__SC_TRACE; return 0;}
- #endif /* ndef _SC_TRACE */
- #ifdef _SC_TRACE_EVENT_FILTER
- if (x == _SC_TRACE_EVENT_FILTER)
- {*r = Mono_Posix_SysconfName__SC_TRACE_EVENT_FILTER; return 0;}
- #endif /* ndef _SC_TRACE_EVENT_FILTER */
- #ifdef _SC_TRACE_INHERIT
- if (x == _SC_TRACE_INHERIT)
- {*r = Mono_Posix_SysconfName__SC_TRACE_INHERIT; return 0;}
- #endif /* ndef _SC_TRACE_INHERIT */
- #ifdef _SC_TRACE_LOG
- if (x == _SC_TRACE_LOG)
- {*r = Mono_Posix_SysconfName__SC_TRACE_LOG; return 0;}
- #endif /* ndef _SC_TRACE_LOG */
- #ifdef _SC_TTY_NAME_MAX
- if (x == _SC_TTY_NAME_MAX)
- {*r = Mono_Posix_SysconfName__SC_TTY_NAME_MAX; return 0;}
- #endif /* ndef _SC_TTY_NAME_MAX */
- #ifdef _SC_TYPED_MEMORY_OBJECTS
- if (x == _SC_TYPED_MEMORY_OBJECTS)
- {*r = Mono_Posix_SysconfName__SC_TYPED_MEMORY_OBJECTS; return 0;}
- #endif /* ndef _SC_TYPED_MEMORY_OBJECTS */
- #ifdef _SC_TZNAME_MAX
- if (x == _SC_TZNAME_MAX)
- {*r = Mono_Posix_SysconfName__SC_TZNAME_MAX; return 0;}
- #endif /* ndef _SC_TZNAME_MAX */
- #ifdef _SC_T_IOV_MAX
- if (x == _SC_T_IOV_MAX)
- {*r = Mono_Posix_SysconfName__SC_T_IOV_MAX; return 0;}
- #endif /* ndef _SC_T_IOV_MAX */
- #ifdef _SC_UCHAR_MAX
- if (x == _SC_UCHAR_MAX)
- {*r = Mono_Posix_SysconfName__SC_UCHAR_MAX; return 0;}
- #endif /* ndef _SC_UCHAR_MAX */
- #ifdef _SC_UINT_MAX
- if (x == _SC_UINT_MAX)
- {*r = Mono_Posix_SysconfName__SC_UINT_MAX; return 0;}
- #endif /* ndef _SC_UINT_MAX */
- #ifdef _SC_UIO_MAXIOV
- if (x == _SC_UIO_MAXIOV)
- {*r = Mono_Posix_SysconfName__SC_UIO_MAXIOV; return 0;}
- #endif /* ndef _SC_UIO_MAXIOV */
- #ifdef _SC_ULONG_MAX
- if (x == _SC_ULONG_MAX)
- {*r = Mono_Posix_SysconfName__SC_ULONG_MAX; return 0;}
- #endif /* ndef _SC_ULONG_MAX */
- #ifdef _SC_USER_GROUPS
- if (x == _SC_USER_GROUPS)
- {*r = Mono_Posix_SysconfName__SC_USER_GROUPS; return 0;}
- #endif /* ndef _SC_USER_GROUPS */
- #ifdef _SC_USER_GROUPS_R
- if (x == _SC_USER_GROUPS_R)
- {*r = Mono_Posix_SysconfName__SC_USER_GROUPS_R; return 0;}
- #endif /* ndef _SC_USER_GROUPS_R */
- #ifdef _SC_USHRT_MAX
- if (x == _SC_USHRT_MAX)
- {*r = Mono_Posix_SysconfName__SC_USHRT_MAX; return 0;}
- #endif /* ndef _SC_USHRT_MAX */
- #ifdef _SC_V6_ILP32_OFF32
- if (x == _SC_V6_ILP32_OFF32)
- {*r = Mono_Posix_SysconfName__SC_V6_ILP32_OFF32; return 0;}
- #endif /* ndef _SC_V6_ILP32_OFF32 */
- #ifdef _SC_V6_ILP32_OFFBIG
- if (x == _SC_V6_ILP32_OFFBIG)
- {*r = Mono_Posix_SysconfName__SC_V6_ILP32_OFFBIG; return 0;}
- #endif /* ndef _SC_V6_ILP32_OFFBIG */
- #ifdef _SC_V6_LP64_OFF64
- if (x == _SC_V6_LP64_OFF64)
- {*r = Mono_Posix_SysconfName__SC_V6_LP64_OFF64; return 0;}
- #endif /* ndef _SC_V6_LP64_OFF64 */
- #ifdef _SC_V6_LPBIG_OFFBIG
- if (x == _SC_V6_LPBIG_OFFBIG)
- {*r = Mono_Posix_SysconfName__SC_V6_LPBIG_OFFBIG; return 0;}
- #endif /* ndef _SC_V6_LPBIG_OFFBIG */
- #ifdef _SC_VERSION
- if (x == _SC_VERSION)
- {*r = Mono_Posix_SysconfName__SC_VERSION; return 0;}
- #endif /* ndef _SC_VERSION */
- #ifdef _SC_WORD_BIT
- if (x == _SC_WORD_BIT)
- {*r = Mono_Posix_SysconfName__SC_WORD_BIT; return 0;}
- #endif /* ndef _SC_WORD_BIT */
- #ifdef _SC_XBS5_ILP32_OFF32
- if (x == _SC_XBS5_ILP32_OFF32)
- {*r = Mono_Posix_SysconfName__SC_XBS5_ILP32_OFF32; return 0;}
- #endif /* ndef _SC_XBS5_ILP32_OFF32 */
- #ifdef _SC_XBS5_ILP32_OFFBIG
- if (x == _SC_XBS5_ILP32_OFFBIG)
- {*r = Mono_Posix_SysconfName__SC_XBS5_ILP32_OFFBIG; return 0;}
- #endif /* ndef _SC_XBS5_ILP32_OFFBIG */
- #ifdef _SC_XBS5_LP64_OFF64
- if (x == _SC_XBS5_LP64_OFF64)
- {*r = Mono_Posix_SysconfName__SC_XBS5_LP64_OFF64; return 0;}
- #endif /* ndef _SC_XBS5_LP64_OFF64 */
- #ifdef _SC_XBS5_LPBIG_OFFBIG
- if (x == _SC_XBS5_LPBIG_OFFBIG)
- {*r = Mono_Posix_SysconfName__SC_XBS5_LPBIG_OFFBIG; return 0;}
- #endif /* ndef _SC_XBS5_LPBIG_OFFBIG */
- #ifdef _SC_XOPEN_CRYPT
- if (x == _SC_XOPEN_CRYPT)
- {*r = Mono_Posix_SysconfName__SC_XOPEN_CRYPT; return 0;}
- #endif /* ndef _SC_XOPEN_CRYPT */
- #ifdef _SC_XOPEN_ENH_I18N
- if (x == _SC_XOPEN_ENH_I18N)
- {*r = Mono_Posix_SysconfName__SC_XOPEN_ENH_I18N; return 0;}
- #endif /* ndef _SC_XOPEN_ENH_I18N */
- #ifdef _SC_XOPEN_LEGACY
- if (x == _SC_XOPEN_LEGACY)
- {*r = Mono_Posix_SysconfName__SC_XOPEN_LEGACY; return 0;}
- #endif /* ndef _SC_XOPEN_LEGACY */
- #ifdef _SC_XOPEN_REALTIME
- if (x == _SC_XOPEN_REALTIME)
- {*r = Mono_Posix_SysconfName__SC_XOPEN_REALTIME; return 0;}
- #endif /* ndef _SC_XOPEN_REALTIME */
- #ifdef _SC_XOPEN_REALTIME_THREADS
- if (x == _SC_XOPEN_REALTIME_THREADS)
- {*r = Mono_Posix_SysconfName__SC_XOPEN_REALTIME_THREADS; return 0;}
- #endif /* ndef _SC_XOPEN_REALTIME_THREADS */
- #ifdef _SC_XOPEN_SHM
- if (x == _SC_XOPEN_SHM)
- {*r = Mono_Posix_SysconfName__SC_XOPEN_SHM; return 0;}
- #endif /* ndef _SC_XOPEN_SHM */
- #ifdef _SC_XOPEN_UNIX
- if (x == _SC_XOPEN_UNIX)
- {*r = Mono_Posix_SysconfName__SC_XOPEN_UNIX; return 0;}
- #endif /* ndef _SC_XOPEN_UNIX */
- #ifdef _SC_XOPEN_VERSION
- if (x == _SC_XOPEN_VERSION)
- {*r = Mono_Posix_SysconfName__SC_XOPEN_VERSION; return 0;}
- #endif /* ndef _SC_XOPEN_VERSION */
- #ifdef _SC_XOPEN_XCU_VERSION
- if (x == _SC_XOPEN_XCU_VERSION)
- {*r = Mono_Posix_SysconfName__SC_XOPEN_XCU_VERSION; return 0;}
- #endif /* ndef _SC_XOPEN_XCU_VERSION */
- #ifdef _SC_XOPEN_XPG2
- if (x == _SC_XOPEN_XPG2)
- {*r = Mono_Posix_SysconfName__SC_XOPEN_XPG2; return 0;}
- #endif /* ndef _SC_XOPEN_XPG2 */
- #ifdef _SC_XOPEN_XPG3
- if (x == _SC_XOPEN_XPG3)
- {*r = Mono_Posix_SysconfName__SC_XOPEN_XPG3; return 0;}
- #endif /* ndef _SC_XOPEN_XPG3 */
- #ifdef _SC_XOPEN_XPG4
- if (x == _SC_XOPEN_XPG4)
- {*r = Mono_Posix_SysconfName__SC_XOPEN_XPG4; return 0;}
- #endif /* ndef _SC_XOPEN_XPG4 */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromSyslogFacility (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_SyslogFacility_LOG_AUTH)
- #ifdef LOG_AUTH
- {*r = LOG_AUTH; return 0;}
- #else /* def LOG_AUTH */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_AUTH */
- if (x == Mono_Posix_SyslogFacility_LOG_AUTHPRIV)
- #ifdef LOG_AUTHPRIV
- {*r = LOG_AUTHPRIV; return 0;}
- #else /* def LOG_AUTHPRIV */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_AUTHPRIV */
- if (x == Mono_Posix_SyslogFacility_LOG_CRON)
- #ifdef LOG_CRON
- {*r = LOG_CRON; return 0;}
- #else /* def LOG_CRON */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_CRON */
- if (x == Mono_Posix_SyslogFacility_LOG_DAEMON)
- #ifdef LOG_DAEMON
- {*r = LOG_DAEMON; return 0;}
- #else /* def LOG_DAEMON */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_DAEMON */
- if (x == Mono_Posix_SyslogFacility_LOG_FTP)
- #ifdef LOG_FTP
- {*r = LOG_FTP; return 0;}
- #else /* def LOG_FTP */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_FTP */
- if (x == Mono_Posix_SyslogFacility_LOG_KERN)
- #ifdef LOG_KERN
- {*r = LOG_KERN; return 0;}
- #else /* def LOG_KERN */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_KERN */
- if (x == Mono_Posix_SyslogFacility_LOG_LOCAL0)
- #ifdef LOG_LOCAL0
- {*r = LOG_LOCAL0; return 0;}
- #else /* def LOG_LOCAL0 */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_LOCAL0 */
- if (x == Mono_Posix_SyslogFacility_LOG_LOCAL1)
- #ifdef LOG_LOCAL1
- {*r = LOG_LOCAL1; return 0;}
- #else /* def LOG_LOCAL1 */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_LOCAL1 */
- if (x == Mono_Posix_SyslogFacility_LOG_LOCAL2)
- #ifdef LOG_LOCAL2
- {*r = LOG_LOCAL2; return 0;}
- #else /* def LOG_LOCAL2 */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_LOCAL2 */
- if (x == Mono_Posix_SyslogFacility_LOG_LOCAL3)
- #ifdef LOG_LOCAL3
- {*r = LOG_LOCAL3; return 0;}
- #else /* def LOG_LOCAL3 */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_LOCAL3 */
- if (x == Mono_Posix_SyslogFacility_LOG_LOCAL4)
- #ifdef LOG_LOCAL4
- {*r = LOG_LOCAL4; return 0;}
- #else /* def LOG_LOCAL4 */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_LOCAL4 */
- if (x == Mono_Posix_SyslogFacility_LOG_LOCAL5)
- #ifdef LOG_LOCAL5
- {*r = LOG_LOCAL5; return 0;}
- #else /* def LOG_LOCAL5 */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_LOCAL5 */
- if (x == Mono_Posix_SyslogFacility_LOG_LOCAL6)
- #ifdef LOG_LOCAL6
- {*r = LOG_LOCAL6; return 0;}
- #else /* def LOG_LOCAL6 */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_LOCAL6 */
- if (x == Mono_Posix_SyslogFacility_LOG_LOCAL7)
- #ifdef LOG_LOCAL7
- {*r = LOG_LOCAL7; return 0;}
- #else /* def LOG_LOCAL7 */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_LOCAL7 */
- if (x == Mono_Posix_SyslogFacility_LOG_LPR)
- #ifdef LOG_LPR
- {*r = LOG_LPR; return 0;}
- #else /* def LOG_LPR */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_LPR */
- if (x == Mono_Posix_SyslogFacility_LOG_MAIL)
- #ifdef LOG_MAIL
- {*r = LOG_MAIL; return 0;}
- #else /* def LOG_MAIL */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_MAIL */
- if (x == Mono_Posix_SyslogFacility_LOG_NEWS)
- #ifdef LOG_NEWS
- {*r = LOG_NEWS; return 0;}
- #else /* def LOG_NEWS */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_NEWS */
- if (x == Mono_Posix_SyslogFacility_LOG_SYSLOG)
- #ifdef LOG_SYSLOG
- {*r = LOG_SYSLOG; return 0;}
- #else /* def LOG_SYSLOG */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_SYSLOG */
- if (x == Mono_Posix_SyslogFacility_LOG_USER)
- #ifdef LOG_USER
- {*r = LOG_USER; return 0;}
- #else /* def LOG_USER */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_USER */
- if (x == Mono_Posix_SyslogFacility_LOG_UUCP)
- #ifdef LOG_UUCP
- {*r = LOG_UUCP; return 0;}
- #else /* def LOG_UUCP */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_UUCP */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToSyslogFacility (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef LOG_AUTH
- if (x == LOG_AUTH)
- {*r = Mono_Posix_SyslogFacility_LOG_AUTH; return 0;}
- #endif /* ndef LOG_AUTH */
- #ifdef LOG_AUTHPRIV
- if (x == LOG_AUTHPRIV)
- {*r = Mono_Posix_SyslogFacility_LOG_AUTHPRIV; return 0;}
- #endif /* ndef LOG_AUTHPRIV */
- #ifdef LOG_CRON
- if (x == LOG_CRON)
- {*r = Mono_Posix_SyslogFacility_LOG_CRON; return 0;}
- #endif /* ndef LOG_CRON */
- #ifdef LOG_DAEMON
- if (x == LOG_DAEMON)
- {*r = Mono_Posix_SyslogFacility_LOG_DAEMON; return 0;}
- #endif /* ndef LOG_DAEMON */
- #ifdef LOG_FTP
- if (x == LOG_FTP)
- {*r = Mono_Posix_SyslogFacility_LOG_FTP; return 0;}
- #endif /* ndef LOG_FTP */
- #ifdef LOG_KERN
- if (x == LOG_KERN)
- {*r = Mono_Posix_SyslogFacility_LOG_KERN; return 0;}
- #endif /* ndef LOG_KERN */
- #ifdef LOG_LOCAL0
- if (x == LOG_LOCAL0)
- {*r = Mono_Posix_SyslogFacility_LOG_LOCAL0; return 0;}
- #endif /* ndef LOG_LOCAL0 */
- #ifdef LOG_LOCAL1
- if (x == LOG_LOCAL1)
- {*r = Mono_Posix_SyslogFacility_LOG_LOCAL1; return 0;}
- #endif /* ndef LOG_LOCAL1 */
- #ifdef LOG_LOCAL2
- if (x == LOG_LOCAL2)
- {*r = Mono_Posix_SyslogFacility_LOG_LOCAL2; return 0;}
- #endif /* ndef LOG_LOCAL2 */
- #ifdef LOG_LOCAL3
- if (x == LOG_LOCAL3)
- {*r = Mono_Posix_SyslogFacility_LOG_LOCAL3; return 0;}
- #endif /* ndef LOG_LOCAL3 */
- #ifdef LOG_LOCAL4
- if (x == LOG_LOCAL4)
- {*r = Mono_Posix_SyslogFacility_LOG_LOCAL4; return 0;}
- #endif /* ndef LOG_LOCAL4 */
- #ifdef LOG_LOCAL5
- if (x == LOG_LOCAL5)
- {*r = Mono_Posix_SyslogFacility_LOG_LOCAL5; return 0;}
- #endif /* ndef LOG_LOCAL5 */
- #ifdef LOG_LOCAL6
- if (x == LOG_LOCAL6)
- {*r = Mono_Posix_SyslogFacility_LOG_LOCAL6; return 0;}
- #endif /* ndef LOG_LOCAL6 */
- #ifdef LOG_LOCAL7
- if (x == LOG_LOCAL7)
- {*r = Mono_Posix_SyslogFacility_LOG_LOCAL7; return 0;}
- #endif /* ndef LOG_LOCAL7 */
- #ifdef LOG_LPR
- if (x == LOG_LPR)
- {*r = Mono_Posix_SyslogFacility_LOG_LPR; return 0;}
- #endif /* ndef LOG_LPR */
- #ifdef LOG_MAIL
- if (x == LOG_MAIL)
- {*r = Mono_Posix_SyslogFacility_LOG_MAIL; return 0;}
- #endif /* ndef LOG_MAIL */
- #ifdef LOG_NEWS
- if (x == LOG_NEWS)
- {*r = Mono_Posix_SyslogFacility_LOG_NEWS; return 0;}
- #endif /* ndef LOG_NEWS */
- #ifdef LOG_SYSLOG
- if (x == LOG_SYSLOG)
- {*r = Mono_Posix_SyslogFacility_LOG_SYSLOG; return 0;}
- #endif /* ndef LOG_SYSLOG */
- #ifdef LOG_USER
- if (x == LOG_USER)
- {*r = Mono_Posix_SyslogFacility_LOG_USER; return 0;}
- #endif /* ndef LOG_USER */
- #ifdef LOG_UUCP
- if (x == LOG_UUCP)
- {*r = Mono_Posix_SyslogFacility_LOG_UUCP; return 0;}
- #endif /* ndef LOG_UUCP */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromSyslogLevel (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_SyslogLevel_LOG_ALERT)
- #ifdef LOG_ALERT
- {*r = LOG_ALERT; return 0;}
- #else /* def LOG_ALERT */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_ALERT */
- if (x == Mono_Posix_SyslogLevel_LOG_CRIT)
- #ifdef LOG_CRIT
- {*r = LOG_CRIT; return 0;}
- #else /* def LOG_CRIT */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_CRIT */
- if (x == Mono_Posix_SyslogLevel_LOG_DEBUG)
- #ifdef LOG_DEBUG
- {*r = LOG_DEBUG; return 0;}
- #else /* def LOG_DEBUG */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_DEBUG */
- if (x == Mono_Posix_SyslogLevel_LOG_EMERG)
- #ifdef LOG_EMERG
- {*r = LOG_EMERG; return 0;}
- #else /* def LOG_EMERG */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_EMERG */
- if (x == Mono_Posix_SyslogLevel_LOG_ERR)
- #ifdef LOG_ERR
- {*r = LOG_ERR; return 0;}
- #else /* def LOG_ERR */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_ERR */
- if (x == Mono_Posix_SyslogLevel_LOG_INFO)
- #ifdef LOG_INFO
- {*r = LOG_INFO; return 0;}
- #else /* def LOG_INFO */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_INFO */
- if (x == Mono_Posix_SyslogLevel_LOG_NOTICE)
- #ifdef LOG_NOTICE
- {*r = LOG_NOTICE; return 0;}
- #else /* def LOG_NOTICE */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_NOTICE */
- if (x == Mono_Posix_SyslogLevel_LOG_WARNING)
- #ifdef LOG_WARNING
- {*r = LOG_WARNING; return 0;}
- #else /* def LOG_WARNING */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_WARNING */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToSyslogLevel (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef LOG_ALERT
- if (x == LOG_ALERT)
- {*r = Mono_Posix_SyslogLevel_LOG_ALERT; return 0;}
- #endif /* ndef LOG_ALERT */
- #ifdef LOG_CRIT
- if (x == LOG_CRIT)
- {*r = Mono_Posix_SyslogLevel_LOG_CRIT; return 0;}
- #endif /* ndef LOG_CRIT */
- #ifdef LOG_DEBUG
- if (x == LOG_DEBUG)
- {*r = Mono_Posix_SyslogLevel_LOG_DEBUG; return 0;}
- #endif /* ndef LOG_DEBUG */
- #ifdef LOG_EMERG
- if (x == LOG_EMERG)
- {*r = Mono_Posix_SyslogLevel_LOG_EMERG; return 0;}
- #endif /* ndef LOG_EMERG */
- #ifdef LOG_ERR
- if (x == LOG_ERR)
- {*r = Mono_Posix_SyslogLevel_LOG_ERR; return 0;}
- #endif /* ndef LOG_ERR */
- #ifdef LOG_INFO
- if (x == LOG_INFO)
- {*r = Mono_Posix_SyslogLevel_LOG_INFO; return 0;}
- #endif /* ndef LOG_INFO */
- #ifdef LOG_NOTICE
- if (x == LOG_NOTICE)
- {*r = Mono_Posix_SyslogLevel_LOG_NOTICE; return 0;}
- #endif /* ndef LOG_NOTICE */
- #ifdef LOG_WARNING
- if (x == LOG_WARNING)
- {*r = Mono_Posix_SyslogLevel_LOG_WARNING; return 0;}
- #endif /* ndef LOG_WARNING */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromSyslogOptions (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_SyslogOptions_LOG_CONS) == Mono_Posix_SyslogOptions_LOG_CONS)
- #ifdef LOG_CONS
- *r |= LOG_CONS;
- #else /* def LOG_CONS */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_CONS */
- if ((x & Mono_Posix_SyslogOptions_LOG_NDELAY) == Mono_Posix_SyslogOptions_LOG_NDELAY)
- #ifdef LOG_NDELAY
- *r |= LOG_NDELAY;
- #else /* def LOG_NDELAY */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_NDELAY */
- if ((x & Mono_Posix_SyslogOptions_LOG_NOWAIT) == Mono_Posix_SyslogOptions_LOG_NOWAIT)
- #ifdef LOG_NOWAIT
- *r |= LOG_NOWAIT;
- #else /* def LOG_NOWAIT */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_NOWAIT */
- if ((x & Mono_Posix_SyslogOptions_LOG_ODELAY) == Mono_Posix_SyslogOptions_LOG_ODELAY)
- #ifdef LOG_ODELAY
- *r |= LOG_ODELAY;
- #else /* def LOG_ODELAY */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_ODELAY */
- if ((x & Mono_Posix_SyslogOptions_LOG_PERROR) == Mono_Posix_SyslogOptions_LOG_PERROR)
- #ifdef LOG_PERROR
- *r |= LOG_PERROR;
- #else /* def LOG_PERROR */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_PERROR */
- if ((x & Mono_Posix_SyslogOptions_LOG_PID) == Mono_Posix_SyslogOptions_LOG_PID)
- #ifdef LOG_PID
- *r |= LOG_PID;
- #else /* def LOG_PID */
- {errno = EINVAL; return -1;}
- #endif /* ndef LOG_PID */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToSyslogOptions (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef LOG_CONS
- if ((x & LOG_CONS) == LOG_CONS)
- *r |= Mono_Posix_SyslogOptions_LOG_CONS;
- #endif /* ndef LOG_CONS */
- #ifdef LOG_NDELAY
- if ((x & LOG_NDELAY) == LOG_NDELAY)
- *r |= Mono_Posix_SyslogOptions_LOG_NDELAY;
- #endif /* ndef LOG_NDELAY */
- #ifdef LOG_NOWAIT
- if ((x & LOG_NOWAIT) == LOG_NOWAIT)
- *r |= Mono_Posix_SyslogOptions_LOG_NOWAIT;
- #endif /* ndef LOG_NOWAIT */
- #ifdef LOG_ODELAY
- if ((x & LOG_ODELAY) == LOG_ODELAY)
- *r |= Mono_Posix_SyslogOptions_LOG_ODELAY;
- #endif /* ndef LOG_ODELAY */
- #ifdef LOG_PERROR
- if ((x & LOG_PERROR) == LOG_PERROR)
- *r |= Mono_Posix_SyslogOptions_LOG_PERROR;
- #endif /* ndef LOG_PERROR */
- #ifdef LOG_PID
- if ((x & LOG_PID) == LOG_PID)
- *r |= Mono_Posix_SyslogOptions_LOG_PID;
- #endif /* ndef LOG_PID */
- return 0;
- }
- #ifdef HAVE_STRUCT_TIMESPEC
- int
- Mono_Posix_FromTimespec (struct Mono_Posix_Timespec *from, struct timespec *to)
- {
- _cnm_return_val_if_overflow (time_t, from->tv_sec, -1);
- _cnm_return_val_if_overflow (gint64, from->tv_nsec, -1);
- memset (to, 0, sizeof(*to));
- to->tv_sec = from->tv_sec;
- to->tv_nsec = from->tv_nsec;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_TIMESPEC */
- #ifdef HAVE_STRUCT_TIMESPEC
- int
- Mono_Posix_ToTimespec (struct timespec *from, struct Mono_Posix_Timespec *to)
- {
- _cnm_return_val_if_overflow (gint64, from->tv_sec, -1);
- _cnm_return_val_if_overflow (gint64, from->tv_nsec, -1);
- memset (to, 0, sizeof(*to));
- to->tv_sec = from->tv_sec;
- to->tv_nsec = from->tv_nsec;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_TIMESPEC */
- #ifdef HAVE_STRUCT_TIMEVAL
- int
- Mono_Posix_FromTimeval (struct Mono_Posix_Timeval *from, struct timeval *to)
- {
- _cnm_return_val_if_overflow (time_t, from->tv_sec, -1);
- _cnm_return_val_if_overflow (suseconds_t, from->tv_usec, -1);
- memset (to, 0, sizeof(*to));
- to->tv_sec = from->tv_sec;
- to->tv_usec = from->tv_usec;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_TIMEVAL */
- #ifdef HAVE_STRUCT_TIMEVAL
- int
- Mono_Posix_ToTimeval (struct timeval *from, struct Mono_Posix_Timeval *to)
- {
- _cnm_return_val_if_overflow (gint64, from->tv_sec, -1);
- _cnm_return_val_if_overflow (gint64, from->tv_usec, -1);
- memset (to, 0, sizeof(*to));
- to->tv_sec = from->tv_sec;
- to->tv_usec = from->tv_usec;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_TIMEVAL */
- #ifdef HAVE_STRUCT_TIMEZONE
- int
- Mono_Posix_FromTimezone (struct Mono_Posix_Timezone *from, struct timezone *to)
- {
- _cnm_return_val_if_overflow (int, from->tz_minuteswest, -1);
- _cnm_return_val_if_overflow (int, from->tz_dsttime, -1);
- memset (to, 0, sizeof(*to));
- to->tz_minuteswest = from->tz_minuteswest;
- to->tz_dsttime = from->tz_dsttime;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_TIMEZONE */
- #ifdef HAVE_STRUCT_TIMEZONE
- int
- Mono_Posix_ToTimezone (struct timezone *from, struct Mono_Posix_Timezone *to)
- {
- _cnm_return_val_if_overflow (int, from->tz_minuteswest, -1);
- _cnm_return_val_if_overflow (int, from->tz_dsttime, -1);
- memset (to, 0, sizeof(*to));
- to->tz_minuteswest = from->tz_minuteswest;
- to->tz_dsttime = from->tz_dsttime;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_TIMEZONE */
- int Mono_Posix_FromUnixAddressFamily (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_UnixAddressFamily_AF_ALG)
- #ifdef AF_ALG
- {*r = AF_ALG; return 0;}
- #else /* def AF_ALG */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_ALG */
- if (x == Mono_Posix_UnixAddressFamily_AF_APPLETALK)
- #ifdef AF_APPLETALK
- {*r = AF_APPLETALK; return 0;}
- #else /* def AF_APPLETALK */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_APPLETALK */
- if (x == Mono_Posix_UnixAddressFamily_AF_ASH)
- #ifdef AF_ASH
- {*r = AF_ASH; return 0;}
- #else /* def AF_ASH */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_ASH */
- if (x == Mono_Posix_UnixAddressFamily_AF_ATMPVC)
- #ifdef AF_ATMPVC
- {*r = AF_ATMPVC; return 0;}
- #else /* def AF_ATMPVC */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_ATMPVC */
- if (x == Mono_Posix_UnixAddressFamily_AF_ATMSVC)
- #ifdef AF_ATMSVC
- {*r = AF_ATMSVC; return 0;}
- #else /* def AF_ATMSVC */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_ATMSVC */
- if (x == Mono_Posix_UnixAddressFamily_AF_AX25)
- #ifdef AF_AX25
- {*r = AF_AX25; return 0;}
- #else /* def AF_AX25 */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_AX25 */
- if (x == Mono_Posix_UnixAddressFamily_AF_BLUETOOTH)
- #ifdef AF_BLUETOOTH
- {*r = AF_BLUETOOTH; return 0;}
- #else /* def AF_BLUETOOTH */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_BLUETOOTH */
- if (x == Mono_Posix_UnixAddressFamily_AF_BRIDGE)
- #ifdef AF_BRIDGE
- {*r = AF_BRIDGE; return 0;}
- #else /* def AF_BRIDGE */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_BRIDGE */
- if (x == Mono_Posix_UnixAddressFamily_AF_CAIF)
- #ifdef AF_CAIF
- {*r = AF_CAIF; return 0;}
- #else /* def AF_CAIF */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_CAIF */
- if (x == Mono_Posix_UnixAddressFamily_AF_CAN)
- #ifdef AF_CAN
- {*r = AF_CAN; return 0;}
- #else /* def AF_CAN */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_CAN */
- if (x == Mono_Posix_UnixAddressFamily_AF_DECnet)
- #ifdef AF_DECnet
- {*r = AF_DECnet; return 0;}
- #else /* def AF_DECnet */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_DECnet */
- if (x == Mono_Posix_UnixAddressFamily_AF_ECONET)
- #ifdef AF_ECONET
- {*r = AF_ECONET; return 0;}
- #else /* def AF_ECONET */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_ECONET */
- if (x == Mono_Posix_UnixAddressFamily_AF_IEEE802154)
- #ifdef AF_IEEE802154
- {*r = AF_IEEE802154; return 0;}
- #else /* def AF_IEEE802154 */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_IEEE802154 */
- if (x == Mono_Posix_UnixAddressFamily_AF_INET)
- #ifdef AF_INET
- {*r = AF_INET; return 0;}
- #else /* def AF_INET */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_INET */
- if (x == Mono_Posix_UnixAddressFamily_AF_INET6)
- #ifdef AF_INET6
- {*r = AF_INET6; return 0;}
- #else /* def AF_INET6 */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_INET6 */
- if (x == Mono_Posix_UnixAddressFamily_AF_IPX)
- #ifdef AF_IPX
- {*r = AF_IPX; return 0;}
- #else /* def AF_IPX */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_IPX */
- if (x == Mono_Posix_UnixAddressFamily_AF_IRDA)
- #ifdef AF_IRDA
- {*r = AF_IRDA; return 0;}
- #else /* def AF_IRDA */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_IRDA */
- if (x == Mono_Posix_UnixAddressFamily_AF_ISDN)
- #ifdef AF_ISDN
- {*r = AF_ISDN; return 0;}
- #else /* def AF_ISDN */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_ISDN */
- if (x == Mono_Posix_UnixAddressFamily_AF_IUCV)
- #ifdef AF_IUCV
- {*r = AF_IUCV; return 0;}
- #else /* def AF_IUCV */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_IUCV */
- if (x == Mono_Posix_UnixAddressFamily_AF_KEY)
- #ifdef AF_KEY
- {*r = AF_KEY; return 0;}
- #else /* def AF_KEY */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_KEY */
- if (x == Mono_Posix_UnixAddressFamily_AF_LLC)
- #ifdef AF_LLC
- {*r = AF_LLC; return 0;}
- #else /* def AF_LLC */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_LLC */
- if (x == Mono_Posix_UnixAddressFamily_AF_NETBEUI)
- #ifdef AF_NETBEUI
- {*r = AF_NETBEUI; return 0;}
- #else /* def AF_NETBEUI */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_NETBEUI */
- if (x == Mono_Posix_UnixAddressFamily_AF_NETLINK)
- #ifdef AF_NETLINK
- {*r = AF_NETLINK; return 0;}
- #else /* def AF_NETLINK */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_NETLINK */
- if (x == Mono_Posix_UnixAddressFamily_AF_NETROM)
- #ifdef AF_NETROM
- {*r = AF_NETROM; return 0;}
- #else /* def AF_NETROM */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_NETROM */
- if (x == Mono_Posix_UnixAddressFamily_AF_NFC)
- #ifdef AF_NFC
- {*r = AF_NFC; return 0;}
- #else /* def AF_NFC */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_NFC */
- if (x == Mono_Posix_UnixAddressFamily_AF_PACKET)
- #ifdef AF_PACKET
- {*r = AF_PACKET; return 0;}
- #else /* def AF_PACKET */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_PACKET */
- if (x == Mono_Posix_UnixAddressFamily_AF_PHONET)
- #ifdef AF_PHONET
- {*r = AF_PHONET; return 0;}
- #else /* def AF_PHONET */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_PHONET */
- if (x == Mono_Posix_UnixAddressFamily_AF_PPPOX)
- #ifdef AF_PPPOX
- {*r = AF_PPPOX; return 0;}
- #else /* def AF_PPPOX */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_PPPOX */
- if (x == Mono_Posix_UnixAddressFamily_AF_RDS)
- #ifdef AF_RDS
- {*r = AF_RDS; return 0;}
- #else /* def AF_RDS */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_RDS */
- if (x == Mono_Posix_UnixAddressFamily_AF_ROSE)
- #ifdef AF_ROSE
- {*r = AF_ROSE; return 0;}
- #else /* def AF_ROSE */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_ROSE */
- if (x == Mono_Posix_UnixAddressFamily_AF_RXRPC)
- #ifdef AF_RXRPC
- {*r = AF_RXRPC; return 0;}
- #else /* def AF_RXRPC */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_RXRPC */
- if (x == Mono_Posix_UnixAddressFamily_AF_SECURITY)
- #ifdef AF_SECURITY
- {*r = AF_SECURITY; return 0;}
- #else /* def AF_SECURITY */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_SECURITY */
- if (x == Mono_Posix_UnixAddressFamily_AF_SNA)
- #ifdef AF_SNA
- {*r = AF_SNA; return 0;}
- #else /* def AF_SNA */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_SNA */
- if (x == Mono_Posix_UnixAddressFamily_AF_TIPC)
- #ifdef AF_TIPC
- {*r = AF_TIPC; return 0;}
- #else /* def AF_TIPC */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_TIPC */
- if (x == Mono_Posix_UnixAddressFamily_AF_UNIX)
- #ifdef AF_UNIX
- {*r = AF_UNIX; return 0;}
- #else /* def AF_UNIX */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_UNIX */
- if (x == Mono_Posix_UnixAddressFamily_AF_UNSPEC)
- #ifdef AF_UNSPEC
- {*r = AF_UNSPEC; return 0;}
- #else /* def AF_UNSPEC */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_UNSPEC */
- if (x == Mono_Posix_UnixAddressFamily_AF_VSOCK)
- #ifdef AF_VSOCK
- {*r = AF_VSOCK; return 0;}
- #else /* def AF_VSOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_VSOCK */
- if (x == Mono_Posix_UnixAddressFamily_AF_WANPIPE)
- #ifdef AF_WANPIPE
- {*r = AF_WANPIPE; return 0;}
- #else /* def AF_WANPIPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_WANPIPE */
- if (x == Mono_Posix_UnixAddressFamily_AF_X25)
- #ifdef AF_X25
- {*r = AF_X25; return 0;}
- #else /* def AF_X25 */
- {errno = EINVAL; return -1;}
- #endif /* ndef AF_X25 */
- if (x == Mono_Posix_UnixAddressFamily_Unknown)
- #ifdef Unknown
- {*r = Unknown; return 0;}
- #else /* def Unknown */
- {errno = EINVAL; return -1;}
- #endif /* ndef Unknown */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToUnixAddressFamily (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef AF_ALG
- if (x == AF_ALG)
- {*r = Mono_Posix_UnixAddressFamily_AF_ALG; return 0;}
- #endif /* ndef AF_ALG */
- #ifdef AF_APPLETALK
- if (x == AF_APPLETALK)
- {*r = Mono_Posix_UnixAddressFamily_AF_APPLETALK; return 0;}
- #endif /* ndef AF_APPLETALK */
- #ifdef AF_ASH
- if (x == AF_ASH)
- {*r = Mono_Posix_UnixAddressFamily_AF_ASH; return 0;}
- #endif /* ndef AF_ASH */
- #ifdef AF_ATMPVC
- if (x == AF_ATMPVC)
- {*r = Mono_Posix_UnixAddressFamily_AF_ATMPVC; return 0;}
- #endif /* ndef AF_ATMPVC */
- #ifdef AF_ATMSVC
- if (x == AF_ATMSVC)
- {*r = Mono_Posix_UnixAddressFamily_AF_ATMSVC; return 0;}
- #endif /* ndef AF_ATMSVC */
- #ifdef AF_AX25
- if (x == AF_AX25)
- {*r = Mono_Posix_UnixAddressFamily_AF_AX25; return 0;}
- #endif /* ndef AF_AX25 */
- #ifdef AF_BLUETOOTH
- if (x == AF_BLUETOOTH)
- {*r = Mono_Posix_UnixAddressFamily_AF_BLUETOOTH; return 0;}
- #endif /* ndef AF_BLUETOOTH */
- #ifdef AF_BRIDGE
- if (x == AF_BRIDGE)
- {*r = Mono_Posix_UnixAddressFamily_AF_BRIDGE; return 0;}
- #endif /* ndef AF_BRIDGE */
- #ifdef AF_CAIF
- if (x == AF_CAIF)
- {*r = Mono_Posix_UnixAddressFamily_AF_CAIF; return 0;}
- #endif /* ndef AF_CAIF */
- #ifdef AF_CAN
- if (x == AF_CAN)
- {*r = Mono_Posix_UnixAddressFamily_AF_CAN; return 0;}
- #endif /* ndef AF_CAN */
- #ifdef AF_DECnet
- if (x == AF_DECnet)
- {*r = Mono_Posix_UnixAddressFamily_AF_DECnet; return 0;}
- #endif /* ndef AF_DECnet */
- #ifdef AF_ECONET
- if (x == AF_ECONET)
- {*r = Mono_Posix_UnixAddressFamily_AF_ECONET; return 0;}
- #endif /* ndef AF_ECONET */
- #ifdef AF_IEEE802154
- if (x == AF_IEEE802154)
- {*r = Mono_Posix_UnixAddressFamily_AF_IEEE802154; return 0;}
- #endif /* ndef AF_IEEE802154 */
- #ifdef AF_INET
- if (x == AF_INET)
- {*r = Mono_Posix_UnixAddressFamily_AF_INET; return 0;}
- #endif /* ndef AF_INET */
- #ifdef AF_INET6
- if (x == AF_INET6)
- {*r = Mono_Posix_UnixAddressFamily_AF_INET6; return 0;}
- #endif /* ndef AF_INET6 */
- #ifdef AF_IPX
- if (x == AF_IPX)
- {*r = Mono_Posix_UnixAddressFamily_AF_IPX; return 0;}
- #endif /* ndef AF_IPX */
- #ifdef AF_IRDA
- if (x == AF_IRDA)
- {*r = Mono_Posix_UnixAddressFamily_AF_IRDA; return 0;}
- #endif /* ndef AF_IRDA */
- #ifdef AF_ISDN
- if (x == AF_ISDN)
- {*r = Mono_Posix_UnixAddressFamily_AF_ISDN; return 0;}
- #endif /* ndef AF_ISDN */
- #ifdef AF_IUCV
- if (x == AF_IUCV)
- {*r = Mono_Posix_UnixAddressFamily_AF_IUCV; return 0;}
- #endif /* ndef AF_IUCV */
- #ifdef AF_KEY
- if (x == AF_KEY)
- {*r = Mono_Posix_UnixAddressFamily_AF_KEY; return 0;}
- #endif /* ndef AF_KEY */
- #ifdef AF_LLC
- if (x == AF_LLC)
- {*r = Mono_Posix_UnixAddressFamily_AF_LLC; return 0;}
- #endif /* ndef AF_LLC */
- #ifdef AF_NETBEUI
- if (x == AF_NETBEUI)
- {*r = Mono_Posix_UnixAddressFamily_AF_NETBEUI; return 0;}
- #endif /* ndef AF_NETBEUI */
- #ifdef AF_NETLINK
- if (x == AF_NETLINK)
- {*r = Mono_Posix_UnixAddressFamily_AF_NETLINK; return 0;}
- #endif /* ndef AF_NETLINK */
- #ifdef AF_NETROM
- if (x == AF_NETROM)
- {*r = Mono_Posix_UnixAddressFamily_AF_NETROM; return 0;}
- #endif /* ndef AF_NETROM */
- #ifdef AF_NFC
- if (x == AF_NFC)
- {*r = Mono_Posix_UnixAddressFamily_AF_NFC; return 0;}
- #endif /* ndef AF_NFC */
- #ifdef AF_PACKET
- if (x == AF_PACKET)
- {*r = Mono_Posix_UnixAddressFamily_AF_PACKET; return 0;}
- #endif /* ndef AF_PACKET */
- #ifdef AF_PHONET
- if (x == AF_PHONET)
- {*r = Mono_Posix_UnixAddressFamily_AF_PHONET; return 0;}
- #endif /* ndef AF_PHONET */
- #ifdef AF_PPPOX
- if (x == AF_PPPOX)
- {*r = Mono_Posix_UnixAddressFamily_AF_PPPOX; return 0;}
- #endif /* ndef AF_PPPOX */
- #ifdef AF_RDS
- if (x == AF_RDS)
- {*r = Mono_Posix_UnixAddressFamily_AF_RDS; return 0;}
- #endif /* ndef AF_RDS */
- #ifdef AF_ROSE
- if (x == AF_ROSE)
- {*r = Mono_Posix_UnixAddressFamily_AF_ROSE; return 0;}
- #endif /* ndef AF_ROSE */
- #ifdef AF_RXRPC
- if (x == AF_RXRPC)
- {*r = Mono_Posix_UnixAddressFamily_AF_RXRPC; return 0;}
- #endif /* ndef AF_RXRPC */
- #ifdef AF_SECURITY
- if (x == AF_SECURITY)
- {*r = Mono_Posix_UnixAddressFamily_AF_SECURITY; return 0;}
- #endif /* ndef AF_SECURITY */
- #ifdef AF_SNA
- if (x == AF_SNA)
- {*r = Mono_Posix_UnixAddressFamily_AF_SNA; return 0;}
- #endif /* ndef AF_SNA */
- #ifdef AF_TIPC
- if (x == AF_TIPC)
- {*r = Mono_Posix_UnixAddressFamily_AF_TIPC; return 0;}
- #endif /* ndef AF_TIPC */
- #ifdef AF_UNIX
- if (x == AF_UNIX)
- {*r = Mono_Posix_UnixAddressFamily_AF_UNIX; return 0;}
- #endif /* ndef AF_UNIX */
- #ifdef AF_UNSPEC
- if (x == AF_UNSPEC)
- {*r = Mono_Posix_UnixAddressFamily_AF_UNSPEC; return 0;}
- #endif /* ndef AF_UNSPEC */
- #ifdef AF_VSOCK
- if (x == AF_VSOCK)
- {*r = Mono_Posix_UnixAddressFamily_AF_VSOCK; return 0;}
- #endif /* ndef AF_VSOCK */
- #ifdef AF_WANPIPE
- if (x == AF_WANPIPE)
- {*r = Mono_Posix_UnixAddressFamily_AF_WANPIPE; return 0;}
- #endif /* ndef AF_WANPIPE */
- #ifdef AF_X25
- if (x == AF_X25)
- {*r = Mono_Posix_UnixAddressFamily_AF_X25; return 0;}
- #endif /* ndef AF_X25 */
- #ifdef Unknown
- if (x == Unknown)
- {*r = Mono_Posix_UnixAddressFamily_Unknown; return 0;}
- #endif /* ndef Unknown */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromUnixSocketControlMessage (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_UnixSocketControlMessage_SCM_CREDENTIALS)
- #ifdef SCM_CREDENTIALS
- {*r = SCM_CREDENTIALS; return 0;}
- #else /* def SCM_CREDENTIALS */
- {errno = EINVAL; return -1;}
- #endif /* ndef SCM_CREDENTIALS */
- if (x == Mono_Posix_UnixSocketControlMessage_SCM_RIGHTS)
- #ifdef SCM_RIGHTS
- {*r = SCM_RIGHTS; return 0;}
- #else /* def SCM_RIGHTS */
- {errno = EINVAL; return -1;}
- #endif /* ndef SCM_RIGHTS */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToUnixSocketControlMessage (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef SCM_CREDENTIALS
- if (x == SCM_CREDENTIALS)
- {*r = Mono_Posix_UnixSocketControlMessage_SCM_CREDENTIALS; return 0;}
- #endif /* ndef SCM_CREDENTIALS */
- #ifdef SCM_RIGHTS
- if (x == SCM_RIGHTS)
- {*r = Mono_Posix_UnixSocketControlMessage_SCM_RIGHTS; return 0;}
- #endif /* ndef SCM_RIGHTS */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromUnixSocketFlags (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_UnixSocketFlags_SOCK_CLOEXEC) == Mono_Posix_UnixSocketFlags_SOCK_CLOEXEC)
- #ifdef SOCK_CLOEXEC
- *r |= SOCK_CLOEXEC;
- #else /* def SOCK_CLOEXEC */
- {errno = EINVAL; return -1;}
- #endif /* ndef SOCK_CLOEXEC */
- if ((x & Mono_Posix_UnixSocketFlags_SOCK_NONBLOCK) == Mono_Posix_UnixSocketFlags_SOCK_NONBLOCK)
- #ifdef SOCK_NONBLOCK
- *r |= SOCK_NONBLOCK;
- #else /* def SOCK_NONBLOCK */
- {errno = EINVAL; return -1;}
- #endif /* ndef SOCK_NONBLOCK */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToUnixSocketFlags (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef SOCK_CLOEXEC
- if ((x & SOCK_CLOEXEC) == SOCK_CLOEXEC)
- *r |= Mono_Posix_UnixSocketFlags_SOCK_CLOEXEC;
- #endif /* ndef SOCK_CLOEXEC */
- #ifdef SOCK_NONBLOCK
- if ((x & SOCK_NONBLOCK) == SOCK_NONBLOCK)
- *r |= Mono_Posix_UnixSocketFlags_SOCK_NONBLOCK;
- #endif /* ndef SOCK_NONBLOCK */
- return 0;
- }
- int Mono_Posix_FromUnixSocketOptionName (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_UnixSocketOptionName_SO_ACCEPTCONN)
- #ifdef SO_ACCEPTCONN
- {*r = SO_ACCEPTCONN; return 0;}
- #else /* def SO_ACCEPTCONN */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_ACCEPTCONN */
- if (x == Mono_Posix_UnixSocketOptionName_SO_ATTACH_FILTER)
- #ifdef SO_ATTACH_FILTER
- {*r = SO_ATTACH_FILTER; return 0;}
- #else /* def SO_ATTACH_FILTER */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_ATTACH_FILTER */
- if (x == Mono_Posix_UnixSocketOptionName_SO_BINDTODEVICE)
- #ifdef SO_BINDTODEVICE
- {*r = SO_BINDTODEVICE; return 0;}
- #else /* def SO_BINDTODEVICE */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_BINDTODEVICE */
- if (x == Mono_Posix_UnixSocketOptionName_SO_BROADCAST)
- #ifdef SO_BROADCAST
- {*r = SO_BROADCAST; return 0;}
- #else /* def SO_BROADCAST */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_BROADCAST */
- if (x == Mono_Posix_UnixSocketOptionName_SO_BSDCOMPAT)
- #ifdef SO_BSDCOMPAT
- {*r = SO_BSDCOMPAT; return 0;}
- #else /* def SO_BSDCOMPAT */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_BSDCOMPAT */
- if (x == Mono_Posix_UnixSocketOptionName_SO_BUSY_POLL)
- #ifdef SO_BUSY_POLL
- {*r = SO_BUSY_POLL; return 0;}
- #else /* def SO_BUSY_POLL */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_BUSY_POLL */
- if (x == Mono_Posix_UnixSocketOptionName_SO_DEBUG)
- #ifdef SO_DEBUG
- {*r = SO_DEBUG; return 0;}
- #else /* def SO_DEBUG */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_DEBUG */
- if (x == Mono_Posix_UnixSocketOptionName_SO_DETACH_FILTER)
- #ifdef SO_DETACH_FILTER
- {*r = SO_DETACH_FILTER; return 0;}
- #else /* def SO_DETACH_FILTER */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_DETACH_FILTER */
- if (x == Mono_Posix_UnixSocketOptionName_SO_DOMAIN)
- #ifdef SO_DOMAIN
- {*r = SO_DOMAIN; return 0;}
- #else /* def SO_DOMAIN */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_DOMAIN */
- if (x == Mono_Posix_UnixSocketOptionName_SO_DONTROUTE)
- #ifdef SO_DONTROUTE
- {*r = SO_DONTROUTE; return 0;}
- #else /* def SO_DONTROUTE */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_DONTROUTE */
- if (x == Mono_Posix_UnixSocketOptionName_SO_ERROR)
- #ifdef SO_ERROR
- {*r = SO_ERROR; return 0;}
- #else /* def SO_ERROR */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_ERROR */
- if (x == Mono_Posix_UnixSocketOptionName_SO_KEEPALIVE)
- #ifdef SO_KEEPALIVE
- {*r = SO_KEEPALIVE; return 0;}
- #else /* def SO_KEEPALIVE */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_KEEPALIVE */
- if (x == Mono_Posix_UnixSocketOptionName_SO_LINGER)
- #ifdef SO_LINGER
- {*r = SO_LINGER; return 0;}
- #else /* def SO_LINGER */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_LINGER */
- if (x == Mono_Posix_UnixSocketOptionName_SO_LOCK_FILTER)
- #ifdef SO_LOCK_FILTER
- {*r = SO_LOCK_FILTER; return 0;}
- #else /* def SO_LOCK_FILTER */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_LOCK_FILTER */
- if (x == Mono_Posix_UnixSocketOptionName_SO_MARK)
- #ifdef SO_MARK
- {*r = SO_MARK; return 0;}
- #else /* def SO_MARK */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_MARK */
- if (x == Mono_Posix_UnixSocketOptionName_SO_MAX_PACING_RATE)
- #ifdef SO_MAX_PACING_RATE
- {*r = SO_MAX_PACING_RATE; return 0;}
- #else /* def SO_MAX_PACING_RATE */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_MAX_PACING_RATE */
- if (x == Mono_Posix_UnixSocketOptionName_SO_NOFCS)
- #ifdef SO_NOFCS
- {*r = SO_NOFCS; return 0;}
- #else /* def SO_NOFCS */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_NOFCS */
- if (x == Mono_Posix_UnixSocketOptionName_SO_NO_CHECK)
- #ifdef SO_NO_CHECK
- {*r = SO_NO_CHECK; return 0;}
- #else /* def SO_NO_CHECK */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_NO_CHECK */
- if (x == Mono_Posix_UnixSocketOptionName_SO_OOBINLINE)
- #ifdef SO_OOBINLINE
- {*r = SO_OOBINLINE; return 0;}
- #else /* def SO_OOBINLINE */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_OOBINLINE */
- if (x == Mono_Posix_UnixSocketOptionName_SO_PASSCRED)
- #ifdef SO_PASSCRED
- {*r = SO_PASSCRED; return 0;}
- #else /* def SO_PASSCRED */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_PASSCRED */
- if (x == Mono_Posix_UnixSocketOptionName_SO_PASSSEC)
- #ifdef SO_PASSSEC
- {*r = SO_PASSSEC; return 0;}
- #else /* def SO_PASSSEC */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_PASSSEC */
- if (x == Mono_Posix_UnixSocketOptionName_SO_PEEK_OFF)
- #ifdef SO_PEEK_OFF
- {*r = SO_PEEK_OFF; return 0;}
- #else /* def SO_PEEK_OFF */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_PEEK_OFF */
- if (x == Mono_Posix_UnixSocketOptionName_SO_PEERCRED)
- #ifdef SO_PEERCRED
- {*r = SO_PEERCRED; return 0;}
- #else /* def SO_PEERCRED */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_PEERCRED */
- if (x == Mono_Posix_UnixSocketOptionName_SO_PEERNAME)
- #ifdef SO_PEERNAME
- {*r = SO_PEERNAME; return 0;}
- #else /* def SO_PEERNAME */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_PEERNAME */
- if (x == Mono_Posix_UnixSocketOptionName_SO_PEERSEC)
- #ifdef SO_PEERSEC
- {*r = SO_PEERSEC; return 0;}
- #else /* def SO_PEERSEC */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_PEERSEC */
- if (x == Mono_Posix_UnixSocketOptionName_SO_PRIORITY)
- #ifdef SO_PRIORITY
- {*r = SO_PRIORITY; return 0;}
- #else /* def SO_PRIORITY */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_PRIORITY */
- if (x == Mono_Posix_UnixSocketOptionName_SO_PROTOCOL)
- #ifdef SO_PROTOCOL
- {*r = SO_PROTOCOL; return 0;}
- #else /* def SO_PROTOCOL */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_PROTOCOL */
- if (x == Mono_Posix_UnixSocketOptionName_SO_RCVBUF)
- #ifdef SO_RCVBUF
- {*r = SO_RCVBUF; return 0;}
- #else /* def SO_RCVBUF */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_RCVBUF */
- if (x == Mono_Posix_UnixSocketOptionName_SO_RCVBUFFORCE)
- #ifdef SO_RCVBUFFORCE
- {*r = SO_RCVBUFFORCE; return 0;}
- #else /* def SO_RCVBUFFORCE */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_RCVBUFFORCE */
- if (x == Mono_Posix_UnixSocketOptionName_SO_RCVLOWAT)
- #ifdef SO_RCVLOWAT
- {*r = SO_RCVLOWAT; return 0;}
- #else /* def SO_RCVLOWAT */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_RCVLOWAT */
- if (x == Mono_Posix_UnixSocketOptionName_SO_RCVTIMEO)
- #ifdef SO_RCVTIMEO
- {*r = SO_RCVTIMEO; return 0;}
- #else /* def SO_RCVTIMEO */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_RCVTIMEO */
- if (x == Mono_Posix_UnixSocketOptionName_SO_REUSEADDR)
- #ifdef SO_REUSEADDR
- {*r = SO_REUSEADDR; return 0;}
- #else /* def SO_REUSEADDR */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_REUSEADDR */
- if (x == Mono_Posix_UnixSocketOptionName_SO_REUSEPORT)
- #ifdef SO_REUSEPORT
- {*r = SO_REUSEPORT; return 0;}
- #else /* def SO_REUSEPORT */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_REUSEPORT */
- if (x == Mono_Posix_UnixSocketOptionName_SO_RXQ_OVFL)
- #ifdef SO_RXQ_OVFL
- {*r = SO_RXQ_OVFL; return 0;}
- #else /* def SO_RXQ_OVFL */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_RXQ_OVFL */
- if (x == Mono_Posix_UnixSocketOptionName_SO_SECURITY_AUTHENTICATION)
- #ifdef SO_SECURITY_AUTHENTICATION
- {*r = SO_SECURITY_AUTHENTICATION; return 0;}
- #else /* def SO_SECURITY_AUTHENTICATION */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_SECURITY_AUTHENTICATION */
- if (x == Mono_Posix_UnixSocketOptionName_SO_SECURITY_ENCRYPTION_NETWORK)
- #ifdef SO_SECURITY_ENCRYPTION_NETWORK
- {*r = SO_SECURITY_ENCRYPTION_NETWORK; return 0;}
- #else /* def SO_SECURITY_ENCRYPTION_NETWORK */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_SECURITY_ENCRYPTION_NETWORK */
- if (x == Mono_Posix_UnixSocketOptionName_SO_SECURITY_ENCRYPTION_TRANSPORT)
- #ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
- {*r = SO_SECURITY_ENCRYPTION_TRANSPORT; return 0;}
- #else /* def SO_SECURITY_ENCRYPTION_TRANSPORT */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_SECURITY_ENCRYPTION_TRANSPORT */
- if (x == Mono_Posix_UnixSocketOptionName_SO_SELECT_ERR_QUEUE)
- #ifdef SO_SELECT_ERR_QUEUE
- {*r = SO_SELECT_ERR_QUEUE; return 0;}
- #else /* def SO_SELECT_ERR_QUEUE */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_SELECT_ERR_QUEUE */
- if (x == Mono_Posix_UnixSocketOptionName_SO_SNDBUF)
- #ifdef SO_SNDBUF
- {*r = SO_SNDBUF; return 0;}
- #else /* def SO_SNDBUF */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_SNDBUF */
- if (x == Mono_Posix_UnixSocketOptionName_SO_SNDBUFFORCE)
- #ifdef SO_SNDBUFFORCE
- {*r = SO_SNDBUFFORCE; return 0;}
- #else /* def SO_SNDBUFFORCE */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_SNDBUFFORCE */
- if (x == Mono_Posix_UnixSocketOptionName_SO_SNDLOWAT)
- #ifdef SO_SNDLOWAT
- {*r = SO_SNDLOWAT; return 0;}
- #else /* def SO_SNDLOWAT */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_SNDLOWAT */
- if (x == Mono_Posix_UnixSocketOptionName_SO_SNDTIMEO)
- #ifdef SO_SNDTIMEO
- {*r = SO_SNDTIMEO; return 0;}
- #else /* def SO_SNDTIMEO */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_SNDTIMEO */
- if (x == Mono_Posix_UnixSocketOptionName_SO_TIMESTAMP)
- #ifdef SO_TIMESTAMP
- {*r = SO_TIMESTAMP; return 0;}
- #else /* def SO_TIMESTAMP */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_TIMESTAMP */
- if (x == Mono_Posix_UnixSocketOptionName_SO_TIMESTAMPING)
- #ifdef SO_TIMESTAMPING
- {*r = SO_TIMESTAMPING; return 0;}
- #else /* def SO_TIMESTAMPING */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_TIMESTAMPING */
- if (x == Mono_Posix_UnixSocketOptionName_SO_TIMESTAMPNS)
- #ifdef SO_TIMESTAMPNS
- {*r = SO_TIMESTAMPNS; return 0;}
- #else /* def SO_TIMESTAMPNS */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_TIMESTAMPNS */
- if (x == Mono_Posix_UnixSocketOptionName_SO_TYPE)
- #ifdef SO_TYPE
- {*r = SO_TYPE; return 0;}
- #else /* def SO_TYPE */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_TYPE */
- if (x == Mono_Posix_UnixSocketOptionName_SO_WIFI_STATUS)
- #ifdef SO_WIFI_STATUS
- {*r = SO_WIFI_STATUS; return 0;}
- #else /* def SO_WIFI_STATUS */
- {errno = EINVAL; return -1;}
- #endif /* ndef SO_WIFI_STATUS */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToUnixSocketOptionName (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef SO_ACCEPTCONN
- if (x == SO_ACCEPTCONN)
- {*r = Mono_Posix_UnixSocketOptionName_SO_ACCEPTCONN; return 0;}
- #endif /* ndef SO_ACCEPTCONN */
- #ifdef SO_ATTACH_FILTER
- if (x == SO_ATTACH_FILTER)
- {*r = Mono_Posix_UnixSocketOptionName_SO_ATTACH_FILTER; return 0;}
- #endif /* ndef SO_ATTACH_FILTER */
- #ifdef SO_BINDTODEVICE
- if (x == SO_BINDTODEVICE)
- {*r = Mono_Posix_UnixSocketOptionName_SO_BINDTODEVICE; return 0;}
- #endif /* ndef SO_BINDTODEVICE */
- #ifdef SO_BROADCAST
- if (x == SO_BROADCAST)
- {*r = Mono_Posix_UnixSocketOptionName_SO_BROADCAST; return 0;}
- #endif /* ndef SO_BROADCAST */
- #ifdef SO_BSDCOMPAT
- if (x == SO_BSDCOMPAT)
- {*r = Mono_Posix_UnixSocketOptionName_SO_BSDCOMPAT; return 0;}
- #endif /* ndef SO_BSDCOMPAT */
- #ifdef SO_BUSY_POLL
- if (x == SO_BUSY_POLL)
- {*r = Mono_Posix_UnixSocketOptionName_SO_BUSY_POLL; return 0;}
- #endif /* ndef SO_BUSY_POLL */
- #ifdef SO_DEBUG
- if (x == SO_DEBUG)
- {*r = Mono_Posix_UnixSocketOptionName_SO_DEBUG; return 0;}
- #endif /* ndef SO_DEBUG */
- #ifdef SO_DETACH_FILTER
- if (x == SO_DETACH_FILTER)
- {*r = Mono_Posix_UnixSocketOptionName_SO_DETACH_FILTER; return 0;}
- #endif /* ndef SO_DETACH_FILTER */
- #ifdef SO_DOMAIN
- if (x == SO_DOMAIN)
- {*r = Mono_Posix_UnixSocketOptionName_SO_DOMAIN; return 0;}
- #endif /* ndef SO_DOMAIN */
- #ifdef SO_DONTROUTE
- if (x == SO_DONTROUTE)
- {*r = Mono_Posix_UnixSocketOptionName_SO_DONTROUTE; return 0;}
- #endif /* ndef SO_DONTROUTE */
- #ifdef SO_ERROR
- if (x == SO_ERROR)
- {*r = Mono_Posix_UnixSocketOptionName_SO_ERROR; return 0;}
- #endif /* ndef SO_ERROR */
- #ifdef SO_KEEPALIVE
- if (x == SO_KEEPALIVE)
- {*r = Mono_Posix_UnixSocketOptionName_SO_KEEPALIVE; return 0;}
- #endif /* ndef SO_KEEPALIVE */
- #ifdef SO_LINGER
- if (x == SO_LINGER)
- {*r = Mono_Posix_UnixSocketOptionName_SO_LINGER; return 0;}
- #endif /* ndef SO_LINGER */
- #ifdef SO_LOCK_FILTER
- if (x == SO_LOCK_FILTER)
- {*r = Mono_Posix_UnixSocketOptionName_SO_LOCK_FILTER; return 0;}
- #endif /* ndef SO_LOCK_FILTER */
- #ifdef SO_MARK
- if (x == SO_MARK)
- {*r = Mono_Posix_UnixSocketOptionName_SO_MARK; return 0;}
- #endif /* ndef SO_MARK */
- #ifdef SO_MAX_PACING_RATE
- if (x == SO_MAX_PACING_RATE)
- {*r = Mono_Posix_UnixSocketOptionName_SO_MAX_PACING_RATE; return 0;}
- #endif /* ndef SO_MAX_PACING_RATE */
- #ifdef SO_NOFCS
- if (x == SO_NOFCS)
- {*r = Mono_Posix_UnixSocketOptionName_SO_NOFCS; return 0;}
- #endif /* ndef SO_NOFCS */
- #ifdef SO_NO_CHECK
- if (x == SO_NO_CHECK)
- {*r = Mono_Posix_UnixSocketOptionName_SO_NO_CHECK; return 0;}
- #endif /* ndef SO_NO_CHECK */
- #ifdef SO_OOBINLINE
- if (x == SO_OOBINLINE)
- {*r = Mono_Posix_UnixSocketOptionName_SO_OOBINLINE; return 0;}
- #endif /* ndef SO_OOBINLINE */
- #ifdef SO_PASSCRED
- if (x == SO_PASSCRED)
- {*r = Mono_Posix_UnixSocketOptionName_SO_PASSCRED; return 0;}
- #endif /* ndef SO_PASSCRED */
- #ifdef SO_PASSSEC
- if (x == SO_PASSSEC)
- {*r = Mono_Posix_UnixSocketOptionName_SO_PASSSEC; return 0;}
- #endif /* ndef SO_PASSSEC */
- #ifdef SO_PEEK_OFF
- if (x == SO_PEEK_OFF)
- {*r = Mono_Posix_UnixSocketOptionName_SO_PEEK_OFF; return 0;}
- #endif /* ndef SO_PEEK_OFF */
- #ifdef SO_PEERCRED
- if (x == SO_PEERCRED)
- {*r = Mono_Posix_UnixSocketOptionName_SO_PEERCRED; return 0;}
- #endif /* ndef SO_PEERCRED */
- #ifdef SO_PEERNAME
- if (x == SO_PEERNAME)
- {*r = Mono_Posix_UnixSocketOptionName_SO_PEERNAME; return 0;}
- #endif /* ndef SO_PEERNAME */
- #ifdef SO_PEERSEC
- if (x == SO_PEERSEC)
- {*r = Mono_Posix_UnixSocketOptionName_SO_PEERSEC; return 0;}
- #endif /* ndef SO_PEERSEC */
- #ifdef SO_PRIORITY
- if (x == SO_PRIORITY)
- {*r = Mono_Posix_UnixSocketOptionName_SO_PRIORITY; return 0;}
- #endif /* ndef SO_PRIORITY */
- #ifdef SO_PROTOCOL
- if (x == SO_PROTOCOL)
- {*r = Mono_Posix_UnixSocketOptionName_SO_PROTOCOL; return 0;}
- #endif /* ndef SO_PROTOCOL */
- #ifdef SO_RCVBUF
- if (x == SO_RCVBUF)
- {*r = Mono_Posix_UnixSocketOptionName_SO_RCVBUF; return 0;}
- #endif /* ndef SO_RCVBUF */
- #ifdef SO_RCVBUFFORCE
- if (x == SO_RCVBUFFORCE)
- {*r = Mono_Posix_UnixSocketOptionName_SO_RCVBUFFORCE; return 0;}
- #endif /* ndef SO_RCVBUFFORCE */
- #ifdef SO_RCVLOWAT
- if (x == SO_RCVLOWAT)
- {*r = Mono_Posix_UnixSocketOptionName_SO_RCVLOWAT; return 0;}
- #endif /* ndef SO_RCVLOWAT */
- #ifdef SO_RCVTIMEO
- if (x == SO_RCVTIMEO)
- {*r = Mono_Posix_UnixSocketOptionName_SO_RCVTIMEO; return 0;}
- #endif /* ndef SO_RCVTIMEO */
- #ifdef SO_REUSEADDR
- if (x == SO_REUSEADDR)
- {*r = Mono_Posix_UnixSocketOptionName_SO_REUSEADDR; return 0;}
- #endif /* ndef SO_REUSEADDR */
- #ifdef SO_REUSEPORT
- if (x == SO_REUSEPORT)
- {*r = Mono_Posix_UnixSocketOptionName_SO_REUSEPORT; return 0;}
- #endif /* ndef SO_REUSEPORT */
- #ifdef SO_RXQ_OVFL
- if (x == SO_RXQ_OVFL)
- {*r = Mono_Posix_UnixSocketOptionName_SO_RXQ_OVFL; return 0;}
- #endif /* ndef SO_RXQ_OVFL */
- #ifdef SO_SECURITY_AUTHENTICATION
- if (x == SO_SECURITY_AUTHENTICATION)
- {*r = Mono_Posix_UnixSocketOptionName_SO_SECURITY_AUTHENTICATION; return 0;}
- #endif /* ndef SO_SECURITY_AUTHENTICATION */
- #ifdef SO_SECURITY_ENCRYPTION_NETWORK
- if (x == SO_SECURITY_ENCRYPTION_NETWORK)
- {*r = Mono_Posix_UnixSocketOptionName_SO_SECURITY_ENCRYPTION_NETWORK; return 0;}
- #endif /* ndef SO_SECURITY_ENCRYPTION_NETWORK */
- #ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
- if (x == SO_SECURITY_ENCRYPTION_TRANSPORT)
- {*r = Mono_Posix_UnixSocketOptionName_SO_SECURITY_ENCRYPTION_TRANSPORT; return 0;}
- #endif /* ndef SO_SECURITY_ENCRYPTION_TRANSPORT */
- #ifdef SO_SELECT_ERR_QUEUE
- if (x == SO_SELECT_ERR_QUEUE)
- {*r = Mono_Posix_UnixSocketOptionName_SO_SELECT_ERR_QUEUE; return 0;}
- #endif /* ndef SO_SELECT_ERR_QUEUE */
- #ifdef SO_SNDBUF
- if (x == SO_SNDBUF)
- {*r = Mono_Posix_UnixSocketOptionName_SO_SNDBUF; return 0;}
- #endif /* ndef SO_SNDBUF */
- #ifdef SO_SNDBUFFORCE
- if (x == SO_SNDBUFFORCE)
- {*r = Mono_Posix_UnixSocketOptionName_SO_SNDBUFFORCE; return 0;}
- #endif /* ndef SO_SNDBUFFORCE */
- #ifdef SO_SNDLOWAT
- if (x == SO_SNDLOWAT)
- {*r = Mono_Posix_UnixSocketOptionName_SO_SNDLOWAT; return 0;}
- #endif /* ndef SO_SNDLOWAT */
- #ifdef SO_SNDTIMEO
- if (x == SO_SNDTIMEO)
- {*r = Mono_Posix_UnixSocketOptionName_SO_SNDTIMEO; return 0;}
- #endif /* ndef SO_SNDTIMEO */
- #ifdef SO_TIMESTAMP
- if (x == SO_TIMESTAMP)
- {*r = Mono_Posix_UnixSocketOptionName_SO_TIMESTAMP; return 0;}
- #endif /* ndef SO_TIMESTAMP */
- #ifdef SO_TIMESTAMPING
- if (x == SO_TIMESTAMPING)
- {*r = Mono_Posix_UnixSocketOptionName_SO_TIMESTAMPING; return 0;}
- #endif /* ndef SO_TIMESTAMPING */
- #ifdef SO_TIMESTAMPNS
- if (x == SO_TIMESTAMPNS)
- {*r = Mono_Posix_UnixSocketOptionName_SO_TIMESTAMPNS; return 0;}
- #endif /* ndef SO_TIMESTAMPNS */
- #ifdef SO_TYPE
- if (x == SO_TYPE)
- {*r = Mono_Posix_UnixSocketOptionName_SO_TYPE; return 0;}
- #endif /* ndef SO_TYPE */
- #ifdef SO_WIFI_STATUS
- if (x == SO_WIFI_STATUS)
- {*r = Mono_Posix_UnixSocketOptionName_SO_WIFI_STATUS; return 0;}
- #endif /* ndef SO_WIFI_STATUS */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromUnixSocketProtocol (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_AH)
- #ifdef IPPROTO_AH
- {*r = IPPROTO_AH; return 0;}
- #else /* def IPPROTO_AH */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_AH */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_BEETPH)
- #ifdef IPPROTO_BEETPH
- {*r = IPPROTO_BEETPH; return 0;}
- #else /* def IPPROTO_BEETPH */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_BEETPH */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_COMP)
- #ifdef IPPROTO_COMP
- {*r = IPPROTO_COMP; return 0;}
- #else /* def IPPROTO_COMP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_COMP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_DCCP)
- #ifdef IPPROTO_DCCP
- {*r = IPPROTO_DCCP; return 0;}
- #else /* def IPPROTO_DCCP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_DCCP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_EGP)
- #ifdef IPPROTO_EGP
- {*r = IPPROTO_EGP; return 0;}
- #else /* def IPPROTO_EGP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_EGP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_ENCAP)
- #ifdef IPPROTO_ENCAP
- {*r = IPPROTO_ENCAP; return 0;}
- #else /* def IPPROTO_ENCAP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_ENCAP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_ESP)
- #ifdef IPPROTO_ESP
- {*r = IPPROTO_ESP; return 0;}
- #else /* def IPPROTO_ESP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_ESP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_GRE)
- #ifdef IPPROTO_GRE
- {*r = IPPROTO_GRE; return 0;}
- #else /* def IPPROTO_GRE */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_GRE */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_ICMP)
- #ifdef IPPROTO_ICMP
- {*r = IPPROTO_ICMP; return 0;}
- #else /* def IPPROTO_ICMP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_ICMP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_IDP)
- #ifdef IPPROTO_IDP
- {*r = IPPROTO_IDP; return 0;}
- #else /* def IPPROTO_IDP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_IDP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_IGMP)
- #ifdef IPPROTO_IGMP
- {*r = IPPROTO_IGMP; return 0;}
- #else /* def IPPROTO_IGMP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_IGMP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_IP)
- #ifdef IPPROTO_IP
- {*r = IPPROTO_IP; return 0;}
- #else /* def IPPROTO_IP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_IP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_IPIP)
- #ifdef IPPROTO_IPIP
- {*r = IPPROTO_IPIP; return 0;}
- #else /* def IPPROTO_IPIP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_IPIP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_IPV6)
- #ifdef IPPROTO_IPV6
- {*r = IPPROTO_IPV6; return 0;}
- #else /* def IPPROTO_IPV6 */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_IPV6 */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_MTP)
- #ifdef IPPROTO_MTP
- {*r = IPPROTO_MTP; return 0;}
- #else /* def IPPROTO_MTP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_MTP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_PIM)
- #ifdef IPPROTO_PIM
- {*r = IPPROTO_PIM; return 0;}
- #else /* def IPPROTO_PIM */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_PIM */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_PUP)
- #ifdef IPPROTO_PUP
- {*r = IPPROTO_PUP; return 0;}
- #else /* def IPPROTO_PUP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_PUP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_RAW)
- #ifdef IPPROTO_RAW
- {*r = IPPROTO_RAW; return 0;}
- #else /* def IPPROTO_RAW */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_RAW */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_RSVP)
- #ifdef IPPROTO_RSVP
- {*r = IPPROTO_RSVP; return 0;}
- #else /* def IPPROTO_RSVP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_RSVP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_SCTP)
- #ifdef IPPROTO_SCTP
- {*r = IPPROTO_SCTP; return 0;}
- #else /* def IPPROTO_SCTP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_SCTP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_TCP)
- #ifdef IPPROTO_TCP
- {*r = IPPROTO_TCP; return 0;}
- #else /* def IPPROTO_TCP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_TCP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_TP)
- #ifdef IPPROTO_TP
- {*r = IPPROTO_TP; return 0;}
- #else /* def IPPROTO_TP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_TP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_UDP)
- #ifdef IPPROTO_UDP
- {*r = IPPROTO_UDP; return 0;}
- #else /* def IPPROTO_UDP */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_UDP */
- if (x == Mono_Posix_UnixSocketProtocol_IPPROTO_UDPLITE)
- #ifdef IPPROTO_UDPLITE
- {*r = IPPROTO_UDPLITE; return 0;}
- #else /* def IPPROTO_UDPLITE */
- {errno = EINVAL; return -1;}
- #endif /* ndef IPPROTO_UDPLITE */
- if (x == Mono_Posix_UnixSocketProtocol_SOL_SOCKET)
- #ifdef SOL_SOCKET
- {*r = SOL_SOCKET; return 0;}
- #else /* def SOL_SOCKET */
- {errno = EINVAL; return -1;}
- #endif /* ndef SOL_SOCKET */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToUnixSocketProtocol (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef IPPROTO_AH
- if (x == IPPROTO_AH)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_AH; return 0;}
- #endif /* ndef IPPROTO_AH */
- #ifdef IPPROTO_BEETPH
- if (x == IPPROTO_BEETPH)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_BEETPH; return 0;}
- #endif /* ndef IPPROTO_BEETPH */
- #ifdef IPPROTO_COMP
- if (x == IPPROTO_COMP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_COMP; return 0;}
- #endif /* ndef IPPROTO_COMP */
- #ifdef IPPROTO_DCCP
- if (x == IPPROTO_DCCP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_DCCP; return 0;}
- #endif /* ndef IPPROTO_DCCP */
- #ifdef IPPROTO_EGP
- if (x == IPPROTO_EGP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_EGP; return 0;}
- #endif /* ndef IPPROTO_EGP */
- #ifdef IPPROTO_ENCAP
- if (x == IPPROTO_ENCAP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_ENCAP; return 0;}
- #endif /* ndef IPPROTO_ENCAP */
- #ifdef IPPROTO_ESP
- if (x == IPPROTO_ESP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_ESP; return 0;}
- #endif /* ndef IPPROTO_ESP */
- #ifdef IPPROTO_GRE
- if (x == IPPROTO_GRE)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_GRE; return 0;}
- #endif /* ndef IPPROTO_GRE */
- #ifdef IPPROTO_ICMP
- if (x == IPPROTO_ICMP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_ICMP; return 0;}
- #endif /* ndef IPPROTO_ICMP */
- #ifdef IPPROTO_IDP
- if (x == IPPROTO_IDP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_IDP; return 0;}
- #endif /* ndef IPPROTO_IDP */
- #ifdef IPPROTO_IGMP
- if (x == IPPROTO_IGMP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_IGMP; return 0;}
- #endif /* ndef IPPROTO_IGMP */
- #ifdef IPPROTO_IP
- if (x == IPPROTO_IP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_IP; return 0;}
- #endif /* ndef IPPROTO_IP */
- #ifdef IPPROTO_IPIP
- if (x == IPPROTO_IPIP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_IPIP; return 0;}
- #endif /* ndef IPPROTO_IPIP */
- #ifdef IPPROTO_IPV6
- if (x == IPPROTO_IPV6)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_IPV6; return 0;}
- #endif /* ndef IPPROTO_IPV6 */
- #ifdef IPPROTO_MTP
- if (x == IPPROTO_MTP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_MTP; return 0;}
- #endif /* ndef IPPROTO_MTP */
- #ifdef IPPROTO_PIM
- if (x == IPPROTO_PIM)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_PIM; return 0;}
- #endif /* ndef IPPROTO_PIM */
- #ifdef IPPROTO_PUP
- if (x == IPPROTO_PUP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_PUP; return 0;}
- #endif /* ndef IPPROTO_PUP */
- #ifdef IPPROTO_RAW
- if (x == IPPROTO_RAW)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_RAW; return 0;}
- #endif /* ndef IPPROTO_RAW */
- #ifdef IPPROTO_RSVP
- if (x == IPPROTO_RSVP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_RSVP; return 0;}
- #endif /* ndef IPPROTO_RSVP */
- #ifdef IPPROTO_SCTP
- if (x == IPPROTO_SCTP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_SCTP; return 0;}
- #endif /* ndef IPPROTO_SCTP */
- #ifdef IPPROTO_TCP
- if (x == IPPROTO_TCP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_TCP; return 0;}
- #endif /* ndef IPPROTO_TCP */
- #ifdef IPPROTO_TP
- if (x == IPPROTO_TP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_TP; return 0;}
- #endif /* ndef IPPROTO_TP */
- #ifdef IPPROTO_UDP
- if (x == IPPROTO_UDP)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_UDP; return 0;}
- #endif /* ndef IPPROTO_UDP */
- #ifdef IPPROTO_UDPLITE
- if (x == IPPROTO_UDPLITE)
- {*r = Mono_Posix_UnixSocketProtocol_IPPROTO_UDPLITE; return 0;}
- #endif /* ndef IPPROTO_UDPLITE */
- #ifdef SOL_SOCKET
- if (x == SOL_SOCKET)
- {*r = Mono_Posix_UnixSocketProtocol_SOL_SOCKET; return 0;}
- #endif /* ndef SOL_SOCKET */
- errno = EINVAL; return -1;
- }
- int Mono_Posix_FromUnixSocketType (int x, int *r)
- {
- *r = 0;
- if (x == Mono_Posix_UnixSocketType_SOCK_DCCP)
- #ifdef SOCK_DCCP
- {*r = SOCK_DCCP; return 0;}
- #else /* def SOCK_DCCP */
- {errno = EINVAL; return -1;}
- #endif /* ndef SOCK_DCCP */
- if (x == Mono_Posix_UnixSocketType_SOCK_DGRAM)
- #ifdef SOCK_DGRAM
- {*r = SOCK_DGRAM; return 0;}
- #else /* def SOCK_DGRAM */
- {errno = EINVAL; return -1;}
- #endif /* ndef SOCK_DGRAM */
- if (x == Mono_Posix_UnixSocketType_SOCK_PACKET)
- #ifdef SOCK_PACKET
- {*r = SOCK_PACKET; return 0;}
- #else /* def SOCK_PACKET */
- {errno = EINVAL; return -1;}
- #endif /* ndef SOCK_PACKET */
- if (x == Mono_Posix_UnixSocketType_SOCK_RAW)
- #ifdef SOCK_RAW
- {*r = SOCK_RAW; return 0;}
- #else /* def SOCK_RAW */
- {errno = EINVAL; return -1;}
- #endif /* ndef SOCK_RAW */
- if (x == Mono_Posix_UnixSocketType_SOCK_RDM)
- #ifdef SOCK_RDM
- {*r = SOCK_RDM; return 0;}
- #else /* def SOCK_RDM */
- {errno = EINVAL; return -1;}
- #endif /* ndef SOCK_RDM */
- if (x == Mono_Posix_UnixSocketType_SOCK_SEQPACKET)
- #ifdef SOCK_SEQPACKET
- {*r = SOCK_SEQPACKET; return 0;}
- #else /* def SOCK_SEQPACKET */
- {errno = EINVAL; return -1;}
- #endif /* ndef SOCK_SEQPACKET */
- if (x == Mono_Posix_UnixSocketType_SOCK_STREAM)
- #ifdef SOCK_STREAM
- {*r = SOCK_STREAM; return 0;}
- #else /* def SOCK_STREAM */
- {errno = EINVAL; return -1;}
- #endif /* ndef SOCK_STREAM */
- if (x == 0)
- return 0;
- errno = EINVAL; return -1;
- }
- int Mono_Posix_ToUnixSocketType (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef SOCK_DCCP
- if (x == SOCK_DCCP)
- {*r = Mono_Posix_UnixSocketType_SOCK_DCCP; return 0;}
- #endif /* ndef SOCK_DCCP */
- #ifdef SOCK_DGRAM
- if (x == SOCK_DGRAM)
- {*r = Mono_Posix_UnixSocketType_SOCK_DGRAM; return 0;}
- #endif /* ndef SOCK_DGRAM */
- #ifdef SOCK_PACKET
- if (x == SOCK_PACKET)
- {*r = Mono_Posix_UnixSocketType_SOCK_PACKET; return 0;}
- #endif /* ndef SOCK_PACKET */
- #ifdef SOCK_RAW
- if (x == SOCK_RAW)
- {*r = Mono_Posix_UnixSocketType_SOCK_RAW; return 0;}
- #endif /* ndef SOCK_RAW */
- #ifdef SOCK_RDM
- if (x == SOCK_RDM)
- {*r = Mono_Posix_UnixSocketType_SOCK_RDM; return 0;}
- #endif /* ndef SOCK_RDM */
- #ifdef SOCK_SEQPACKET
- if (x == SOCK_SEQPACKET)
- {*r = Mono_Posix_UnixSocketType_SOCK_SEQPACKET; return 0;}
- #endif /* ndef SOCK_SEQPACKET */
- #ifdef SOCK_STREAM
- if (x == SOCK_STREAM)
- {*r = Mono_Posix_UnixSocketType_SOCK_STREAM; return 0;}
- #endif /* ndef SOCK_STREAM */
- errno = EINVAL; return -1;
- }
- #ifdef HAVE_STRUCT_UTIMBUF
- int
- Mono_Posix_FromUtimbuf (struct Mono_Posix_Utimbuf *from, struct utimbuf *to)
- {
- _cnm_return_val_if_overflow (time_t, from->actime, -1);
- _cnm_return_val_if_overflow (time_t, from->modtime, -1);
- memset (to, 0, sizeof(*to));
- to->actime = from->actime;
- to->modtime = from->modtime;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_UTIMBUF */
- #ifdef HAVE_STRUCT_UTIMBUF
- int
- Mono_Posix_ToUtimbuf (struct utimbuf *from, struct Mono_Posix_Utimbuf *to)
- {
- _cnm_return_val_if_overflow (gint64, from->actime, -1);
- _cnm_return_val_if_overflow (gint64, from->modtime, -1);
- memset (to, 0, sizeof(*to));
- to->actime = from->actime;
- to->modtime = from->modtime;
- return 0;
- }
- #endif /* ndef HAVE_STRUCT_UTIMBUF */
- int Mono_Posix_FromWaitOptions (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_WaitOptions_WNOHANG) == Mono_Posix_WaitOptions_WNOHANG)
- #ifdef WNOHANG
- *r |= WNOHANG;
- #else /* def WNOHANG */
- {errno = EINVAL; return -1;}
- #endif /* ndef WNOHANG */
- if ((x & Mono_Posix_WaitOptions_WUNTRACED) == Mono_Posix_WaitOptions_WUNTRACED)
- #ifdef WUNTRACED
- *r |= WUNTRACED;
- #else /* def WUNTRACED */
- {errno = EINVAL; return -1;}
- #endif /* ndef WUNTRACED */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToWaitOptions (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef WNOHANG
- if ((x & WNOHANG) == WNOHANG)
- *r |= Mono_Posix_WaitOptions_WNOHANG;
- #endif /* ndef WNOHANG */
- #ifdef WUNTRACED
- if ((x & WUNTRACED) == WUNTRACED)
- *r |= Mono_Posix_WaitOptions_WUNTRACED;
- #endif /* ndef WUNTRACED */
- return 0;
- }
- int Mono_Posix_FromXattrFlags (int x, int *r)
- {
- *r = 0;
- if ((x & Mono_Posix_XattrFlags_XATTR_AUTO) == Mono_Posix_XattrFlags_XATTR_AUTO)
- #ifdef XATTR_AUTO
- *r |= XATTR_AUTO;
- #else /* def XATTR_AUTO */
- {errno = EINVAL; return -1;}
- #endif /* ndef XATTR_AUTO */
- if ((x & Mono_Posix_XattrFlags_XATTR_CREATE) == Mono_Posix_XattrFlags_XATTR_CREATE)
- #ifdef XATTR_CREATE
- *r |= XATTR_CREATE;
- #else /* def XATTR_CREATE */
- {errno = EINVAL; return -1;}
- #endif /* ndef XATTR_CREATE */
- if ((x & Mono_Posix_XattrFlags_XATTR_REPLACE) == Mono_Posix_XattrFlags_XATTR_REPLACE)
- #ifdef XATTR_REPLACE
- *r |= XATTR_REPLACE;
- #else /* def XATTR_REPLACE */
- {errno = EINVAL; return -1;}
- #endif /* ndef XATTR_REPLACE */
- if (x == 0)
- return 0;
- return 0;
- }
- int Mono_Posix_ToXattrFlags (int x, int *r)
- {
- *r = 0;
- if (x == 0)
- return 0;
- #ifdef XATTR_AUTO
- if ((x & XATTR_AUTO) == XATTR_AUTO)
- *r |= Mono_Posix_XattrFlags_XATTR_AUTO;
- #endif /* ndef XATTR_AUTO */
- #ifdef XATTR_CREATE
- if ((x & XATTR_CREATE) == XATTR_CREATE)
- *r |= Mono_Posix_XattrFlags_XATTR_CREATE;
- #endif /* ndef XATTR_CREATE */
- #ifdef XATTR_REPLACE
- if ((x & XATTR_REPLACE) == XATTR_REPLACE)
- *r |= Mono_Posix_XattrFlags_XATTR_REPLACE;
- #endif /* ndef XATTR_REPLACE */
- return 0;
- }
|