utime_illumos_amd64.go 114 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801
  1. // Code generated by 'ccgo utime/gen.c -crt-import-path "" -export-defines "" -export-enums "" -export-externs X -export-fields F -export-structs "" -export-typedefs "" -header -hide _OSSwapInt16,_OSSwapInt32,_OSSwapInt64 -ignore-unsupported-alignment -o utime/utime_illumos_amd64.go -pkgname utime', DO NOT EDIT.
  2. package utime
  3. import (
  4. "math"
  5. "reflect"
  6. "sync/atomic"
  7. "unsafe"
  8. )
  9. var _ = math.Pi
  10. var _ reflect.Kind
  11. var _ atomic.Value
  12. var _ unsafe.Pointer
  13. const (
  14. CLOCKS_PER_SEC = 1000000 // time_iso.h:78:1:
  15. CLOCK_HIGHRES = 4 // time_impl.h:126:1:
  16. CLOCK_MONOTONIC = 4 // time_impl.h:124:1:
  17. CLOCK_PROCESS_CPUTIME_ID = 5 // time_impl.h:125:1:
  18. CLOCK_PROF = 2 // time_impl.h:127:1:
  19. CLOCK_REALTIME = 3 // time_impl.h:123:1:
  20. CLOCK_THREAD_CPUTIME_ID = 2 // time_impl.h:122:1:
  21. CLOCK_VIRTUAL = 1 // time_impl.h:121:1:
  22. DST_AUST = 2 // time.h:115:1:
  23. DST_AUSTALT = 10 // time.h:123:1:
  24. DST_CAN = 6 // time.h:119:1:
  25. DST_EET = 5 // time.h:118:1:
  26. DST_GB = 7 // time.h:120:1:
  27. DST_MET = 4 // time.h:117:1:
  28. DST_NONE = 0 // time.h:113:1:
  29. DST_RUM = 8 // time.h:121:1:
  30. DST_TUR = 9 // time.h:122:1:
  31. DST_USA = 1 // time.h:114:1:
  32. DST_WET = 3 // time.h:116:1:
  33. FD_SETSIZE = 65536 // select.h:88:1:
  34. ITIMER_PROF = 2 // time.h:201:1:
  35. ITIMER_REAL = 0 // time.h:199:1:
  36. ITIMER_REALPROF = 3 // time.h:204:1:
  37. ITIMER_VIRTUAL = 1 // time.h:200:1:
  38. MICROSEC = 1000000 // time.h:246:1:
  39. MILLISEC = 1000 // time.h:245:1:
  40. NANOSEC = 1000000000 // time.h:247:1:
  41. NBBY = 8 // select.h:103:1:
  42. P_MYID = -1 // types.h:632:1:
  43. REG_LABEL_BP = 2 // machtypes.h:44:1:
  44. REG_LABEL_MAX = 8 // machtypes.h:51:1:
  45. REG_LABEL_PC = 0 // machtypes.h:42:1:
  46. REG_LABEL_R12 = 4 // machtypes.h:47:1:
  47. REG_LABEL_R13 = 5 // machtypes.h:48:1:
  48. REG_LABEL_R14 = 6 // machtypes.h:49:1:
  49. REG_LABEL_R15 = 7 // machtypes.h:50:1:
  50. REG_LABEL_RBX = 3 // machtypes.h:46:1:
  51. REG_LABEL_SP = 1 // machtypes.h:43:1:
  52. SEC = 1 // time.h:244:1:
  53. TIMER_ABSTIME = 0x1 // time_impl.h:134:1:
  54. TIMER_RELTIME = 0x0 // time_impl.h:133:1:
  55. TIME_UTC = 0x1 // time.h:306:1:
  56. X_ALIGNMENT_REQUIRED = 1 // isa_defs.h:262:1:
  57. X_BIT_FIELDS_LTOH = 0 // isa_defs.h:245:1:
  58. X_BOOL_ALIGNMENT = 1 // isa_defs.h:248:1:
  59. X_CHAR_ALIGNMENT = 1 // isa_defs.h:249:1:
  60. X_CHAR_IS_SIGNED = 0 // isa_defs.h:247:1:
  61. X_CLOCKID_T = 0 // types.h:568:1:
  62. X_CLOCK_T = 0 // types.h:563:1:
  63. X_COND_MAGIC = 0x4356 // types.h:426:1:
  64. X_DMA_USES_PHYSADDR = 0 // isa_defs.h:281:1:
  65. X_DONT_USE_1275_GENERIC_NAMES = 0 // isa_defs.h:287:1:
  66. X_DOUBLE_ALIGNMENT = 8 // isa_defs.h:256:1:
  67. X_DOUBLE_COMPLEX_ALIGNMENT = 8 // isa_defs.h:257:1:
  68. X_DTRACE_VERSION = 1 // feature_tests.h:490:1:
  69. X_FILE_OFFSET_BITS = 64 // <builtin>:25:1:
  70. X_FIRMWARE_NEEDS_FDISK = 0 // isa_defs.h:282:1:
  71. X_FLOAT_ALIGNMENT = 4 // isa_defs.h:252:1:
  72. X_FLOAT_COMPLEX_ALIGNMENT = 4 // isa_defs.h:253:1:
  73. X_HAVE_CPUID_INSN = 0 // isa_defs.h:288:1:
  74. X_IEEE_754 = 0 // isa_defs.h:246:1:
  75. X_INT64_TYPE = 0 // int_types.h:82:1:
  76. X_INT_ALIGNMENT = 4 // isa_defs.h:251:1:
  77. X_ISO_CPP_14882_1998 = 0 // feature_tests.h:466:1:
  78. X_ISO_C_9899_1999 = 0 // feature_tests.h:472:1:
  79. X_ISO_C_9899_2011 = 0 // feature_tests.h:478:1:
  80. X_ISO_TIME_ISO_H = 0 // time_iso.h:46:1:
  81. X_LARGEFILE64_SOURCE = 1 // feature_tests.h:231:1:
  82. X_LARGEFILE_SOURCE = 1 // feature_tests.h:235:1:
  83. X_LITTLE_ENDIAN = 0 // isa_defs.h:242:1:
  84. X_LOCALE_T = 0 // time.h:291:1:
  85. X_LONGLONG_TYPE = 0 // feature_tests.h:412:1:
  86. X_LONG_ALIGNMENT = 8 // isa_defs.h:254:1:
  87. X_LONG_DOUBLE_ALIGNMENT = 16 // isa_defs.h:258:1:
  88. X_LONG_DOUBLE_COMPLEX_ALIGNMENT = 16 // isa_defs.h:259:1:
  89. X_LONG_LONG_ALIGNMENT = 8 // isa_defs.h:255:1:
  90. X_LONG_LONG_ALIGNMENT_32 = 4 // isa_defs.h:268:1:
  91. X_LONG_LONG_LTOH = 0 // isa_defs.h:244:1:
  92. X_LP64 = 1 // <predefined>:286:1:
  93. X_MAX_ALIGNMENT = 16 // isa_defs.h:261:1:
  94. X_MULTI_DATAMODEL = 0 // isa_defs.h:279:1:
  95. X_MUTEX_MAGIC = 0x4d58 // types.h:424:1:
  96. X_NBBY = 8 // select.h:100:1:
  97. X_NORETURN_KYWD = 0 // feature_tests.h:448:1:
  98. X_OFF_T = 0 // types.h:142:1:
  99. X_POINTER_ALIGNMENT = 8 // isa_defs.h:260:1:
  100. X_PSM_MODULES = 0 // isa_defs.h:284:1:
  101. X_PTRDIFF_T = 0 // types.h:112:1:
  102. X_RESTRICT_KYWD = 0 // feature_tests.h:435:1:
  103. X_RTC_CONFIG = 0 // isa_defs.h:285:1:
  104. X_RWL_MAGIC = 0x5257 // types.h:427:1:
  105. X_SEMA_MAGIC = 0x534d // types.h:425:1:
  106. X_SHORT_ALIGNMENT = 2 // isa_defs.h:250:1:
  107. X_SIGEVENT = 0 // time.h:132:1:
  108. X_SIGSET_T = 0 // select.h:73:1:
  109. X_SIGVAL = 0 // time.h:124:1:
  110. X_SIZE_T = 0 // types.h:540:1:
  111. X_SOFT_HOSTID = 0 // isa_defs.h:286:1:
  112. X_SSIZE_T = 0 // types.h:549:1:
  113. X_STACK_GROWS_DOWNWARD = 0 // isa_defs.h:243:1:
  114. X_STDC_C11 = 0 // feature_tests.h:165:1:
  115. X_STDC_C99 = 0 // feature_tests.h:169:1:
  116. X_SUNOS_VTOC_16 = 0 // isa_defs.h:280:1:
  117. X_SUSECONDS_T = 0 // types.h:343:1:
  118. X_SYS_CCOMPILE_H = 0 // ccompile.h:32:1:
  119. X_SYS_FEATURE_TESTS_H = 0 // feature_tests.h:41:1:
  120. X_SYS_INT_TYPES_H = 0 // int_types.h:30:1:
  121. X_SYS_ISA_DEFS_H = 0 // isa_defs.h:30:1:
  122. X_SYS_MACHTYPES_H = 0 // machtypes.h:27:1:
  123. X_SYS_NULL_H = 0 // null.h:17:1:
  124. X_SYS_SELECT_H = 0 // select.h:45:1:
  125. X_SYS_TIME_H = 0 // time.h:27:1:
  126. X_SYS_TIME_IMPL_H = 0 // time_impl.h:38:1:
  127. X_SYS_TYPES_H = 0 // types.h:35:1:
  128. X_SYS_UTIME_H = 0 // utime.h:31:1:
  129. X_TIMER_T = 0 // types.h:573:1:
  130. X_TIME_H = 0 // time.h:37:1:
  131. X_TIME_T = 0 // types.h:558:1:
  132. X_UID_T = 0 // types.h:400:1:
  133. X_UTIME_H = 0 // utime.h:32:1:
  134. X_XOPEN_VERSION = 3 // feature_tests.h:392:1:
  135. Sun = 1 // <predefined>:172:1:
  136. Unix = 1 // <predefined>:175:1:
  137. )
  138. // used for block sizes
  139. // The boolean_t type has had a varied amount of exposure over the years in
  140. // terms of how its enumeration constants have been exposed. In particular, it
  141. // originally used the __XOPEN_OR_POSIX macro to determine whether to prefix the
  142. // B_TRUE and B_FALSE with an underscore. This check never included the
  143. // question of if we were in a strict ANSI C environment or whether extensions
  144. // were defined.
  145. //
  146. // Compilers such as clang started defaulting to always including an
  147. // XOPEN_SOURCE declaration on behalf of users, but also noted __EXTENSIONS__.
  148. // This would lead most software that had used the non-underscore versions to
  149. // need it. As such, we have adjusted the non-strict XOPEN environment to retain
  150. // its old behavior so as to minimize namespace pollution; however, we instead
  151. // include both variants of the definitions in the generally visible version
  152. // allowing software written in either world to hopefully end up in a good
  153. // place.
  154. //
  155. // This isn't perfect, but should hopefully minimize the pain for folks actually
  156. // trying to build software.
  157. const ( /* types.h:215:1: */
  158. B_FALSE = 0
  159. B_TRUE = 1
  160. X_B_FALSE = 0
  161. X_B_TRUE = 1
  162. )
  163. type Ptrdiff_t = int64 /* <builtin>:3:26 */
  164. type Size_t = uint64 /* <builtin>:9:23 */
  165. type Wchar_t = int32 /* <builtin>:15:24 */
  166. type X__int128_t = struct {
  167. Flo int64
  168. Fhi int64
  169. } /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128
  170. type X__uint128_t = struct {
  171. Flo uint64
  172. Fhi uint64
  173. } /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128
  174. type X__builtin_va_list = uintptr /* <builtin>:46:14 */
  175. type X__float128 = float64 /* <builtin>:47:21 */
  176. // CDDL HEADER START
  177. //
  178. // The contents of this file are subject to the terms of the
  179. // Common Development and Distribution License, Version 1.0 only
  180. // (the "License"). You may not use this file except in compliance
  181. // with the License.
  182. //
  183. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  184. // or http://www.opensolaris.org/os/licensing.
  185. // See the License for the specific language governing permissions
  186. // and limitations under the License.
  187. //
  188. // When distributing Covered Code, include this CDDL HEADER in each
  189. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  190. // If applicable, add the following below this CDDL HEADER, with the
  191. // fields enclosed by brackets "[]" replaced with your own identifying
  192. // information: Portions Copyright [yyyy] [name of copyright owner]
  193. //
  194. // CDDL HEADER END
  195. // Copyright 2014 Garrett D'Amore <garrett@damore.org>
  196. // Copyright (c) 1988 AT&T
  197. // All Rights Reserved
  198. // utimbuf is used by utime(2)
  199. // CDDL HEADER START
  200. //
  201. // The contents of this file are subject to the terms of the
  202. // Common Development and Distribution License, Version 1.0 only
  203. // (the "License"). You may not use this file except in compliance
  204. // with the License.
  205. //
  206. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  207. // or http://www.opensolaris.org/os/licensing.
  208. // See the License for the specific language governing permissions
  209. // and limitations under the License.
  210. //
  211. // When distributing Covered Code, include this CDDL HEADER in each
  212. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  213. // If applicable, add the following below this CDDL HEADER, with the
  214. // fields enclosed by brackets "[]" replaced with your own identifying
  215. // information: Portions Copyright [yyyy] [name of copyright owner]
  216. //
  217. // CDDL HEADER END
  218. // Copyright 1997 Sun Microsystems, Inc. All rights reserved.
  219. // Use is subject to license terms.
  220. // Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  221. // All Rights Reserved
  222. // CDDL HEADER START
  223. //
  224. // The contents of this file are subject to the terms of the
  225. // Common Development and Distribution License (the "License").
  226. // You may not use this file except in compliance with the License.
  227. //
  228. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  229. // or http://www.opensolaris.org/os/licensing.
  230. // See the License for the specific language governing permissions
  231. // and limitations under the License.
  232. //
  233. // When distributing Covered Code, include this CDDL HEADER in each
  234. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  235. // If applicable, add the following below this CDDL HEADER, with the
  236. // fields enclosed by brackets "[]" replaced with your own identifying
  237. // information: Portions Copyright [yyyy] [name of copyright owner]
  238. //
  239. // CDDL HEADER END
  240. // Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  241. // All Rights Reserved
  242. // Copyright 2009 Sun Microsystems, Inc. All rights reserved.
  243. // Use is subject to license terms.
  244. //
  245. // Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  246. // Copyright 2016 Joyent, Inc.
  247. // Copyright 2021 Oxide Computer Company
  248. // DO NOT EDIT THIS FILE.
  249. //
  250. // It has been auto-edited by fixincludes from:
  251. //
  252. // "/usr/include/sys/feature_tests.h"
  253. //
  254. // This had to be done to correct non-standard usages in the
  255. // original, manufacturer supplied header file.
  256. // CDDL HEADER START
  257. //
  258. // The contents of this file are subject to the terms of the
  259. // Common Development and Distribution License (the "License").
  260. // You may not use this file except in compliance with the License.
  261. //
  262. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  263. // or http://www.opensolaris.org/os/licensing.
  264. // See the License for the specific language governing permissions
  265. // and limitations under the License.
  266. //
  267. // When distributing Covered Code, include this CDDL HEADER in each
  268. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  269. // If applicable, add the following below this CDDL HEADER, with the
  270. // fields enclosed by brackets "[]" replaced with your own identifying
  271. // information: Portions Copyright [yyyy] [name of copyright owner]
  272. //
  273. // CDDL HEADER END
  274. // Copyright 2013 Garrett D'Amore <garrett@damore.org>
  275. // Copyright 2016 Joyent, Inc.
  276. // Copyright 2022 Oxide Computer Company
  277. //
  278. // Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  279. // Use is subject to license terms.
  280. // CDDL HEADER START
  281. //
  282. // The contents of this file are subject to the terms of the
  283. // Common Development and Distribution License, Version 1.0 only
  284. // (the "License"). You may not use this file except in compliance
  285. // with the License.
  286. //
  287. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  288. // or http://www.opensolaris.org/os/licensing.
  289. // See the License for the specific language governing permissions
  290. // and limitations under the License.
  291. //
  292. // When distributing Covered Code, include this CDDL HEADER in each
  293. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  294. // If applicable, add the following below this CDDL HEADER, with the
  295. // fields enclosed by brackets "[]" replaced with your own identifying
  296. // information: Portions Copyright [yyyy] [name of copyright owner]
  297. //
  298. // CDDL HEADER END
  299. // Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  300. // Use is subject to license terms.
  301. // Copyright 2015 EveryCity Ltd. All rights reserved.
  302. // Copyright 2019 Joyent, Inc.
  303. // This file contains definitions designed to enable different compilers
  304. // to be used harmoniously on Solaris systems.
  305. // Allow for version tests for compiler bugs and features.
  306. // analogous to lint's PRINTFLIKEn
  307. // Handle the kernel printf routines that can take '%b' too
  308. // This one's pretty obvious -- the function never returns
  309. // The function is 'extern inline' and expects GNU C89 behaviour, not C99
  310. // behaviour.
  311. //
  312. // Should only be used on 'extern inline' definitions for GCC.
  313. // The function has control flow such that it may return multiple times (in
  314. // the manner of setjmp or vfork)
  315. // This is an appropriate label for functions that do not
  316. // modify their arguments, e.g. strlen()
  317. // This is a stronger form of __pure__. Can be used for functions
  318. // that do not modify their arguments and don't depend on global
  319. // memory.
  320. // This attribute, attached to a variable, means that the variable is meant to
  321. // be possibly unused. GCC will not produce a warning for this variable.
  322. // Shorthand versions for readability
  323. // In release build, disable warnings about variables
  324. // which are used only for debugging.
  325. // CDDL HEADER START
  326. //
  327. // The contents of this file are subject to the terms of the
  328. // Common Development and Distribution License (the "License").
  329. // You may not use this file except in compliance with the License.
  330. //
  331. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  332. // or http://www.opensolaris.org/os/licensing.
  333. // See the License for the specific language governing permissions
  334. // and limitations under the License.
  335. //
  336. //
  337. // When distributing Covered Code, include this CDDL HEADER in each
  338. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  339. // If applicable, add the following below this CDDL HEADER, with the
  340. // fields enclosed by brackets "[]" replaced with your own identifying
  341. // information: Portions Copyright [yyyy] [name of copyright owner]
  342. //
  343. // CDDL HEADER END
  344. // Copyright 2008 Sun Microsystems, Inc. All rights reserved.
  345. // Use is subject to license terms.
  346. // Copyright 2016 Joyent, Inc.
  347. // This header file serves to group a set of well known defines and to
  348. // set these for each instruction set architecture. These defines may
  349. // be divided into two groups; characteristics of the processor and
  350. // implementation choices for Solaris on a processor.
  351. //
  352. // Processor Characteristics:
  353. //
  354. // _LITTLE_ENDIAN / _BIG_ENDIAN:
  355. // The natural byte order of the processor. A pointer to an int points
  356. // to the least/most significant byte of that int.
  357. //
  358. // _STACK_GROWS_UPWARD / _STACK_GROWS_DOWNWARD:
  359. // The processor specific direction of stack growth. A push onto the
  360. // stack increases/decreases the stack pointer, so it stores data at
  361. // successively higher/lower addresses. (Stackless machines ignored
  362. // without regrets).
  363. //
  364. // _LONG_LONG_HTOL / _LONG_LONG_LTOH:
  365. // A pointer to a long long points to the most/least significant long
  366. // within that long long.
  367. //
  368. // _BIT_FIELDS_HTOL / _BIT_FIELDS_LTOH:
  369. // The C compiler assigns bit fields from the high/low to the low/high end
  370. // of an int (most to least significant vs. least to most significant).
  371. //
  372. // _IEEE_754:
  373. // The processor (or supported implementations of the processor)
  374. // supports the ieee-754 floating point standard. No other floating
  375. // point standards are supported (or significant). Any other supported
  376. // floating point formats are expected to be cased on the ISA processor
  377. // symbol.
  378. //
  379. // _CHAR_IS_UNSIGNED / _CHAR_IS_SIGNED:
  380. // The C Compiler implements objects of type `char' as `unsigned' or
  381. // `signed' respectively. This is really an implementation choice of
  382. // the compiler writer, but it is specified in the ABI and tends to
  383. // be uniform across compilers for an instruction set architecture.
  384. // Hence, it has the properties of a processor characteristic.
  385. //
  386. // _CHAR_ALIGNMENT / _SHORT_ALIGNMENT / _INT_ALIGNMENT / _LONG_ALIGNMENT /
  387. // _LONG_LONG_ALIGNMENT / _DOUBLE_ALIGNMENT / _LONG_DOUBLE_ALIGNMENT /
  388. // _POINTER_ALIGNMENT / _FLOAT_ALIGNMENT:
  389. // The ABI defines alignment requirements of each of the primitive
  390. // object types. Some, if not all, may be hardware requirements as
  391. // well. The values are expressed in "byte-alignment" units.
  392. //
  393. // _MAX_ALIGNMENT:
  394. // The most stringent alignment requirement as specified by the ABI.
  395. // Equal to the maximum of all the above _XXX_ALIGNMENT values.
  396. //
  397. // _MAX_ALIGNMENT_TYPE:
  398. // The name of the C type that has the value descried in _MAX_ALIGNMENT.
  399. //
  400. // _ALIGNMENT_REQUIRED:
  401. // True or false (1 or 0) whether or not the hardware requires the ABI
  402. // alignment.
  403. //
  404. // _LONG_LONG_ALIGNMENT_32
  405. // The 32-bit ABI supported by a 64-bit kernel may have different
  406. // alignment requirements for primitive object types. The value of this
  407. // identifier is expressed in "byte-alignment" units.
  408. //
  409. // _HAVE_CPUID_INSN
  410. // This indicates that the architecture supports the 'cpuid'
  411. // instruction as defined by Intel. (Intel allows other vendors
  412. // to extend the instruction for their own purposes.)
  413. //
  414. //
  415. // Implementation Choices:
  416. //
  417. // _ILP32 / _LP64:
  418. // This specifies the compiler data type implementation as specified in
  419. // the relevant ABI. The choice between these is strongly influenced
  420. // by the underlying hardware, but is not absolutely tied to it.
  421. // Currently only two data type models are supported:
  422. //
  423. // _ILP32:
  424. // Int/Long/Pointer are 32 bits. This is the historical UNIX
  425. // and Solaris implementation. Due to its historical standing,
  426. // this is the default case.
  427. //
  428. // _LP64:
  429. // Long/Pointer are 64 bits, Int is 32 bits. This is the chosen
  430. // implementation for 64-bit ABIs such as SPARC V9.
  431. //
  432. // _I32LPx:
  433. // A compilation environment where 'int' is 32-bit, and
  434. // longs and pointers are simply the same size.
  435. //
  436. // In all cases, Char is 8 bits and Short is 16 bits.
  437. //
  438. // _SUNOS_VTOC_8 / _SUNOS_VTOC_16 / _SVR4_VTOC_16:
  439. // This specifies the form of the disk VTOC (or label):
  440. //
  441. // _SUNOS_VTOC_8:
  442. // This is a VTOC form which is upwardly compatible with the
  443. // SunOS 4.x disk label and allows 8 partitions per disk.
  444. //
  445. // _SUNOS_VTOC_16:
  446. // In this format the incore vtoc image matches the ondisk
  447. // version. It allows 16 slices per disk, and is not
  448. // compatible with the SunOS 4.x disk label.
  449. //
  450. // Note that these are not the only two VTOC forms possible and
  451. // additional forms may be added. One possible form would be the
  452. // SVr4 VTOC form. The symbol for that is reserved now, although
  453. // it is not implemented.
  454. //
  455. // _SVR4_VTOC_16:
  456. // This VTOC form is compatible with the System V Release 4
  457. // VTOC (as implemented on the SVr4 Intel and 3b ports) with
  458. // 16 partitions per disk.
  459. //
  460. //
  461. // _DMA_USES_PHYSADDR / _DMA_USES_VIRTADDR
  462. // This describes the type of addresses used by system DMA:
  463. //
  464. // _DMA_USES_PHYSADDR:
  465. // This type of DMA, used in the x86 implementation,
  466. // requires physical addresses for DMA buffers. The 24-bit
  467. // addresses used by some legacy boards is the source of the
  468. // "low-memory" (<16MB) requirement for some devices using DMA.
  469. //
  470. // _DMA_USES_VIRTADDR:
  471. // This method of DMA allows the use of virtual addresses for
  472. // DMA transfers.
  473. //
  474. // _FIRMWARE_NEEDS_FDISK / _NO_FDISK_PRESENT
  475. // This indicates the presence/absence of an fdisk table.
  476. //
  477. // _FIRMWARE_NEEDS_FDISK
  478. // The fdisk table is required by system firmware. If present,
  479. // it allows a disk to be subdivided into multiple fdisk
  480. // partitions, each of which is equivalent to a separate,
  481. // virtual disk. This enables the co-existence of multiple
  482. // operating systems on a shared hard disk.
  483. //
  484. // _NO_FDISK_PRESENT
  485. // If the fdisk table is absent, it is assumed that the entire
  486. // media is allocated for a single operating system.
  487. //
  488. // _HAVE_TEM_FIRMWARE
  489. // Defined if this architecture has the (fallback) option of
  490. // using prom_* calls for doing I/O if a suitable kernel driver
  491. // is not available to do it.
  492. //
  493. // _DONT_USE_1275_GENERIC_NAMES
  494. // Controls whether or not device tree node names should
  495. // comply with the IEEE 1275 "Generic Names" Recommended
  496. // Practice. With _DONT_USE_GENERIC_NAMES, device-specific
  497. // names identifying the particular device will be used.
  498. //
  499. // __i386_COMPAT
  500. // This indicates whether the i386 ABI is supported as a *non-native*
  501. // mode for the platform. When this symbol is defined:
  502. // - 32-bit xstat-style system calls are enabled
  503. // - 32-bit xmknod-style system calls are enabled
  504. // - 32-bit system calls use i386 sizes -and- alignments
  505. //
  506. // Note that this is NOT defined for the i386 native environment!
  507. //
  508. // __x86
  509. // This is ONLY a synonym for defined(__i386) || defined(__amd64)
  510. // which is useful only insofar as these two architectures share
  511. // common attributes. Analogous to __sparc.
  512. //
  513. // _PSM_MODULES
  514. // This indicates whether or not the implementation uses PSM
  515. // modules for processor support, reading /etc/mach from inside
  516. // the kernel to extract a list.
  517. //
  518. // _RTC_CONFIG
  519. // This indicates whether or not the implementation uses /etc/rtc_config
  520. // to configure the real-time clock in the kernel.
  521. //
  522. // _UNIX_KRTLD
  523. // This indicates that the implementation uses a dynamically
  524. // linked unix + krtld to form the core kernel image at boot
  525. // time, or (in the absence of this symbol) a prelinked kernel image.
  526. //
  527. // _OBP
  528. // This indicates the firmware interface is OBP.
  529. //
  530. // _SOFT_HOSTID
  531. // This indicates that the implementation obtains the hostid
  532. // from the file /etc/hostid, rather than from hardware.
  533. // The following set of definitions characterize Solaris on AMD's
  534. // 64-bit systems.
  535. // Define the appropriate "processor characteristics"
  536. // Different alignment constraints for the i386 ABI in compatibility mode
  537. // Define the appropriate "implementation choices".
  538. // The feature test macro __i386 is generic for all processors implementing
  539. // the Intel 386 instruction set or a superset of it. Specifically, this
  540. // includes all members of the 386, 486, and Pentium family of processors.
  541. // Values of _POSIX_C_SOURCE
  542. //
  543. // undefined not a POSIX compilation
  544. // 1 POSIX.1-1990 compilation
  545. // 2 POSIX.2-1992 compilation
  546. // 199309L POSIX.1b-1993 compilation (Real Time)
  547. // 199506L POSIX.1c-1995 compilation (POSIX Threads)
  548. // 200112L POSIX.1-2001 compilation (Austin Group Revision)
  549. // 200809L POSIX.1-2008 compilation
  550. // The feature test macros __XOPEN_OR_POSIX, _STRICT_STDC, _STRICT_SYMBOLS,
  551. // and _STDC_C99 are Sun implementation specific macros created in order to
  552. // compress common standards specified feature test macros for easier reading.
  553. // These macros should not be used by the application developer as
  554. // unexpected results may occur. Instead, the user should reference
  555. // standards(7) for correct usage of the standards feature test macros.
  556. //
  557. // __XOPEN_OR_POSIX Used in cases where a symbol is defined by both
  558. // X/Open or POSIX or in the negative, when neither
  559. // X/Open or POSIX defines a symbol.
  560. //
  561. // _STRICT_STDC __STDC__ is specified by the C Standards and defined
  562. // by the compiler. For Sun compilers the value of
  563. // __STDC__ is either 1, 0, or not defined based on the
  564. // compilation mode (see cc(1)). When the value of
  565. // __STDC__ is 1 and in the absence of any other feature
  566. // test macros, the namespace available to the application
  567. // is limited to only those symbols defined by the C
  568. // Standard. _STRICT_STDC provides a more readable means
  569. // of identifying symbols defined by the standard, or in
  570. // the negative, symbols that are extensions to the C
  571. // Standard. See additional comments for GNU C differences.
  572. //
  573. // _STDC_C99 __STDC_VERSION__ is specified by the C standards and
  574. // defined by the compiler and indicates the version of
  575. // the C standard. A value of 199901L indicates a
  576. // compiler that complies with ISO/IEC 9899:1999, other-
  577. // wise known as the C99 standard.
  578. //
  579. // _STDC_C11 Like _STDC_C99 except that the value of __STDC_VERSION__
  580. // is 201112L indicating a compiler that compiles with
  581. // ISO/IEC 9899:2011, otherwise known as the C11 standard.
  582. //
  583. // _STRICT_SYMBOLS Used in cases where symbol visibility is restricted
  584. // by the standards, and the user has not explicitly
  585. // relaxed the strictness via __EXTENSIONS__.
  586. // ISO/IEC 9899:1990 and it's revisions, ISO/IEC 9899:1999 and ISO/IEC
  587. // 99899:2011 specify the following predefined macro name:
  588. //
  589. // __STDC__ The integer constant 1, intended to indicate a conforming
  590. // implementation.
  591. //
  592. // Furthermore, a strictly conforming program shall use only those features
  593. // of the language and library specified in these standards. A conforming
  594. // implementation shall accept any strictly conforming program.
  595. //
  596. // Based on these requirements, Sun's C compiler defines __STDC__ to 1 for
  597. // strictly conforming environments and __STDC__ to 0 for environments that
  598. // use ANSI C semantics but allow extensions to the C standard. For non-ANSI
  599. // C semantics, Sun's C compiler does not define __STDC__.
  600. //
  601. // The GNU C project interpretation is that __STDC__ should always be defined
  602. // to 1 for compilation modes that accept ANSI C syntax regardless of whether
  603. // or not extensions to the C standard are used. Violations of conforming
  604. // behavior are conditionally flagged as warnings via the use of the
  605. // -pedantic option. In addition to defining __STDC__ to 1, the GNU C
  606. // compiler also defines __STRICT_ANSI__ as a means of specifying strictly
  607. // conforming environments using the -ansi or -std=<standard> options.
  608. //
  609. // In the absence of any other compiler options, Sun and GNU set the value
  610. // of __STDC__ as follows when using the following options:
  611. //
  612. // Value of __STDC__ __STRICT_ANSI__
  613. //
  614. // cc -Xa (default) 0 undefined
  615. // cc -Xt (transitional) 0 undefined
  616. // cc -Xc (strictly conforming) 1 undefined
  617. // cc -Xs (K&R C) undefined undefined
  618. //
  619. // gcc (default) 1 undefined
  620. // gcc -ansi, -std={c89, c99,...) 1 defined
  621. // gcc -traditional (K&R) undefined undefined
  622. //
  623. // The default compilation modes for Sun C compilers versus GNU C compilers
  624. // results in a differing value for __STDC__ which results in a more
  625. // restricted namespace when using Sun compilers. To allow both GNU and Sun
  626. // interpretations to peacefully co-exist, we use the following Sun
  627. // implementation _STRICT_STDC_ macro:
  628. // Compiler complies with ISO/IEC 9899:1999 or ISO/IEC 9989:2011
  629. // Use strict symbol visibility.
  630. // This is a variant of _STRICT_SYMBOLS that is meant to cover headers that are
  631. // governed by POSIX, but have not been governed by ISO C. One can go two ways
  632. // on what should happen if an application actively includes (not transitively)
  633. // a header that isn't part of the ISO C spec, we opt to say that if someone has
  634. // gone out of there way then they're doing it for a reason and that is an act
  635. // of non-compliance and therefore it's not up to us to hide away every symbol.
  636. //
  637. // In general, prefer using _STRICT_SYMBOLS, but this is here in particular for
  638. // cases where in the past we have only used a POSIX related check and we don't
  639. // wish to make something stricter. Often applications are relying on the
  640. // ability to, or more realistically unwittingly, have _STRICT_STDC declared and
  641. // still use these interfaces.
  642. // Large file interfaces:
  643. //
  644. // _LARGEFILE_SOURCE
  645. // 1 large file-related additions to POSIX
  646. // interfaces requested (fseeko, etc.)
  647. // _LARGEFILE64_SOURCE
  648. // 1 transitional large-file-related interfaces
  649. // requested (seek64, stat64, etc.)
  650. //
  651. // The corresponding announcement macros are respectively:
  652. // _LFS_LARGEFILE
  653. // _LFS64_LARGEFILE
  654. // (These are set in <unistd.h>.)
  655. //
  656. // Requesting _LARGEFILE64_SOURCE implies requesting _LARGEFILE_SOURCE as
  657. // well.
  658. //
  659. // The large file interfaces are made visible regardless of the initial values
  660. // of the feature test macros under certain circumstances:
  661. // - If no explicit standards-conforming environment is requested (neither
  662. // of _POSIX_SOURCE nor _XOPEN_SOURCE is defined and the value of
  663. // __STDC__ does not imply standards conformance).
  664. // - Extended system interfaces are explicitly requested (__EXTENSIONS__
  665. // is defined).
  666. // - Access to in-kernel interfaces is requested (_KERNEL or _KMEMUSER is
  667. // defined). (Note that this dependency is an artifact of the current
  668. // kernel implementation and may change in future releases.)
  669. // Large file compilation environment control:
  670. //
  671. // The setting of _FILE_OFFSET_BITS controls the size of various file-related
  672. // types and governs the mapping between file-related source function symbol
  673. // names and the corresponding binary entry points.
  674. //
  675. // In the 32-bit environment, the default value is 32; if not set, set it to
  676. // the default here, to simplify tests in other headers.
  677. //
  678. // In the 64-bit compilation environment, the only value allowed is 64.
  679. // Use of _XOPEN_SOURCE
  680. //
  681. // The following X/Open specifications are supported:
  682. //
  683. // X/Open Portability Guide, Issue 3 (XPG3)
  684. // X/Open CAE Specification, Issue 4 (XPG4)
  685. // X/Open CAE Specification, Issue 4, Version 2 (XPG4v2)
  686. // X/Open CAE Specification, Issue 5 (XPG5)
  687. // Open Group Technical Standard, Issue 6 (XPG6), also referred to as
  688. // IEEE Std. 1003.1-2001 and ISO/IEC 9945:2002.
  689. // Open Group Technical Standard, Issue 7 (XPG7), also referred to as
  690. // IEEE Std. 1003.1-2008 and ISO/IEC 9945:2009.
  691. //
  692. // XPG4v2 is also referred to as UNIX 95 (SUS or SUSv1).
  693. // XPG5 is also referred to as UNIX 98 or the Single Unix Specification,
  694. // Version 2 (SUSv2)
  695. // XPG6 is the result of a merge of the X/Open and POSIX specifications
  696. // and as such is also referred to as IEEE Std. 1003.1-2001 in
  697. // addition to UNIX 03 and SUSv3.
  698. // XPG7 is also referred to as UNIX 08 and SUSv4.
  699. //
  700. // When writing a conforming X/Open application, as per the specification
  701. // requirements, the appropriate feature test macros must be defined at
  702. // compile time. These are as follows. For more info, see standards(7).
  703. //
  704. // Feature Test Macro Specification
  705. // ------------------------------------------------ -------------
  706. // _XOPEN_SOURCE XPG3
  707. // _XOPEN_SOURCE && _XOPEN_VERSION = 4 XPG4
  708. // _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1 XPG4v2
  709. // _XOPEN_SOURCE = 500 XPG5
  710. // _XOPEN_SOURCE = 600 (or POSIX_C_SOURCE=200112L) XPG6
  711. // _XOPEN_SOURCE = 700 (or POSIX_C_SOURCE=200809L) XPG7
  712. //
  713. // In order to simplify the guards within the headers, the following
  714. // implementation private test macros have been created. Applications
  715. // must NOT use these private test macros as unexpected results will
  716. // occur.
  717. //
  718. // Note that in general, the use of these private macros is cumulative.
  719. // For example, the use of _XPG3 with no other restrictions on the X/Open
  720. // namespace will make the symbols visible for XPG3 through XPG6
  721. // compilation environments. The use of _XPG4_2 with no other X/Open
  722. // namespace restrictions indicates that the symbols were introduced in
  723. // XPG4v2 and are therefore visible for XPG4v2 through XPG6 compilation
  724. // environments, but not for XPG3 or XPG4 compilation environments.
  725. //
  726. // _XPG3 X/Open Portability Guide, Issue 3 (XPG3)
  727. // _XPG4 X/Open CAE Specification, Issue 4 (XPG4)
  728. // _XPG4_2 X/Open CAE Specification, Issue 4, Version 2 (XPG4v2/UNIX 95/SUS)
  729. // _XPG5 X/Open CAE Specification, Issue 5 (XPG5/UNIX 98/SUSv2)
  730. // _XPG6 Open Group Technical Standard, Issue 6 (XPG6/UNIX 03/SUSv3)
  731. // _XPG7 Open Group Technical Standard, Issue 7 (XPG7/UNIX 08/SUSv4)
  732. // X/Open Portability Guide, Issue 3
  733. // _XOPEN_VERSION is defined by the X/Open specifications and is not
  734. // normally defined by the application, except in the case of an XPG4
  735. // application. On the implementation side, _XOPEN_VERSION defined with
  736. // the value of 3 indicates an XPG3 application. _XOPEN_VERSION defined
  737. // with the value of 4 indicates an XPG4 or XPG4v2 (UNIX 95) application.
  738. // _XOPEN_VERSION defined with a value of 500 indicates an XPG5 (UNIX 98)
  739. // application and with a value of 600 indicates an XPG6 (UNIX 03)
  740. // application and with a value of 700 indicates an XPG7 (UNIX 08).
  741. // The appropriate version is determined by the use of the
  742. // feature test macros described earlier. The value of _XOPEN_VERSION
  743. // defaults to 3 otherwise indicating support for XPG3 applications.
  744. // ANSI C and ISO 9899:1990 say the type long long doesn't exist in strictly
  745. // conforming environments. ISO 9899:1999 says it does.
  746. //
  747. // The presence of _LONGLONG_TYPE says "long long exists" which is therefore
  748. // defined in all but strictly conforming environments that disallow it.
  749. // The following macro defines a value for the ISO C99 restrict
  750. // keyword so that _RESTRICT_KYWD resolves to "restrict" if
  751. // an ISO C99 compiler is used, "__restrict" for c++ and "" (null string)
  752. // if any other compiler is used. This allows for the use of single
  753. // prototype declarations regardless of compiler version.
  754. // The following macro defines a value for the ISO C11 _Noreturn
  755. // keyword so that _NORETURN_KYWD resolves to "_Noreturn" if
  756. // an ISO C11 compiler is used and "" (null string) if any other
  757. // compiler is used. This allows for the use of single prototype
  758. // declarations regardless of compiler version.
  759. // ISO/IEC 9899:2011 Annex K
  760. // The following macro indicates header support for the ANSI C++
  761. // standard. The ISO/IEC designation for this is ISO/IEC FDIS 14882.
  762. // The following macro indicates header support for the C99 standard,
  763. // ISO/IEC 9899:1999, Programming Languages - C.
  764. // The following macro indicates header support for the C11 standard,
  765. // ISO/IEC 9899:2011, Programming Languages - C.
  766. // The following macro indicates header support for the C11 standard,
  767. // ISO/IEC 9899:2011 Annex K, Programming Languages - C.
  768. // The following macro indicates header support for DTrace. The value is an
  769. // integer that corresponds to the major version number for DTrace.
  770. // CDDL HEADER START
  771. //
  772. // The contents of this file are subject to the terms of the
  773. // Common Development and Distribution License (the "License").
  774. // You may not use this file except in compliance with the License.
  775. //
  776. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  777. // or http://www.opensolaris.org/os/licensing.
  778. // See the License for the specific language governing permissions
  779. // and limitations under the License.
  780. //
  781. //
  782. // When distributing Covered Code, include this CDDL HEADER in each
  783. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  784. // If applicable, add the following below this CDDL HEADER, with the
  785. // fields enclosed by brackets "[]" replaced with your own identifying
  786. // information: Portions Copyright [yyyy] [name of copyright owner]
  787. //
  788. // CDDL HEADER END
  789. // Copyright 2008 Sun Microsystems, Inc. All rights reserved.
  790. // Use is subject to license terms.
  791. // Copyright 2016 Joyent, Inc.
  792. // Machine dependent definitions moved to <sys/machtypes.h>.
  793. // CDDL HEADER START
  794. //
  795. // The contents of this file are subject to the terms of the
  796. // Common Development and Distribution License (the "License").
  797. // You may not use this file except in compliance with the License.
  798. //
  799. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  800. // or http://www.opensolaris.org/os/licensing.
  801. // See the License for the specific language governing permissions
  802. // and limitations under the License.
  803. //
  804. // When distributing Covered Code, include this CDDL HEADER in each
  805. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  806. // If applicable, add the following below this CDDL HEADER, with the
  807. // fields enclosed by brackets "[]" replaced with your own identifying
  808. // information: Portions Copyright [yyyy] [name of copyright owner]
  809. //
  810. // CDDL HEADER END
  811. // Copyright 2007 Sun Microsystems, Inc. All rights reserved.
  812. // Use is subject to license terms.
  813. // Machine dependent types:
  814. //
  815. // intel ia32 Version
  816. type X_label_t = struct{ Fval [8]int64 } /* machtypes.h:59:9 */
  817. // CDDL HEADER START
  818. //
  819. // The contents of this file are subject to the terms of the
  820. // Common Development and Distribution License, Version 1.0 only
  821. // (the "License"). You may not use this file except in compliance
  822. // with the License.
  823. //
  824. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  825. // or http://www.opensolaris.org/os/licensing.
  826. // See the License for the specific language governing permissions
  827. // and limitations under the License.
  828. //
  829. // When distributing Covered Code, include this CDDL HEADER in each
  830. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  831. // If applicable, add the following below this CDDL HEADER, with the
  832. // fields enclosed by brackets "[]" replaced with your own identifying
  833. // information: Portions Copyright [yyyy] [name of copyright owner]
  834. //
  835. // CDDL HEADER END
  836. // Copyright 2014 Garrett D'Amore <garrett@damore.org>
  837. // Copyright (c) 1988 AT&T
  838. // All Rights Reserved
  839. // utimbuf is used by utime(2)
  840. // CDDL HEADER START
  841. //
  842. // The contents of this file are subject to the terms of the
  843. // Common Development and Distribution License, Version 1.0 only
  844. // (the "License"). You may not use this file except in compliance
  845. // with the License.
  846. //
  847. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  848. // or http://www.opensolaris.org/os/licensing.
  849. // See the License for the specific language governing permissions
  850. // and limitations under the License.
  851. //
  852. // When distributing Covered Code, include this CDDL HEADER in each
  853. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  854. // If applicable, add the following below this CDDL HEADER, with the
  855. // fields enclosed by brackets "[]" replaced with your own identifying
  856. // information: Portions Copyright [yyyy] [name of copyright owner]
  857. //
  858. // CDDL HEADER END
  859. // Copyright 1997 Sun Microsystems, Inc. All rights reserved.
  860. // Use is subject to license terms.
  861. // Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  862. // All Rights Reserved
  863. // CDDL HEADER START
  864. //
  865. // The contents of this file are subject to the terms of the
  866. // Common Development and Distribution License (the "License").
  867. // You may not use this file except in compliance with the License.
  868. //
  869. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  870. // or http://www.opensolaris.org/os/licensing.
  871. // See the License for the specific language governing permissions
  872. // and limitations under the License.
  873. //
  874. // When distributing Covered Code, include this CDDL HEADER in each
  875. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  876. // If applicable, add the following below this CDDL HEADER, with the
  877. // fields enclosed by brackets "[]" replaced with your own identifying
  878. // information: Portions Copyright [yyyy] [name of copyright owner]
  879. //
  880. // CDDL HEADER END
  881. // Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  882. // All Rights Reserved
  883. // Copyright 2009 Sun Microsystems, Inc. All rights reserved.
  884. // Use is subject to license terms.
  885. //
  886. // Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  887. // Copyright 2016 Joyent, Inc.
  888. // Copyright 2021 Oxide Computer Company
  889. // DO NOT EDIT THIS FILE.
  890. //
  891. // It has been auto-edited by fixincludes from:
  892. //
  893. // "/usr/include/sys/feature_tests.h"
  894. //
  895. // This had to be done to correct non-standard usages in the
  896. // original, manufacturer supplied header file.
  897. // CDDL HEADER START
  898. //
  899. // The contents of this file are subject to the terms of the
  900. // Common Development and Distribution License (the "License").
  901. // You may not use this file except in compliance with the License.
  902. //
  903. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  904. // or http://www.opensolaris.org/os/licensing.
  905. // See the License for the specific language governing permissions
  906. // and limitations under the License.
  907. //
  908. // When distributing Covered Code, include this CDDL HEADER in each
  909. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  910. // If applicable, add the following below this CDDL HEADER, with the
  911. // fields enclosed by brackets "[]" replaced with your own identifying
  912. // information: Portions Copyright [yyyy] [name of copyright owner]
  913. //
  914. // CDDL HEADER END
  915. // Copyright 2013 Garrett D'Amore <garrett@damore.org>
  916. // Copyright 2016 Joyent, Inc.
  917. // Copyright 2022 Oxide Computer Company
  918. //
  919. // Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  920. // Use is subject to license terms.
  921. // CDDL HEADER START
  922. //
  923. // The contents of this file are subject to the terms of the
  924. // Common Development and Distribution License, Version 1.0 only
  925. // (the "License"). You may not use this file except in compliance
  926. // with the License.
  927. //
  928. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  929. // or http://www.opensolaris.org/os/licensing.
  930. // See the License for the specific language governing permissions
  931. // and limitations under the License.
  932. //
  933. // When distributing Covered Code, include this CDDL HEADER in each
  934. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  935. // If applicable, add the following below this CDDL HEADER, with the
  936. // fields enclosed by brackets "[]" replaced with your own identifying
  937. // information: Portions Copyright [yyyy] [name of copyright owner]
  938. //
  939. // CDDL HEADER END
  940. // Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  941. // Use is subject to license terms.
  942. // Copyright 2015 EveryCity Ltd. All rights reserved.
  943. // Copyright 2019 Joyent, Inc.
  944. // This file contains definitions designed to enable different compilers
  945. // to be used harmoniously on Solaris systems.
  946. // Allow for version tests for compiler bugs and features.
  947. // analogous to lint's PRINTFLIKEn
  948. // Handle the kernel printf routines that can take '%b' too
  949. // This one's pretty obvious -- the function never returns
  950. // The function is 'extern inline' and expects GNU C89 behaviour, not C99
  951. // behaviour.
  952. //
  953. // Should only be used on 'extern inline' definitions for GCC.
  954. // The function has control flow such that it may return multiple times (in
  955. // the manner of setjmp or vfork)
  956. // This is an appropriate label for functions that do not
  957. // modify their arguments, e.g. strlen()
  958. // This is a stronger form of __pure__. Can be used for functions
  959. // that do not modify their arguments and don't depend on global
  960. // memory.
  961. // This attribute, attached to a variable, means that the variable is meant to
  962. // be possibly unused. GCC will not produce a warning for this variable.
  963. // Shorthand versions for readability
  964. // In release build, disable warnings about variables
  965. // which are used only for debugging.
  966. // CDDL HEADER START
  967. //
  968. // The contents of this file are subject to the terms of the
  969. // Common Development and Distribution License (the "License").
  970. // You may not use this file except in compliance with the License.
  971. //
  972. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  973. // or http://www.opensolaris.org/os/licensing.
  974. // See the License for the specific language governing permissions
  975. // and limitations under the License.
  976. //
  977. //
  978. // When distributing Covered Code, include this CDDL HEADER in each
  979. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  980. // If applicable, add the following below this CDDL HEADER, with the
  981. // fields enclosed by brackets "[]" replaced with your own identifying
  982. // information: Portions Copyright [yyyy] [name of copyright owner]
  983. //
  984. // CDDL HEADER END
  985. // Copyright 2008 Sun Microsystems, Inc. All rights reserved.
  986. // Use is subject to license terms.
  987. // Copyright 2016 Joyent, Inc.
  988. // This header file serves to group a set of well known defines and to
  989. // set these for each instruction set architecture. These defines may
  990. // be divided into two groups; characteristics of the processor and
  991. // implementation choices for Solaris on a processor.
  992. //
  993. // Processor Characteristics:
  994. //
  995. // _LITTLE_ENDIAN / _BIG_ENDIAN:
  996. // The natural byte order of the processor. A pointer to an int points
  997. // to the least/most significant byte of that int.
  998. //
  999. // _STACK_GROWS_UPWARD / _STACK_GROWS_DOWNWARD:
  1000. // The processor specific direction of stack growth. A push onto the
  1001. // stack increases/decreases the stack pointer, so it stores data at
  1002. // successively higher/lower addresses. (Stackless machines ignored
  1003. // without regrets).
  1004. //
  1005. // _LONG_LONG_HTOL / _LONG_LONG_LTOH:
  1006. // A pointer to a long long points to the most/least significant long
  1007. // within that long long.
  1008. //
  1009. // _BIT_FIELDS_HTOL / _BIT_FIELDS_LTOH:
  1010. // The C compiler assigns bit fields from the high/low to the low/high end
  1011. // of an int (most to least significant vs. least to most significant).
  1012. //
  1013. // _IEEE_754:
  1014. // The processor (or supported implementations of the processor)
  1015. // supports the ieee-754 floating point standard. No other floating
  1016. // point standards are supported (or significant). Any other supported
  1017. // floating point formats are expected to be cased on the ISA processor
  1018. // symbol.
  1019. //
  1020. // _CHAR_IS_UNSIGNED / _CHAR_IS_SIGNED:
  1021. // The C Compiler implements objects of type `char' as `unsigned' or
  1022. // `signed' respectively. This is really an implementation choice of
  1023. // the compiler writer, but it is specified in the ABI and tends to
  1024. // be uniform across compilers for an instruction set architecture.
  1025. // Hence, it has the properties of a processor characteristic.
  1026. //
  1027. // _CHAR_ALIGNMENT / _SHORT_ALIGNMENT / _INT_ALIGNMENT / _LONG_ALIGNMENT /
  1028. // _LONG_LONG_ALIGNMENT / _DOUBLE_ALIGNMENT / _LONG_DOUBLE_ALIGNMENT /
  1029. // _POINTER_ALIGNMENT / _FLOAT_ALIGNMENT:
  1030. // The ABI defines alignment requirements of each of the primitive
  1031. // object types. Some, if not all, may be hardware requirements as
  1032. // well. The values are expressed in "byte-alignment" units.
  1033. //
  1034. // _MAX_ALIGNMENT:
  1035. // The most stringent alignment requirement as specified by the ABI.
  1036. // Equal to the maximum of all the above _XXX_ALIGNMENT values.
  1037. //
  1038. // _MAX_ALIGNMENT_TYPE:
  1039. // The name of the C type that has the value descried in _MAX_ALIGNMENT.
  1040. //
  1041. // _ALIGNMENT_REQUIRED:
  1042. // True or false (1 or 0) whether or not the hardware requires the ABI
  1043. // alignment.
  1044. //
  1045. // _LONG_LONG_ALIGNMENT_32
  1046. // The 32-bit ABI supported by a 64-bit kernel may have different
  1047. // alignment requirements for primitive object types. The value of this
  1048. // identifier is expressed in "byte-alignment" units.
  1049. //
  1050. // _HAVE_CPUID_INSN
  1051. // This indicates that the architecture supports the 'cpuid'
  1052. // instruction as defined by Intel. (Intel allows other vendors
  1053. // to extend the instruction for their own purposes.)
  1054. //
  1055. //
  1056. // Implementation Choices:
  1057. //
  1058. // _ILP32 / _LP64:
  1059. // This specifies the compiler data type implementation as specified in
  1060. // the relevant ABI. The choice between these is strongly influenced
  1061. // by the underlying hardware, but is not absolutely tied to it.
  1062. // Currently only two data type models are supported:
  1063. //
  1064. // _ILP32:
  1065. // Int/Long/Pointer are 32 bits. This is the historical UNIX
  1066. // and Solaris implementation. Due to its historical standing,
  1067. // this is the default case.
  1068. //
  1069. // _LP64:
  1070. // Long/Pointer are 64 bits, Int is 32 bits. This is the chosen
  1071. // implementation for 64-bit ABIs such as SPARC V9.
  1072. //
  1073. // _I32LPx:
  1074. // A compilation environment where 'int' is 32-bit, and
  1075. // longs and pointers are simply the same size.
  1076. //
  1077. // In all cases, Char is 8 bits and Short is 16 bits.
  1078. //
  1079. // _SUNOS_VTOC_8 / _SUNOS_VTOC_16 / _SVR4_VTOC_16:
  1080. // This specifies the form of the disk VTOC (or label):
  1081. //
  1082. // _SUNOS_VTOC_8:
  1083. // This is a VTOC form which is upwardly compatible with the
  1084. // SunOS 4.x disk label and allows 8 partitions per disk.
  1085. //
  1086. // _SUNOS_VTOC_16:
  1087. // In this format the incore vtoc image matches the ondisk
  1088. // version. It allows 16 slices per disk, and is not
  1089. // compatible with the SunOS 4.x disk label.
  1090. //
  1091. // Note that these are not the only two VTOC forms possible and
  1092. // additional forms may be added. One possible form would be the
  1093. // SVr4 VTOC form. The symbol for that is reserved now, although
  1094. // it is not implemented.
  1095. //
  1096. // _SVR4_VTOC_16:
  1097. // This VTOC form is compatible with the System V Release 4
  1098. // VTOC (as implemented on the SVr4 Intel and 3b ports) with
  1099. // 16 partitions per disk.
  1100. //
  1101. //
  1102. // _DMA_USES_PHYSADDR / _DMA_USES_VIRTADDR
  1103. // This describes the type of addresses used by system DMA:
  1104. //
  1105. // _DMA_USES_PHYSADDR:
  1106. // This type of DMA, used in the x86 implementation,
  1107. // requires physical addresses for DMA buffers. The 24-bit
  1108. // addresses used by some legacy boards is the source of the
  1109. // "low-memory" (<16MB) requirement for some devices using DMA.
  1110. //
  1111. // _DMA_USES_VIRTADDR:
  1112. // This method of DMA allows the use of virtual addresses for
  1113. // DMA transfers.
  1114. //
  1115. // _FIRMWARE_NEEDS_FDISK / _NO_FDISK_PRESENT
  1116. // This indicates the presence/absence of an fdisk table.
  1117. //
  1118. // _FIRMWARE_NEEDS_FDISK
  1119. // The fdisk table is required by system firmware. If present,
  1120. // it allows a disk to be subdivided into multiple fdisk
  1121. // partitions, each of which is equivalent to a separate,
  1122. // virtual disk. This enables the co-existence of multiple
  1123. // operating systems on a shared hard disk.
  1124. //
  1125. // _NO_FDISK_PRESENT
  1126. // If the fdisk table is absent, it is assumed that the entire
  1127. // media is allocated for a single operating system.
  1128. //
  1129. // _HAVE_TEM_FIRMWARE
  1130. // Defined if this architecture has the (fallback) option of
  1131. // using prom_* calls for doing I/O if a suitable kernel driver
  1132. // is not available to do it.
  1133. //
  1134. // _DONT_USE_1275_GENERIC_NAMES
  1135. // Controls whether or not device tree node names should
  1136. // comply with the IEEE 1275 "Generic Names" Recommended
  1137. // Practice. With _DONT_USE_GENERIC_NAMES, device-specific
  1138. // names identifying the particular device will be used.
  1139. //
  1140. // __i386_COMPAT
  1141. // This indicates whether the i386 ABI is supported as a *non-native*
  1142. // mode for the platform. When this symbol is defined:
  1143. // - 32-bit xstat-style system calls are enabled
  1144. // - 32-bit xmknod-style system calls are enabled
  1145. // - 32-bit system calls use i386 sizes -and- alignments
  1146. //
  1147. // Note that this is NOT defined for the i386 native environment!
  1148. //
  1149. // __x86
  1150. // This is ONLY a synonym for defined(__i386) || defined(__amd64)
  1151. // which is useful only insofar as these two architectures share
  1152. // common attributes. Analogous to __sparc.
  1153. //
  1154. // _PSM_MODULES
  1155. // This indicates whether or not the implementation uses PSM
  1156. // modules for processor support, reading /etc/mach from inside
  1157. // the kernel to extract a list.
  1158. //
  1159. // _RTC_CONFIG
  1160. // This indicates whether or not the implementation uses /etc/rtc_config
  1161. // to configure the real-time clock in the kernel.
  1162. //
  1163. // _UNIX_KRTLD
  1164. // This indicates that the implementation uses a dynamically
  1165. // linked unix + krtld to form the core kernel image at boot
  1166. // time, or (in the absence of this symbol) a prelinked kernel image.
  1167. //
  1168. // _OBP
  1169. // This indicates the firmware interface is OBP.
  1170. //
  1171. // _SOFT_HOSTID
  1172. // This indicates that the implementation obtains the hostid
  1173. // from the file /etc/hostid, rather than from hardware.
  1174. // The following set of definitions characterize Solaris on AMD's
  1175. // 64-bit systems.
  1176. // Define the appropriate "processor characteristics"
  1177. // Different alignment constraints for the i386 ABI in compatibility mode
  1178. // Define the appropriate "implementation choices".
  1179. // The feature test macro __i386 is generic for all processors implementing
  1180. // the Intel 386 instruction set or a superset of it. Specifically, this
  1181. // includes all members of the 386, 486, and Pentium family of processors.
  1182. // Values of _POSIX_C_SOURCE
  1183. //
  1184. // undefined not a POSIX compilation
  1185. // 1 POSIX.1-1990 compilation
  1186. // 2 POSIX.2-1992 compilation
  1187. // 199309L POSIX.1b-1993 compilation (Real Time)
  1188. // 199506L POSIX.1c-1995 compilation (POSIX Threads)
  1189. // 200112L POSIX.1-2001 compilation (Austin Group Revision)
  1190. // 200809L POSIX.1-2008 compilation
  1191. // The feature test macros __XOPEN_OR_POSIX, _STRICT_STDC, _STRICT_SYMBOLS,
  1192. // and _STDC_C99 are Sun implementation specific macros created in order to
  1193. // compress common standards specified feature test macros for easier reading.
  1194. // These macros should not be used by the application developer as
  1195. // unexpected results may occur. Instead, the user should reference
  1196. // standards(7) for correct usage of the standards feature test macros.
  1197. //
  1198. // __XOPEN_OR_POSIX Used in cases where a symbol is defined by both
  1199. // X/Open or POSIX or in the negative, when neither
  1200. // X/Open or POSIX defines a symbol.
  1201. //
  1202. // _STRICT_STDC __STDC__ is specified by the C Standards and defined
  1203. // by the compiler. For Sun compilers the value of
  1204. // __STDC__ is either 1, 0, or not defined based on the
  1205. // compilation mode (see cc(1)). When the value of
  1206. // __STDC__ is 1 and in the absence of any other feature
  1207. // test macros, the namespace available to the application
  1208. // is limited to only those symbols defined by the C
  1209. // Standard. _STRICT_STDC provides a more readable means
  1210. // of identifying symbols defined by the standard, or in
  1211. // the negative, symbols that are extensions to the C
  1212. // Standard. See additional comments for GNU C differences.
  1213. //
  1214. // _STDC_C99 __STDC_VERSION__ is specified by the C standards and
  1215. // defined by the compiler and indicates the version of
  1216. // the C standard. A value of 199901L indicates a
  1217. // compiler that complies with ISO/IEC 9899:1999, other-
  1218. // wise known as the C99 standard.
  1219. //
  1220. // _STDC_C11 Like _STDC_C99 except that the value of __STDC_VERSION__
  1221. // is 201112L indicating a compiler that compiles with
  1222. // ISO/IEC 9899:2011, otherwise known as the C11 standard.
  1223. //
  1224. // _STRICT_SYMBOLS Used in cases where symbol visibility is restricted
  1225. // by the standards, and the user has not explicitly
  1226. // relaxed the strictness via __EXTENSIONS__.
  1227. // ISO/IEC 9899:1990 and it's revisions, ISO/IEC 9899:1999 and ISO/IEC
  1228. // 99899:2011 specify the following predefined macro name:
  1229. //
  1230. // __STDC__ The integer constant 1, intended to indicate a conforming
  1231. // implementation.
  1232. //
  1233. // Furthermore, a strictly conforming program shall use only those features
  1234. // of the language and library specified in these standards. A conforming
  1235. // implementation shall accept any strictly conforming program.
  1236. //
  1237. // Based on these requirements, Sun's C compiler defines __STDC__ to 1 for
  1238. // strictly conforming environments and __STDC__ to 0 for environments that
  1239. // use ANSI C semantics but allow extensions to the C standard. For non-ANSI
  1240. // C semantics, Sun's C compiler does not define __STDC__.
  1241. //
  1242. // The GNU C project interpretation is that __STDC__ should always be defined
  1243. // to 1 for compilation modes that accept ANSI C syntax regardless of whether
  1244. // or not extensions to the C standard are used. Violations of conforming
  1245. // behavior are conditionally flagged as warnings via the use of the
  1246. // -pedantic option. In addition to defining __STDC__ to 1, the GNU C
  1247. // compiler also defines __STRICT_ANSI__ as a means of specifying strictly
  1248. // conforming environments using the -ansi or -std=<standard> options.
  1249. //
  1250. // In the absence of any other compiler options, Sun and GNU set the value
  1251. // of __STDC__ as follows when using the following options:
  1252. //
  1253. // Value of __STDC__ __STRICT_ANSI__
  1254. //
  1255. // cc -Xa (default) 0 undefined
  1256. // cc -Xt (transitional) 0 undefined
  1257. // cc -Xc (strictly conforming) 1 undefined
  1258. // cc -Xs (K&R C) undefined undefined
  1259. //
  1260. // gcc (default) 1 undefined
  1261. // gcc -ansi, -std={c89, c99,...) 1 defined
  1262. // gcc -traditional (K&R) undefined undefined
  1263. //
  1264. // The default compilation modes for Sun C compilers versus GNU C compilers
  1265. // results in a differing value for __STDC__ which results in a more
  1266. // restricted namespace when using Sun compilers. To allow both GNU and Sun
  1267. // interpretations to peacefully co-exist, we use the following Sun
  1268. // implementation _STRICT_STDC_ macro:
  1269. // Compiler complies with ISO/IEC 9899:1999 or ISO/IEC 9989:2011
  1270. // Use strict symbol visibility.
  1271. // This is a variant of _STRICT_SYMBOLS that is meant to cover headers that are
  1272. // governed by POSIX, but have not been governed by ISO C. One can go two ways
  1273. // on what should happen if an application actively includes (not transitively)
  1274. // a header that isn't part of the ISO C spec, we opt to say that if someone has
  1275. // gone out of there way then they're doing it for a reason and that is an act
  1276. // of non-compliance and therefore it's not up to us to hide away every symbol.
  1277. //
  1278. // In general, prefer using _STRICT_SYMBOLS, but this is here in particular for
  1279. // cases where in the past we have only used a POSIX related check and we don't
  1280. // wish to make something stricter. Often applications are relying on the
  1281. // ability to, or more realistically unwittingly, have _STRICT_STDC declared and
  1282. // still use these interfaces.
  1283. // Large file interfaces:
  1284. //
  1285. // _LARGEFILE_SOURCE
  1286. // 1 large file-related additions to POSIX
  1287. // interfaces requested (fseeko, etc.)
  1288. // _LARGEFILE64_SOURCE
  1289. // 1 transitional large-file-related interfaces
  1290. // requested (seek64, stat64, etc.)
  1291. //
  1292. // The corresponding announcement macros are respectively:
  1293. // _LFS_LARGEFILE
  1294. // _LFS64_LARGEFILE
  1295. // (These are set in <unistd.h>.)
  1296. //
  1297. // Requesting _LARGEFILE64_SOURCE implies requesting _LARGEFILE_SOURCE as
  1298. // well.
  1299. //
  1300. // The large file interfaces are made visible regardless of the initial values
  1301. // of the feature test macros under certain circumstances:
  1302. // - If no explicit standards-conforming environment is requested (neither
  1303. // of _POSIX_SOURCE nor _XOPEN_SOURCE is defined and the value of
  1304. // __STDC__ does not imply standards conformance).
  1305. // - Extended system interfaces are explicitly requested (__EXTENSIONS__
  1306. // is defined).
  1307. // - Access to in-kernel interfaces is requested (_KERNEL or _KMEMUSER is
  1308. // defined). (Note that this dependency is an artifact of the current
  1309. // kernel implementation and may change in future releases.)
  1310. // Large file compilation environment control:
  1311. //
  1312. // The setting of _FILE_OFFSET_BITS controls the size of various file-related
  1313. // types and governs the mapping between file-related source function symbol
  1314. // names and the corresponding binary entry points.
  1315. //
  1316. // In the 32-bit environment, the default value is 32; if not set, set it to
  1317. // the default here, to simplify tests in other headers.
  1318. //
  1319. // In the 64-bit compilation environment, the only value allowed is 64.
  1320. // Use of _XOPEN_SOURCE
  1321. //
  1322. // The following X/Open specifications are supported:
  1323. //
  1324. // X/Open Portability Guide, Issue 3 (XPG3)
  1325. // X/Open CAE Specification, Issue 4 (XPG4)
  1326. // X/Open CAE Specification, Issue 4, Version 2 (XPG4v2)
  1327. // X/Open CAE Specification, Issue 5 (XPG5)
  1328. // Open Group Technical Standard, Issue 6 (XPG6), also referred to as
  1329. // IEEE Std. 1003.1-2001 and ISO/IEC 9945:2002.
  1330. // Open Group Technical Standard, Issue 7 (XPG7), also referred to as
  1331. // IEEE Std. 1003.1-2008 and ISO/IEC 9945:2009.
  1332. //
  1333. // XPG4v2 is also referred to as UNIX 95 (SUS or SUSv1).
  1334. // XPG5 is also referred to as UNIX 98 or the Single Unix Specification,
  1335. // Version 2 (SUSv2)
  1336. // XPG6 is the result of a merge of the X/Open and POSIX specifications
  1337. // and as such is also referred to as IEEE Std. 1003.1-2001 in
  1338. // addition to UNIX 03 and SUSv3.
  1339. // XPG7 is also referred to as UNIX 08 and SUSv4.
  1340. //
  1341. // When writing a conforming X/Open application, as per the specification
  1342. // requirements, the appropriate feature test macros must be defined at
  1343. // compile time. These are as follows. For more info, see standards(7).
  1344. //
  1345. // Feature Test Macro Specification
  1346. // ------------------------------------------------ -------------
  1347. // _XOPEN_SOURCE XPG3
  1348. // _XOPEN_SOURCE && _XOPEN_VERSION = 4 XPG4
  1349. // _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1 XPG4v2
  1350. // _XOPEN_SOURCE = 500 XPG5
  1351. // _XOPEN_SOURCE = 600 (or POSIX_C_SOURCE=200112L) XPG6
  1352. // _XOPEN_SOURCE = 700 (or POSIX_C_SOURCE=200809L) XPG7
  1353. //
  1354. // In order to simplify the guards within the headers, the following
  1355. // implementation private test macros have been created. Applications
  1356. // must NOT use these private test macros as unexpected results will
  1357. // occur.
  1358. //
  1359. // Note that in general, the use of these private macros is cumulative.
  1360. // For example, the use of _XPG3 with no other restrictions on the X/Open
  1361. // namespace will make the symbols visible for XPG3 through XPG6
  1362. // compilation environments. The use of _XPG4_2 with no other X/Open
  1363. // namespace restrictions indicates that the symbols were introduced in
  1364. // XPG4v2 and are therefore visible for XPG4v2 through XPG6 compilation
  1365. // environments, but not for XPG3 or XPG4 compilation environments.
  1366. //
  1367. // _XPG3 X/Open Portability Guide, Issue 3 (XPG3)
  1368. // _XPG4 X/Open CAE Specification, Issue 4 (XPG4)
  1369. // _XPG4_2 X/Open CAE Specification, Issue 4, Version 2 (XPG4v2/UNIX 95/SUS)
  1370. // _XPG5 X/Open CAE Specification, Issue 5 (XPG5/UNIX 98/SUSv2)
  1371. // _XPG6 Open Group Technical Standard, Issue 6 (XPG6/UNIX 03/SUSv3)
  1372. // _XPG7 Open Group Technical Standard, Issue 7 (XPG7/UNIX 08/SUSv4)
  1373. // X/Open Portability Guide, Issue 3
  1374. // _XOPEN_VERSION is defined by the X/Open specifications and is not
  1375. // normally defined by the application, except in the case of an XPG4
  1376. // application. On the implementation side, _XOPEN_VERSION defined with
  1377. // the value of 3 indicates an XPG3 application. _XOPEN_VERSION defined
  1378. // with the value of 4 indicates an XPG4 or XPG4v2 (UNIX 95) application.
  1379. // _XOPEN_VERSION defined with a value of 500 indicates an XPG5 (UNIX 98)
  1380. // application and with a value of 600 indicates an XPG6 (UNIX 03)
  1381. // application and with a value of 700 indicates an XPG7 (UNIX 08).
  1382. // The appropriate version is determined by the use of the
  1383. // feature test macros described earlier. The value of _XOPEN_VERSION
  1384. // defaults to 3 otherwise indicating support for XPG3 applications.
  1385. // ANSI C and ISO 9899:1990 say the type long long doesn't exist in strictly
  1386. // conforming environments. ISO 9899:1999 says it does.
  1387. //
  1388. // The presence of _LONGLONG_TYPE says "long long exists" which is therefore
  1389. // defined in all but strictly conforming environments that disallow it.
  1390. // The following macro defines a value for the ISO C99 restrict
  1391. // keyword so that _RESTRICT_KYWD resolves to "restrict" if
  1392. // an ISO C99 compiler is used, "__restrict" for c++ and "" (null string)
  1393. // if any other compiler is used. This allows for the use of single
  1394. // prototype declarations regardless of compiler version.
  1395. // The following macro defines a value for the ISO C11 _Noreturn
  1396. // keyword so that _NORETURN_KYWD resolves to "_Noreturn" if
  1397. // an ISO C11 compiler is used and "" (null string) if any other
  1398. // compiler is used. This allows for the use of single prototype
  1399. // declarations regardless of compiler version.
  1400. // ISO/IEC 9899:2011 Annex K
  1401. // The following macro indicates header support for the ANSI C++
  1402. // standard. The ISO/IEC designation for this is ISO/IEC FDIS 14882.
  1403. // The following macro indicates header support for the C99 standard,
  1404. // ISO/IEC 9899:1999, Programming Languages - C.
  1405. // The following macro indicates header support for the C11 standard,
  1406. // ISO/IEC 9899:2011, Programming Languages - C.
  1407. // The following macro indicates header support for the C11 standard,
  1408. // ISO/IEC 9899:2011 Annex K, Programming Languages - C.
  1409. // The following macro indicates header support for DTrace. The value is an
  1410. // integer that corresponds to the major version number for DTrace.
  1411. // CDDL HEADER START
  1412. //
  1413. // The contents of this file are subject to the terms of the
  1414. // Common Development and Distribution License (the "License").
  1415. // You may not use this file except in compliance with the License.
  1416. //
  1417. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  1418. // or http://www.opensolaris.org/os/licensing.
  1419. // See the License for the specific language governing permissions
  1420. // and limitations under the License.
  1421. //
  1422. //
  1423. // When distributing Covered Code, include this CDDL HEADER in each
  1424. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  1425. // If applicable, add the following below this CDDL HEADER, with the
  1426. // fields enclosed by brackets "[]" replaced with your own identifying
  1427. // information: Portions Copyright [yyyy] [name of copyright owner]
  1428. //
  1429. // CDDL HEADER END
  1430. // Copyright 2008 Sun Microsystems, Inc. All rights reserved.
  1431. // Use is subject to license terms.
  1432. // Copyright 2016 Joyent, Inc.
  1433. // Machine dependent definitions moved to <sys/machtypes.h>.
  1434. // CDDL HEADER START
  1435. //
  1436. // The contents of this file are subject to the terms of the
  1437. // Common Development and Distribution License (the "License").
  1438. // You may not use this file except in compliance with the License.
  1439. //
  1440. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  1441. // or http://www.opensolaris.org/os/licensing.
  1442. // See the License for the specific language governing permissions
  1443. // and limitations under the License.
  1444. //
  1445. // When distributing Covered Code, include this CDDL HEADER in each
  1446. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  1447. // If applicable, add the following below this CDDL HEADER, with the
  1448. // fields enclosed by brackets "[]" replaced with your own identifying
  1449. // information: Portions Copyright [yyyy] [name of copyright owner]
  1450. //
  1451. // CDDL HEADER END
  1452. // Copyright 2007 Sun Microsystems, Inc. All rights reserved.
  1453. // Use is subject to license terms.
  1454. // Machine dependent types:
  1455. //
  1456. // intel ia32 Version
  1457. type Label_t = X_label_t /* machtypes.h:59:54 */
  1458. type Lock_t = uint8 /* machtypes.h:63:23 */ // lock work for busy wait
  1459. // Include fixed width type declarations proposed by the ISO/JTC1/SC22/WG14 C
  1460. // committee's working draft for the revision of the current ISO C standard,
  1461. // ISO/IEC 9899:1990 Programming language - C. These are not currently
  1462. // required by any standard but constitute a useful, general purpose set
  1463. // of type definitions which is namespace clean with respect to all standards.
  1464. // CDDL HEADER START
  1465. //
  1466. // The contents of this file are subject to the terms of the
  1467. // Common Development and Distribution License, Version 1.0 only
  1468. // (the "License"). You may not use this file except in compliance
  1469. // with the License.
  1470. //
  1471. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  1472. // or http://www.opensolaris.org/os/licensing.
  1473. // See the License for the specific language governing permissions
  1474. // and limitations under the License.
  1475. //
  1476. // When distributing Covered Code, include this CDDL HEADER in each
  1477. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  1478. // If applicable, add the following below this CDDL HEADER, with the
  1479. // fields enclosed by brackets "[]" replaced with your own identifying
  1480. // information: Portions Copyright [yyyy] [name of copyright owner]
  1481. //
  1482. // CDDL HEADER END
  1483. // Copyright 2014 Garrett D'Amore <garrett@damore.org>
  1484. //
  1485. // Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  1486. // Use is subject to license terms.
  1487. // This file, <sys/int_types.h>, is part of the Sun Microsystems implementation
  1488. // of <inttypes.h> defined in the ISO C standard, ISO/IEC 9899:1999
  1489. // Programming language - C.
  1490. //
  1491. // Programs/Modules should not directly include this file. Access to the
  1492. // types defined in this file should be through the inclusion of one of the
  1493. // following files:
  1494. //
  1495. // <sys/types.h> Provides only the "_t" types defined in this
  1496. // file which is a subset of the contents of
  1497. // <inttypes.h>. (This can be appropriate for
  1498. // all programs/modules except those claiming
  1499. // ANSI-C conformance.)
  1500. //
  1501. // <sys/inttypes.h> Provides the Kernel and Driver appropriate
  1502. // components of <inttypes.h>.
  1503. //
  1504. // <inttypes.h> For use by applications.
  1505. //
  1506. // See these files for more details.
  1507. // DO NOT EDIT THIS FILE.
  1508. //
  1509. // It has been auto-edited by fixincludes from:
  1510. //
  1511. // "/usr/include/sys/feature_tests.h"
  1512. //
  1513. // This had to be done to correct non-standard usages in the
  1514. // original, manufacturer supplied header file.
  1515. // CDDL HEADER START
  1516. //
  1517. // The contents of this file are subject to the terms of the
  1518. // Common Development and Distribution License (the "License").
  1519. // You may not use this file except in compliance with the License.
  1520. //
  1521. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  1522. // or http://www.opensolaris.org/os/licensing.
  1523. // See the License for the specific language governing permissions
  1524. // and limitations under the License.
  1525. //
  1526. // When distributing Covered Code, include this CDDL HEADER in each
  1527. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  1528. // If applicable, add the following below this CDDL HEADER, with the
  1529. // fields enclosed by brackets "[]" replaced with your own identifying
  1530. // information: Portions Copyright [yyyy] [name of copyright owner]
  1531. //
  1532. // CDDL HEADER END
  1533. // Copyright 2013 Garrett D'Amore <garrett@damore.org>
  1534. // Copyright 2016 Joyent, Inc.
  1535. // Copyright 2022 Oxide Computer Company
  1536. //
  1537. // Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  1538. // Use is subject to license terms.
  1539. // Basic / Extended integer types
  1540. //
  1541. // The following defines the basic fixed-size integer types.
  1542. //
  1543. // Implementations are free to typedef them to Standard C integer types or
  1544. // extensions that they support. If an implementation does not support one
  1545. // of the particular integer data types below, then it should not define the
  1546. // typedefs and macros corresponding to that data type. Note that int8_t
  1547. // is not defined in -Xs mode on ISAs for which the ABI specifies "char"
  1548. // as an unsigned entity because there is no way to define an eight bit
  1549. // signed integral.
  1550. type Int8_t = int8 /* int_types.h:75:16 */
  1551. type Int16_t = int16 /* int_types.h:79:17 */
  1552. type Int32_t = int32 /* int_types.h:80:15 */
  1553. type Int64_t = int64 /* int_types.h:83:16 */
  1554. type Uint8_t = uint8 /* int_types.h:91:24 */
  1555. type Uint16_t = uint16 /* int_types.h:92:25 */
  1556. type Uint32_t = uint32 /* int_types.h:93:23 */
  1557. type Uint64_t = uint64 /* int_types.h:95:24 */
  1558. // intmax_t and uintmax_t are to be the longest (in number of bits) signed
  1559. // and unsigned integer types supported by the implementation.
  1560. type Intmax_t = int64 /* int_types.h:107:19 */
  1561. type Uintmax_t = uint64 /* int_types.h:108:19 */
  1562. // intptr_t and uintptr_t are signed and unsigned integer types large enough
  1563. // to hold any data pointer; that is, data pointers can be assigned into or
  1564. // from these integer types without losing precision.
  1565. type Intptr_t = int64 /* int_types.h:120:16 */
  1566. type Uintptr_t = uint64 /* int_types.h:121:24 */
  1567. // The following define the fastest integer types that can hold the
  1568. // specified number of bits.
  1569. type Int_fast8_t = int8 /* int_types.h:132:16 */
  1570. type Int_fast16_t = int32 /* int_types.h:136:15 */
  1571. type Int_fast32_t = int32 /* int_types.h:137:15 */
  1572. type Int_fast64_t = int64 /* int_types.h:139:16 */
  1573. type Uint_fast8_t = uint8 /* int_types.h:146:24 */
  1574. type Uint_fast16_t = uint32 /* int_types.h:147:23 */
  1575. type Uint_fast32_t = uint32 /* int_types.h:148:23 */
  1576. type Uint_fast64_t = uint64 /* int_types.h:150:24 */
  1577. // The following define the smallest integer types that can hold the
  1578. // specified number of bits.
  1579. type Int_least8_t = int8 /* int_types.h:162:16 */
  1580. type Int_least16_t = int16 /* int_types.h:166:17 */
  1581. type Int_least32_t = int32 /* int_types.h:167:15 */
  1582. type Int_least64_t = int64 /* int_types.h:169:16 */
  1583. // If these are changed, please update char16_t and char32_t in head/uchar.h.
  1584. type Uint_least8_t = uint8 /* int_types.h:179:24 */
  1585. type Uint_least16_t = uint16 /* int_types.h:180:25 */
  1586. type Uint_least32_t = uint32 /* int_types.h:181:23 */
  1587. type Uint_least64_t = uint64 /* int_types.h:183:24 */
  1588. // Strictly conforming ANSI C environments prior to the 1999
  1589. // revision of the C Standard (ISO/IEC 9899:1999) do not have
  1590. // the long long data type.
  1591. type Longlong_t = int64 /* types.h:72:20 */
  1592. type U_longlong_t = uint64 /* types.h:73:28 */
  1593. // These types (t_{u}scalar_t) exist because the XTI/TPI/DLPI standards had
  1594. // to use them instead of int32_t and uint32_t because DEC had
  1595. // shipped 64-bit wide.
  1596. type T_scalar_t = int32 /* types.h:92:18 */
  1597. type T_uscalar_t = uint32 /* types.h:93:18 */
  1598. // POSIX Extensions
  1599. type Uchar_t = uint8 /* types.h:102:23 */
  1600. type Ushort_t = uint16 /* types.h:103:24 */
  1601. type Uint_t = uint32 /* types.h:104:22 */
  1602. type Ulong_t = uint64 /* types.h:105:23 */
  1603. type Caddr_t = uintptr /* types.h:107:15 */ // ?<core address> type
  1604. type Daddr_t = int64 /* types.h:108:15 */ // <disk address> type
  1605. type Cnt_t = int16 /* types.h:109:16 */ // pointer difference
  1606. // VM-related types
  1607. type Pfn_t = uint64 /* types.h:123:18 */ // page frame number
  1608. type Pgcnt_t = uint64 /* types.h:124:18 */ // number of pages
  1609. type Spgcnt_t = int64 /* types.h:125:15 */ // signed number of pages
  1610. type Use_t = uint8 /* types.h:127:18 */ // use count for swap.
  1611. type Sysid_t = int16 /* types.h:128:16 */
  1612. type Index_t = int16 /* types.h:129:16 */
  1613. type Timeout_id_t = uintptr /* types.h:130:15 */ // opaque handle from timeout(9F)
  1614. type Bufcall_id_t = uintptr /* types.h:131:15 */ // opaque handle from bufcall(9F)
  1615. // The size of off_t and related types depends on the setting of
  1616. // _FILE_OFFSET_BITS. (Note that other system headers define other types
  1617. // related to those defined here.)
  1618. //
  1619. // If _LARGEFILE64_SOURCE is defined, variants of these types that are
  1620. // explicitly 64 bits wide become available.
  1621. type Off_t = int64 /* types.h:145:15 */ // offsets within files
  1622. type Off64_t = int64 /* types.h:152:16 */ // offsets within files
  1623. type Ino_t = uint64 /* types.h:161:18 */ // expanded inode type
  1624. type Blkcnt_t = int64 /* types.h:162:15 */ // count of file blocks
  1625. type Fsblkcnt_t = uint64 /* types.h:163:18 */ // count of file system blocks
  1626. type Fsfilcnt_t = uint64 /* types.h:164:18 */ // count of files
  1627. type Ino64_t = uint64 /* types.h:174:16 */ // expanded inode type
  1628. type Blkcnt64_t = int64 /* types.h:175:18 */ // count of file blocks
  1629. type Fsblkcnt64_t = uint64 /* types.h:176:20 */ // count of file system blocks
  1630. type Fsfilcnt64_t = uint64 /* types.h:177:20 */ // count of files
  1631. type Blksize_t = int32 /* types.h:187:14 */ // used for block sizes
  1632. // The boolean_t type has had a varied amount of exposure over the years in
  1633. // terms of how its enumeration constants have been exposed. In particular, it
  1634. // originally used the __XOPEN_OR_POSIX macro to determine whether to prefix the
  1635. // B_TRUE and B_FALSE with an underscore. This check never included the
  1636. // question of if we were in a strict ANSI C environment or whether extensions
  1637. // were defined.
  1638. //
  1639. // Compilers such as clang started defaulting to always including an
  1640. // XOPEN_SOURCE declaration on behalf of users, but also noted __EXTENSIONS__.
  1641. // This would lead most software that had used the non-underscore versions to
  1642. // need it. As such, we have adjusted the non-strict XOPEN environment to retain
  1643. // its old behavior so as to minimize namespace pollution; however, we instead
  1644. // include both variants of the definitions in the generally visible version
  1645. // allowing software written in either world to hopefully end up in a good
  1646. // place.
  1647. //
  1648. // This isn't perfect, but should hopefully minimize the pain for folks actually
  1649. // trying to build software.
  1650. type Boolean_t = uint32 /* types.h:215:69 */
  1651. // The {u,}pad64_t types can be used in structures such that those structures
  1652. // may be accessed by code produced by compilation environments which don't
  1653. // support a 64 bit integral datatype. The intention is not to allow
  1654. // use of these fields in such environments, but to maintain the alignment
  1655. // and offsets of the structure.
  1656. //
  1657. // Similar comments for {u,}pad128_t.
  1658. //
  1659. // Note that these types do NOT generate any stronger alignment constraints
  1660. // than those available in the underlying ABI. See <sys/isa_defs.h>
  1661. type Pad64_t = int64 /* types.h:240:18 */
  1662. type Upad64_t = uint64 /* types.h:241:18 */
  1663. type Pad128_t = struct {
  1664. F_q float64
  1665. F__ccgo_pad1 [8]byte
  1666. } /* types.h:257:3 */
  1667. type Upad128_t = struct {
  1668. F_q float64
  1669. F__ccgo_pad1 [8]byte
  1670. } /* types.h:262:3 */
  1671. type Offset_t = int64 /* types.h:264:20 */
  1672. type U_offset_t = uint64 /* types.h:265:22 */
  1673. type Len_t = uint64 /* types.h:266:22 */
  1674. type Diskaddr_t = uint64 /* types.h:267:22 */
  1675. // Definitions remaining from previous partial support for 64-bit file
  1676. // offsets. This partial support for devices greater than 2gb requires
  1677. // compiler support for long long.
  1678. type Lloff_t = struct{ F_f int64 } /* types.h:284:3 */
  1679. type Lldaddr_t = struct{ F_f int64 } /* types.h:304:3 */
  1680. type K_fltset_t = uint32 /* types.h:317:16 */ // kernel fault set type
  1681. // The following type is for various kinds of identifiers. The
  1682. // actual type must be the same for all since some system calls
  1683. // (such as sigsend) take arguments that may be any of these
  1684. // types. The enumeration type idtype_t defined in sys/procset.h
  1685. // is used to indicate what type of id is being specified --
  1686. // a process id, process group id, session id, scheduling class id,
  1687. // user id, group id, project id, task id or zone id.
  1688. type Id_t = int32 /* types.h:329:14 */
  1689. type Lgrp_id_t = int32 /* types.h:334:15 */ // lgroup ID
  1690. // Type useconds_t is an unsigned integral type capable of storing
  1691. // values at least in the range of zero to 1,000,000.
  1692. type Useconds_t = uint32 /* types.h:340:17 */ // Time, in microseconds
  1693. type Suseconds_t = int64 /* types.h:344:14 */ // signed # of microseconds
  1694. // Typedefs for dev_t components.
  1695. type Major_t = uint32 /* types.h:351:16 */ // major part of device number
  1696. type Minor_t = uint32 /* types.h:352:16 */ // minor part of device number
  1697. // The data type of a thread priority.
  1698. type Pri_t = int16 /* types.h:361:15 */
  1699. // The data type for a CPU flags field. (Can be extended to larger unsigned
  1700. // types, if needed, limited by ability to update atomically.)
  1701. type Cpu_flag_t = uint16 /* types.h:367:18 */
  1702. // For compatibility reasons the following typedefs (prefixed o_)
  1703. // can't grow regardless of the EFT definition. Although,
  1704. // applications should not explicitly use these typedefs
  1705. // they may be included via a system header definition.
  1706. // WARNING: These typedefs may be removed in a future
  1707. // release.
  1708. //
  1709. // ex. the definitions in s5inode.h (now obsoleted)
  1710. // remained small to preserve compatibility
  1711. // in the S5 file system type.
  1712. type O_mode_t = uint16 /* types.h:380:18 */ // old file attribute type
  1713. type O_dev_t = int16 /* types.h:381:15 */ // old device type
  1714. type O_uid_t = uint16 /* types.h:382:18 */ // old UID type
  1715. type O_gid_t = uint16 /* types.h:383:17 */ // old GID type
  1716. type O_nlink_t = int16 /* types.h:384:15 */ // old file link type
  1717. type O_pid_t = int16 /* types.h:385:15 */ // old process id type
  1718. type O_ino_t = uint16 /* types.h:386:18 */ // old inode type
  1719. // POSIX and XOPEN Declarations
  1720. type Key_t = int32 /* types.h:392:13 */ // IPC key type
  1721. type Mode_t = uint32 /* types.h:394:16 */ // file attribute type
  1722. type Uid_t = uint32 /* types.h:401:22 */ // UID type
  1723. type Gid_t = uint32 /* types.h:404:15 */ // GID type
  1724. type Datalink_id_t = uint32 /* types.h:406:18 */
  1725. type Vrid_t = uint32 /* types.h:407:18 */
  1726. type Taskid_t = int32 /* types.h:409:17 */
  1727. type Projid_t = int32 /* types.h:410:17 */
  1728. type Poolid_t = int32 /* types.h:411:14 */
  1729. type Zoneid_t = int32 /* types.h:412:14 */
  1730. type Ctid_t = int32 /* types.h:413:14 */
  1731. // POSIX definitions are same as defined in thread.h and synch.h.
  1732. // Any changes made to here should be reflected in corresponding
  1733. // files as described in comments.
  1734. type Pthread_t = uint32 /* types.h:420:16 */ // = thread_t in thread.h
  1735. type Pthread_key_t = uint32 /* types.h:421:16 */ // = thread_key_t in thread.h
  1736. // "Magic numbers" tagging synchronization object types
  1737. type X_pthread_mutex = struct {
  1738. F__pthread_mutex_flags struct {
  1739. F__pthread_mutex_flag1 uint16
  1740. F__pthread_mutex_flag2 uint8
  1741. F__pthread_mutex_ceiling uint8
  1742. F__pthread_mutex_type uint16
  1743. F__pthread_mutex_magic uint16
  1744. }
  1745. F__pthread_mutex_lock struct {
  1746. F__ccgo_pad1 [0]uint64
  1747. F__pthread_mutex_lock64 struct{ F__pthread_mutex_pad [8]uint8 }
  1748. }
  1749. F__pthread_mutex_data uint64
  1750. } /* types.h:429:9 */
  1751. // = thread_key_t in thread.h
  1752. // "Magic numbers" tagging synchronization object types
  1753. type Pthread_mutex_t = X_pthread_mutex /* types.h:448:3 */
  1754. type X_pthread_cond = struct {
  1755. F__pthread_cond_flags struct {
  1756. F__pthread_cond_flag [4]uint8
  1757. F__pthread_cond_type uint16
  1758. F__pthread_cond_magic uint16
  1759. }
  1760. F__pthread_cond_data uint64
  1761. } /* types.h:450:9 */
  1762. type Pthread_cond_t = X_pthread_cond /* types.h:457:3 */
  1763. // UNIX 98 Extension
  1764. type X_pthread_rwlock = struct {
  1765. F__pthread_rwlock_readers int32
  1766. F__pthread_rwlock_type uint16
  1767. F__pthread_rwlock_magic uint16
  1768. F__pthread_rwlock_mutex Pthread_mutex_t
  1769. F__pthread_rwlock_readercv Pthread_cond_t
  1770. F__pthread_rwlock_writercv Pthread_cond_t
  1771. } /* types.h:462:9 */
  1772. // UNIX 98 Extension
  1773. type Pthread_rwlock_t = X_pthread_rwlock /* types.h:469:3 */
  1774. // SUSV3
  1775. type Pthread_barrier_t = struct {
  1776. F__pthread_barrier_count uint32
  1777. F__pthread_barrier_current uint32
  1778. F__pthread_barrier_cycle uint64
  1779. F__pthread_barrier_reserved uint64
  1780. F__pthread_barrier_lock Pthread_mutex_t
  1781. F__pthread_barrier_cond Pthread_cond_t
  1782. } /* types.h:481:3 */
  1783. type Pthread_spinlock_t = Pthread_mutex_t /* types.h:483:25 */
  1784. // attributes for threads, dynamically allocated by library
  1785. type X_pthread_attr = struct{ F__pthread_attrp uintptr } /* types.h:488:9 */
  1786. // attributes for threads, dynamically allocated by library
  1787. type Pthread_attr_t = X_pthread_attr /* types.h:490:3 */
  1788. // attributes for mutex, dynamically allocated by library
  1789. type X_pthread_mutexattr = struct{ F__pthread_mutexattrp uintptr } /* types.h:495:9 */
  1790. // attributes for mutex, dynamically allocated by library
  1791. type Pthread_mutexattr_t = X_pthread_mutexattr /* types.h:497:3 */
  1792. // attributes for cond, dynamically allocated by library
  1793. type X_pthread_condattr = struct{ F__pthread_condattrp uintptr } /* types.h:502:9 */
  1794. // attributes for cond, dynamically allocated by library
  1795. type Pthread_condattr_t = X_pthread_condattr /* types.h:504:3 */
  1796. // pthread_once
  1797. type X_once = struct{ F__pthread_once_pad [4]uint64 } /* types.h:509:9 */
  1798. // pthread_once
  1799. type Pthread_once_t = X_once /* types.h:511:3 */
  1800. // UNIX 98 Extensions
  1801. // attributes for rwlock, dynamically allocated by library
  1802. type X_pthread_rwlockattr = struct{ F__pthread_rwlockattrp uintptr } /* types.h:517:9 */
  1803. // UNIX 98 Extensions
  1804. // attributes for rwlock, dynamically allocated by library
  1805. type Pthread_rwlockattr_t = X_pthread_rwlockattr /* types.h:519:3 */
  1806. // SUSV3
  1807. // attributes for pthread_barrier_t, dynamically allocated by library
  1808. type Pthread_barrierattr_t = struct{ F__pthread_barrierattrp uintptr } /* types.h:527:3 */
  1809. type Dev_t = uint64 /* types.h:529:17 */ // expanded device type
  1810. type Nlink_t = uint32 /* types.h:532:16 */ // file link type
  1811. type Pid_t = int32 /* types.h:533:13 */ // size of something in bytes
  1812. type Ssize_t = int64 /* types.h:551:14 */ // size of something in bytes or -1
  1813. type Time_t = int64 /* types.h:559:15 */ // time of day in seconds
  1814. type Clock_t = int64 /* types.h:564:15 */ // relative time in a specified resolution
  1815. type Clockid_t = int32 /* types.h:569:13 */ // clock identifier type
  1816. type Timer_t = int32 /* types.h:574:13 */ // timer identifier type
  1817. // BEGIN CSTYLED
  1818. type Unchar = uint8 /* types.h:580:23 */
  1819. type Ushort = uint16 /* types.h:581:24 */
  1820. type Uint = uint32 /* types.h:582:22 */
  1821. type Ulong = uint64 /* types.h:583:23 */
  1822. // END CSTYLED
  1823. // The following is the value of type id_t to use to indicate the
  1824. // caller's current id. See procset.h for the type idtype_t
  1825. // which defines which kind of id is being specified.
  1826. // The following value of type pfn_t is used to indicate
  1827. // invalid page frame number.
  1828. // BEGIN CSTYLED
  1829. type U_char = uint8 /* types.h:650:23 */
  1830. type U_short = uint16 /* types.h:651:24 */
  1831. type U_int = uint32 /* types.h:652:22 */
  1832. type U_long = uint64 /* types.h:653:23 */
  1833. type X_quad = struct{ Fval [2]int32 } /* types.h:654:9 */
  1834. type Quad_t = X_quad /* types.h:654:38 */ // used by UFS
  1835. type Quad = Quad_t /* types.h:655:17 */ // used by UFS
  1836. // END CSTYLED
  1837. // Nested include for BSD/sockets source compatibility.
  1838. // (The select macros used to be defined here).
  1839. // CDDL HEADER START
  1840. //
  1841. // The contents of this file are subject to the terms of the
  1842. // Common Development and Distribution License (the "License").
  1843. // You may not use this file except in compliance with the License.
  1844. //
  1845. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  1846. // or http://www.opensolaris.org/os/licensing.
  1847. // See the License for the specific language governing permissions
  1848. // and limitations under the License.
  1849. //
  1850. // When distributing Covered Code, include this CDDL HEADER in each
  1851. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  1852. // If applicable, add the following below this CDDL HEADER, with the
  1853. // fields enclosed by brackets "[]" replaced with your own identifying
  1854. // information: Portions Copyright [yyyy] [name of copyright owner]
  1855. //
  1856. // CDDL HEADER END
  1857. // Copyright 2014 Garrett D'Amore <garrett@damore.org>
  1858. //
  1859. // Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  1860. //
  1861. // Copyright 2010 Sun Microsystems, Inc. All rights reserved.
  1862. // Use is subject to license terms.
  1863. // Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  1864. // All Rights Reserved
  1865. // University Copyright- Copyright (c) 1982, 1986, 1988
  1866. // The Regents of the University of California
  1867. // All Rights Reserved
  1868. //
  1869. // University Acknowledgment- Portions of this document are derived from
  1870. // software developed by the University of California, Berkeley, and its
  1871. // contributors.
  1872. // DO NOT EDIT THIS FILE.
  1873. //
  1874. // It has been auto-edited by fixincludes from:
  1875. //
  1876. // "/usr/include/sys/feature_tests.h"
  1877. //
  1878. // This had to be done to correct non-standard usages in the
  1879. // original, manufacturer supplied header file.
  1880. // CDDL HEADER START
  1881. //
  1882. // The contents of this file are subject to the terms of the
  1883. // Common Development and Distribution License (the "License").
  1884. // You may not use this file except in compliance with the License.
  1885. //
  1886. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  1887. // or http://www.opensolaris.org/os/licensing.
  1888. // See the License for the specific language governing permissions
  1889. // and limitations under the License.
  1890. //
  1891. // When distributing Covered Code, include this CDDL HEADER in each
  1892. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  1893. // If applicable, add the following below this CDDL HEADER, with the
  1894. // fields enclosed by brackets "[]" replaced with your own identifying
  1895. // information: Portions Copyright [yyyy] [name of copyright owner]
  1896. //
  1897. // CDDL HEADER END
  1898. // Copyright 2013 Garrett D'Amore <garrett@damore.org>
  1899. // Copyright 2016 Joyent, Inc.
  1900. // Copyright 2022 Oxide Computer Company
  1901. //
  1902. // Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  1903. // Use is subject to license terms.
  1904. // CDDL HEADER START
  1905. //
  1906. // The contents of this file are subject to the terms of the
  1907. // Common Development and Distribution License, Version 1.0 only
  1908. // (the "License"). You may not use this file except in compliance
  1909. // with the License.
  1910. //
  1911. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  1912. // or http://www.opensolaris.org/os/licensing.
  1913. // See the License for the specific language governing permissions
  1914. // and limitations under the License.
  1915. //
  1916. // When distributing Covered Code, include this CDDL HEADER in each
  1917. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  1918. // If applicable, add the following below this CDDL HEADER, with the
  1919. // fields enclosed by brackets "[]" replaced with your own identifying
  1920. // information: Portions Copyright [yyyy] [name of copyright owner]
  1921. //
  1922. // CDDL HEADER END
  1923. // Copyright 2005 Sun Microsystems, Inc. All rights reserved.
  1924. // Use is subject to license terms.
  1925. // Implementation-private. This header should not be included
  1926. // directly by an application. The application should instead
  1927. // include <time.h> which includes this header conditionally
  1928. // depending on which feature test macros are defined. By default,
  1929. // this header is included by <time.h>. X/Open and POSIX
  1930. // standards requirements result in this header being included
  1931. // by <time.h> only under a restricted set of conditions.
  1932. // DO NOT EDIT THIS FILE.
  1933. //
  1934. // It has been auto-edited by fixincludes from:
  1935. //
  1936. // "/usr/include/sys/feature_tests.h"
  1937. //
  1938. // This had to be done to correct non-standard usages in the
  1939. // original, manufacturer supplied header file.
  1940. // CDDL HEADER START
  1941. //
  1942. // The contents of this file are subject to the terms of the
  1943. // Common Development and Distribution License (the "License").
  1944. // You may not use this file except in compliance with the License.
  1945. //
  1946. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  1947. // or http://www.opensolaris.org/os/licensing.
  1948. // See the License for the specific language governing permissions
  1949. // and limitations under the License.
  1950. //
  1951. // When distributing Covered Code, include this CDDL HEADER in each
  1952. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  1953. // If applicable, add the following below this CDDL HEADER, with the
  1954. // fields enclosed by brackets "[]" replaced with your own identifying
  1955. // information: Portions Copyright [yyyy] [name of copyright owner]
  1956. //
  1957. // CDDL HEADER END
  1958. // Copyright 2013 Garrett D'Amore <garrett@damore.org>
  1959. // Copyright 2016 Joyent, Inc.
  1960. // Copyright 2022 Oxide Computer Company
  1961. //
  1962. // Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  1963. // Use is subject to license terms.
  1964. // Time expressed in seconds and nanoseconds
  1965. type Timespec = struct {
  1966. Ftv_sec int64
  1967. Ftv_nsec int64
  1968. } /* time_impl.h:57:9 */
  1969. // used by UFS
  1970. // END CSTYLED
  1971. // Nested include for BSD/sockets source compatibility.
  1972. // (The select macros used to be defined here).
  1973. // CDDL HEADER START
  1974. //
  1975. // The contents of this file are subject to the terms of the
  1976. // Common Development and Distribution License (the "License").
  1977. // You may not use this file except in compliance with the License.
  1978. //
  1979. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  1980. // or http://www.opensolaris.org/os/licensing.
  1981. // See the License for the specific language governing permissions
  1982. // and limitations under the License.
  1983. //
  1984. // When distributing Covered Code, include this CDDL HEADER in each
  1985. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  1986. // If applicable, add the following below this CDDL HEADER, with the
  1987. // fields enclosed by brackets "[]" replaced with your own identifying
  1988. // information: Portions Copyright [yyyy] [name of copyright owner]
  1989. //
  1990. // CDDL HEADER END
  1991. // Copyright 2014 Garrett D'Amore <garrett@damore.org>
  1992. //
  1993. // Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  1994. //
  1995. // Copyright 2010 Sun Microsystems, Inc. All rights reserved.
  1996. // Use is subject to license terms.
  1997. // Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  1998. // All Rights Reserved
  1999. // University Copyright- Copyright (c) 1982, 1986, 1988
  2000. // The Regents of the University of California
  2001. // All Rights Reserved
  2002. //
  2003. // University Acknowledgment- Portions of this document are derived from
  2004. // software developed by the University of California, Berkeley, and its
  2005. // contributors.
  2006. // DO NOT EDIT THIS FILE.
  2007. //
  2008. // It has been auto-edited by fixincludes from:
  2009. //
  2010. // "/usr/include/sys/feature_tests.h"
  2011. //
  2012. // This had to be done to correct non-standard usages in the
  2013. // original, manufacturer supplied header file.
  2014. // CDDL HEADER START
  2015. //
  2016. // The contents of this file are subject to the terms of the
  2017. // Common Development and Distribution License (the "License").
  2018. // You may not use this file except in compliance with the License.
  2019. //
  2020. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  2021. // or http://www.opensolaris.org/os/licensing.
  2022. // See the License for the specific language governing permissions
  2023. // and limitations under the License.
  2024. //
  2025. // When distributing Covered Code, include this CDDL HEADER in each
  2026. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  2027. // If applicable, add the following below this CDDL HEADER, with the
  2028. // fields enclosed by brackets "[]" replaced with your own identifying
  2029. // information: Portions Copyright [yyyy] [name of copyright owner]
  2030. //
  2031. // CDDL HEADER END
  2032. // Copyright 2013 Garrett D'Amore <garrett@damore.org>
  2033. // Copyright 2016 Joyent, Inc.
  2034. // Copyright 2022 Oxide Computer Company
  2035. //
  2036. // Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  2037. // Use is subject to license terms.
  2038. // CDDL HEADER START
  2039. //
  2040. // The contents of this file are subject to the terms of the
  2041. // Common Development and Distribution License, Version 1.0 only
  2042. // (the "License"). You may not use this file except in compliance
  2043. // with the License.
  2044. //
  2045. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  2046. // or http://www.opensolaris.org/os/licensing.
  2047. // See the License for the specific language governing permissions
  2048. // and limitations under the License.
  2049. //
  2050. // When distributing Covered Code, include this CDDL HEADER in each
  2051. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  2052. // If applicable, add the following below this CDDL HEADER, with the
  2053. // fields enclosed by brackets "[]" replaced with your own identifying
  2054. // information: Portions Copyright [yyyy] [name of copyright owner]
  2055. //
  2056. // CDDL HEADER END
  2057. // Copyright 2005 Sun Microsystems, Inc. All rights reserved.
  2058. // Use is subject to license terms.
  2059. // Implementation-private. This header should not be included
  2060. // directly by an application. The application should instead
  2061. // include <time.h> which includes this header conditionally
  2062. // depending on which feature test macros are defined. By default,
  2063. // this header is included by <time.h>. X/Open and POSIX
  2064. // standards requirements result in this header being included
  2065. // by <time.h> only under a restricted set of conditions.
  2066. // DO NOT EDIT THIS FILE.
  2067. //
  2068. // It has been auto-edited by fixincludes from:
  2069. //
  2070. // "/usr/include/sys/feature_tests.h"
  2071. //
  2072. // This had to be done to correct non-standard usages in the
  2073. // original, manufacturer supplied header file.
  2074. // CDDL HEADER START
  2075. //
  2076. // The contents of this file are subject to the terms of the
  2077. // Common Development and Distribution License (the "License").
  2078. // You may not use this file except in compliance with the License.
  2079. //
  2080. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  2081. // or http://www.opensolaris.org/os/licensing.
  2082. // See the License for the specific language governing permissions
  2083. // and limitations under the License.
  2084. //
  2085. // When distributing Covered Code, include this CDDL HEADER in each
  2086. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  2087. // If applicable, add the following below this CDDL HEADER, with the
  2088. // fields enclosed by brackets "[]" replaced with your own identifying
  2089. // information: Portions Copyright [yyyy] [name of copyright owner]
  2090. //
  2091. // CDDL HEADER END
  2092. // Copyright 2013 Garrett D'Amore <garrett@damore.org>
  2093. // Copyright 2016 Joyent, Inc.
  2094. // Copyright 2022 Oxide Computer Company
  2095. //
  2096. // Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  2097. // Use is subject to license terms.
  2098. // Time expressed in seconds and nanoseconds
  2099. type Timespec_t = Timespec /* time_impl.h:60:3 */
  2100. type Timestruc_t = Timespec /* time_impl.h:81:25 */ // definition per SVr4
  2101. // The following has been left in for backward compatibility. Portable
  2102. // applications should not use the structure name timestruc.
  2103. // Timer specification
  2104. type Itimerspec = struct {
  2105. Fit_interval struct {
  2106. Ftv_sec int64
  2107. Ftv_nsec int64
  2108. }
  2109. Fit_value struct {
  2110. Ftv_sec int64
  2111. Ftv_nsec int64
  2112. }
  2113. } /* time_impl.h:95:9 */
  2114. // definition per SVr4
  2115. // The following has been left in for backward compatibility. Portable
  2116. // applications should not use the structure name timestruc.
  2117. // Timer specification
  2118. type Itimerspec_t = Itimerspec /* time_impl.h:98:3 */
  2119. // Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  2120. // All Rights Reserved
  2121. // Copyright (c) 1982, 1986, 1993 Regents of the University of California.
  2122. // All rights reserved. The Berkeley software License Agreement
  2123. // specifies the terms and conditions for redistribution.
  2124. // Copyright 2014 Garrett D'Amore <garrett@damore.org>
  2125. //
  2126. // Copyright 2009 Sun Microsystems, Inc. All rights reserved.
  2127. // Use is subject to license terms.
  2128. //
  2129. // Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  2130. // Copyright 2016 Joyent, Inc.
  2131. // Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
  2132. // Copyright (c) 2013, 2016 by Delphix. All rights reserved.
  2133. // DO NOT EDIT THIS FILE.
  2134. //
  2135. // It has been auto-edited by fixincludes from:
  2136. //
  2137. // "/usr/include/sys/feature_tests.h"
  2138. //
  2139. // This had to be done to correct non-standard usages in the
  2140. // original, manufacturer supplied header file.
  2141. // CDDL HEADER START
  2142. //
  2143. // The contents of this file are subject to the terms of the
  2144. // Common Development and Distribution License (the "License").
  2145. // You may not use this file except in compliance with the License.
  2146. //
  2147. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  2148. // or http://www.opensolaris.org/os/licensing.
  2149. // See the License for the specific language governing permissions
  2150. // and limitations under the License.
  2151. //
  2152. // When distributing Covered Code, include this CDDL HEADER in each
  2153. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  2154. // If applicable, add the following below this CDDL HEADER, with the
  2155. // fields enclosed by brackets "[]" replaced with your own identifying
  2156. // information: Portions Copyright [yyyy] [name of copyright owner]
  2157. //
  2158. // CDDL HEADER END
  2159. // Copyright 2013 Garrett D'Amore <garrett@damore.org>
  2160. // Copyright 2016 Joyent, Inc.
  2161. // Copyright 2022 Oxide Computer Company
  2162. //
  2163. // Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  2164. // Use is subject to license terms.
  2165. // Structure returned by gettimeofday(2) system call,
  2166. // and used in other calls.
  2167. type Timeval = struct {
  2168. Ftv_sec int64
  2169. Ftv_usec int64
  2170. } /* time.h:54:1 */
  2171. type Timezone = struct {
  2172. Ftz_minuteswest int32
  2173. Ftz_dsttime int32
  2174. } /* time.h:86:1 */
  2175. // Needed for longlong_t type. Placement of this due to <sys/types.h>
  2176. // including <sys/select.h> which relies on the presense of the itimerval
  2177. // structure.
  2178. // CDDL HEADER START
  2179. //
  2180. // The contents of this file are subject to the terms of the
  2181. // Common Development and Distribution License (the "License").
  2182. // You may not use this file except in compliance with the License.
  2183. //
  2184. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  2185. // or http://www.opensolaris.org/os/licensing.
  2186. // See the License for the specific language governing permissions
  2187. // and limitations under the License.
  2188. //
  2189. // When distributing Covered Code, include this CDDL HEADER in each
  2190. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  2191. // If applicable, add the following below this CDDL HEADER, with the
  2192. // fields enclosed by brackets "[]" replaced with your own identifying
  2193. // information: Portions Copyright [yyyy] [name of copyright owner]
  2194. //
  2195. // CDDL HEADER END
  2196. // Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  2197. // All Rights Reserved
  2198. // Copyright 2009 Sun Microsystems, Inc. All rights reserved.
  2199. // Use is subject to license terms.
  2200. //
  2201. // Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  2202. // Copyright 2016 Joyent, Inc.
  2203. // Copyright 2021 Oxide Computer Company
  2204. // Operations on timevals.
  2205. // Names of the interval timers, and structure
  2206. // defining a timer setting.
  2207. // time and when system is running on
  2208. // behalf of the process.
  2209. // time profiling of multithreaded
  2210. // programs.
  2211. type Itimerval = struct {
  2212. Fit_interval struct {
  2213. Ftv_sec int64
  2214. Ftv_usec int64
  2215. }
  2216. Fit_value struct {
  2217. Ftv_sec int64
  2218. Ftv_usec int64
  2219. }
  2220. } /* time.h:209:1 */
  2221. // Definitions for commonly used resolutions.
  2222. // Time expressed as a 64-bit nanosecond counter.
  2223. type Hrtime_t = int64 /* time.h:265:20 */
  2224. // The inclusion of <time.h> is historical and was added for
  2225. // backward compatibility in delta 1.2 when a number of definitions
  2226. // were moved out of <sys/time.h>. More recently, the timespec and
  2227. // itimerspec structure definitions, along with the _CLOCK_*, CLOCK_*,
  2228. // _TIMER_*, and TIMER_* symbols were moved to <sys/time_impl.h>,
  2229. // which is now included by <time.h>. This change was due to POSIX
  2230. // 1003.1b-1993 and X/Open UNIX 98 requirements. For non-POSIX and
  2231. // non-X/Open applications, including this header will still make
  2232. // visible these definitions.
  2233. // CDDL HEADER START
  2234. //
  2235. // The contents of this file are subject to the terms of the
  2236. // Common Development and Distribution License (the "License").
  2237. // You may not use this file except in compliance with the License.
  2238. //
  2239. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  2240. // or http://www.opensolaris.org/os/licensing.
  2241. // See the License for the specific language governing permissions
  2242. // and limitations under the License.
  2243. //
  2244. // When distributing Covered Code, include this CDDL HEADER in each
  2245. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  2246. // If applicable, add the following below this CDDL HEADER, with the
  2247. // fields enclosed by brackets "[]" replaced with your own identifying
  2248. // information: Portions Copyright [yyyy] [name of copyright owner]
  2249. //
  2250. // CDDL HEADER END
  2251. // Copyright (c) 1988 AT&T
  2252. // All Rights Reserved
  2253. // Copyright 2014 Garrett D'Amore <garrett@damore.org>
  2254. //
  2255. // Copyright 2007 Sun Microsystems, Inc. All rights reserved.
  2256. // Use is subject to license terms.
  2257. // Copyright 2010 Nexenta Systems, Inc. Al rights reserved.
  2258. // Copyright 2016 Joyent, Inc.
  2259. // DO NOT EDIT THIS FILE.
  2260. //
  2261. // It has been auto-edited by fixincludes from:
  2262. //
  2263. // "/usr/include/sys/feature_tests.h"
  2264. //
  2265. // This had to be done to correct non-standard usages in the
  2266. // original, manufacturer supplied header file.
  2267. // CDDL HEADER START
  2268. //
  2269. // The contents of this file are subject to the terms of the
  2270. // Common Development and Distribution License (the "License").
  2271. // You may not use this file except in compliance with the License.
  2272. //
  2273. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  2274. // or http://www.opensolaris.org/os/licensing.
  2275. // See the License for the specific language governing permissions
  2276. // and limitations under the License.
  2277. //
  2278. // When distributing Covered Code, include this CDDL HEADER in each
  2279. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  2280. // If applicable, add the following below this CDDL HEADER, with the
  2281. // fields enclosed by brackets "[]" replaced with your own identifying
  2282. // information: Portions Copyright [yyyy] [name of copyright owner]
  2283. //
  2284. // CDDL HEADER END
  2285. // Copyright 2013 Garrett D'Amore <garrett@damore.org>
  2286. // Copyright 2016 Joyent, Inc.
  2287. // Copyright 2022 Oxide Computer Company
  2288. //
  2289. // Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  2290. // Use is subject to license terms.
  2291. // CDDL HEADER START
  2292. //
  2293. // The contents of this file are subject to the terms of the
  2294. // Common Development and Distribution License, Version 1.0 only
  2295. // (the "License"). You may not use this file except in compliance
  2296. // with the License.
  2297. //
  2298. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  2299. // or http://www.opensolaris.org/os/licensing.
  2300. // See the License for the specific language governing permissions
  2301. // and limitations under the License.
  2302. //
  2303. // When distributing Covered Code, include this CDDL HEADER in each
  2304. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  2305. // If applicable, add the following below this CDDL HEADER, with the
  2306. // fields enclosed by brackets "[]" replaced with your own identifying
  2307. // information: Portions Copyright [yyyy] [name of copyright owner]
  2308. //
  2309. // CDDL HEADER END
  2310. // Copyright (c) 1988 AT&T
  2311. // All Rights Reserved
  2312. // Copyright 2014 Garrett D'Amore <garrett@damore.org>
  2313. // Copyright 2014 PALO, Richard.
  2314. //
  2315. // Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  2316. // Use is subject to license terms.
  2317. // An application should not include this header directly. Instead it
  2318. // should be included only through the inclusion of other Sun headers.
  2319. //
  2320. // The contents of this header is limited to identifiers specified in the
  2321. // C Standard. Any new identifiers specified in future amendments to the
  2322. // C Standard must be placed in this header. If these new identifiers
  2323. // are required to also be in the C++ Standard "std" namespace, then for
  2324. // anything other than macro definitions, corresponding "using" directives
  2325. // must also be added to <time.h.h>.
  2326. // DO NOT EDIT THIS FILE.
  2327. //
  2328. // It has been auto-edited by fixincludes from:
  2329. //
  2330. // "/usr/include/sys/feature_tests.h"
  2331. //
  2332. // This had to be done to correct non-standard usages in the
  2333. // original, manufacturer supplied header file.
  2334. // CDDL HEADER START
  2335. //
  2336. // The contents of this file are subject to the terms of the
  2337. // Common Development and Distribution License (the "License").
  2338. // You may not use this file except in compliance with the License.
  2339. //
  2340. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  2341. // or http://www.opensolaris.org/os/licensing.
  2342. // See the License for the specific language governing permissions
  2343. // and limitations under the License.
  2344. //
  2345. // When distributing Covered Code, include this CDDL HEADER in each
  2346. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  2347. // If applicable, add the following below this CDDL HEADER, with the
  2348. // fields enclosed by brackets "[]" replaced with your own identifying
  2349. // information: Portions Copyright [yyyy] [name of copyright owner]
  2350. //
  2351. // CDDL HEADER END
  2352. // Copyright 2013 Garrett D'Amore <garrett@damore.org>
  2353. // Copyright 2016 Joyent, Inc.
  2354. // Copyright 2022 Oxide Computer Company
  2355. //
  2356. // Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  2357. // Use is subject to license terms.
  2358. // This file and its contents are supplied under the terms of the
  2359. // Common Development and Distribution License ("CDDL"), version 1.0.
  2360. // You may only use this file in accordance with the terms of version
  2361. // 1.0 of the CDDL.
  2362. //
  2363. // A full copy of the text of the CDDL should have accompanied this
  2364. // source. A copy of the CDDL is also available via the Internet at
  2365. // http://www.illumos.org/license/CDDL.
  2366. // Copyright 2014-2016 PALO, Richard.
  2367. // DO NOT EDIT THIS FILE.
  2368. //
  2369. // It has been auto-edited by fixincludes from:
  2370. //
  2371. // "/usr/include/sys/feature_tests.h"
  2372. //
  2373. // This had to be done to correct non-standard usages in the
  2374. // original, manufacturer supplied header file.
  2375. // CDDL HEADER START
  2376. //
  2377. // The contents of this file are subject to the terms of the
  2378. // Common Development and Distribution License (the "License").
  2379. // You may not use this file except in compliance with the License.
  2380. //
  2381. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  2382. // or http://www.opensolaris.org/os/licensing.
  2383. // See the License for the specific language governing permissions
  2384. // and limitations under the License.
  2385. //
  2386. // When distributing Covered Code, include this CDDL HEADER in each
  2387. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  2388. // If applicable, add the following below this CDDL HEADER, with the
  2389. // fields enclosed by brackets "[]" replaced with your own identifying
  2390. // information: Portions Copyright [yyyy] [name of copyright owner]
  2391. //
  2392. // CDDL HEADER END
  2393. // Copyright 2013 Garrett D'Amore <garrett@damore.org>
  2394. // Copyright 2016 Joyent, Inc.
  2395. // Copyright 2022 Oxide Computer Company
  2396. //
  2397. // Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  2398. // Use is subject to license terms.
  2399. // POSIX.1-2008 requires that the NULL macro be cast to type void *.
  2400. type Tm = struct {
  2401. Ftm_sec int32
  2402. Ftm_min int32
  2403. Ftm_hour int32
  2404. Ftm_mday int32
  2405. Ftm_mon int32
  2406. Ftm_year int32
  2407. Ftm_wday int32
  2408. Ftm_yday int32
  2409. Ftm_isdst int32
  2410. } /* time_iso.h:80:1 */
  2411. // Neither X/Open nor POSIX allow the inclusion of <signal.h> for the
  2412. // definition of the sigevent structure. Both require the inclusion
  2413. // of <signal.h> and <time.h> when using the timer_create() function.
  2414. // However, X/Open also specifies that the sigevent structure be defined
  2415. // in <time.h> as described in the header <signal.h>. This prevents
  2416. // compiler warnings for applications that only include <time.h> and not
  2417. // also <signal.h>. The sigval union and the sigevent structure is
  2418. // therefore defined both here and in <sys/siginfo.h> which gets included
  2419. // via inclusion of <signal.h>.
  2420. type Sigval = struct {
  2421. F__ccgo_pad1 [0]uint64
  2422. Fsival_int int32
  2423. F__ccgo_pad2 [4]byte
  2424. } /* time.h:125:1 */
  2425. type Sigevent = struct {
  2426. Fsigev_notify int32
  2427. Fsigev_signo int32
  2428. Fsigev_value struct {
  2429. F__ccgo_pad1 [0]uint64
  2430. Fsival_int int32
  2431. F__ccgo_pad2 [4]byte
  2432. }
  2433. Fsigev_notify_function uintptr
  2434. Fsigev_notify_attributes uintptr
  2435. F__sigev_pad2 int32
  2436. F__ccgo_pad1 [4]byte
  2437. } /* time.h:133:1 */
  2438. type Locale_t = uintptr /* time.h:292:24 */
  2439. // The inclusion of <sys/select.h> is needed for the FD_CLR,
  2440. // FD_ISSET, FD_SET, and FD_SETSIZE macros as well as the
  2441. // select() prototype defined in the XOpen specifications
  2442. // beginning with XSH4v2. Placement required after definition
  2443. // for itimerval.
  2444. // CDDL HEADER START
  2445. //
  2446. // The contents of this file are subject to the terms of the
  2447. // Common Development and Distribution License (the "License").
  2448. // You may not use this file except in compliance with the License.
  2449. //
  2450. // You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  2451. // or http://www.opensolaris.org/os/licensing.
  2452. // See the License for the specific language governing permissions
  2453. // and limitations under the License.
  2454. //
  2455. // When distributing Covered Code, include this CDDL HEADER in each
  2456. // file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  2457. // If applicable, add the following below this CDDL HEADER, with the
  2458. // fields enclosed by brackets "[]" replaced with your own identifying
  2459. // information: Portions Copyright [yyyy] [name of copyright owner]
  2460. //
  2461. // CDDL HEADER END
  2462. // Copyright 2014 Garrett D'Amore <garrett@damore.org>
  2463. //
  2464. // Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  2465. //
  2466. // Copyright 2010 Sun Microsystems, Inc. All rights reserved.
  2467. // Use is subject to license terms.
  2468. // Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  2469. // All Rights Reserved
  2470. // University Copyright- Copyright (c) 1982, 1986, 1988
  2471. // The Regents of the University of California
  2472. // All Rights Reserved
  2473. //
  2474. // University Acknowledgment- Portions of this document are derived from
  2475. // software developed by the University of California, Berkeley, and its
  2476. // contributors.
  2477. // The sigset_t type is defined in <sys/signal.h> and duplicated
  2478. // in <sys/ucontext.h> as a result of XPG4v2 requirements. XPG6
  2479. // now allows the visibility of signal.h in this header, however
  2480. // an order of inclusion problem occurs as a result of inclusion
  2481. // of <sys/select.h> in <signal.h> under certain conditions.
  2482. // Rather than include <sys/signal.h> here, we've duplicated
  2483. // the sigset_t type instead. This type is required for the XPG6
  2484. // introduced pselect() function also declared in this header.
  2485. type Sigset_t = struct{ F__sigbits [4]uint32 } /* select.h:76:3 */
  2486. // Select uses bit masks of file descriptors in longs.
  2487. // These macros manipulate such bit fields.
  2488. // FD_SETSIZE may be defined by the user, but the default here
  2489. // should be >= RLIM_FD_MAX.
  2490. type Fd_mask = int64 /* select.h:92:14 */
  2491. type Fds_mask = int64 /* select.h:94:14 */
  2492. // The value of _NBBY needs to be consistant with the value
  2493. // of NBBY in <sys/param.h>.
  2494. type Fd_set1 = struct{ Ffds_bits [1024]int64 } /* select.h:120:9 */
  2495. // The value of _NBBY needs to be consistant with the value
  2496. // of NBBY in <sys/param.h>.
  2497. type Fd_set = Fd_set1 /* select.h:125:3 */
  2498. // _VOID was defined to be either void or char but this is not
  2499. // required because previous SunOS compilers have accepted the void
  2500. // type. However, because many system header and source files use the
  2501. // void keyword, the volatile keyword, and ANSI C function prototypes,
  2502. // non-ANSI compilers cannot compile the system anyway. The _VOID macro
  2503. // should therefore not be used and remains for source compatibility
  2504. // only.
  2505. // CSTYLED
  2506. // utimbuf is used by utime(2)
  2507. type Utimbuf = struct {
  2508. Factime int64
  2509. Fmodtime int64
  2510. } /* utime.h:40:1 */
  2511. var _ int8 /* gen.c:2:13: */