io_uring.py 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486
  1. # mypy: ignore-errors
  2. # -*- coding: utf-8 -*-
  3. #
  4. # TARGET arch is: []
  5. # WORD_SIZE is: 8
  6. # POINTER_SIZE is: 8
  7. # LONGDOUBLE_SIZE is: 16
  8. #
  9. import ctypes
  10. class AsDictMixin:
  11. @classmethod
  12. def as_dict(cls, self):
  13. result = {}
  14. if not isinstance(self, AsDictMixin):
  15. # not a structure, assume it's already a python object
  16. return self
  17. if not hasattr(cls, "_fields_"):
  18. return result
  19. # sys.version_info >= (3, 5)
  20. # for (field, *_) in cls._fields_: # noqa
  21. for field_tuple in cls._fields_: # noqa
  22. field = field_tuple[0]
  23. if field.startswith('PADDING_'):
  24. continue
  25. value = getattr(self, field)
  26. type_ = type(value)
  27. if hasattr(value, "_length_") and hasattr(value, "_type_"):
  28. # array
  29. if not hasattr(type_, "as_dict"):
  30. value = [v for v in value]
  31. else:
  32. type_ = type_._type_
  33. value = [type_.as_dict(v) for v in value]
  34. elif hasattr(value, "contents") and hasattr(value, "_type_"):
  35. # pointer
  36. try:
  37. if not hasattr(type_, "as_dict"):
  38. value = value.contents
  39. else:
  40. type_ = type_._type_
  41. value = type_.as_dict(value.contents)
  42. except ValueError:
  43. # nullptr
  44. value = None
  45. elif isinstance(value, AsDictMixin):
  46. # other structure
  47. value = type_.as_dict(value)
  48. result[field] = value
  49. return result
  50. class Structure(ctypes.Structure, AsDictMixin):
  51. def __init__(self, *args, **kwds):
  52. # We don't want to use positional arguments fill PADDING_* fields
  53. args = dict(zip(self.__class__._field_names_(), args))
  54. args.update(kwds)
  55. super(Structure, self).__init__(**args)
  56. @classmethod
  57. def _field_names_(cls):
  58. if hasattr(cls, '_fields_'):
  59. return (f[0] for f in cls._fields_ if not f[0].startswith('PADDING'))
  60. else:
  61. return ()
  62. @classmethod
  63. def get_type(cls, field):
  64. for f in cls._fields_:
  65. if f[0] == field:
  66. return f[1]
  67. return None
  68. @classmethod
  69. def bind(cls, bound_fields):
  70. fields = {}
  71. for name, type_ in cls._fields_:
  72. if hasattr(type_, "restype"):
  73. if name in bound_fields:
  74. if bound_fields[name] is None:
  75. fields[name] = type_()
  76. else:
  77. # use a closure to capture the callback from the loop scope
  78. fields[name] = (
  79. type_((lambda callback: lambda *args: callback(*args))(
  80. bound_fields[name]))
  81. )
  82. del bound_fields[name]
  83. else:
  84. # default callback implementation (does nothing)
  85. try:
  86. default_ = type_(0).restype().value
  87. except TypeError:
  88. default_ = None
  89. fields[name] = type_((
  90. lambda default_: lambda *args: default_)(default_))
  91. else:
  92. # not a callback function, use default initialization
  93. if name in bound_fields:
  94. fields[name] = bound_fields[name]
  95. del bound_fields[name]
  96. else:
  97. fields[name] = type_()
  98. if len(bound_fields) != 0:
  99. raise ValueError(
  100. "Cannot bind the following unknown callback(s) {}.{}".format(
  101. cls.__name__, bound_fields.keys()
  102. ))
  103. return cls(**fields)
  104. class Union(ctypes.Union, AsDictMixin):
  105. pass
  106. c_int128 = ctypes.c_ubyte*16
  107. c_uint128 = c_int128
  108. void = None
  109. if ctypes.sizeof(ctypes.c_longdouble) == 16:
  110. c_long_double_t = ctypes.c_longdouble
  111. else:
  112. c_long_double_t = ctypes.c_ubyte*16
  113. class FunctionFactoryStub:
  114. def __getattr__(self, _):
  115. return ctypes.CFUNCTYPE(lambda y:y)
  116. # libraries['FIXME_STUB'] explanation
  117. # As you did not list (-l libraryname.so) a library that exports this function
  118. # This is a non-working stub instead.
  119. # You can either re-run clan2py with -l /path/to/library.so
  120. # Or manually fix this by comment the ctypes.CDLL loading
  121. _libraries = {}
  122. _libraries['FIXME_STUB'] = FunctionFactoryStub() # ctypes.CDLL('FIXME_STUB')
  123. def string_cast(char_pointer, encoding='utf-8', errors='strict'):
  124. value = ctypes.cast(char_pointer, ctypes.c_char_p).value
  125. if value is not None and encoding is not None:
  126. value = value.decode(encoding, errors=errors)
  127. return value
  128. def char_pointer_cast(string, encoding='utf-8'):
  129. if encoding is not None:
  130. try:
  131. string = string.encode(encoding)
  132. except AttributeError:
  133. # In Python3, bytes has no encode attribute
  134. pass
  135. string = ctypes.c_char_p(string)
  136. return ctypes.cast(string, ctypes.POINTER(ctypes.c_char))
  137. class struct_io_uring_sq(Structure):
  138. pass
  139. class struct_io_uring_sqe(Structure):
  140. pass
  141. struct_io_uring_sq._pack_ = 1 # source:False
  142. struct_io_uring_sq._fields_ = [
  143. ('khead', ctypes.POINTER(ctypes.c_uint32)),
  144. ('ktail', ctypes.POINTER(ctypes.c_uint32)),
  145. ('kring_mask', ctypes.POINTER(ctypes.c_uint32)),
  146. ('kring_entries', ctypes.POINTER(ctypes.c_uint32)),
  147. ('kflags', ctypes.POINTER(ctypes.c_uint32)),
  148. ('kdropped', ctypes.POINTER(ctypes.c_uint32)),
  149. ('array', ctypes.POINTER(ctypes.c_uint32)),
  150. ('sqes', ctypes.POINTER(struct_io_uring_sqe)),
  151. ('sqe_head', ctypes.c_uint32),
  152. ('sqe_tail', ctypes.c_uint32),
  153. ('ring_sz', ctypes.c_uint64),
  154. ('ring_ptr', ctypes.POINTER(None)),
  155. ('pad', ctypes.c_uint32 * 4),
  156. ]
  157. class union_io_uring_sqe_0(Union):
  158. pass
  159. union_io_uring_sqe_0._pack_ = 1 # source:False
  160. union_io_uring_sqe_0._fields_ = [
  161. ('off', ctypes.c_uint64),
  162. ('addr2', ctypes.c_uint64),
  163. ]
  164. class union_io_uring_sqe_1(Union):
  165. pass
  166. union_io_uring_sqe_1._pack_ = 1 # source:False
  167. union_io_uring_sqe_1._fields_ = [
  168. ('addr', ctypes.c_uint64),
  169. ('splice_off_in', ctypes.c_uint64),
  170. ]
  171. class union_io_uring_sqe_2(Union):
  172. pass
  173. union_io_uring_sqe_2._pack_ = 1 # source:False
  174. union_io_uring_sqe_2._fields_ = [
  175. ('rw_flags', ctypes.c_int32),
  176. ('fsync_flags', ctypes.c_uint32),
  177. ('poll_events', ctypes.c_uint16),
  178. ('poll32_events', ctypes.c_uint32),
  179. ('sync_range_flags', ctypes.c_uint32),
  180. ('msg_flags', ctypes.c_uint32),
  181. ('timeout_flags', ctypes.c_uint32),
  182. ('accept_flags', ctypes.c_uint32),
  183. ('cancel_flags', ctypes.c_uint32),
  184. ('open_flags', ctypes.c_uint32),
  185. ('statx_flags', ctypes.c_uint32),
  186. ('fadvise_advice', ctypes.c_uint32),
  187. ('splice_flags', ctypes.c_uint32),
  188. ('rename_flags', ctypes.c_uint32),
  189. ('unlink_flags', ctypes.c_uint32),
  190. ('hardlink_flags', ctypes.c_uint32),
  191. ]
  192. class union_io_uring_sqe_3(Union):
  193. pass
  194. union_io_uring_sqe_3._pack_ = 1 # source:True
  195. union_io_uring_sqe_3._fields_ = [
  196. ('buf_index', ctypes.c_uint16),
  197. ('buf_group', ctypes.c_uint16),
  198. ]
  199. class union_io_uring_sqe_4(Union):
  200. pass
  201. union_io_uring_sqe_4._pack_ = 1 # source:False
  202. union_io_uring_sqe_4._fields_ = [
  203. ('splice_fd_in', ctypes.c_int32),
  204. ('file_index', ctypes.c_uint32),
  205. ]
  206. struct_io_uring_sqe._pack_ = 1 # source:False
  207. struct_io_uring_sqe._anonymous_ = ('_0', '_1', '_2', '_3', '_4',)
  208. struct_io_uring_sqe._fields_ = [
  209. ('opcode', ctypes.c_ubyte),
  210. ('flags', ctypes.c_ubyte),
  211. ('ioprio', ctypes.c_uint16),
  212. ('fd', ctypes.c_int32),
  213. ('_0', union_io_uring_sqe_0),
  214. ('_1', union_io_uring_sqe_1),
  215. ('len', ctypes.c_uint32),
  216. ('_2', union_io_uring_sqe_2),
  217. ('user_data', ctypes.c_uint64),
  218. ('_3', union_io_uring_sqe_3),
  219. ('personality', ctypes.c_uint16),
  220. ('_4', union_io_uring_sqe_4),
  221. ('__pad2', ctypes.c_uint64 * 2),
  222. ]
  223. class struct_io_uring_cq(Structure):
  224. pass
  225. class struct_io_uring_cqe(Structure):
  226. pass
  227. struct_io_uring_cq._pack_ = 1 # source:False
  228. struct_io_uring_cq._fields_ = [
  229. ('khead', ctypes.POINTER(ctypes.c_uint32)),
  230. ('ktail', ctypes.POINTER(ctypes.c_uint32)),
  231. ('kring_mask', ctypes.POINTER(ctypes.c_uint32)),
  232. ('kring_entries', ctypes.POINTER(ctypes.c_uint32)),
  233. ('kflags', ctypes.POINTER(ctypes.c_uint32)),
  234. ('koverflow', ctypes.POINTER(ctypes.c_uint32)),
  235. ('cqes', ctypes.POINTER(struct_io_uring_cqe)),
  236. ('ring_sz', ctypes.c_uint64),
  237. ('ring_ptr', ctypes.POINTER(None)),
  238. ('pad', ctypes.c_uint32 * 4),
  239. ]
  240. struct_io_uring_cqe._pack_ = 1 # source:False
  241. struct_io_uring_cqe._fields_ = [
  242. ('user_data', ctypes.c_uint64),
  243. ('res', ctypes.c_int32),
  244. ('flags', ctypes.c_uint32),
  245. ]
  246. class struct_io_uring(Structure):
  247. pass
  248. struct_io_uring._pack_ = 1 # source:False
  249. struct_io_uring._fields_ = [
  250. ('sq', struct_io_uring_sq),
  251. ('cq', struct_io_uring_cq),
  252. ('flags', ctypes.c_uint32),
  253. ('ring_fd', ctypes.c_int32),
  254. ('features', ctypes.c_uint32),
  255. ('pad', ctypes.c_uint32 * 3),
  256. ]
  257. class struct_io_uring_probe(Structure):
  258. pass
  259. class struct_io_uring_probe_op(Structure):
  260. pass
  261. struct_io_uring_probe_op._pack_ = 1 # source:False
  262. struct_io_uring_probe_op._fields_ = [
  263. ('op', ctypes.c_ubyte),
  264. ('resv', ctypes.c_ubyte),
  265. ('flags', ctypes.c_uint16),
  266. ('resv2', ctypes.c_uint32),
  267. ]
  268. struct_io_uring_probe._pack_ = 1 # source:False
  269. struct_io_uring_probe._fields_ = [
  270. ('last_op', ctypes.c_ubyte),
  271. ('ops_len', ctypes.c_ubyte),
  272. ('resv', ctypes.c_uint16),
  273. ('resv2', ctypes.c_uint32 * 3),
  274. ('ops', struct_io_uring_probe_op * 0),
  275. ]
  276. try:
  277. io_uring_get_probe_ring = _libraries['FIXME_STUB'].io_uring_get_probe_ring
  278. io_uring_get_probe_ring.restype = ctypes.POINTER(struct_io_uring_probe)
  279. io_uring_get_probe_ring.argtypes = [ctypes.POINTER(struct_io_uring)]
  280. except AttributeError:
  281. pass
  282. try:
  283. io_uring_get_probe = _libraries['FIXME_STUB'].io_uring_get_probe
  284. io_uring_get_probe.restype = ctypes.POINTER(struct_io_uring_probe)
  285. io_uring_get_probe.argtypes = []
  286. except AttributeError:
  287. pass
  288. try:
  289. io_uring_free_probe = _libraries['FIXME_STUB'].io_uring_free_probe
  290. io_uring_free_probe.restype = None
  291. io_uring_free_probe.argtypes = [ctypes.POINTER(struct_io_uring_probe)]
  292. except AttributeError:
  293. pass
  294. try:
  295. io_uring_opcode_supported = _libraries['FIXME_STUB'].io_uring_opcode_supported
  296. io_uring_opcode_supported.restype = ctypes.c_int32
  297. io_uring_opcode_supported.argtypes = [ctypes.POINTER(struct_io_uring_probe), ctypes.c_int32]
  298. except AttributeError:
  299. pass
  300. class struct_io_uring_params(Structure):
  301. pass
  302. class struct_io_sqring_offsets(Structure):
  303. pass
  304. struct_io_sqring_offsets._pack_ = 1 # source:False
  305. struct_io_sqring_offsets._fields_ = [
  306. ('head', ctypes.c_uint32),
  307. ('tail', ctypes.c_uint32),
  308. ('ring_mask', ctypes.c_uint32),
  309. ('ring_entries', ctypes.c_uint32),
  310. ('flags', ctypes.c_uint32),
  311. ('dropped', ctypes.c_uint32),
  312. ('array', ctypes.c_uint32),
  313. ('resv1', ctypes.c_uint32),
  314. ('resv2', ctypes.c_uint64),
  315. ]
  316. class struct_io_cqring_offsets(Structure):
  317. pass
  318. struct_io_cqring_offsets._pack_ = 1 # source:False
  319. struct_io_cqring_offsets._fields_ = [
  320. ('head', ctypes.c_uint32),
  321. ('tail', ctypes.c_uint32),
  322. ('ring_mask', ctypes.c_uint32),
  323. ('ring_entries', ctypes.c_uint32),
  324. ('overflow', ctypes.c_uint32),
  325. ('cqes', ctypes.c_uint32),
  326. ('flags', ctypes.c_uint32),
  327. ('resv1', ctypes.c_uint32),
  328. ('resv2', ctypes.c_uint64),
  329. ]
  330. struct_io_uring_params._pack_ = 1 # source:False
  331. struct_io_uring_params._fields_ = [
  332. ('sq_entries', ctypes.c_uint32),
  333. ('cq_entries', ctypes.c_uint32),
  334. ('flags', ctypes.c_uint32),
  335. ('sq_thread_cpu', ctypes.c_uint32),
  336. ('sq_thread_idle', ctypes.c_uint32),
  337. ('features', ctypes.c_uint32),
  338. ('wq_fd', ctypes.c_uint32),
  339. ('resv', ctypes.c_uint32 * 3),
  340. ('sq_off', struct_io_sqring_offsets),
  341. ('cq_off', struct_io_cqring_offsets),
  342. ]
  343. try:
  344. io_uring_queue_init_params = _libraries['FIXME_STUB'].io_uring_queue_init_params
  345. io_uring_queue_init_params.restype = ctypes.c_int32
  346. io_uring_queue_init_params.argtypes = [ctypes.c_uint32, ctypes.POINTER(struct_io_uring), ctypes.POINTER(struct_io_uring_params)]
  347. except AttributeError:
  348. pass
  349. try:
  350. io_uring_queue_init = _libraries['FIXME_STUB'].io_uring_queue_init
  351. io_uring_queue_init.restype = ctypes.c_int32
  352. io_uring_queue_init.argtypes = [ctypes.c_uint32, ctypes.POINTER(struct_io_uring), ctypes.c_uint32]
  353. except AttributeError:
  354. pass
  355. try:
  356. io_uring_queue_mmap = _libraries['FIXME_STUB'].io_uring_queue_mmap
  357. io_uring_queue_mmap.restype = ctypes.c_int32
  358. io_uring_queue_mmap.argtypes = [ctypes.c_int32, ctypes.POINTER(struct_io_uring_params), ctypes.POINTER(struct_io_uring)]
  359. except AttributeError:
  360. pass
  361. try:
  362. io_uring_ring_dontfork = _libraries['FIXME_STUB'].io_uring_ring_dontfork
  363. io_uring_ring_dontfork.restype = ctypes.c_int32
  364. io_uring_ring_dontfork.argtypes = [ctypes.POINTER(struct_io_uring)]
  365. except AttributeError:
  366. pass
  367. try:
  368. io_uring_queue_exit = _libraries['FIXME_STUB'].io_uring_queue_exit
  369. io_uring_queue_exit.restype = None
  370. io_uring_queue_exit.argtypes = [ctypes.POINTER(struct_io_uring)]
  371. except AttributeError:
  372. pass
  373. try:
  374. io_uring_peek_batch_cqe = _libraries['FIXME_STUB'].io_uring_peek_batch_cqe
  375. io_uring_peek_batch_cqe.restype = ctypes.c_uint32
  376. io_uring_peek_batch_cqe.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(ctypes.POINTER(struct_io_uring_cqe)), ctypes.c_uint32]
  377. except AttributeError:
  378. pass
  379. class struct___kernel_timespec(Structure):
  380. pass
  381. struct___kernel_timespec._pack_ = 1 # source:False
  382. struct___kernel_timespec._fields_ = [
  383. ('tv_sec', ctypes.c_int64),
  384. ('tv_nsec', ctypes.c_int64),
  385. ]
  386. class struct_c__SA___sigset_t(Structure):
  387. pass
  388. struct_c__SA___sigset_t._pack_ = 1 # source:False
  389. struct_c__SA___sigset_t._fields_ = [
  390. ('__val', ctypes.c_uint64 * 16),
  391. ]
  392. try:
  393. io_uring_wait_cqes = _libraries['FIXME_STUB'].io_uring_wait_cqes
  394. io_uring_wait_cqes.restype = ctypes.c_int32
  395. io_uring_wait_cqes.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(ctypes.POINTER(struct_io_uring_cqe)), ctypes.c_uint32, ctypes.POINTER(struct___kernel_timespec), ctypes.POINTER(struct_c__SA___sigset_t)]
  396. except AttributeError:
  397. pass
  398. try:
  399. io_uring_wait_cqe_timeout = _libraries['FIXME_STUB'].io_uring_wait_cqe_timeout
  400. io_uring_wait_cqe_timeout.restype = ctypes.c_int32
  401. io_uring_wait_cqe_timeout.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(ctypes.POINTER(struct_io_uring_cqe)), ctypes.POINTER(struct___kernel_timespec)]
  402. except AttributeError:
  403. pass
  404. try:
  405. io_uring_submit = _libraries['FIXME_STUB'].io_uring_submit
  406. io_uring_submit.restype = ctypes.c_int32
  407. io_uring_submit.argtypes = [ctypes.POINTER(struct_io_uring)]
  408. except AttributeError:
  409. pass
  410. try:
  411. io_uring_submit_and_wait = _libraries['FIXME_STUB'].io_uring_submit_and_wait
  412. io_uring_submit_and_wait.restype = ctypes.c_int32
  413. io_uring_submit_and_wait.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.c_uint32]
  414. except AttributeError:
  415. pass
  416. try:
  417. io_uring_get_sqe = _libraries['FIXME_STUB'].io_uring_get_sqe
  418. io_uring_get_sqe.restype = ctypes.POINTER(struct_io_uring_sqe)
  419. io_uring_get_sqe.argtypes = [ctypes.POINTER(struct_io_uring)]
  420. except AttributeError:
  421. pass
  422. class struct_iovec(Structure):
  423. pass
  424. struct_iovec._pack_ = 1 # source:False
  425. struct_iovec._fields_ = [
  426. ('iov_base', ctypes.POINTER(None)),
  427. ('iov_len', ctypes.c_uint64),
  428. ]
  429. try:
  430. io_uring_register_buffers = _libraries['FIXME_STUB'].io_uring_register_buffers
  431. io_uring_register_buffers.restype = ctypes.c_int32
  432. io_uring_register_buffers.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(struct_iovec), ctypes.c_uint32]
  433. except AttributeError:
  434. pass
  435. try:
  436. io_uring_register_buffers_tags = _libraries['FIXME_STUB'].io_uring_register_buffers_tags
  437. io_uring_register_buffers_tags.restype = ctypes.c_int32
  438. io_uring_register_buffers_tags.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(struct_iovec), ctypes.POINTER(ctypes.c_uint64), ctypes.c_uint32]
  439. except AttributeError:
  440. pass
  441. try:
  442. io_uring_register_buffers_update_tag = _libraries['FIXME_STUB'].io_uring_register_buffers_update_tag
  443. io_uring_register_buffers_update_tag.restype = ctypes.c_int32
  444. io_uring_register_buffers_update_tag.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.c_uint32, ctypes.POINTER(struct_iovec), ctypes.POINTER(ctypes.c_uint64), ctypes.c_uint32]
  445. except AttributeError:
  446. pass
  447. try:
  448. io_uring_unregister_buffers = _libraries['FIXME_STUB'].io_uring_unregister_buffers
  449. io_uring_unregister_buffers.restype = ctypes.c_int32
  450. io_uring_unregister_buffers.argtypes = [ctypes.POINTER(struct_io_uring)]
  451. except AttributeError:
  452. pass
  453. try:
  454. io_uring_register_files = _libraries['FIXME_STUB'].io_uring_register_files
  455. io_uring_register_files.restype = ctypes.c_int32
  456. io_uring_register_files.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(ctypes.c_int32), ctypes.c_uint32]
  457. except AttributeError:
  458. pass
  459. try:
  460. io_uring_register_files_tags = _libraries['FIXME_STUB'].io_uring_register_files_tags
  461. io_uring_register_files_tags.restype = ctypes.c_int32
  462. io_uring_register_files_tags.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_uint64), ctypes.c_uint32]
  463. except AttributeError:
  464. pass
  465. try:
  466. io_uring_register_files_update_tag = _libraries['FIXME_STUB'].io_uring_register_files_update_tag
  467. io_uring_register_files_update_tag.restype = ctypes.c_int32
  468. io_uring_register_files_update_tag.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.c_uint32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_uint64), ctypes.c_uint32]
  469. except AttributeError:
  470. pass
  471. try:
  472. io_uring_unregister_files = _libraries['FIXME_STUB'].io_uring_unregister_files
  473. io_uring_unregister_files.restype = ctypes.c_int32
  474. io_uring_unregister_files.argtypes = [ctypes.POINTER(struct_io_uring)]
  475. except AttributeError:
  476. pass
  477. try:
  478. io_uring_register_files_update = _libraries['FIXME_STUB'].io_uring_register_files_update
  479. io_uring_register_files_update.restype = ctypes.c_int32
  480. io_uring_register_files_update.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.c_uint32, ctypes.POINTER(ctypes.c_int32), ctypes.c_uint32]
  481. except AttributeError:
  482. pass
  483. try:
  484. io_uring_register_eventfd = _libraries['FIXME_STUB'].io_uring_register_eventfd
  485. io_uring_register_eventfd.restype = ctypes.c_int32
  486. io_uring_register_eventfd.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.c_int32]
  487. except AttributeError:
  488. pass
  489. try:
  490. io_uring_register_eventfd_async = _libraries['FIXME_STUB'].io_uring_register_eventfd_async
  491. io_uring_register_eventfd_async.restype = ctypes.c_int32
  492. io_uring_register_eventfd_async.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.c_int32]
  493. except AttributeError:
  494. pass
  495. try:
  496. io_uring_unregister_eventfd = _libraries['FIXME_STUB'].io_uring_unregister_eventfd
  497. io_uring_unregister_eventfd.restype = ctypes.c_int32
  498. io_uring_unregister_eventfd.argtypes = [ctypes.POINTER(struct_io_uring)]
  499. except AttributeError:
  500. pass
  501. try:
  502. io_uring_register_probe = _libraries['FIXME_STUB'].io_uring_register_probe
  503. io_uring_register_probe.restype = ctypes.c_int32
  504. io_uring_register_probe.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(struct_io_uring_probe), ctypes.c_uint32]
  505. except AttributeError:
  506. pass
  507. try:
  508. io_uring_register_personality = _libraries['FIXME_STUB'].io_uring_register_personality
  509. io_uring_register_personality.restype = ctypes.c_int32
  510. io_uring_register_personality.argtypes = [ctypes.POINTER(struct_io_uring)]
  511. except AttributeError:
  512. pass
  513. try:
  514. io_uring_unregister_personality = _libraries['FIXME_STUB'].io_uring_unregister_personality
  515. io_uring_unregister_personality.restype = ctypes.c_int32
  516. io_uring_unregister_personality.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.c_int32]
  517. except AttributeError:
  518. pass
  519. class struct_io_uring_restriction(Structure):
  520. pass
  521. class union_io_uring_restriction_0(Union):
  522. pass
  523. union_io_uring_restriction_0._pack_ = 1 # source:False
  524. union_io_uring_restriction_0._fields_ = [
  525. ('register_op', ctypes.c_ubyte),
  526. ('sqe_op', ctypes.c_ubyte),
  527. ('sqe_flags', ctypes.c_ubyte),
  528. ]
  529. struct_io_uring_restriction._pack_ = 1 # source:False
  530. struct_io_uring_restriction._anonymous_ = ('_0',)
  531. struct_io_uring_restriction._fields_ = [
  532. ('opcode', ctypes.c_uint16),
  533. ('_0', union_io_uring_restriction_0),
  534. ('resv', ctypes.c_ubyte),
  535. ('resv2', ctypes.c_uint32 * 3),
  536. ]
  537. try:
  538. io_uring_register_restrictions = _libraries['FIXME_STUB'].io_uring_register_restrictions
  539. io_uring_register_restrictions.restype = ctypes.c_int32
  540. io_uring_register_restrictions.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(struct_io_uring_restriction), ctypes.c_uint32]
  541. except AttributeError:
  542. pass
  543. try:
  544. io_uring_enable_rings = _libraries['FIXME_STUB'].io_uring_enable_rings
  545. io_uring_enable_rings.restype = ctypes.c_int32
  546. io_uring_enable_rings.argtypes = [ctypes.POINTER(struct_io_uring)]
  547. except AttributeError:
  548. pass
  549. try:
  550. __io_uring_sqring_wait = _libraries['FIXME_STUB'].__io_uring_sqring_wait
  551. __io_uring_sqring_wait.restype = ctypes.c_int32
  552. __io_uring_sqring_wait.argtypes = [ctypes.POINTER(struct_io_uring)]
  553. except AttributeError:
  554. pass
  555. size_t = ctypes.c_uint64
  556. class struct_c__SA_cpu_set_t(Structure):
  557. pass
  558. struct_c__SA_cpu_set_t._pack_ = 1 # source:False
  559. struct_c__SA_cpu_set_t._fields_ = [
  560. ('__bits', ctypes.c_uint64 * 16),
  561. ]
  562. try:
  563. io_uring_register_iowq_aff = _libraries['FIXME_STUB'].io_uring_register_iowq_aff
  564. io_uring_register_iowq_aff.restype = ctypes.c_int32
  565. io_uring_register_iowq_aff.argtypes = [ctypes.POINTER(struct_io_uring), size_t, ctypes.POINTER(struct_c__SA_cpu_set_t)]
  566. except AttributeError:
  567. pass
  568. try:
  569. io_uring_unregister_iowq_aff = _libraries['FIXME_STUB'].io_uring_unregister_iowq_aff
  570. io_uring_unregister_iowq_aff.restype = ctypes.c_int32
  571. io_uring_unregister_iowq_aff.argtypes = [ctypes.POINTER(struct_io_uring)]
  572. except AttributeError:
  573. pass
  574. try:
  575. io_uring_register_iowq_max_workers = _libraries['FIXME_STUB'].io_uring_register_iowq_max_workers
  576. io_uring_register_iowq_max_workers.restype = ctypes.c_int32
  577. io_uring_register_iowq_max_workers.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(ctypes.c_uint32)]
  578. except AttributeError:
  579. pass
  580. try:
  581. __io_uring_get_cqe = _libraries['FIXME_STUB'].__io_uring_get_cqe
  582. __io_uring_get_cqe.restype = ctypes.c_int32
  583. __io_uring_get_cqe.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(ctypes.POINTER(struct_io_uring_cqe)), ctypes.c_uint32, ctypes.c_uint32, ctypes.POINTER(struct_c__SA___sigset_t)]
  584. except AttributeError:
  585. pass
  586. try:
  587. io_uring_cq_advance = _libraries['FIXME_STUB'].io_uring_cq_advance
  588. io_uring_cq_advance.restype = None
  589. io_uring_cq_advance.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.c_uint32]
  590. except AttributeError:
  591. pass
  592. try:
  593. io_uring_cqe_seen = _libraries['FIXME_STUB'].io_uring_cqe_seen
  594. io_uring_cqe_seen.restype = None
  595. io_uring_cqe_seen.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(struct_io_uring_cqe)]
  596. except AttributeError:
  597. pass
  598. try:
  599. io_uring_sqe_set_data = _libraries['FIXME_STUB'].io_uring_sqe_set_data
  600. io_uring_sqe_set_data.restype = None
  601. io_uring_sqe_set_data.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.POINTER(None)]
  602. except AttributeError:
  603. pass
  604. try:
  605. io_uring_cqe_get_data = _libraries['FIXME_STUB'].io_uring_cqe_get_data
  606. io_uring_cqe_get_data.restype = ctypes.POINTER(None)
  607. io_uring_cqe_get_data.argtypes = [ctypes.POINTER(struct_io_uring_cqe)]
  608. except AttributeError:
  609. pass
  610. try:
  611. io_uring_sqe_set_flags = _libraries['FIXME_STUB'].io_uring_sqe_set_flags
  612. io_uring_sqe_set_flags.restype = None
  613. io_uring_sqe_set_flags.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_uint32]
  614. except AttributeError:
  615. pass
  616. try:
  617. __io_uring_set_target_fixed_file = _libraries['FIXME_STUB'].__io_uring_set_target_fixed_file
  618. __io_uring_set_target_fixed_file.restype = None
  619. __io_uring_set_target_fixed_file.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_uint32]
  620. except AttributeError:
  621. pass
  622. __u64 = ctypes.c_uint64
  623. try:
  624. io_uring_prep_rw = _libraries['FIXME_STUB'].io_uring_prep_rw
  625. io_uring_prep_rw.restype = None
  626. io_uring_prep_rw.argtypes = [ctypes.c_int32, ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(None), ctypes.c_uint32, __u64]
  627. except AttributeError:
  628. pass
  629. int64_t = ctypes.c_int64
  630. try:
  631. io_uring_prep_splice = _libraries['FIXME_STUB'].io_uring_prep_splice
  632. io_uring_prep_splice.restype = None
  633. io_uring_prep_splice.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, int64_t, ctypes.c_int32, int64_t, ctypes.c_uint32, ctypes.c_uint32]
  634. except AttributeError:
  635. pass
  636. try:
  637. io_uring_prep_tee = _libraries['FIXME_STUB'].io_uring_prep_tee
  638. io_uring_prep_tee.restype = None
  639. io_uring_prep_tee.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.c_int32, ctypes.c_uint32, ctypes.c_uint32]
  640. except AttributeError:
  641. pass
  642. try:
  643. io_uring_prep_readv = _libraries['FIXME_STUB'].io_uring_prep_readv
  644. io_uring_prep_readv.restype = None
  645. io_uring_prep_readv.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(struct_iovec), ctypes.c_uint32, __u64]
  646. except AttributeError:
  647. pass
  648. try:
  649. io_uring_prep_read_fixed = _libraries['FIXME_STUB'].io_uring_prep_read_fixed
  650. io_uring_prep_read_fixed.restype = None
  651. io_uring_prep_read_fixed.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(None), ctypes.c_uint32, __u64, ctypes.c_int32]
  652. except AttributeError:
  653. pass
  654. try:
  655. io_uring_prep_writev = _libraries['FIXME_STUB'].io_uring_prep_writev
  656. io_uring_prep_writev.restype = None
  657. io_uring_prep_writev.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(struct_iovec), ctypes.c_uint32, __u64]
  658. except AttributeError:
  659. pass
  660. try:
  661. io_uring_prep_write_fixed = _libraries['FIXME_STUB'].io_uring_prep_write_fixed
  662. io_uring_prep_write_fixed.restype = None
  663. io_uring_prep_write_fixed.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(None), ctypes.c_uint32, __u64, ctypes.c_int32]
  664. except AttributeError:
  665. pass
  666. class struct_msghdr(Structure):
  667. pass
  668. struct_msghdr._pack_ = 1 # source:False
  669. struct_msghdr._fields_ = [
  670. ('msg_name', ctypes.POINTER(None)),
  671. ('msg_namelen', ctypes.c_uint32),
  672. ('PADDING_0', ctypes.c_ubyte * 4),
  673. ('msg_iov', ctypes.POINTER(struct_iovec)),
  674. ('msg_iovlen', ctypes.c_uint64),
  675. ('msg_control', ctypes.POINTER(None)),
  676. ('msg_controllen', ctypes.c_uint64),
  677. ('msg_flags', ctypes.c_int32),
  678. ('PADDING_1', ctypes.c_ubyte * 4),
  679. ]
  680. try:
  681. io_uring_prep_recvmsg = _libraries['FIXME_STUB'].io_uring_prep_recvmsg
  682. io_uring_prep_recvmsg.restype = None
  683. io_uring_prep_recvmsg.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(struct_msghdr), ctypes.c_uint32]
  684. except AttributeError:
  685. pass
  686. try:
  687. io_uring_prep_sendmsg = _libraries['FIXME_STUB'].io_uring_prep_sendmsg
  688. io_uring_prep_sendmsg.restype = None
  689. io_uring_prep_sendmsg.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(struct_msghdr), ctypes.c_uint32]
  690. except AttributeError:
  691. pass
  692. try:
  693. __io_uring_prep_poll_mask = _libraries['FIXME_STUB'].__io_uring_prep_poll_mask
  694. __io_uring_prep_poll_mask.restype = ctypes.c_uint32
  695. __io_uring_prep_poll_mask.argtypes = [ctypes.c_uint32]
  696. except AttributeError:
  697. pass
  698. try:
  699. io_uring_prep_poll_add = _libraries['FIXME_STUB'].io_uring_prep_poll_add
  700. io_uring_prep_poll_add.restype = None
  701. io_uring_prep_poll_add.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.c_uint32]
  702. except AttributeError:
  703. pass
  704. try:
  705. io_uring_prep_poll_multishot = _libraries['FIXME_STUB'].io_uring_prep_poll_multishot
  706. io_uring_prep_poll_multishot.restype = None
  707. io_uring_prep_poll_multishot.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.c_uint32]
  708. except AttributeError:
  709. pass
  710. try:
  711. io_uring_prep_poll_remove = _libraries['FIXME_STUB'].io_uring_prep_poll_remove
  712. io_uring_prep_poll_remove.restype = None
  713. io_uring_prep_poll_remove.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.POINTER(None)]
  714. except AttributeError:
  715. pass
  716. try:
  717. io_uring_prep_poll_update = _libraries['FIXME_STUB'].io_uring_prep_poll_update
  718. io_uring_prep_poll_update.restype = None
  719. io_uring_prep_poll_update.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.POINTER(None), ctypes.POINTER(None), ctypes.c_uint32, ctypes.c_uint32]
  720. except AttributeError:
  721. pass
  722. try:
  723. io_uring_prep_fsync = _libraries['FIXME_STUB'].io_uring_prep_fsync
  724. io_uring_prep_fsync.restype = None
  725. io_uring_prep_fsync.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.c_uint32]
  726. except AttributeError:
  727. pass
  728. try:
  729. io_uring_prep_nop = _libraries['FIXME_STUB'].io_uring_prep_nop
  730. io_uring_prep_nop.restype = None
  731. io_uring_prep_nop.argtypes = [ctypes.POINTER(struct_io_uring_sqe)]
  732. except AttributeError:
  733. pass
  734. try:
  735. io_uring_prep_timeout = _libraries['FIXME_STUB'].io_uring_prep_timeout
  736. io_uring_prep_timeout.restype = None
  737. io_uring_prep_timeout.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.POINTER(struct___kernel_timespec), ctypes.c_uint32, ctypes.c_uint32]
  738. except AttributeError:
  739. pass
  740. try:
  741. io_uring_prep_timeout_remove = _libraries['FIXME_STUB'].io_uring_prep_timeout_remove
  742. io_uring_prep_timeout_remove.restype = None
  743. io_uring_prep_timeout_remove.argtypes = [ctypes.POINTER(struct_io_uring_sqe), __u64, ctypes.c_uint32]
  744. except AttributeError:
  745. pass
  746. try:
  747. io_uring_prep_timeout_update = _libraries['FIXME_STUB'].io_uring_prep_timeout_update
  748. io_uring_prep_timeout_update.restype = None
  749. io_uring_prep_timeout_update.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.POINTER(struct___kernel_timespec), __u64, ctypes.c_uint32]
  750. except AttributeError:
  751. pass
  752. class struct_sockaddr(Structure):
  753. pass
  754. struct_sockaddr._pack_ = 1 # source:False
  755. struct_sockaddr._fields_ = [
  756. ('sa_family', ctypes.c_uint16),
  757. ('sa_data', ctypes.c_char * 14),
  758. ]
  759. try:
  760. io_uring_prep_accept = _libraries['FIXME_STUB'].io_uring_prep_accept
  761. io_uring_prep_accept.restype = None
  762. io_uring_prep_accept.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(struct_sockaddr), ctypes.POINTER(ctypes.c_uint32), ctypes.c_int32]
  763. except AttributeError:
  764. pass
  765. try:
  766. io_uring_prep_accept_direct = _libraries['FIXME_STUB'].io_uring_prep_accept_direct
  767. io_uring_prep_accept_direct.restype = None
  768. io_uring_prep_accept_direct.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(struct_sockaddr), ctypes.POINTER(ctypes.c_uint32), ctypes.c_int32, ctypes.c_uint32]
  769. except AttributeError:
  770. pass
  771. try:
  772. io_uring_prep_cancel = _libraries['FIXME_STUB'].io_uring_prep_cancel
  773. io_uring_prep_cancel.restype = None
  774. io_uring_prep_cancel.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.POINTER(None), ctypes.c_int32]
  775. except AttributeError:
  776. pass
  777. try:
  778. io_uring_prep_link_timeout = _libraries['FIXME_STUB'].io_uring_prep_link_timeout
  779. io_uring_prep_link_timeout.restype = None
  780. io_uring_prep_link_timeout.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.POINTER(struct___kernel_timespec), ctypes.c_uint32]
  781. except AttributeError:
  782. pass
  783. socklen_t = ctypes.c_uint32
  784. try:
  785. io_uring_prep_connect = _libraries['FIXME_STUB'].io_uring_prep_connect
  786. io_uring_prep_connect.restype = None
  787. io_uring_prep_connect.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(struct_sockaddr), socklen_t]
  788. except AttributeError:
  789. pass
  790. try:
  791. io_uring_prep_files_update = _libraries['FIXME_STUB'].io_uring_prep_files_update
  792. io_uring_prep_files_update.restype = None
  793. io_uring_prep_files_update.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.POINTER(ctypes.c_int32), ctypes.c_uint32, ctypes.c_int32]
  794. except AttributeError:
  795. pass
  796. off_t = ctypes.c_int64
  797. try:
  798. io_uring_prep_fallocate = _libraries['FIXME_STUB'].io_uring_prep_fallocate
  799. io_uring_prep_fallocate.restype = None
  800. io_uring_prep_fallocate.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.c_int32, off_t, off_t]
  801. except AttributeError:
  802. pass
  803. mode_t = ctypes.c_uint32
  804. try:
  805. io_uring_prep_openat = _libraries['FIXME_STUB'].io_uring_prep_openat
  806. io_uring_prep_openat.restype = None
  807. io_uring_prep_openat.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.c_int32, mode_t]
  808. except AttributeError:
  809. pass
  810. try:
  811. io_uring_prep_openat_direct = _libraries['FIXME_STUB'].io_uring_prep_openat_direct
  812. io_uring_prep_openat_direct.restype = None
  813. io_uring_prep_openat_direct.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.c_int32, mode_t, ctypes.c_uint32]
  814. except AttributeError:
  815. pass
  816. try:
  817. io_uring_prep_close = _libraries['FIXME_STUB'].io_uring_prep_close
  818. io_uring_prep_close.restype = None
  819. io_uring_prep_close.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32]
  820. except AttributeError:
  821. pass
  822. try:
  823. io_uring_prep_read = _libraries['FIXME_STUB'].io_uring_prep_read
  824. io_uring_prep_read.restype = None
  825. io_uring_prep_read.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(None), ctypes.c_uint32, __u64]
  826. except AttributeError:
  827. pass
  828. try:
  829. io_uring_prep_write = _libraries['FIXME_STUB'].io_uring_prep_write
  830. io_uring_prep_write.restype = None
  831. io_uring_prep_write.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(None), ctypes.c_uint32, __u64]
  832. except AttributeError:
  833. pass
  834. class struct_statx(Structure):
  835. pass
  836. try:
  837. io_uring_prep_statx = _libraries['FIXME_STUB'].io_uring_prep_statx
  838. io_uring_prep_statx.restype = None
  839. io_uring_prep_statx.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.c_int32, ctypes.c_uint32, ctypes.POINTER(struct_statx)]
  840. except AttributeError:
  841. pass
  842. try:
  843. io_uring_prep_fadvise = _libraries['FIXME_STUB'].io_uring_prep_fadvise
  844. io_uring_prep_fadvise.restype = None
  845. io_uring_prep_fadvise.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, __u64, off_t, ctypes.c_int32]
  846. except AttributeError:
  847. pass
  848. try:
  849. io_uring_prep_madvise = _libraries['FIXME_STUB'].io_uring_prep_madvise
  850. io_uring_prep_madvise.restype = None
  851. io_uring_prep_madvise.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.POINTER(None), off_t, ctypes.c_int32]
  852. except AttributeError:
  853. pass
  854. try:
  855. io_uring_prep_send = _libraries['FIXME_STUB'].io_uring_prep_send
  856. io_uring_prep_send.restype = None
  857. io_uring_prep_send.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(None), size_t, ctypes.c_int32]
  858. except AttributeError:
  859. pass
  860. try:
  861. io_uring_prep_recv = _libraries['FIXME_STUB'].io_uring_prep_recv
  862. io_uring_prep_recv.restype = None
  863. io_uring_prep_recv.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(None), size_t, ctypes.c_int32]
  864. except AttributeError:
  865. pass
  866. class struct_open_how(Structure):
  867. pass
  868. struct_open_how._pack_ = 1 # source:False
  869. struct_open_how._fields_ = [
  870. ('flags', ctypes.c_uint64),
  871. ('mode', ctypes.c_uint64),
  872. ('resolve', ctypes.c_uint64),
  873. ]
  874. try:
  875. io_uring_prep_openat2 = _libraries['FIXME_STUB'].io_uring_prep_openat2
  876. io_uring_prep_openat2.restype = None
  877. io_uring_prep_openat2.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(struct_open_how)]
  878. except AttributeError:
  879. pass
  880. try:
  881. io_uring_prep_openat2_direct = _libraries['FIXME_STUB'].io_uring_prep_openat2_direct
  882. io_uring_prep_openat2_direct.restype = None
  883. io_uring_prep_openat2_direct.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(struct_open_how), ctypes.c_uint32]
  884. except AttributeError:
  885. pass
  886. class struct_epoll_event(Structure):
  887. pass
  888. try:
  889. io_uring_prep_epoll_ctl = _libraries['FIXME_STUB'].io_uring_prep_epoll_ctl
  890. io_uring_prep_epoll_ctl.restype = None
  891. io_uring_prep_epoll_ctl.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.c_int32, ctypes.c_int32, ctypes.POINTER(struct_epoll_event)]
  892. except AttributeError:
  893. pass
  894. try:
  895. io_uring_prep_provide_buffers = _libraries['FIXME_STUB'].io_uring_prep_provide_buffers
  896. io_uring_prep_provide_buffers.restype = None
  897. io_uring_prep_provide_buffers.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.POINTER(None), ctypes.c_int32, ctypes.c_int32, ctypes.c_int32, ctypes.c_int32]
  898. except AttributeError:
  899. pass
  900. try:
  901. io_uring_prep_remove_buffers = _libraries['FIXME_STUB'].io_uring_prep_remove_buffers
  902. io_uring_prep_remove_buffers.restype = None
  903. io_uring_prep_remove_buffers.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.c_int32]
  904. except AttributeError:
  905. pass
  906. try:
  907. io_uring_prep_shutdown = _libraries['FIXME_STUB'].io_uring_prep_shutdown
  908. io_uring_prep_shutdown.restype = None
  909. io_uring_prep_shutdown.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.c_int32]
  910. except AttributeError:
  911. pass
  912. try:
  913. io_uring_prep_unlinkat = _libraries['FIXME_STUB'].io_uring_prep_unlinkat
  914. io_uring_prep_unlinkat.restype = None
  915. io_uring_prep_unlinkat.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.c_int32]
  916. except AttributeError:
  917. pass
  918. try:
  919. io_uring_prep_renameat = _libraries['FIXME_STUB'].io_uring_prep_renameat
  920. io_uring_prep_renameat.restype = None
  921. io_uring_prep_renameat.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.c_int32]
  922. except AttributeError:
  923. pass
  924. try:
  925. io_uring_prep_sync_file_range = _libraries['FIXME_STUB'].io_uring_prep_sync_file_range
  926. io_uring_prep_sync_file_range.restype = None
  927. io_uring_prep_sync_file_range.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.c_uint32, __u64, ctypes.c_int32]
  928. except AttributeError:
  929. pass
  930. try:
  931. io_uring_prep_mkdirat = _libraries['FIXME_STUB'].io_uring_prep_mkdirat
  932. io_uring_prep_mkdirat.restype = None
  933. io_uring_prep_mkdirat.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), mode_t]
  934. except AttributeError:
  935. pass
  936. try:
  937. io_uring_prep_symlinkat = _libraries['FIXME_STUB'].io_uring_prep_symlinkat
  938. io_uring_prep_symlinkat.restype = None
  939. io_uring_prep_symlinkat.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.POINTER(ctypes.c_char), ctypes.c_int32, ctypes.POINTER(ctypes.c_char)]
  940. except AttributeError:
  941. pass
  942. try:
  943. io_uring_prep_linkat = _libraries['FIXME_STUB'].io_uring_prep_linkat
  944. io_uring_prep_linkat.restype = None
  945. io_uring_prep_linkat.argtypes = [ctypes.POINTER(struct_io_uring_sqe), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.c_int32]
  946. except AttributeError:
  947. pass
  948. try:
  949. io_uring_sq_ready = _libraries['FIXME_STUB'].io_uring_sq_ready
  950. io_uring_sq_ready.restype = ctypes.c_uint32
  951. io_uring_sq_ready.argtypes = [ctypes.POINTER(struct_io_uring)]
  952. except AttributeError:
  953. pass
  954. try:
  955. io_uring_sq_space_left = _libraries['FIXME_STUB'].io_uring_sq_space_left
  956. io_uring_sq_space_left.restype = ctypes.c_uint32
  957. io_uring_sq_space_left.argtypes = [ctypes.POINTER(struct_io_uring)]
  958. except AttributeError:
  959. pass
  960. try:
  961. io_uring_sqring_wait = _libraries['FIXME_STUB'].io_uring_sqring_wait
  962. io_uring_sqring_wait.restype = ctypes.c_int32
  963. io_uring_sqring_wait.argtypes = [ctypes.POINTER(struct_io_uring)]
  964. except AttributeError:
  965. pass
  966. try:
  967. io_uring_cq_ready = _libraries['FIXME_STUB'].io_uring_cq_ready
  968. io_uring_cq_ready.restype = ctypes.c_uint32
  969. io_uring_cq_ready.argtypes = [ctypes.POINTER(struct_io_uring)]
  970. except AttributeError:
  971. pass
  972. try:
  973. io_uring_cq_eventfd_enabled = _libraries['FIXME_STUB'].io_uring_cq_eventfd_enabled
  974. io_uring_cq_eventfd_enabled.restype = ctypes.c_bool
  975. io_uring_cq_eventfd_enabled.argtypes = [ctypes.POINTER(struct_io_uring)]
  976. except AttributeError:
  977. pass
  978. try:
  979. io_uring_cq_eventfd_toggle = _libraries['FIXME_STUB'].io_uring_cq_eventfd_toggle
  980. io_uring_cq_eventfd_toggle.restype = ctypes.c_int32
  981. io_uring_cq_eventfd_toggle.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.c_bool]
  982. except AttributeError:
  983. pass
  984. try:
  985. io_uring_wait_cqe_nr = _libraries['FIXME_STUB'].io_uring_wait_cqe_nr
  986. io_uring_wait_cqe_nr.restype = ctypes.c_int32
  987. io_uring_wait_cqe_nr.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(ctypes.POINTER(struct_io_uring_cqe)), ctypes.c_uint32]
  988. except AttributeError:
  989. pass
  990. try:
  991. io_uring_peek_cqe = _libraries['FIXME_STUB'].io_uring_peek_cqe
  992. io_uring_peek_cqe.restype = ctypes.c_int32
  993. io_uring_peek_cqe.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(ctypes.POINTER(struct_io_uring_cqe))]
  994. except AttributeError:
  995. pass
  996. try:
  997. io_uring_wait_cqe = _libraries['FIXME_STUB'].io_uring_wait_cqe
  998. io_uring_wait_cqe.restype = ctypes.c_int32
  999. io_uring_wait_cqe.argtypes = [ctypes.POINTER(struct_io_uring), ctypes.POINTER(ctypes.POINTER(struct_io_uring_cqe))]
  1000. except AttributeError:
  1001. pass
  1002. ssize_t = ctypes.c_int64
  1003. try:
  1004. io_uring_mlock_size = _libraries['FIXME_STUB'].io_uring_mlock_size
  1005. io_uring_mlock_size.restype = ssize_t
  1006. io_uring_mlock_size.argtypes = [ctypes.c_uint32, ctypes.c_uint32]
  1007. except AttributeError:
  1008. pass
  1009. try:
  1010. io_uring_mlock_size_params = _libraries['FIXME_STUB'].io_uring_mlock_size_params
  1011. io_uring_mlock_size_params.restype = ssize_t
  1012. io_uring_mlock_size_params.argtypes = [ctypes.c_uint32, ctypes.POINTER(struct_io_uring_params)]
  1013. except AttributeError:
  1014. pass
  1015. # values for enumeration 'c__Ea_IOSQE_FIXED_FILE_BIT'
  1016. c__Ea_IOSQE_FIXED_FILE_BIT__enumvalues = {
  1017. 0: 'IOSQE_FIXED_FILE_BIT',
  1018. 1: 'IOSQE_IO_DRAIN_BIT',
  1019. 2: 'IOSQE_IO_LINK_BIT',
  1020. 3: 'IOSQE_IO_HARDLINK_BIT',
  1021. 4: 'IOSQE_ASYNC_BIT',
  1022. 5: 'IOSQE_BUFFER_SELECT_BIT',
  1023. }
  1024. IOSQE_FIXED_FILE_BIT = 0
  1025. IOSQE_IO_DRAIN_BIT = 1
  1026. IOSQE_IO_LINK_BIT = 2
  1027. IOSQE_IO_HARDLINK_BIT = 3
  1028. IOSQE_ASYNC_BIT = 4
  1029. IOSQE_BUFFER_SELECT_BIT = 5
  1030. c__Ea_IOSQE_FIXED_FILE_BIT = ctypes.c_uint32 # enum
  1031. # values for enumeration 'c__Ea_IORING_OP_NOP'
  1032. c__Ea_IORING_OP_NOP__enumvalues = {
  1033. 0: 'IORING_OP_NOP',
  1034. 1: 'IORING_OP_READV',
  1035. 2: 'IORING_OP_WRITEV',
  1036. 3: 'IORING_OP_FSYNC',
  1037. 4: 'IORING_OP_READ_FIXED',
  1038. 5: 'IORING_OP_WRITE_FIXED',
  1039. 6: 'IORING_OP_POLL_ADD',
  1040. 7: 'IORING_OP_POLL_REMOVE',
  1041. 8: 'IORING_OP_SYNC_FILE_RANGE',
  1042. 9: 'IORING_OP_SENDMSG',
  1043. 10: 'IORING_OP_RECVMSG',
  1044. 11: 'IORING_OP_TIMEOUT',
  1045. 12: 'IORING_OP_TIMEOUT_REMOVE',
  1046. 13: 'IORING_OP_ACCEPT',
  1047. 14: 'IORING_OP_ASYNC_CANCEL',
  1048. 15: 'IORING_OP_LINK_TIMEOUT',
  1049. 16: 'IORING_OP_CONNECT',
  1050. 17: 'IORING_OP_FALLOCATE',
  1051. 18: 'IORING_OP_OPENAT',
  1052. 19: 'IORING_OP_CLOSE',
  1053. 20: 'IORING_OP_FILES_UPDATE',
  1054. 21: 'IORING_OP_STATX',
  1055. 22: 'IORING_OP_READ',
  1056. 23: 'IORING_OP_WRITE',
  1057. 24: 'IORING_OP_FADVISE',
  1058. 25: 'IORING_OP_MADVISE',
  1059. 26: 'IORING_OP_SEND',
  1060. 27: 'IORING_OP_RECV',
  1061. 28: 'IORING_OP_OPENAT2',
  1062. 29: 'IORING_OP_EPOLL_CTL',
  1063. 30: 'IORING_OP_SPLICE',
  1064. 31: 'IORING_OP_PROVIDE_BUFFERS',
  1065. 32: 'IORING_OP_REMOVE_BUFFERS',
  1066. 33: 'IORING_OP_TEE',
  1067. 34: 'IORING_OP_SHUTDOWN',
  1068. 35: 'IORING_OP_RENAMEAT',
  1069. 36: 'IORING_OP_UNLINKAT',
  1070. 37: 'IORING_OP_MKDIRAT',
  1071. 38: 'IORING_OP_SYMLINKAT',
  1072. 39: 'IORING_OP_LINKAT',
  1073. 40: 'IORING_OP_LAST',
  1074. }
  1075. IORING_OP_NOP = 0
  1076. IORING_OP_READV = 1
  1077. IORING_OP_WRITEV = 2
  1078. IORING_OP_FSYNC = 3
  1079. IORING_OP_READ_FIXED = 4
  1080. IORING_OP_WRITE_FIXED = 5
  1081. IORING_OP_POLL_ADD = 6
  1082. IORING_OP_POLL_REMOVE = 7
  1083. IORING_OP_SYNC_FILE_RANGE = 8
  1084. IORING_OP_SENDMSG = 9
  1085. IORING_OP_RECVMSG = 10
  1086. IORING_OP_TIMEOUT = 11
  1087. IORING_OP_TIMEOUT_REMOVE = 12
  1088. IORING_OP_ACCEPT = 13
  1089. IORING_OP_ASYNC_CANCEL = 14
  1090. IORING_OP_LINK_TIMEOUT = 15
  1091. IORING_OP_CONNECT = 16
  1092. IORING_OP_FALLOCATE = 17
  1093. IORING_OP_OPENAT = 18
  1094. IORING_OP_CLOSE = 19
  1095. IORING_OP_FILES_UPDATE = 20
  1096. IORING_OP_STATX = 21
  1097. IORING_OP_READ = 22
  1098. IORING_OP_WRITE = 23
  1099. IORING_OP_FADVISE = 24
  1100. IORING_OP_MADVISE = 25
  1101. IORING_OP_SEND = 26
  1102. IORING_OP_RECV = 27
  1103. IORING_OP_OPENAT2 = 28
  1104. IORING_OP_EPOLL_CTL = 29
  1105. IORING_OP_SPLICE = 30
  1106. IORING_OP_PROVIDE_BUFFERS = 31
  1107. IORING_OP_REMOVE_BUFFERS = 32
  1108. IORING_OP_TEE = 33
  1109. IORING_OP_SHUTDOWN = 34
  1110. IORING_OP_RENAMEAT = 35
  1111. IORING_OP_UNLINKAT = 36
  1112. IORING_OP_MKDIRAT = 37
  1113. IORING_OP_SYMLINKAT = 38
  1114. IORING_OP_LINKAT = 39
  1115. IORING_OP_LAST = 40
  1116. c__Ea_IORING_OP_NOP = ctypes.c_uint32 # enum
  1117. # values for enumeration 'c__Ea_IORING_CQE_BUFFER_SHIFT'
  1118. c__Ea_IORING_CQE_BUFFER_SHIFT__enumvalues = {
  1119. 16: 'IORING_CQE_BUFFER_SHIFT',
  1120. }
  1121. IORING_CQE_BUFFER_SHIFT = 16
  1122. c__Ea_IORING_CQE_BUFFER_SHIFT = ctypes.c_uint32 # enum
  1123. # values for enumeration 'c__Ea_IORING_REGISTER_BUFFERS'
  1124. c__Ea_IORING_REGISTER_BUFFERS__enumvalues = {
  1125. 0: 'IORING_REGISTER_BUFFERS',
  1126. 1: 'IORING_UNREGISTER_BUFFERS',
  1127. 2: 'IORING_REGISTER_FILES',
  1128. 3: 'IORING_UNREGISTER_FILES',
  1129. 4: 'IORING_REGISTER_EVENTFD',
  1130. 5: 'IORING_UNREGISTER_EVENTFD',
  1131. 6: 'IORING_REGISTER_FILES_UPDATE',
  1132. 7: 'IORING_REGISTER_EVENTFD_ASYNC',
  1133. 8: 'IORING_REGISTER_PROBE',
  1134. 9: 'IORING_REGISTER_PERSONALITY',
  1135. 10: 'IORING_UNREGISTER_PERSONALITY',
  1136. 11: 'IORING_REGISTER_RESTRICTIONS',
  1137. 12: 'IORING_REGISTER_ENABLE_RINGS',
  1138. 13: 'IORING_REGISTER_FILES2',
  1139. 14: 'IORING_REGISTER_FILES_UPDATE2',
  1140. 15: 'IORING_REGISTER_BUFFERS2',
  1141. 16: 'IORING_REGISTER_BUFFERS_UPDATE',
  1142. 17: 'IORING_REGISTER_IOWQ_AFF',
  1143. 18: 'IORING_UNREGISTER_IOWQ_AFF',
  1144. 19: 'IORING_REGISTER_IOWQ_MAX_WORKERS',
  1145. 20: 'IORING_REGISTER_LAST',
  1146. }
  1147. IORING_REGISTER_BUFFERS = 0
  1148. IORING_UNREGISTER_BUFFERS = 1
  1149. IORING_REGISTER_FILES = 2
  1150. IORING_UNREGISTER_FILES = 3
  1151. IORING_REGISTER_EVENTFD = 4
  1152. IORING_UNREGISTER_EVENTFD = 5
  1153. IORING_REGISTER_FILES_UPDATE = 6
  1154. IORING_REGISTER_EVENTFD_ASYNC = 7
  1155. IORING_REGISTER_PROBE = 8
  1156. IORING_REGISTER_PERSONALITY = 9
  1157. IORING_UNREGISTER_PERSONALITY = 10
  1158. IORING_REGISTER_RESTRICTIONS = 11
  1159. IORING_REGISTER_ENABLE_RINGS = 12
  1160. IORING_REGISTER_FILES2 = 13
  1161. IORING_REGISTER_FILES_UPDATE2 = 14
  1162. IORING_REGISTER_BUFFERS2 = 15
  1163. IORING_REGISTER_BUFFERS_UPDATE = 16
  1164. IORING_REGISTER_IOWQ_AFF = 17
  1165. IORING_UNREGISTER_IOWQ_AFF = 18
  1166. IORING_REGISTER_IOWQ_MAX_WORKERS = 19
  1167. IORING_REGISTER_LAST = 20
  1168. c__Ea_IORING_REGISTER_BUFFERS = ctypes.c_uint32 # enum
  1169. # values for enumeration 'c__Ea_IO_WQ_BOUND'
  1170. c__Ea_IO_WQ_BOUND__enumvalues = {
  1171. 0: 'IO_WQ_BOUND',
  1172. 1: 'IO_WQ_UNBOUND',
  1173. }
  1174. IO_WQ_BOUND = 0
  1175. IO_WQ_UNBOUND = 1
  1176. c__Ea_IO_WQ_BOUND = ctypes.c_uint32 # enum
  1177. class struct_io_uring_files_update(Structure):
  1178. pass
  1179. struct_io_uring_files_update._pack_ = 1 # source:False
  1180. struct_io_uring_files_update._fields_ = [
  1181. ('offset', ctypes.c_uint32),
  1182. ('resv', ctypes.c_uint32),
  1183. ('fds', ctypes.c_uint64),
  1184. ]
  1185. class struct_io_uring_rsrc_register(Structure):
  1186. pass
  1187. struct_io_uring_rsrc_register._pack_ = 1 # source:False
  1188. struct_io_uring_rsrc_register._fields_ = [
  1189. ('nr', ctypes.c_uint32),
  1190. ('resv', ctypes.c_uint32),
  1191. ('resv2', ctypes.c_uint64),
  1192. ('data', ctypes.c_uint64),
  1193. ('tags', ctypes.c_uint64),
  1194. ]
  1195. class struct_io_uring_rsrc_update(Structure):
  1196. pass
  1197. struct_io_uring_rsrc_update._pack_ = 1 # source:False
  1198. struct_io_uring_rsrc_update._fields_ = [
  1199. ('offset', ctypes.c_uint32),
  1200. ('resv', ctypes.c_uint32),
  1201. ('data', ctypes.c_uint64),
  1202. ]
  1203. class struct_io_uring_rsrc_update2(Structure):
  1204. pass
  1205. struct_io_uring_rsrc_update2._pack_ = 1 # source:False
  1206. struct_io_uring_rsrc_update2._fields_ = [
  1207. ('offset', ctypes.c_uint32),
  1208. ('resv', ctypes.c_uint32),
  1209. ('data', ctypes.c_uint64),
  1210. ('tags', ctypes.c_uint64),
  1211. ('nr', ctypes.c_uint32),
  1212. ('resv2', ctypes.c_uint32),
  1213. ]
  1214. # values for enumeration 'c__Ea_IORING_RESTRICTION_REGISTER_OP'
  1215. c__Ea_IORING_RESTRICTION_REGISTER_OP__enumvalues = {
  1216. 0: 'IORING_RESTRICTION_REGISTER_OP',
  1217. 1: 'IORING_RESTRICTION_SQE_OP',
  1218. 2: 'IORING_RESTRICTION_SQE_FLAGS_ALLOWED',
  1219. 3: 'IORING_RESTRICTION_SQE_FLAGS_REQUIRED',
  1220. 4: 'IORING_RESTRICTION_LAST',
  1221. }
  1222. IORING_RESTRICTION_REGISTER_OP = 0
  1223. IORING_RESTRICTION_SQE_OP = 1
  1224. IORING_RESTRICTION_SQE_FLAGS_ALLOWED = 2
  1225. IORING_RESTRICTION_SQE_FLAGS_REQUIRED = 3
  1226. IORING_RESTRICTION_LAST = 4
  1227. c__Ea_IORING_RESTRICTION_REGISTER_OP = ctypes.c_uint32 # enum
  1228. class struct_io_uring_getevents_arg(Structure):
  1229. pass
  1230. struct_io_uring_getevents_arg._pack_ = 1 # source:False
  1231. struct_io_uring_getevents_arg._fields_ = [
  1232. ('sigmask', ctypes.c_uint64),
  1233. ('sigmask_sz', ctypes.c_uint32),
  1234. ('pad', ctypes.c_uint32),
  1235. ('ts', ctypes.c_uint64),
  1236. ]
  1237. __all__ = \
  1238. ['IORING_CQE_BUFFER_SHIFT', 'IORING_OP_ACCEPT',
  1239. 'IORING_OP_ASYNC_CANCEL', 'IORING_OP_CLOSE', 'IORING_OP_CONNECT',
  1240. 'IORING_OP_EPOLL_CTL', 'IORING_OP_FADVISE', 'IORING_OP_FALLOCATE',
  1241. 'IORING_OP_FILES_UPDATE', 'IORING_OP_FSYNC', 'IORING_OP_LAST',
  1242. 'IORING_OP_LINKAT', 'IORING_OP_LINK_TIMEOUT', 'IORING_OP_MADVISE',
  1243. 'IORING_OP_MKDIRAT', 'IORING_OP_NOP', 'IORING_OP_OPENAT',
  1244. 'IORING_OP_OPENAT2', 'IORING_OP_POLL_ADD',
  1245. 'IORING_OP_POLL_REMOVE', 'IORING_OP_PROVIDE_BUFFERS',
  1246. 'IORING_OP_READ', 'IORING_OP_READV', 'IORING_OP_READ_FIXED',
  1247. 'IORING_OP_RECV', 'IORING_OP_RECVMSG', 'IORING_OP_REMOVE_BUFFERS',
  1248. 'IORING_OP_RENAMEAT', 'IORING_OP_SEND', 'IORING_OP_SENDMSG',
  1249. 'IORING_OP_SHUTDOWN', 'IORING_OP_SPLICE', 'IORING_OP_STATX',
  1250. 'IORING_OP_SYMLINKAT', 'IORING_OP_SYNC_FILE_RANGE',
  1251. 'IORING_OP_TEE', 'IORING_OP_TIMEOUT', 'IORING_OP_TIMEOUT_REMOVE',
  1252. 'IORING_OP_UNLINKAT', 'IORING_OP_WRITE', 'IORING_OP_WRITEV',
  1253. 'IORING_OP_WRITE_FIXED', 'IORING_REGISTER_BUFFERS',
  1254. 'IORING_REGISTER_BUFFERS2', 'IORING_REGISTER_BUFFERS_UPDATE',
  1255. 'IORING_REGISTER_ENABLE_RINGS', 'IORING_REGISTER_EVENTFD',
  1256. 'IORING_REGISTER_EVENTFD_ASYNC', 'IORING_REGISTER_FILES',
  1257. 'IORING_REGISTER_FILES2', 'IORING_REGISTER_FILES_UPDATE',
  1258. 'IORING_REGISTER_FILES_UPDATE2', 'IORING_REGISTER_IOWQ_AFF',
  1259. 'IORING_REGISTER_IOWQ_MAX_WORKERS', 'IORING_REGISTER_LAST',
  1260. 'IORING_REGISTER_PERSONALITY', 'IORING_REGISTER_PROBE',
  1261. 'IORING_REGISTER_RESTRICTIONS', 'IORING_RESTRICTION_LAST',
  1262. 'IORING_RESTRICTION_REGISTER_OP',
  1263. 'IORING_RESTRICTION_SQE_FLAGS_ALLOWED',
  1264. 'IORING_RESTRICTION_SQE_FLAGS_REQUIRED',
  1265. 'IORING_RESTRICTION_SQE_OP', 'IORING_UNREGISTER_BUFFERS',
  1266. 'IORING_UNREGISTER_EVENTFD', 'IORING_UNREGISTER_FILES',
  1267. 'IORING_UNREGISTER_IOWQ_AFF', 'IORING_UNREGISTER_PERSONALITY',
  1268. 'IOSQE_ASYNC_BIT', 'IOSQE_BUFFER_SELECT_BIT',
  1269. 'IOSQE_FIXED_FILE_BIT', 'IOSQE_IO_DRAIN_BIT',
  1270. 'IOSQE_IO_HARDLINK_BIT', 'IOSQE_IO_LINK_BIT', 'IO_WQ_BOUND',
  1271. 'IO_WQ_UNBOUND', '__io_uring_get_cqe',
  1272. '__io_uring_prep_poll_mask', '__io_uring_set_target_fixed_file',
  1273. '__io_uring_sqring_wait', '__u64',
  1274. 'c__Ea_IORING_CQE_BUFFER_SHIFT', 'c__Ea_IORING_OP_NOP',
  1275. 'c__Ea_IORING_REGISTER_BUFFERS',
  1276. 'c__Ea_IORING_RESTRICTION_REGISTER_OP',
  1277. 'c__Ea_IOSQE_FIXED_FILE_BIT', 'c__Ea_IO_WQ_BOUND', 'int64_t',
  1278. 'io_uring_cq_advance', 'io_uring_cq_eventfd_enabled',
  1279. 'io_uring_cq_eventfd_toggle', 'io_uring_cq_ready',
  1280. 'io_uring_cqe_get_data', 'io_uring_cqe_seen',
  1281. 'io_uring_enable_rings', 'io_uring_free_probe',
  1282. 'io_uring_get_probe', 'io_uring_get_probe_ring',
  1283. 'io_uring_get_sqe', 'io_uring_mlock_size',
  1284. 'io_uring_mlock_size_params', 'io_uring_opcode_supported',
  1285. 'io_uring_peek_batch_cqe', 'io_uring_peek_cqe',
  1286. 'io_uring_prep_accept', 'io_uring_prep_accept_direct',
  1287. 'io_uring_prep_cancel', 'io_uring_prep_close',
  1288. 'io_uring_prep_connect', 'io_uring_prep_epoll_ctl',
  1289. 'io_uring_prep_fadvise', 'io_uring_prep_fallocate',
  1290. 'io_uring_prep_files_update', 'io_uring_prep_fsync',
  1291. 'io_uring_prep_link_timeout', 'io_uring_prep_linkat',
  1292. 'io_uring_prep_madvise', 'io_uring_prep_mkdirat',
  1293. 'io_uring_prep_nop', 'io_uring_prep_openat',
  1294. 'io_uring_prep_openat2', 'io_uring_prep_openat2_direct',
  1295. 'io_uring_prep_openat_direct', 'io_uring_prep_poll_add',
  1296. 'io_uring_prep_poll_multishot', 'io_uring_prep_poll_remove',
  1297. 'io_uring_prep_poll_update', 'io_uring_prep_provide_buffers',
  1298. 'io_uring_prep_read', 'io_uring_prep_read_fixed',
  1299. 'io_uring_prep_readv', 'io_uring_prep_recv',
  1300. 'io_uring_prep_recvmsg', 'io_uring_prep_remove_buffers',
  1301. 'io_uring_prep_renameat', 'io_uring_prep_rw',
  1302. 'io_uring_prep_send', 'io_uring_prep_sendmsg',
  1303. 'io_uring_prep_shutdown', 'io_uring_prep_splice',
  1304. 'io_uring_prep_statx', 'io_uring_prep_symlinkat',
  1305. 'io_uring_prep_sync_file_range', 'io_uring_prep_tee',
  1306. 'io_uring_prep_timeout', 'io_uring_prep_timeout_remove',
  1307. 'io_uring_prep_timeout_update', 'io_uring_prep_unlinkat',
  1308. 'io_uring_prep_write', 'io_uring_prep_write_fixed',
  1309. 'io_uring_prep_writev', 'io_uring_queue_exit',
  1310. 'io_uring_queue_init', 'io_uring_queue_init_params',
  1311. 'io_uring_queue_mmap', 'io_uring_register_buffers',
  1312. 'io_uring_register_buffers_tags',
  1313. 'io_uring_register_buffers_update_tag',
  1314. 'io_uring_register_eventfd', 'io_uring_register_eventfd_async',
  1315. 'io_uring_register_files', 'io_uring_register_files_tags',
  1316. 'io_uring_register_files_update',
  1317. 'io_uring_register_files_update_tag',
  1318. 'io_uring_register_iowq_aff',
  1319. 'io_uring_register_iowq_max_workers',
  1320. 'io_uring_register_personality', 'io_uring_register_probe',
  1321. 'io_uring_register_restrictions', 'io_uring_ring_dontfork',
  1322. 'io_uring_sq_ready', 'io_uring_sq_space_left',
  1323. 'io_uring_sqe_set_data', 'io_uring_sqe_set_flags',
  1324. 'io_uring_sqring_wait', 'io_uring_submit',
  1325. 'io_uring_submit_and_wait', 'io_uring_unregister_buffers',
  1326. 'io_uring_unregister_eventfd', 'io_uring_unregister_files',
  1327. 'io_uring_unregister_iowq_aff', 'io_uring_unregister_personality',
  1328. 'io_uring_wait_cqe', 'io_uring_wait_cqe_nr',
  1329. 'io_uring_wait_cqe_timeout', 'io_uring_wait_cqes', 'mode_t',
  1330. 'off_t', 'size_t', 'socklen_t', 'ssize_t',
  1331. 'struct___kernel_timespec', 'struct_c__SA___sigset_t',
  1332. 'struct_c__SA_cpu_set_t', 'struct_epoll_event',
  1333. 'struct_io_cqring_offsets', 'struct_io_sqring_offsets',
  1334. 'struct_io_uring', 'struct_io_uring_cq', 'struct_io_uring_cqe',
  1335. 'struct_io_uring_files_update', 'struct_io_uring_getevents_arg',
  1336. 'struct_io_uring_params', 'struct_io_uring_probe',
  1337. 'struct_io_uring_probe_op', 'struct_io_uring_restriction',
  1338. 'struct_io_uring_rsrc_register', 'struct_io_uring_rsrc_update',
  1339. 'struct_io_uring_rsrc_update2', 'struct_io_uring_sq',
  1340. 'struct_io_uring_sqe', 'struct_iovec', 'struct_msghdr',
  1341. 'struct_open_how', 'struct_sockaddr', 'struct_statx',
  1342. 'union_io_uring_restriction_0', 'union_io_uring_sqe_0',
  1343. 'union_io_uring_sqe_1', 'union_io_uring_sqe_2',
  1344. 'union_io_uring_sqe_3', 'union_io_uring_sqe_4']
  1345. NR_io_uring_setup = 425
  1346. NR_io_uring_enter = 426
  1347. NR_io_uring_register = 427
  1348. IOSQE_FIXED_FILE = (1 << IOSQE_FIXED_FILE_BIT)
  1349. IOSQE_IO_DRAIN = (1 << IOSQE_IO_DRAIN_BIT)
  1350. IOSQE_IO_LINK = (1 << IOSQE_IO_LINK_BIT)
  1351. IOSQE_IO_HARDLINK = (1 << IOSQE_IO_HARDLINK_BIT)
  1352. IOSQE_ASYNC = (1 << IOSQE_ASYNC_BIT)
  1353. IOSQE_BUFFER_SELECT = (1 << IOSQE_BUFFER_SELECT_BIT)
  1354. IORING_SETUP_IOPOLL = (1 << 0)
  1355. IORING_SETUP_SQPOLL = (1 << 1)
  1356. IORING_SETUP_SQ_AFF = (1 << 2)
  1357. IORING_SETUP_CQSIZE = (1 << 3)
  1358. IORING_SETUP_CLAMP = (1 << 4)
  1359. IORING_SETUP_ATTACH_WQ = (1 << 5)
  1360. IORING_SETUP_R_DISABLED = (1 << 6)
  1361. IORING_FSYNC_DATASYNC = (1 << 0)
  1362. IORING_TIMEOUT_ABS = (1 << 0)
  1363. IORING_TIMEOUT_UPDATE = (1 << 1)
  1364. IORING_TIMEOUT_BOOTTIME = (1 << 2)
  1365. IORING_TIMEOUT_REALTIME = (1 << 3)
  1366. IORING_LINK_TIMEOUT_UPDATE = (1 << 4)
  1367. IORING_TIMEOUT_CLOCK_MASK = (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME)
  1368. IORING_TIMEOUT_UPDATE_MASK = (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE)
  1369. SPLICE_F_FD_IN_FIXED = (1 << 31)
  1370. IORING_POLL_ADD_MULTI = (1 << 0)
  1371. IORING_POLL_UPDATE_EVENTS = (1 << 1)
  1372. IORING_POLL_UPDATE_USER_DATA = (1 << 2)
  1373. IORING_CQE_F_BUFFER = (1 << 0)
  1374. IORING_CQE_F_MORE = (1 << 1)
  1375. IORING_OFF_SQ_RING = 0
  1376. IORING_OFF_CQ_RING = 0x8000000
  1377. IORING_OFF_SQES = 0x10000000
  1378. IORING_SQ_NEED_WAKEUP = (1 << 0)
  1379. IORING_SQ_CQ_OVERFLOW = (1 << 1)
  1380. IORING_CQ_EVENTFD_DISABLED = (1 << 0)
  1381. IORING_ENTER_GETEVENTS = (1 << 0)
  1382. IORING_ENTER_SQ_WAKEUP = (1 << 1)
  1383. IORING_ENTER_SQ_WAIT = (1 << 2)
  1384. IORING_ENTER_EXT_ARG = (1 << 3)
  1385. IORING_FEAT_SINGLE_MMAP = (1 << 0)
  1386. IORING_FEAT_NODROP = (1 << 1)
  1387. IORING_FEAT_SUBMIT_STABLE = (1 << 2)
  1388. IORING_FEAT_RW_CUR_POS = (1 << 3)
  1389. IORING_FEAT_CUR_PERSONALITY = (1 << 4)
  1390. IORING_FEAT_FAST_POLL = (1 << 5)
  1391. IORING_FEAT_POLL_32BITS = (1 << 6)
  1392. IORING_FEAT_SQPOLL_NONFIXED = (1 << 7)
  1393. IORING_FEAT_EXT_ARG = (1 << 8)
  1394. IORING_FEAT_NATIVE_WORKERS = (1 << 9)
  1395. IORING_FEAT_RSRC_TAGS = (1 << 10)
  1396. IORING_REGISTER_FILES_SKIP = (-2)
  1397. IO_URING_OP_SUPPORTED = (1 << 0)