diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 158b630..f6b40f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - name: Bench run: cargo bench --package io-uring-bench - check: + check-vendor: runs-on: ubuntu-latest strategy: @@ -40,11 +40,10 @@ jobs: matrix: toolchain: - stable - - "1.48" + - "1.63" target: - x86_64-unknown-linux-gnu - x86_64-unknown-linux-musl - - i686-unknown-linux-gnu - aarch64-unknown-linux-gnu steps: @@ -58,6 +57,58 @@ jobs: - name: Lint run: cargo clippy --target ${{ matrix.target }} + check-other: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + toolchain: + - stable + - "1.63" + target: + - i686-unknown-linux-gnu + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} + components: clippy + override: true + - name: Lint + env: + RUSTFLAGS: --cfg=io_uring_skip_arch_check + run: cargo clippy --target ${{ matrix.target }} + + check-own: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + toolchain: + - stable + target: + - x86_64-unknown-linux-gnu + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} + components: clippy + override: true + - name: Lint + env: + RUSTFLAGS: --cfg=io_uring_use_own_sys + IO_URING_OWN_SYS_BINDING: sys_x86-64.rs + run: cargo check --target ${{ matrix.target }} + fmt: name: fmt runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index d4f0f66..f08d4ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + [[package]] name = "anes" version = "0.1.6" @@ -9,41 +18,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] -name = "anyhow" -version = "1.0.75" +name = "anstyle" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] -name = "atty" -version = "0.2.14" +name = "anyhow" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bindgen" -version = "0.65.1" +version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 1.3.2", + "bitflags", "cexpr", "clang-sys", + "itertools", "lazy_static", "lazycell", "log", - "peeking_take_while", "prettyplease", "proc-macro2", "quote", @@ -56,21 +60,15 @@ dependencies = [ [[package]] name = "bitflags" -version = "1.3.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "cast" @@ -78,15 +76,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] - [[package]] name = "cexpr" version = "0.6.0" @@ -104,9 +93,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "ciborium" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -115,15 +104,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", @@ -131,9 +120,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -142,40 +131,44 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.25" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ - "bitflags 1.3.2", - "clap_lex", - "indexmap", - "textwrap", + "clap_builder", ] [[package]] -name = "clap_lex" -version = "0.2.4" +name = "clap_builder" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ - "os_str_bytes", + "anstyle", + "clap_lex", ] +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + [[package]] name = "criterion" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" dependencies = [ "anes", - "atty", "cast", "ciborium", "clap", "criterion-plot", + "is-terminal", "itertools", - "lazy_static", "num-traits", + "once_cell", "oorandom", "plotters", "rayon", @@ -197,81 +190,58 @@ dependencies = [ "itertools", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] -name = "either" -version = "1.9.0" +name = "crunchy" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "errno" -version = "0.3.3" +name = "either" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "errno" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] name = "fastrand" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "glob" @@ -281,48 +251,37 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hermit-abi" -version = "0.1.19" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ - "libc", + "cfg-if", + "crunchy", ] [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] -name = "indexmap" -version = "1.9.3" +name = "home" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "autocfg", - "hashbrown", + "windows-sys 0.52.0", ] [[package]] name = "io-uring" -version = "0.6.4" +version = "0.7.0" dependencies = [ "anyhow", "bindgen", - "bitflags 1.3.2", + "bitflags", + "cfg-if", "libc", "sc", "slab", @@ -350,6 +309,17 @@ dependencies = [ "tempfile", ] +[[package]] +name = "is-terminal" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -361,24 +331,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" @@ -388,46 +358,37 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "winapi", + "windows-targets", ] [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "memchr" -version = "2.6.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "minimal-lexical" @@ -447,52 +408,30 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.2", - "libc", -] - [[package]] name = "once_cell" -version = "1.17.2" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" -version = "11.1.3" +version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "os_str_bytes" -version = "6.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" +checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "plotters" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" dependencies = [ "num-traits", "plotters-backend", @@ -503,24 +442,24 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" +checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" [[package]] name = "plotters-svg" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" dependencies = [ "plotters-backend", ] [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", "syn", @@ -528,27 +467,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "rayon" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -556,39 +495,42 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] -name = "redox_syscall" -version = "0.3.5" +name = "regex" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ - "bitflags 1.3.2", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "regex" -version = "1.8.4" +name = "regex-automata" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ + "aho-corasick", + "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rustc-hash" @@ -598,22 +540,22 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.9" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bfe0f2582b4931a45d1fa608f8a8722e8b3c7ac54dd6d5f3b3212791fedef49" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.0", + "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -630,26 +572,20 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "010e18bd3bfd1d45a7e666b236c78720df0d9a7698ebaa9c1c559961eb60a38b" -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "serde" -version = "1.0.188" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", @@ -658,20 +594,21 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "slab" @@ -684,19 +621,19 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "syn" -version = "2.0.36" +version = "2.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e02e55d62894af2a08aca894c6577281f76769ba47c94d5756bec8ac6e7373" +checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" dependencies = [ "proc-macro2", "quote", @@ -705,23 +642,17 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", + "once_cell", "rustix", - "windows-sys", + "windows-sys 0.59.0", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "tinytemplate" version = "1.2.1" @@ -740,9 +671,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -750,19 +681,20 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", @@ -775,9 +707,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -785,9 +717,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", @@ -798,15 +730,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -814,64 +746,53 @@ dependencies = [ [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "winapi-util" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "windows-sys 0.59.0", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "winapi", + "windows-targets", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", + "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", @@ -880,42 +801,48 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/Cargo.toml b/Cargo.toml index 1d74568..387784d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,15 @@ [package] name = "io-uring" -version = "0.6.4" +version = "0.7.0" authors = ["quininer "] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/tokio-rs/io-uring" homepage = "https://github.com/tokio-rs/io-uring" documentation = "https://docs.rs/io-uring" description = "The low-level `io_uring` userspace interface for Rust" categories = [ "asynchronous", "network-programming", "filesystem" ] +rust-version = "1.63" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -22,14 +23,14 @@ direct-syscall = [ "sc" ] io_safety = [] [dependencies] -# Since we need to work on rustc 1.48, we cannot use 2021 edition. -bitflags = "1" +bitflags = "2" +cfg-if = "1" libc = { version = "0.2.98", default-features = false } sc = { version = "0.2", optional = true } [build-dependencies] -bindgen = { version = "0.65", optional = true } +bindgen = { version = "0.69", optional = true } [dev-dependencies] anyhow = "1" diff --git a/build.rs b/build.rs index 4853d36..9ca70b5 100644 --- a/build.rs +++ b/build.rs @@ -1,8 +1,13 @@ -#[cfg(not(feature = "bindgen"))] -fn main() {} +fn main() { + #[cfg(feature = "bindgen")] + build(); + + println!("cargo:rustc-check-cfg=cfg(io_uring_skip_arch_check)"); + println!("cargo:rustc-check-cfg=cfg(io_uring_use_own_sys)"); +} #[cfg(feature = "bindgen")] -fn main() { +fn build() { use std::env; use std::path::PathBuf; @@ -22,6 +27,8 @@ fn main() { #[cfg(feature = "overwrite")] let outdir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()).join("src/sys"); + let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap(); + let mut builder = bindgen::Builder::default(); if let Some(path) = env::var("BUILD_IO_URING_INCLUDE_FILE") @@ -33,6 +40,8 @@ fn main() { builder = builder.header_contents("include-file.h", INCLUDE); } + let target_file = outdir.join(format!("sys_{}.rs", target_arch)); + builder .ctypes_prefix("libc") .prepend_enum_name(false) @@ -43,6 +52,6 @@ fn main() { .allowlist_var("__NR_io_uring.*|IOSQE_.*|IORING_.*|IO_URING_.*|SPLICE_F_FD_IN_FIXED") .generate() .unwrap() - .write_to_file(outdir.join("sys.rs")) + .write_to_file(target_file) .unwrap(); } diff --git a/io-uring-bench/Cargo.toml b/io-uring-bench/Cargo.toml index 1879285..be80cab 100644 --- a/io-uring-bench/Cargo.toml +++ b/io-uring-bench/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] io-uring = { path = ".." } -criterion = "0.4" +criterion = "0.5" tempfile = "3" [[bench]] diff --git a/io-uring-test/src/tests/fs.rs b/io-uring-test/src/tests/fs.rs index 8c66806..da3d2a0 100644 --- a/io-uring-test/src/tests/fs.rs +++ b/io-uring-test/src/tests/fs.rs @@ -744,6 +744,8 @@ pub fn test_file_direct_write_read CompletionQueue<'_, E> { let len = std::cmp::min(self.len(), entries.len()); for entry in &mut entries[..len] { - *entry = MaybeUninit::new(unsafe { self.pop() }); + entry.write(unsafe { self.pop() }); } unsafe { std::slice::from_raw_parts_mut(entries as *mut _ as *mut E, len) } diff --git a/src/lib.rs b/src/lib.rs index 111a31b..19b6fc4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,6 @@ //! //! The crate only provides a summary of the parameters. //! For more detailed documentation, see manpage. -#![warn(rust_2018_idioms)] #[macro_use] mod util; diff --git a/src/sys/mod.rs b/src/sys/mod.rs index 652ba7c..c9a346b 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -15,33 +15,27 @@ use std::io; use libc::*; -#[cfg(feature = "direct-syscall")] -fn to_result(ret: c_int) -> io::Result { - if ret >= 0 { - Ok(ret) - } else { - Err(io::Error::from_raw_os_error(-ret)) - } -} - -#[cfg(not(feature = "direct-syscall"))] -fn to_result(ret: c_int) -> io::Result { - if ret >= 0 { - Ok(ret) +#[cfg(all( + not(feature = "bindgen"), + not(any(target_arch = "x86_64", target_arch = "aarch64")), + not(io_uring_skip_arch_check) +))] +compile_error!( + "The prebuilt `sys.rs` may not be compatible with your target, +please use bindgen feature to generate new `sys.rs` of your arch +or use `--cfg=io_uring_skip_arch_check` to skip the check." +); + +cfg_if::cfg_if! { + if #[cfg(io_uring_use_own_sys)] { + include!(env!("IO_URING_OWN_SYS_BINDING")); + } else if #[cfg(all(feature = "bindgen", not(feature = "overwrite")))] { + include!(concat!(env!("OUT_DIR"), "/sys.rs")); } else { - Err(io::Error::last_os_error()) + include!("sys.rs"); } } -#[cfg(all(feature = "bindgen", not(feature = "overwrite")))] -include!(concat!(env!("OUT_DIR"), "/sys.rs")); - -#[cfg(any( - not(feature = "bindgen"), - all(feature = "bindgen", feature = "overwrite") -))] -include!("sys.rs"); - #[cfg(feature = "bindgen")] const SYSCALL_REGISTER: c_long = __NR_io_uring_register as _; @@ -60,6 +54,24 @@ const SYSCALL_ENTER: c_long = __NR_io_uring_enter as _; #[cfg(not(feature = "bindgen"))] const SYSCALL_ENTER: c_long = libc::SYS_io_uring_enter; +#[cfg(feature = "direct-syscall")] +fn to_result(ret: c_int) -> io::Result { + if ret >= 0 { + Ok(ret) + } else { + Err(io::Error::from_raw_os_error(-ret)) + } +} + +#[cfg(not(feature = "direct-syscall"))] +fn to_result(ret: c_int) -> io::Result { + if ret >= 0 { + Ok(ret) + } else { + Err(io::Error::last_os_error()) + } +} + #[cfg(not(feature = "direct-syscall"))] pub unsafe fn io_uring_register( fd: c_int, diff --git a/src/sys/sys.rs b/src/sys/sys.rs index 20d73ee..663b944 100644 --- a/src/sys/sys.rs +++ b/src/sys/sys.rs @@ -1,2831 +1,9 @@ -/* automatically generated by rust-bindgen 0.65.1 */ - -#[repr(C)] -#[derive(Default)] -pub struct __IncompleteArrayField(::core::marker::PhantomData, [T; 0]); -impl __IncompleteArrayField { - #[inline] - pub const fn new() -> Self { - __IncompleteArrayField(::core::marker::PhantomData, []) +cfg_if::cfg_if! { + if #[cfg(target_arch = "x86_64")] { + include!("sys_x86-64.rs"); + } else if #[cfg(target_arch = "aarch64")] { + include!("sys_aarch64.rs"); + } else { + include!("sys_x86-64.rs"); } - #[inline] - pub fn as_ptr(&self) -> *const T { - self as *const _ as *const T - } - #[inline] - pub fn as_mut_ptr(&mut self) -> *mut T { - self as *mut _ as *mut T - } - #[inline] - pub unsafe fn as_slice(&self, len: usize) -> &[T] { - ::core::slice::from_raw_parts(self.as_ptr(), len) - } - #[inline] - pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { - ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len) - } -} -impl ::core::fmt::Debug for __IncompleteArrayField { - fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - fmt.write_str("__IncompleteArrayField") - } -} -#[repr(C)] -pub struct __BindgenUnionField(::core::marker::PhantomData); -impl __BindgenUnionField { - #[inline] - pub const fn new() -> Self { - __BindgenUnionField(::core::marker::PhantomData) - } - #[inline] - pub unsafe fn as_ref(&self) -> &T { - ::core::mem::transmute(self) - } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { - ::core::mem::transmute(self) - } -} -impl ::core::default::Default for __BindgenUnionField { - #[inline] - fn default() -> Self { - Self::new() - } -} -impl ::core::clone::Clone for __BindgenUnionField { - #[inline] - fn clone(&self) -> Self { - Self::new() - } -} -impl ::core::marker::Copy for __BindgenUnionField {} -impl ::core::fmt::Debug for __BindgenUnionField { - fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -impl ::core::hash::Hash for __BindgenUnionField { - fn hash(&self, _state: &mut H) {} -} -impl ::core::cmp::PartialEq for __BindgenUnionField { - fn eq(&self, _other: &__BindgenUnionField) -> bool { - true - } -} -impl ::core::cmp::Eq for __BindgenUnionField {} -pub const __NR_io_uring_setup: u32 = 425; -pub const __NR_io_uring_enter: u32 = 426; -pub const __NR_io_uring_register: u32 = 427; -pub const IORING_FILE_INDEX_ALLOC: i32 = -1; -pub const IORING_SETUP_IOPOLL: u32 = 1; -pub const IORING_SETUP_SQPOLL: u32 = 2; -pub const IORING_SETUP_SQ_AFF: u32 = 4; -pub const IORING_SETUP_CQSIZE: u32 = 8; -pub const IORING_SETUP_CLAMP: u32 = 16; -pub const IORING_SETUP_ATTACH_WQ: u32 = 32; -pub const IORING_SETUP_R_DISABLED: u32 = 64; -pub const IORING_SETUP_SUBMIT_ALL: u32 = 128; -pub const IORING_SETUP_COOP_TASKRUN: u32 = 256; -pub const IORING_SETUP_TASKRUN_FLAG: u32 = 512; -pub const IORING_SETUP_SQE128: u32 = 1024; -pub const IORING_SETUP_CQE32: u32 = 2048; -pub const IORING_SETUP_SINGLE_ISSUER: u32 = 4096; -pub const IORING_SETUP_DEFER_TASKRUN: u32 = 8192; -pub const IORING_SETUP_NO_MMAP: u32 = 16384; -pub const IORING_SETUP_REGISTERED_FD_ONLY: u32 = 32768; -pub const IORING_SETUP_NO_SQARRAY: u32 = 65536; -pub const IORING_URING_CMD_FIXED: u32 = 1; -pub const IORING_URING_CMD_MASK: u32 = 1; -pub const IORING_FSYNC_DATASYNC: u32 = 1; -pub const IORING_TIMEOUT_ABS: u32 = 1; -pub const IORING_TIMEOUT_UPDATE: u32 = 2; -pub const IORING_TIMEOUT_BOOTTIME: u32 = 4; -pub const IORING_TIMEOUT_REALTIME: u32 = 8; -pub const IORING_LINK_TIMEOUT_UPDATE: u32 = 16; -pub const IORING_TIMEOUT_ETIME_SUCCESS: u32 = 32; -pub const IORING_TIMEOUT_MULTISHOT: u32 = 64; -pub const IORING_TIMEOUT_CLOCK_MASK: u32 = 12; -pub const IORING_TIMEOUT_UPDATE_MASK: u32 = 18; -pub const SPLICE_F_FD_IN_FIXED: u32 = 2147483648; -pub const IORING_POLL_ADD_MULTI: u32 = 1; -pub const IORING_POLL_UPDATE_EVENTS: u32 = 2; -pub const IORING_POLL_UPDATE_USER_DATA: u32 = 4; -pub const IORING_POLL_ADD_LEVEL: u32 = 8; -pub const IORING_ASYNC_CANCEL_ALL: u32 = 1; -pub const IORING_ASYNC_CANCEL_FD: u32 = 2; -pub const IORING_ASYNC_CANCEL_ANY: u32 = 4; -pub const IORING_ASYNC_CANCEL_FD_FIXED: u32 = 8; -pub const IORING_ASYNC_CANCEL_USERDATA: u32 = 16; -pub const IORING_ASYNC_CANCEL_OP: u32 = 32; -pub const IORING_RECVSEND_POLL_FIRST: u32 = 1; -pub const IORING_RECV_MULTISHOT: u32 = 2; -pub const IORING_RECVSEND_FIXED_BUF: u32 = 4; -pub const IORING_SEND_ZC_REPORT_USAGE: u32 = 8; -pub const IORING_NOTIF_USAGE_ZC_COPIED: u32 = 2147483648; -pub const IORING_ACCEPT_MULTISHOT: u32 = 1; -pub const IORING_MSG_RING_CQE_SKIP: u32 = 1; -pub const IORING_MSG_RING_FLAGS_PASS: u32 = 2; -pub const IORING_CQE_F_BUFFER: u32 = 1; -pub const IORING_CQE_F_MORE: u32 = 2; -pub const IORING_CQE_F_SOCK_NONEMPTY: u32 = 4; -pub const IORING_CQE_F_NOTIF: u32 = 8; -pub const IORING_OFF_SQ_RING: u32 = 0; -pub const IORING_OFF_CQ_RING: u32 = 134217728; -pub const IORING_OFF_SQES: u32 = 268435456; -pub const IORING_OFF_PBUF_RING: u32 = 2147483648; -pub const IORING_OFF_PBUF_SHIFT: u32 = 16; -pub const IORING_OFF_MMAP_MASK: u32 = 4160749568; -pub const IORING_SQ_NEED_WAKEUP: u32 = 1; -pub const IORING_SQ_CQ_OVERFLOW: u32 = 2; -pub const IORING_SQ_TASKRUN: u32 = 4; -pub const IORING_CQ_EVENTFD_DISABLED: u32 = 1; -pub const IORING_ENTER_GETEVENTS: u32 = 1; -pub const IORING_ENTER_SQ_WAKEUP: u32 = 2; -pub const IORING_ENTER_SQ_WAIT: u32 = 4; -pub const IORING_ENTER_EXT_ARG: u32 = 8; -pub const IORING_ENTER_REGISTERED_RING: u32 = 16; -pub const IORING_FEAT_SINGLE_MMAP: u32 = 1; -pub const IORING_FEAT_NODROP: u32 = 2; -pub const IORING_FEAT_SUBMIT_STABLE: u32 = 4; -pub const IORING_FEAT_RW_CUR_POS: u32 = 8; -pub const IORING_FEAT_CUR_PERSONALITY: u32 = 16; -pub const IORING_FEAT_FAST_POLL: u32 = 32; -pub const IORING_FEAT_POLL_32BITS: u32 = 64; -pub const IORING_FEAT_SQPOLL_NONFIXED: u32 = 128; -pub const IORING_FEAT_EXT_ARG: u32 = 256; -pub const IORING_FEAT_NATIVE_WORKERS: u32 = 512; -pub const IORING_FEAT_RSRC_TAGS: u32 = 1024; -pub const IORING_FEAT_CQE_SKIP: u32 = 2048; -pub const IORING_FEAT_LINKED_FILE: u32 = 4096; -pub const IORING_FEAT_REG_REG_RING: u32 = 8192; -pub const IORING_RSRC_REGISTER_SPARSE: u32 = 1; -pub const IORING_REGISTER_FILES_SKIP: i32 = -2; -pub const IO_URING_OP_SUPPORTED: u32 = 1; -pub type __u8 = libc::c_uchar; -pub type __u16 = libc::c_ushort; -pub type __s32 = libc::c_int; -pub type __u32 = libc::c_uint; -pub type __u64 = libc::c_ulonglong; -pub type __kernel_time64_t = libc::c_longlong; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct __kernel_timespec { - pub tv_sec: __kernel_time64_t, - pub tv_nsec: libc::c_longlong, -} -#[test] -fn bindgen_test_layout___kernel_timespec() { - const UNINIT: ::core::mem::MaybeUninit<__kernel_timespec> = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::<__kernel_timespec>(), - 16usize, - concat!("Size of: ", stringify!(__kernel_timespec)) - ); - assert_eq!( - ::core::mem::align_of::<__kernel_timespec>(), - 8usize, - concat!("Alignment of ", stringify!(__kernel_timespec)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__kernel_timespec), - "::", - stringify!(tv_sec) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__kernel_timespec), - "::", - stringify!(tv_nsec) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct open_how { - pub flags: __u64, - pub mode: __u64, - pub resolve: __u64, -} -#[test] -fn bindgen_test_layout_open_how() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(open_how)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(open_how)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(open_how), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(open_how), - "::", - stringify!(mode) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resolve) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(open_how), - "::", - stringify!(resolve) - ) - ); -} -pub type __kernel_rwf_t = libc::c_int; -#[repr(C)] -pub struct io_uring_sqe { - pub opcode: __u8, - pub flags: __u8, - pub ioprio: __u16, - pub fd: __s32, - pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_1, - pub __bindgen_anon_2: io_uring_sqe__bindgen_ty_2, - pub len: __u32, - pub __bindgen_anon_3: io_uring_sqe__bindgen_ty_3, - pub user_data: __u64, - pub __bindgen_anon_4: io_uring_sqe__bindgen_ty_4, - pub personality: __u16, - pub __bindgen_anon_5: io_uring_sqe__bindgen_ty_5, - pub __bindgen_anon_6: io_uring_sqe__bindgen_ty_6, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union io_uring_sqe__bindgen_ty_1 { - pub off: __u64, - pub addr2: __u64, - pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_1__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_sqe__bindgen_ty_1__bindgen_ty_1 { - pub cmd_op: __u32, - pub __pad1: __u32, -} -#[test] -fn bindgen_test_layout_io_uring_sqe__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).cmd_op) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(cmd_op) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).__pad1) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(__pad1) - ) - ); -} -#[test] -fn bindgen_test_layout_io_uring_sqe__bindgen_ty_1() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_1)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).off) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_1), - "::", - stringify!(off) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).addr2) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_1), - "::", - stringify!(addr2) - ) - ); -} -impl Default for io_uring_sqe__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union io_uring_sqe__bindgen_ty_2 { - pub addr: __u64, - pub splice_off_in: __u64, - pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_2__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_sqe__bindgen_ty_2__bindgen_ty_1 { - pub level: __u32, - pub optname: __u32, -} -#[test] -fn bindgen_test_layout_io_uring_sqe__bindgen_ty_2__bindgen_ty_1() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).level) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1), - "::", - stringify!(level) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).optname) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1), - "::", - stringify!(optname) - ) - ); -} -#[test] -fn bindgen_test_layout_io_uring_sqe__bindgen_ty_2() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_2)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_2)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_2), - "::", - stringify!(addr) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).splice_off_in) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_2), - "::", - stringify!(splice_off_in) - ) - ); -} -impl Default for io_uring_sqe__bindgen_ty_2 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union io_uring_sqe__bindgen_ty_3 { - pub rw_flags: __kernel_rwf_t, - pub fsync_flags: __u32, - pub poll_events: __u16, - pub poll32_events: __u32, - pub sync_range_flags: __u32, - pub msg_flags: __u32, - pub timeout_flags: __u32, - pub accept_flags: __u32, - pub cancel_flags: __u32, - pub open_flags: __u32, - pub statx_flags: __u32, - pub fadvise_advice: __u32, - pub splice_flags: __u32, - pub rename_flags: __u32, - pub unlink_flags: __u32, - pub hardlink_flags: __u32, - pub xattr_flags: __u32, - pub msg_ring_flags: __u32, - pub uring_cmd_flags: __u32, - pub waitid_flags: __u32, - pub futex_flags: __u32, -} -#[test] -fn bindgen_test_layout_io_uring_sqe__bindgen_ty_3() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_3)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_3)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).rw_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(rw_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).fsync_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(fsync_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).poll_events) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(poll_events) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).poll32_events) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(poll32_events) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).sync_range_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(sync_range_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).msg_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(msg_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).timeout_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(timeout_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).accept_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(accept_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).cancel_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(cancel_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).open_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(open_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).statx_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(statx_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).fadvise_advice) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(fadvise_advice) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).splice_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(splice_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).rename_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(rename_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).unlink_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(unlink_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).hardlink_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(hardlink_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).xattr_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(xattr_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).msg_ring_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(msg_ring_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).uring_cmd_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(uring_cmd_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).waitid_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(waitid_flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).futex_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_3), - "::", - stringify!(futex_flags) - ) - ); -} -impl Default for io_uring_sqe__bindgen_ty_3 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub union io_uring_sqe__bindgen_ty_4 { - pub buf_index: __u16, - pub buf_group: __u16, -} -#[test] -fn bindgen_test_layout_io_uring_sqe__bindgen_ty_4() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 2usize, - concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_4)) - ); - assert_eq!( - ::core::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_4)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).buf_index) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_4), - "::", - stringify!(buf_index) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).buf_group) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_4), - "::", - stringify!(buf_group) - ) - ); -} -impl Default for io_uring_sqe__bindgen_ty_4 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union io_uring_sqe__bindgen_ty_5 { - pub splice_fd_in: __s32, - pub file_index: __u32, - pub optlen: __u32, - pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_5__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_sqe__bindgen_ty_5__bindgen_ty_1 { - pub addr_len: __u16, - pub __pad3: [__u16; 1usize], -} -#[test] -fn bindgen_test_layout_io_uring_sqe__bindgen_ty_5__bindgen_ty_1() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 2usize, - concat!( - "Alignment of ", - stringify!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).addr_len) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(addr_len) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).__pad3) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(__pad3) - ) - ); -} -#[test] -fn bindgen_test_layout_io_uring_sqe__bindgen_ty_5() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_5)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_5)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).splice_fd_in) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_5), - "::", - stringify!(splice_fd_in) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).file_index) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_5), - "::", - stringify!(file_index) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).optlen) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_5), - "::", - stringify!(optlen) - ) - ); -} -impl Default for io_uring_sqe__bindgen_ty_5 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -pub struct io_uring_sqe__bindgen_ty_6 { - pub __bindgen_anon_1: __BindgenUnionField, - pub optval: __BindgenUnionField<__u64>, - pub cmd: __BindgenUnionField<[__u8; 0usize]>, - pub bindgen_union_field: [u64; 2usize], -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_sqe__bindgen_ty_6__bindgen_ty_1 { - pub addr3: __u64, - pub __pad2: [__u64; 1usize], -} -#[test] -fn bindgen_test_layout_io_uring_sqe__bindgen_ty_6__bindgen_ty_1() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).addr3) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1), - "::", - stringify!(addr3) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).__pad2) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1), - "::", - stringify!(__pad2) - ) - ); -} -#[test] -fn bindgen_test_layout_io_uring_sqe__bindgen_ty_6() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_6)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_6)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).optval) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_6), - "::", - stringify!(optval) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).cmd) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe__bindgen_ty_6), - "::", - stringify!(cmd) - ) - ); -} -impl Default for io_uring_sqe__bindgen_ty_6 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[test] -fn bindgen_test_layout_io_uring_sqe() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(io_uring_sqe)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_sqe)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).opcode) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe), - "::", - stringify!(opcode) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).ioprio) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe), - "::", - stringify!(ioprio) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe), - "::", - stringify!(fd) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe), - "::", - stringify!(len) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe), - "::", - stringify!(user_data) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).personality) as usize - ptr as usize }, - 42usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sqe), - "::", - stringify!(personality) - ) - ); -} -impl Default for io_uring_sqe { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub const IOSQE_FIXED_FILE_BIT: _bindgen_ty_4 = 0; -pub const IOSQE_IO_DRAIN_BIT: _bindgen_ty_4 = 1; -pub const IOSQE_IO_LINK_BIT: _bindgen_ty_4 = 2; -pub const IOSQE_IO_HARDLINK_BIT: _bindgen_ty_4 = 3; -pub const IOSQE_ASYNC_BIT: _bindgen_ty_4 = 4; -pub const IOSQE_BUFFER_SELECT_BIT: _bindgen_ty_4 = 5; -pub const IOSQE_CQE_SKIP_SUCCESS_BIT: _bindgen_ty_4 = 6; -pub type _bindgen_ty_4 = libc::c_uint; -pub const IORING_OP_NOP: io_uring_op = 0; -pub const IORING_OP_READV: io_uring_op = 1; -pub const IORING_OP_WRITEV: io_uring_op = 2; -pub const IORING_OP_FSYNC: io_uring_op = 3; -pub const IORING_OP_READ_FIXED: io_uring_op = 4; -pub const IORING_OP_WRITE_FIXED: io_uring_op = 5; -pub const IORING_OP_POLL_ADD: io_uring_op = 6; -pub const IORING_OP_POLL_REMOVE: io_uring_op = 7; -pub const IORING_OP_SYNC_FILE_RANGE: io_uring_op = 8; -pub const IORING_OP_SENDMSG: io_uring_op = 9; -pub const IORING_OP_RECVMSG: io_uring_op = 10; -pub const IORING_OP_TIMEOUT: io_uring_op = 11; -pub const IORING_OP_TIMEOUT_REMOVE: io_uring_op = 12; -pub const IORING_OP_ACCEPT: io_uring_op = 13; -pub const IORING_OP_ASYNC_CANCEL: io_uring_op = 14; -pub const IORING_OP_LINK_TIMEOUT: io_uring_op = 15; -pub const IORING_OP_CONNECT: io_uring_op = 16; -pub const IORING_OP_FALLOCATE: io_uring_op = 17; -pub const IORING_OP_OPENAT: io_uring_op = 18; -pub const IORING_OP_CLOSE: io_uring_op = 19; -pub const IORING_OP_FILES_UPDATE: io_uring_op = 20; -pub const IORING_OP_STATX: io_uring_op = 21; -pub const IORING_OP_READ: io_uring_op = 22; -pub const IORING_OP_WRITE: io_uring_op = 23; -pub const IORING_OP_FADVISE: io_uring_op = 24; -pub const IORING_OP_MADVISE: io_uring_op = 25; -pub const IORING_OP_SEND: io_uring_op = 26; -pub const IORING_OP_RECV: io_uring_op = 27; -pub const IORING_OP_OPENAT2: io_uring_op = 28; -pub const IORING_OP_EPOLL_CTL: io_uring_op = 29; -pub const IORING_OP_SPLICE: io_uring_op = 30; -pub const IORING_OP_PROVIDE_BUFFERS: io_uring_op = 31; -pub const IORING_OP_REMOVE_BUFFERS: io_uring_op = 32; -pub const IORING_OP_TEE: io_uring_op = 33; -pub const IORING_OP_SHUTDOWN: io_uring_op = 34; -pub const IORING_OP_RENAMEAT: io_uring_op = 35; -pub const IORING_OP_UNLINKAT: io_uring_op = 36; -pub const IORING_OP_MKDIRAT: io_uring_op = 37; -pub const IORING_OP_SYMLINKAT: io_uring_op = 38; -pub const IORING_OP_LINKAT: io_uring_op = 39; -pub const IORING_OP_MSG_RING: io_uring_op = 40; -pub const IORING_OP_FSETXATTR: io_uring_op = 41; -pub const IORING_OP_SETXATTR: io_uring_op = 42; -pub const IORING_OP_FGETXATTR: io_uring_op = 43; -pub const IORING_OP_GETXATTR: io_uring_op = 44; -pub const IORING_OP_SOCKET: io_uring_op = 45; -pub const IORING_OP_URING_CMD: io_uring_op = 46; -pub const IORING_OP_SEND_ZC: io_uring_op = 47; -pub const IORING_OP_SENDMSG_ZC: io_uring_op = 48; -pub const IORING_OP_READ_MULTISHOT: io_uring_op = 49; -pub const IORING_OP_WAITID: io_uring_op = 50; -pub const IORING_OP_FUTEX_WAIT: io_uring_op = 51; -pub const IORING_OP_FUTEX_WAKE: io_uring_op = 52; -pub const IORING_OP_FUTEX_WAITV: io_uring_op = 53; -pub const IORING_OP_LAST: io_uring_op = 54; -pub type io_uring_op = libc::c_uint; -pub const IORING_MSG_DATA: _bindgen_ty_5 = 0; -pub const IORING_MSG_SEND_FD: _bindgen_ty_5 = 1; -pub type _bindgen_ty_5 = libc::c_uint; -#[repr(C)] -#[derive(Debug, Default)] -pub struct io_uring_cqe { - pub user_data: __u64, - pub res: __s32, - pub flags: __u32, - pub big_cqe: __IncompleteArrayField<__u64>, -} -#[test] -fn bindgen_test_layout_io_uring_cqe() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(io_uring_cqe)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_cqe)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_cqe), - "::", - stringify!(user_data) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).res) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_cqe), - "::", - stringify!(res) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(io_uring_cqe), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).big_cqe) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(io_uring_cqe), - "::", - stringify!(big_cqe) - ) - ); -} -pub const IORING_CQE_BUFFER_SHIFT: _bindgen_ty_6 = 16; -pub type _bindgen_ty_6 = libc::c_uint; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_sqring_offsets { - pub head: __u32, - pub tail: __u32, - pub ring_mask: __u32, - pub ring_entries: __u32, - pub flags: __u32, - pub dropped: __u32, - pub array: __u32, - pub resv1: __u32, - pub user_addr: __u64, -} -#[test] -fn bindgen_test_layout_io_sqring_offsets() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(io_sqring_offsets)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_sqring_offsets)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_sqring_offsets), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_sqring_offsets), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).ring_mask) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_sqring_offsets), - "::", - stringify!(ring_mask) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).ring_entries) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(io_sqring_offsets), - "::", - stringify!(ring_entries) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(io_sqring_offsets), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).dropped) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(io_sqring_offsets), - "::", - stringify!(dropped) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).array) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(io_sqring_offsets), - "::", - stringify!(array) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv1) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(io_sqring_offsets), - "::", - stringify!(resv1) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).user_addr) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(io_sqring_offsets), - "::", - stringify!(user_addr) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_cqring_offsets { - pub head: __u32, - pub tail: __u32, - pub ring_mask: __u32, - pub ring_entries: __u32, - pub overflow: __u32, - pub cqes: __u32, - pub flags: __u32, - pub resv1: __u32, - pub user_addr: __u64, -} -#[test] -fn bindgen_test_layout_io_cqring_offsets() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(io_cqring_offsets)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_cqring_offsets)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_cqring_offsets), - "::", - stringify!(head) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_cqring_offsets), - "::", - stringify!(tail) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).ring_mask) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_cqring_offsets), - "::", - stringify!(ring_mask) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).ring_entries) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(io_cqring_offsets), - "::", - stringify!(ring_entries) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).overflow) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(io_cqring_offsets), - "::", - stringify!(overflow) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).cqes) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(io_cqring_offsets), - "::", - stringify!(cqes) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(io_cqring_offsets), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv1) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(io_cqring_offsets), - "::", - stringify!(resv1) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).user_addr) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(io_cqring_offsets), - "::", - stringify!(user_addr) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_params { - pub sq_entries: __u32, - pub cq_entries: __u32, - pub flags: __u32, - pub sq_thread_cpu: __u32, - pub sq_thread_idle: __u32, - pub features: __u32, - pub wq_fd: __u32, - pub resv: [__u32; 3usize], - pub sq_off: io_sqring_offsets, - pub cq_off: io_cqring_offsets, -} -#[test] -fn bindgen_test_layout_io_uring_params() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 120usize, - concat!("Size of: ", stringify!(io_uring_params)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_params)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).sq_entries) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_params), - "::", - stringify!(sq_entries) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).cq_entries) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_params), - "::", - stringify!(cq_entries) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_params), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).sq_thread_cpu) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(io_uring_params), - "::", - stringify!(sq_thread_cpu) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).sq_thread_idle) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(io_uring_params), - "::", - stringify!(sq_thread_idle) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).features) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(io_uring_params), - "::", - stringify!(features) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).wq_fd) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(io_uring_params), - "::", - stringify!(wq_fd) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(io_uring_params), - "::", - stringify!(resv) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).sq_off) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(io_uring_params), - "::", - stringify!(sq_off) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).cq_off) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(io_uring_params), - "::", - stringify!(cq_off) - ) - ); -} -pub const IORING_REGISTER_BUFFERS: _bindgen_ty_7 = 0; -pub const IORING_UNREGISTER_BUFFERS: _bindgen_ty_7 = 1; -pub const IORING_REGISTER_FILES: _bindgen_ty_7 = 2; -pub const IORING_UNREGISTER_FILES: _bindgen_ty_7 = 3; -pub const IORING_REGISTER_EVENTFD: _bindgen_ty_7 = 4; -pub const IORING_UNREGISTER_EVENTFD: _bindgen_ty_7 = 5; -pub const IORING_REGISTER_FILES_UPDATE: _bindgen_ty_7 = 6; -pub const IORING_REGISTER_EVENTFD_ASYNC: _bindgen_ty_7 = 7; -pub const IORING_REGISTER_PROBE: _bindgen_ty_7 = 8; -pub const IORING_REGISTER_PERSONALITY: _bindgen_ty_7 = 9; -pub const IORING_UNREGISTER_PERSONALITY: _bindgen_ty_7 = 10; -pub const IORING_REGISTER_RESTRICTIONS: _bindgen_ty_7 = 11; -pub const IORING_REGISTER_ENABLE_RINGS: _bindgen_ty_7 = 12; -pub const IORING_REGISTER_FILES2: _bindgen_ty_7 = 13; -pub const IORING_REGISTER_FILES_UPDATE2: _bindgen_ty_7 = 14; -pub const IORING_REGISTER_BUFFERS2: _bindgen_ty_7 = 15; -pub const IORING_REGISTER_BUFFERS_UPDATE: _bindgen_ty_7 = 16; -pub const IORING_REGISTER_IOWQ_AFF: _bindgen_ty_7 = 17; -pub const IORING_UNREGISTER_IOWQ_AFF: _bindgen_ty_7 = 18; -pub const IORING_REGISTER_IOWQ_MAX_WORKERS: _bindgen_ty_7 = 19; -pub const IORING_REGISTER_RING_FDS: _bindgen_ty_7 = 20; -pub const IORING_UNREGISTER_RING_FDS: _bindgen_ty_7 = 21; -pub const IORING_REGISTER_PBUF_RING: _bindgen_ty_7 = 22; -pub const IORING_UNREGISTER_PBUF_RING: _bindgen_ty_7 = 23; -pub const IORING_REGISTER_SYNC_CANCEL: _bindgen_ty_7 = 24; -pub const IORING_REGISTER_FILE_ALLOC_RANGE: _bindgen_ty_7 = 25; -pub const IORING_REGISTER_LAST: _bindgen_ty_7 = 26; -pub const IORING_REGISTER_USE_REGISTERED_RING: _bindgen_ty_7 = 2147483648; -pub type _bindgen_ty_7 = libc::c_uint; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_files_update { - pub offset: __u32, - pub resv: __u32, - pub fds: __u64, -} -#[test] -fn bindgen_test_layout_io_uring_files_update() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(io_uring_files_update)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_files_update)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_files_update), - "::", - stringify!(offset) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_files_update), - "::", - stringify!(resv) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).fds) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_files_update), - "::", - stringify!(fds) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_rsrc_register { - pub nr: __u32, - pub flags: __u32, - pub resv2: __u64, - pub data: __u64, - pub tags: __u64, -} -#[test] -fn bindgen_test_layout_io_uring_rsrc_register() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(io_uring_rsrc_register)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_rsrc_register)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_register), - "::", - stringify!(nr) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_register), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_register), - "::", - stringify!(resv2) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_register), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).tags) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_register), - "::", - stringify!(tags) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_rsrc_update { - pub offset: __u32, - pub resv: __u32, - pub data: __u64, -} -#[test] -fn bindgen_test_layout_io_uring_rsrc_update() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(io_uring_rsrc_update)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_rsrc_update)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_update), - "::", - stringify!(offset) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_update), - "::", - stringify!(resv) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_update), - "::", - stringify!(data) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_rsrc_update2 { - pub offset: __u32, - pub resv: __u32, - pub data: __u64, - pub tags: __u64, - pub nr: __u32, - pub resv2: __u32, -} -#[test] -fn bindgen_test_layout_io_uring_rsrc_update2() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(io_uring_rsrc_update2)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_rsrc_update2)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_update2), - "::", - stringify!(offset) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_update2), - "::", - stringify!(resv) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_update2), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).tags) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_update2), - "::", - stringify!(tags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_update2), - "::", - stringify!(nr) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(io_uring_rsrc_update2), - "::", - stringify!(resv2) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_probe_op { - pub op: __u8, - pub resv: __u8, - pub flags: __u16, - pub resv2: __u32, -} -#[test] -fn bindgen_test_layout_io_uring_probe_op() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(io_uring_probe_op)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(io_uring_probe_op)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_probe_op), - "::", - stringify!(op) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(io_uring_probe_op), - "::", - stringify!(resv) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(io_uring_probe_op), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_probe_op), - "::", - stringify!(resv2) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default)] -pub struct io_uring_probe { - pub last_op: __u8, - pub ops_len: __u8, - pub resv: __u16, - pub resv2: [__u32; 3usize], - pub ops: __IncompleteArrayField, -} -#[test] -fn bindgen_test_layout_io_uring_probe() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(io_uring_probe)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(io_uring_probe)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).last_op) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_probe), - "::", - stringify!(last_op) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).ops_len) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(io_uring_probe), - "::", - stringify!(ops_len) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(io_uring_probe), - "::", - stringify!(resv) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_probe), - "::", - stringify!(resv2) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).ops) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(io_uring_probe), - "::", - stringify!(ops) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct io_uring_restriction { - pub opcode: __u16, - pub __bindgen_anon_1: io_uring_restriction__bindgen_ty_1, - pub resv: __u8, - pub resv2: [__u32; 3usize], -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union io_uring_restriction__bindgen_ty_1 { - pub register_op: __u8, - pub sqe_op: __u8, - pub sqe_flags: __u8, -} -#[test] -fn bindgen_test_layout_io_uring_restriction__bindgen_ty_1() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(io_uring_restriction__bindgen_ty_1)) - ); - assert_eq!( - ::core::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(io_uring_restriction__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).register_op) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_restriction__bindgen_ty_1), - "::", - stringify!(register_op) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).sqe_op) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_restriction__bindgen_ty_1), - "::", - stringify!(sqe_op) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).sqe_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_restriction__bindgen_ty_1), - "::", - stringify!(sqe_flags) - ) - ); -} -impl Default for io_uring_restriction__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[test] -fn bindgen_test_layout_io_uring_restriction() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(io_uring_restriction)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(io_uring_restriction)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).opcode) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_restriction), - "::", - stringify!(opcode) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, - 3usize, - concat!( - "Offset of field: ", - stringify!(io_uring_restriction), - "::", - stringify!(resv) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_restriction), - "::", - stringify!(resv2) - ) - ); -} -impl Default for io_uring_restriction { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_buf { - pub addr: __u64, - pub len: __u32, - pub bid: __u16, - pub resv: __u16, -} -#[test] -fn bindgen_test_layout_io_uring_buf() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(io_uring_buf)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_buf)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf), - "::", - stringify!(addr) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf), - "::", - stringify!(len) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).bid) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf), - "::", - stringify!(bid) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, - 14usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf), - "::", - stringify!(resv) - ) - ); -} -#[repr(C)] -pub struct io_uring_buf_ring { - pub __bindgen_anon_1: io_uring_buf_ring__bindgen_ty_1, -} -#[repr(C)] -pub struct io_uring_buf_ring__bindgen_ty_1 { - pub __bindgen_anon_1: __BindgenUnionField, - pub __bindgen_anon_2: __BindgenUnionField, - pub bindgen_union_field: [u64; 2usize], -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1 { - pub resv1: __u64, - pub resv2: __u32, - pub resv3: __u16, - pub tail: __u16, -} -#[test] -fn bindgen_test_layout_io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv1) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(resv1) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(resv2) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv3) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(resv3) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, - 14usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(tail) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default)] -pub struct io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2 { - pub __empty_bufs: io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1, - pub bufs: __IncompleteArrayField, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1 {} -#[test] -fn bindgen_test_layout_io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1() { - assert_eq!( - ::core::mem::size_of::(), - 0usize, - concat!( - "Size of: ", - stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1) - ) - ); -} -#[test] -fn bindgen_test_layout_io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 0usize, - concat!( - "Size of: ", - stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).__empty_bufs) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(__empty_bufs) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).bufs) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(bufs) - ) - ); -} -#[test] -fn bindgen_test_layout_io_uring_buf_ring__bindgen_ty_1() { - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(io_uring_buf_ring__bindgen_ty_1)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_buf_ring__bindgen_ty_1)) - ); -} -impl Default for io_uring_buf_ring__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[test] -fn bindgen_test_layout_io_uring_buf_ring() { - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(io_uring_buf_ring)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_buf_ring)) - ); -} -impl Default for io_uring_buf_ring { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_buf_reg { - pub ring_addr: __u64, - pub ring_entries: __u32, - pub bgid: __u16, - pub flags: __u16, - pub resv: [__u64; 3usize], -} -#[test] -fn bindgen_test_layout_io_uring_buf_reg() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(io_uring_buf_reg)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_buf_reg)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).ring_addr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf_reg), - "::", - stringify!(ring_addr) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).ring_entries) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf_reg), - "::", - stringify!(ring_entries) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).bgid) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf_reg), - "::", - stringify!(bgid) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 14usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf_reg), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(io_uring_buf_reg), - "::", - stringify!(resv) - ) - ); -} -pub const IORING_RESTRICTION_REGISTER_OP: _bindgen_ty_10 = 0; -pub const IORING_RESTRICTION_SQE_OP: _bindgen_ty_10 = 1; -pub const IORING_RESTRICTION_SQE_FLAGS_ALLOWED: _bindgen_ty_10 = 2; -pub const IORING_RESTRICTION_SQE_FLAGS_REQUIRED: _bindgen_ty_10 = 3; -pub const IORING_RESTRICTION_LAST: _bindgen_ty_10 = 4; -pub type _bindgen_ty_10 = libc::c_uint; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_getevents_arg { - pub sigmask: __u64, - pub sigmask_sz: __u32, - pub pad: __u32, - pub ts: __u64, -} -#[test] -fn bindgen_test_layout_io_uring_getevents_arg() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(io_uring_getevents_arg)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_getevents_arg)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).sigmask) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_getevents_arg), - "::", - stringify!(sigmask) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).sigmask_sz) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_getevents_arg), - "::", - stringify!(sigmask_sz) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(io_uring_getevents_arg), - "::", - stringify!(pad) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).ts) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(io_uring_getevents_arg), - "::", - stringify!(ts) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_sync_cancel_reg { - pub addr: __u64, - pub fd: __s32, - pub flags: __u32, - pub timeout: __kernel_timespec, - pub opcode: __u8, - pub pad: [__u8; 7usize], - pub pad2: [__u64; 3usize], -} -#[test] -fn bindgen_test_layout_io_uring_sync_cancel_reg() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(io_uring_sync_cancel_reg)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_sync_cancel_reg)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sync_cancel_reg), - "::", - stringify!(addr) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sync_cancel_reg), - "::", - stringify!(fd) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sync_cancel_reg), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sync_cancel_reg), - "::", - stringify!(timeout) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).opcode) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sync_cancel_reg), - "::", - stringify!(opcode) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, - 33usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sync_cancel_reg), - "::", - stringify!(pad) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).pad2) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(io_uring_sync_cancel_reg), - "::", - stringify!(pad2) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_file_index_range { - pub off: __u32, - pub len: __u32, - pub resv: __u64, -} -#[test] -fn bindgen_test_layout_io_uring_file_index_range() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(io_uring_file_index_range)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(io_uring_file_index_range)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).off) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_file_index_range), - "::", - stringify!(off) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_file_index_range), - "::", - stringify!(len) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_file_index_range), - "::", - stringify!(resv) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct io_uring_recvmsg_out { - pub namelen: __u32, - pub controllen: __u32, - pub payloadlen: __u32, - pub flags: __u32, -} -#[test] -fn bindgen_test_layout_io_uring_recvmsg_out() { - const UNINIT: ::core::mem::MaybeUninit = - ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(io_uring_recvmsg_out)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(io_uring_recvmsg_out)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).namelen) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(io_uring_recvmsg_out), - "::", - stringify!(namelen) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).controllen) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(io_uring_recvmsg_out), - "::", - stringify!(controllen) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).payloadlen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(io_uring_recvmsg_out), - "::", - stringify!(payloadlen) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(io_uring_recvmsg_out), - "::", - stringify!(flags) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct futex_waitv { - pub val: __u64, - pub uaddr: __u64, - pub flags: __u32, - pub __reserved: __u32, -} -#[test] -fn bindgen_test_layout_futex_waitv() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(futex_waitv)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(futex_waitv)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(futex_waitv), - "::", - stringify!(val) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).uaddr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(futex_waitv), - "::", - stringify!(uaddr) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(futex_waitv), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(futex_waitv), - "::", - stringify!(__reserved) - ) - ); } diff --git a/src/sys/sys_aarch64.rs b/src/sys/sys_aarch64.rs new file mode 100644 index 0000000..d33bc71 --- /dev/null +++ b/src/sys/sys_aarch64.rs @@ -0,0 +1,2986 @@ +/* automatically generated by rust-bindgen 0.69.4 */ + +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::core::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub const fn new() -> Self { + __IncompleteArrayField(::core::marker::PhantomData, []) + } + #[inline] + pub fn as_ptr(&self) -> *const T { + self as *const _ as *const T + } + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut T { + self as *mut _ as *mut T + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::core::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::core::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +#[repr(C)] +pub struct __BindgenUnionField(::core::marker::PhantomData); +impl __BindgenUnionField { + #[inline] + pub const fn new() -> Self { + __BindgenUnionField(::core::marker::PhantomData) + } + #[inline] + pub unsafe fn as_ref(&self) -> &T { + ::core::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut(&mut self) -> &mut T { + ::core::mem::transmute(self) + } +} +impl ::core::default::Default for __BindgenUnionField { + #[inline] + fn default() -> Self { + Self::new() + } +} +impl ::core::clone::Clone for __BindgenUnionField { + #[inline] + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for __BindgenUnionField {} +impl ::core::fmt::Debug for __BindgenUnionField { + fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fmt.write_str("__BindgenUnionField") + } +} +impl ::core::hash::Hash for __BindgenUnionField { + fn hash(&self, _state: &mut H) {} +} +impl ::core::cmp::PartialEq for __BindgenUnionField { + fn eq(&self, _other: &__BindgenUnionField) -> bool { + true + } +} +impl ::core::cmp::Eq for __BindgenUnionField {} +pub const __NR_io_uring_setup: u32 = 425; +pub const __NR_io_uring_enter: u32 = 426; +pub const __NR_io_uring_register: u32 = 427; +pub const IORING_FILE_INDEX_ALLOC: i32 = -1; +pub const IORING_SETUP_IOPOLL: u32 = 1; +pub const IORING_SETUP_SQPOLL: u32 = 2; +pub const IORING_SETUP_SQ_AFF: u32 = 4; +pub const IORING_SETUP_CQSIZE: u32 = 8; +pub const IORING_SETUP_CLAMP: u32 = 16; +pub const IORING_SETUP_ATTACH_WQ: u32 = 32; +pub const IORING_SETUP_R_DISABLED: u32 = 64; +pub const IORING_SETUP_SUBMIT_ALL: u32 = 128; +pub const IORING_SETUP_COOP_TASKRUN: u32 = 256; +pub const IORING_SETUP_TASKRUN_FLAG: u32 = 512; +pub const IORING_SETUP_SQE128: u32 = 1024; +pub const IORING_SETUP_CQE32: u32 = 2048; +pub const IORING_SETUP_SINGLE_ISSUER: u32 = 4096; +pub const IORING_SETUP_DEFER_TASKRUN: u32 = 8192; +pub const IORING_SETUP_NO_MMAP: u32 = 16384; +pub const IORING_SETUP_REGISTERED_FD_ONLY: u32 = 32768; +pub const IORING_SETUP_NO_SQARRAY: u32 = 65536; +pub const IORING_URING_CMD_FIXED: u32 = 1; +pub const IORING_URING_CMD_MASK: u32 = 1; +pub const IORING_FSYNC_DATASYNC: u32 = 1; +pub const IORING_TIMEOUT_ABS: u32 = 1; +pub const IORING_TIMEOUT_UPDATE: u32 = 2; +pub const IORING_TIMEOUT_BOOTTIME: u32 = 4; +pub const IORING_TIMEOUT_REALTIME: u32 = 8; +pub const IORING_LINK_TIMEOUT_UPDATE: u32 = 16; +pub const IORING_TIMEOUT_ETIME_SUCCESS: u32 = 32; +pub const IORING_TIMEOUT_MULTISHOT: u32 = 64; +pub const IORING_TIMEOUT_CLOCK_MASK: u32 = 12; +pub const IORING_TIMEOUT_UPDATE_MASK: u32 = 18; +pub const SPLICE_F_FD_IN_FIXED: u32 = 2147483648; +pub const IORING_POLL_ADD_MULTI: u32 = 1; +pub const IORING_POLL_UPDATE_EVENTS: u32 = 2; +pub const IORING_POLL_UPDATE_USER_DATA: u32 = 4; +pub const IORING_POLL_ADD_LEVEL: u32 = 8; +pub const IORING_ASYNC_CANCEL_ALL: u32 = 1; +pub const IORING_ASYNC_CANCEL_FD: u32 = 2; +pub const IORING_ASYNC_CANCEL_ANY: u32 = 4; +pub const IORING_ASYNC_CANCEL_FD_FIXED: u32 = 8; +pub const IORING_ASYNC_CANCEL_USERDATA: u32 = 16; +pub const IORING_ASYNC_CANCEL_OP: u32 = 32; +pub const IORING_RECVSEND_POLL_FIRST: u32 = 1; +pub const IORING_RECV_MULTISHOT: u32 = 2; +pub const IORING_RECVSEND_FIXED_BUF: u32 = 4; +pub const IORING_SEND_ZC_REPORT_USAGE: u32 = 8; +pub const IORING_RECVSEND_BUNDLE: u32 = 16; +pub const IORING_NOTIF_USAGE_ZC_COPIED: u32 = 2147483648; +pub const IORING_ACCEPT_MULTISHOT: u32 = 1; +pub const IORING_ACCEPT_DONTWAIT: u32 = 2; +pub const IORING_ACCEPT_POLL_FIRST: u32 = 4; +pub const IORING_MSG_RING_CQE_SKIP: u32 = 1; +pub const IORING_MSG_RING_FLAGS_PASS: u32 = 2; +pub const IORING_FIXED_FD_NO_CLOEXEC: u32 = 1; +pub const IORING_NOP_INJECT_RESULT: u32 = 1; +pub const IORING_CQE_F_BUFFER: u32 = 1; +pub const IORING_CQE_F_MORE: u32 = 2; +pub const IORING_CQE_F_SOCK_NONEMPTY: u32 = 4; +pub const IORING_CQE_F_NOTIF: u32 = 8; +pub const IORING_CQE_BUFFER_SHIFT: u32 = 16; +pub const IORING_OFF_SQ_RING: u32 = 0; +pub const IORING_OFF_CQ_RING: u32 = 134217728; +pub const IORING_OFF_SQES: u32 = 268435456; +pub const IORING_OFF_PBUF_RING: u32 = 2147483648; +pub const IORING_OFF_PBUF_SHIFT: u32 = 16; +pub const IORING_OFF_MMAP_MASK: u32 = 4160749568; +pub const IORING_SQ_NEED_WAKEUP: u32 = 1; +pub const IORING_SQ_CQ_OVERFLOW: u32 = 2; +pub const IORING_SQ_TASKRUN: u32 = 4; +pub const IORING_CQ_EVENTFD_DISABLED: u32 = 1; +pub const IORING_ENTER_GETEVENTS: u32 = 1; +pub const IORING_ENTER_SQ_WAKEUP: u32 = 2; +pub const IORING_ENTER_SQ_WAIT: u32 = 4; +pub const IORING_ENTER_EXT_ARG: u32 = 8; +pub const IORING_ENTER_REGISTERED_RING: u32 = 16; +pub const IORING_FEAT_SINGLE_MMAP: u32 = 1; +pub const IORING_FEAT_NODROP: u32 = 2; +pub const IORING_FEAT_SUBMIT_STABLE: u32 = 4; +pub const IORING_FEAT_RW_CUR_POS: u32 = 8; +pub const IORING_FEAT_CUR_PERSONALITY: u32 = 16; +pub const IORING_FEAT_FAST_POLL: u32 = 32; +pub const IORING_FEAT_POLL_32BITS: u32 = 64; +pub const IORING_FEAT_SQPOLL_NONFIXED: u32 = 128; +pub const IORING_FEAT_EXT_ARG: u32 = 256; +pub const IORING_FEAT_NATIVE_WORKERS: u32 = 512; +pub const IORING_FEAT_RSRC_TAGS: u32 = 1024; +pub const IORING_FEAT_CQE_SKIP: u32 = 2048; +pub const IORING_FEAT_LINKED_FILE: u32 = 4096; +pub const IORING_FEAT_REG_REG_RING: u32 = 8192; +pub const IORING_FEAT_RECVSEND_BUNDLE: u32 = 16384; +pub const IORING_RSRC_REGISTER_SPARSE: u32 = 1; +pub const IORING_REGISTER_FILES_SKIP: i32 = -2; +pub const IO_URING_OP_SUPPORTED: u32 = 1; +pub type __u8 = libc::c_uchar; +pub type __u16 = libc::c_ushort; +pub type __s32 = libc::c_int; +pub type __u32 = libc::c_uint; +pub type __u64 = libc::c_ulonglong; +pub type __kernel_time64_t = libc::c_longlong; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __kernel_timespec { + pub tv_sec: __kernel_time64_t, + pub tv_nsec: libc::c_longlong, +} +#[test] +fn bindgen_test_layout___kernel_timespec() { + const UNINIT: ::core::mem::MaybeUninit<__kernel_timespec> = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::<__kernel_timespec>(), + 16usize, + concat!("Size of: ", stringify!(__kernel_timespec)) + ); + assert_eq!( + ::core::mem::align_of::<__kernel_timespec>(), + 8usize, + concat!("Alignment of ", stringify!(__kernel_timespec)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__kernel_timespec), + "::", + stringify!(tv_sec) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__kernel_timespec), + "::", + stringify!(tv_nsec) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct open_how { + pub flags: __u64, + pub mode: __u64, + pub resolve: __u64, +} +#[test] +fn bindgen_test_layout_open_how() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(open_how)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(open_how)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(open_how), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(open_how), + "::", + stringify!(mode) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resolve) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(open_how), + "::", + stringify!(resolve) + ) + ); +} +pub type __kernel_rwf_t = libc::c_int; +#[repr(C)] +pub struct io_uring_sqe { + pub opcode: __u8, + pub flags: __u8, + pub ioprio: __u16, + pub fd: __s32, + pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_1, + pub __bindgen_anon_2: io_uring_sqe__bindgen_ty_2, + pub len: __u32, + pub __bindgen_anon_3: io_uring_sqe__bindgen_ty_3, + pub user_data: __u64, + pub __bindgen_anon_4: io_uring_sqe__bindgen_ty_4, + pub personality: __u16, + pub __bindgen_anon_5: io_uring_sqe__bindgen_ty_5, + pub __bindgen_anon_6: io_uring_sqe__bindgen_ty_6, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union io_uring_sqe__bindgen_ty_1 { + pub off: __u64, + pub addr2: __u64, + pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_sqe__bindgen_ty_1__bindgen_ty_1 { + pub cmd_op: __u32, + pub __pad1: __u32, +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cmd_op) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(cmd_op) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__pad1) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(__pad1) + ) + ); +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_1)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).off) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_1), + "::", + stringify!(off) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).addr2) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_1), + "::", + stringify!(addr2) + ) + ); +} +impl Default for io_uring_sqe__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union io_uring_sqe__bindgen_ty_2 { + pub addr: __u64, + pub splice_off_in: __u64, + pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_2__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_sqe__bindgen_ty_2__bindgen_ty_1 { + pub level: __u32, + pub optname: __u32, +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_2__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).level) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(level) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).optname) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(optname) + ) + ); +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_2() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_2)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_2), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).splice_off_in) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_2), + "::", + stringify!(splice_off_in) + ) + ); +} +impl Default for io_uring_sqe__bindgen_ty_2 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union io_uring_sqe__bindgen_ty_3 { + pub rw_flags: __kernel_rwf_t, + pub fsync_flags: __u32, + pub poll_events: __u16, + pub poll32_events: __u32, + pub sync_range_flags: __u32, + pub msg_flags: __u32, + pub timeout_flags: __u32, + pub accept_flags: __u32, + pub cancel_flags: __u32, + pub open_flags: __u32, + pub statx_flags: __u32, + pub fadvise_advice: __u32, + pub splice_flags: __u32, + pub rename_flags: __u32, + pub unlink_flags: __u32, + pub hardlink_flags: __u32, + pub xattr_flags: __u32, + pub msg_ring_flags: __u32, + pub uring_cmd_flags: __u32, + pub waitid_flags: __u32, + pub futex_flags: __u32, + pub install_fd_flags: __u32, + pub nop_flags: __u32, +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_3() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_3)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_3)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).rw_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(rw_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).fsync_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(fsync_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).poll_events) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(poll_events) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).poll32_events) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(poll32_events) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sync_range_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(sync_range_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).msg_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(msg_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).timeout_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(timeout_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).accept_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(accept_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cancel_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(cancel_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).open_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(open_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).statx_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(statx_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).fadvise_advice) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(fadvise_advice) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).splice_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(splice_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).rename_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(rename_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).unlink_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(unlink_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).hardlink_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(hardlink_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).xattr_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(xattr_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).msg_ring_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(msg_ring_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).uring_cmd_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(uring_cmd_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).waitid_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(waitid_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).futex_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(futex_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).install_fd_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(install_fd_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).nop_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(nop_flags) + ) + ); +} +impl Default for io_uring_sqe__bindgen_ty_3 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub union io_uring_sqe__bindgen_ty_4 { + pub buf_index: __u16, + pub buf_group: __u16, +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_4() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 2usize, + concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_4)) + ); + assert_eq!( + ::core::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_4)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).buf_index) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_4), + "::", + stringify!(buf_index) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).buf_group) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_4), + "::", + stringify!(buf_group) + ) + ); +} +impl Default for io_uring_sqe__bindgen_ty_4 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union io_uring_sqe__bindgen_ty_5 { + pub splice_fd_in: __s32, + pub file_index: __u32, + pub optlen: __u32, + pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_5__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_sqe__bindgen_ty_5__bindgen_ty_1 { + pub addr_len: __u16, + pub __pad3: [__u16; 1usize], +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_5__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 4usize, + concat!( + "Size of: ", + stringify!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 2usize, + concat!( + "Alignment of ", + stringify!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).addr_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1), + "::", + stringify!(addr_len) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__pad3) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1), + "::", + stringify!(__pad3) + ) + ); +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_5() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_5)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_5)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).splice_fd_in) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_5), + "::", + stringify!(splice_fd_in) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).file_index) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_5), + "::", + stringify!(file_index) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).optlen) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_5), + "::", + stringify!(optlen) + ) + ); +} +impl Default for io_uring_sqe__bindgen_ty_5 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +pub struct io_uring_sqe__bindgen_ty_6 { + pub __bindgen_anon_1: __BindgenUnionField, + pub optval: __BindgenUnionField<__u64>, + pub cmd: __BindgenUnionField<[__u8; 0usize]>, + pub bindgen_union_field: [u64; 2usize], +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_sqe__bindgen_ty_6__bindgen_ty_1 { + pub addr3: __u64, + pub __pad2: [__u64; 1usize], +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_6__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).addr3) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1), + "::", + stringify!(addr3) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__pad2) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1), + "::", + stringify!(__pad2) + ) + ); +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_6() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_6)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_6)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).optval) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_6), + "::", + stringify!(optval) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cmd) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_6), + "::", + stringify!(cmd) + ) + ); +} +impl Default for io_uring_sqe__bindgen_ty_6 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[test] +fn bindgen_test_layout_io_uring_sqe() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(io_uring_sqe)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_sqe)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).opcode) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(opcode) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ioprio) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(ioprio) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(fd) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(len) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(user_data) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).personality) as usize - ptr as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(personality) + ) + ); +} +impl Default for io_uring_sqe { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const IOSQE_FIXED_FILE_BIT: io_uring_sqe_flags_bit = 0; +pub const IOSQE_IO_DRAIN_BIT: io_uring_sqe_flags_bit = 1; +pub const IOSQE_IO_LINK_BIT: io_uring_sqe_flags_bit = 2; +pub const IOSQE_IO_HARDLINK_BIT: io_uring_sqe_flags_bit = 3; +pub const IOSQE_ASYNC_BIT: io_uring_sqe_flags_bit = 4; +pub const IOSQE_BUFFER_SELECT_BIT: io_uring_sqe_flags_bit = 5; +pub const IOSQE_CQE_SKIP_SUCCESS_BIT: io_uring_sqe_flags_bit = 6; +pub type io_uring_sqe_flags_bit = libc::c_uint; +pub const IORING_OP_NOP: io_uring_op = 0; +pub const IORING_OP_READV: io_uring_op = 1; +pub const IORING_OP_WRITEV: io_uring_op = 2; +pub const IORING_OP_FSYNC: io_uring_op = 3; +pub const IORING_OP_READ_FIXED: io_uring_op = 4; +pub const IORING_OP_WRITE_FIXED: io_uring_op = 5; +pub const IORING_OP_POLL_ADD: io_uring_op = 6; +pub const IORING_OP_POLL_REMOVE: io_uring_op = 7; +pub const IORING_OP_SYNC_FILE_RANGE: io_uring_op = 8; +pub const IORING_OP_SENDMSG: io_uring_op = 9; +pub const IORING_OP_RECVMSG: io_uring_op = 10; +pub const IORING_OP_TIMEOUT: io_uring_op = 11; +pub const IORING_OP_TIMEOUT_REMOVE: io_uring_op = 12; +pub const IORING_OP_ACCEPT: io_uring_op = 13; +pub const IORING_OP_ASYNC_CANCEL: io_uring_op = 14; +pub const IORING_OP_LINK_TIMEOUT: io_uring_op = 15; +pub const IORING_OP_CONNECT: io_uring_op = 16; +pub const IORING_OP_FALLOCATE: io_uring_op = 17; +pub const IORING_OP_OPENAT: io_uring_op = 18; +pub const IORING_OP_CLOSE: io_uring_op = 19; +pub const IORING_OP_FILES_UPDATE: io_uring_op = 20; +pub const IORING_OP_STATX: io_uring_op = 21; +pub const IORING_OP_READ: io_uring_op = 22; +pub const IORING_OP_WRITE: io_uring_op = 23; +pub const IORING_OP_FADVISE: io_uring_op = 24; +pub const IORING_OP_MADVISE: io_uring_op = 25; +pub const IORING_OP_SEND: io_uring_op = 26; +pub const IORING_OP_RECV: io_uring_op = 27; +pub const IORING_OP_OPENAT2: io_uring_op = 28; +pub const IORING_OP_EPOLL_CTL: io_uring_op = 29; +pub const IORING_OP_SPLICE: io_uring_op = 30; +pub const IORING_OP_PROVIDE_BUFFERS: io_uring_op = 31; +pub const IORING_OP_REMOVE_BUFFERS: io_uring_op = 32; +pub const IORING_OP_TEE: io_uring_op = 33; +pub const IORING_OP_SHUTDOWN: io_uring_op = 34; +pub const IORING_OP_RENAMEAT: io_uring_op = 35; +pub const IORING_OP_UNLINKAT: io_uring_op = 36; +pub const IORING_OP_MKDIRAT: io_uring_op = 37; +pub const IORING_OP_SYMLINKAT: io_uring_op = 38; +pub const IORING_OP_LINKAT: io_uring_op = 39; +pub const IORING_OP_MSG_RING: io_uring_op = 40; +pub const IORING_OP_FSETXATTR: io_uring_op = 41; +pub const IORING_OP_SETXATTR: io_uring_op = 42; +pub const IORING_OP_FGETXATTR: io_uring_op = 43; +pub const IORING_OP_GETXATTR: io_uring_op = 44; +pub const IORING_OP_SOCKET: io_uring_op = 45; +pub const IORING_OP_URING_CMD: io_uring_op = 46; +pub const IORING_OP_SEND_ZC: io_uring_op = 47; +pub const IORING_OP_SENDMSG_ZC: io_uring_op = 48; +pub const IORING_OP_READ_MULTISHOT: io_uring_op = 49; +pub const IORING_OP_WAITID: io_uring_op = 50; +pub const IORING_OP_FUTEX_WAIT: io_uring_op = 51; +pub const IORING_OP_FUTEX_WAKE: io_uring_op = 52; +pub const IORING_OP_FUTEX_WAITV: io_uring_op = 53; +pub const IORING_OP_FIXED_FD_INSTALL: io_uring_op = 54; +pub const IORING_OP_FTRUNCATE: io_uring_op = 55; +pub const IORING_OP_LAST: io_uring_op = 56; +pub type io_uring_op = libc::c_uint; +pub const IORING_MSG_DATA: io_uring_msg_ring_flags = 0; +pub const IORING_MSG_SEND_FD: io_uring_msg_ring_flags = 1; +pub type io_uring_msg_ring_flags = libc::c_uint; +#[repr(C)] +#[derive(Debug, Default)] +pub struct io_uring_cqe { + pub user_data: __u64, + pub res: __s32, + pub flags: __u32, + pub big_cqe: __IncompleteArrayField<__u64>, +} +#[test] +fn bindgen_test_layout_io_uring_cqe() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_cqe)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_cqe)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_cqe), + "::", + stringify!(user_data) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).res) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_cqe), + "::", + stringify!(res) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_cqe), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).big_cqe) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_cqe), + "::", + stringify!(big_cqe) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_sqring_offsets { + pub head: __u32, + pub tail: __u32, + pub ring_mask: __u32, + pub ring_entries: __u32, + pub flags: __u32, + pub dropped: __u32, + pub array: __u32, + pub resv1: __u32, + pub user_addr: __u64, +} +#[test] +fn bindgen_test_layout_io_sqring_offsets() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(io_sqring_offsets)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_sqring_offsets)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(tail) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ring_mask) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(ring_mask) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ring_entries) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(ring_entries) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).dropped) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(dropped) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).array) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(array) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv1) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(resv1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).user_addr) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(user_addr) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_cqring_offsets { + pub head: __u32, + pub tail: __u32, + pub ring_mask: __u32, + pub ring_entries: __u32, + pub overflow: __u32, + pub cqes: __u32, + pub flags: __u32, + pub resv1: __u32, + pub user_addr: __u64, +} +#[test] +fn bindgen_test_layout_io_cqring_offsets() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(io_cqring_offsets)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_cqring_offsets)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(tail) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ring_mask) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(ring_mask) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ring_entries) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(ring_entries) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).overflow) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(overflow) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cqes) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(cqes) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv1) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(resv1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).user_addr) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(user_addr) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_params { + pub sq_entries: __u32, + pub cq_entries: __u32, + pub flags: __u32, + pub sq_thread_cpu: __u32, + pub sq_thread_idle: __u32, + pub features: __u32, + pub wq_fd: __u32, + pub resv: [__u32; 3usize], + pub sq_off: io_sqring_offsets, + pub cq_off: io_cqring_offsets, +} +#[test] +fn bindgen_test_layout_io_uring_params() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 120usize, + concat!("Size of: ", stringify!(io_uring_params)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_params)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sq_entries) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(sq_entries) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cq_entries) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(cq_entries) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sq_thread_cpu) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(sq_thread_cpu) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sq_thread_idle) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(sq_thread_idle) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).features) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(features) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).wq_fd) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(wq_fd) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sq_off) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(sq_off) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cq_off) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(cq_off) + ) + ); +} +pub const IORING_REGISTER_BUFFERS: io_uring_register_op = 0; +pub const IORING_UNREGISTER_BUFFERS: io_uring_register_op = 1; +pub const IORING_REGISTER_FILES: io_uring_register_op = 2; +pub const IORING_UNREGISTER_FILES: io_uring_register_op = 3; +pub const IORING_REGISTER_EVENTFD: io_uring_register_op = 4; +pub const IORING_UNREGISTER_EVENTFD: io_uring_register_op = 5; +pub const IORING_REGISTER_FILES_UPDATE: io_uring_register_op = 6; +pub const IORING_REGISTER_EVENTFD_ASYNC: io_uring_register_op = 7; +pub const IORING_REGISTER_PROBE: io_uring_register_op = 8; +pub const IORING_REGISTER_PERSONALITY: io_uring_register_op = 9; +pub const IORING_UNREGISTER_PERSONALITY: io_uring_register_op = 10; +pub const IORING_REGISTER_RESTRICTIONS: io_uring_register_op = 11; +pub const IORING_REGISTER_ENABLE_RINGS: io_uring_register_op = 12; +pub const IORING_REGISTER_FILES2: io_uring_register_op = 13; +pub const IORING_REGISTER_FILES_UPDATE2: io_uring_register_op = 14; +pub const IORING_REGISTER_BUFFERS2: io_uring_register_op = 15; +pub const IORING_REGISTER_BUFFERS_UPDATE: io_uring_register_op = 16; +pub const IORING_REGISTER_IOWQ_AFF: io_uring_register_op = 17; +pub const IORING_UNREGISTER_IOWQ_AFF: io_uring_register_op = 18; +pub const IORING_REGISTER_IOWQ_MAX_WORKERS: io_uring_register_op = 19; +pub const IORING_REGISTER_RING_FDS: io_uring_register_op = 20; +pub const IORING_UNREGISTER_RING_FDS: io_uring_register_op = 21; +pub const IORING_REGISTER_PBUF_RING: io_uring_register_op = 22; +pub const IORING_UNREGISTER_PBUF_RING: io_uring_register_op = 23; +pub const IORING_REGISTER_SYNC_CANCEL: io_uring_register_op = 24; +pub const IORING_REGISTER_FILE_ALLOC_RANGE: io_uring_register_op = 25; +pub const IORING_REGISTER_PBUF_STATUS: io_uring_register_op = 26; +pub const IORING_REGISTER_NAPI: io_uring_register_op = 27; +pub const IORING_UNREGISTER_NAPI: io_uring_register_op = 28; +pub const IORING_REGISTER_LAST: io_uring_register_op = 29; +pub const IORING_REGISTER_USE_REGISTERED_RING: io_uring_register_op = 2147483648; +pub type io_uring_register_op = libc::c_uint; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_files_update { + pub offset: __u32, + pub resv: __u32, + pub fds: __u64, +} +#[test] +fn bindgen_test_layout_io_uring_files_update() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_files_update)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_files_update)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_files_update), + "::", + stringify!(offset) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_files_update), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).fds) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_files_update), + "::", + stringify!(fds) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_rsrc_register { + pub nr: __u32, + pub flags: __u32, + pub resv2: __u64, + pub data: __u64, + pub tags: __u64, +} +#[test] +fn bindgen_test_layout_io_uring_rsrc_register() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(io_uring_rsrc_register)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_rsrc_register)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_register), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_register), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_register), + "::", + stringify!(resv2) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_register), + "::", + stringify!(data) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tags) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_register), + "::", + stringify!(tags) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_rsrc_update { + pub offset: __u32, + pub resv: __u32, + pub data: __u64, +} +#[test] +fn bindgen_test_layout_io_uring_rsrc_update() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_rsrc_update)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_rsrc_update)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update), + "::", + stringify!(offset) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update), + "::", + stringify!(data) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_rsrc_update2 { + pub offset: __u32, + pub resv: __u32, + pub data: __u64, + pub tags: __u64, + pub nr: __u32, + pub resv2: __u32, +} +#[test] +fn bindgen_test_layout_io_uring_rsrc_update2() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(io_uring_rsrc_update2)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_rsrc_update2)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update2), + "::", + stringify!(offset) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update2), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update2), + "::", + stringify!(data) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tags) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update2), + "::", + stringify!(tags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update2), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update2), + "::", + stringify!(resv2) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_probe_op { + pub op: __u8, + pub resv: __u8, + pub flags: __u16, + pub resv2: __u32, +} +#[test] +fn bindgen_test_layout_io_uring_probe_op() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(io_uring_probe_op)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_probe_op)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe_op), + "::", + stringify!(op) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe_op), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe_op), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe_op), + "::", + stringify!(resv2) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default)] +pub struct io_uring_probe { + pub last_op: __u8, + pub ops_len: __u8, + pub resv: __u16, + pub resv2: [__u32; 3usize], + pub ops: __IncompleteArrayField, +} +#[test] +fn bindgen_test_layout_io_uring_probe() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_probe)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_probe)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).last_op) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe), + "::", + stringify!(last_op) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ops_len) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe), + "::", + stringify!(ops_len) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe), + "::", + stringify!(resv2) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ops) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe), + "::", + stringify!(ops) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct io_uring_restriction { + pub opcode: __u16, + pub __bindgen_anon_1: io_uring_restriction__bindgen_ty_1, + pub resv: __u8, + pub resv2: [__u32; 3usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union io_uring_restriction__bindgen_ty_1 { + pub register_op: __u8, + pub sqe_op: __u8, + pub sqe_flags: __u8, +} +#[test] +fn bindgen_test_layout_io_uring_restriction__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(io_uring_restriction__bindgen_ty_1)) + ); + assert_eq!( + ::core::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(io_uring_restriction__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).register_op) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_restriction__bindgen_ty_1), + "::", + stringify!(register_op) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sqe_op) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_restriction__bindgen_ty_1), + "::", + stringify!(sqe_op) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sqe_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_restriction__bindgen_ty_1), + "::", + stringify!(sqe_flags) + ) + ); +} +impl Default for io_uring_restriction__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[test] +fn bindgen_test_layout_io_uring_restriction() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_restriction)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_restriction)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).opcode) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_restriction), + "::", + stringify!(opcode) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(io_uring_restriction), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_restriction), + "::", + stringify!(resv2) + ) + ); +} +impl Default for io_uring_restriction { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_buf { + pub addr: __u64, + pub len: __u32, + pub bid: __u16, + pub resv: __u16, +} +#[test] +fn bindgen_test_layout_io_uring_buf() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_buf)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_buf)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf), + "::", + stringify!(len) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).bid) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf), + "::", + stringify!(bid) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf), + "::", + stringify!(resv) + ) + ); +} +#[repr(C)] +pub struct io_uring_buf_ring { + pub __bindgen_anon_1: io_uring_buf_ring__bindgen_ty_1, +} +#[repr(C)] +pub struct io_uring_buf_ring__bindgen_ty_1 { + pub __bindgen_anon_1: __BindgenUnionField, + pub __bindgen_anon_2: __BindgenUnionField, + pub bindgen_union_field: [u64; 2usize], +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1 { + pub resv1: __u64, + pub resv2: __u32, + pub resv3: __u16, + pub tail: __u16, +} +#[test] +fn bindgen_test_layout_io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv1) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(resv1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(resv2) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv3) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(resv3) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(tail) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default)] +pub struct io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2 { + pub __empty_bufs: io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1, + pub bufs: __IncompleteArrayField, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1 {} +#[test] +fn bindgen_test_layout_io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1() { + assert_eq!( + ::core::mem::size_of::(), + 0usize, + concat!( + "Size of: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1) + ) + ); +} +#[test] +fn bindgen_test_layout_io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 0usize, + concat!( + "Size of: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__empty_bufs) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(__empty_bufs) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).bufs) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(bufs) + ) + ); +} +#[test] +fn bindgen_test_layout_io_uring_buf_ring__bindgen_ty_1() { + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_buf_ring__bindgen_ty_1)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_buf_ring__bindgen_ty_1)) + ); +} +impl Default for io_uring_buf_ring__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[test] +fn bindgen_test_layout_io_uring_buf_ring() { + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_buf_ring)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_buf_ring)) + ); +} +impl Default for io_uring_buf_ring { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const IOU_PBUF_RING_MMAP: io_uring_register_pbuf_ring_flags = 1; +pub type io_uring_register_pbuf_ring_flags = libc::c_uint; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_buf_reg { + pub ring_addr: __u64, + pub ring_entries: __u32, + pub bgid: __u16, + pub flags: __u16, + pub resv: [__u64; 3usize], +} +#[test] +fn bindgen_test_layout_io_uring_buf_reg() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(io_uring_buf_reg)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_buf_reg)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ring_addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_reg), + "::", + stringify!(ring_addr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ring_entries) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_reg), + "::", + stringify!(ring_entries) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).bgid) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_reg), + "::", + stringify!(bgid) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_reg), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_reg), + "::", + stringify!(resv) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_buf_status { + pub buf_group: __u32, + pub head: __u32, + pub resv: [__u32; 8usize], +} +#[test] +fn bindgen_test_layout_io_uring_buf_status() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(io_uring_buf_status)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_buf_status)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).buf_group) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_status), + "::", + stringify!(buf_group) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_status), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_status), + "::", + stringify!(resv) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_napi { + pub busy_poll_to: __u32, + pub prefer_busy_poll: __u8, + pub pad: [__u8; 3usize], + pub resv: __u64, +} +#[test] +fn bindgen_test_layout_io_uring_napi() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_napi)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_napi)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).busy_poll_to) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_napi), + "::", + stringify!(busy_poll_to) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).prefer_busy_poll) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_napi), + "::", + stringify!(prefer_busy_poll) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(io_uring_napi), + "::", + stringify!(pad) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_napi), + "::", + stringify!(resv) + ) + ); +} +pub const IORING_RESTRICTION_REGISTER_OP: io_uring_register_restriction_op = 0; +pub const IORING_RESTRICTION_SQE_OP: io_uring_register_restriction_op = 1; +pub const IORING_RESTRICTION_SQE_FLAGS_ALLOWED: io_uring_register_restriction_op = 2; +pub const IORING_RESTRICTION_SQE_FLAGS_REQUIRED: io_uring_register_restriction_op = 3; +pub const IORING_RESTRICTION_LAST: io_uring_register_restriction_op = 4; +pub type io_uring_register_restriction_op = libc::c_uint; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_getevents_arg { + pub sigmask: __u64, + pub sigmask_sz: __u32, + pub pad: __u32, + pub ts: __u64, +} +#[test] +fn bindgen_test_layout_io_uring_getevents_arg() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(io_uring_getevents_arg)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_getevents_arg)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sigmask) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_getevents_arg), + "::", + stringify!(sigmask) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sigmask_sz) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_getevents_arg), + "::", + stringify!(sigmask_sz) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_getevents_arg), + "::", + stringify!(pad) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ts) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_getevents_arg), + "::", + stringify!(ts) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_sync_cancel_reg { + pub addr: __u64, + pub fd: __s32, + pub flags: __u32, + pub timeout: __kernel_timespec, + pub opcode: __u8, + pub pad: [__u8; 7usize], + pub pad2: [__u64; 3usize], +} +#[test] +fn bindgen_test_layout_io_uring_sync_cancel_reg() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(io_uring_sync_cancel_reg)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_sync_cancel_reg)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(fd) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(timeout) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).opcode) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(opcode) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(pad) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).pad2) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(pad2) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_file_index_range { + pub off: __u32, + pub len: __u32, + pub resv: __u64, +} +#[test] +fn bindgen_test_layout_io_uring_file_index_range() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_file_index_range)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_file_index_range)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).off) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_file_index_range), + "::", + stringify!(off) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_file_index_range), + "::", + stringify!(len) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_file_index_range), + "::", + stringify!(resv) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_recvmsg_out { + pub namelen: __u32, + pub controllen: __u32, + pub payloadlen: __u32, + pub flags: __u32, +} +#[test] +fn bindgen_test_layout_io_uring_recvmsg_out() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_recvmsg_out)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_recvmsg_out)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).namelen) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_recvmsg_out), + "::", + stringify!(namelen) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).controllen) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_recvmsg_out), + "::", + stringify!(controllen) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).payloadlen) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_recvmsg_out), + "::", + stringify!(payloadlen) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_recvmsg_out), + "::", + stringify!(flags) + ) + ); +} +pub const SOCKET_URING_OP_SIOCINQ: io_uring_socket_op = 0; +pub const SOCKET_URING_OP_SIOCOUTQ: io_uring_socket_op = 1; +pub const SOCKET_URING_OP_GETSOCKOPT: io_uring_socket_op = 2; +pub const SOCKET_URING_OP_SETSOCKOPT: io_uring_socket_op = 3; +pub type io_uring_socket_op = libc::c_uint; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct futex_waitv { + pub val: __u64, + pub uaddr: __u64, + pub flags: __u32, + pub __reserved: __u32, +} +#[test] +fn bindgen_test_layout_futex_waitv() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(futex_waitv)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(futex_waitv)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(futex_waitv), + "::", + stringify!(val) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).uaddr) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(futex_waitv), + "::", + stringify!(uaddr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(futex_waitv), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(futex_waitv), + "::", + stringify!(__reserved) + ) + ); +} diff --git a/src/sys/sys_x86-64.rs b/src/sys/sys_x86-64.rs new file mode 100644 index 0000000..d33bc71 --- /dev/null +++ b/src/sys/sys_x86-64.rs @@ -0,0 +1,2986 @@ +/* automatically generated by rust-bindgen 0.69.4 */ + +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::core::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub const fn new() -> Self { + __IncompleteArrayField(::core::marker::PhantomData, []) + } + #[inline] + pub fn as_ptr(&self) -> *const T { + self as *const _ as *const T + } + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut T { + self as *mut _ as *mut T + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::core::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::core::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +#[repr(C)] +pub struct __BindgenUnionField(::core::marker::PhantomData); +impl __BindgenUnionField { + #[inline] + pub const fn new() -> Self { + __BindgenUnionField(::core::marker::PhantomData) + } + #[inline] + pub unsafe fn as_ref(&self) -> &T { + ::core::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut(&mut self) -> &mut T { + ::core::mem::transmute(self) + } +} +impl ::core::default::Default for __BindgenUnionField { + #[inline] + fn default() -> Self { + Self::new() + } +} +impl ::core::clone::Clone for __BindgenUnionField { + #[inline] + fn clone(&self) -> Self { + *self + } +} +impl ::core::marker::Copy for __BindgenUnionField {} +impl ::core::fmt::Debug for __BindgenUnionField { + fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fmt.write_str("__BindgenUnionField") + } +} +impl ::core::hash::Hash for __BindgenUnionField { + fn hash(&self, _state: &mut H) {} +} +impl ::core::cmp::PartialEq for __BindgenUnionField { + fn eq(&self, _other: &__BindgenUnionField) -> bool { + true + } +} +impl ::core::cmp::Eq for __BindgenUnionField {} +pub const __NR_io_uring_setup: u32 = 425; +pub const __NR_io_uring_enter: u32 = 426; +pub const __NR_io_uring_register: u32 = 427; +pub const IORING_FILE_INDEX_ALLOC: i32 = -1; +pub const IORING_SETUP_IOPOLL: u32 = 1; +pub const IORING_SETUP_SQPOLL: u32 = 2; +pub const IORING_SETUP_SQ_AFF: u32 = 4; +pub const IORING_SETUP_CQSIZE: u32 = 8; +pub const IORING_SETUP_CLAMP: u32 = 16; +pub const IORING_SETUP_ATTACH_WQ: u32 = 32; +pub const IORING_SETUP_R_DISABLED: u32 = 64; +pub const IORING_SETUP_SUBMIT_ALL: u32 = 128; +pub const IORING_SETUP_COOP_TASKRUN: u32 = 256; +pub const IORING_SETUP_TASKRUN_FLAG: u32 = 512; +pub const IORING_SETUP_SQE128: u32 = 1024; +pub const IORING_SETUP_CQE32: u32 = 2048; +pub const IORING_SETUP_SINGLE_ISSUER: u32 = 4096; +pub const IORING_SETUP_DEFER_TASKRUN: u32 = 8192; +pub const IORING_SETUP_NO_MMAP: u32 = 16384; +pub const IORING_SETUP_REGISTERED_FD_ONLY: u32 = 32768; +pub const IORING_SETUP_NO_SQARRAY: u32 = 65536; +pub const IORING_URING_CMD_FIXED: u32 = 1; +pub const IORING_URING_CMD_MASK: u32 = 1; +pub const IORING_FSYNC_DATASYNC: u32 = 1; +pub const IORING_TIMEOUT_ABS: u32 = 1; +pub const IORING_TIMEOUT_UPDATE: u32 = 2; +pub const IORING_TIMEOUT_BOOTTIME: u32 = 4; +pub const IORING_TIMEOUT_REALTIME: u32 = 8; +pub const IORING_LINK_TIMEOUT_UPDATE: u32 = 16; +pub const IORING_TIMEOUT_ETIME_SUCCESS: u32 = 32; +pub const IORING_TIMEOUT_MULTISHOT: u32 = 64; +pub const IORING_TIMEOUT_CLOCK_MASK: u32 = 12; +pub const IORING_TIMEOUT_UPDATE_MASK: u32 = 18; +pub const SPLICE_F_FD_IN_FIXED: u32 = 2147483648; +pub const IORING_POLL_ADD_MULTI: u32 = 1; +pub const IORING_POLL_UPDATE_EVENTS: u32 = 2; +pub const IORING_POLL_UPDATE_USER_DATA: u32 = 4; +pub const IORING_POLL_ADD_LEVEL: u32 = 8; +pub const IORING_ASYNC_CANCEL_ALL: u32 = 1; +pub const IORING_ASYNC_CANCEL_FD: u32 = 2; +pub const IORING_ASYNC_CANCEL_ANY: u32 = 4; +pub const IORING_ASYNC_CANCEL_FD_FIXED: u32 = 8; +pub const IORING_ASYNC_CANCEL_USERDATA: u32 = 16; +pub const IORING_ASYNC_CANCEL_OP: u32 = 32; +pub const IORING_RECVSEND_POLL_FIRST: u32 = 1; +pub const IORING_RECV_MULTISHOT: u32 = 2; +pub const IORING_RECVSEND_FIXED_BUF: u32 = 4; +pub const IORING_SEND_ZC_REPORT_USAGE: u32 = 8; +pub const IORING_RECVSEND_BUNDLE: u32 = 16; +pub const IORING_NOTIF_USAGE_ZC_COPIED: u32 = 2147483648; +pub const IORING_ACCEPT_MULTISHOT: u32 = 1; +pub const IORING_ACCEPT_DONTWAIT: u32 = 2; +pub const IORING_ACCEPT_POLL_FIRST: u32 = 4; +pub const IORING_MSG_RING_CQE_SKIP: u32 = 1; +pub const IORING_MSG_RING_FLAGS_PASS: u32 = 2; +pub const IORING_FIXED_FD_NO_CLOEXEC: u32 = 1; +pub const IORING_NOP_INJECT_RESULT: u32 = 1; +pub const IORING_CQE_F_BUFFER: u32 = 1; +pub const IORING_CQE_F_MORE: u32 = 2; +pub const IORING_CQE_F_SOCK_NONEMPTY: u32 = 4; +pub const IORING_CQE_F_NOTIF: u32 = 8; +pub const IORING_CQE_BUFFER_SHIFT: u32 = 16; +pub const IORING_OFF_SQ_RING: u32 = 0; +pub const IORING_OFF_CQ_RING: u32 = 134217728; +pub const IORING_OFF_SQES: u32 = 268435456; +pub const IORING_OFF_PBUF_RING: u32 = 2147483648; +pub const IORING_OFF_PBUF_SHIFT: u32 = 16; +pub const IORING_OFF_MMAP_MASK: u32 = 4160749568; +pub const IORING_SQ_NEED_WAKEUP: u32 = 1; +pub const IORING_SQ_CQ_OVERFLOW: u32 = 2; +pub const IORING_SQ_TASKRUN: u32 = 4; +pub const IORING_CQ_EVENTFD_DISABLED: u32 = 1; +pub const IORING_ENTER_GETEVENTS: u32 = 1; +pub const IORING_ENTER_SQ_WAKEUP: u32 = 2; +pub const IORING_ENTER_SQ_WAIT: u32 = 4; +pub const IORING_ENTER_EXT_ARG: u32 = 8; +pub const IORING_ENTER_REGISTERED_RING: u32 = 16; +pub const IORING_FEAT_SINGLE_MMAP: u32 = 1; +pub const IORING_FEAT_NODROP: u32 = 2; +pub const IORING_FEAT_SUBMIT_STABLE: u32 = 4; +pub const IORING_FEAT_RW_CUR_POS: u32 = 8; +pub const IORING_FEAT_CUR_PERSONALITY: u32 = 16; +pub const IORING_FEAT_FAST_POLL: u32 = 32; +pub const IORING_FEAT_POLL_32BITS: u32 = 64; +pub const IORING_FEAT_SQPOLL_NONFIXED: u32 = 128; +pub const IORING_FEAT_EXT_ARG: u32 = 256; +pub const IORING_FEAT_NATIVE_WORKERS: u32 = 512; +pub const IORING_FEAT_RSRC_TAGS: u32 = 1024; +pub const IORING_FEAT_CQE_SKIP: u32 = 2048; +pub const IORING_FEAT_LINKED_FILE: u32 = 4096; +pub const IORING_FEAT_REG_REG_RING: u32 = 8192; +pub const IORING_FEAT_RECVSEND_BUNDLE: u32 = 16384; +pub const IORING_RSRC_REGISTER_SPARSE: u32 = 1; +pub const IORING_REGISTER_FILES_SKIP: i32 = -2; +pub const IO_URING_OP_SUPPORTED: u32 = 1; +pub type __u8 = libc::c_uchar; +pub type __u16 = libc::c_ushort; +pub type __s32 = libc::c_int; +pub type __u32 = libc::c_uint; +pub type __u64 = libc::c_ulonglong; +pub type __kernel_time64_t = libc::c_longlong; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __kernel_timespec { + pub tv_sec: __kernel_time64_t, + pub tv_nsec: libc::c_longlong, +} +#[test] +fn bindgen_test_layout___kernel_timespec() { + const UNINIT: ::core::mem::MaybeUninit<__kernel_timespec> = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::<__kernel_timespec>(), + 16usize, + concat!("Size of: ", stringify!(__kernel_timespec)) + ); + assert_eq!( + ::core::mem::align_of::<__kernel_timespec>(), + 8usize, + concat!("Alignment of ", stringify!(__kernel_timespec)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__kernel_timespec), + "::", + stringify!(tv_sec) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__kernel_timespec), + "::", + stringify!(tv_nsec) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct open_how { + pub flags: __u64, + pub mode: __u64, + pub resolve: __u64, +} +#[test] +fn bindgen_test_layout_open_how() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(open_how)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(open_how)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(open_how), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(open_how), + "::", + stringify!(mode) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resolve) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(open_how), + "::", + stringify!(resolve) + ) + ); +} +pub type __kernel_rwf_t = libc::c_int; +#[repr(C)] +pub struct io_uring_sqe { + pub opcode: __u8, + pub flags: __u8, + pub ioprio: __u16, + pub fd: __s32, + pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_1, + pub __bindgen_anon_2: io_uring_sqe__bindgen_ty_2, + pub len: __u32, + pub __bindgen_anon_3: io_uring_sqe__bindgen_ty_3, + pub user_data: __u64, + pub __bindgen_anon_4: io_uring_sqe__bindgen_ty_4, + pub personality: __u16, + pub __bindgen_anon_5: io_uring_sqe__bindgen_ty_5, + pub __bindgen_anon_6: io_uring_sqe__bindgen_ty_6, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union io_uring_sqe__bindgen_ty_1 { + pub off: __u64, + pub addr2: __u64, + pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_sqe__bindgen_ty_1__bindgen_ty_1 { + pub cmd_op: __u32, + pub __pad1: __u32, +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cmd_op) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(cmd_op) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__pad1) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(__pad1) + ) + ); +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_1)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).off) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_1), + "::", + stringify!(off) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).addr2) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_1), + "::", + stringify!(addr2) + ) + ); +} +impl Default for io_uring_sqe__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union io_uring_sqe__bindgen_ty_2 { + pub addr: __u64, + pub splice_off_in: __u64, + pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_2__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_sqe__bindgen_ty_2__bindgen_ty_1 { + pub level: __u32, + pub optname: __u32, +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_2__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).level) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(level) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).optname) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(optname) + ) + ); +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_2() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_2)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_2), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).splice_off_in) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_2), + "::", + stringify!(splice_off_in) + ) + ); +} +impl Default for io_uring_sqe__bindgen_ty_2 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union io_uring_sqe__bindgen_ty_3 { + pub rw_flags: __kernel_rwf_t, + pub fsync_flags: __u32, + pub poll_events: __u16, + pub poll32_events: __u32, + pub sync_range_flags: __u32, + pub msg_flags: __u32, + pub timeout_flags: __u32, + pub accept_flags: __u32, + pub cancel_flags: __u32, + pub open_flags: __u32, + pub statx_flags: __u32, + pub fadvise_advice: __u32, + pub splice_flags: __u32, + pub rename_flags: __u32, + pub unlink_flags: __u32, + pub hardlink_flags: __u32, + pub xattr_flags: __u32, + pub msg_ring_flags: __u32, + pub uring_cmd_flags: __u32, + pub waitid_flags: __u32, + pub futex_flags: __u32, + pub install_fd_flags: __u32, + pub nop_flags: __u32, +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_3() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_3)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_3)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).rw_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(rw_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).fsync_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(fsync_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).poll_events) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(poll_events) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).poll32_events) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(poll32_events) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sync_range_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(sync_range_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).msg_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(msg_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).timeout_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(timeout_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).accept_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(accept_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cancel_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(cancel_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).open_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(open_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).statx_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(statx_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).fadvise_advice) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(fadvise_advice) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).splice_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(splice_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).rename_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(rename_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).unlink_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(unlink_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).hardlink_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(hardlink_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).xattr_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(xattr_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).msg_ring_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(msg_ring_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).uring_cmd_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(uring_cmd_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).waitid_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(waitid_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).futex_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(futex_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).install_fd_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(install_fd_flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).nop_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_3), + "::", + stringify!(nop_flags) + ) + ); +} +impl Default for io_uring_sqe__bindgen_ty_3 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub union io_uring_sqe__bindgen_ty_4 { + pub buf_index: __u16, + pub buf_group: __u16, +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_4() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 2usize, + concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_4)) + ); + assert_eq!( + ::core::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_4)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).buf_index) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_4), + "::", + stringify!(buf_index) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).buf_group) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_4), + "::", + stringify!(buf_group) + ) + ); +} +impl Default for io_uring_sqe__bindgen_ty_4 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union io_uring_sqe__bindgen_ty_5 { + pub splice_fd_in: __s32, + pub file_index: __u32, + pub optlen: __u32, + pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_5__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_sqe__bindgen_ty_5__bindgen_ty_1 { + pub addr_len: __u16, + pub __pad3: [__u16; 1usize], +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_5__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 4usize, + concat!( + "Size of: ", + stringify!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 2usize, + concat!( + "Alignment of ", + stringify!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).addr_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1), + "::", + stringify!(addr_len) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__pad3) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_5__bindgen_ty_1), + "::", + stringify!(__pad3) + ) + ); +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_5() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_5)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_5)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).splice_fd_in) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_5), + "::", + stringify!(splice_fd_in) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).file_index) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_5), + "::", + stringify!(file_index) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).optlen) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_5), + "::", + stringify!(optlen) + ) + ); +} +impl Default for io_uring_sqe__bindgen_ty_5 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +pub struct io_uring_sqe__bindgen_ty_6 { + pub __bindgen_anon_1: __BindgenUnionField, + pub optval: __BindgenUnionField<__u64>, + pub cmd: __BindgenUnionField<[__u8; 0usize]>, + pub bindgen_union_field: [u64; 2usize], +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_sqe__bindgen_ty_6__bindgen_ty_1 { + pub addr3: __u64, + pub __pad2: [__u64; 1usize], +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_6__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).addr3) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1), + "::", + stringify!(addr3) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__pad2) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_6__bindgen_ty_1), + "::", + stringify!(__pad2) + ) + ); +} +#[test] +fn bindgen_test_layout_io_uring_sqe__bindgen_ty_6() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_sqe__bindgen_ty_6)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_6)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).optval) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_6), + "::", + stringify!(optval) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cmd) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe__bindgen_ty_6), + "::", + stringify!(cmd) + ) + ); +} +impl Default for io_uring_sqe__bindgen_ty_6 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[test] +fn bindgen_test_layout_io_uring_sqe() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(io_uring_sqe)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_sqe)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).opcode) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(opcode) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ioprio) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(ioprio) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(fd) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(len) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(user_data) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).personality) as usize - ptr as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sqe), + "::", + stringify!(personality) + ) + ); +} +impl Default for io_uring_sqe { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const IOSQE_FIXED_FILE_BIT: io_uring_sqe_flags_bit = 0; +pub const IOSQE_IO_DRAIN_BIT: io_uring_sqe_flags_bit = 1; +pub const IOSQE_IO_LINK_BIT: io_uring_sqe_flags_bit = 2; +pub const IOSQE_IO_HARDLINK_BIT: io_uring_sqe_flags_bit = 3; +pub const IOSQE_ASYNC_BIT: io_uring_sqe_flags_bit = 4; +pub const IOSQE_BUFFER_SELECT_BIT: io_uring_sqe_flags_bit = 5; +pub const IOSQE_CQE_SKIP_SUCCESS_BIT: io_uring_sqe_flags_bit = 6; +pub type io_uring_sqe_flags_bit = libc::c_uint; +pub const IORING_OP_NOP: io_uring_op = 0; +pub const IORING_OP_READV: io_uring_op = 1; +pub const IORING_OP_WRITEV: io_uring_op = 2; +pub const IORING_OP_FSYNC: io_uring_op = 3; +pub const IORING_OP_READ_FIXED: io_uring_op = 4; +pub const IORING_OP_WRITE_FIXED: io_uring_op = 5; +pub const IORING_OP_POLL_ADD: io_uring_op = 6; +pub const IORING_OP_POLL_REMOVE: io_uring_op = 7; +pub const IORING_OP_SYNC_FILE_RANGE: io_uring_op = 8; +pub const IORING_OP_SENDMSG: io_uring_op = 9; +pub const IORING_OP_RECVMSG: io_uring_op = 10; +pub const IORING_OP_TIMEOUT: io_uring_op = 11; +pub const IORING_OP_TIMEOUT_REMOVE: io_uring_op = 12; +pub const IORING_OP_ACCEPT: io_uring_op = 13; +pub const IORING_OP_ASYNC_CANCEL: io_uring_op = 14; +pub const IORING_OP_LINK_TIMEOUT: io_uring_op = 15; +pub const IORING_OP_CONNECT: io_uring_op = 16; +pub const IORING_OP_FALLOCATE: io_uring_op = 17; +pub const IORING_OP_OPENAT: io_uring_op = 18; +pub const IORING_OP_CLOSE: io_uring_op = 19; +pub const IORING_OP_FILES_UPDATE: io_uring_op = 20; +pub const IORING_OP_STATX: io_uring_op = 21; +pub const IORING_OP_READ: io_uring_op = 22; +pub const IORING_OP_WRITE: io_uring_op = 23; +pub const IORING_OP_FADVISE: io_uring_op = 24; +pub const IORING_OP_MADVISE: io_uring_op = 25; +pub const IORING_OP_SEND: io_uring_op = 26; +pub const IORING_OP_RECV: io_uring_op = 27; +pub const IORING_OP_OPENAT2: io_uring_op = 28; +pub const IORING_OP_EPOLL_CTL: io_uring_op = 29; +pub const IORING_OP_SPLICE: io_uring_op = 30; +pub const IORING_OP_PROVIDE_BUFFERS: io_uring_op = 31; +pub const IORING_OP_REMOVE_BUFFERS: io_uring_op = 32; +pub const IORING_OP_TEE: io_uring_op = 33; +pub const IORING_OP_SHUTDOWN: io_uring_op = 34; +pub const IORING_OP_RENAMEAT: io_uring_op = 35; +pub const IORING_OP_UNLINKAT: io_uring_op = 36; +pub const IORING_OP_MKDIRAT: io_uring_op = 37; +pub const IORING_OP_SYMLINKAT: io_uring_op = 38; +pub const IORING_OP_LINKAT: io_uring_op = 39; +pub const IORING_OP_MSG_RING: io_uring_op = 40; +pub const IORING_OP_FSETXATTR: io_uring_op = 41; +pub const IORING_OP_SETXATTR: io_uring_op = 42; +pub const IORING_OP_FGETXATTR: io_uring_op = 43; +pub const IORING_OP_GETXATTR: io_uring_op = 44; +pub const IORING_OP_SOCKET: io_uring_op = 45; +pub const IORING_OP_URING_CMD: io_uring_op = 46; +pub const IORING_OP_SEND_ZC: io_uring_op = 47; +pub const IORING_OP_SENDMSG_ZC: io_uring_op = 48; +pub const IORING_OP_READ_MULTISHOT: io_uring_op = 49; +pub const IORING_OP_WAITID: io_uring_op = 50; +pub const IORING_OP_FUTEX_WAIT: io_uring_op = 51; +pub const IORING_OP_FUTEX_WAKE: io_uring_op = 52; +pub const IORING_OP_FUTEX_WAITV: io_uring_op = 53; +pub const IORING_OP_FIXED_FD_INSTALL: io_uring_op = 54; +pub const IORING_OP_FTRUNCATE: io_uring_op = 55; +pub const IORING_OP_LAST: io_uring_op = 56; +pub type io_uring_op = libc::c_uint; +pub const IORING_MSG_DATA: io_uring_msg_ring_flags = 0; +pub const IORING_MSG_SEND_FD: io_uring_msg_ring_flags = 1; +pub type io_uring_msg_ring_flags = libc::c_uint; +#[repr(C)] +#[derive(Debug, Default)] +pub struct io_uring_cqe { + pub user_data: __u64, + pub res: __s32, + pub flags: __u32, + pub big_cqe: __IncompleteArrayField<__u64>, +} +#[test] +fn bindgen_test_layout_io_uring_cqe() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_cqe)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_cqe)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_cqe), + "::", + stringify!(user_data) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).res) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_cqe), + "::", + stringify!(res) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_cqe), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).big_cqe) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_cqe), + "::", + stringify!(big_cqe) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_sqring_offsets { + pub head: __u32, + pub tail: __u32, + pub ring_mask: __u32, + pub ring_entries: __u32, + pub flags: __u32, + pub dropped: __u32, + pub array: __u32, + pub resv1: __u32, + pub user_addr: __u64, +} +#[test] +fn bindgen_test_layout_io_sqring_offsets() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(io_sqring_offsets)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_sqring_offsets)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(tail) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ring_mask) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(ring_mask) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ring_entries) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(ring_entries) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).dropped) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(dropped) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).array) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(array) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv1) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(resv1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).user_addr) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(io_sqring_offsets), + "::", + stringify!(user_addr) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_cqring_offsets { + pub head: __u32, + pub tail: __u32, + pub ring_mask: __u32, + pub ring_entries: __u32, + pub overflow: __u32, + pub cqes: __u32, + pub flags: __u32, + pub resv1: __u32, + pub user_addr: __u64, +} +#[test] +fn bindgen_test_layout_io_cqring_offsets() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(io_cqring_offsets)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_cqring_offsets)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(tail) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ring_mask) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(ring_mask) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ring_entries) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(ring_entries) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).overflow) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(overflow) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cqes) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(cqes) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv1) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(resv1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).user_addr) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(io_cqring_offsets), + "::", + stringify!(user_addr) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_params { + pub sq_entries: __u32, + pub cq_entries: __u32, + pub flags: __u32, + pub sq_thread_cpu: __u32, + pub sq_thread_idle: __u32, + pub features: __u32, + pub wq_fd: __u32, + pub resv: [__u32; 3usize], + pub sq_off: io_sqring_offsets, + pub cq_off: io_cqring_offsets, +} +#[test] +fn bindgen_test_layout_io_uring_params() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 120usize, + concat!("Size of: ", stringify!(io_uring_params)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_params)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sq_entries) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(sq_entries) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cq_entries) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(cq_entries) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sq_thread_cpu) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(sq_thread_cpu) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sq_thread_idle) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(sq_thread_idle) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).features) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(features) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).wq_fd) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(wq_fd) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sq_off) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(sq_off) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cq_off) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(io_uring_params), + "::", + stringify!(cq_off) + ) + ); +} +pub const IORING_REGISTER_BUFFERS: io_uring_register_op = 0; +pub const IORING_UNREGISTER_BUFFERS: io_uring_register_op = 1; +pub const IORING_REGISTER_FILES: io_uring_register_op = 2; +pub const IORING_UNREGISTER_FILES: io_uring_register_op = 3; +pub const IORING_REGISTER_EVENTFD: io_uring_register_op = 4; +pub const IORING_UNREGISTER_EVENTFD: io_uring_register_op = 5; +pub const IORING_REGISTER_FILES_UPDATE: io_uring_register_op = 6; +pub const IORING_REGISTER_EVENTFD_ASYNC: io_uring_register_op = 7; +pub const IORING_REGISTER_PROBE: io_uring_register_op = 8; +pub const IORING_REGISTER_PERSONALITY: io_uring_register_op = 9; +pub const IORING_UNREGISTER_PERSONALITY: io_uring_register_op = 10; +pub const IORING_REGISTER_RESTRICTIONS: io_uring_register_op = 11; +pub const IORING_REGISTER_ENABLE_RINGS: io_uring_register_op = 12; +pub const IORING_REGISTER_FILES2: io_uring_register_op = 13; +pub const IORING_REGISTER_FILES_UPDATE2: io_uring_register_op = 14; +pub const IORING_REGISTER_BUFFERS2: io_uring_register_op = 15; +pub const IORING_REGISTER_BUFFERS_UPDATE: io_uring_register_op = 16; +pub const IORING_REGISTER_IOWQ_AFF: io_uring_register_op = 17; +pub const IORING_UNREGISTER_IOWQ_AFF: io_uring_register_op = 18; +pub const IORING_REGISTER_IOWQ_MAX_WORKERS: io_uring_register_op = 19; +pub const IORING_REGISTER_RING_FDS: io_uring_register_op = 20; +pub const IORING_UNREGISTER_RING_FDS: io_uring_register_op = 21; +pub const IORING_REGISTER_PBUF_RING: io_uring_register_op = 22; +pub const IORING_UNREGISTER_PBUF_RING: io_uring_register_op = 23; +pub const IORING_REGISTER_SYNC_CANCEL: io_uring_register_op = 24; +pub const IORING_REGISTER_FILE_ALLOC_RANGE: io_uring_register_op = 25; +pub const IORING_REGISTER_PBUF_STATUS: io_uring_register_op = 26; +pub const IORING_REGISTER_NAPI: io_uring_register_op = 27; +pub const IORING_UNREGISTER_NAPI: io_uring_register_op = 28; +pub const IORING_REGISTER_LAST: io_uring_register_op = 29; +pub const IORING_REGISTER_USE_REGISTERED_RING: io_uring_register_op = 2147483648; +pub type io_uring_register_op = libc::c_uint; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_files_update { + pub offset: __u32, + pub resv: __u32, + pub fds: __u64, +} +#[test] +fn bindgen_test_layout_io_uring_files_update() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_files_update)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_files_update)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_files_update), + "::", + stringify!(offset) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_files_update), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).fds) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_files_update), + "::", + stringify!(fds) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_rsrc_register { + pub nr: __u32, + pub flags: __u32, + pub resv2: __u64, + pub data: __u64, + pub tags: __u64, +} +#[test] +fn bindgen_test_layout_io_uring_rsrc_register() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(io_uring_rsrc_register)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_rsrc_register)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_register), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_register), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_register), + "::", + stringify!(resv2) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_register), + "::", + stringify!(data) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tags) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_register), + "::", + stringify!(tags) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_rsrc_update { + pub offset: __u32, + pub resv: __u32, + pub data: __u64, +} +#[test] +fn bindgen_test_layout_io_uring_rsrc_update() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_rsrc_update)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_rsrc_update)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update), + "::", + stringify!(offset) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update), + "::", + stringify!(data) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_rsrc_update2 { + pub offset: __u32, + pub resv: __u32, + pub data: __u64, + pub tags: __u64, + pub nr: __u32, + pub resv2: __u32, +} +#[test] +fn bindgen_test_layout_io_uring_rsrc_update2() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(io_uring_rsrc_update2)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_rsrc_update2)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update2), + "::", + stringify!(offset) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update2), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update2), + "::", + stringify!(data) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tags) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update2), + "::", + stringify!(tags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).nr) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update2), + "::", + stringify!(nr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(io_uring_rsrc_update2), + "::", + stringify!(resv2) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_probe_op { + pub op: __u8, + pub resv: __u8, + pub flags: __u16, + pub resv2: __u32, +} +#[test] +fn bindgen_test_layout_io_uring_probe_op() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(io_uring_probe_op)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_probe_op)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe_op), + "::", + stringify!(op) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe_op), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe_op), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe_op), + "::", + stringify!(resv2) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default)] +pub struct io_uring_probe { + pub last_op: __u8, + pub ops_len: __u8, + pub resv: __u16, + pub resv2: [__u32; 3usize], + pub ops: __IncompleteArrayField, +} +#[test] +fn bindgen_test_layout_io_uring_probe() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_probe)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_probe)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).last_op) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe), + "::", + stringify!(last_op) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ops_len) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe), + "::", + stringify!(ops_len) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe), + "::", + stringify!(resv2) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ops) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_probe), + "::", + stringify!(ops) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct io_uring_restriction { + pub opcode: __u16, + pub __bindgen_anon_1: io_uring_restriction__bindgen_ty_1, + pub resv: __u8, + pub resv2: [__u32; 3usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union io_uring_restriction__bindgen_ty_1 { + pub register_op: __u8, + pub sqe_op: __u8, + pub sqe_flags: __u8, +} +#[test] +fn bindgen_test_layout_io_uring_restriction__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(io_uring_restriction__bindgen_ty_1)) + ); + assert_eq!( + ::core::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(io_uring_restriction__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).register_op) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_restriction__bindgen_ty_1), + "::", + stringify!(register_op) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sqe_op) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_restriction__bindgen_ty_1), + "::", + stringify!(sqe_op) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sqe_flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_restriction__bindgen_ty_1), + "::", + stringify!(sqe_flags) + ) + ); +} +impl Default for io_uring_restriction__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[test] +fn bindgen_test_layout_io_uring_restriction() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_restriction)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_restriction)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).opcode) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_restriction), + "::", + stringify!(opcode) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(io_uring_restriction), + "::", + stringify!(resv) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_restriction), + "::", + stringify!(resv2) + ) + ); +} +impl Default for io_uring_restriction { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_buf { + pub addr: __u64, + pub len: __u32, + pub bid: __u16, + pub resv: __u16, +} +#[test] +fn bindgen_test_layout_io_uring_buf() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_buf)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_buf)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf), + "::", + stringify!(len) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).bid) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf), + "::", + stringify!(bid) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf), + "::", + stringify!(resv) + ) + ); +} +#[repr(C)] +pub struct io_uring_buf_ring { + pub __bindgen_anon_1: io_uring_buf_ring__bindgen_ty_1, +} +#[repr(C)] +pub struct io_uring_buf_ring__bindgen_ty_1 { + pub __bindgen_anon_1: __BindgenUnionField, + pub __bindgen_anon_2: __BindgenUnionField, + pub bindgen_union_field: [u64; 2usize], +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1 { + pub resv1: __u64, + pub resv2: __u32, + pub resv3: __u16, + pub tail: __u16, +} +#[test] +fn bindgen_test_layout_io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv1) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(resv1) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(resv2) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv3) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(resv3) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(tail) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default)] +pub struct io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2 { + pub __empty_bufs: io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1, + pub bufs: __IncompleteArrayField, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1 {} +#[test] +fn bindgen_test_layout_io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1() { + assert_eq!( + ::core::mem::size_of::(), + 0usize, + concat!( + "Size of: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1) + ) + ); +} +#[test] +fn bindgen_test_layout_io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 0usize, + concat!( + "Size of: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__empty_bufs) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(__empty_bufs) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).bufs) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(bufs) + ) + ); +} +#[test] +fn bindgen_test_layout_io_uring_buf_ring__bindgen_ty_1() { + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_buf_ring__bindgen_ty_1)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_buf_ring__bindgen_ty_1)) + ); +} +impl Default for io_uring_buf_ring__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[test] +fn bindgen_test_layout_io_uring_buf_ring() { + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_buf_ring)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_buf_ring)) + ); +} +impl Default for io_uring_buf_ring { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const IOU_PBUF_RING_MMAP: io_uring_register_pbuf_ring_flags = 1; +pub type io_uring_register_pbuf_ring_flags = libc::c_uint; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_buf_reg { + pub ring_addr: __u64, + pub ring_entries: __u32, + pub bgid: __u16, + pub flags: __u16, + pub resv: [__u64; 3usize], +} +#[test] +fn bindgen_test_layout_io_uring_buf_reg() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(io_uring_buf_reg)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_buf_reg)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ring_addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_reg), + "::", + stringify!(ring_addr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ring_entries) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_reg), + "::", + stringify!(ring_entries) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).bgid) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_reg), + "::", + stringify!(bgid) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_reg), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_reg), + "::", + stringify!(resv) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_buf_status { + pub buf_group: __u32, + pub head: __u32, + pub resv: [__u32; 8usize], +} +#[test] +fn bindgen_test_layout_io_uring_buf_status() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(io_uring_buf_status)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_buf_status)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).buf_group) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_status), + "::", + stringify!(buf_group) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_status), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_buf_status), + "::", + stringify!(resv) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_napi { + pub busy_poll_to: __u32, + pub prefer_busy_poll: __u8, + pub pad: [__u8; 3usize], + pub resv: __u64, +} +#[test] +fn bindgen_test_layout_io_uring_napi() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_napi)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_napi)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).busy_poll_to) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_napi), + "::", + stringify!(busy_poll_to) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).prefer_busy_poll) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_napi), + "::", + stringify!(prefer_busy_poll) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(io_uring_napi), + "::", + stringify!(pad) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_napi), + "::", + stringify!(resv) + ) + ); +} +pub const IORING_RESTRICTION_REGISTER_OP: io_uring_register_restriction_op = 0; +pub const IORING_RESTRICTION_SQE_OP: io_uring_register_restriction_op = 1; +pub const IORING_RESTRICTION_SQE_FLAGS_ALLOWED: io_uring_register_restriction_op = 2; +pub const IORING_RESTRICTION_SQE_FLAGS_REQUIRED: io_uring_register_restriction_op = 3; +pub const IORING_RESTRICTION_LAST: io_uring_register_restriction_op = 4; +pub type io_uring_register_restriction_op = libc::c_uint; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_getevents_arg { + pub sigmask: __u64, + pub sigmask_sz: __u32, + pub pad: __u32, + pub ts: __u64, +} +#[test] +fn bindgen_test_layout_io_uring_getevents_arg() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(io_uring_getevents_arg)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_getevents_arg)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sigmask) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_getevents_arg), + "::", + stringify!(sigmask) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sigmask_sz) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_getevents_arg), + "::", + stringify!(sigmask_sz) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_getevents_arg), + "::", + stringify!(pad) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ts) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_getevents_arg), + "::", + stringify!(ts) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_sync_cancel_reg { + pub addr: __u64, + pub fd: __s32, + pub flags: __u32, + pub timeout: __kernel_timespec, + pub opcode: __u8, + pub pad: [__u8; 7usize], + pub pad2: [__u64; 3usize], +} +#[test] +fn bindgen_test_layout_io_uring_sync_cancel_reg() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(io_uring_sync_cancel_reg)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_sync_cancel_reg)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(fd) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(timeout) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).opcode) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(opcode) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(pad) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).pad2) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(io_uring_sync_cancel_reg), + "::", + stringify!(pad2) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_file_index_range { + pub off: __u32, + pub len: __u32, + pub resv: __u64, +} +#[test] +fn bindgen_test_layout_io_uring_file_index_range() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_file_index_range)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(io_uring_file_index_range)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).off) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_file_index_range), + "::", + stringify!(off) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_file_index_range), + "::", + stringify!(len) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).resv) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_file_index_range), + "::", + stringify!(resv) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct io_uring_recvmsg_out { + pub namelen: __u32, + pub controllen: __u32, + pub payloadlen: __u32, + pub flags: __u32, +} +#[test] +fn bindgen_test_layout_io_uring_recvmsg_out() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(io_uring_recvmsg_out)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(io_uring_recvmsg_out)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).namelen) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(io_uring_recvmsg_out), + "::", + stringify!(namelen) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).controllen) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(io_uring_recvmsg_out), + "::", + stringify!(controllen) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).payloadlen) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(io_uring_recvmsg_out), + "::", + stringify!(payloadlen) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(io_uring_recvmsg_out), + "::", + stringify!(flags) + ) + ); +} +pub const SOCKET_URING_OP_SIOCINQ: io_uring_socket_op = 0; +pub const SOCKET_URING_OP_SIOCOUTQ: io_uring_socket_op = 1; +pub const SOCKET_URING_OP_GETSOCKOPT: io_uring_socket_op = 2; +pub const SOCKET_URING_OP_SETSOCKOPT: io_uring_socket_op = 3; +pub type io_uring_socket_op = libc::c_uint; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct futex_waitv { + pub val: __u64, + pub uaddr: __u64, + pub flags: __u32, + pub __reserved: __u32, +} +#[test] +fn bindgen_test_layout_futex_waitv() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(futex_waitv)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(futex_waitv)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(futex_waitv), + "::", + stringify!(val) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).uaddr) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(futex_waitv), + "::", + stringify!(uaddr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(futex_waitv), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(futex_waitv), + "::", + stringify!(__reserved) + ) + ); +} diff --git a/src/types.rs b/src/types.rs index e6179a8..b7a1d41 100644 --- a/src/types.rs +++ b/src/types.rs @@ -88,6 +88,7 @@ bitflags! { /// The default behavior when the timeout expires is to return a CQE with -libc::ETIME in /// the res field. To change this behavior to have zero returned, include /// [`types::TimeoutFlags::ETIME_SUCCESS`]. + #[derive(Debug, Clone, Copy)] pub struct TimeoutFlags: u32 { const ABS = sys::IORING_TIMEOUT_ABS; @@ -103,6 +104,7 @@ bitflags! { bitflags! { /// Options for [`Fsync`](super::Fsync). + #[derive(Debug, Clone, Copy)] pub struct FsyncFlags: u32 { const DATASYNC = sys::IORING_FSYNC_DATASYNC; } @@ -111,6 +113,7 @@ bitflags! { bitflags! { /// Options for [`AsyncCancel`](super::AsyncCancel) and /// [`Submitter::register_sync_cancel`](super::Submitter::register_sync_cancel). + #[derive(Debug, Clone, Copy)] pub(crate) struct AsyncCancelFlags: u32 { /// Cancel all requests that match the given criteria, rather /// than just canceling the first one found. @@ -320,7 +323,7 @@ impl BufRingEntry { /// of the buf_ring for the resv field to even be considered the tail field of the ring. /// The entry must also be properly initialized. pub unsafe fn tail(ring_base: *const BufRingEntry) -> *const u16 { - &(*ring_base).0.resv + std::ptr::addr_of!((*ring_base).0.resv) } }